]> git.sesse.net Git - vlc/blob - modules/gui/macosx/MainWindow.h
macosx: show the playlist size as a badge in the sidebar and fixed an appearance...
[vlc] / modules / gui / macosx / MainWindow.h
1 /*****************************************************************************
2  * MainWindow.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2011 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 <vlc_input.h>
31 #import "misc.h"
32 #import "fspanel.h"
33
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;
65
66     IBOutlet id o_dropzone_view;
67     IBOutlet id o_dropzone_btn;
68     IBOutlet id o_dropzone_lbl;
69
70     IBOutlet VLCFSPanel *o_fspanel;
71
72     BOOL b_dark_interface;
73     BOOL b_video_playback_enabled;
74     int i_lastShownVolume;
75     BOOL b_mute;
76     input_state_e cachedInputState;
77
78     NSImage * o_pause_img;
79     NSImage * o_pause_pressed_img;
80     NSImage * o_play_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;
92
93     NSTimeInterval last_fwd_event;
94     NSTimeInterval last_bwd_event;
95     BOOL just_triggered_next;
96     BOOL just_triggered_previous;
97     NSMutableArray *o_sidebaritems;
98
99     VLCWindow       * o_nonembedded_window;
100     BOOL              b_nonembedded;
101
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 */
108     BOOL              b_fullscreen;
109     BOOL              b_window_is_invisible;
110     NSRecursiveLock * o_animation_lock;
111     NSSize nativeVideoSize;
112
113     NSInteger i_originalLevel;
114 }
115 + (VLCMainWindow *)sharedInstance;
116
117 - (IBAction)play:(id)sender;
118 - (IBAction)bwd:(id)sender;
119 - (IBAction)fwd:(id)sender;
120 - (IBAction)stop:(id)sender;
121 - (IBAction)togglePlaylist:(id)sender;
122 - (IBAction)repeat:(id)sender;
123 - (IBAction)shuffle:(id)sender;
124 - (IBAction)timeSliderAction:(id)sender;
125 - (IBAction)volumeAction:(id)sender;
126 - (IBAction)effects:(id)sender;
127 - (IBAction)fullscreen:(id)sender;
128 - (IBAction)dropzoneButtonAction:(id)sender;
129
130 - (void)showDropZone;
131 - (void)hideDropZone;
132 - (void)updateTimeSlider;
133 - (void)updateVolumeSlider;
134 - (void)updateWindow;
135 - (void)updateName;
136 - (void)setPause;
137 - (void)setPlay;
138 - (void)setRepeatOne;
139 - (void)setRepeatAll;
140 - (void)setRepeatOff;
141 - (void)setShuffle;
142
143 - (void)drawFancyGradientEffectForTimeSlider;
144
145 - (id)videoView;
146 - (void)setVideoplayEnabled;
147 - (void)resizeWindow;
148 - (void)setNativeVideoSize:(NSSize)size;
149
150 /* fullscreen handling */
151 - (void)showFullscreenController;
152 - (BOOL)isFullscreen;
153 - (void)lockFullscreenAnimation;
154 - (void)unlockFullscreenAnimation;
155 - (void)enterFullscreen;
156 - (void)leaveFullscreen;
157 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
158 - (void)hasEndedFullscreen;
159 - (void)hasBecomeFullscreen;
160 - (void)setFrameOnMainThread:(NSData*)packedargs;
161
162 @end
163
164 @interface VLCProgressBarGradientEffect : NSView {
165     NSImage * o_time_sld_gradient_left_img;
166     NSImage * o_time_sld_gradient_middle_img;
167     NSImage * o_time_sld_gradient_right_img;
168 }
169 - (void)loadImagesInDarkStyle:(BOOL)b_value;
170 @end
171