1 /*****************************************************************************
2 * MainWindow.h: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2011 VLC authors and VideoLAN
7 * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8 * Jon Lech Johansen <jon-vl@nanocrew.net>
9 * Christophe Massiot <massiot@via.ecp.fr>
10 * Derk-Jan Hartman <hartman at videolan.org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 #import <Cocoa/Cocoa.h>
28 #import "CompatibilityFixes.h"
29 #import "PXSourceList.h"
34 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate> {
35 IBOutlet id o_play_btn;
36 IBOutlet id o_bwd_btn;
37 IBOutlet id o_fwd_btn;
38 IBOutlet id o_stop_btn;
39 IBOutlet id o_playlist_btn;
40 IBOutlet id o_repeat_btn;
41 IBOutlet id o_shuffle_btn;
42 IBOutlet id o_effects_btn;
43 IBOutlet id o_fullscreen_btn;
44 IBOutlet id o_search_fld;
45 IBOutlet id o_volume_sld;
46 IBOutlet id o_volume_track_view;
47 IBOutlet id o_volume_down_btn;
48 IBOutlet id o_volume_up_btn;
49 IBOutlet id o_time_sld;
50 IBOutlet id o_time_sld_fancygradient_view;
51 IBOutlet id o_time_fld;
52 IBOutlet id o_progress_bar;
53 IBOutlet id o_bottombar_view;
54 IBOutlet id o_time_sld_left_view;
55 IBOutlet id o_time_sld_middle_view;
56 IBOutlet id o_time_sld_right_view;
57 // TODO Playlist table, additional ui stuff at the top of the window
58 IBOutlet id o_playlist_table;
59 IBOutlet id o_video_view;
60 IBOutlet id o_split_view;
61 IBOutlet id o_left_split_view;
62 IBOutlet id o_right_split_view;
63 IBOutlet id o_sidebar_view;
64 IBOutlet id o_chosen_category_lbl;
66 IBOutlet id o_dropzone_view;
67 IBOutlet id o_dropzone_btn;
68 IBOutlet id o_dropzone_lbl;
70 IBOutlet VLCFSPanel *o_fspanel;
71 IBOutlet id o_titlebar_view;
73 BOOL b_dark_interface;
74 BOOL b_nativeFullscreenMode;
75 BOOL b_video_playback_enabled;
76 int i_lastShownVolume;
78 input_state_e cachedInputState;
80 NSImage * o_pause_img;
81 NSImage * o_pause_pressed_img;
83 NSImage * o_play_pressed_img;
84 NSImage * o_repeat_img;
85 NSImage * o_repeat_pressed_img;
86 NSImage * o_repeat_all_img;
87 NSImage * o_repeat_all_pressed_img;
88 NSImage * o_repeat_one_img;
89 NSImage * o_repeat_one_pressed_img;
90 NSImage * o_shuffle_img;
91 NSImage * o_shuffle_pressed_img;
92 NSImage * o_shuffle_on_img;
93 NSImage * o_shuffle_on_pressed_img;
95 NSTimeInterval last_fwd_event;
96 NSTimeInterval last_bwd_event;
97 BOOL just_triggered_next;
98 BOOL just_triggered_previous;
99 NSMutableArray *o_sidebaritems;
101 VLCWindow * o_nonembedded_window;
104 VLCWindow * o_fullscreen_window;
105 NSViewAnimation * o_fullscreen_anim1;
106 NSViewAnimation * o_fullscreen_anim2;
107 NSViewAnimation * o_makekey_anim;
108 NSView * o_temp_view;
109 /* set to yes if we are fullscreen and all animations are over */
111 BOOL b_window_is_invisible;
112 NSRecursiveLock * o_animation_lock;
113 NSSize nativeVideoSize;
115 NSInteger i_originalLevel;
116 NSRect previousSavedFrame;
118 + (VLCMainWindow *)sharedInstance;
120 - (IBAction)play:(id)sender;
121 - (IBAction)bwd:(id)sender;
122 - (IBAction)fwd:(id)sender;
123 - (IBAction)stop:(id)sender;
124 - (IBAction)togglePlaylist:(id)sender;
125 - (IBAction)repeat:(id)sender;
126 - (IBAction)shuffle:(id)sender;
127 - (IBAction)timeSliderAction:(id)sender;
128 - (IBAction)volumeAction:(id)sender;
129 - (IBAction)effects:(id)sender;
130 - (IBAction)fullscreen:(id)sender;
131 - (IBAction)dropzoneButtonAction:(id)sender;
133 - (void)setTitle:(NSString *)title;
134 - (void) customZoom: (id)sender;
136 - (void)showDropZone;
137 - (void)hideDropZone;
138 - (void)updateTimeSlider;
139 - (void)updateVolumeSlider;
140 - (void)updateWindow;
144 - (void)setRepeatOne;
145 - (void)setRepeatAll;
146 - (void)setRepeatOff;
149 - (void)drawFancyGradientEffectForTimeSlider;
152 - (void)setVideoplayEnabled;
153 - (void)resizeWindow;
154 - (void)setNativeVideoSize:(NSSize)size;
156 /* fullscreen handling */
157 - (void)showFullscreenController;
158 - (BOOL)isFullscreen;
159 - (void)lockFullscreenAnimation;
160 - (void)unlockFullscreenAnimation;
161 - (void)enterFullscreen;
162 - (void)leaveFullscreen;
163 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
164 - (void)hasEndedFullscreen;
165 - (void)hasBecomeFullscreen;
166 - (void)setFrameOnMainThread:(NSData*)packedargs;
168 /* lion's native fullscreen handling */
169 - (void)windowWillEnterFullScreen:(NSNotification *)notification;
170 - (void)windowWillExitFullScreen:(NSNotification *)notification;
174 @interface VLCProgressBarGradientEffect : NSView {
175 NSImage * o_time_sld_gradient_left_img;
176 NSImage * o_time_sld_gradient_middle_img;
177 NSImage * o_time_sld_gradient_right_img;
179 - (void)loadImagesInDarkStyle:(BOOL)b_value;