X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16fc7c452414973e2cfd1e3975ae1cedd99e3397..2b42a87073839b2b31c105f08080626ba32b40e3:/src/x11/bitmap.cpp diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 2af78decca..7306e90644 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,12 +432,12 @@ 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)); } @@ -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)