X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/923d28da0eed674dfd7f4a497568ac14a29f0189..3f4a2351e4c677c88c18ea812b609477adee7380:/src/x11/bitmap.cpp diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 6139786ca5..7e42116984 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -19,10 +19,10 @@ #include "wx/app.h" #include "wx/dcmemory.h" #include "wx/icon.h" + #include "wx/math.h" + #include "wx/image.h" #endif -#include "wx/image.h" - #include "wx/x11/private.h" /* No point in using libXPM for NanoX */ @@ -42,7 +42,6 @@ bool wxGetImageFromDrawable(GR_DRAW_ID drawable, int srcX, int srcY, int width, #include "wx/wfstream.h" #endif #endif -#include "wx/math.h" //----------------------------------------------------------------------------- // wxMask @@ -232,7 +231,7 @@ class wxBitmapRefData: public wxObjectRefData { public: wxBitmapRefData(); - ~wxBitmapRefData(); + virtual ~wxBitmapRefData(); WXPixmap m_pixmap; WXPixmap m_bitmap; @@ -361,7 +360,7 @@ bool wxBitmap::Create( int width, int height, int depth ) return Ok(); } -bool wxBitmap::Create(void *data, wxBitmapType type, +bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth) { UnRef(); @@ -418,11 +417,9 @@ bool wxBitmap::Create(WXPixmap pixmap) return true; } -bool wxBitmap::CreateFromXpm( const char **bits ) +wxBitmap::wxBitmap(const char* const* bits) { - wxCHECK_MSG( bits, false, wxT("NULL pointer in wxBitmap::CreateFromXpm") ); - - return Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); + Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); } bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) @@ -913,7 +910,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int depth ) { m_refData = new wxBitmapRefData; - (void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, depth); + (void) Create(bits, wxBITMAP_TYPE_XBM_DATA, width, height, depth); } wxBitmap::~wxBitmap() @@ -930,7 +927,7 @@ bool wxBitmap::operator != ( const wxBitmap& bmp ) const return m_refData != bmp.m_refData; } -bool wxBitmap::Ok() const +bool wxBitmap::IsOk() const { return (m_refData != NULL); } @@ -1321,7 +1318,7 @@ public: virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); - virtual bool Create(wxBitmap *WXUNUSED(bitmap), void *WXUNUSED(data), long WXUNUSED(flags), + virtual bool Create(wxBitmap *WXUNUSED(bitmap), const void* WXUNUSED(data), long WXUNUSED(flags), int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth) = 1) { return false; } }; @@ -1436,13 +1433,13 @@ public: const wxPalette *WXUNUSED(palette) = NULL) { return false; } - virtual bool Create(wxBitmap *bitmap, void *data, long flags, + virtual bool Create(wxBitmap *bitmap, const void* data, long flags, int width, int height, int depth = 1); }; IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler) -bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *bits, +bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits, long WXUNUSED(flags), int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth)) { @@ -1542,13 +1539,13 @@ public: const wxPalette *WXUNUSED(palette) = NULL) { return false; } - virtual bool Create(wxBitmap *bitmap, void *data, long flags, + virtual bool Create(wxBitmap *bitmap, const void* data, long flags, int width, int height, int depth = 1); }; IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler) -bool wxXBMDataHandler::Create( wxBitmap *bitmap, void *bits, +bool wxXBMDataHandler::Create( wxBitmap *bitmap, const void* bits, long WXUNUSED(flags), int width, int height, int WXUNUSED(depth)) {