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, NSSplitViewDelegate> {
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_background;
55 IBOutlet id o_playlist_table;
56 IBOutlet id o_video_view;
57 IBOutlet id o_split_view;
58 IBOutlet id o_left_split_view;
59 IBOutlet id o_right_split_view;
60 IBOutlet id o_sidebar_view;
61 IBOutlet id o_chosen_category_lbl;
63 IBOutlet id o_dropzone_view;
64 IBOutlet id o_dropzone_btn;
65 IBOutlet id o_dropzone_lbl;
67 IBOutlet VLCFSPanel *o_fspanel;
68 IBOutlet id o_titlebar_view;
69 IBOutlet id o_resize_view;
71 BOOL b_dark_interface;
72 BOOL b_nativeFullscreenMode;
73 BOOL b_video_playback_enabled;
74 int i_lastShownVolume;
76 input_state_e cachedInputState;
78 NSImage * o_pause_img;
79 NSImage * o_pause_pressed_img;
81 NSImage * o_play_pressed_img;
82 NSImage * o_repeat_img;
83 NSImage * o_repeat_pressed_img;
84 NSImage * o_repeat_all_img;
85 NSImage * o_repeat_all_pressed_img;
86 NSImage * o_repeat_one_img;
87 NSImage * o_repeat_one_pressed_img;
88 NSImage * o_shuffle_img;
89 NSImage * o_shuffle_pressed_img;
90 NSImage * o_shuffle_on_img;
91 NSImage * o_shuffle_on_pressed_img;
93 NSTimeInterval last_fwd_event;
94 NSTimeInterval last_bwd_event;
95 BOOL just_triggered_next;
96 BOOL just_triggered_previous;
97 NSMutableArray *o_sidebaritems;
99 VLCWindow * o_nonembedded_window;
102 VLCWindow * o_fullscreen_window;
103 NSViewAnimation * o_fullscreen_anim1;
104 NSViewAnimation * o_fullscreen_anim2;
105 NSViewAnimation * o_makekey_anim;
106 NSView * o_temp_view;
107 /* set to yes if we are fullscreen and all animations are over */
109 BOOL b_window_is_invisible;
110 NSRecursiveLock * o_animation_lock;
111 NSSize nativeVideoSize;
113 NSTimer *t_hide_mouse_timer;
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;
135 - (void)windowResizedOrMoved:(NSNotification *)notification;
137 - (void)showDropZone;
138 - (void)hideDropZone;
139 - (void)updateTimeSlider;
140 - (void)updateVolumeSlider;
141 - (void)updateWindow;
145 - (void)setRepeatOne;
146 - (void)setRepeatAll;
147 - (void)setRepeatOff;
150 - (void)drawFancyGradientEffectForTimeSlider;
153 - (void)setVideoplayEnabled;
154 - (void)resizeWindow;
155 - (void)setNativeVideoSize:(NSSize)size;
157 - (void)hideMouseCursor:(NSTimer *)timer;
158 - (void)recreateHideMouseTimer;
160 /* fullscreen handling */
161 - (void)showFullscreenController;
162 - (BOOL)isFullscreen;
163 - (void)lockFullscreenAnimation;
164 - (void)unlockFullscreenAnimation;
165 - (void)enterFullscreen;
166 - (void)leaveFullscreen;
167 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
168 - (void)hasEndedFullscreen;
169 - (void)hasBecomeFullscreen;
170 - (void)setFrameOnMainThread:(NSData*)packedargs;
172 /* lion's native fullscreen handling */
173 - (void)windowWillEnterFullScreen:(NSNotification *)notification;
174 - (void)windowWillExitFullScreen:(NSNotification *)notification;