]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/bitmap.h
wxGTK's built-in dockable menu now give their
[wxWidgets.git] / include / wx / gtk1 / bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bitmap.h
3 // Purpose:
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKBITMAPH__
12 #define __GTKBITMAPH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/palette.h"
22
23 //-----------------------------------------------------------------------------
24 // classes
25 //-----------------------------------------------------------------------------
26
27 class wxMask;
28 class wxBitmap;
29
30 //-----------------------------------------------------------------------------
31 // wxMask
32 //-----------------------------------------------------------------------------
33
34 class wxMask: public wxObject
35 {
36 DECLARE_DYNAMIC_CLASS(wxMask)
37
38 public:
39 wxMask();
40 wxMask( const wxBitmap& bitmap, const wxColour& colour );
41 wxMask( const wxBitmap& bitmap, int paletteIndex );
42 wxMask( const wxBitmap& bitmap );
43 ~wxMask();
44
45 // implementation
46
47 GdkBitmap *m_bitmap;
48 GdkBitmap *GetBitmap() const;
49 };
50
51 //-----------------------------------------------------------------------------
52 // wxBitmap
53 //-----------------------------------------------------------------------------
54
55 class wxBitmap: public wxObject
56 {
57 DECLARE_DYNAMIC_CLASS(wxBitmap)
58
59 public:
60 wxBitmap();
61 wxBitmap( int width, int height, int depth = -1 );
62 wxBitmap( const char bits[], int width, int height, int depth = 1 );
63 wxBitmap( const char **bits );
64 wxBitmap( char **bits );
65 wxBitmap( const wxBitmap& bmp );
66 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
67 ~wxBitmap();
68 wxBitmap& operator = ( const wxBitmap& bmp );
69 bool operator == ( const wxBitmap& bmp );
70 bool operator != ( const wxBitmap& bmp );
71 bool Ok() const;
72
73 int GetHeight() const;
74 int GetWidth() const;
75 int GetDepth() const;
76
77 wxMask *GetMask() const;
78 void SetMask( wxMask *mask );
79
80 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
81 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
82
83 wxPalette *GetPalette() const;
84 wxPalette *GetColourMap() const
85 { return GetPalette(); };
86
87 // implementation
88
89 void SetHeight( int height );
90 void SetWidth( int width );
91 void SetDepth( int depth );
92 void SetPixmap( GdkPixmap *pixmap );
93
94 GdkPixmap *GetPixmap() const;
95 GdkBitmap *GetBitmap() const;
96
97 // no data :-)
98 };
99
100 #endif // __GTKBITMAPH__