]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bitmap.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
6 | // 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 | class wxBitmap: public wxObject | |
72 | { | |
73 | DECLARE_DYNAMIC_CLASS(wxBitmap) | |
74 | ||
75 | public: | |
76 | ||
77 | wxBitmap(void); | |
78 | wxBitmap( const int width, const int height, const int depth = -1 ); | |
79 | wxBitmap( char **bits ); | |
80 | wxBitmap( const wxBitmap& bmp ); | |
81 | wxBitmap( const wxBitmap* bmp ); | |
82 | wxBitmap( const wxString &filename, const int type ); | |
83 | ~wxBitmap(void); | |
84 | wxBitmap& operator = ( const wxBitmap& bmp ); | |
85 | bool operator == ( const wxBitmap& bmp ); | |
86 | bool operator != ( const wxBitmap& bmp ); | |
87 | bool Ok(void) const; | |
88 | ||
89 | int GetHeight(void) const; | |
90 | int GetWidth(void) const; | |
91 | int GetDepth(void) const; | |
92 | void SetHeight( const int height ); | |
93 | void SetWidth( const int width ); | |
94 | void SetDepth( const int depth ); | |
95 | ||
96 | wxMask *GetMask(void) const; | |
97 | void SetMask( wxMask *mask ); | |
98 | ||
99 | bool SaveFile( const wxString &name, const int type, wxPalette *palette = NULL ); | |
100 | bool LoadFile( const wxString &name, const int type ); | |
101 | ||
102 | wxPalette *GetPalette(void) const; | |
103 | wxPalette *GetColourMap(void) const | |
104 | { return GetPalette(); }; | |
105 | ||
106 | private: | |
107 | ||
108 | friend wxDC; | |
109 | friend wxPaintDC; | |
110 | friend wxMemoryDC; | |
111 | friend wxToolBarGTK; | |
112 | ||
113 | GdkPixmap *GetPixmap(void) const; | |
114 | ||
115 | // no data :-) | |
116 | }; | |
117 | ||
118 | #endif // __GTKBITMAPH__ |