X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af49c4b8a2d3553e733e71c7dd3911881f4c1a2a..ddadf560da7ec1d7477a40ed5b9277b6468dc5e7:/include/wx/mgl/bitmap.h diff --git a/include/wx/mgl/bitmap.h b/include/wx/mgl/bitmap.h index 51400743f6..f6392e5f8c 100644 --- a/include/wx/mgl/bitmap.h +++ b/include/wx/mgl/bitmap.h @@ -6,90 +6,40 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - #ifndef __WX_BITMAP_H__ #define __WX_BITMAP_H__ -#ifdef __GNUG__ -#pragma interface "bitmap.h" -#endif - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" -#include "wx/palette.h" -#include "wx/gdiobj.h" - - //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- -class WXDLLEXPORT wxMask; -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxImage; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxMemoryDC; +class WXDLLIMPEXP_FWD_CORE wxDC; +class WXDLLIMPEXP_FWD_CORE wxMemoryDC; class MGLDevCtx; struct bitmap_t; -//----------------------------------------------------------------------------- -// wxMask -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxMask: public wxObject -{ -public: - wxMask(); - wxMask(const wxBitmap& bitmap, const wxColour& colour); - wxMask(const wxBitmap& bitmap, int paletteIndex); - wxMask(const wxBitmap& bitmap); - ~wxMask(); - - bool Create(const wxBitmap& bitmap, const wxColour& colour); - bool Create(const wxBitmap& bitmap, int paletteIndex); - bool Create(const wxBitmap& bitmap); - - // implementation - wxBitmap *m_bitmap; - - wxBitmap *GetBitmap() const { return m_bitmap; } - -private: - DECLARE_DYNAMIC_CLASS(wxMask) -}; - //----------------------------------------------------------------------------- // wxBitmap //----------------------------------------------------------------------------- -class WXDLLEXPORT wxBitmapHandler : public wxBitmapHandlerBase -{ -public: - wxBitmapHandler() : wxBitmapHandlerBase() {} -private: - DECLARE_DYNAMIC_CLASS(wxBitmapHandler) -}; - -class WXDLLEXPORT wxBitmap: public wxBitmapBase +class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase { public: wxBitmap() {} - wxBitmap(int width, int height, int depth = -1); + wxBitmap(int width, int height, int depth = -1) + { Create(width, height, depth); } + wxBitmap(const wxSize& sz, int depth = -1) + { Create(sz, depth); } wxBitmap(const char bits[], int width, int height, int depth = 1); - wxBitmap(const char **bits) { CreateFromXpm(bits); } - wxBitmap(char **bits) { CreateFromXpm((const char **)bits); } - wxBitmap(const wxBitmap& bmp); - wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); + wxBitmap(const char* const* bits); + wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); wxBitmap(const wxImage& image, int depth = -1); - ~wxBitmap() {} - wxBitmap& operator = (const wxBitmap& bmp); - bool operator == (const wxBitmap& bmp) const; - bool operator != (const wxBitmap& bmp) const; - bool Ok() const; + virtual ~wxBitmap() {} - bool Create(int width, int height, int depth = -1); + bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); + bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) + { return Create(sz.GetWidth(), sz.GetHeight(), depth); } virtual int GetHeight() const; virtual int GetWidth() const; @@ -102,8 +52,8 @@ public: virtual wxBitmap GetSubBitmap(const wxRect& rect) const; - virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const; - virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); + virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = NULL) const; + virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual wxPalette *GetPalette() const; virtual void SetPalette(const wxPalette& palette); @@ -118,11 +68,14 @@ public: virtual void SetWidth(int width); virtual void SetDepth(int depth); + virtual wxColour QuantizeColour(const wxColour& colour) const; + // get underlying native representation: bitmap_t *GetMGLbitmap_t() const; protected: - bool CreateFromXpm(const char **bits); + virtual wxGDIRefData *CreateGDIRefData() const; + virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; // creates temporary DC for access to bitmap's data: MGLDevCtx *CreateTmpDC() const;