WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0 );
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scale = NULL );
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage);
-double WXDLLIMPEXP_CORE wxOSXGetMainScreenContentScaleFactor();
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();
WXDLLIMPEXP_CORE CGDataConsumerRef wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data );
WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
-CGColorSpaceRef WXDLLIMPEXP_CORE wxMacGetGenericRGBColorSpace(void);
+WXDLLIMPEXP_CORE CGColorSpaceRef wxMacGetGenericRGBColorSpace(void);
+
+WXDLLIMPEXP_CORE double wxOSXGetMainScreenContentScaleFactor();
class wxWindowMac;
// to
#endif
}
+double wxOSXGetMainScreenContentScaleFactor()
+{
+ double scale;
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
+ if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
+ {
+ scale=[[UIScreen mainScreen] scale];
+ }
+ else
+#endif
+ {
+ scale=1.0;
+ }
+
+ return scale;
+}
+
+#endif
+
+#if wxOSX_USE_CARBON
+
+double wxOSXGetMainScreenContentScaleFactor()
+{
+ return 1.0;
+}
+
#endif
#if wxOSX_USE_COCOA
return hbitmap;
}
-double WXDLLIMPEXP_CORE wxOSXGetMainScreenContentScaleFactor()
+double wxOSXGetMainScreenContentScaleFactor()
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
if ( [ [NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)] )
wxCFRef<CFURLRef> imageURL;
-#if wxOSX_USE_COCOA
if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 )
{
imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname2x, restype, NULL));
scale = 2.0;
}
-#endif
if ( imageURL.get() == NULL )
{