X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bca03736369e836cce9297509505c5972e775dd..a7734bdfb398c42321d985abdad7304bb3ac5182:/src/cocoa/bitmap.mm?ds=sidebyside diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 08e8d435fe..452a92cbee 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -19,9 +19,9 @@ #include "wx/palette.h" #include "wx/icon.h" #include "wx/colour.h" + #include "wx/image.h" #endif //WX_PRECOMP -#include "wx/image.h" #include "wx/xpmdecod.h" #include "wx/rawbmp.h" @@ -33,6 +33,8 @@ #import #import +IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase) + // ======================================================================== // wxBitmapRefData // ======================================================================== @@ -123,7 +125,7 @@ wxBitmap::wxBitmap(int w, int h, int d) (void)Create(w, h, d); } -wxBitmap::wxBitmap(void *data, wxBitmapType type, int width, int height, int depth) +wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth) { (void) Create(data, type, width, height, depth); } @@ -242,7 +244,7 @@ void wxBitmap::SetMask(wxMask *mask) M_BITMAPDATA->m_bitmapMask = mask ; } -bool wxBitmap::Ok() const +bool wxBitmap::IsOk() const { return m_refData && M_BITMAPDATA->m_ok; } @@ -346,7 +348,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) return true; } -bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth) +bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth) { UnRef(); @@ -413,24 +415,6 @@ wxImage wxBitmap::ConvertToImage() const return newImage; } -bool wxBitmap::CreateFromXpm(const char **xpm) -{ -#if wxUSE_IMAGE && wxUSE_XPM - UnRef(); - - wxCHECK_MSG( xpm, false, wxT("invalid XPM data") ); - - wxXPMDecoder decoder; - wxImage img = decoder.ReadData(xpm); - wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") ); - - *this = wxBitmap(img); - return true; -#else - return false; -#endif -} - bool wxBitmap::CreateFromImage(const wxImage& image, int depth) { UnRef();