]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
macosx: Fix drawing issues with podcast controls and dropzone
[vlc] / modules / gui / macosx / intf.h
1 /*****************************************************************************
2  * intf.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2014 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 "SPMediaKeyTap.h"                   /* for the media key support */
42 #import "misc.h"
43 #import "MainWindow.h"
44 #import "VLCVoutWindowController.h"
45 #import "StringUtility.h"
46
47 #import <IOKit/pwr_mgt/IOPMLib.h>           /* for sleep prevention */
48
49 /*****************************************************************************
50  * Local prototypes.
51  *****************************************************************************/
52 #define VLCIntf [[VLCMain sharedInstance] intf]
53
54 // You need to release those objects after use
55 input_thread_t *getInput(void);
56 vout_thread_t *getVout(void);
57 vout_thread_t *getVoutForActiveWindow(void);
58 audio_output_t *getAout(void);
59
60 static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
61
62 /*****************************************************************************
63  * VLCMain interface
64  *****************************************************************************/
65 @class AppleRemote;
66 @class VLCControls;
67 @class VLCPlaylist;
68
69 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
70 {
71     intf_thread_t *p_intf;      /* The main intf object */
72     input_thread_t *p_current_input;
73     BOOL launched;              /* finishedLaunching */
74     int items_at_launch;        /* items in playlist after launch */
75     id o_mainmenu;              /* VLCMainMenu */
76     id o_prefs;                 /* VLCPrefs       */
77     id o_sprefs;                /* VLCSimplePrefs */
78     id o_open;                  /* VLCOpen        */
79     id o_wizard;                /* VLCWizard      */
80     id o_coredialogs;           /* VLCCoreDialogProvider */
81     id o_info;                  /* VLCInformation */
82     id o_eyetv;                 /* VLCEyeTVController */
83     id o_bookmarks;             /* VLCBookmarks */
84     id o_coreinteraction;       /* VLCCoreInteraction */
85     BOOL nib_main_loaded;       /* main nibfile */
86     BOOL nib_open_loaded;       /* open nibfile */
87     BOOL nib_about_loaded;      /* about nibfile */
88     BOOL nib_wizard_loaded;     /* wizard nibfile */
89     BOOL nib_prefs_loaded;      /* preferences nibfile */
90     BOOL nib_info_loaded;       /* information panel nibfile */
91     BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
92     BOOL nib_bookmarks_loaded;   /* Bookmarks nibfile */
93     BOOL b_active_videoplayback;
94     BOOL b_nativeFullscreenMode;
95
96     IBOutlet VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
97
98     IBOutlet VLCControls * o_controls;     /* VLCControls    */
99     IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
100
101     AppleRemote * o_remote;
102     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
103
104     /* media key support */
105     BOOL b_mediaKeySupport;
106     BOOL b_mediakeyJustJumped;
107     SPMediaKeyTap * o_mediaKeyController;
108
109     NSArray *o_usedHotkeys;
110
111     /* sleep management */
112     IOPMAssertionID systemSleepAssertionID;
113     IOPMAssertionID userActivityAssertionID;
114
115     VLCVoutWindowController *o_vout_controller;
116
117     /* iTunes/Spotify play/pause support */
118     BOOL b_has_itunes_paused;
119     BOOL b_has_spotify_paused;
120     NSTimer *o_itunes_play_timer;
121
122     BOOL b_playlist_updated_selector_in_queue;
123
124     dispatch_queue_t informInputChangedQueue;
125 }
126
127 @property (readonly) VLCVoutWindowController* voutController;
128 @property (readonly) BOOL nativeFullscreenMode;
129 @property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue;
130 + (VLCMain *)sharedInstance;
131
132 - (intf_thread_t *)intf;
133 - (void)setIntf:(intf_thread_t *)p_mainintf;
134
135 - (id)mainMenu;
136 - (VLCMainWindow *)mainWindow;
137 - (id)controls;
138 - (id)bookmarks;
139 - (id)open;
140 - (id)simplePreferences;
141 - (id)preferences;
142 - (id)playlist;
143 - (id)info;
144 - (id)wizard;
145 - (id)coreDialogProvider;
146 - (id)eyeTVController;
147 - (id)appleRemoteController;
148 - (void)setActiveVideoPlayback:(BOOL)b_value;
149 - (BOOL)activeVideoPlayback;
150 - (void)applicationWillTerminate:(NSNotification *)notification;
151 - (void)updateCurrentlyUsedHotkeys;
152 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
153
154 - (void)PlaylistItemChanged;
155 - (void)playbackStatusUpdated;
156 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
157 - (void)playbackModeUpdated;
158 - (void)updateVolume;
159 - (void)updatePlaybackPosition;
160 - (void)updateName;
161 - (void)playlistUpdated;
162 - (void)updateRecordState: (BOOL)b_value;
163 - (void)updateInfoandMetaPanel;
164 - (void)updateMainMenu;
165 - (void)updateMainWindow;
166 - (void)showMainWindow;
167 - (void)showFullscreenController;
168 - (void)updateDelays;
169
170 - (void)updateTogglePlaylistState;
171
172 - (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
173
174 - (void)resetAndReinitializeUserDefaults;
175
176 - (BOOL)isTerminating;
177
178 @end
179
180
181 /*****************************************************************************
182  * VLCApplication interface
183  *****************************************************************************/
184
185 @interface VLCApplication : NSApplication
186
187 @end