]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/bitmap.cpp
don't define TRACE_CLIPBOARD in release builds (fixes gcc warning)
[wxWidgets.git] / src / dfb / bitmap.cpp
index 60e0a9e861f8c497ef3737a881c385fdf69b243f..8b57fb96deaf2da115d76923ae9d71e97d31389b 100644 (file)
@@ -24,9 +24,6 @@
 #include "wx/colour.h"
 #include "wx/image.h"
 
-#warning "move this to common"
-#include "wx/xpmdecod.h"
-
 #include "wx/dfb/private.h"
 
 //-----------------------------------------------------------------------------
@@ -102,7 +99,7 @@ public:
 // wxBitmap
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject)
+IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
 IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase)
 
 wxBitmap::wxBitmap(int width, int height, int depth)
@@ -138,25 +135,6 @@ bool wxBitmap::Create(int width, int height, int depth)
     return Create(wxIDirectFB::Get()->CreateSurface(&desc));
 }
 
-#warning "FIXME: move this to common code"
-bool wxBitmap::CreateFromXpm(const char **bits)
-{
-    wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
-
-#if wxUSE_IMAGE && wxUSE_XPM
-    wxXPMDecoder decoder;
-    wxImage img = decoder.ReadData(bits);
-    wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
-
-    *this = wxBitmap(img);
-
-    return true;
-#else
-    wxFAIL_MSG( _T("creating bitmaps from XPMs not supported") );
-    return false;
-#endif // wxUSE_IMAGE && wxUSE_XPM
-}
-
 #if wxUSE_IMAGE
 wxBitmap::wxBitmap(const wxImage& image, int depth)
 {
@@ -211,17 +189,11 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
     wxFAIL_MSG( _T("not implemented") );
 }
 
-bool wxBitmap::Ok() const
+bool wxBitmap::IsOk() const
 {
     return (m_refData != NULL && M_BITMAP->m_surface);
 }
 
-bool wxBitmap::operator==(const wxBitmap& bmp) const
-{
-    // FIXME: is this the right way to compare bitmaps?
-    return (m_refData == bmp.m_refData);
-}
-
 int wxBitmap::GetHeight() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
@@ -258,6 +230,7 @@ void wxBitmap::SetMask(wxMask *mask)
 {
     wxCHECK_RET( Ok(), wxT("invalid bitmap") );
 
+    AllocExclusive();
     delete M_BITMAP->m_mask;
     M_BITMAP->m_mask = mask;
 }
@@ -350,6 +323,7 @@ void wxBitmap::SetPalette(const wxPalette& palette)
     wxCHECK_RET( Ok(), wxT("invalid bitmap") );
     wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
 
+    AllocExclusive();
     delete M_BITMAP->m_palette;
     M_BITMAP->m_palette = NULL;