// wxBitmapRefData
//-----------------------------------------------------------------------------
-class wxBitmapRefData: public wxObjectRefData
+class wxBitmapRefData: public wxGDIRefData
{
public:
wxBitmapRefData()
#endif
}
+ virtual bool IsOk() const { return m_surface; }
+
wxIDirectFBSurfacePtr m_surface;
wxMask *m_mask;
#if wxUSE_PALETTE
// wxBitmap
//-----------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase)
wxBitmap::wxBitmap(int width, int height, int depth)
}
#if wxUSE_IMAGE
-wxBitmap::wxBitmap(const wxImage& image, int depth)
+wxBitmap::wxBitmap(const wxImage& imageOrig, int depth)
{
- wxCHECK_RET( image.Ok(), wxT("invalid image") );
+ wxCHECK_RET( imageOrig.Ok(), wxT("invalid image") );
+
+ wxImage image(imageOrig);
+
+ // convert mask to alpha channel, because wxMask isn't implemented yet
+ // FIXME: don't do this, implement proper wxMask support
+ if ( image.HasMask() )
+ image.InitAlpha();
DFBSurfacePixelFormat format = DepthToFormat(depth);
if ( format == DSPF_UNKNOWN && image.HasAlpha() )
return;
}
}
-
- // FIXME: implement mask creation from image's mask (or alpha channel?)
- wxASSERT_MSG( !image.HasMask(), "image masks are ignored for now" );
}
wxImage wxBitmap::ConvertToImage() const
wxFAIL_MSG( "not implemented" );
}
-bool wxBitmap::IsOk() const
-{
- return (m_refData != NULL && M_BITMAP->m_surface);
-}
-
int wxBitmap::GetHeight() const
{
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
return M_BITMAP->m_surface;
}
-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(*(wxBitmapRefData *)data);
}