]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/bitmap.h
* New function wxObjectInputStream::Recall()
[wxWidgets.git] / include / wx / gtk1 / bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bitmap.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // RCS-ID: $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 wxToolBar;
32 class wxBitmapButton;
33 class wxStaticBitmap;
34 class wxFrame;
35 class wxDialog;
36 class wxTreeCtrl;
37
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:
50
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 private:
58
59 friend wxBitmap;
60 friend wxDC;
61 friend wxPaintDC;
62 friend wxToolBar;
63 friend wxBitmapButton;
64 friend wxStaticBitmap;
65 friend wxFrame;
66 friend wxDialog;
67 friend wxTreeCtrl;
68
69 GdkBitmap *GetBitmap() const;
70
71 protected:
72
73 GdkBitmap *m_bitmap;
74
75 };
76
77 //-----------------------------------------------------------------------------
78 // wxBitmap
79 //-----------------------------------------------------------------------------
80
81 // CMB 20/5/98: added xbm constructor and GetBitmap() method
82 class wxBitmap: public wxObject
83 {
84 DECLARE_DYNAMIC_CLASS(wxBitmap)
85
86 public:
87
88 wxBitmap();
89 wxBitmap( int width, int height, int depth = -1 );
90 wxBitmap( const char bits[], int width, int height, int depth = 1 );
91 wxBitmap( char **bits );
92 wxBitmap( const wxBitmap& bmp );
93 wxBitmap( const wxBitmap* bmp );
94 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
95 ~wxBitmap();
96 wxBitmap& operator = ( const wxBitmap& bmp );
97 bool operator == ( const wxBitmap& bmp );
98 bool operator != ( const wxBitmap& bmp );
99 bool Ok() const;
100
101 int GetHeight() const;
102 int GetWidth() const;
103 int GetDepth() const;
104 void SetHeight( int height );
105 void SetWidth( int width );
106 void SetDepth( int depth );
107
108 wxMask *GetMask() const;
109 void SetMask( wxMask *mask );
110
111 void Resize( int height, int width );
112
113 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
114 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
115
116 wxPalette *GetPalette() const;
117 wxPalette *GetColourMap() const
118 { return GetPalette(); };
119
120 private:
121
122 friend wxDC;
123 friend wxPaintDC;
124 friend wxMemoryDC;
125 friend wxToolBar;
126 friend wxBitmapButton;
127 friend wxStaticBitmap;
128 friend wxFrame;
129 friend wxDialog;
130 friend wxTreeCtrl;
131
132 GdkPixmap *GetPixmap() const;
133 GdkBitmap *GetBitmap() const;
134
135 void DestroyImage();
136 void RecreateImage();
137 void Render();
138
139 // no data :-)
140 };
141
142 #endif // __GTKBITMAPH__