]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
macosx: fix issue which caused automatic video resizing even if disabled
[vlc] / modules / gui / macosx / intf.h
1 /*****************************************************************************
2  * intf.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2013 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Derk-Jan Hartman <hartman at videolan dot org>
9  *          Felix Paul Kühne <fkuehne at videolan dot org>
10  *          David Fuhrmann <david dot fuhrmann at googlemail dot com>
11  *          Pierre d'Herbemont <pdherbemont # videolan org>
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
72 /*****************************************************************************
73  * VLCMain interface
74  *****************************************************************************/
75 @class AppleRemote;
76 @class VLCInformation;
77 @class VLCEmbeddedWindow;
78 @class VLCControls;
79 @class VLCPlaylist;
80
81 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
82 {
83     intf_thread_t *p_intf;      /* The main intf object */
84     input_thread_t *p_current_input, *p_input_changed;
85     BOOL launched;              /* finishedLaunching */
86     int items_at_launch;        /* items in playlist after launch */
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     IBOutlet VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
109
110     IBOutlet VLCControls * o_controls;     /* VLCControls    */
111     IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
112
113     AppleRemote * o_remote;
114     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
115
116     /* media key support */
117     BOOL b_mediaKeySupport;
118     BOOL b_mediakeyJustJumped;
119     SPMediaKeyTap * o_mediaKeyController;
120
121     NSArray *o_usedHotkeys;
122
123     /* sleep management */
124     IOPMAssertionID systemSleepAssertionID;
125     IOPMAssertionID userActivityAssertionID;
126
127     VLCVoutWindowController *o_vout_controller;
128
129     /* iTunes play/pause support */
130     BOOL b_has_itunes_paused;
131     NSTimer *o_itunes_play_timer;
132
133     BOOL b_playlist_updated_selector_in_queue;
134 }
135
136 @property (readonly) VLCVoutWindowController* voutController;
137 @property (readonly) BOOL nativeFullscreenMode;
138 @property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue;
139 + (VLCMain *)sharedInstance;
140
141 - (intf_thread_t *)intf;
142 - (void)setIntf:(intf_thread_t *)p_mainintf;
143
144 - (id)mainMenu;
145 - (VLCMainWindow *)mainWindow;
146 - (id)controls;
147 - (id)bookmarks;
148 - (id)open;
149 - (id)simplePreferences;
150 - (id)preferences;
151 - (id)playlist;
152 - (id)info;
153 - (id)wizard;
154 - (id)coreDialogProvider;
155 - (id)eyeTVController;
156 - (id)appleRemoteController;
157 - (void)setActiveVideoPlayback:(BOOL)b_value;
158 - (BOOL)activeVideoPlayback;
159 - (void)applicationWillTerminate:(NSNotification *)notification;
160 - (void)updateCurrentlyUsedHotkeys;
161 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
162
163 - (void)PlaylistItemChanged;
164 - (void)informInputChanged;
165 - (void)playbackStatusUpdated;
166 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
167 - (void)playbackModeUpdated;
168 - (void)updateVolume;
169 - (void)updatePlaybackPosition;
170 - (void)updateName;
171 - (void)playlistUpdated;
172 - (void)updateRecordState: (BOOL)b_value;
173 - (void)updateInfoandMetaPanel;
174 - (void)updateMainMenu;
175 - (void)updateMainWindow;
176 - (void)showMainWindow;
177 - (void)showFullscreenController;
178 - (void)updateDelays;
179
180 - (void)updateTogglePlaylistState;
181
182 - (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
183
184 - (void)resetAndReinitializeUserDefaults;
185
186 @end
187
188
189 /*****************************************************************************
190  * VLCApplication interface
191  *****************************************************************************/
192
193 @interface VLCApplication : NSApplication
194
195 @end