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:
Stefan Csomor
2014-08-09 17:02:17 +00:00
parent ae2f2a1ece
commit f71ea69505
3 changed files with 19 additions and 81 deletions

View File

@@ -451,18 +451,12 @@ 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;
}
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage)
{

View File

@@ -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
}
#elif wxOSX_USE_IPHONE
cfFontFamilies = CopyAvailableFontFamilyNames();
#endif

View File

@@ -71,9 +71,6 @@ int wxDisplayDepth()
{
int theDepth = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
if ( UMAGetSystemVersion() >= 0x1060 )
{
CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(kCGDirectMainDisplay);
CFStringRef encoding = CGDisplayModeCopyPixelEncoding(currentMode);
@@ -88,14 +85,7 @@ int wxDisplayDepth()
CFRelease(encoding);
CGDisplayModeRelease(currentMode);
}
else
#endif
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
theDepth = (int) CGDisplayBitsPerPixel(CGMainDisplayID());
#endif
}
return theDepth;
}