]> git.sesse.net Git - vlc/commitdiff
macosx: moved compatiblity fixes to a designated header
authorFelix Paul Kühne <fkuehne@videolan.org>
Tue, 16 Aug 2011 16:03:51 +0000 (18:03 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 16 Aug 2011 16:05:00 +0000 (18:05 +0200)
24 files changed:
extras/package/macosx/vlc.xcodeproj/project.pbxproj
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AudioEffects.m
modules/gui/macosx/CompatibilityFixes.h [new file with mode: 0644]
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.m
modules/gui/macosx/Modules.am
modules/gui/macosx/PXSourceList.h
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/about.m
modules/gui/macosx/bookmarks.m
modules/gui/macosx/embeddedwindow.h
modules/gui/macosx/fspanel.m
modules/gui/macosx/intf.m
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m
modules/gui/macosx/open.m
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.h
modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/wizard.m

index 10cc778e2edaf475141c7c6a3b5e8fc0ab9182d8..b60a055be232c7b0197b9a9cf9078d33f338f972 100644 (file)
                CC9B43AE13B29C79000205AE /* bottom-background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottom-background.png"; path = "Resources/mainwindow/bottom-background.png"; sourceTree = "<group>"; };
                CC9B43B013B29FCF000205AE /* bottom-background_dark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bottom-background_dark.png"; path = "Resources/mainwindow_dark/bottom-background_dark.png"; sourceTree = "<group>"; };
                CC9E3E7913D1CFCF00429A71 /* qtcapture.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = qtcapture.m; path = ../../../modules/access/qtcapture.m; sourceTree = "<group>"; };
+               CCB0BB3013FAC9F40095BD0A /* CompatibilityFixes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompatibilityFixes.h; path = ../../../modules/gui/macosx/CompatibilityFixes.h; sourceTree = "<group>"; };
                CCB24D5D0D54BBAE004D780C /* simple_prefs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = simple_prefs.m; path = ../../../modules/gui/macosx/simple_prefs.m; sourceTree = SOURCE_ROOT; };
                CCB24D5E0D54BBAE004D780C /* simple_prefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simple_prefs.h; path = ../../../modules/gui/macosx/simple_prefs.h; sourceTree = SOURCE_ROOT; };
                CCBE999E0F922C51000705F8 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
                08FB77AFFE84173DC02AAC07 /* Classes */ = {
                        isa = PBXGroup;
                        children = (
+                               CCB0BB3013FAC9F40095BD0A /* CompatibilityFixes.h */,
                                8ED6C27E03E2EB1C0059A3A7 /* macosx.m */,
                                8ED6C27C03E2EB1C0059A3A7 /* intf.h */,
                                8ED6C27D03E2EB1C0059A3A7 /* intf.m */,
index 618f7ad4c719a8893e0714e2ecff33f58504a80c..27cf045f35bac2aaa607afb1cd3de58f877ee342 100644 (file)
@@ -55,6 +55,7 @@
 
 /* this was added by the VideoLAN team to ensure Leopard-compatibility and is VLC-only */
 #import "intf.h"
+#import "CompatibilityFixes.h"
 
 const char* AppleRemoteDeviceName = "AppleIRController";
 const int REMOTE_SWITCH_COOKIE=19;
@@ -99,7 +100,7 @@ static AppleRemote *_o_sharedInstance = nil;
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep]   forKey:@"35_31_18_35_31_18_"];
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]   forKey:@"19_"];
         }
