Removing non-native bitmap code, using common code for iOS and macOS

This commit is contained in:
Stefan Csomor
2018-09-21 20:58:06 +02:00
committed by Vadim Zeitlin
parent bca583234e
commit 266f32493e
6 changed files with 147 additions and 253 deletions

View File

@@ -118,7 +118,7 @@ public:
// creates an bitmap from the native image format
wxBitmap(CGImageRef image, double scale = 1.0);
wxBitmap(WX_NSImage image);
wxBitmap(WXImage image);
wxBitmap(CGContextRef bitmapcontext);
// Create a bitmap compatible with the given DC
@@ -147,7 +147,7 @@ public:
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
bool Create( CGImageRef image, double scale = 1.0 );
bool Create( WX_NSImage image );
bool Create( WXImage image );
bool Create( CGContextRef bitmapcontext);
// Create a bitmap compatible with the given DC, inheriting its magnification factor
@@ -207,13 +207,16 @@ public:
// returns a CGImageRef which must released after usage with CGImageRelease
CGImageRef CreateCGImage() const ;
WXImage GetImage() const;
#if wxOSX_USE_COCOA
// returns an autoreleased version of the image
WX_NSImage GetNSImage() const;
WX_NSImage GetNSImage() const
{ return GetImage(); }
#endif
#if wxOSX_USE_IPHONE
// returns an autoreleased version of the image
WX_UIImage GetUIImage() const;
WX_UIImage GetUIImage() const
{ return GetImage(); }
#endif
#if WXWIN_COMPATIBILITY_3_0

View File

@@ -41,10 +41,6 @@ WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetIconForType(OSType type );
void WXDLLIMPEXP_CORE wxOSXSetImageSize(WX_NSImage image, CGFloat width, CGFloat height);
CGSize WXDLLIMPEXP_CORE wxOSXGetImageSize(WX_NSImage image);
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scale = NULL );
CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromNSImage( WX_NSImage nsimage, CGRect* r, CGContextRef cg);
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage, bool *isTemplate = NULL);
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();

View File

@@ -114,6 +114,15 @@ WXDLLIMPEXP_CORE CGColorSpaceRef wxMacGetGenericRGBColorSpace(void);
WXDLLIMPEXP_CORE double wxOSXGetMainScreenContentScaleFactor();
// UI
CGSize WXDLLIMPEXP_CORE wxOSXGetImageSize(WXImage image);
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromImage( WXImage nsimage, double *scale = NULL );
CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromImage( WXImage nsimage, CGRect* r, CGContextRef cg);
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromImage( WXImage nsimage, bool *isTemplate = NULL);
WXImage WXDLLIMPEXP_CORE wxOSXGetImageFromCGImage( CGImageRef image, double scale = 1.0, bool isTemplate = false);
class wxWindowMac;
// to
extern wxWindow* g_MacLastWindow;