]> git.sesse.net Git - vlc/commitdiff
macosx: fixed conditionals for the different OS X release by adapting to the newly...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 2 Sep 2012 11:47:21 +0000 (13:47 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 2 Sep 2012 11:47:21 +0000 (13:47 +0200)
18 files changed:
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AudioEffects.m
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindowTitle.m
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/about.m
modules/gui/macosx/bookmarks.m
modules/gui/macosx/controls.m
modules/gui/macosx/fspanel.m
modules/gui/macosx/intf.m
modules/gui/macosx/misc.m
modules/gui/macosx/open.m
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/prefs.m
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/wizard.m

index 76e2c813de557af0cfbd7ce32bb1da440e2796bb..084bc57d567937db1266df6ed8e0b6ec183431d4 100644 (file)
@@ -99,12 +99,12 @@ static AppleRemote *_o_sharedInstance = nil;
         [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay]       forKey:@"33_21_20_8_2_33_21_20_8_2_"];
         [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
 
-        if( OSX_LION )
-            /* Lion cookies */
-            [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]     forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
-        else
+        if( OSX_SNOW_LEOPARD )
             /* 10.6.2+ Snow Leopard cookies */
             [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]     forKey:@"19_"];
+        else
+        /* Lion cookies */
+            [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]     forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
 
         _cookieToButtonMapping = [[NSDictionary alloc] initWithDictionary: mutableCookieToButtonMapping];
         [mutableCookieToButtonMapping release];
index 9646f895ac70f65f3f8c8b3019fbaa4901f4d295..89ed7d61405d41595fd53655337df1c5c527b484 100644 (file)
@@ -105,7 +105,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 (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self setupEqualizer];
index a5c85dcc8690b79a3583420cc8a92d984186891b..342a275fdb1ef1d31af00742c7a2a1b6334c6ace 100644 (file)
@@ -954,8 +954,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
     b_activeDragAndDrop = YES;
     [self setNeedsDisplay:YES];
 
-    if (OSX_SNOW_LEOPARD || OSX_LION)
-        [[NSCursor dragCopyCursor] set];
+    [[NSCursor dragCopyCursor] set];
 
     if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric)
         return NSDragOperationGeneric;
index b5f9020fa791101eb0a05871c2863b13f0160eb2..1b1d3ca3b8ec111d0ef93bb6b9ca19411d998bb1 100644 (file)
@@ -95,7 +95,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     if (b_dark_interface)
     {
 #ifdef MAC_OS_X_VERSION_10_7
-        if (OSX_LION)
+        if (!OSX_SNOW_LEOPARD)
             styleMask = NSBorderlessWindowMask | NSResizableWindowMask;
         else
             styleMask = NSBorderlessWindowMask;
@@ -114,7 +114,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [self setMovableByWindowBackground: YES];
 
     /* we don't want this window to be restored on relaunch */
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [self setRestorable:NO];
 
     return self;
@@ -187,7 +187,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     b_video_deco = var_InheritBool( VLCIntf, "video-deco" );
     b_nativeFullscreenMode = NO;
 #ifdef MAC_OS_X_VERSION_10_7
-    if( OSX_LION && b_video_deco )
+    if( !OSX_SNOW_LEOPARD && b_video_deco )
         b_nativeFullscreenMode = var_InheritBool( VLCIntf, "macosx-nativefullscreenmode" );
 #endif
     t_hide_mouse_timer = nil;
@@ -467,7 +467,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
             [o_detached_titlebar_view setFullscreenButtonHidden: YES];
     }
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
     {
         /* the default small size of the search field is slightly different on Lion, let's work-around that */
         NSRect frame;
@@ -670,7 +670,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     frame.size.width = 0;
     [o_detached_time_sld_fancygradient_view setFrame: frame];
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
     {
         [o_resize_view setImage: NULL];
         [o_detached_resize_view setImage: NULL];
@@ -3059,7 +3059,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     if (b_dark_interface || !b_video_deco)
     {
 #ifdef MAC_OS_X_VERSION_10_7
-        if (OSX_LION)
+        if (!OSX_SNOW_LEOPARD)
             styleMask = NSBorderlessWindowMask | NSResizableWindowMask;
         else
             styleMask = NSBorderlessWindowMask;
@@ -3075,7 +3075,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     [self setMovableByWindowBackground: YES];
 
     /* we don't want this window to be restored on relaunch */
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [self setRestorable:NO];
 
     return self;
index a811c35a34603b3ed0ab24175b7a732c3aeea9d1..0405b6d5fd00c893a8245f3ffa9891efb9fac4e4 100644 (file)
 
 - (void)loadButtonIcons
 {
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
     {
         if( [NSColor currentControlTint] == NSBlueControlTint )
         {
         return;
 
     NSArray * pathComponents;
-
-    if (OSX_SNOW_LEOPARD || OSX_LION)
-        pathComponents = [representedURL pathComponents];
-    else
-        pathComponents = [[representedURL path] pathComponents];
+    pathComponents = [representedURL pathComponents];
 
     if (!pathComponents)
         return;
     }
 
     NSArray * pathComponents;
-    if (OSX_SNOW_LEOPARD || OSX_LION)
-        pathComponents = [representedURL pathComponents];
-    else
-        pathComponents = [[representedURL path] pathComponents];
+    pathComponents = [representedURL pathComponents];
     if (!pathComponents)
         return;
 
index ca98d17ccb12800ac9176868763bc15cac4ab84c..afd18fb5bb27515e77238439d507a0830db34b10 100644 (file)
@@ -93,7 +93,7 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
     [[o_sv_dur_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000%@", o_suffix]];
     [o_sv_dur_value_fld setToolTip: o_toolTip];
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self resetValues:self];
index a3ff3e14f253b0c82b3d41a5e090b8b4692d3296..615b536ce5e4d1a0ca08da0e2baecd72a424b760 100644 (file)
@@ -63,7 +63,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
 {
     [o_window setTitle: _NS("Video Effects")];
     [o_window setExcludedFromWindowsMenu:YES];
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
index 430dd1068a37d03435aafa612ccfbd8c90cc46fb..69ceda496c606ef47cede22e8207f40031d3b964 100644 (file)
@@ -71,7 +71,7 @@ static VLAboutBox *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_about_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* add a colored backdrop to get a white window background */
index 049e63d1343c4fc992dbbb80ad3a15ac7042a8d4..c2fd41c0894fb70733130e7fbbada95a0af0e600 100644 (file)
@@ -65,7 +65,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self initStrings];
index a66178ae05a62d2209fd6c757e0e82ef91e8a52c..009de48020044bbf83caa6c6c650dbc1ec6ce732 100644 (file)
     BOOL b_invertedEventFromDevice = NO;
     CGFloat f_deltaY, f_deltaX = .0;
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
     {
         if ([theEvent isDirectionInvertedFromDevice])
             b_invertedEventFromDevice = YES;
index ff71629c071fd38c5cf797a1abfe5e4fc71af7bf..fb48379bfe325cb84b908b04c51c89bdebe6bcdd 100644 (file)
@@ -51,7 +51,7 @@
     [win setOpaque:NO];
     [win setHasShadow: NO];
     [win setBackgroundColor:[NSColor clearColor]];
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* let the window sit on top of everything else and start out completely transparent */
index 76c5959ce46b9e9e36f77beb2bf4924d355b25ba..5b3b99a338a9bf2a3ef833bf0296d922fe3aa567 100644 (file)
@@ -597,7 +597,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     var_AddCallback(p_playlist, "volume", VolumeUpdated, self);
     var_AddCallback(p_playlist, "mute", VolumeUpdated, self);
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
     {
         if ([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen)
             var_SetBool( p_playlist, "fullscreen", YES );
@@ -630,7 +630,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     /* yeah, we are done */
     b_nativeFullscreenMode = NO;
 #ifdef MAC_OS_X_VERSION_10_7
-    if( OSX_LION && b_video_deco )
+    if( !OSX_SNOW_LEOPARD && b_video_deco )
         b_nativeFullscreenMode = var_InheritBool( p_intf, "macosx-nativefullscreenmode" );
 #endif
 
index 632666826122d127b8aaffb410f9422bcd8bbe23..40eb95ae40907d1e42681b3026e6097e64c59c8b 100644 (file)
@@ -268,7 +268,7 @@ static NSMutableArray *blackoutWindows = NULL;
     {
         b_isset_canBecomeKeyWindow = NO;
         /* we don't want this window to be restored on relaunch */
-        if (OSX_LION)
+        if (!OSX_SNOW_LEOPARD)
             [self setRestorable:NO];
     }
     return self;
index 979e26d72c7550d6b24e01b2d40d78de858d6099..a4750e4ce5eb41580cb559d5d2131beae206a637 100644 (file)
@@ -119,7 +119,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_panel setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [o_panel setTitle: _NS("Open Source")];
index 3a7bcb6f2033d04e98a9bb763bf35b81625fb54f..a1cfbb65892611603b58ba4dca34e5d188ee69bb 100644 (file)
@@ -70,7 +70,7 @@ static VLCInfo *_o_sharedInstance = nil;
 {
     [o_info_window setExcludedFromWindowsMenu: YES];
     [o_info_window setFloatingPanel: NO];
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_info_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [o_info_window setTitle: _NS("Media Information")];
index 0db47bcada85196a5264527c48f548eefd7ef5d6..dda8b637666c80680ea098d4f99f356b82d196eb 100644 (file)
@@ -179,7 +179,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 {
     p_intf = VLCIntf;
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_prefs_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self initStrings];
index f2357f1908f06d79d42949f0537e03e0bee62777..0df588799e8169cb9eced315940a1926c2cd9ce1 100644 (file)
@@ -99,7 +99,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
     [o_sprefs_toolbar setDelegate: self];
     [o_sprefs_win setToolbar: o_sprefs_toolbar];
 
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [o_hotkeys_listbox setTarget:self];
@@ -440,7 +440,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
 #ifdef MAC_OS_X_VERSION_10_7
     b_correct_sdk = YES;
 #endif
-    if( !( b_correct_sdk && OSX_LION ))
+    if( !( b_correct_sdk && !OSX_SNOW_LEOPARD ))
     {
         [o_intf_nativefullscreen_ckb setState: NSOffState];
         [o_intf_nativefullscreen_ckb setEnabled: NO];
index 6981ccc7de7a1cf468cb8b9fa12a26e56dc56057..4946b1682b0c15b2070b09b6ee6e825f36c58cf0 100644 (file)
@@ -73,7 +73,7 @@ static VLCWizard *_o_sharedInstance = nil;
 
 - (void)awakeFromNib
 {
-    if (OSX_LION)
+    if (!OSX_SNOW_LEOPARD)
         [o_wizard_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     /* some minor cleanup */