]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bitmap.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
6f65e337 | 5 | // RCS-ID: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling |
f05df5a8 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | ||
11 | #ifndef __GTKBITMAPH__ | |
12 | #define __GTKBITMAPH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/string.h" | |
21 | #include "wx/palette.h" | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | // classes | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
c801d85f KB |
27 | class wxMask; |
28 | class wxBitmap; | |
29 | ||
4bc67cc5 RR |
30 | //----------------------------------------------------------------------------- |
31 | // also implemented here from wxImage | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | /* | |
35 | class wxImage : wxGDIObject | |
36 | { | |
37 | wxImage( const wxBitmap &bitmap ); | |
38 | wxBitmap ConvertToBitmap() const; | |
39 | } | |
40 | */ | |
41 | ||
c801d85f KB |
42 | //----------------------------------------------------------------------------- |
43 | // wxMask | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | class wxMask: public wxObject | |
47 | { | |
48 | DECLARE_DYNAMIC_CLASS(wxMask) | |
49 | ||
fd0eed64 RR |
50 | public: |
51 | wxMask(); | |
52 | wxMask( const wxBitmap& bitmap, const wxColour& colour ); | |
53 | wxMask( const wxBitmap& bitmap, int paletteIndex ); | |
54 | wxMask( const wxBitmap& bitmap ); | |
55 | ~wxMask(); | |
56 | ||
57 | // implementation | |
8bbe427f | 58 | |
fd0eed64 RR |
59 | GdkBitmap *m_bitmap; |
60 | GdkBitmap *GetBitmap() const; | |
c801d85f KB |
61 | }; |
62 | ||
63 | //----------------------------------------------------------------------------- | |
64 | // wxBitmap | |
65 | //----------------------------------------------------------------------------- | |
66 | ||
67 | class wxBitmap: public wxObject | |
68 | { | |
69 | DECLARE_DYNAMIC_CLASS(wxBitmap) | |
70 | ||
fd0eed64 RR |
71 | public: |
72 | wxBitmap(); | |
73 | wxBitmap( int width, int height, int depth = -1 ); | |
74 | wxBitmap( const char bits[], int width, int height, int depth = 1 ); | |
e52f60e6 | 75 | wxBitmap( const char **bits ); |
fd0eed64 RR |
76 | wxBitmap( char **bits ); |
77 | wxBitmap( const wxBitmap& bmp ); | |
fd0eed64 RR |
78 | wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM ); |
79 | ~wxBitmap(); | |
80 | wxBitmap& operator = ( const wxBitmap& bmp ); | |
81 | bool operator == ( const wxBitmap& bmp ); | |
82 | bool operator != ( const wxBitmap& bmp ); | |
83 | bool Ok() const; | |
8bbe427f | 84 | |
fd0eed64 RR |
85 | int GetHeight() const; |
86 | int GetWidth() const; | |
87 | int GetDepth() const; | |
c801d85f | 88 | |
fd0eed64 RR |
89 | wxMask *GetMask() const; |
90 | void SetMask( wxMask *mask ); | |
44216b3b | 91 | |
fd0eed64 RR |
92 | bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL ); |
93 | bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM ); | |
debe6624 | 94 | |
fd0eed64 RR |
95 | wxPalette *GetPalette() const; |
96 | wxPalette *GetColourMap() const | |
97 | { return GetPalette(); }; | |
8bbe427f VZ |
98 | |
99 | // implementation | |
c801d85f | 100 | |
4bc67cc5 RR |
101 | void SetHeight( int height ); |
102 | void SetWidth( int width ); | |
103 | void SetDepth( int depth ); | |
104 | void SetPixmap( GdkPixmap *pixmap ); | |
8bbe427f | 105 | |
fd0eed64 RR |
106 | GdkPixmap *GetPixmap() const; |
107 | GdkBitmap *GetBitmap() const; | |
f05df5a8 | 108 | |
c801d85f KB |
109 | // no data :-) |
110 | }; | |
111 | ||
112 | #endif // __GTKBITMAPH__ |