]> git.sesse.net Git - vlc/commitdiff
gui/*macosx: Don't rely on carbon or on old non 64 bits API when possible.
authorPierre d'Herbemont <pdherbemont@free.fr>
Sun, 12 Apr 2009 21:31:50 +0000 (14:31 -0700)
committerPierre d'Herbemont <pdherbemont@free.fr>
Sun, 12 Apr 2009 21:35:30 +0000 (14:35 -0700)
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/vout.m
modules/gui/minimal_macosx/VLCMinimalVoutWindow.m

index 2ffaa3ba02b95470b1048d25adf8d4953be28e5c..e2ff658dc2204266b01a7167eb3056d8b06ea484 100644 (file)
@@ -26,9 +26,6 @@
  * Preamble
  *****************************************************************************/
 
-/* DisableScreenUpdates, SetSystemUIMode, ... */
-#import <Carbon/Carbon.h>
-
 #import "intf.h"
 #import "controls.h"
 #import "vout.h"
             CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
  
             if ([screen isMainScreen])
-                SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+                [NSMenu setMenuBarVisible:NO];
  
             [[self contentView] replaceSubview:o_view with:o_temp_view];
             [o_temp_view setFrame:[o_view frame]];
         }
  
         /* Make sure we don't see the o_view disappearing of the screen during this operation */
-               #ifndef __x86_64__
-                       DisableScreenUpdates();
-               #endif
+        NSEnableScreenUpdates();
                [[self contentView] replaceSubview:o_view with:o_temp_view];
         [o_temp_view setFrame:[o_view frame]];
         [o_fullscreen_window setContentView:o_view];
         [o_fullscreen_window makeKeyAndOrderFront:self];
-               #ifndef __x86_64__
-                       EnableScreenUpdates();
-               #endif
+        NSDisableScreenUpdates();
     }
 
     /* We are in fullscreen (and no animation is running) */
     }
  
     if ([screen isMainScreen])
-        SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+        [NSMenu setMenuBarVisible:NO];
 
     dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
     dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
         CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
 
         [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-        SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+        [NSMenu setMenuBarVisible:YES];
 
         /* Will release the lock */
         [self hasEndedFullscreen];
     [self orderFront: self];
 
     [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+    [NSMenu setMenuBarVisible:YES];
 
     if (o_fullscreen_anim1)
     {
 {
     /* This function is private and should be only triggered at the end of the fullscreen change animation */
     /* Make sure we don't see the o_view disappearing of the screen during this operation */
-       #ifndef __x86_64__
-               DisableScreenUpdates();
-       #endif
+    NSDisableScreenUpdates();
     [o_view retain];
     [o_view removeFromSuperviewWithoutNeedingDisplay];
     [[self contentView] replaceSubview:o_temp_view with:o_view];
     if ([self isVisible])
         [super makeKeyAndOrderFront:self]; /* our version contains a workaround */
     [o_fullscreen_window orderOut: self];
-       #ifndef __x86_64__
-               EnableScreenUpdates();
-       #endif
+    NSEnableScreenUpdates();
 
     [o_fullscreen_window release];
     o_fullscreen_window = nil;
index 9027baf14de51cdb381c263233aef567eeac3d12..224ed25f48363f64ebd811760ee1966d488b9b16 100644 (file)
 
 /* prevent system sleep */
 #import <CoreServices/CoreServices.h>
-#import <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
-
-/* SystemUIMode */
-#import <Carbon/Carbon.h>
 
 #include <vlc_keys.h>
 
@@ -1117,7 +1113,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     [self setMovableByWindowBackground: NO];
 
     if( [screen isMainScreen] )
-        SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+        [NSMenu setMenuBarVisible:NO];
 
     initialFrame = [self frame];
     [self setFrame:[screen frame] display:YES animate:YES];
@@ -1138,7 +1134,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     [NSScreen unblackoutScreens];
 
     [[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
-    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+    [NSMenu setMenuBarVisible:YES];
+
     [self setFrame:initialFrame display:YES animate:YES];
     [self setMovableByWindowBackground: YES];
     if( var_GetBool( p_vout, "video-on-top" ) )
index f00b832058ea0989a206665c505aab3c90dbd197..8d998c9bf8a991607e72bcd236cc08a504e93380 100644 (file)
@@ -29,9 +29,6 @@
 #include "VLCOpenGLVoutView.h"
 #include "VLCMinimalVoutWindow.h"
 
-/* SetSystemUIMode, ... */
-#import <Carbon/Carbon.h>
-
 #import <Cocoa/Cocoa.h>
 
 @implementation VLCMinimalVoutWindow
 {
     fullscreen = YES;
     initialFrame = [self frame];
-    SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+    [NSMenu setMenuBarVisible:NO];
     [self setFrame:[[self screen] frame] display:YES animate:YES];
 }
 
 - (void)leaveFullscreen
 {
     fullscreen = NO;
-    SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
+    [NSMenu setMenuBarVisible:YES];
     [self setFrame:initialFrame display:YES animate:YES];
 }