-        else if( NSAppKitVersionNumber >= 1115.2 )
+        else if( OSX_LION )
         {
             /* omg, keys from the future */
             msg_Dbg( VLCIntf, "using future AR cookies" );
index 1af0c44fc569ab88b1b219139796328d63fe200c..f2680a5ef354c9138adba0ac9ed807d1f3e97860 100644 (file)
@@ -30,6 +30,7 @@
 #import "intf.h"
 #import "AudioEffects.h"
 #import "../../audio_filter/equalizer_presets.h"
+#import "CompatibilityFixes.h"
 
 #import <vlc_common.h>
 #import <vlc_aout_intf.h>
@@ -102,7 +103,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"filter"]] setLabel:_NS("Filter")];
     [o_window setTitle:_NS("Audio Effects")];
     [o_window setExcludedFromWindowsMenu:YES];
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self setupEqualizer];
diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
new file mode 100644 (file)
index 0000000..2d62c8a
--- /dev/null
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * sdkfixes.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2011 VideoLAN
+ * $Id$
+ *
+ * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+#pragma mark -
+#pragma OS detection code
+#define OSX_LEOPARD (NSAppKitVersionNumber < 1038 && NSAppKitVersionNumber >= 949)
+#define OSX_SNOW_LEOPARD (NSAppKitVersionNumber < 1115 && NSAppKitVersionNumber >= 1038)
+#define OSX_LION NSAppKitVersionNumber >= 1115.2
+
+#pragma mark -
+#pragma Fixes for OS X Leopard (10.5)
+
+#ifndef MAC_OS_X_VERSION_10_6
+
+@protocol NSAnimationDelegate <NSObject> @end
+@protocol NSWindowDelegate <NSObject> @end
+@protocol NSComboBoxDataSource <NSObject> @end
+@protocol NSTextFieldDelegate <NSObject> @end
+@protocol NSTableViewDataSource <NSObject> @end
+@protocol NSOutlineViewDelegate <NSObject> @end
+@protocol NSOutlineViewDataSource <NSObject> @end
+@protocol NSToolbarDelegate <NSObject> @end
+
+enum {
+    NSApplicationPresentationDefault                    = 0,
+    NSApplicationPresentationAutoHideDock               = (1 <<  0),
+    NSApplicationPresentationHideDock                   = (1 <<  1),
+    NSApplicationPresentationAutoHideMenuBar            = (1 <<  2),
+    NSApplicationPresentationHideMenuBar                = (1 <<  3),
+    NSApplicationPresentationDisableAppleMenu           = (1 <<  4),
+    NSApplicationPresentationDisableProcessSwitching    = (1 <<  5),
+    NSApplicationPresentationDisableForceQuit           = (1 <<  6),
+    NSApplicationPresentationDisableSessionTermination  = (1 <<  7),
+    NSApplicationPresentationDisableHideApplication     = (1 <<  8),
+    NSApplicationPresentationDisableMenuBarTransparency = (1 <<  9)
+};
+#endif
+
+#pragma mark -
+#pragma Fixes for OS X Snow Leopard (10.6)
+
+#ifndef MAC_OS_X_VERSION_10_7
+
+enum {
+    NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
+    NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8
+};
+
+enum {
+    NSApplicationPresentationFullScreen                 = (1 << 10),
+    NSApplicationPresentationAutoHideToolbar            = (1 << 11)
+};
+
+#endif
index 4112d0207b04f01c30b8860f230fb76994fb9fd6..f6b5e4f88e3b7dfac8bad56abd21693d0da3db8e 100644 (file)
 #import "misc.h"
 #import "fspanel.h"
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSAnimationDelegate <NSObject> @end
-#endif
-
 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate> {
     IBOutlet id o_play_btn;
     IBOutlet id o_bwd_btn;
index 237196099be2f6e1c1da677db791f0b976fc0f0f..b3c3cbeb60f50e9b537d71e06cea0db732a15092 100644 (file)
@@ -24,6 +24,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#import "CompatibilityFixes.h"
 #import "MainWindow.h"
 #import "intf.h"
 #import "CoreInteraction.h"
@@ -218,7 +219,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     o_temp_view = [[NSView alloc] init];
     [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
     [o_dropzone_view setFrame: [o_playlist_table frame]];
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
 
     /* create the sidebar */
@@ -856,7 +857,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)resizeWindow
 {
-    if ( !b_fullscreen && !(NSAppKitVersionNumber >= 1115.2 && [NSApp currentSystemPresentationOptions] == NSApplicationPresentationFullScreen) )
+    if ( !b_fullscreen && !(OSX_LION && [NSApp currentSystemPresentationOptions] == NSApplicationPresentationFullScreen) )
     {
         NSPoint topleftbase;
         NSPoint topleftscreen;
@@ -975,7 +976,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
             if ([screen isMainScreen])
             {
-                if (NSAppKitVersionNumber < 1038) // Leopard
+                if (OSX_LEOPARD)
                     SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
                 else
                     [NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
@@ -1034,7 +1035,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
     if ([screen isMainScreen])
     {
-        if (NSAppKitVersionNumber < 1038) // Leopard
+        if (OSX_LEOPARD)
             SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
         else
             [NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
@@ -1143,7 +1144,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         }
 
         [o_fspanel setNonActive: nil];
-        if (NSAppKitVersionNumber < 1038) // Leopard
+        if (OSX_LEOPARD)
             SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
         else
             [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
@@ -1169,7 +1170,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [[o_video_view window] orderFront: self];
 
     [o_fspanel setNonActive: nil];
-    if (NSAppKitVersionNumber < 1038) // Leopard
+    if (OSX_LEOPARD)
         SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
     else
         [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
index 08dc54170c5d451358847b625d8e21a0b6ad082d..9e02d71230b8d12fbef6087d5a80c480ab72f0b6 100644 (file)
@@ -4,6 +4,7 @@
 LIBTOOL=@LIBTOOL@ --tag=CC
 
 SOURCES_macosx = \
+       CompatibilityFixes.h \
        AppleRemote.h \
        AppleRemote.m \
        SPInvocationGrabbing.h \
index 6736999d83765e8fe771ad2ca654190c7ebff1c1..afb1c990e493eeb64a8aee0b81fc9063f50f6f85 100644 (file)
 #import "PXSourceListDelegate.h"
 #import "PXSourceListDataSource.h"
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSOutlineViewDelegate <NSObject> @end
-@protocol NSOutlineViewDataSource <NSObject> @end
-#endif
-
 @interface PXSourceList: NSOutlineView <NSOutlineViewDelegate, NSOutlineViewDataSource>
 {
        id <PXSourceListDelegate> _secondaryDelegate;           //Used to store the publicly visible delegate
index 848f7529fe8701b2bddee694468a50d0e871396f..b465b260c39df9fedc27f86a2a0e2627201cb87a 100644 (file)
@@ -22,6 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#import "CompatibilityFixes.h"
 #import "intf.h"
 #import <vlc_common.h>
 #import "TrackSynchronization.h"
@@ -61,7 +62,7 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
     [o_sv_speed_lbl setStringValue: _NS("Speed of the subtitles:")];
     [[o_sv_speed_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
 
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self resetValues:self];
index 47aaf637adbc266a99c3f6421f12bfc4d7af238c..e2733f3ec9c43cde586e12e60efb3e946ee051c3 100644 (file)
@@ -21,6 +21,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#import "CompatibilityFixes.h"
 #import "intf.h"
 #import <vlc_common.h>
 #import "VideoEffects.h"
@@ -60,7 +61,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
 {
     [o_window setTitle: _NS("Video Effects")];
     [o_window setExcludedFromWindowsMenu:YES];
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
index bbd0b67477311f0f014289875d4af585970cdab8..e184c3be8dc778ba08a1f4ce2f9f2f184f6582ee 100644 (file)
@@ -29,6 +29,7 @@
 #import "about.h"
 #import <vlc_intf_strings.h>
 #import <vlc_about.h>
+#import "CompatibilityFixes.h"
 
 #ifdef __x86_64__
 #define PLATFORM "Intel 64bit"
@@ -69,7 +70,7 @@ static VLAboutBox *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_about_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 }
 
index 412c0f2952a7bdc9690e0fc9c4504f507ab5e5d0..aaee87f1e78d514c81826f9d6c8899bc881a224d 100644 (file)
 #import "bookmarks.h"
 #import "wizard.h"
 #import <vlc_interface.h>
-
-/*****************************************************************************
- * VLCExtended implementation
- *
- * implements the GUI functions for the window, the data source and the
- * delegate for o_tbl_dataTable
- *****************************************************************************/
+#import "CompatibilityFixes.h"
 
 @implementation VLCBookmarks
 
@@ -71,7 +65,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self initStrings];
index b86b7f080a31ada42e3ea476725c43179f2bcaf9..420c62a041b1d342d625395ee5596b5b7ab4f31c 100644 (file)
 
 #import "misc.h"
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSAnimationDelegate <NSObject> @end
-#endif
-
 @interface VLCEmbeddedWindow : NSWindow <NSWindowDelegate, NSAnimationDelegate>
 {
     IBOutlet id o_btn_backward;
index 85fabc1a86dddd1a0e99dbc65f79f54bc8c3c7d3..c06091d417aec114de2e9a2baa7c5163c201590c 100644 (file)
@@ -30,6 +30,7 @@
 #import "MainWindow.h"
 #import "misc.h"
 #import "fspanel.h"
+#import "CompatibilityFixes.h"
 
 @interface VLCFSPanel ()
 - (void)hideMouse;
@@ -49,7 +50,7 @@
     [win setOpaque:NO];
     [win setHasShadow: NO];
     [win setBackgroundColor:[NSColor clearColor]];
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* let the window sit on top of everything else and start out completely transparent */
index 0642480bdcf2d3903ed3077222ea8f530298c64a..7c3aa88f05d30e143c303173f4419232d97d6253 100644 (file)
@@ -39,6 +39,7 @@
 #include <vlc_vout_window.h>
 #include <unistd.h> /* execl() */
 
+#import "CompatibilityFixes.h"
 #import "intf.h"
 #import "MainMenu.h"
 #import "vout.h"
@@ -1233,7 +1234,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
     playlist_t * p_playlist = pl_Get( VLCIntf );
     BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" );
 
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
     {
         [o_mainwindow toggleFullScreen: self];
         if(b_fullscreen)
index 0a657b6df12c247a5febd853b9b47d273b487d7b..da19f3c72cd22b97380b81b463a0bff020da494b 100644 (file)
 #import <Cocoa/Cocoa.h>
 #import <ApplicationServices/ApplicationServices.h>
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSWindowDelegate <NSObject> @end
-NSUInteger NSApplicationPresentationAutoHideDock;
-NSUInteger NSApplicationPresentationAutoHideMenuBar;
-NSUInteger NSApplicationPresentationDefault;
-#endif
-
 /*****************************************************************************
  * NSAnimation (VLCAddition)
  *****************************************************************************/
index 4b1abe26a9b8f78627009635df14d9acdbe75892..cfb62f558811fcd61e35bd0a31d953473922b309 100644 (file)
@@ -25,6 +25,7 @@
 #import <Cocoa/Cocoa.h>
 #import <Carbon/Carbon.h>
 
+#import "CompatibilityFixes.h"
 #import "intf.h"                                          /* VLCApplication */
 #import "MainWindow.h"
 #import "misc.h"
@@ -147,7 +148,7 @@ static NSMutableArray *blackoutWindows = NULL;
         {
             if ([screen isMainScreen])
             {
-                if (NSAppKitVersionNumber < 1038) // Leopard
+                if (OSX_LEOPARD)
                     SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
                 else
                     [NSApp setPresentationOptions:(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
@@ -166,7 +167,7 @@ static NSMutableArray *blackoutWindows = NULL;
         [blackoutWindow closeAndAnimate: YES];
     }
 
-    if (NSAppKitVersionNumber < 1038) // Leopard
+    if (OSX_LEOPARD)
         SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
     else
         [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
index d47f59329c4c9175a71533db7cc00be6f2f52083..dc5afc80b81b39f084483e728307680fcbe06e06 100644 (file)
@@ -40,6 +40,7 @@
 #import <Cocoa/Cocoa.h>
 #import <QTKit/QTKit.h>
 
+#import "CompatibilityFixes.h"
 #import "intf.h"
 #import "playlist.h"
 #import "open.h"
@@ -104,7 +105,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_panel setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [o_panel setTitle: _NS("Open Source")];
index 77e3c303e298c74c75634fe0ad9e0a5eae7cb238..602f1d3126981acb263215edd8f4c49ed483498c 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include "intf.h"
-#include "playlistinfo.h"
-#include "playlist.h"
-#include <vlc_url.h>
+#import "CompatibilityFixes.h"
+#import "intf.h"
+#import "playlistinfo.h"
+#import "playlist.h"
+#import <vlc_url.h>
 
 /*****************************************************************************
  * VLCPlaylistInfo Implementation
@@ -69,7 +70,7 @@ static VLCInfo *_o_sharedInstance = nil;
 {
     [o_info_window setExcludedFromWindowsMenu: YES];
     [o_info_window setFloatingPanel: NO];
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_info_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [o_info_window setTitle: _NS("Media Information")];
index 03f977ba31ec7cf228b1ef0c5fed4d52ea399b74..504c5277f7df78df2044c56d1ced39ae021d9764 100644 (file)
@@ -52,6 +52,7 @@
 #include <vlc_common.h>
 #include <vlc_config_cat.h>
 
+#import "CompatibilityFixes.h"
 #import "intf.h"
 #import "prefs.h"
 #import "simple_prefs.h"
@@ -175,7 +176,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 {
     p_intf = VLCIntf;
 
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_prefs_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self initStrings];
index 6d3db0cb7599977cdcc65b262c321036e25a808e..bc0e3ebaac9129deb70e8cc334fb3f51b495cdda 100644 (file)
 #define LEFTMARGIN  18
 #define RIGHTMARGIN 18
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSComboBoxDataSource <NSObject> @end
-@protocol NSTextFieldDelegate <NSObject> @end
-@protocol NSTableViewDataSource <NSObject> @end
-#endif
-
 static NSMenu   *o_keys_menu = nil;
 
 @interface VLCConfigControl : NSView
index 2bc7a47c8d83b2843f05be5898b807df80dbe53e..98f334cb8b29fdf2850c27abeed90dcc63799382 100644 (file)
 #import "intf.h"
 #import <vlc_common.h>
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSToolbarDelegate <NSObject> @end
-#endif
-
 @interface VLCSimplePrefs : NSObject <NSToolbarDelegate>
 {
     IBOutlet id o_audio_dolby_pop;
index edf4f6e02dbb6a485fe24c1fb1def4bc433bb6e2..f08a76d3052dd619d71f15fb1af6a706b6e128e9 100644 (file)
@@ -21,6 +21,7 @@
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
 
+#import "CompatibilityFixes.h"
 #import "simple_prefs.h"
 #import "prefs.h"
 #import <vlc_keys.h>
@@ -104,7 +105,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     [o_sprefs_toolbar setDelegate: self];
     [o_sprefs_win setToolbar: o_sprefs_toolbar];
 
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* setup useful stuff */
index 6cb06af4f0e3c6b71046d598292fc84d2be630e8..cba436d3276beda8c78fcb44bd3ab9e64962b0b1 100644 (file)
@@ -31,6 +31,7 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#import "CompatibilityFixes.h"
 #import "wizard.h"
 #import "intf.h"
 #import "playlist.h"
@@ -71,7 +72,7 @@ static VLCWizard *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (NSAppKitVersionNumber >= 1115.2)
+    if (OSX_LION)
         [o_wizard_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* some minor cleanup */