summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-07-25 22:25:49 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2010-09-28 09:50:34 -0700
commit59cd93f48a3a0a34781d4a94a3cd05a575e2d4ba (patch)
treeb5fb6ac6739a598876d593512e9edf9b0cdd85e0
parent629c3f473b7415069a87ef4717ec3d701978dc48 (diff)
XQuartz: RandR: Use deprecated CG APIs only on Leopard and earlier
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--hw/xquartz/quartzRandR.c10
-rw-r--r--hw/xquartz/quartzRandR.h6
2 files changed, 11 insertions, 5 deletions
diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index b3b315c59..e46e90405 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -1,9 +1,9 @@
/*
- *
* Quartz-specific support for the XRandR extension
*
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons,
* 2010 Jan Hauffa.
+ * 2010 Apple Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -39,6 +39,8 @@
#include "quartzRandR.h"
#include "quartz.h"
+#include <AvailabilityMacros.h>
+
#include <X11/extensions/randr.h>
#include <randrstr.h>
#include <IOKit/graphics/IOGraphicsTypes.h>
@@ -51,7 +53,7 @@ typedef Bool (*QuartzModeCallback)
(ScreenPtr, CGDirectDisplayID, QuartzModeInfoPtr, void *);
-#if defined(USE_DEPRECATED_CG_API)
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
static long getDictLong (CFDictionaryRef dictRef, CFStringRef key) {
long value;
@@ -140,7 +142,7 @@ static Bool QuartzRandREnumerateModes (ScreenPtr pScreen,
return TRUE;
}
-#else /* defined(USE_DEPRECATED_CG_API) */
+#else /* we have the new CG APIs from Snow Leopard */
static void QuartzRandRGetModeInfo (CGDisplayModeRef modeRef,
QuartzModeInfoPtr pMode) {
@@ -220,7 +222,7 @@ static Bool QuartzRandREnumerateModes (ScreenPtr pScreen,
return TRUE;
}
-#endif /* defined(USE_DEPRECATED_CG_API) */
+#endif /* Snow Leopard CoreGraphics APIs */
static Bool QuartzRandRModesEqual (QuartzModeInfoPtr pMode1,
diff --git a/hw/xquartz/quartzRandR.h b/hw/xquartz/quartzRandR.h
index 711c3f3f3..d57dc3bf8 100644
--- a/hw/xquartz/quartzRandR.h
+++ b/hw/xquartz/quartzRandR.h
@@ -2,6 +2,7 @@
* quartzRandR.h
*
* Copyright (c) 2010 Jan Hauffa.
+ * 2010 Apple Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -27,6 +28,9 @@
* use or other dealings in this Software without prior written authorization.
*/
-#define USE_DEPRECATED_CG_API 1
+#ifndef _QUARTZRANDR_H_
+#define _QUARTZRANDR_H_
Bool QuartzRandRInit (ScreenPtr pScreen);
+
+#endif