]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKBITMAPH__
12 #define __GTKBITMAPH__
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/palette.h"
22 #include "wx/gdiobj.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 class wxMask
: public wxObject
39 wxMask( const wxBitmap
& bitmap
, const wxColour
& colour
);
40 wxMask( const wxBitmap
& bitmap
, int paletteIndex
);
41 wxMask( const wxBitmap
& bitmap
);
44 bool Create( const wxBitmap
& bitmap
, const wxColour
& colour
);
45 bool Create( const wxBitmap
& bitmap
, int paletteIndex
);
46 bool Create( const wxBitmap
& bitmap
);
51 GdkBitmap
*GetBitmap() const;
54 DECLARE_DYNAMIC_CLASS(wxMask
)
57 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
61 class wxBitmap
: public wxGDIObject
65 wxBitmap( int width
, int height
, int depth
= -1 );
66 wxBitmap( const char bits
[], int width
, int height
, int depth
= 1 );
67 wxBitmap( const char **bits
) { (void)CreateFromXpm(bits
); }
68 wxBitmap( char **bits
) { (void)CreateFromXpm((const char **)bits
); }
69 wxBitmap( const wxBitmap
& bmp
);
70 wxBitmap( const wxString
&filename
, int type
= wxBITMAP_TYPE_XPM
);
72 wxBitmap
& operator = ( const wxBitmap
& bmp
);
73 bool operator == ( const wxBitmap
& bmp
) const;
74 bool operator != ( const wxBitmap
& bmp
) const;
77 bool Create(int width
, int height
, int depth
= -1);
79 int GetHeight() const;
83 wxMask
*GetMask() const;
84 void SetMask( wxMask
*mask
);
86 wxBitmap
GetSubBitmap( const wxRect
& rect
) const;
88 bool SaveFile( const wxString
&name
, int type
, wxPalette
*palette
= (wxPalette
*) NULL
);
89 bool LoadFile( const wxString
&name
, int type
= wxBITMAP_TYPE_XPM
);
91 wxPalette
*GetPalette() const;
92 wxPalette
*GetColourMap() const
93 { return GetPalette(); };
98 void SetHeight( int height
);
99 void SetWidth( int width
);
100 void SetDepth( int depth
);
101 void SetPixmap( GdkPixmap
*pixmap
);
102 void SetBitmap( GdkBitmap
*bitmap
);
104 GdkPixmap
*GetPixmap() const;
105 GdkBitmap
*GetBitmap() const;
108 bool CreateFromXpm(const char **bits
);
111 DECLARE_DYNAMIC_CLASS(wxBitmap
)
114 #endif // __GTKBITMAPH__