X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2aeec9ecccdb1b051848768f45a4ac1859ded5f3..dbc65e2760f79e0296c7e8b49ec6791d62070d3e:/include/wx/msw/bitmap.h diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 2aab4a41ee..dff632bbb3 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -29,6 +29,7 @@ class WXDLLEXPORT wxMask; class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxControl; class WXDLLEXPORT wxImage; +class WXDLLEXPORT wxPalette; // ---------------------------------------------------------------------------- // Bitmap data @@ -47,7 +48,9 @@ public: public: int m_numColors; +#if wxUSE_PALETTE wxPalette m_bitmapPalette; +#endif // wxUSE_PALETTE int m_quality; // MSW-specific @@ -90,9 +93,12 @@ public: // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1); - + +#if wxUSE_IMAGE // Convert from wxImage: - wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); } + wxBitmap(const wxImage& image, int depth = -1) + { (void)CreateFromImage(image, depth); } +#endif // wxUSE_IMAGE // we must have this, otherwise icons are silently copied into bitmaps using // the copy ctor but the resulting bitmap is invalid! @@ -121,11 +127,13 @@ public: virtual ~wxBitmap(); +#if wxUSE_IMAGE wxImage ConvertToImage() const; +#endif // wxUSE_IMAGE // get the given part of bitmap wxBitmap GetSubBitmap( const wxRect& rect ) const; - + // copies the contents and mask of the given (colour) icon to the bitmap bool CopyFromIcon(const wxIcon& icon); @@ -142,8 +150,10 @@ public: int GetQuality() const { return (GetBitmapData() ? GetBitmapData()->m_quality : 0); } void SetQuality(int q); +#if wxUSE_PALETTE wxPalette* GetPalette() const { return (GetBitmapData() ? (& GetBitmapData()->m_bitmapPalette) : (wxPalette*) NULL); } void SetPalette(const wxPalette& palette); +#endif // wxUSE_PALETTE wxMask *GetMask() const { return (GetBitmapData() ? GetBitmapData()->m_bitmapMask : (wxMask*) NULL); } void SetMask(wxMask *mask) ; @@ -155,10 +165,12 @@ public: void SetOk(bool isOk); #endif // WXWIN_COMPATIBILITY_2 +#if wxUSE_PALETTE #if WXWIN_COMPATIBILITY wxPalette *GetColourMap() const { return GetPalette(); } void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); }; #endif // WXWIN_COMPATIBILITY +#endif // wxUSE_PALETTE // Implementation public: @@ -191,9 +203,11 @@ protected: // creates the bitmap from XPM data, supposed to be called from ctor bool CreateFromXpm(const char **bits); + +#if wxUSE_IMAGE // creates the bitmap from wxImage, supposed to be called from ctor bool CreateFromImage(const wxImage& image, int depth); - +#endif // wxUSE_IMAGE private: #ifdef __WIN32__