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