X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8855e47254a28f5141524b3aaaac03c2944e997..907ea7d5cc64befac486b269b3ab5b87dfc246d5:/include/wx/palmos/bitmap.h diff --git a/include/wx/palmos/bitmap.h b/include/wx/palmos/bitmap.h index 076784bc5a..4ef6b5dd56 100644 --- a/include/wx/palmos/bitmap.h +++ b/include/wx/palmos/bitmap.h @@ -16,26 +16,26 @@ #include "wx/gdicmn.h" #include "wx/palette.h" -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxBitmapHandler; -class WXDLLEXPORT wxBitmapRefData; -class WXDLLEXPORT wxControl; -class WXDLLEXPORT wxCursor; -class WXDLLEXPORT wxDC; +class WXDLLIMPEXP_FWD_CORE wxBitmap; +class WXDLLIMPEXP_FWD_CORE wxBitmapHandler; +class WXDLLIMPEXP_FWD_CORE wxBitmapRefData; +class WXDLLIMPEXP_FWD_CORE wxControl; +class WXDLLIMPEXP_FWD_CORE wxCursor; +class WXDLLIMPEXP_FWD_CORE wxDC; #if wxUSE_WXDIB -class WXDLLEXPORT wxDIB; +class WXDLLIMPEXP_FWD_CORE wxDIB; #endif -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxImage; -class WXDLLEXPORT wxMask; -class WXDLLEXPORT wxPalette; -class WXDLLEXPORT wxPixelDataBase; +class WXDLLIMPEXP_FWD_CORE wxIcon; +class WXDLLIMPEXP_FWD_CORE wxImage; +class WXDLLIMPEXP_FWD_CORE wxMask; +class WXDLLIMPEXP_FWD_CORE wxPalette; +class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; // ---------------------------------------------------------------------------- // wxBitmap: a mono or colour bitmap // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBitmap : public wxGDIImage +class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage { public: // default ctor creates an invalid bitmap, you must Create() it later @@ -45,21 +45,21 @@ public: wxBitmap(const char bits[], int width, int height, int depth = 1); // Initialize with XPM data - wxBitmap(const char **data) { CreateFromXpm(data); } - wxBitmap(char **data) { CreateFromXpm((const char **)data); } + wxBitmap(const char* const* data); // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); // 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 // is omitted, will create a bitmap compatible with the display) // // NB: this ctor will create a DIB for 24 and 32bpp bitmaps, use ctor // taking a DC argument if you want to force using DDB in this case - wxBitmap(int width, int height, int depth = -1); + wxBitmap(int width, int height, int depth = -1) { /*TODO*/ } + wxBitmap(const wxSize& sz, int depth = -1) { /*TODO*/ } // Create a bitmap compatible with the given DC wxBitmap(int width, int height, const wxDC& dc); @@ -92,10 +92,11 @@ public: return *this; } - virtual ~wxBitmap(); + virtual ~wxBitmap() {} #if wxUSE_IMAGE && wxUSE_WXDIB wxImage ConvertToImage() const; + wxBitmap ConvertToDisabled(unsigned char brightness = 255) const; #endif // wxUSE_IMAGE // get the given part of bitmap @@ -112,10 +113,13 @@ public: bool CopyFromDIB(const wxDIB& dib); #endif - virtual bool Create(int width, int height, int depth = -1); + virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); + virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) + { return Create(sz.GetWidth(), sz.GetHeight(), depth); } + 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 LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); + virtual bool Create(const void* data, long type, int width, int height, int depth = 1); + virtual bool LoadFile(const wxString& name, long type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); wxBitmapRefData *GetBitmapData() const @@ -133,13 +137,9 @@ public: wxMask *GetMask() const; void SetMask(wxMask *mask); - bool operator==(const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; } - bool operator!=(const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } - // these functions are internal and shouldn't be used, they risk to // disappear in the future bool HasAlpha() const; - void UseAlpha(); // implementation only from now on // ------------------------------- @@ -148,20 +148,12 @@ public: void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); } WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); } -#ifdef __WXDEBUG__ - void SetSelectedInto(wxDC *dc); - wxDC *GetSelectedInto() const; -#endif // __WXDEBUG__ - protected: // common part of all ctors void Init(); 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 bool DoCreate(int w, int h, int depth, WXHDC hdc); @@ -184,7 +176,7 @@ private: // wxMask: a mono bitmap used for drawing bitmaps transparently. // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMask : public wxObject +class WXDLLIMPEXP_CORE wxMask : public wxObject { public: wxMask(); @@ -223,7 +215,7 @@ protected: // wxBitmapHandler is a class which knows how to load/save bitmaps to/from file // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBitmapHandler : public wxGDIImageHandler +class WXDLLIMPEXP_CORE wxBitmapHandler : public wxGDIImageHandler { public: wxBitmapHandler() { m_type = wxBITMAP_TYPE_INVALID; } @@ -235,7 +227,7 @@ public: // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the // old class which worked only with bitmaps virtual bool Create(wxBitmap *bitmap, - void *data, + const void* data, long flags, int width, int height, int depth = 1); virtual bool LoadFile(wxBitmap *bitmap, @@ -248,7 +240,7 @@ public: const wxPalette *palette = NULL); virtual bool Create(wxGDIImage *image, - void *data, + const void* data, long flags, int width, int height, int depth = 1); virtual bool Load(wxGDIImage *image,