]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
Useless #includes
[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  *          David Fuhrmann <david dot fuhrmann at googlemail dot com>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26  *****************************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 #   include "config.h"
30 #endif
31
32 #import <vlc_common.h>
33 #import <vlc_interface.h>
34 #import <vlc_playlist.h>
35 #import <vlc_vout.h>
36 #import <vlc_aout.h>
37 #import <vlc_input.h>
38 #import <vlc_vout_window.h>
39
40 #import <Cocoa/Cocoa.h>
41 #import "CompatibilityFixes.h"
42 #import "SPMediaKeyTap.h"                   /* for the media key support */
43 #import "misc.h"
44 #import "MainWindow.h"
45 #import "VLCVoutWindowController.h"
46 #import "StringUtility.h"
47
48 #import <IOKit/pwr_mgt/IOPMLib.h>           /* for sleep prevention */
49
50 /*****************************************************************************
51  * Local prototypes.
52  *****************************************************************************/
53 #define VLCIntf [[VLCMain sharedInstance] intf]
54
55 // You need to release those objects after use
56 input_thread_t *getInput(void);
57 vout_thread_t *getVout(void);
58 vout_thread_t *getVoutForActiveWindow(void);
59 audio_output_t *getAout(void);
60
61 /*****************************************************************************
62  * intf_sys_t: description and status of the interface
63  *****************************************************************************/
64 struct intf_sys_t
65 {
66     /* menus handlers */
67     bool b_input_update;
68     bool b_aout_update;
69     bool b_vout_update;
70
71     /* The messages window */
72     msg_subscription_t sub;
73 };
74
75 /*****************************************************************************
76  * VLCMain interface
77  *****************************************************************************/
78 @class AppleRemote;
79 @class VLCInformation;
80 @class VLCEmbeddedWindow;
81 @class VLCControls;
82 @class VLCPlaylist;
83
84 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
85 {
86     intf_thread_t *p_intf;      /* The main intf object */
87     input_thread_t *p_current_input, *p_input_changed;
88     id o_mainmenu;              /* VLCMainMenu */
89     id o_prefs;                 /* VLCPrefs       */
90     id o_sprefs;                /* VLCSimplePrefs */
91     id o_open;                  /* VLCOpen        */
92     id o_wizard;                /* VLCWizard      */
93     id o_coredialogs;           /* VLCCoreDialogProvider */
94     id o_info;                  /* VLCInformation */
95     id o_eyetv;                 /* VLCEyeTVController */
96     id o_bookmarks;             /* VLCBookmarks */
97     id o_coreinteraction;       /* VLCCoreInteraction */
98     BOOL nib_main_loaded;       /* main nibfile */
99     BOOL nib_open_loaded;       /* open nibfile */
100     BOOL nib_about_loaded;      /* about nibfile */
101     BOOL nib_wizard_loaded;     /* wizard nibfile */
102     BOOL nib_prefs_loaded;      /* preferences nibfile */
103     BOOL nib_info_loaded;       /* information panel nibfile */
104     BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
105     BOOL nib_bookmarks_loaded;   /* Bookmarks nibfile */
106     BOOL b_active_videoplayback;
107     BOOL b_nativeFullscreenMode;
108
109     VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
110
111     IBOutlet VLCControls * o_controls;     /* VLCControls    */
112     IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
113
114     /* messages panel */
115     IBOutlet NSWindow * o_msgs_panel;           /* messages panel */
116     NSMutableArray * o_msg_arr;                 /* messages array */
117     NSLock * o_msg_lock;                        /* messages lock */
118     BOOL b_msg_arr_changed;                     /* did the array change? */
119     IBOutlet NSButton * o_msgs_crashlog_btn;    /* messages open crashlog */
120     IBOutlet NSButton * o_msgs_save_btn;        /* save the log as rtf */
121     IBOutlet NSButton * o_msgs_refresh_btn;     /* update the panel */
122     IBOutlet id o_msgs_table;
123
124     /* CrashReporter panel */
125     IBOutlet NSButton * o_crashrep_dontSend_btn;
126     IBOutlet NSButton * o_crashrep_send_btn;
127     IBOutlet NSTextView * o_crashrep_fld;
128     IBOutlet NSTextField * o_crashrep_title_txt;
129     IBOutlet NSTextField * o_crashrep_desc_txt;
130     IBOutlet NSWindow * o_crashrep_win;
131     IBOutlet NSButton * o_crashrep_includeEmail_ckb;
132     IBOutlet NSButton * o_crashrep_dontaskagain_ckb;
133     IBOutlet NSTextField * o_crashrep_includeEmail_txt;
134     NSURLConnection * crashLogURLConnection;
135
136     AppleRemote * o_remote;
137     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
138
139     /* media key support */
140     BOOL b_mediaKeySupport;
141     BOOL b_mediakeyJustJumped;
142     SPMediaKeyTap * o_mediaKeyController;
143
144     NSArray *o_usedHotkeys;
145
146     /* sleep management */
147     IOPMAssertionID systemSleepAssertionID;
148     IOPMAssertionID userActivityAssertionID;
149
150     VLCVoutWindowController *o_vout_controller;
151 }
152
153 @property (readonly) VLCVoutWindowController* voutController;
154 @property (readonly) BOOL nativeFullscreenMode;
155
156 + (VLCMain *)sharedInstance;
157
158 - (intf_thread_t *)intf;
159 - (void)setIntf:(intf_thread_t *)p_mainintf;
160
161 - (id)mainMenu;
162 - (VLCMainWindow *)mainWindow;
163 - (id)controls;
164 - (id)bookmarks;
165 - (id)open;
166 - (id)simplePreferences;
167 - (id)preferences;
168 - (id)playlist;
169 - (id)info;
170 - (id)wizard;
171 - (id)coreDialogProvider;
172 - (id)eyeTVController;
173 - (id)appleRemoteController;
174 - (void)setActiveVideoPlayback:(BOOL)b_value;
175 - (BOOL)activeVideoPlayback;
176 - (void)applicationWillTerminate:(NSNotification *)notification;
177 - (void)updateCurrentlyUsedHotkeys;
178 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
179
180 - (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd;
181
182 - (void)PlaylistItemChanged;
183 - (void)playbackStatusUpdated;
184 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
185 - (void)playbackModeUpdated;
186 - (void)updateVolume;
187 - (void)updatePlaybackPosition;
188 - (void)updateName;
189 - (void)playlistUpdated;
190 - (void)updateRecordState: (BOOL)b_value;
191 - (void)updateInfoandMetaPanel;
192 - (void)updateMainMenu;
193 - (void)updateMainWindow;
194 - (void)showMainWindow;
195 - (void)showFullscreenController;
196 - (void)updateDelays;
197 - (void)initStrings;
198
199 - (IBAction)crashReporterAction:(id)sender;
200 - (IBAction)openCrashLog:(id)sender;
201 - (IBAction)saveDebugLog:(id)sender;
202 - (IBAction)showMessagesPanel:(id)sender;
203 - (IBAction)updateMessagesPanel:(id)sender;
204
205 - (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)type withStr: (char *)str;
206
207 - (void)updateTogglePlaylistState;
208
209 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
210
211 - (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
212 @end
213
214
215 /*****************************************************************************
216  * VLCApplication interface
217  *****************************************************************************/
218
219 @interface VLCApplication : NSApplication
220
221 @end