X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b5c2d5262df98e197736d81d8a9fe54d1932ab0..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/os2/bitmap.h diff --git a/include/wx/os2/bitmap.h b/include/wx/os2/bitmap.h index 82639748f2..b4c1642395 100644 --- a/include/wx/os2/bitmap.h +++ b/include/wx/os2/bitmap.h @@ -4,7 +4,6 @@ // Author: David Webster // Modified by: // Created: 11/28/99 -// RCS-ID: $Id$ // Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -25,7 +24,6 @@ class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxMask; class WXDLLIMPEXP_FWD_CORE wxCursor; class WXDLLIMPEXP_FWD_CORE wxControl; -class WXDLLIMPEXP_FWD_CORE wxImage; class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; // ---------------------------------------------------------------------------- @@ -64,7 +62,8 @@ public: // wxBitmap: a mono or colour bitmap // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage +class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage, + public wxBitmapHelpers { public: // default ctor creates an invalid bitmap, you must Create() it later @@ -91,13 +90,13 @@ public: // needed for old GCC wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif // Load a resource wxBitmap( int nId - ,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE + ,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE ); // For compatiability with other ports, under OS/2 does same as default ctor @@ -114,7 +113,16 @@ public: ); // If depth is omitted, will create a bitmap compatible with the display - wxBitmap( int nWidth, int nHeight, int nDepth = -1 ); + wxBitmap( int nWidth, int nHeight, int nDepth = -1 ) + { + Init(); + (void)Create(nWidth, nHeight, nDepth); + } + wxBitmap( const wxSize& sz, int nDepth = -1 ) + { + Init(); + (void)Create(sz, nDepth); + } wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); } @@ -140,6 +148,7 @@ public: virtual ~wxBitmap(); wxImage ConvertToImage() const; + wxBitmap ConvertToDisabled(unsigned char brightness = 255) const; // get the given part of bitmap wxBitmap GetSubBitmap(const wxRect& rRect) const; @@ -152,8 +161,13 @@ public: virtual bool Create( int nWidth ,int nHeight - ,int nDepth = -1 + ,int nDepth = 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& WXUNUSED(dc)) + { return Create(width,height); } + virtual bool Create( const void* pData ,wxBitmapType lType ,int nWidth @@ -161,10 +175,10 @@ public: ,int nDepth = 1 ); virtual bool LoadFile( int nId - ,wxBitmapType lType = wxBITMAP_TYPE_BMP_RESOURCE + ,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE ); virtual bool LoadFile( const wxString& rName - ,wxBitmapType lType = wxBITMAP_TYPE_XPM + ,wxBitmapType lType = wxBITMAP_DEFAULT_TYPE ); virtual bool SaveFile( const wxString& rName ,wxBitmapType lType @@ -184,12 +198,12 @@ public: void SetQuality(int nQ); wxPalette* GetPalette() const - { return (GetBitmapData() ? (& GetBitmapData()->m_vBitmapPalette) : (wxPalette*) NULL); } + { return (GetBitmapData() ? (& GetBitmapData()->m_vBitmapPalette) : NULL); } void SetPalette(const wxPalette& rPalette); inline wxMask* GetMask() const - { return (GetBitmapData() ? GetBitmapData()->m_pBitmapMask : (wxMask*) NULL); } + { return (GetBitmapData() ? GetBitmapData()->m_pBitmapMask : NULL); } void SetMask(wxMask* pMask) ; @@ -205,7 +219,7 @@ public: { if (GetBitmapData()) GetBitmapData()->m_pSelectedInto = pDc; } inline wxDC* GetSelectedInto() const - { return (GetBitmapData() ? GetBitmapData()->m_pSelectedInto : (wxDC*) NULL); } + { return (GetBitmapData() ? GetBitmapData()->m_pSelectedInto : NULL); } inline bool IsMono(void) const { return m_bIsMono; }