]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/bitmap.h
Updates from Chris Breeze
[wxWidgets.git] / include / wx / gtk1 / bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bitmap.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // RCS-ID: $Id$
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef __GTKBITMAPH__
13 #define __GTKBITMAPH__
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/palette.h"
23
24 //-----------------------------------------------------------------------------
25 // classes
26 //-----------------------------------------------------------------------------
27
28 class wxDC;
29 class wxPaintDC;
30 class wxMemoryDC;
31 class wxToolBarGTK;
32
33 class wxMask;
34 class wxBitmap;
35
36 //-----------------------------------------------------------------------------
37 // wxMask
38 //-----------------------------------------------------------------------------
39
40 class wxMask: public wxObject
41 {
42 DECLARE_DYNAMIC_CLASS(wxMask)
43
44 public:
45
46 wxMask(void);
47 wxMask( const wxBitmap& bitmap, const wxColour& colour );
48 wxMask( const wxBitmap& bitmap, const int paletteIndex );
49 wxMask( const wxBitmap& bitmap );
50 ~wxMask(void);
51
52 private:
53
54 friend wxBitmap;
55 friend wxDC;
56 friend wxPaintDC;
57 friend wxToolBarGTK;
58
59 GdkBitmap *GetBitmap(void) const;
60
61 protected:
62
63 GdkBitmap *m_bitmap;
64
65 };
66
67 //-----------------------------------------------------------------------------
68 // wxBitmap
69 //-----------------------------------------------------------------------------
70
71 // CMB 20/5/98: added xbm constructor and GetBitmap() method
72 class wxBitmap: public wxObject
73 {
74 DECLARE_DYNAMIC_CLASS(wxBitmap)
75
76 public:
77
78 wxBitmap(void);
79 wxBitmap( const int width, const int height, const int depth = -1 );
80 wxBitmap( const char bits[], const int width, const int height, const int depth = 1 );
81 wxBitmap( char **bits );
82 wxBitmap( const wxBitmap& bmp );
83 wxBitmap( const wxBitmap* bmp );
84 wxBitmap( const wxString &filename, const int type );
85 ~wxBitmap(void);
86 wxBitmap& operator = ( const wxBitmap& bmp );
87 bool operator == ( const wxBitmap& bmp );
88 bool operator != ( const wxBitmap& bmp );
89 bool Ok(void) const;
90
91 int GetHeight(void) const;
92 int GetWidth(void) const;
93 int GetDepth(void) const;
94 void SetHeight( const int height );
95 void SetWidth( const int width );
96 void SetDepth( const int depth );
97
98 wxMask *GetMask(void) const;
99 void SetMask( wxMask *mask );
100
101 bool SaveFile( const wxString &name, const int type, wxPalette *palette = NULL );
102 bool LoadFile( const wxString &name, const int type );
103
104 wxPalette *GetPalette(void) const;
105 wxPalette *GetColourMap(void) const
106 { return GetPalette(); };
107
108 private:
109
110 friend wxDC;
111 friend wxPaintDC;
112 friend wxMemoryDC;
113 friend wxToolBarGTK;
114
115 GdkPixmap *GetPixmap(void) const;
116 GdkBitmap *GetBitmap(void) const;
117
118 // no data :-)
119 };
120
121 #endif // __GTKBITMAPH__