]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bitmap.h
Second try at doing Set/GetClient right
[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 #include "wx/image.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 wxMask();
41 wxMask( const wxBitmap& bitmap, const wxColour& colour );
42 wxMask( const wxBitmap& bitmap, int paletteIndex );
43 wxMask( const wxBitmap& bitmap );
44 ~wxMask();
45
46 // implementation
47
48 GdkBitmap *m_bitmap;
49 GdkBitmap *GetBitmap() const;
50 };
51
52 //-----------------------------------------------------------------------------
53 // wxBitmap
54 //-----------------------------------------------------------------------------
55
56 class wxBitmap: public wxObject
57 {
58 DECLARE_DYNAMIC_CLASS(wxBitmap)
59
60 public:
61 wxBitmap();
62 wxBitmap( int width, int height, int depth = -1 );
63 wxBitmap( const char bits[], int width, int height, int depth = 1 );
64 wxBitmap( const wxImage &image );
65 wxBitmap( char **bits );
66 wxBitmap( const wxBitmap& bmp );
67 wxBitmap( const wxBitmap* bmp );
68 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
69 ~wxBitmap();
70 wxBitmap& operator = ( const wxBitmap& bmp );
71 bool operator == ( const wxBitmap& bmp );
72 bool operator != ( const wxBitmap& bmp );
73 bool Ok() const;
74
75 wxImage ConvertToImage() const;
76
77 int GetHeight() const;
78 int GetWidth() const;
79 int GetDepth() const;
80 void SetHeight( int height );
81 void SetWidth( int width );
82 void SetDepth( int depth );
83
84 wxMask *GetMask() const;
85 void SetMask( wxMask *mask );
86
87 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
88 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
89
90 wxPalette *GetPalette() const;
91 wxPalette *GetColourMap() const
92 { return GetPalette(); };
93
94 // implementation
95
96 GdkPixmap *GetPixmap() const;
97 GdkBitmap *GetBitmap() const;
98
99 // no data :-)
100 };
101
102 #endif // __GTKBITMAPH__