[vlc-commits] macosx/main: trim public interface and remove pseudo-global includes

Felix Paul Kühne git at videolan.org
Tue May 7 12:38:09 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Tue May  7 12:37:18 2019 +0200| [a5e053f12777086ac64843f435d4c350b1cb097c] | committer: Felix Paul Kühne

macosx/main: trim public interface and remove pseudo-global includes

This reduces the amount of unexpected magic behavior throughout the interface.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5e053f12777086ac64843f435d4c350b1cb097c
---

 .../macosx/coreinteraction/VLCHotkeysController.m  |  1 +
 modules/gui/macosx/library/VLCLibraryWindow.m      |  1 +
 modules/gui/macosx/main/VLCMain.h                  | 78 ++++++-----------
 modules/gui/macosx/main/VLCMain.m                  | 99 ++++++++++------------
 modules/gui/macosx/menus/VLCMainMenu.m             |  5 +-
 .../gui/macosx/os-integration/VLCClickerManager.h  |  3 +
 .../gui/macosx/os-integration/VLCClickerManager.m  |  3 +
 .../panels/VLCAudioEffectsWindowController.m       |  1 +
 .../macosx/panels/VLCBookmarksWindowController.m   |  7 +-
 .../macosx/panels/VLCInformationWindowController.m |  2 +
 .../VLCTrackSynchronizationWindowController.m      |  2 +
 .../panels/VLCVideoEffectsWindowController.m       |  6 +-
 .../macosx/panels/dialogs/VLCCoreDialogProvider.m  |  1 +
 .../panels/dialogs/VLCResumeDialogController.m     |  2 +-
 .../playlist/VLCPlaybackContinuityController.m     |  1 +
 modules/gui/macosx/playlist/VLCPlayerController.m  |  1 +
 .../gui/macosx/playlist/VLCPlaylistController.m    |  1 +
 .../macosx/playlist/VLCPlaylistMenuController.m    |  1 +
 .../macosx/preferences/VLCSimplePrefsController.m  |  4 +-
 modules/gui/macosx/preferences/prefs.m             | 13 +--
 .../gui/macosx/windows/VLCAboutWindowController.m  |  1 +
 .../gui/macosx/windows/VLCErrorWindowController.m  |  1 -
 .../gui/macosx/windows/VLCHelpWindowController.m   |  1 +
 .../gui/macosx/windows/VLCOpenWindowController.m   |  3 +-
 .../windows/addons/VLCAddonsWindowController.m     |  1 +
 .../VLCConvertAndSaveWindowController.m            |  2 +
 .../gui/macosx/windows/convertandsave/VLCOutput.m  |  1 +
 .../extensions/VLCExtensionsDialogProvider.m       |  1 +
 .../windows/extensions/VLCExtensionsManager.m      |  2 +-
 .../windows/logging/VLCLogWindowController.m       |  1 +
 .../windows/mainwindow/VLCMainWindowControlsBar.m  |  1 +
 .../macosx/windows/video/VLCFSPanelController.m    |  1 +
 .../macosx/windows/video/VLCVideoOutputProvider.m  |  6 +-
 .../macosx/windows/video/VLCVideoWindowCommon.m    |  4 +-
 modules/gui/macosx/windows/video/VLCVoutView.m     |  2 +-
 35 files changed, 127 insertions(+), 133 deletions(-)

diff --git a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
index 9914954752..43a7e6080f 100644
--- a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
+++ b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m
@@ -25,6 +25,7 @@
 #import "VLCHotkeysController.h"
 
 #import "main/VLCMain.h"
+#import "extensions/NSString+Helpers.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
 
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m
index c3ba1d461b..baf282b4d5 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.m
+++ b/modules/gui/macosx/library/VLCLibraryWindow.m
@@ -43,6 +43,7 @@
 #import "windows/mainwindow/VLCControlsBarCommon.h"
 #import "windows/video/VLCFSPanelController.h"
 #import "windows/video/VLCVoutView.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 static const float f_min_window_width = 604.;
 static const float f_min_window_height = 307.;
