removing code for pre 10.6 systems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user