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