git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74303
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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);
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();
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 );
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();
+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
#endif
#if wxOSX_USE_COCOA
-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)] )
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
if ( [ [NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)] )
wxCFRef<CFURLRef> imageURL;
wxCFRef<CFURLRef> imageURL;
if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 )
{
imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname2x, restype, NULL));
scale = 2.0;
}
if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 )
{
imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname2x, restype, NULL));
scale = 2.0;
}
if ( imageURL.get() == NULL )
{
if ( imageURL.get() == NULL )
{