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)
|
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
|
NSRect nsRect = NSRectFromCGRect(*r);
|
||||||
if ( UMAGetSystemVersion() >= 0x1060 )
|
return [nsimage CGImageForProposedRect:&nsRect
|
||||||
{
|
context:[NSGraphicsContext graphicsContextWithGraphicsPort:cg flipped:YES]
|
||||||
NSRect nsRect = NSRectFromCGRect(*r);
|
hints:nil];
|
||||||
return [nsimage CGImageForProposedRect:&nsRect
|
|
||||||
context:[NSGraphicsContext graphicsContextWithGraphicsPort:cg flipped:YES]
|
|
||||||
hints:nil];
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage)
|
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage)
|
||||||
|
@@ -45,53 +45,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
|||||||
CFArrayRef cfFontFamilies = nil;
|
CFArrayRef cfFontFamilies = nil;
|
||||||
|
|
||||||
#if wxOSX_USE_COCOA_OR_CARBON
|
#if wxOSX_USE_COCOA_OR_CARBON
|
||||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
|
cfFontFamilies = CTFontManagerCopyAvailableFontFamilyNames();
|
||||||
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
|
|
||||||
}
|
|
||||||
#elif wxOSX_USE_IPHONE
|
#elif wxOSX_USE_IPHONE
|
||||||
cfFontFamilies = CopyAvailableFontFamilyNames();
|
cfFontFamilies = CopyAvailableFontFamilyNames();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -71,31 +71,21 @@ int wxDisplayDepth()
|
|||||||
{
|
{
|
||||||
int theDepth = 0;
|
int theDepth = 0;
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
|
||||||
if ( UMAGetSystemVersion() >= 0x1060 )
|
CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode);
|
||||||
{
|
|
||||||
CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
|
if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||||
CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode);
|
theDepth = 32;
|
||||||
|
else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||||
if(CFStringCompare(encoding, CFSTR(IO32BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
theDepth = 16;
|
||||||
theDepth = 32;
|
else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||||
else if(CFStringCompare(encoding, CFSTR(IO16BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
theDepth = 8;
|
||||||
theDepth = 16;
|
|
||||||
else if(CFStringCompare(encoding, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
|
||||||
theDepth = 8;
|
|
||||||
else
|
|
||||||
theDepth = 32; // some reasonable default
|
|
||||||
|
|
||||||
CFRelease(encoding);
|
|
||||||
CGDisplayModeRelease(currentMode);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif
|
theDepth = 32; // some reasonable default
|
||||||
{
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
CFRelease(encoding);
|
||||||
theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());
|
CGDisplayModeRelease(currentMode);
|
||||||
#endif
|
|
||||||
}
|
|
||||||
return theDepth;
|
return theDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user