diff --git a/modules/gui/macosx/main/VLCMain.h b/modules/gui/macosx/main/VLCMain.h
index 7aa74ca1f8..77dbc82054 100644
--- a/modules/gui/macosx/main/VLCMain.h
+++ b/modules/gui/macosx/main/VLCMain.h
@@ -31,16 +31,6 @@
 
 #import <vlc_common.h>
 #import <vlc_interface.h>
-#import <vlc_vout.h>
-#import <vlc_aout.h>
-#import <vlc_input.h>
-#import <vlc_vout_window.h>
-#import <stdatomic.h>
-
-#import "extensions/misc.h"
-#import "extensions/NSString+Helpers.h"
-#import "menus/VLCStatusBarIcon.h"
-#import "windows/video/VLCVideoOutputProvider.h"
 
 /*****************************************************************************
  * Local prototypes.
@@ -48,15 +38,12 @@
 
 intf_thread_t *getIntf(void);
 
-static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-static NSString * VLCConfigurationChangedNotification = @"VLCConfigurationChangedNotification";
-static NSString * VLCMediaKeySupportSettingChangedNotification = @"VLCMediaKeySupportSettingChangedNotification";
-static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSettingChangedNotification";
+extern NSString *VLCConfigurationChangedNotification;
 
 /*****************************************************************************
  * VLCMain interface
  *****************************************************************************/
- at class AppleRemote;
+ at class VLCExtensionsManager;
 @class VLCInformationWindowController;
 @class VLCMainMenu;
 @class VLCResumeDialogController;
@@ -72,50 +59,35 @@ static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSet
 @class VLCAudioEffectsWindowController;
 @class VLCVideoEffectsWindowController;
 @class VLCConvertAndSaveWindowController;
- at class VLCExtensionsManager;
- at class VLCStatusBarIcon;
 @class VLCLibraryController;
 @class VLCPlaylistController;
- at class VLCHotkeysController;
-
- at interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
+ at class VLCVideoOutputProvider;
 
- at property (readonly) VLCVideoOutputProvider* voutProvider;
- at property (readonly) BOOL nativeFullscreenMode;
- at property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue;
- at property (readonly) VLCLibraryWindowController *libraryWindowController;
- at property (readonly) VLCLibraryController *libraryController;
- at property (readonly) VLCPlaylistController *playlistController;
- at property (readonly) VLCHotkeysController *hotkeysController;
+ at interface VLCMain : NSObject
 
 + (VLCMain *)sharedInstance;
-+ (void)killInstance;
-
-- (VLCMainMenu *)mainMenu;
-- (VLCLibraryWindow *)libraryWindow;
-- (VLCBookmarksWindowController *)bookmarks;
-- (VLCOpenWindowController *)open;
-- (VLCSimplePrefsController *)simplePreferences;
-- (VLCPrefs *)preferences;
-- (VLCCoreDialogProvider *)coreDialogProvider;
-- (VLCResumeDialogController *)resumeDialog;
-- (VLCExtensionsManager *)extensionsManager;
-- (VLCStatusBarIcon *)statusBarIcon;
 
-- (VLCLogWindowController *)debugMsgPanel;
+ at property (readwrite) BOOL activeVideoPlayback;
+ at property (readonly) BOOL isTerminating;
 
-- (VLCTrackSynchronizationWindowController *)trackSyncPanel;
-- (VLCAudioEffectsWindowController *)audioEffectsPanel;
-- (VLCVideoEffectsWindowController *)videoEffectsPanel;
-
-- (VLCInformationWindowController *)currentMediaInfoPanel;
-
-- (VLCConvertAndSaveWindowController *)convertAndSaveWindow;
-
-- (void)setActiveVideoPlayback:(BOOL)b_value;
-- (BOOL)activeVideoPlayback;
-- (void)applicationWillTerminate:(NSNotification *)notification;
-
-- (BOOL)isTerminating;
+ at property (readonly) VLCAudioEffectsWindowController *audioEffectsPanel;
+ at property (readonly) VLCBookmarksWindowController *bookmarks;
+ at property (readonly) VLCConvertAndSaveWindowController *convertAndSaveWindow;
+ at property (readonly) VLCCoreDialogProvider *coreDialogProvider;
+ at property (readonly) VLCExtensionsManager *extensionsManager;
+ at property (readonly) VLCInformationWindowController *currentMediaInfoPanel;
+ at property (readonly) VLCLogWindowController *debugMsgPanel;
+ at property (readonly) VLCLibraryController *libraryController;
+ at property (readonly) VLCLibraryWindow *libraryWindow;
+ at property (readonly) VLCLibraryWindowController *libraryWindowController;
+ at property (readonly) VLCMainMenu *mainMenu;
+ at property (readonly) VLCOpenWindowController *open;
+ at property (readonly) VLCPlaylistController *playlistController;
+ at property (readonly) VLCPrefs *preferences;
+ at property (readonly) VLCResumeDialogController *resumeDialog;
+ at property (readonly) VLCSimplePrefsController *simplePreferences;
+ at property (readonly) VLCTrackSynchronizationWindowController *trackSyncPanel;
+ at property (readonly) VLCVideoEffectsWindowController *videoEffectsPanel;
+ at property (readonly) VLCVideoOutputProvider *voutProvider;
 
 @end
diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m
index 06e67967b3..c0c9326fe6 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -42,15 +42,16 @@
 #include <vlc_url.h>
 #include <vlc_variables.h>
 
-#import "coreinteraction/VLCHotkeysController.h"
-
 #import "library/VLCLibraryWindow.h"
 
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain+OldPrefs.h"
 #import "main/VLCApplication.h"
 
+#import "extensions/NSString+Helpers.h"
+
 #import "menus/VLCMainMenu.h"
+#import "menus/VLCStatusBarIcon.h"
 
 #import "os-integration/VLCClickerManager.h"
 
@@ -77,11 +78,54 @@
 #import "windows/VLCOpenWindowController.h"
 #import "windows/VLCOpenInputMetadata.h"
 #import "windows/video/VLCVoutView.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 #ifdef HAVE_SPARKLE
 #import <Sparkle/Sparkle.h>                 /* we're the update delegate */
 #endif
 
+NSString *VLCConfigurationChangedNotification = @"VLCConfigurationChangedNotification";
+
+#pragma mark -
+#pragma mark Private extension
+
+ at interface VLCMain ()
+#ifdef HAVE_SPARKLE
+<SUUpdaterDelegate, NSApplicationDelegate>
+#else
+<NSApplicationDelegate>
+#endif
+{
+    intf_thread_t *p_intf;
+    BOOL launched;
+
+    BOOL b_active_videoplayback;
+
+    VLCMainMenu *_mainmenu;
+    VLCPrefs *_prefs;
+    VLCSimplePrefsController *_sprefs;
+    VLCOpenWindowController *_open;
+    VLCCoreDialogProvider *_coredialogs;
+    VLCBookmarksWindowController *_bookmarks;
+    VLCResumeDialogController *_resume_dialog;
+    VLCPlaybackContinuityController *_continuityController;
+    VLCLogWindowController *_messagePanelController;
+    VLCStatusBarIcon *_statusBarIcon;
+    VLCTrackSynchronizationWindowController *_trackSyncPanel;
+    VLCAudioEffectsWindowController *_audioEffectsPanel;
+    VLCVideoEffectsWindowController *_videoEffectsPanel;
+    VLCConvertAndSaveWindowController *_convertAndSaveWindow;
+    VLCInformationWindowController *_currentMediaInfoPanel;
+    VLCLibraryWindowController *_libraryWindowController;
+    VLCClickerManager *_clickerManager;
+
+    bool b_intf_terminating; /* Makes sure applicationWillTerminate will be called only once */
+}
++ (void)killInstance;
+- (void)applicationWillTerminate:(NSNotification *)notification;
+
+ at end
+
 #pragma mark -
 #pragma mark VLC Interface Object Callbacks
 
@@ -174,43 +218,6 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     }
 }
 
