[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 1
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4 |
Date: |
Sun, 10 May 2015 23:19:17 +0100 |
Remove compatibility ifdefs that work around OSX 10.4 not providing
various typedefs and functions.
Signed-off-by: Peter Maydell <address@hidden>
---
ui/cocoa.m | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6e69952..f6c5fb4 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -30,9 +30,6 @@
#include "ui/input.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
#define MAC_OS_X_VERSION_10_5 1050
#endif
@@ -376,11 +373,7 @@ QemuCocoaView *cocoaView;
);
// selective drawing code (draws only dirty rectangles) (OS X >= 10.4)
const NSRect *rectList;
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
NSInteger rectCount;
-#else
- int rectCount;
-#endif
int i;
CGImageRef clipImageRef;
CGRect clipRect;
@@ -490,33 +483,25 @@ QemuCocoaView *cocoaView;
isFullscreen = FALSE;
[self ungrabMouse];
[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
[self exitFullScreenModeWithOptions:nil];
} else {
-#endif
[fullScreenWindow close];
[normalWindow setContentView: self];
[normalWindow makeKeyAndOrderFront: self];
[NSMenu setMenuBarVisible:YES];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
}
-#endif
} else { // switch from desktop to fullscreen
isFullscreen = TRUE;
[normalWindow orderOut: nil]; /* Hide the window */
[self grabMouse];
[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
[self enterFullScreenMode:[NSScreen mainScreen]
withOptions:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens,
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber
numberWithBool:NO], kCGDisplayModeIsStretched, nil], NSFullScreenModeSetting,
nil]];
} else {
-#endif
[NSMenu setMenuBarVisible:NO];
fullScreenWindow = [[NSWindow alloc]
initWithContentRect:[[NSScreen mainScreen] frame]
styleMask:NSBorderlessWindowMask
@@ -528,9 +513,7 @@ QemuCocoaView *cocoaView;
[self setFrame:NSMakeRect(cx, cy, cw, ch)];
[[fullScreenWindow contentView] addSubview: self];
[fullScreenWindow makeKeyAndOrderFront:self];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
}
-#endif
}
}
--
2.2.1
- [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support), Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4,
Peter Maydell <=
- [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support, Peter Maydell, 2015/05/10
- Re: [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support), Programmingkid, 2015/05/11