// wxBitmap
//-----------------------------------------------------------------------------
-class wxBitmapRefData: public wxObjectRefData
+class wxBitmapRefData: public wxGDIRefData
{
public:
wxBitmapRefData();
virtual ~wxBitmapRefData();
+ virtual bool IsOk() const { return m_pixmap || m_pixbuf; }
+
GdkPixmap *m_pixmap;
GdkPixbuf *m_pixbuf;
wxMask *m_mask;
#endif // wxUSE_IMAGE
-bool wxBitmap::IsOk() const
-{
- return (m_refData != NULL) &&
- (
- M_BMPDATA->m_pixbuf ||
- M_BMPDATA->m_pixmap
- );
-}
-
int wxBitmap::GetHeight() const
{
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
wxImage image = ConvertToImage();
return image.Ok() && image.SaveFile(name, type);
#else // !wxUSE_IMAGE
+ wxUnusedVar(name);
+ wxUnusedVar(type);
+
return false;
#endif // wxUSE_IMAGE
}
const bool hasAlpha = HasAlpha();
// allow access if bpp is valid and matches existence of alpha
if (pixbuf != NULL && (
- bpp == 24 && !hasAlpha ||
- bpp == 32 && hasAlpha))
+ (bpp == 24 && !hasAlpha) ||
+ (bpp == 32 && hasAlpha)))
{
data.m_height = gdk_pixbuf_get_height( pixbuf );
data.m_width = gdk_pixbuf_get_width( pixbuf );
gdk_pixbuf_get_has_alpha(M_BMPDATA->m_pixbuf);
}
-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
{
const wxBitmapRefData* oldRef = wx_static_cast(const wxBitmapRefData*, data);
wxBitmapRefData* newRef = new wxBitmapRefData;
return newRef;
}
-//-----------------------------------------------------------------------------
-// wxBitmapHandler
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
-
/* static */ void wxBitmap::InitStandardHandlers()
{
// TODO: Insert handler based on GdkPixbufs handler later