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:
Paul Cornett
2006-10-08 08:04:49 +00:00
parent 9ce05df4bc
commit 452418c4b0
33 changed files with 166 additions and 479 deletions

View File

@@ -48,7 +48,7 @@ use:
wxRect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight())); wxRect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight()));
\end{verbatim} \end{verbatim}
\func{}{wxBitmap}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} \func{}{wxBitmap}{\param{const void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
Creates a bitmap from the given data which is interpreted in platform-dependent Creates a bitmap from the given data which is interpreted in platform-dependent
manner. manner.
@@ -75,7 +75,7 @@ or visual. Some platforms only support 1 for monochrome and -1 for the current
colour setting. Beginning with version 2.5.4 of wxWidgets a depth of 32 including colour setting. Beginning with version 2.5.4 of wxWidgets a depth of 32 including
an alpha channel is supported under MSW, Mac and GTK+. an alpha channel is supported under MSW, Mac and GTK+.
\func{}{wxBitmap}{\param{const char**}{ bits}} \func{}{wxBitmap}{\param{const char* const*}{ bits}}
Creates a bitmap from XPM data. Creates a bitmap from XPM data.
@@ -260,7 +260,7 @@ Creates the bitmap from an icon.
Creates a fresh bitmap. If the final argument is omitted, the display depth of Creates a fresh bitmap. If the final argument is omitted, the display depth of
the screen is used. the screen is used.
\func{virtual bool}{Create}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} \func{virtual bool}{Create}{\param{const void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
Creates a bitmap from the given data, which can be of arbitrary type. Creates a bitmap from the given data, which can be of arbitrary type.

View File

@@ -38,7 +38,7 @@ Destroys the wxBitmapHandler object.
\membersection{wxBitmapHandler::Create}\label{wxbitmaphandlercreate} \membersection{wxBitmapHandler::Create}\label{wxbitmaphandlercreate}
\func{virtual bool}{Create}{\param{wxBitmap* }{bitmap}, \param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}} \func{virtual bool}{Create}{\param{wxBitmap* }{bitmap}, \param{const void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object {\it bitmap} is Creates a bitmap from the given data, which can be of arbitrary type. The wxBitmap object {\it bitmap} is
manipulated by this function. manipulated by this function.
@@ -64,13 +64,13 @@ true if the call succeeded, false otherwise (the default).
\membersection{wxBitmapHandler::GetName}\label{wxbitmaphandlergetname} \membersection{wxBitmapHandler::GetName}\label{wxbitmaphandlergetname}
\constfunc{wxString}{GetName}{\void} \constfunc{const wxString\&}{ GetName}{\void}
Gets the name of this handler. Gets the name of this handler.
\membersection{wxBitmapHandler::GetExtension}\label{wxbitmaphandlergetextension} \membersection{wxBitmapHandler::GetExtension}\label{wxbitmaphandlergetextension}
\constfunc{wxString}{GetExtension}{\void} \constfunc{const wxString\&}{ GetExtension}{\void}
Gets the file extension associated with this handler. Gets the file extension associated with this handler.

View File

@@ -128,7 +128,7 @@ Loads an image from a file.
Loads an image from an input stream. Loads an image from an input stream.
\func{}{wxImage}{\param{const char** }{xpmData}} \func{}{wxImage}{\param{const char* const* }{xpmData}}
Creates an image from XPM data. Creates an image from XPM data.
@@ -1383,14 +1383,14 @@ Destroys the wxImageHandler object.
\membersection{wxImageHandler::GetName}\label{wximagehandlergetname} \membersection{wxImageHandler::GetName}\label{wximagehandlergetname}
\constfunc{wxString}{GetName}{\void} \constfunc{const wxString\&}{GetName}{\void}
Gets the name of this handler. Gets the name of this handler.
\membersection{wxImageHandler::GetExtension}\label{wximagehandlergetextension} \membersection{wxImageHandler::GetExtension}\label{wximagehandlergetextension}
\constfunc{wxString}{GetExtension}{\void} \constfunc{const wxString\&}{GetExtension}{\void}
Gets the file extension associated with this handler. Gets the file extension associated with this handler.
@@ -1420,7 +1420,7 @@ Gets the image type associated with this handler.
\membersection{wxImageHandler::GetMimeType}\label{wximagehandlergetmimetype} \membersection{wxImageHandler::GetMimeType}\label{wximagehandlergetmimetype}
\constfunc{wxString}{GetMimeType}{\void} \constfunc{const wxString\&}{GetMimeType}{\void}
Gets the MIME type associated with this handler. Gets the MIME type associated with this handler.

View File

@@ -16,10 +16,7 @@
// headers // headers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h" // for wxBitmapType #include "wx/gdicmn.h" // for wxBitmapType
#include "wx/colour.h" #include "wx/colour.h"
@@ -93,26 +90,21 @@ protected:
class WXDLLEXPORT wxBitmapHandlerBase : public wxObject class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
{ {
public: public:
wxBitmapHandlerBase() wxBitmapHandlerBase() { m_type = wxBITMAP_TYPE_INVALID; }
: m_name()
, m_extension()
, m_type(wxBITMAP_TYPE_INVALID)
{ }
virtual ~wxBitmapHandlerBase() { } virtual ~wxBitmapHandlerBase() { }
virtual bool Create(wxBitmap *bitmap, void *data, long flags, virtual bool Create(wxBitmap *bitmap, const void* data, long flags,
int width, int height, int depth = 1) = 0; int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight) = 0; int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL) = 0; int type, const wxPalette *palette = NULL);
void SetName(const wxString& name) { m_name = name; } void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; } void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(wxBitmapType type) { m_type = type; } void SetType(wxBitmapType type) { m_type = type; }
wxString GetName() const { return m_name; } const wxString& GetName() const { return m_name; }
wxString GetExtension() const { return m_extension; } const wxString& GetExtension() const { return m_extension; }
wxBitmapType GetType() const { return m_type; } wxBitmapType GetType() const { return m_type; }
private: private:
@@ -120,7 +112,6 @@ private:
wxString m_extension; wxString m_extension;
wxBitmapType m_type; wxBitmapType m_type;
private:
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase) DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
}; };
@@ -133,8 +124,7 @@ public:
wxBitmap(); wxBitmap();
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits); wxBitmap(const char* const* bits);
wxBitmap(char **bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = -1); wxBitmap(const wxImage& image, int depth = -1);
bool operator == (const wxBitmap& bmp) const; bool operator == (const wxBitmap& bmp) const;

