]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bitmap.h
"wxGDIObject * => &" related changes (see mail to the list)
[wxWidgets.git] / include / wx / gtk / 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 // 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
42 //-----------------------------------------------------------------------------
43 // wxMask
44 //-----------------------------------------------------------------------------
45
46 class wxMask: public wxObject
47 {
48 DECLARE_DYNAMIC_CLASS(wxMask)
49
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
58
59 GdkBitmap *m_bitmap;
60 GdkBitmap *GetBitmap() const;
61 };
62
63 //-----------------------------------------------------------------------------
64 // wxBitmap
65 //-----------------------------------------------------------------------------
66
67 class wxBitmap: public wxObject
68 {
69 DECLARE_DYNAMIC_CLASS(wxBitmap)
70
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 );
75 wxBitmap( const char **bits );
76 wxBitmap( char **bits );
77 wxBitmap( const wxBitmap& bmp );
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;
84
85 int GetHeight() const;
86 int GetWidth() const;
87 int GetDepth() const;
88
89 wxMask *GetMask() const;
90 void SetMask( wxMask *mask );
91
92 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
93 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
94
95 wxPalette *GetPalette() const;
96 wxPalette *GetColourMap() const
97 { return GetPalette(); };
98
99 // implementation
100
101 void SetHeight( int height );
102 void SetWidth( int width );
103 void SetDepth( int depth );
104 void SetPixmap( GdkPixmap *pixmap );
105
106 GdkPixmap *GetPixmap() const;
107 GdkBitmap *GetBitmap() const;
108
109 // no data :-)
110 };
111
112 #endif // __GTKBITMAPH__