XQuartz: RandR: Use deprecated CG APIs only on Leopard and earlier
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
629c3f473b
commit
59cd93f48a
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
*
|
|
||||||
* Quartz-specific support for the XRandR extension
|
* Quartz-specific support for the XRandR extension
|
||||||
*
|
*
|
||||||
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons,
|
* Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons,
|
||||||
* 2010 Jan Hauffa.
|
* 2010 Jan Hauffa.
|
||||||
|
* 2010 Apple Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
@ -39,6 +39,8 @@
|
||||||
#include "quartzRandR.h"
|
#include "quartzRandR.h"
|
||||||
#include "quartz.h"
|
#include "quartz.h"
|
||||||
|
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
|
|
||||||
#include <X11/extensions/randr.h>
|
#include <X11/extensions/randr.h>
|
||||||
#include <randrstr.h>
|
#include <randrstr.h>
|
||||||
#include <IOKit/graphics/IOGraphicsTypes.h>
|
#include <IOKit/graphics/IOGraphicsTypes.h>
|
||||||
|
@ -51,7 +53,7 @@ typedef Bool (*QuartzModeCallback)
|
||||||
(ScreenPtr, CGDirectDisplayID, QuartzModeInfoPtr, void *);
|
(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) {
|
static long getDictLong (CFDictionaryRef dictRef, CFStringRef key) {
|
||||||
long value;
|
long value;
|
||||||
|
@ -140,7 +142,7 @@ static Bool QuartzRandREnumerateModes (ScreenPtr pScreen,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* defined(USE_DEPRECATED_CG_API) */
|
#else /* we have the new CG APIs from Snow Leopard */
|
||||||
|
|
||||||
static void QuartzRandRGetModeInfo (CGDisplayModeRef modeRef,
|
static void QuartzRandRGetModeInfo (CGDisplayModeRef modeRef,
|
||||||
QuartzModeInfoPtr pMode) {
|
QuartzModeInfoPtr pMode) {
|
||||||
|
@ -220,7 +222,7 @@ static Bool QuartzRandREnumerateModes (ScreenPtr pScreen,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* defined(USE_DEPRECATED_CG_API) */
|
#endif /* Snow Leopard CoreGraphics APIs */
|
||||||
|
|
||||||
|
|
||||||
static Bool QuartzRandRModesEqual (QuartzModeInfoPtr pMode1,
|
static Bool QuartzRandRModesEqual (QuartzModeInfoPtr pMode1,
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* quartzRandR.h
|
* quartzRandR.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010 Jan Hauffa.
|
* Copyright (c) 2010 Jan Hauffa.
|
||||||
|
* 2010 Apple Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* 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.
|
* 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);
|
Bool QuartzRandRInit (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue