]>
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 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 class wxMask
: public wxObject
40 wxMask( const wxBitmap
& bitmap
, const wxColour
& colour
);
41 wxMask( const wxBitmap
& bitmap
, int paletteIndex
);
42 wxMask( const wxBitmap
& bitmap
);
45 bool Create( const wxBitmap
& bitmap
, const wxColour
& colour
);
46 bool Create( const wxBitmap
& bitmap
, int paletteIndex
);
47 bool Create( const wxBitmap
& bitmap
);
52 GdkBitmap
*GetBitmap() const;
55 DECLARE_DYNAMIC_CLASS(wxMask
)
58 //-----------------------------------------------------------------------------
60 //-----------------------------------------------------------------------------
62 class wxBitmap
: public wxGDIObject
66 wxBitmap( int width
, int height
, int depth
= -1 );
67 wxBitmap( const char bits
[], int width
, int height
, int depth
= 1 );
68 wxBitmap( const char **bits
) { (void)CreateFromXpm(bits
); }
69 wxBitmap( char **bits
) { (void)CreateFromXpm((const char **)bits
); }
70 wxBitmap( const wxBitmap
& bmp
);
71 wxBitmap( const wxString
&filename
, int type
= wxBITMAP_TYPE_XPM
);
72 wxBitmap( const wxImage
& image
, int depth
= -1 ) { (void)CreateFromImage(image
, depth
); }
74 wxBitmap
& operator = ( const wxBitmap
& bmp
);
75 bool operator == ( const wxBitmap
& bmp
) const;
76 bool operator != ( const wxBitmap
& bmp
) const;
79 bool Create(int width
, int height
, int depth
= -1);
81 int GetHeight() const;
85 wxImage
ConvertToImage() const;
87 // copies the contents and mask of the given (colour) icon to the bitmap
88 virtual bool CopyFromIcon(const wxIcon
& icon
);
90 wxMask
*GetMask() const;
91 void SetMask( wxMask
*mask
);
93 wxBitmap
GetSubBitmap( const wxRect
& rect
) const;
95 bool SaveFile( const wxString
&name
, int type
, wxPalette
*palette
= (wxPalette
*) NULL
);
96 bool LoadFile( const wxString
&name
, int type
= wxBITMAP_TYPE_XPM
);
98 wxPalette
*GetPalette() const;
99 wxPalette
*GetColourMap() const
100 { return GetPalette(); };
105 void SetHeight( int height
);
106 void SetWidth( int width
);
107 void SetDepth( int depth
);
108 void SetPixmap( GdkPixmap
*pixmap
);
109 void SetBitmap( GdkBitmap
*bitmap
);
111 GdkPixmap
*GetPixmap() const;
112 GdkBitmap
*GetBitmap() const;
115 bool CreateFromXpm(const char **bits
);
116 bool CreateFromImage(const wxImage
& image
, int depth
);
119 DECLARE_DYNAMIC_CLASS(wxBitmap
)
122 #endif // __GTKBITMAPH__