-#pragma mark -
-#pragma mark Private
-
- at interface VLCMain ()
-#ifdef HAVE_SPARKLE
-    <SUUpdaterDelegate>
-#endif
-{
-    intf_thread_t *p_intf;
-    BOOL launched;
-
-    BOOL b_active_videoplayback;
-
-    VLCMainMenu *_mainmenu;
-    VLCPrefs *_prefs;
-    VLCSimplePrefsController *_sprefs;
-    VLCOpenWindowController *_open;
-    VLCCoreDialogProvider *_coredialogs;
-    VLCBookmarksWindowController *_bookmarks;
-    VLCResumeDialogController *_resume_dialog;
-    VLCPlaybackContinuityController *_continuityController;
-    VLCLogWindowController *_messagePanelController;
-    VLCStatusBarIcon *_statusBarIcon;
-    VLCTrackSynchronizationWindowController *_trackSyncPanel;
-    VLCAudioEffectsWindowController *_audioEffectsPanel;
-    VLCVideoEffectsWindowController *_videoEffectsPanel;
-    VLCConvertAndSaveWindowController *_convertAndSaveWindow;
-    VLCExtensionsManager *_extensionsManager;
-    VLCInformationWindowController *_currentMediaInfoPanel;
-    VLCLibraryWindowController *_libraryWindowController;
-    VLCClickerManager *_clickerManager;
-
-    bool b_intf_terminating; /* Makes sure applicationWillTerminate will be called only once */
-}
-
- at end
-
 /*****************************************************************************
  * VLCMain implementation
  *****************************************************************************/
@@ -244,8 +251,6 @@ static VLCMain *sharedInstance = nil;
 
         [VLCApplication sharedApplication].delegate = self;
 
-        _hotkeysController = [[VLCHotkeysController alloc] init];
-
         _playlistController = [[VLCPlaylistController alloc] initWithPlaylist:vlc_intf_GetMainPlaylist(p_intf)];
         _libraryController = [[VLCLibraryController alloc] init];
         _continuityController = [[VLCPlaybackContinuityController alloc] init];