View File

@@ -71,12 +71,11 @@ public:
// Initialize with raw data. // Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data // Initialize with XPM data
wxBitmap(const char **bits) { CreateFromXpm(bits); } wxBitmap(const char* const* bits);
wxBitmap(char **bits) { CreateFromXpm((const char**)bits); }
// Load a file or resource // Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
// Constructor for generalised creation from data // Constructor for generalised creation from data
wxBitmap(void *data, wxBitmapType type, int width, int height, int depth = 1); wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display // If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
// Convert from wxImage: // Convert from wxImage:
@@ -92,13 +91,11 @@ public:
// Implementation // Implementation
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
public: public:
// Initialize with XPM data
bool CreateFromXpm(const char **bits);
// Initialize from wxImage // Initialize from wxImage
bool CreateFromImage(const wxImage& image, int depth=-1); bool CreateFromImage(const wxImage& image, int depth=-1);
virtual bool Create(int width, int height, int depth = -1); virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, wxBitmapType type, int width, int height, int depth = 1); virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
@@ -152,4 +149,9 @@ public:
static void CleanUpHandlers() { } static void CleanUpHandlers() { }
}; };
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{
DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
};
#endif // __WX_COCOA_BITMAP_H__ #endif // __WX_COCOA_BITMAP_H__

View File

@@ -19,12 +19,9 @@ wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
// wxBitmap // wxBitmap
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapHandler : public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() : wxBitmapHandlerBase() {}
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
@@ -35,8 +32,7 @@ public:
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
wxBitmap(const char **bits) { CreateFromXpm(bits); } wxBitmap(const char* const* bits);
wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
#if wxUSE_IMAGE #if wxUSE_IMAGE
wxBitmap(const wxImage& image, int depth = -1); wxBitmap(const wxImage& image, int depth = -1);
#endif #endif
@@ -83,8 +79,6 @@ public:
wxIDirectFBSurfacePtr GetDirectFBSurface() const; wxIDirectFBSurfacePtr GetDirectFBSurface() const;
protected: protected:
bool CreateFromXpm(const char **bits);
// ref counting code // ref counting code
virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

View File

@@ -53,7 +53,7 @@ public:
wxBitmap() { } wxBitmap() { }
wxBitmap( int width, int height, int depth = -1 ); wxBitmap( int width, int height, int depth = -1 );
wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char* const* bits ) { CreateFromXpm(bits); } wxBitmap( const char* const* bits );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); } wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
virtual ~wxBitmap(); virtual ~wxBitmap();
@@ -114,7 +114,6 @@ public:
void UseAlpha(); void UseAlpha();
protected: protected:
bool CreateFromXpm(const char* const* bits);
bool CreateFromImage(const wxImage& image, int depth); bool CreateFromImage(const wxImage& image, int depth);
private: private:
@@ -144,17 +143,7 @@ private:
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() { }
virtual ~wxBitmapHandler();
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
#endif // _WX_GTK_BITMAP_H_ #endif // _WX_GTK_BITMAP_H_

View File

@@ -67,8 +67,7 @@ public:
wxBitmap(); wxBitmap();
wxBitmap( int width, int height, int depth = -1 ); wxBitmap( int width, int height, int depth = -1 );
wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( const char* const* bits );
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); } wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
virtual ~wxBitmap(); virtual ~wxBitmap();
@@ -128,7 +127,6 @@ public:
void UseAlpha(); void UseAlpha();
protected: protected:
bool CreateFromXpm(const char **bits);
bool CreateFromImage(const wxImage& image, int depth); bool CreateFromImage(const wxImage& image, int depth);
private: private:
@@ -148,18 +146,7 @@ private:
class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() { }
virtual ~wxBitmapHandler();
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
#endif // __GTKBITMAPH__ #endif // __GTKBITMAPH__

View File

@@ -99,10 +99,10 @@ public:
void SetExtension(const wxString& ext) { m_extension = ext; } void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(long type) { m_type = type; } void SetType(long type) { m_type = type; }
void SetMimeType(const wxString& type) { m_mime = type; } void SetMimeType(const wxString& type) { m_mime = type; }
wxString GetName() const { return m_name; } const wxString& GetName() const { return m_name; }
wxString GetExtension() const { return m_extension; } const wxString& GetExtension() const { return m_extension; }
long GetType() const { return m_type; } long GetType() const { return m_type; }
wxString GetMimeType() const { return m_mime; } const wxString& GetMimeType() const { return m_mime; }
protected: protected:
#if wxUSE_STREAMS #if wxUSE_STREAMS
@@ -199,8 +199,7 @@ public:
wxImage( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); wxImage( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false );
wxImage( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); wxImage( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 );
wxImage( const wxString& name, const wxString& mimetype, int index = -1 ); wxImage( const wxString& name, const wxString& mimetype, int index = -1 );
wxImage( const char** xpmData ); wxImage( const char* const* xpmData );
wxImage( char** xpmData );
#if wxUSE_STREAMS #if wxUSE_STREAMS
wxImage( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 ); wxImage( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 );
@@ -210,7 +209,7 @@ public:
bool Create( int width, int height, bool clear = true ); bool Create( int width, int height, bool clear = true );
bool Create( int width, int height, unsigned char* data, bool static_data = false ); bool Create( int width, int height, unsigned char* data, bool static_data = false );
bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false );
bool Create( const char** xpmData ); bool Create( const char* const* xpmData );
void Destroy(); void Destroy();
// creates an identical copy of the image (the = operator // creates an identical copy of the image (the = operator

View File

@@ -78,23 +78,11 @@ private:
}; };
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() { }
virtual ~wxBitmapHandler();
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
class WXDLLEXPORT wxBitmap: public wxBitmapBase class WXDLLEXPORT wxBitmap: public wxBitmapBase
{ {
DECLARE_DYNAMIC_CLASS(wxBitmap) DECLARE_DYNAMIC_CLASS(wxBitmap)
@@ -108,15 +96,13 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data // Initialize with XPM data
bool CreateFromXpm(const char **bits); wxBitmap(const char* const* bits);
wxBitmap(const char **bits);
wxBitmap(char **bits);
// Load a file or resource // Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE); wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE);
// Constructor for generalised creation from data // Constructor for generalised creation from data
wxBitmap(void *data, wxBitmapType type, int width, int height, int depth = 1); wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display // If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
@@ -135,7 +121,7 @@ public:
wxBitmap GetSubBitmap( const wxRect& rect ) const; wxBitmap GetSubBitmap( const wxRect& rect ) const;
virtual bool Create(int width, int height, int depth = -1); virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, wxBitmapType type, int width, int height, int depth = 1); virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
// virtual bool Create( WXHICON icon) ; // virtual bool Create( WXHICON icon) ;
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;

View File

@@ -23,12 +23,9 @@ struct bitmap_t;
// wxBitmap // wxBitmap
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandler : public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() : wxBitmapHandlerBase() {}
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
class WXDLLEXPORT wxBitmap: public wxBitmapBase class WXDLLEXPORT wxBitmap: public wxBitmapBase
@@ -37,8 +34,7 @@ public:
wxBitmap() {} wxBitmap() {}
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits) { CreateFromXpm(bits); } wxBitmap(const char* const* bits);
wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
wxBitmap(const wxImage& image, int depth = -1); wxBitmap(const wxImage& image, int depth = -1);
virtual ~wxBitmap() {} virtual ~wxBitmap() {}
@@ -81,8 +77,6 @@ public:
bitmap_t *GetMGLbitmap_t() const; bitmap_t *GetMGLbitmap_t() const;
protected: protected:
bool CreateFromXpm(const char **bits);
// creates temporary DC for access to bitmap's data: // creates temporary DC for access to bitmap's data:
MGLDevCtx *CreateTmpDC() const; MGLDevCtx *CreateTmpDC() const;
// sets fg & bg colours for 1bit bitmaps: // sets fg & bg colours for 1bit bitmaps:

View File

