Second try to add "support" for deriving from
wxBitmapHandlerBase. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -71,11 +71,12 @@ public:
|
|||||||
wxString GetExtension() const { return m_extension; }
|
wxString GetExtension() const { return m_extension; }
|
||||||
wxBitmapType GetType() const { return m_type; }
|
wxBitmapType GetType() const { return m_type; }
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
wxString m_extension;
|
wxString m_extension;
|
||||||
wxBitmapType m_type;
|
wxBitmapType m_type;
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
|
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -106,7 +106,7 @@ public:
|
|||||||
wxPalette *GetColourMap() const { return GetPalette(); };
|
wxPalette *GetColourMap() const { return GetPalette(); };
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
static void InitStandardHandlers() { }
|
static void InitStandardHandlers();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
@@ -153,8 +153,30 @@ private:
|
|||||||
|
|
||||||
friend class wxMemoryDC;
|
friend class wxMemoryDC;
|
||||||
#endif
|
#endif
|
||||||
|
friend class wxBitmapHandler;
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxBitmapHandler
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxBitmapHandler: public wxBitmapHandlerBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
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__
|
||||||
|
@@ -106,7 +106,7 @@ public:
|
|||||||
wxPalette *GetColourMap() const { return GetPalette(); };
|
wxPalette *GetColourMap() const { return GetPalette(); };
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
static void InitStandardHandlers() { }
|
static void InitStandardHandlers();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
@@ -153,8 +153,30 @@ private:
|
|||||||
|
|
||||||
friend class wxMemoryDC;
|
friend class wxMemoryDC;
|
||||||
#endif
|
#endif
|
||||||
|
friend class wxBitmapHandler;
|
||||||
|
|
||||||
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxBitmapHandler
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxBitmapHandler: public wxBitmapHandlerBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
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__
|
||||||
|
@@ -103,9 +103,8 @@ public:
|
|||||||
|
|
||||||
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
|
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
|
||||||
public:
|
public:
|
||||||
wxBitmapHandler() : m_name(), m_extension(), m_type(0) { }
|
wxBitmapHandler() { }
|
||||||
virtual ~wxBitmapHandler();
|
virtual ~wxBitmapHandler();
|
||||||
|
|
||||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||||
@@ -113,17 +112,8 @@ public:
|
|||||||
int desiredWidth, int desiredHeight);
|
int desiredWidth, int desiredHeight);
|
||||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||||
|
|
||||||
void SetName(const wxString& name) { m_name = name; }
|
private:
|
||||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||||
|
@@ -1555,4 +1555,36 @@ void wxBitmap::PurgeOtherRepresentations(wxBitmap::Representation keep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxBitmapHandler
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler,wxBitmapHandlerBase)
|
||||||
|
|
||||||
|
wxBitmapHandler::~wxBitmapHandler()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* static */ void wxBitmap::InitStandardHandlers()
|
||||||
|
{
|
||||||
|
// TODO: Insert handler based on GdkPixbufs handler later
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // __WXGTK20__
|
#endif // __WXGTK20__
|
||||||
|
@@ -1555,4 +1555,36 @@ void wxBitmap::PurgeOtherRepresentations(wxBitmap::Representation keep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxBitmapHandler
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler,wxBitmapHandlerBase)
|
||||||
|
|
||||||
|
wxBitmapHandler::~wxBitmapHandler()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* static */ void wxBitmap::InitStandardHandlers()
|
||||||
|
{
|
||||||
|
// TODO: Insert handler based on GdkPixbufs handler later
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // __WXGTK20__
|
#endif // __WXGTK20__
|
||||||
|
Reference in New Issue
Block a user