@@ -274,8 +279,6 @@ static VLCMain *sharedInstance = nil;
         if ([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen)
             [_playlistController.playerController setFullscreen:YES];
 
-        _nativeFullscreenMode = var_InheritBool(p_intf, "macosx-nativefullscreenmode");
-
         if (var_InheritInteger(p_intf, "macosx-icon-change")) {
             /* After day 354 of the year, the usual VLC cone is replaced by another cone
              * wearing a Father Xmas hat.
@@ -457,11 +460,6 @@ static VLCMain *sharedInstance = nil;
     return _mainmenu;
 }
 
-- (VLCStatusBarIcon *)statusBarIcon
-{
-    return _statusBarIcon;
-}
-
 - (VLCLibraryWindowController *)libraryWindowController
 {
     return _libraryWindowController;
@@ -472,11 +470,6 @@ static VLCMain *sharedInstance = nil;
     return (VLCLibraryWindow *)_libraryWindowController.window;
 }
 
-- (VLCExtensionsManager *)extensionsManager
-{
-    return _extensionsManager;
-}
-
 - (VLCLogWindowController *)debugMsgPanel
 {
     if (!_messagePanelController)
diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m
index bd42cd433a..13b2be52f9 100644
--- a/modules/gui/macosx/menus/VLCMainMenu.m
+++ b/modules/gui/macosx/menus/VLCMainMenu.m
@@ -26,6 +26,8 @@
 #import "coreinteraction/VLCVideoFilterHelper.h"
 
 #import "extensions/NSScreen+VLCAdditions.h"
+#import "extensions/NSString+Helpers.h"
+
 #import "library/VLCLibraryWindow.h"
 #import "library/VLCLibraryFolderManagementWindow.h"
 
@@ -49,10 +51,11 @@
 #import "windows/VLCHelpWindowController.h"
 #import "windows/mainwindow/VLCMainWindowControlsBar.h"
 #import "windows/extensions/VLCExtensionsManager.h"
-#import "windows/video/VLCVoutView.h"
 #import "windows/convertandsave/VLCConvertAndSaveWindowController.h"
 #import "windows/logging/VLCLogWindowController.h"
 #import "windows/addons/VLCAddonsWindowController.h"
+#import "windows/video/VLCVoutView.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 #import <vlc_interface.h>
 
diff --git a/modules/gui/macosx/os-integration/VLCClickerManager.h b/modules/gui/macosx/os-integration/VLCClickerManager.h
index 13f09de528..c36d4e9d80 100644
--- a/modules/gui/macosx/os-integration/VLCClickerManager.h
+++ b/modules/gui/macosx/os-integration/VLCClickerManager.h
@@ -22,6 +22,9 @@
 
 #import <Foundation/Foundation.h>
 
+extern NSString *VLCMediaKeySupportSettingChangedNotification;
+extern NSString *VLCAppleRemoteSettingChangedNotification;
+
 @interface VLCClickerManager : NSObject
 
 @end
diff --git a/modules/gui/macosx/os-integration/VLCClickerManager.m b/modules/gui/macosx/os-integration/VLCClickerManager.m
index c0a87cf4a8..b1a21ca13d 100644
--- a/modules/gui/macosx/os-integration/VLCClickerManager.m
+++ b/modules/gui/macosx/os-integration/VLCClickerManager.m
@@ -30,6 +30,9 @@
 #import "playlist/VLCPlaylistModel.h"
 #import "playlist/VLCPlayerController.h"
 
+NSString *VLCMediaKeySupportSettingChangedNotification = @"VLCMediaKeySupportSettingChangedNotification";
+NSString *VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSettingChangedNotification";
+
 @interface VLCClickerManager()
 {
     VLCPlaylistController *_playlistController;
diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
index 7bf2f0f6ef..7dbf3a1398 100644
--- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
@@ -41,6 +41,7 @@
 #import "panels/dialogs/VLCTextfieldPanelController.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 @interface VLCAudioEffectsWindowController ()
 {
diff --git a/modules/gui/macosx/panels/VLCBookmarksWindowController.m b/modules/gui/macosx/panels/VLCBookmarksWindowController.m
index fe9521301d..9bb2d673c2 100644
--- a/modules/gui/macosx/panels/VLCBookmarksWindowController.m
+++ b/modules/gui/macosx/panels/VLCBookmarksWindowController.m
@@ -35,7 +35,9 @@
 
 #import "VLCBookmarksWindowController.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 @interface VLCBookmarksWindowController() <NSTableViewDataSource, NSTableViewDelegate>
 {
@@ -89,11 +91,6 @@
     [_editCancelButton setTitle: _NS("Cancel")];
     [_editNameLabel setStringValue: _NS("Name")];
     [_editTimeLabel setStringValue: _NS("Time")];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(inputChangedEvent:)
-                                                 name:VLCInputChangedNotification
-                                               object:nil];
 }
 
 - (void)updateCocoaWindowLevel:(NSInteger)i_level
diff --git a/modules/gui/macosx/panels/VLCInformationWindowController.m b/modules/gui/macosx/panels/VLCInformationWindowController.m
index fb9c8bc69c..8c603ee2d4 100644
--- a/modules/gui/macosx/panels/VLCInformationWindowController.m
+++ b/modules/gui/macosx/panels/VLCInformationWindowController.m
@@ -23,10 +23,12 @@
 
 #import "VLCInformationWindowController.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 #import <vlc_url.h>
 
diff --git a/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m b/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m
index c73f978112..75431c0d0e 100644
--- a/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m
+++ b/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m
@@ -23,10 +23,12 @@
 
 #import "VLCTrackSynchronizationWindowController.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "coreinteraction/VLCVideoFilterHelper.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 #define SUBSDELAY_CFG_MODE                     "subsdelay-mode"
 #define SUBSDELAY_CFG_FACTOR                   "subsdelay-factor"
diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
index 6b2ad1a9a5..fe92d65a84 100644
--- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
@@ -31,6 +31,7 @@
 #import "panels/dialogs/VLCTextfieldPanelController.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 #import <vlc_playlist_legacy.h>
 
@@ -333,11 +334,6 @@
     [[_addLogoPositionPopup lastItem] setTag: 10];
     [_addLogoTransparencyLabel setStringValue:_NS("Transparency")];
 
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(inputChangedEvent:)
-                                                 name:VLCInputChangedNotification
-                                               object:nil];
-
     [self resetValues];
 }
 
diff --git a/modules/gui/macosx/panels/dialogs/VLCCoreDialogProvider.m b/modules/gui/macosx/panels/dialogs/VLCCoreDialogProvider.m
index 42b7087468..e9d9fa3cae 100644
--- a/modules/gui/macosx/panels/dialogs/VLCCoreDialogProvider.m
+++ b/modules/gui/macosx/panels/dialogs/VLCCoreDialogProvider.m
@@ -24,6 +24,7 @@
 #import "VLCCoreDialogProvider.h"
 
 #import "extensions/misc.h"
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "windows/VLCErrorWindowController.h"
 
diff --git a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
index 84a9af541c..eb29d87dda 100644
--- a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
+++ b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
@@ -26,7 +26,7 @@
 
 #import "main/VLCMain.h"
 #import "extensions/NSString+Helpers.h"
-#import "extensions/NSString+Helpers.h"
+#import "windows/video/VLCVideoOutputProvider.h"
 
 @interface VLCResumeDialogController()
 {
diff --git a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
index 91839f66c8..470dba6246 100644
--- a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
+++ b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
@@ -23,6 +23,7 @@
 
 #import "VLCPlaybackContinuityController.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "panels/dialogs/VLCResumeDialogController.h"
 #import "playlist/VLCPlaylistController.h"
diff --git a/modules/gui/macosx/playlist/VLCPlayerController.m b/modules/gui/macosx/playlist/VLCPlayerController.m
index 7b4cff2e45..fd80a0dae0 100644
--- a/modules/gui/macosx/playlist/VLCPlayerController.m
+++ b/modules/gui/macosx/playlist/VLCPlayerController.m
@@ -24,6 +24,7 @@
 
 #import <vlc_url.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "os-integration/VLCRemoteControlService.h"
 #import "os-integration/iTunes.h"
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m b/modules/gui/macosx/playlist/VLCPlaylistController.m
index 5b90df74c5..7512d9fdbd 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -25,6 +25,7 @@
 #import <vlc_interface.h>
 #import <vlc_player.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistModel.h"
 #import "playlist/VLCPlaylistItem.h"
diff --git a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
index 1d7cbceb93..4cebe5308b 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m
@@ -24,6 +24,7 @@
 
 #import "VLCPlaylistMenuController.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlaylistModel.h"
diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
index 26d9589022..e6712cf42a 100644
--- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m
@@ -35,15 +35,17 @@
 #import <vlc_modules.h>
 #import <vlc_plugin.h>
 #import <vlc_config_cat.h>
+#import <vlc_aout.h>
 
 #import "extensions/misc.h"
 #import "extensions/NSScreen+VLCAdditions.h"
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "main/VLCMain+OldPrefs.h"
+#import "os-integration/VLCClickerManager.h"
 #import "preferences/prefs.h"
 
-
 static struct {
     const char iso[6];
     const char name[34];
diff --git a/modules/gui/macosx/preferences/prefs.m b/modules/gui/macosx/preferences/prefs.m
index 05ff44056b..5f870970a3 100644
--- a/modules/gui/macosx/preferences/prefs.m
+++ b/modules/gui/macosx/preferences/prefs.m
@@ -43,19 +43,20 @@
  *****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
-# include "config.h"
+# import "config.h"
 #endif
 
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <sys/param.h>                                    /* for MAXPATHLEN */
-#include <string.h>
+#import <stdlib.h>                                      /* malloc(), free() */
+#import <sys/param.h>                                    /* for MAXPATHLEN */
+#import <string.h>
 
-#include <vlc_common.h>
+#import <vlc_common.h>
 #import <vlc_actions.h>
-#include <vlc_config_cat.h>
+#import <vlc_config_cat.h>
 #import <vlc_modules.h>
 #import <vlc_plugin.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "preferences/prefs.h"
diff --git a/modules/gui/macosx/windows/VLCAboutWindowController.m b/modules/gui/macosx/windows/VLCAboutWindowController.m
index c1d68fa1c2..76331dc0f9 100644
--- a/modules/gui/macosx/windows/VLCAboutWindowController.m
+++ b/modules/gui/macosx/windows/VLCAboutWindowController.m
@@ -30,6 +30,7 @@
 #import <vlc_intf_strings.h>
 #import <vlc_about.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 
diff --git a/modules/gui/macosx/windows/VLCErrorWindowController.m b/modules/gui/macosx/windows/VLCErrorWindowController.m
index a8479518e4..58de28cd34 100644
--- a/modules/gui/macosx/windows/VLCErrorWindowController.m
+++ b/modules/gui/macosx/windows/VLCErrorWindowController.m
@@ -25,7 +25,6 @@
 
 #import "extensions/NSString+Helpers.h"
 
-
 @interface VLCErrorWindowController()
 {
     NSMutableArray *_errors;
diff --git a/modules/gui/macosx/windows/VLCHelpWindowController.m b/modules/gui/macosx/windows/VLCHelpWindowController.m
index fecf66d322..c0e106502a 100644
--- a/modules/gui/macosx/windows/VLCHelpWindowController.m
+++ b/modules/gui/macosx/windows/VLCHelpWindowController.m
@@ -26,6 +26,7 @@
 #import <vlc_intf_strings.h>
 #import <vlc_about.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "views/VLCScrollingClipView.h"
diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m b/modules/gui/macosx/windows/VLCOpenWindowController.m
index 7a2404d8d5..bc887291b5 100644
--- a/modules/gui/macosx/windows/VLCOpenWindowController.m
+++ b/modules/gui/macosx/windows/VLCOpenWindowController.m
@@ -32,12 +32,13 @@
 #import <vlc_common.h>
 #import <vlc_url.h>
 
+#import "extensions/misc.h"
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "windows/convertandsave/VLCOutput.h"
 #import "windows/VLCOpenInputMetadata.h"
 
-
 NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
 
 @interface VLCOpenTextField : NSTextField
diff --git a/modules/gui/macosx/windows/addons/VLCAddonsWindowController.m b/modules/gui/macosx/windows/addons/VLCAddonsWindowController.m
index 9ab94609cc..45a5041627 100644
--- a/modules/gui/macosx/windows/addons/VLCAddonsWindowController.m
+++ b/modules/gui/macosx/windows/addons/VLCAddonsWindowController.m
@@ -24,6 +24,7 @@
 #import <vlc_common.h>
 #import <vlc_addons.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "windows/addons/VLCAddonListItem.h"
 
diff --git a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
index 4c13a4c48e..78585bfa55 100644
--- a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
+++ b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
@@ -22,6 +22,8 @@
 
 #import "VLCConvertAndSaveWindowController.h"
 
+#import "extensions/misc.h"
+#import "extensions/NSString+Helpers.h"
 #import "extensions/NSView+VLCAdditions.h"
 #import "main/VLCMain.h"
 #import "panels/dialogs/VLCPopupPanelController.h"
diff --git a/modules/gui/macosx/windows/convertandsave/VLCOutput.m b/modules/gui/macosx/windows/convertandsave/VLCOutput.m
index 7f6a628c0a..8a97546bb6 100644
--- a/modules/gui/macosx/windows/convertandsave/VLCOutput.m
+++ b/modules/gui/macosx/windows/convertandsave/VLCOutput.m
@@ -26,6 +26,7 @@
 
 #import "VLCOutput.h"
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 
 @interface VLCOutput()
diff --git a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
index 612c2d460a..015c7f274a 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
@@ -27,6 +27,7 @@
 
 #import "main/VLCMain.h"
 #import "VLCExtensionsManager.h"
+#import "extensions/NSString+Helpers.h"
 #import "extensions/misc.h"
 #import "VLCUIWidgets.h"
 
diff --git a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
index d65cc44db8..86b921d8a6 100644
--- a/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
+++ b/modules/gui/macosx/windows/extensions/VLCExtensionsManager.m
@@ -28,9 +28,9 @@
 #import <vlc_modules.h>
 #import <vlc_extensions.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "windows/extensions/VLCExtensionsDialogProvider.h"
 
-
 #define MENU_MAP(a,e) ((uint32_t)((((uint16_t)a) << 16) | ((uint16_t)e)))
 #define MENU_GET_ACTION(a) ((uint16_t)(((uint32_t)a) >> 16))
 #define MENU_GET_EXTENSION(a) ((uint16_t)(((uint32_t)a) & 0xFFFF))
diff --git a/modules/gui/macosx/windows/logging/VLCLogWindowController.m b/modules/gui/macosx/windows/logging/VLCLogWindowController.m
index 30b26026bc..cd3d45c81a 100644
--- a/modules/gui/macosx/windows/logging/VLCLogWindowController.m
+++ b/modules/gui/macosx/windows/logging/VLCLogWindowController.m
@@ -26,6 +26,7 @@
 
 #import <vlc_common.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "windows/logging/VLCLogMessage.h"
 
diff --git a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
index f2b508e12e..5277d9ae62 100644
--- a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
+++ b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
@@ -25,6 +25,7 @@
 
 #import <vlc_aout.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "menus/VLCMainMenu.h"
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.m b/modules/gui/macosx/windows/video/VLCFSPanelController.m
index e34f82c56a..fb4eb160a9 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.m
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.m
@@ -27,6 +27,7 @@
 
 #import <vlc_aout.h>
 
+#import "extensions/NSString+Helpers.h"
 #import "main/VLCMain.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
index 5261f219dc..d239d00a01 100644
--- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
+++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
@@ -220,7 +220,7 @@ int WindowOpen(vout_window_t *p_wnd)
     VLCVoutView *voutView;
     VLCVideoWindowCommon *newVideoWindow;
     BOOL isEmbedded = YES;
-    BOOL isNativeFullscreen = [mainInstance nativeFullscreenMode];
+    BOOL isNativeFullscreen = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
     BOOL windowDecorations = var_InheritBool(getIntf(), "video-deco");
     BOOL videoWallpaper = var_InheritBool(getIntf(), "video-wallpaper");
     BOOL multipleVoutWindows = [_voutWindows count] > 0;
@@ -393,7 +393,7 @@ int WindowOpen(vout_window_t *p_wnd)
 
     // prevent visible extra window if in fullscreen
     NSDisableScreenUpdates();
-    BOOL b_native = [[mainInstance libraryWindow] nativeFullscreenMode];
+    BOOL b_native = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
 
     // close fullscreen, without changing fullscreen vars
     if (!b_native && ([videoWindow fullscreen] || [videoWindow inFullscreenTransition]))
@@ -468,7 +468,7 @@ int WindowOpen(vout_window_t *p_wnd)
 - (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd withAnimation:(BOOL)b_animation
 {
     intf_thread_t *p_intf = getIntf();
-    BOOL b_nativeFullscreenMode = [[VLCMain sharedInstance] nativeFullscreenMode];
+    BOOL b_nativeFullscreenMode = var_InheritBool(getIntf(), "macosx-nativefullscreenmode");
 
     if (!p_intf || (!b_nativeFullscreenMode && !p_wnd))
         return;
diff --git a/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m b/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m
index e886960a4b..130b8f93d0 100644
--- a/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m
+++ b/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m
@@ -24,11 +24,13 @@
 #import "VLCVideoWindowCommon.h"
 
 #import "extensions/NSScreen+VLCAdditions.h"
+#import "extensions/NSString+Helpers.h"
 #import "main/CompatibilityFixes.h"
 #import "main/VLCMain.h"
 #import "windows/mainwindow/VLCControlsBarCommon.h"
-#import "windows/video/VLCVoutView.h"
 #import "windows/video/VLCFSPanelController.h"
+#import "windows/video/VLCVideoOutputProvider.h"
+#import "windows/video/VLCVoutView.h"
 #import "playlist/VLCPlaylistController.h"
 #import "playlist/VLCPlayerController.h"
 #import "library/VLCLibraryWindow.h"
diff --git a/modules/gui/macosx/windows/video/VLCVoutView.m b/modules/gui/macosx/windows/video/VLCVoutView.m
index 4005e1fd3c..589889cf29 100644
--- a/modules/gui/macosx/windows/video/VLCVoutView.m
+++ b/modules/gui/macosx/windows/video/VLCVoutView.m
@@ -82,7 +82,7 @@
         f_cumulated_magnification = 0.0;
         VLCMain *mainInstance = [VLCMain sharedInstance];
         _playerController = [[mainInstance playlistController] playerController];
-        _hotkeysController = [mainInstance hotkeysController];
+        _hotkeysController = [[VLCHotkeysController alloc] init];
     }
 
     return self;



More information about the vlc-commits mailing list