]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bitmap.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
6f65e337 | 6 | // RCS-ID: $Id$ |
c801d85f | 7 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem |
f05df5a8 | 8 | // Licence: wxWindows licence |
c801d85f KB |
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 | ||
6f65e337 JS |
28 | class wxDC; |
29 | class wxPaintDC; | |
30 | class wxMemoryDC; | |
716b7364 | 31 | class wxToolBar; |
53b28675 RR |
32 | class wxBitmapButton; |
33 | class wxStaticBitmap; | |
d355d3fe | 34 | class wxFrame; |
c33c4050 | 35 | class wxDialog; |
f4e325b3 | 36 | class wxTreeCtrl; |
dd7f2a6c | 37 | class wxNotebook; |
6f65e337 | 38 | |
c801d85f KB |
39 | class wxMask; |
40 | class wxBitmap; | |
41 | ||
42 | //----------------------------------------------------------------------------- | |
43 | // wxMask | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | class wxMask: public wxObject | |
47 | { | |
48 | DECLARE_DYNAMIC_CLASS(wxMask) | |
49 | ||
50 | public: | |
44216b3b VZ |
51 | |
52 | wxMask(); | |
c801d85f | 53 | wxMask( const wxBitmap& bitmap, const wxColour& colour ); |
debe6624 | 54 | wxMask( const wxBitmap& bitmap, int paletteIndex ); |
c801d85f | 55 | wxMask( const wxBitmap& bitmap ); |
44216b3b | 56 | ~wxMask(); |
c801d85f | 57 | |
6f65e337 | 58 | private: |
44216b3b | 59 | |
6f65e337 JS |
60 | friend wxBitmap; |
61 | friend wxDC; | |
62 | friend wxPaintDC; | |
716b7364 | 63 | friend wxToolBar; |
53b28675 RR |
64 | friend wxBitmapButton; |
65 | friend wxStaticBitmap; | |
d355d3fe | 66 | friend wxFrame; |
c33c4050 | 67 | friend wxDialog; |
f4e325b3 | 68 | friend wxTreeCtrl; |
dd7f2a6c | 69 | friend wxNotebook; |
44216b3b VZ |
70 | |
71 | GdkBitmap *GetBitmap() const; | |
72 | ||
c801d85f | 73 | protected: |
44216b3b VZ |
74 | |
75 | GdkBitmap *m_bitmap; | |
76 | ||
c801d85f KB |
77 | }; |
78 | ||
79 | //----------------------------------------------------------------------------- | |
80 | // wxBitmap | |
81 | //----------------------------------------------------------------------------- | |
82 | ||
6f65e337 | 83 | // CMB 20/5/98: added xbm constructor and GetBitmap() method |
c801d85f KB |
84 | class wxBitmap: public wxObject |
85 | { | |
86 | DECLARE_DYNAMIC_CLASS(wxBitmap) | |
87 | ||
88 | public: | |
89 | ||
44216b3b | 90 | wxBitmap(); |
debe6624 JS |
91 | wxBitmap( int width, int height, int depth = -1 ); |
92 | wxBitmap( const char bits[], int width, int height, int depth = 1 ); | |
c801d85f KB |
93 | wxBitmap( char **bits ); |
94 | wxBitmap( const wxBitmap& bmp ); | |
95 | wxBitmap( const wxBitmap* bmp ); | |
44216b3b VZ |
96 | wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM); |
97 | ~wxBitmap(); | |
c801d85f KB |
98 | wxBitmap& operator = ( const wxBitmap& bmp ); |
99 | bool operator == ( const wxBitmap& bmp ); | |
100 | bool operator != ( const wxBitmap& bmp ); | |
44216b3b VZ |
101 | bool Ok() const; |
102 | ||
103 | int GetHeight() const; | |
104 | int GetWidth() const; | |
105 | int GetDepth() const; | |
debe6624 JS |
106 | void SetHeight( int height ); |
107 | void SetWidth( int width ); | |
108 | void SetDepth( int depth ); | |
c801d85f | 109 | |
44216b3b | 110 | wxMask *GetMask() const; |
c801d85f | 111 | void SetMask( wxMask *mask ); |
44216b3b | 112 | |
219f895a | 113 | void Resize( int height, int width ); |
44216b3b | 114 | |
c67daf87 | 115 | bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL ); |
44216b3b | 116 | bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM); |
debe6624 | 117 | |
44216b3b VZ |
118 | wxPalette *GetPalette() const; |
119 | wxPalette *GetColourMap() const | |
c801d85f KB |
120 | { return GetPalette(); }; |
121 | ||
44216b3b VZ |
122 | GdkPixmap *GetPixmap() const; |
123 | GdkBitmap *GetBitmap() const; | |
f05df5a8 VZ |
124 | |
125 | private: | |
44216b3b VZ |
126 | void DestroyImage(); |
127 | void RecreateImage(); | |
128 | void Render(); | |
129 | ||
c801d85f KB |
130 | // no data :-) |
131 | }; | |
132 | ||
133 | #endif // __GTKBITMAPH__ |