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