From f71ea69505f90d9adf033461d7c198fb440a6df6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 9 Aug 2014 17:02:17 +0000 Subject: [PATCH] removing code for pre 10.6 systems git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/utilscocoa.mm | 14 +++-------- src/osx/core/fontenum.cpp | 48 +----------------------------------- src/osx/utils_osx.cpp | 38 +++++++++++----------------- 3 files changed, 19 insertions(+), 81 deletions(-) diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 1ec5dd8e67..05251c0e56 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -452,16 +452,10 @@ WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref ) CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromNSImage( WX_NSImage nsimage, CGRect* r, CGContextRef cg) { -#if wxOSX_USE_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 - if ( UMAGetSystemVersion() >= 0x1060 ) - { - NSRect nsRect = NSRectFromCGRect(*r); - return [nsimage CGImageForProposedRect:&nsRect - context:[NSGraphicsContext graphicsContextWithGraphicsPort:cg flipped:YES] - hints:nil]; - } -#endif - return NULL; + NSRect nsRect = NSRectFromCGRect(*r); + return [nsimage CGImageForProposedRect:&nsRect + context:[NSGraphicsContext graphicsContextWithGraphicsPort:cg flipped:YES] + hints:nil]; } CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage) diff --git a/src/osx/core/fontenum.cpp b/src/osx/core/fontenum.cpp index 74bf8039e9..2fc33ff908 100644 --- a/src/osx/core/fontenum.cpp +++ b/src/osx/core/fontenum.cpp @@ -45,53 +45,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, CFArrayRef cfFontFamilies = nil; #if wxOSX_USE_COCOA_OR_CARBON -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) - if ( UMAGetSystemVersion() >= 0x1060 ) - cfFontFamilies = CTFontManagerCopyAvailableFontFamilyNames(); - else -#endif - { -#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6) - // - // From Apple's QA 1471 http://developer.apple.com/qa/qa2006/qa1471.html - // - - CFMutableArrayRef atsfontnames = CFArrayCreateMutable(kCFAllocatorDefault,0,&kCFTypeArrayCallBacks);; - - ATSFontFamilyIterator theFontFamilyIterator = NULL; - ATSFontFamilyRef theATSFontFamilyRef = 0; - OSStatus status = noErr; - - // Create the iterator - status = ATSFontFamilyIteratorCreate(kATSFontContextLocal, nil,nil, - kATSOptionFlagsUnRestrictedScope, - &theFontFamilyIterator ); - - while (status == noErr) - { - // Get the next font in the iteration. - status = ATSFontFamilyIteratorNext( theFontFamilyIterator, &theATSFontFamilyRef ); - if(status == noErr) - { - CFStringRef theName = NULL; - ATSFontFamilyGetName(theATSFontFamilyRef, kATSOptionFlagsDefault, &theName); - CFArrayAppendValue(atsfontnames, theName); - CFRelease(theName); - - } - else if (status == kATSIterationScopeModified) // Make sure the font database hasn't changed. - { - // reset the iterator - status = ATSFontFamilyIteratorReset (kATSFontContextLocal, nil, nil, - kATSOptionFlagsUnRestrictedScope, - &theFontFamilyIterator); - CFArrayRemoveAllValues(atsfontnames); - } - } - ATSFontFamilyIteratorRelease(&theFontFamilyIterator); - cfFontFamilies = atsfontnames; -#endif - } + cfFontFamilies = CTFontManagerCopyAvailableFontFamilyNames(); #elif wxOSX_USE_IPHONE cfFontFamilies = CopyAvailableFontFamilyNames(); #endif diff --git a/src/osx/utils_osx.cpp b/src/osx/utils_osx.cpp index bfcf65f57c..9f449c9b22 100644 --- a/src/osx/utils_osx.cpp +++ b/src/osx/utils_osx.cpp @@ -71,31 +71,21 @@ int wxDisplayDepth() { int theDepth = 0; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 - if ( UMAGetSystemVersion() >= 0x1060 ) - { - CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); - CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode); - - if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 32; - else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 16; - else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) - theDepth = 8; - else - theDepth = 32; // some reasonable default - - CFRelease(encoding); - CGDisplayModeRelease(currentMode); - } + CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay); + CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode); + + if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 32; + else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 16; + else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) + theDepth = 8; else -#endif - { -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID()); -#endif - } + theDepth = 32; // some reasonable default + + CFRelease(encoding); + CGDisplayModeRelease(currentMode); + return theDepth; }