virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL) = 0;
- void SetName(const wxString& name) { m_name = name; }
- void SetExtension(const wxString& ext) { m_extension = ext; }
- void SetType(wxBitmapType type) { m_type = type; }
- wxString GetName() const { return m_name; }
- wxString GetExtension() const { return m_extension; }
- wxBitmapType GetType() const { return m_type; }
-
-protected:
+ void SetName(const wxString& name) { m_name = name; }
+ void SetExtension(const wxString& ext) { m_extension = ext; }
+ void SetType(wxBitmapType type) { m_type = type; }
+ wxString GetName() const { return m_name; }
+ wxString GetExtension() const { return m_extension; }
+ wxBitmapType GetType() const { return m_type; }
+
+private:
wxString m_name;
wxString m_extension;
wxBitmapType m_type;
+private:
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
};
wxPalette *GetColourMap() const { return GetPalette(); };
#endif // wxUSE_PALETTE
- static void InitStandardHandlers() { }
+ static void InitStandardHandlers();
// implementation
// --------------
friend class wxMemoryDC;
#endif
-
+ friend class wxBitmapHandler;
+
+private:
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__
wxPalette *GetColourMap() const { return GetPalette(); };
#endif // wxUSE_PALETTE
- static void InitStandardHandlers() { }
+ static void InitStandardHandlers();
// implementation
// --------------
friend class wxMemoryDC;
#endif
-
+ friend class wxBitmapHandler;
+
+private:
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__
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
{
- DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
public:
- wxBitmapHandler() : m_name(), m_extension(), m_type(0) { }
- virtual ~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);
+ 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);
- 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;
+private:
+ DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
};
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
}
}
+//-----------------------------------------------------------------------------
+// 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__
}
}
+//-----------------------------------------------------------------------------
+// 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__