]> git.sesse.net Git - vlc/blob - modules/gui/macosx/MainWindow.h
macosx: save the expanded/collapsed state of the sidebar items (close #6389)
[vlc] / modules / gui / macosx / MainWindow.h
1 /*****************************************************************************
2  * MainWindow.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2012 VLC authors and VideoLAN
5  * $Id$
6  *
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>
11  *
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.
16  *
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.
21  *
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  *****************************************************************************/
26
27 #import <Cocoa/Cocoa.h>
28 #import "CompatibilityFixes.h"
29 #import "PXSourceList.h"
30 #import "PXSourceListDataSource.h"
31 #import <vlc_input.h>
32 #import "misc.h"
33 #import "fspanel.h"
34 #import "MainWindowTitle.h"
35
36 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate, NSSplitViewDelegate> {
37     IBOutlet id o_play_btn;
38     IBOutlet id o_bwd_btn;
39     IBOutlet id o_fwd_btn;
40     IBOutlet id o_stop_btn;
41     IBOutlet id o_playlist_btn;
42     IBOutlet id o_repeat_btn;
43     IBOutlet id o_shuffle_btn;
44     IBOutlet id o_effects_btn;
45     IBOutlet id o_fullscreen_btn;
46     IBOutlet id o_search_fld;
47     IBOutlet id o_topbar_view;
48     IBOutlet id o_volume_sld;
49     IBOutlet id o_volume_track_view;
50     IBOutlet id o_volume_down_btn;
51     IBOutlet id o_volume_up_btn;
52     IBOutlet id o_time_sld;
53     IBOutlet id o_time_sld_fancygradient_view;
54     IBOutlet id o_time_fld;
55     IBOutlet id o_progress_bar;
56     IBOutlet id o_bottombar_view;
57     IBOutlet id o_time_sld_background;
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_sidebar_scrollview;
65     IBOutlet id o_chosen_category_lbl;
66
67     IBOutlet id o_dropzone_view;
68     IBOutlet id o_dropzone_btn;
69     IBOutlet id o_dropzone_lbl;
70     IBOutlet id o_dropzone_box;
71
72     IBOutlet VLCFSPanel *o_fspanel;
73     IBOutlet id o_titlebar_view;
74     IBOutlet id o_resize_view;
75     IBOutlet id o_detached_resize_view;
76
77     IBOutlet id o_detached_play_btn;
78     IBOutlet id o_detached_fwd_btn;
79     IBOutlet id o_detached_bwd_btn;
80     IBOutlet id o_detached_fullscreen_btn;
81     IBOutlet id o_detached_time_fld;
82     IBOutlet id o_detached_time_sld;
83     IBOutlet id o_detached_time_sld_background;
84     IBOutlet id o_detached_progress_bar;
85     IBOutlet id o_detached_time_sld_fancygradient_view;
86     IBOutlet id o_detached_bottombar_view;
87     IBOutlet id o_detached_titlebar_view;
88     IBOutlet id o_detached_video_window;
89
90     BOOL b_dark_interface;
91     BOOL b_nativeFullscreenMode;
92     BOOL b_video_playback_enabled;
93     BOOL b_dropzone_active;
94     BOOL b_splitview_removed;
95     BOOL b_minimized_view;
96     int i_lastSplitViewHeight;
97     int i_lastShownVolume;
98     input_state_e cachedInputState;
99
100     NSImage * o_pause_img;
101     NSImage * o_pause_pressed_img;
102     NSImage * o_play_img;
103     NSImage * o_play_pressed_img;
104     NSImage * o_repeat_img;
105     NSImage * o_repeat_pressed_img;
106     NSImage * o_repeat_all_img;
107     NSImage * o_repeat_all_pressed_img;
108     NSImage * o_repeat_one_img;
109     NSImage * o_repeat_one_pressed_img;
110     NSImage * o_shuffle_img;
111     NSImage * o_shuffle_pressed_img;
112     NSImage * o_shuffle_on_img;
113     NSImage * o_shuffle_on_pressed_img;
114
115     NSTimeInterval last_fwd_event;
116     NSTimeInterval last_bwd_event;
117     BOOL just_triggered_next;
118     BOOL just_triggered_previous;
119     NSMutableArray *o_sidebaritems;
120
121     BOOL              b_nonembedded;
122
123     VLCWindow       * o_fullscreen_window;
124     NSViewAnimation * o_fullscreen_anim1;
125     NSViewAnimation * o_fullscreen_anim2;
126     NSViewAnimation * o_makekey_anim;
127     NSView          * o_temp_view;
128     /* set to yes if we are fullscreen and all animations are over */
129     BOOL              b_fullscreen;
130     BOOL              b_window_is_invisible;
131     NSRecursiveLock * o_animation_lock;
132     NSSize nativeVideoSize;
133
134     NSTimer *t_hide_mouse_timer;
135
136     VLCColorView * o_color_backdrop;
137     NSInteger i_originalLevel;
138     NSRect previousSavedFrame;
139 }
140 + (VLCMainWindow *)sharedInstance;
141
142 - (IBAction)play:(id)sender;
143 - (IBAction)bwd:(id)sender;
144 - (IBAction)fwd:(id)sender;
145 - (IBAction)stop:(id)sender;
146 - (IBAction)togglePlaylist:(id)sender;
147 - (IBAction)repeat:(id)sender;
148 - (IBAction)shuffle:(id)sender;
149 - (IBAction)timeSliderAction:(id)sender;
150 - (IBAction)volumeAction:(id)sender;
151 - (IBAction)effects:(id)sender;
152 - (IBAction)fullscreen:(id)sender;
153 - (IBAction)dropzoneButtonAction:(id)sender;
154
155 - (void)setTitle:(NSString *)title;
156 - (void) customZoom:(id)sender;
157 - (void)windowResizedOrMoved:(NSNotification *)notification;
158
159 - (void)showDropZone;
160 - (void)hideDropZone;
161 - (void)showSplitView;
162 - (void)hideSplitView;
163 - (void)updateTimeSlider;
164 - (void)updateVolumeSlider;
165 - (void)updateWindow;
166 - (void)updateName;
167 - (void)setPause;
168 - (void)setPlay;
169 - (void)setRepeatOne;
170 - (void)setRepeatAll;
171 - (void)setRepeatOff;
172 - (void)setShuffle;
173
174 - (void)drawFancyGradientEffectForTimeSlider;
175
176 - (id)videoView;
177 - (id)setupVideoView;
178 - (void)setVideoplayEnabled;
179 - (void)resizeWindow;
180 - (void)setNativeVideoSize:(NSSize)size;
181
182 - (void)hideMouseCursor:(NSTimer *)timer;
183 - (void)recreateHideMouseTimer;
184
185 /* fullscreen handling */
186 - (void)showFullscreenController;
187 - (BOOL)isFullscreen;
188 - (void)updateFullscreen;
189 - (void)lockFullscreenAnimation;
190 - (void)unlockFullscreenAnimation;
191 - (void)enterFullscreen;
192 - (void)leaveFullscreen;
193 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
194 - (void)hasEndedFullscreen;
195 - (void)hasBecomeFullscreen;
196
197 /* lion's native fullscreen handling */
198 - (void)windowWillEnterFullScreen:(NSNotification *)notification;
199 - (void)windowWillExitFullScreen:(NSNotification *)notification;
200
201 @end
202
203 @interface VLCDetachedVideoWindow : NSWindow
204 {
205     BOOL b_dark_interface;
206     NSRect previousSavedFrame;
207 }
208
209 - (BOOL)isFullscreen;
210 - (void)updateFullscreen;
211 - (void)customZoom:(id)sender;
212
213 @end