ui/cocoa: Remove compatibility ifdefs for OSX 10.4
Remove compatibility ifdefs that work around OSX 10.4 not providing various typedefs and functions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1431296361-16981-3-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
b63901d84c
commit
89424ff32f
17
ui/cocoa.m
17
ui/cocoa.m
|
@ -30,9 +30,6 @@
|
||||||
#include "ui/input.h"
|
#include "ui/input.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
|
|
||||||
#ifndef MAC_OS_X_VERSION_10_4
|
|
||||||
#define MAC_OS_X_VERSION_10_4 1040
|
|
||||||
#endif
|
|
||||||
#ifndef MAC_OS_X_VERSION_10_5
|
#ifndef MAC_OS_X_VERSION_10_5
|
||||||
#define MAC_OS_X_VERSION_10_5 1050
|
#define MAC_OS_X_VERSION_10_5 1050
|
||||||
#endif
|
#endif
|
||||||
|
@ -376,11 +373,7 @@ QemuCocoaView *cocoaView;
|
||||||
);
|
);
|
||||||
// selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
|
// selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
|
||||||
const NSRect *rectList;
|
const NSRect *rectList;
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
NSInteger rectCount;
|
NSInteger rectCount;
|
||||||
#else
|
|
||||||
int rectCount;
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
CGImageRef clipImageRef;
|
CGImageRef clipImageRef;
|
||||||
CGRect clipRect;
|
CGRect clipRect;
|
||||||
|
@ -490,33 +483,25 @@ QemuCocoaView *cocoaView;
|
||||||
isFullscreen = FALSE;
|
isFullscreen = FALSE;
|
||||||
[self ungrabMouse];
|
[self ungrabMouse];
|
||||||
[self setContentDimensions];
|
[self setContentDimensions];
|
||||||
// test if host supports "exitFullScreenModeWithOptions" at compile time
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
if ([NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)]) { // test if "exitFullScreenModeWithOptions" is supported on host at runtime
|
if ([NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)]) { // test if "exitFullScreenModeWithOptions" is supported on host at runtime
|
||||||
[self exitFullScreenModeWithOptions:nil];
|
[self exitFullScreenModeWithOptions:nil];
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
[fullScreenWindow close];
|
[fullScreenWindow close];
|
||||||
[normalWindow setContentView: self];
|
[normalWindow setContentView: self];
|
||||||
[normalWindow makeKeyAndOrderFront: self];
|
[normalWindow makeKeyAndOrderFront: self];
|
||||||
[NSMenu setMenuBarVisible:YES];
|
[NSMenu setMenuBarVisible:YES];
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
} else { // switch from desktop to fullscreen
|
} else { // switch from desktop to fullscreen
|
||||||
isFullscreen = TRUE;
|
isFullscreen = TRUE;
|
||||||
[normalWindow orderOut: nil]; /* Hide the window */
|
[normalWindow orderOut: nil]; /* Hide the window */
|
||||||
[self grabMouse];
|
[self grabMouse];
|
||||||
[self setContentDimensions];
|
[self setContentDimensions];
|
||||||
// test if host supports "enterFullScreenMode:withOptions" at compile time
|
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
if ([NSView respondsToSelector:@selector(enterFullScreenMode:withOptions:)]) { // test if "enterFullScreenMode:withOptions" is supported on host at runtime
|
if ([NSView respondsToSelector:@selector(enterFullScreenMode:withOptions:)]) { // test if "enterFullScreenMode:withOptions" is supported on host at runtime
|
||||||
[self enterFullScreenMode:[NSScreen mainScreen] withOptions:[NSDictionary dictionaryWithObjectsAndKeys:
|
[self enterFullScreenMode:[NSScreen mainScreen] withOptions:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens,
|
[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens,
|
||||||
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], kCGDisplayModeIsStretched, nil], NSFullScreenModeSetting,
|
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], kCGDisplayModeIsStretched, nil], NSFullScreenModeSetting,
|
||||||
nil]];
|
nil]];
|
||||||
} else {
|
} else {
|
||||||
#endif
|
|
||||||
[NSMenu setMenuBarVisible:NO];
|
[NSMenu setMenuBarVisible:NO];
|
||||||
fullScreenWindow = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
|
fullScreenWindow = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
|
||||||
styleMask:NSBorderlessWindowMask
|
styleMask:NSBorderlessWindowMask
|
||||||
|
@ -528,9 +513,7 @@ QemuCocoaView *cocoaView;
|
||||||
[self setFrame:NSMakeRect(cx, cy, cw, ch)];
|
[self setFrame:NSMakeRect(cx, cy, cw, ch)];
|
||||||
[[fullScreenWindow contentView] addSubview: self];
|
[[fullScreenWindow contentView] addSubview: self];
|
||||||
[fullScreenWindow makeKeyAndOrderFront:self];
|
[fullScreenWindow makeKeyAndOrderFront:self];
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue