]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/bitmap.h
Motif compilation fix
[wxWidgets.git] / include / wx / gtk1 / bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bitmap.h
3 // Purpose:
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
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
27 class wxMask;
28 class wxBitmap;
29
30 //-----------------------------------------------------------------------------
31 // wxMask
32 //-----------------------------------------------------------------------------
33
34 class wxMask: public wxObject
35 {
36 public:
37 wxMask();
38 wxMask( const wxBitmap& bitmap, const wxColour& colour );
39 wxMask( const wxBitmap& bitmap, int paletteIndex );
40 wxMask( const wxBitmap& bitmap );
41 ~wxMask();
42
43 bool Create( const wxBitmap& bitmap, const wxColour& colour );
44 bool Create( const wxBitmap& bitmap, int paletteIndex );
45 bool Create( const wxBitmap& bitmap );
46
47 // implementation
48 GdkBitmap *m_bitmap;
49
50 GdkBitmap *GetBitmap() const;
51
52 private:
53 DECLARE_DYNAMIC_CLASS(wxMask)
54 };
55
56 //-----------------------------------------------------------------------------
57 // wxBitmap
58 //-----------------------------------------------------------------------------
59
60 class wxBitmap: public wxObject
61 {
62 public:
63 wxBitmap();
64 wxBitmap( int width, int height, int depth = -1 );
65 wxBitmap( const char bits[], int width, int height, int depth = 1 );
66 wxBitmap( const char **bits );
67 wxBitmap( char **bits );
68 wxBitmap( const wxBitmap& bmp );
69 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
70 ~wxBitmap();
71 wxBitmap& operator = ( const wxBitmap& bmp );
72 bool operator == ( const wxBitmap& bmp );
73 bool operator != ( const wxBitmap& bmp );
74 bool Ok() const;
75
76 int GetHeight() const;
77 int GetWidth() const;
78 int GetDepth() const;
79
80 wxMask *GetMask() const;
81 void SetMask( wxMask *mask );
82
83 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
84 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
85
86 wxPalette *GetPalette() const;
87 wxPalette *GetColourMap() const
88 { return GetPalette(); };
89
90 // implementation
91
92 void SetHeight( int height );
93 void SetWidth( int width );
94 void SetDepth( int depth );
95 void SetPixmap( GdkPixmap *pixmap );
96
97 GdkPixmap *GetPixmap() const;
98 GdkBitmap *GetBitmap() const;
99
100 // no data :-)
101
102 private:
103 DECLARE_DYNAMIC_CLASS(wxBitmap)
104 };
105
106 #endif // __GTKBITMAPH__