+void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
+{
+ wxCHECK_MSG( Ok(), NULL, "invalid bitmap" );
+
+ AllocExclusive();
+
+ DFBSurfacePixelFormat format;
+ if ( bpp == 32 )
+ format = DSPF_ARGB;
+ else
+ format = DSPF_RGB24;
+
+ // requested format is not what this bitmap uses
+ if ( format != M_BITMAP->m_surface->GetPixelFormat() )
+ return NULL;
+
+ void *bits = NULL;
+ if ( !M_BITMAP->m_surface->Lock
+ (
+ (DFBSurfaceLockFlags)(DSLF_READ | DSLF_WRITE),
+ &bits,
+ &data.m_stride
+ ) )
+ return NULL;
+
+ M_BITMAP->m_surface->GetSize(&data.m_width, &data.m_height);
+
+ return bits;
+}
+
+void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
+{
+ M_BITMAP->m_surface->Unlock();
+}
+
+bool wxBitmap::HasAlpha() const
+{
+ wxCHECK_MSG( Ok(), false, "invalid bitmap" );
+
+ return M_BITMAP->m_surface->GetPixelFormat() == DSPF_ARGB;
+}
+