wxArtProvider with wxBitmapBundle

This commit is contained in:
Stefan Csomor
2021-09-30 17:50:13 +02:00
committed by Vadim Zeitlin
parent ab619010bd
commit fe3e0c558e
7 changed files with 149 additions and 19 deletions

View File

@@ -15,6 +15,7 @@
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/iconbndl.h"
#include "wx/bmpbndl.h"
class WXDLLIMPEXP_FWD_CORE wxArtProvidersList;
class WXDLLIMPEXP_FWD_CORE wxArtProviderCache;
@@ -157,6 +158,14 @@ public:
const wxArtClient& client = wxASCII_STR(wxART_OTHER),
const wxSize& size = wxDefaultSize);
// Query the providers for bitmapbundle with given ID and return it.
// If none is available, then the search for a bitmap with the same properties
// is performed. If successful, the bitmap is wrapped into a bitmap bundle.
static wxBitmapBundle
GetBitmapBundle(const wxArtID& id,
const wxArtClient& client = wxASCII_STR(wxART_OTHER),
const wxSize& size = wxDefaultSize);
// Query the providers for icon with given ID and return it. Return
// wxNullIcon if no provider provides it.
static wxIcon GetIcon(const wxArtID& id,
@@ -225,6 +234,15 @@ protected:
return wxNullBitmap;
}
// Derived classes must override CreateBitmapBundle if they provide
// a bundle that cannot be represented through an ordinary bitmap.
virtual wxBitmapBundle CreateBitmapBundle(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
return wxBitmapBundle(CreateBitmap(id, client, size));
}
virtual wxIconBundle CreateIconBundle(const wxArtID& WXUNUSED(id),
const wxArtClient& WXUNUSED(client))
{

View File

@@ -44,7 +44,7 @@ WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCFURL( CFURLRef urlref );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetIconForType(OSType type );
void WXDLLIMPEXP_CORE wxOSXSetImageSize(WX_NSImage image, CGFloat width, CGFloat height);
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
wxBitmapBundle WXDLLIMPEXP_CORE wxOSXCreateSystemBitmapBundle(const wxString& id, const wxString &client, const wxSize& size);
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();
WXWindow WXDLLIMPEXP_CORE wxOSXGetKeyWindow();
WXImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromNSCursor(const WXHCURSOR cursor);

View File

@@ -34,7 +34,7 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
CGImageRef inImage) ;
WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image );
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
wxBitmapBundle WXDLLIMPEXP_CORE wxOSXCreateSystemBitmapBundle(const wxString& id, const wxString &client, const wxSize& size);
class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
{