X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16fc7c452414973e2cfd1e3975ae1cedd99e3397..6362d82b3ed82aa6795e4ad03160820f94c9e4d4:/src/x11/bitmap.cpp diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 2af78decca..ec233b0c93 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -227,7 +227,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) // wxBitmap //----------------------------------------------------------------------------- -class wxBitmapRefData: public wxObjectRefData +class wxBitmapRefData : public wxGDIRefData { public: wxBitmapRefData(); @@ -237,6 +237,8 @@ public: // shouldn't be called more than once as it doesn't free the existing data bool Create(int width, int height, int depth); + virtual bool IsOk() const { return m_pixmap || m_bitmap; } + Pixmap m_pixmap; Pixmap m_bitmap; Display *m_display; @@ -430,14 +432,14 @@ wxBitmap::wxBitmap(const char* const* bits) Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); } -wxObjectRefData *wxBitmap::CreateRefData() const +wxGDIRefData *wxBitmap::CreateGDIRefData() const { return new wxBitmapRefData; } -wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *data) const +wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) @@ -934,11 +936,6 @@ wxBitmap::~wxBitmap() { } -bool wxBitmap::IsOk() const -{ - return (m_refData != NULL); -} - int wxBitmap::GetHeight() const { wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); @@ -1299,8 +1296,6 @@ int GrGetPixelColor(GR_SCREEN_INFO* sinfo, GR_PALETTE* palette, GR_PIXELVAL pixe // Bitmap handlers // ============================================================================ -IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase) - #define M_BMPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) #if wxUSE_XPM @@ -1359,7 +1354,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, Pixmap mask = 0; int ErrorStatus = XpmReadFileToPixmap( xdisplay, xroot, - (char*) name.c_str(), + (char*) ((const char*) name.c_str()), &pixmap, &mask, &xpmAttr); if (ErrorStatus == XpmSuccess) @@ -1432,25 +1427,25 @@ public: virtual bool LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), - long WXUNUSED(flags), + wxBitmapType WXUNUSED(flags), int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight)) { return false; } virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), - int WXUNUSED(type), + wxBitmapType WXUNUSED(type), const wxPalette *WXUNUSED(palette) = NULL) { return false; } - virtual bool Create(wxBitmap *bitmap, const void* data, long flags, + virtual bool Create(wxBitmap *bitmap, const void* data, wxBitmapType flags, int width, int height, int depth = 1); }; IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler) bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits, - long WXUNUSED(flags), + wxBitmapType WXUNUSED(flags), int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth)) { #if wxHAVE_LIB_XPM