X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72cdf4c9b3ce92addf09cfb322f0c19bfb0f8744..480df2cf579c8c39453b76c8dc017b7c4ed677e2:/include/wx/motif/bitmap.h diff --git a/include/wx/motif/bitmap.h b/include/wx/motif/bitmap.h index 6cc1da1765..1af6e40347 100644 --- a/include/wx/motif/bitmap.h +++ b/include/wx/motif/bitmap.h @@ -140,8 +140,12 @@ public: // Initialize with raw XBM data wxBitmap(const char bits[], int width, int height, int depth = 1); - // Initialize with XPM data - wxBitmap(char **data, wxControl* control = NULL); + // from XPM + wxBitmap(const char **data) { (void)CreateFromXpm(data); } + wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); } + + // Initialize with XPM data -- deprecated + wxBitmap(char **data, wxControl* control); // Load a file or resource wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM); @@ -155,6 +159,9 @@ public: virtual bool Create(int width, int height, int depth = -1); virtual bool Create(void *data, long type, int width, int height, int depth = 1); + + wxBitmap GetSubBitmap( const wxRect& rect ) const; + virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); @@ -176,8 +183,8 @@ public: void SetMask(wxMask *mask) ; wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } - bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; } - bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; } + bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; } + bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } // Format handling static wxList& GetHandlers() { return sm_handlers; } @@ -194,18 +201,22 @@ public: // Motif implementation public: WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; } - WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; } + WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; } virtual WXPixmap GetLabelPixmap(WXWidget w) ; virtual WXPixmap GetArmPixmap(WXWidget w) ; virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ; + void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; } protected: static wxList sm_handlers; + +protected: + bool CreateFromXpm(const char **bits); }; // Creates a bitmap with transparent areas drawn in // the given colour. -wxBitmap wxCreateMaskedBitmap(wxBitmap& bitmap, wxColour& colour); +wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour); #endif // _WX_BITMAP_H_