Move some things to wxBitmapBase to avoid much duplication.
Use proper const for XPM data, and const void* for arbitary bitmap data. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user