@@ -45,14 +45,13 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data // Initialize with XPM data
wxBitmap(const char **data) { CreateFromXpm(data); } wxBitmap(const char* const* data);
wxBitmap(char **data) { CreateFromXpm((const char **)data); }
// Load a file or resource // Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
// New constructor for generalised creation from data // New constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1); wxBitmap(const void* data, long type, int width, int height, int depth = 1);
// Create a new, uninitialized bitmap of the given size and depth (if it // Create a new, uninitialized bitmap of the given size and depth (if it
// is omitted, will create a bitmap compatible with the display) // is omitted, will create a bitmap compatible with the display)
@@ -114,7 +113,7 @@ public:
virtual bool Create(int width, int height, int depth = -1); virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(int width, int height, const wxDC& dc); virtual bool Create(int width, int height, const wxDC& dc);
virtual bool Create(void *data, long type, int width, int height, int depth = 1); virtual bool Create(const void* data, long type, int width, int height, int depth = 1);
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
@@ -165,9 +164,6 @@ protected:
virtual wxGDIImageRefData *CreateData() const; virtual wxGDIImageRefData *CreateData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
// creates the bitmap from XPM data, supposed to be called from ctor
bool CreateFromXpm(const char **bits);
// creates an uninitialized bitmap, called from Create()s above // creates an uninitialized bitmap, called from Create()s above
bool DoCreate(int w, int h, int depth, WXHDC hdc); bool DoCreate(int w, int h, int depth, WXHDC hdc);
@@ -245,7 +241,7 @@ public:
// keep wxBitmapHandler derived from wxGDIImageHandler compatible with the // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the
// old class which worked only with bitmaps // old class which worked only with bitmaps
virtual bool Create(wxBitmap *bitmap, virtual bool Create(wxBitmap *bitmap,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, virtual bool LoadFile(wxBitmap *bitmap,
@@ -258,7 +254,7 @@ public:
const wxPalette *palette = NULL); const wxPalette *palette = NULL);
virtual bool Create(wxGDIImage *image, virtual bool Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
virtual bool Load(wxGDIImage *image, virtual bool Load(wxGDIImage *image,

View File

@@ -104,7 +104,7 @@ public:
// real handler operations: to implement in derived classes // real handler operations: to implement in derived classes
virtual bool Create(wxGDIImage *image, virtual bool Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1) = 0; int width, int height, int depth = 1) = 0;
virtual bool Load(wxGDIImage *image, virtual bool Load(wxGDIImage *image,

View File

@@ -84,8 +84,7 @@ public:
); );
// Initialize with XPM data // Initialize with XPM data
wxBitmap(const char** ppData) { CreateFromXpm(ppData); } wxBitmap(const char* const* bits);
wxBitmap(char** ppData) { CreateFromXpm((const char**)ppData); }
// Load a resource // Load a resource
wxBitmap( int nId wxBitmap( int nId
@@ -98,7 +97,7 @@ public:
) )
{ Init(); } { Init(); }
// New constructor for generalised creation from data // New constructor for generalised creation from data
wxBitmap( void* pData wxBitmap( const void* pData
,long lType ,long lType
,int nWidth ,int nWidth
,int nHeight ,int nHeight
@@ -146,7 +145,7 @@ public:
,int nHeight ,int nHeight
,int nDepth = -1 ,int nDepth = -1
); );
virtual bool Create( void* pData virtual bool Create( const void* pData
,long lType ,long lType
,int nWidth ,int nWidth
,int nHeight ,int nHeight
@@ -213,8 +212,6 @@ protected:
inline virtual wxGDIImageRefData* CreateData() const inline virtual wxGDIImageRefData* CreateData() const
{ return new wxBitmapRefData; } { return new wxBitmapRefData; }
// creates the bitmap from XPM data, supposed to be called from ctor
bool CreateFromXpm(const char** ppData);
bool CreateFromImage(const wxImage& image, int depth); bool CreateFromImage(const wxImage& image, int depth);
private: private:
@@ -296,7 +293,7 @@ public:
// keep wxBitmapHandler derived from wxGDIImageHandler compatible with the // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the
// old class which worked only with bitmaps // old class which worked only with bitmaps
virtual bool Create( wxBitmap* pBitmap virtual bool Create( wxBitmap* pBitmap
,void* pData ,const void* pData
,long lFlags ,long lFlags
,int nWidth ,int nWidth
,int nHeight ,int nHeight
@@ -321,7 +318,7 @@ public:
); );
virtual bool Create( wxGDIImage* pImage virtual bool Create( wxGDIImage* pImage
,void* pData ,const void* pData
,long lFlags ,long lFlags
,int nWidth ,int nWidth
,int nHeight ,int nHeight

View File

@@ -45,14 +45,13 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data // Initialize with XPM data
wxBitmap(const char **data) { CreateFromXpm(data); } wxBitmap(const char* const* data);
wxBitmap(char **data) { CreateFromXpm((const char **)data); }
// Load a file or resource // Load a file or resource
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE);
// New constructor for generalised creation from data // New constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1); wxBitmap(const void* data, long type, int width, int height, int depth = 1);
// Create a new, uninitialized bitmap of the given size and depth (if it // Create a new, uninitialized bitmap of the given size and depth (if it
// is omitted, will create a bitmap compatible with the display) // is omitted, will create a bitmap compatible with the display)
@@ -114,7 +113,7 @@ public:
virtual bool Create(int width, int height, int depth = -1); virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(int width, int height, const wxDC& dc); virtual bool Create(int width, int height, const wxDC& dc);
virtual bool Create(void *data, long type, int width, int height, int depth = 1); virtual bool Create(const void* data, long type, int width, int height, int depth = 1);
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
@@ -159,9 +158,6 @@ protected:
virtual wxGDIImageRefData *CreateData() const; virtual wxGDIImageRefData *CreateData() const;
// creates the bitmap from XPM data, supposed to be called from ctor
bool CreateFromXpm(const char **bits);
// creates an uninitialized bitmap, called from Create()s above // creates an uninitialized bitmap, called from Create()s above
bool DoCreate(int w, int h, int depth, WXHDC hdc); bool DoCreate(int w, int h, int depth, WXHDC hdc);
@@ -235,7 +231,7 @@ public:
// keep wxBitmapHandler derived from wxGDIImageHandler compatible with the // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the
// old class which worked only with bitmaps // old class which worked only with bitmaps
virtual bool Create(wxBitmap *bitmap, virtual bool Create(wxBitmap *bitmap,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, virtual bool LoadFile(wxBitmap *bitmap,
@@ -248,7 +244,7 @@ public:
const wxPalette *palette = NULL); const wxPalette *palette = NULL);
virtual bool Create(wxGDIImage *image, virtual bool Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
virtual bool Load(wxGDIImage *image, virtual bool Load(wxGDIImage *image,

View File

@@ -94,7 +94,7 @@ public:
// real handler operations: to implement in derived classes // real handler operations: to implement in derived classes
virtual bool Create(wxGDIImage *image, virtual bool Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth = 1) = 0; int width, int height, int depth = 1) = 0;
virtual bool Load(wxGDIImage *image, virtual bool Load(wxGDIImage *image,

View File

@@ -62,12 +62,9 @@ private:
// wxBitmap // wxBitmap
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class WXDLLEXPORT wxBitmapHandler : public wxBitmapHandlerBase class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
{ {
public: DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
wxBitmapHandler() : wxBitmapHandlerBase() {}
private:
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
}; };
class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
@@ -76,8 +73,7 @@ public:
wxBitmap(); wxBitmap();
wxBitmap( int width, int height, int depth = -1 ); wxBitmap( int width, int height, int depth = -1 );
wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( const char* const* bits );
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
virtual ~wxBitmap(); virtual ~wxBitmap();
@@ -88,7 +84,7 @@ public:
static void InitStandardHandlers(); static void InitStandardHandlers();
bool Create(int width, int height, int depth = -1); bool Create(int width, int height, int depth = -1);
bool Create(void* data, wxBitmapType type, bool Create(const void* data, wxBitmapType type,
int width, int height, int depth = -1); int width, int height, int depth = -1);
// create the wxBitmap using a _copy_ of the pixmap // create the wxBitmap using a _copy_ of the pixmap
bool Create(WXPixmap pixmap); bool Create(WXPixmap pixmap);
@@ -135,9 +131,6 @@ public:
WXDisplay *GetDisplay() const; WXDisplay *GetDisplay() const;
protected:
bool CreateFromXpm(const char **bits);
private: private:
DECLARE_DYNAMIC_CLASS(wxBitmap) DECLARE_DYNAMIC_CLASS(wxBitmap)
}; };

View File

@@ -35,7 +35,7 @@ public:
wxImage ReadFile(wxInputStream& stream); wxImage ReadFile(wxInputStream& stream);
#endif #endif
// Read directly from XPM data (as passed to wxBitmap ctor): // Read directly from XPM data (as passed to wxBitmap ctor):
wxImage ReadData(const char **xpm_data); wxImage ReadData(const char* const* xpm_data);
}; };
#endif // wxUSE_IMAGE && wxUSE_XPM #endif // wxUSE_IMAGE && wxUSE_XPM

View File

@@ -33,6 +33,8 @@
#import <AppKit/NSImage.h> #import <AppKit/NSImage.h>
#import <AppKit/NSColor.h> #import <AppKit/NSColor.h>
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
// ======================================================================== // ========================================================================
// wxBitmapRefData // wxBitmapRefData
// ======================================================================== // ========================================================================
@@ -123,7 +125,7 @@ wxBitmap::wxBitmap(int w, int h, int d)
(void)Create(w, h, d); (void)Create(w, h, d);
} }
wxBitmap::wxBitmap(void *data, wxBitmapType type, int width, int height, int depth) wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth)
{ {
(void) Create(data, type, width, height, depth); (void) Create(data, type, width, height, depth);
} }
@@ -346,7 +348,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
return true; return true;
} }
bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth) bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth)
{ {
UnRef(); UnRef();
@@ -413,24 +415,6 @@ wxImage wxBitmap::ConvertToImage() const
return newImage; return newImage;
} }
bool wxBitmap::CreateFromXpm(const char **xpm)
{
#if wxUSE_IMAGE && wxUSE_XPM
UnRef();
wxCHECK_MSG( xpm, false, wxT("invalid XPM data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(xpm);
wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") );
*this = wxBitmap(img);
return true;
#else
return false;
#endif
}
bool wxBitmap::CreateFromImage(const wxImage& image, int depth) bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
{ {
UnRef(); UnRef();

View File

@@ -126,6 +126,21 @@ void wxBitmapBase::CleanUpHandlers()
} }
} }
bool wxBitmapHandlerBase::Create(wxBitmap*, const void*, long, int, int, int)
{
return false;
}
bool wxBitmapHandlerBase::LoadFile(wxBitmap*, const wxString&, long, int, int)
{
return false;
}
bool wxBitmapHandlerBase::SaveFile(const wxBitmap*, const wxString&, int, const wxPalette*)
{
return false;
}
class wxBitmapBaseModule: public wxModule class wxBitmapBaseModule: public wxModule
{ {
DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule) DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule)
@@ -139,6 +154,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule)
#endif // wxUSE_BITMAP_BASE #endif // wxUSE_BITMAP_BASE
// ----------------------------------------------------------------------------
// wxBitmap common
// ----------------------------------------------------------------------------
#if !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__))
wxBitmap::wxBitmap(const char* const* bits)
{
wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data"));
#if wxUSE_IMAGE && wxUSE_XPM
wxImage image(bits);
wxCHECK2_MSG(image.Ok(), return, wxT("invalid bitmap data"));
*this = wxBitmap(image);
#else
wxFAIL_MSG(_T("creating bitmaps from XPMs not supported"));
#endif // wxUSE_IMAGE && wxUSE_XPM
}
#endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__))
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMaskBase // wxMaskBase
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -30,10 +30,7 @@
#include "wx/filefn.h" #include "wx/filefn.h"
#include "wx/wfstream.h" #include "wx/wfstream.h"
#include "wx/xpmdecod.h"
#if wxUSE_XPM
#include "wx/xpmdecod.h"
#endif
// For memcpy // For memcpy
#include <string.h> #include <string.h>
@@ -165,17 +162,12 @@ wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index )
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
wxImage::wxImage( const char** xpmData ) wxImage::wxImage(const char* const* xpmData)
{ {
Create(xpmData); Create(xpmData);
} }
wxImage::wxImage( char** xpmData ) bool wxImage::Create(const char* const* xpmData)
{
Create((const char**) xpmData);
}
bool wxImage::Create( const char** xpmData )
{ {
#if wxUSE_XPM #if wxUSE_XPM
UnRef(); UnRef();

View File

@@ -99,23 +99,20 @@ license is as follows:
#if wxUSE_IMAGE && wxUSE_XPM #if wxUSE_IMAGE && wxUSE_XPM
#include "wx/xpmdecod.h"
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/utils.h" #include "wx/utils.h"
#include "wx/hashmap.h" #include "wx/hashmap.h"
#if wxUSE_STREAMS #include "wx/stream.h"
#include "wx/stream.h"
#endif
#include "wx/image.h" #include "wx/image.h"
#endif #endif
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include "wx/xpmdecod.h"
#if wxUSE_STREAMS #if wxUSE_STREAMS
bool wxXPMDecoder::CanRead(wxInputStream& stream) bool wxXPMDecoder::CanRead(wxInputStream& stream)
{ {
@@ -659,7 +656,7 @@ struct wxXPMColourMapData
}; };
WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap); WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap);
wxImage wxXPMDecoder::ReadData(const char **xpm_data) wxImage wxXPMDecoder::ReadData(const char* const* xpm_data)
{ {
wxCHECK_MSG(xpm_data, wxNullImage, wxT("NULL XPM data") ); wxCHECK_MSG(xpm_data, wxNullImage, wxT("NULL XPM data") );

View File

@@ -24,9 +24,6 @@
#include "wx/colour.h" #include "wx/colour.h"
#include "wx/image.h" #include "wx/image.h"
#warning "move this to common"
#include "wx/xpmdecod.h"
#include "wx/dfb/private.h" #include "wx/dfb/private.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -102,7 +99,7 @@ public:
// wxBitmap // wxBitmap
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject) IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase) IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase)
wxBitmap::wxBitmap(int width, int height, int depth) 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)); 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 #if wxUSE_IMAGE
wxBitmap::wxBitmap(const wxImage& image, int depth) wxBitmap::wxBitmap(const wxImage& image, int depth)
{ {

View File

@@ -250,6 +250,20 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
} }
} }
wxBitmap::wxBitmap(const char* const* bits)
{
wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data"));
GdkBitmap* mask = NULL;
SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits)));
if (M_BMPDATA->m_pixmap != NULL && mask != NULL)
{
M_BMPDATA->m_mask = new wxMask;
M_BMPDATA->m_mask->m_bitmap = mask;
}
}
wxBitmap::~wxBitmap() wxBitmap::~wxBitmap()
{ {
} }
@@ -284,26 +298,6 @@ bool wxBitmap::Create( int width, int height, int depth )
return Ok(); return Ok();
} }
bool wxBitmap::CreateFromXpm(const char* const* bits)
{
UnRef();
wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
GdkBitmap *mask = (GdkBitmap*) NULL;
SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits)));
wxCHECK_MSG( M_BMPDATA->m_pixmap, false, wxT("couldn't create pixmap") );
if (mask)
{
M_BMPDATA->m_mask = new wxMask;
M_BMPDATA->m_mask->m_bitmap = mask;
}
return true;
}
wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy) const wxBitmap wxBitmap::Rescale(int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy) const
{ {
wxBitmap bmp; wxBitmap bmp;
@@ -1060,44 +1054,7 @@ void wxBitmap::UseAlpha()
// wxBitmapHandler // wxBitmapHandler
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler,wxBitmapHandlerBase) IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
wxBitmapHandler::~wxBitmapHandler()
{
}
bool wxBitmapHandler::Create(wxBitmap * WXUNUSED(bitmap),
void * WXUNUSED(data),
long WXUNUSED(type),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
bool wxBitmapHandler::LoadFile(wxBitmap * WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
long WXUNUSED(flags),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
int WXUNUSED(type),
const wxPalette * WXUNUSED(palette))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
/* static */ void wxBitmap::InitStandardHandlers() /* static */ void wxBitmap::InitStandardHandlers()
{ {

View File

@@ -312,11 +312,9 @@ bool wxBitmap::Create( int width, int height, int depth )
return Ok(); return Ok();
} }
bool wxBitmap::CreateFromXpm( const char **bits ) wxBitmap::wxBitmap(const char* const* bits)
{ {
UnRef(); wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data"));
wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
GdkVisual *visual = wxTheApp->GetGdkVisual(); GdkVisual *visual = wxTheApp->GetGdkVisual();
@@ -326,7 +324,7 @@ bool wxBitmap::CreateFromXpm( const char **bits )
M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, (gchar **) bits ); M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, (gchar **) bits );
wxCHECK_MSG( M_BMPDATA->m_pixmap, false, wxT("couldn't create pixmap") ); wxCHECK2_MSG(M_BMPDATA->m_pixmap, return, wxT("couldn't create pixmap"));
if (mask) if (mask)
{ {
@@ -337,8 +335,6 @@ bool wxBitmap::CreateFromXpm( const char **bits )
gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) ); gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
M_BMPDATA->m_bpp = visual->depth; // Can we get a different depth from create_from_xpm_d() ? M_BMPDATA->m_bpp = visual->depth; // Can we get a different depth from create_from_xpm_d() ?
return true;
} }
wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy ) wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy )
@@ -1320,7 +1316,6 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
{ {
} }
bool wxBitmap::HasAlpha() const bool wxBitmap::HasAlpha() const
{ {
return false; return false;
@@ -1334,44 +1329,7 @@ void wxBitmap::UseAlpha()
// wxBitmapHandler // wxBitmapHandler
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler,wxBitmapHandlerBase) IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
wxBitmapHandler::~wxBitmapHandler()
{
}
bool wxBitmapHandler::Create(wxBitmap * WXUNUSED(bitmap),
void * WXUNUSED(data),
long WXUNUSED(type),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
bool wxBitmapHandler::LoadFile(wxBitmap * WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
long WXUNUSED(flags),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
int WXUNUSED(type),
const wxPalette * WXUNUSED(palette))
{
wxFAIL_MSG( _T("not implemented") );
return false;
}
/* static */ void wxBitmap::InitStandardHandlers() /* static */ void wxBitmap::InitStandardHandlers()
{ {

View File

@@ -27,7 +27,6 @@
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
#ifdef __DARWIN__ #ifdef __DARWIN__
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
@@ -842,7 +841,7 @@ wxBitmap::wxBitmap(int w, int h, int d)
(void)Create(w, h, d); (void)Create(w, h, d);
} }
wxBitmap::wxBitmap(void *data, wxBitmapType type, int width, int height, int depth) wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth)
{ {
(void) Create(data, type, width, height, depth); (void) Create(data, type, width, height, depth);
} }
@@ -852,16 +851,6 @@ wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
LoadFile(filename, type); LoadFile(filename, type);
} }
wxBitmap::wxBitmap(const char **bits)
{
(void) CreateFromXpm(bits);
}
wxBitmap::wxBitmap(char **bits)
{
(void) CreateFromXpm((const char **)bits);
}
void * wxBitmap::GetRawAccess() const void * wxBitmap::GetRawAccess() const
{ {
wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ; wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ;
@@ -883,24 +872,6 @@ void wxBitmap::EndRawAccess()
M_BITMAPDATA->EndRawAccess() ; M_BITMAPDATA->EndRawAccess() ;
} }
bool wxBitmap::CreateFromXpm(const char **bits)
{
#if wxUSE_IMAGE
wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits);
wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
return true;
#else
return false;
#endif
}
#ifdef __WXMAC_OSX__ #ifdef __WXMAC_OSX__
WXCGIMAGEREF wxBitmap::CGImageCreate() const WXCGIMAGEREF wxBitmap::CGImageCreate() const
{ {
@@ -1015,7 +986,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
return false; return false;
} }
bool wxBitmap::Create(void *data, wxBitmapType type, int width, int height, int depth) bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height, int depth)
{ {
UnRef(); UnRef();
@@ -1536,25 +1507,7 @@ WXHBITMAP wxMask::GetHBITMAP() const
// wxBitmapHandler // wxBitmapHandler
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxBitmapHandler::~wxBitmapHandler() IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
{
}
bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
{
return false;
}
bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight)
{
return false;
}
bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
{
return false;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Standard Handlers // Standard Handlers

View File

@@ -91,7 +91,7 @@ wxBitmapRefData::~wxBitmapRefData()
#define M_BMPDATA ((wxBitmapRefData *)m_refData) #define M_BMPDATA ((wxBitmapRefData *)m_refData)
IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler,wxObject) IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxBitmapHandlerBase)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxBitmapBase) IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxBitmapBase)
wxBitmap::wxBitmap(int width, int height, int depth) wxBitmap::wxBitmap(int width, int height, int depth)
@@ -171,19 +171,6 @@ bool wxBitmap::Create(int width, int height, int depth)
return Ok(); return Ok();
} }
bool wxBitmap::CreateFromXpm(const char **bits)
{
wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits);
wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
return true;
}
wxBitmap::wxBitmap(const wxImage& image, int depth) wxBitmap::wxBitmap(const wxImage& image, int depth)
{ {
long width, height; long width, height;
@@ -559,7 +546,7 @@ public:
const wxString& extension, const wxString& name); const wxString& extension, const wxString& name);
virtual bool Create(wxBitmap *WXUNUSED(bitmap), virtual bool Create(wxBitmap *WXUNUSED(bitmap),
void *WXUNUSED(data), const void* WXUNUSED(data),
long WXUNUSED(flags), long WXUNUSED(flags),
int WXUNUSED(width), int WXUNUSED(width),
int WXUNUSED(height), int WXUNUSED(height),
@@ -777,7 +764,7 @@ class wxICOBitmapHandler: public wxBitmapHandler
const wxString& extension, const wxString& name); const wxString& extension, const wxString& name);
virtual bool Create(wxBitmap *WXUNUSED(bitmap), virtual bool Create(wxBitmap *WXUNUSED(bitmap),
void *WXUNUSED(data), const void* WXUNUSED(data),
long WXUNUSED(flags), long WXUNUSED(flags),
int WXUNUSED(width), int WXUNUSED(width),
int WXUNUSED(height), int WXUNUSED(height),

View File

@@ -473,24 +473,6 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
#endif #endif
} }
// Create from XPM data
bool wxBitmap::CreateFromXpm(const char **data)
{
#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(data);
wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
return true;
#else
wxUnusedVar(data);
return false;
#endif
}
wxBitmap::wxBitmap(int w, int h, int d) wxBitmap::wxBitmap(int w, int h, int d)
{ {
(void)Create(w, h, d); (void)Create(w, h, d);
@@ -501,7 +483,7 @@ wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
(void)Create(w, h, dc); (void)Create(w, h, dc);
} }
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth) wxBitmap::wxBitmap(const void* data, long type, int width, int height, int depth)
{ {
(void)Create(data, type, width, height, depth); (void)Create(data, type, width, height, depth);
} }
@@ -1026,7 +1008,7 @@ bool wxBitmap::LoadFile(const wxString& filename, long type)
return false; return false;
} }
bool wxBitmap::Create(void *data, long type, int width, int height, int depth) bool wxBitmap::Create(const void* data, long type, int width, int height, int depth)
{ {
UnRef(); UnRef();
@@ -1512,13 +1494,13 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxBitmapHandler::Create(wxGDIImage *image, bool wxBitmapHandler::Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth) int width, int height, int depth)
{ {
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
return bitmap ? Create(bitmap, data, flags, width, height, depth) : false; return bitmap && Create(bitmap, data, flags, width, height, depth);
} }
bool wxBitmapHandler::Load(wxGDIImage *image, bool wxBitmapHandler::Load(wxGDIImage *image,
@@ -1528,7 +1510,7 @@ bool wxBitmapHandler::Load(wxGDIImage *image,
{ {
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
return bitmap ? LoadFile(bitmap, name, flags, width, height) : false; return bitmap && LoadFile(bitmap, name, flags, width, height);
} }
bool wxBitmapHandler::Save(wxGDIImage *image, bool wxBitmapHandler::Save(wxGDIImage *image,
@@ -1537,34 +1519,7 @@ bool wxBitmapHandler::Save(wxGDIImage *image,
{ {
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
return bitmap ? SaveFile(bitmap, name, type) : false; return bitmap && SaveFile(bitmap, name, type);
}
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
void *WXUNUSED(data),
long WXUNUSED(type),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth))
{
return false;
}
bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
long WXUNUSED(type),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{
return false;
}
bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name),
int WXUNUSED(type),
const wxPalette *WXUNUSED(palette))
{
return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -104,7 +104,7 @@ public:
// creating and saving icons is not supported // creating and saving icons is not supported
virtual bool Create(wxGDIImage *WXUNUSED(image), virtual bool Create(wxGDIImage *WXUNUSED(image),
void *WXUNUSED(data), const void* WXUNUSED(data),
long WXUNUSED(flags), long WXUNUSED(flags),
int WXUNUSED(width), int WXUNUSED(width),
int WXUNUSED(height), int WXUNUSED(height),

View File

@@ -271,7 +271,7 @@ wxBitmap::wxBitmap(
} // end of wxBitmap::wxBitmap } // end of wxBitmap::wxBitmap
wxBitmap::wxBitmap( wxBitmap::wxBitmap(
void* pData const void* pData
, long lType , long lType
, int nWidth , int nWidth
, int nHeight , int nHeight
@@ -380,27 +380,6 @@ bool wxBitmap::Create(
return Ok(); return Ok();
} // end of wxBitmap::Create } // end of wxBitmap::Create
bool wxBitmap::CreateFromXpm(
const char** ppData
)
{
#if wxUSE_IMAGE && wxUSE_XPM
Init();
wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data"));
wxXPMDecoder vDecoder;
wxImage vImg = vDecoder.ReadData(ppData);
wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data"));
*this = wxBitmap(vImg);
return true;
#else
return false;
#endif
} // end of wxBitmap::CreateFromXpm
bool wxBitmap::LoadFile(const wxString& filename, long type) bool wxBitmap::LoadFile(const wxString& filename, long type)
{ {
UnRef(); UnRef();
@@ -458,7 +437,7 @@ bool wxBitmap::LoadFile(
} // end of wxBitmap::LoadFile } // end of wxBitmap::LoadFile
bool wxBitmap::Create( bool wxBitmap::Create(
void* pData const void* pData
, long lType , long lType
, int nWidth , int nWidth
, int nHeight , int nHeight
@@ -1450,7 +1429,7 @@ bool wxMask::Create(
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxBitmapHandler::Create( wxGDIImage* pImage, bool wxBitmapHandler::Create( wxGDIImage* pImage,
void* pData, const void* pData,
long WXUNUSED(lFlags), long WXUNUSED(lFlags),
int nWidth, int nWidth,
int nHeight, int nHeight,
@@ -1506,7 +1485,7 @@ bool wxBitmapHandler::Save(
bool wxBitmapHandler::Create( bool wxBitmapHandler::Create(
wxBitmap* WXUNUSED(pBitmap) wxBitmap* WXUNUSED(pBitmap)
, void* WXUNUSED(pData) , const void* WXUNUSED(pData)
, long WXUNUSED(lType) , long WXUNUSED(lType)
, int WXUNUSED(nWidth) , int WXUNUSED(nWidth)
, int WXUNUSED(nHeight) , int WXUNUSED(nHeight)

View File

@@ -113,7 +113,7 @@ public:
// creating and saving icons is not supported // creating and saving icons is not supported
virtual bool Create( wxGDIImage* WXUNUSED(pImage) virtual bool Create( wxGDIImage* WXUNUSED(pImage)
,void* WXUNUSED(pData) ,const void* WXUNUSED(pData)
,long WXUNUSED(lFlags) ,long WXUNUSED(lFlags)
,int WXUNUSED(nWidth) ,int WXUNUSED(nWidth)
,int WXUNUSED(nHeight) ,int WXUNUSED(nHeight)

View File

@@ -211,16 +211,6 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
Init(); Init();
} }
// Create from XPM data
#if wxUSE_IMAGE && wxUSE_XPM
bool wxBitmap::CreateFromXpm(const char **data)
#else
bool wxBitmap::CreateFromXpm(const char **WXUNUSED(data))
#endif
{
return false;
}
wxBitmap::wxBitmap(int w, int h, int d) wxBitmap::wxBitmap(int w, int h, int d)
{ {
} }
@@ -229,7 +219,7 @@ wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
{ {
} }
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth) wxBitmap::wxBitmap(const void* data, long type, int width, int height, int depth)
{ {
} }
@@ -294,7 +284,7 @@ bool wxBitmap::LoadFile(const wxString& filename, long type)
return false; return false;
} }
bool wxBitmap::Create(void *data, long type, int width, int height, int depth) bool wxBitmap::Create(const void* data, long type, int width, int height, int depth)
{ {
return false; return false;
} }
@@ -445,7 +435,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxBitmapHandler::Create(wxGDIImage *image, bool wxBitmapHandler::Create(wxGDIImage *image,
void *data, const void* data,
long flags, long flags,
int width, int height, int depth) int width, int height, int depth)
{ {
@@ -468,7 +458,7 @@ bool wxBitmapHandler::Save(wxGDIImage *image,
} }
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap), bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
void *WXUNUSED(data), const void* WXUNUSED(data),
long WXUNUSED(type), long WXUNUSED(type),
int WXUNUSED(width), int WXUNUSED(width),
int WXUNUSED(height), int WXUNUSED(height),

View File

@@ -360,7 +360,7 @@ bool wxBitmap::Create( int width, int height, int depth )
return Ok(); return Ok();
} }
bool wxBitmap::Create(void *data, wxBitmapType type, bool wxBitmap::Create(const void* data, wxBitmapType type,
int width, int height, int depth) int width, int height, int depth)
{ {
UnRef(); UnRef();
@@ -417,11 +417,9 @@ bool wxBitmap::Create(WXPixmap pixmap)
return true; return true;
} }
bool wxBitmap::CreateFromXpm( const char **bits ) wxBitmap::wxBitmap(const char* const* bits)
{ {
wxCHECK_MSG( bits, false, wxT("NULL pointer in wxBitmap::CreateFromXpm") ); Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
return Create(bits, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
} }
bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
@@ -912,7 +910,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int depth )
{ {
m_refData = new wxBitmapRefData; m_refData = new wxBitmapRefData;
(void) Create((void*) bits, wxBITMAP_TYPE_XBM_DATA, width, height, depth); (void) Create(bits, wxBITMAP_TYPE_XBM_DATA, width, height, depth);
} }
wxBitmap::~wxBitmap() wxBitmap::~wxBitmap()
@@ -1320,7 +1318,7 @@ public:
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL); int type, const wxPalette *palette = NULL);
virtual bool Create(wxBitmap *WXUNUSED(bitmap), void *WXUNUSED(data), long WXUNUSED(flags), virtual bool Create(wxBitmap *WXUNUSED(bitmap), const void* WXUNUSED(data), long WXUNUSED(flags),
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth) = 1) int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth) = 1)
{ return false; } { return false; }
}; };
@@ -1435,13 +1433,13 @@ public:
const wxPalette *WXUNUSED(palette) = NULL) const wxPalette *WXUNUSED(palette) = NULL)
{ return false; } { return false; }
virtual bool Create(wxBitmap *bitmap, void *data, long flags, virtual bool Create(wxBitmap *bitmap, const void* data, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
}; };
IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *bits, bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits,
long WXUNUSED(flags), long WXUNUSED(flags),
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth)) int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth))
{ {
@@ -1541,13 +1539,13 @@ public:
const wxPalette *WXUNUSED(palette) = NULL) const wxPalette *WXUNUSED(palette) = NULL)
{ return false; } { return false; }
virtual bool Create(wxBitmap *bitmap, void *data, long flags, virtual bool Create(wxBitmap *bitmap, const void* data, long flags,
int width, int height, int depth = 1); int width, int height, int depth = 1);
}; };
IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler)
bool wxXBMDataHandler::Create( wxBitmap *bitmap, void *bits, bool wxXBMDataHandler::Create( wxBitmap *bitmap, const void* bits,
long WXUNUSED(flags), long WXUNUSED(flags),
int width, int height, int WXUNUSED(depth)) int width, int height, int WXUNUSED(depth))
{ {