X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8636aed89614be928547793f91cea7ca54a0d9a8..0c85071392af92841050de11e1b71d0b155f749d:/include/wx/gtk/bitmap.h?ds=sidebyside diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 37c42b14c5..41959d5ba6 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -19,6 +19,7 @@ #include "wx/object.h" #include "wx/string.h" #include "wx/palette.h" +#include "wx/gdiobj.h" //----------------------------------------------------------------------------- // classes @@ -57,28 +58,32 @@ private: // wxBitmap //----------------------------------------------------------------------------- -class wxBitmap: public wxObject +class wxBitmap: public wxGDIObject { public: wxBitmap(); wxBitmap( int width, int height, int depth = -1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 ); - wxBitmap( const char **bits ); - wxBitmap( char **bits ); + wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } + wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); } wxBitmap( const wxBitmap& bmp ); wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM ); ~wxBitmap(); wxBitmap& operator = ( const wxBitmap& bmp ); - bool operator == ( const wxBitmap& bmp ); - bool operator != ( const wxBitmap& bmp ); + bool operator == ( const wxBitmap& bmp ) const; + bool operator != ( const wxBitmap& bmp ) const; bool Ok() const; + bool Create(int width, int height, int depth = -1); + int GetHeight() const; int GetWidth() const; int GetDepth() const; wxMask *GetMask() const; void SetMask( wxMask *mask ); + + wxBitmap GetSubBitmap( const wxRect& rect ) const; bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL ); bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM ); @@ -88,17 +93,20 @@ public: { return GetPalette(); }; // implementation + // -------------- void SetHeight( int height ); void SetWidth( int width ); void SetDepth( int depth ); void SetPixmap( GdkPixmap *pixmap ); + void SetBitmap( GdkBitmap *bitmap ); GdkPixmap *GetPixmap() const; GdkBitmap *GetBitmap() const; - - // no data :-) +protected: + bool CreateFromXpm(const char **bits); + private: DECLARE_DYNAMIC_CLASS(wxBitmap) };