]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
macosx: video effects panel: synchronize text field and stepper values properly by...
[vlc] / modules / gui / macosx / intf.h
1 /*****************************************************************************
2  * intf.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2012 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Christophe Massiot <massiot@via.ecp.fr>
9  *          Derk-Jan Hartman <hartman at videolan dot org>
10  *          Felix Paul Kühne <fkuehne at videolan dot 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 #ifdef HAVE_CONFIG_H
28 #   include "config.h"
29 #endif
30
31 #import <vlc_common.h>
32 #import <vlc_interface.h>
33 #import <vlc_playlist.h>
34 #import <vlc_vout.h>
35 #import <vlc_aout.h>
36 #import <vlc_input.h>
37 #import <vlc_vout_window.h>
38
39 #import <Cocoa/Cocoa.h>
40 #import "CompatibilityFixes.h"
41 #import "SPMediaKeyTap.h"                   /* for the media key support */
42 #import "misc.h"
43 #import "MainWindow.h"
44 #import "StringUtility.h"
45
46 #import <IOKit/pwr_mgt/IOPMLib.h>           /* for sleep prevention */
47
48 /*****************************************************************************
49  * Local prototypes.
50  *****************************************************************************/
51 #define VLCIntf [[VLCMain sharedInstance] intf]
52
53 // You need to release those objects after use
54 input_thread_t *getInput(void);
55 vout_thread_t *getVout(void);
56 vout_thread_t *getVoutForActiveWindow(void);
57 audio_output_t *getAout(void);
58
59 /*****************************************************************************
60  * intf_sys_t: description and status of the interface
61  *****************************************************************************/
62 struct intf_sys_t
63 {
64     /* menus handlers */
65     bool b_input_update;
66     bool b_aout_update;
67     bool b_vout_update;
68
69     /* The messages window */
70     msg_subscription_t sub;
71 };
72
73 /*****************************************************************************
74  * VLCMain interface
75  *****************************************************************************/
76 @class AppleRemote;
77 @class VLCInformation;
78 @class VLCEmbeddedWindow;
79 @class VLCControls;
80 @class VLCPlaylist;
81 @class VLCVoutWindowController;
82
83 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
84 {
85     intf_thread_t *p_intf;      /* The main intf object */
86     input_thread_t *p_current_input;
87     id o_mainmenu;              /* VLCMainMenu */
88     id o_prefs;                 /* VLCPrefs       */
89     id o_sprefs;                /* VLCSimplePrefs */
90     id o_open;                  /* VLCOpen        */
91     id o_wizard;                /* VLCWizard      */
92     id o_coredialogs;           /* VLCCoreDialogProvider */
93     id o_info;                  /* VLCInformation */
94     id o_eyetv;                 /* VLCEyeTVController */
95     id o_bookmarks;             /* VLCBookmarks */
96     id o_coreinteraction;       /* VLCCoreInteraction */
97     BOOL nib_main_loaded;       /* main nibfile */
98     BOOL nib_open_loaded;       /* open nibfile */
99     BOOL nib_about_loaded;      /* about nibfile */
100     BOOL nib_wizard_loaded;     /* wizard nibfile */
101     BOOL nib_prefs_loaded;      /* preferences nibfile */
102     BOOL nib_info_loaded;       /* information panel nibfile */
103     BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
104     BOOL nib_bookmarks_loaded;   /* Bookmarks nibfile */
105     BOOL b_active_videoplayback;
106     BOOL b_nativeFullscreenMode;
107
108     VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
109
110     IBOutlet VLCControls * o_controls;     /* VLCControls    */
111     IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
112
113     /* messages panel */
114     IBOutlet NSWindow * o_msgs_panel;           /* messages panel */
115     NSMutableArray * o_msg_arr;                 /* messages array */
116     NSLock * o_msg_lock;                        /* messages lock */
117     BOOL b_msg_arr_changed;                     /* did the array change? */
118     IBOutlet NSButton * o_msgs_crashlog_btn;    /* messages open crashlog */
119     IBOutlet NSButton * o_msgs_save_btn;        /* save the log as rtf */
120     IBOutlet NSButton * o_msgs_refresh_btn;     /* update the panel */
121     IBOutlet id o_msgs_table;
122
123     /* CrashReporter panel */
124     IBOutlet NSButton * o_crashrep_dontSend_btn;
125     IBOutlet NSButton * o_crashrep_send_btn;
126     IBOutlet NSTextView * o_crashrep_fld;
127     IBOutlet NSTextField * o_crashrep_title_txt;
128     IBOutlet NSTextField * o_crashrep_desc_txt;
129     IBOutlet NSWindow * o_crashrep_win;
130     IBOutlet NSButton * o_crashrep_includeEmail_ckb;
131     IBOutlet NSButton * o_crashrep_dontaskagain_ckb;
132     IBOutlet NSTextField * o_crashrep_includeEmail_txt;
133     NSURLConnection * crashLogURLConnection;
134
135     AppleRemote * o_remote;
136     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
137
138     /* media key support */
139     BOOL b_mediaKeySupport;
140     BOOL b_mediakeyJustJumped;
141     SPMediaKeyTap * o_mediaKeyController;
142
143     NSArray *o_usedHotkeys;
144
145     /* sleep management */
146     IOPMAssertionID systemSleepAssertionID;
147
148     VLCVoutWindowController *o_vout_controller;
149 }
150
151 @property (readonly) VLCVoutWindowController* voutController;
152 @property (readonly) BOOL nativeFullscreenMode;
153
154 + (VLCMain *)sharedInstance;
155
156 - (intf_thread_t *)intf;
157 - (void)setIntf:(intf_thread_t *)p_mainintf;
158
159 - (id)mainMenu;
160 - (VLCMainWindow *)mainWindow;
161 - (id)controls;
162 - (id)bookmarks;
163 - (id)open;
164 - (id)simplePreferences;
165 - (id)preferences;
166 - (id)playlist;
167 - (id)info;
168 - (id)wizard;
169 - (id)coreDialogProvider;
170 - (id)eyeTVController;
171 - (id)appleRemoteController;
172 - (void)setActiveVideoPlayback:(BOOL)b_value;
173 - (BOOL)activeVideoPlayback;
174 - (void)applicationWillTerminate:(NSNotification *)notification;
175 - (void)updateCurrentlyUsedHotkeys;
176 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
177
178 - (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd;
179
180 - (void)PlaylistItemChanged;
181 - (void)playbackStatusUpdated;
182 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
183 - (void)playbackModeUpdated;
184 - (void)updateVolume;
185 - (void)updatePlaybackPosition;
186 - (void)updateName;
187 - (void)playlistUpdated;
188 - (void)updateRecordState: (BOOL)b_value;
189 - (void)updateInfoandMetaPanel;
190 - (void)updateMainMenu;
191 - (void)updateMainWindow;
192 - (void)showMainWindow;
193 - (void)showFullscreenController;
194 - (void)updateDelays;
195 - (void)initStrings;
196
197 - (IBAction)crashReporterAction:(id)sender;
198 - (IBAction)openCrashLog:(id)sender;
199 - (IBAction)saveDebugLog:(id)sender;
200 - (IBAction)showMessagesPanel:(id)sender;
201 - (IBAction)updateMessagesPanel:(id)sender;
202
203 - (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)type withStr: (char *)str;
204
205 - (void)updateTogglePlaylistState;
206
207 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
208
209 - (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
210 @end
211
212
213 /*****************************************************************************
214  * VLCApplication interface
215  *****************************************************************************/
216
217 @interface VLCApplication : NSApplication
218
219 @end