]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bitmap.h
Dnd constant name changes because names like Copy can be #defined by other
[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 friend wxBitmap;
54
55 GdkBitmap *m_bitmap;
56
57 };
58
59 //-----------------------------------------------------------------------------
60 // wxBitmap
61 //-----------------------------------------------------------------------------
62
63 // CMB 20/5/98: added xbm constructor and GetBitmap() method
64 class wxBitmap: public wxObject
65 {
66 DECLARE_DYNAMIC_CLASS(wxBitmap)
67
68 public:
69
70 wxBitmap();
71 wxBitmap( int width, int height, int depth = -1 );
72 wxBitmap( const char bits[], int width, int height, int depth = 1 );
73 wxBitmap( char **bits );
74 wxBitmap( const wxBitmap& bmp );
75 wxBitmap( const wxBitmap* bmp );
76 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
77 ~wxBitmap();
78 wxBitmap& operator = ( const wxBitmap& bmp );
79 bool operator == ( const wxBitmap& bmp );
80 bool operator != ( const wxBitmap& bmp );
81 bool Ok() const;
82
83 int GetHeight() const;
84 int GetWidth() const;
85 int GetDepth() const;
86 void SetHeight( int height );
87 void SetWidth( int width );
88 void SetDepth( int depth );
89
90 wxMask *GetMask() const;
91 void SetMask( wxMask *mask );
92
93 void Resize( int height, int width );
94
95 bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
96 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
97
98 wxPalette *GetPalette() const;
99 wxPalette *GetColourMap() const
100 { return GetPalette(); };
101
102 // implementation
103
104 GdkPixmap *GetPixmap() const;
105 GdkBitmap *GetBitmap() const;
106
107 void DestroyImage();
108 void RecreateImage();
109 void Render();
110
111 // no data :-)
112 };
113
114 #endif // __GTKBITMAPH__