#if !defined(__WXUNIVERSAL__) && \
((defined(__WXGTK__) && defined(__WXGTK20__)) || defined(__WXMSW__) || \
- (defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON))
+ defined(__WXMAC__))
// *some* (partial) native implementation of wxArtProvider exists; this is
// not the same as wxArtProvider::HasNativeProvider()!
#define wxHAS_NATIVE_ART_PROVIDER_IMPL
CGImageRef inImage) ;
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image );
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage );
+wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
class WXDLLIMPEXP_FWD_CORE wxDialog;
CGImageRef inImage) ;
WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image );
+wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
{
#include "wx/image.h"
#endif
-#if wxOSX_USE_COCOA_OR_CARBON
+#include "wx/osx/private.h"
// ----------------------------------------------------------------------------
// wxMacArtProvider
class wxMacArtProvider : public wxArtProvider
{
protected:
+#if wxOSX_USE_COCOA_OR_CARBON
virtual wxIconBundle CreateIconBundle(const wxArtID& id,
const wxArtClient& client);
+#endif
+#if wxOSX_USE_COCOA_OR_IPHONE
+ virtual wxBitmap CreateBitmap(const wxArtID& id,
+ const wxArtClient& client,
+ const wxSize& size)
+ {
+ return wxOSXCreateSystemBitmap(id, client, size);
+ }
+#endif
};
/* static */ void wxArtProvider::InitNativeProvider()
wxArtProvider::Push(new wxMacArtProvider);
}
+#if wxOSX_USE_COCOA_OR_CARBON
+
// ----------------------------------------------------------------------------
// helper macros
// ----------------------------------------------------------------------------
return wxMacArtProvider_CreateIconBundle(id);
}
+#endif
// ----------------------------------------------------------------------------
// wxArtProvider::GetNativeSizeHint()
return wxDefaultSize;
}
-#endif // wxOSX_USE_COCOA_CARBON
return( newImage );
}
+wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &client, const wxSize& size)
+{
+#if 0
+ // unfortunately this only accesses images in the app bundle, not the system wide globals
+ wxCFStringRef cfname(name);
+ return wxBitmap( [[UIImage imageNamed:cfname.AsNSString()] CGImage] );
+#else
+ return wxBitmap();
+#endif
+}
+
#endif
#if wxOSX_USE_COCOA
+wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &client, const wxSize& size)
+{
+ wxCFStringRef cfname(name);
+ wxCFRef<CGImageRef> image( wxOSXCreateCGImageFromNSImage([NSImage imageNamed:cfname.AsNSString()]) );
+ return wxBitmap( image );
+}
+
// From "Cocoa Drawing Guide:Working with Images"
WX_NSImage wxOSXGetNSImageFromCGImage( CGImageRef image )
{