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