Derive wxBitmap from wxBitmapBase in wxMotif, with the appropriate
changes to wxIcon. Fix deprecation warnings and use %p to format WXWidget in debug output (fixes the 4 non-deprecation warnings). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,7 +32,7 @@ class WXDLLEXPORT wxImage;
|
||||
class WXDLLEXPORT wxMask;
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__)
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXMOTIF__)
|
||||
// Only used by some ports
|
||||
// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
|
||||
|
||||
|
@@ -100,32 +100,35 @@ public:
|
||||
|
||||
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxObject
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
public:
|
||||
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
wxBitmapHandler() : wxBitmapHandlerBase() { }
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
void SetType(long type) { m_type = type; }
|
||||
wxString GetName() const { return m_name; }
|
||||
wxString GetExtension() const { return m_extension; }
|
||||
long GetType() const { return m_type; }
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
long m_type;
|
||||
int desiredWidth, int desiredHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
|
||||
int type, const wxPalette *palette = NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
};
|
||||
|
||||
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||
|
||||
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||
class WXDLLEXPORT wxBitmap: public wxBitmapBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
|
||||
@@ -149,10 +152,11 @@ public:
|
||||
wxBitmap(char **data, wxControl* control);
|
||||
|
||||
// Load a file or resource
|
||||
wxBitmap(const wxString& name, int type = wxBITMAP_TYPE_XPM);
|
||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
|
||||
// Constructor for generalised creation from data
|
||||
wxBitmap(void *data, long type, int width, int height, int depth = 1);
|
||||
wxBitmap(void *data, wxBitmapType type,
|
||||
int width, int height, int depth = 1);
|
||||
|
||||
// If depth is omitted, will create a bitmap compatible with the display
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
@@ -163,12 +167,15 @@ public:
|
||||
~wxBitmap();
|
||||
|
||||
virtual bool Create(int width, int height, int depth = -1);
|
||||
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
|
||||
virtual bool Create(void *data, wxBitmapType type,
|
||||
int width, int height, int depth = 1);
|
||||
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
|
||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||
virtual bool LoadFile(const wxString& name,
|
||||
wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
virtual bool SaveFile(const wxString& name, wxBitmapType type,
|
||||
const wxPalette *cmap = NULL) const;
|
||||
|
||||
wxImage ConvertToImage() const;
|
||||
|
||||
@@ -197,16 +204,7 @@ public:
|
||||
bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// Format handling
|
||||
static wxList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandler *handler);
|
||||
static void InsertHandler(wxBitmapHandler *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
|
||||
static wxBitmapHandler *FindHandler(long bitmapType);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
static void CleanUpHandlers();
|
||||
|
||||
// Motif implementation
|
||||
public:
|
||||
@@ -217,9 +215,6 @@ public:
|
||||
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
|
||||
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; }
|
||||
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
protected:
|
||||
bool CreateFromXpm(const char **bits);
|
||||
bool CreateFromImage(const wxImage& image, int depth);
|
||||
|
@@ -39,11 +39,11 @@ public:
|
||||
wxIcon(const char **data);
|
||||
wxIcon(char **data);
|
||||
|
||||
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
|
||||
wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
~wxIcon();
|
||||
|
||||
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
|
||||
bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
// create from bitmap (which should have a mask unless it's monochrome):
|
||||
|
Reference in New Issue
Block a user