Commit 739c5bd3 authored by Jeremy Huddleston Sequoia's avatar Jeremy Huddleston Sequoia
Browse files

xquartz: Remove support for Leopard and earlier versions of macOS


Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 5ad49102)
parent 2d7eb824
......@@ -46,10 +46,7 @@
#undef BOOL
#endif
@interface X11Controller : NSObject
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
<NSTableViewDataSource>
#endif
@interface X11Controller : NSObject <NSTableViewDataSource>
{
IBOutlet NSPanel *prefs_panel;
......
......@@ -868,13 +868,7 @@ extern char *bundle_id_prefix;
- (IBAction) x11_help:sender
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
AHLookupAnchor((CFStringRef)NSLocalizedString(@"Mac Help",
no comment),
CFSTR("mchlp2276"));
#else
AHLookupAnchor(CFSTR("com.apple.machelp"), CFSTR("mchlp2276"));
#endif
}
- (OSX_BOOL) validateMenuItem:(NSMenuItem *)item
......
......@@ -72,12 +72,6 @@
#include <rootlessCommon.h>
#include <Xplugin.h>
/* Work around a bug on Leopard's headers */
#if defined (__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 && MAC_OS_X_VERSION_MAX_ALLOWED < 1060
extern OSErr UpdateSystemActivity(UInt8 activity);
#define OverallAct 0
#endif
DevPrivateKeyRec quartzScreenKeyRec;
int aquaMenuBarHeight = 0;
QuartzModeProcsPtr quartzProcs = NULL;
......
......@@ -66,154 +66,6 @@ static Bool ignore_next_fake_mode_update = FALSE;
typedef int (*QuartzModeCallback)
(ScreenPtr, QuartzModeInfoPtr, void *);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
static long
getDictLong(CFDictionaryRef dictRef, CFStringRef key)
{
long value;
CFNumberRef numRef = (CFNumberRef)CFDictionaryGetValue(dictRef, key);
if (!numRef)
return 0;
if (!CFNumberGetValue(numRef, kCFNumberLongType, &value))
return 0;
return value;
}
static double
getDictDouble(CFDictionaryRef dictRef, CFStringRef key)
{
double value;
CFNumberRef numRef = (CFNumberRef)CFDictionaryGetValue(dictRef, key);
if (!numRef)
return 0.0;
if (!CFNumberGetValue(numRef, kCFNumberDoubleType, &value))
return 0.0;
return value;
}
static void
QuartzRandRGetModeInfo(CFDictionaryRef modeRef,
QuartzModeInfoPtr pMode)
{
pMode->width = (size_t)getDictLong(modeRef, kCGDisplayWidth);
pMode->height = (size_t)getDictLong(modeRef, kCGDisplayHeight);
pMode->refresh =
(int)(getDictDouble(modeRef, kCGDisplayRefreshRate) + 0.5);
if (pMode->refresh == 0)
pMode->refresh = DEFAULT_REFRESH;
pMode->ref = NULL;
pMode->pSize = NULL;
}
static Bool
QuartzRandRCopyCurrentModeInfo(CGDirectDisplayID screenId,
QuartzModeInfoPtr pMode)
{
CFDictionaryRef curModeRef = CGDisplayCurrentMode(screenId);
if (!curModeRef)
return FALSE;
QuartzRandRGetModeInfo(curModeRef, pMode);
pMode->ref = (void *)curModeRef;
CFRetain(pMode->ref);
return TRUE;
}
static Bool
QuartzRandRSetCGMode(CGDirectDisplayID screenId,
QuartzModeInfoPtr pMode)
{
CFDictionaryRef modeRef = (CFDictionaryRef)pMode->ref;
return (CGDisplaySwitchToMode(screenId, modeRef) == kCGErrorSuccess);
}
static Bool
QuartzRandREnumerateModes(ScreenPtr pScreen,
QuartzModeCallback callback,
void *data)
{
Bool retval = FALSE;
QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
/* Just an 800x600 fallback if we have no attached heads */
if (pQuartzScreen->displayIDs) {
CFDictionaryRef curModeRef, modeRef;
long curBpp;
CFArrayRef modes;
QuartzModeInfo modeInfo;
int i;
CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0];
curModeRef = CGDisplayCurrentMode(screenId);
if (!curModeRef)
return FALSE;
curBpp = getDictLong(curModeRef, kCGDisplayBitsPerPixel);
modes = CGDisplayAvailableModes(screenId);
if (!modes)
return FALSE;
for (i = 0; i < CFArrayGetCount(modes); i++) {
int cb;
modeRef = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
/* Skip modes that are not usable on the current display or have a
different pixel encoding than the current mode. */
if (((unsigned long)getDictLong(modeRef, kCGDisplayIOFlags) &
kDisplayModeUsableFlags) != kDisplayModeUsableFlags)
continue;
if (getDictLong(modeRef, kCGDisplayBitsPerPixel) != curBpp)
continue;
QuartzRandRGetModeInfo(modeRef, &modeInfo);
modeInfo.ref = (void *)modeRef;
cb = callback(pScreen, &modeInfo, data);
if (cb == CALLBACK_CONTINUE)
retval = TRUE;
else if (cb == CALLBACK_SUCCESS)
return TRUE;
else if (cb == CALLBACK_ERROR)
return FALSE;
}
}
switch (callback(pScreen, &pQuartzScreen->rootlessMode, data)) {
case CALLBACK_SUCCESS:
return TRUE;
case CALLBACK_ERROR:
return FALSE;
case CALLBACK_CONTINUE:
retval = TRUE;
default:
break;
}
switch (callback(pScreen, &pQuartzScreen->fullscreenMode, data)) {
case CALLBACK_SUCCESS:
return TRUE;
case CALLBACK_ERROR:
return FALSE;
case CALLBACK_CONTINUE:
retval = TRUE;
default:
break;
}
return retval;
}
#else /* we have the new CG APIs from Snow Leopard */
static void
QuartzRandRGetModeInfo(CGDisplayModeRef modeRef,
QuartzModeInfoPtr pMode)
......@@ -350,8 +202,6 @@ QuartzRandREnumerateModes(ScreenPtr pScreen,
return retval;
}
#endif /* Snow Leopard CoreGraphics APIs */
static Bool
QuartzRandRModesEqual(QuartzModeInfoPtr pMode1,
QuartzModeInfoPtr pMode2)
......
......@@ -331,10 +331,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
DEBUG_LOG("index=%d depth=%d\n", index, depth);
if (depth == -1) {
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
CGDisplayBitsPerSample(kCGDirectMainDisplay);
#else
CGDisplayModeRef modeRef;
CFStringRef encStrRef;
......@@ -364,12 +360,9 @@ xprAddScreen(int index, ScreenPtr pScreen)
}
CFRelease(encStrRef);
#endif
}
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
have_depth:
#endif
switch (depth) {
case 8: // pseudo-working
dfb->visuals = PseudoColorMask;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment