Add support for template NSImages to wxBitmap

wxBitmap uses CGImage instead of NSImage internally and the conversion
looses NSImage metadata.  In particular, it looses the "template"
attribute, which is set for files ending with "Template" and loaded
trough wxArtProvider.

This change makes it easy to use template images with native controls
such as the toolbar.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-10-14 08:53:33 +00:00
parent 2e9888a4be
commit 2476c5246e
3 changed files with 20 additions and 6 deletions

View File

@@ -32,9 +32,9 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
CGContextRef inContext,
const CGRect * inBounds,
CGImageRef inImage) ;
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0 );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0, bool isTemplate = false);
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scale = NULL );
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage);
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();