]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bitmap.h
7baf8849f35ebdfb8bed0d7f7f3ce3af20a7f007
[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 wxMask;
29 class wxBitmap;
30
31 //-----------------------------------------------------------------------------
32 // wxMask
33 //-----------------------------------------------------------------------------
34
35 class wxMask: public wxObject
36 {
37 DECLARE_DYNAMIC_CLASS(wxMask)
38
39 public:
40
41 wxMask();
42 wxMask( const wxBitmap& bitmap, const wxColour& colour );
43 wxMask( const wxBitmap& bitmap, int paletteIndex );
44 wxMask( const wxBitmap& bitmap );
45 ~wxMask();
46
47 // implementation
48
49 GdkBitmap *GetBitmap() const;
50
51 protected:
52
53 GdkBitmap *m_bitmap;
54
55 };
56
57 //-----------------------------------------------------------------------------
58 // wxBitmap
59 //-----------------------------------------------------------------------------
60
61 // CMB 20/5/98: added xbm constructor and GetBitmap() method
62 class wxBitmap: public wxObject
63 {
64 DECLARE_DYNAMIC_CLASS(wxBitmap)
65
66 public:
67
68 wxBitmap();
69 wxBitmap( int width, int height, int depth = -1 );
70 wxBitmap( const char bits[], int width, int height, int depth = 1 );
71 wxBitmap( char **bits );
72 wxBitmap( const wxBitmap& bmp );
73 wxBitmap( const wxBitmap* bmp );
74 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
75 ~wxBitmap();
76 wxBitmap& operator = ( const wxBitmap& bmp );
77 bool operator == ( const wxBitmap& bmp );
78 bool operator != ( const wxBitmap& bmp );
79 bool Ok() const;
80
81 int GetHeight() const;
82 int GetWidth() const;
83 int GetDepth() const;
84 void SetHeight( int height );
85 void SetWidth( int width );
86 void SetDepth( int depth );
87
88 wxMask *GetMask() const;
89 void SetMask( wxMask *mask );
90
91 void Resize( int height, int width );
92
93 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
94 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
95
96 wxPalette *GetPalette() const;
97 wxPalette *GetColourMap() const
98 { return GetPalette(); };
99
100 // implementation
101
102 GdkPixmap *GetPixmap() const;
103 GdkBitmap *GetBitmap() const;
104
105 void DestroyImage();
106 void RecreateImage();
107 void Render();
108
109 // no data :-)
110 };
111
112 #endif // __GTKBITMAPH__