]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/bitmap.h
warning msgs
[wxWidgets.git] / include / wx / gtk / bitmap.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: bitmap.h
3// Purpose:
4// Author: Robert Roebling
5// Created: 01/02/97
6f65e337 6// RCS-ID: $Id$
c801d85f
KB
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
6f65e337
JS
28class wxDC;
29class wxPaintDC;
30class wxMemoryDC;
716b7364 31class wxToolBar;
53b28675
RR
32class wxBitmapButton;
33class wxStaticBitmap;
6f65e337 34
c801d85f
KB
35class wxMask;
36class wxBitmap;
37
38//-----------------------------------------------------------------------------
39// wxMask
40//-----------------------------------------------------------------------------
41
42class wxMask: public wxObject
43{
44 DECLARE_DYNAMIC_CLASS(wxMask)
45
46 public:
44216b3b
VZ
47
48 wxMask();
c801d85f 49 wxMask( const wxBitmap& bitmap, const wxColour& colour );
debe6624 50 wxMask( const wxBitmap& bitmap, int paletteIndex );
c801d85f 51 wxMask( const wxBitmap& bitmap );
44216b3b 52 ~wxMask();
c801d85f 53
6f65e337 54 private:
44216b3b 55
6f65e337
JS
56 friend wxBitmap;
57 friend wxDC;
58 friend wxPaintDC;
716b7364 59 friend wxToolBar;
53b28675
RR
60 friend wxBitmapButton;
61 friend wxStaticBitmap;
44216b3b
VZ
62
63 GdkBitmap *GetBitmap() const;
64
c801d85f 65 protected:
44216b3b
VZ
66
67 GdkBitmap *m_bitmap;
68
c801d85f
KB
69};
70
71//-----------------------------------------------------------------------------
72// wxBitmap
73//-----------------------------------------------------------------------------
74
6f65e337 75// CMB 20/5/98: added xbm constructor and GetBitmap() method
c801d85f
KB
76class wxBitmap: public wxObject
77{
78 DECLARE_DYNAMIC_CLASS(wxBitmap)
79
80 public:
81
44216b3b 82 wxBitmap();
debe6624
JS
83 wxBitmap( int width, int height, int depth = -1 );
84 wxBitmap( const char bits[], int width, int height, int depth = 1 );
c801d85f
KB
85 wxBitmap( char **bits );
86 wxBitmap( const wxBitmap& bmp );
87 wxBitmap( const wxBitmap* bmp );
44216b3b
VZ
88 wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
89 ~wxBitmap();
c801d85f
KB
90 wxBitmap& operator = ( const wxBitmap& bmp );
91 bool operator == ( const wxBitmap& bmp );
92 bool operator != ( const wxBitmap& bmp );
44216b3b
VZ
93 bool Ok() const;
94
95 int GetHeight() const;
96 int GetWidth() const;
97 int GetDepth() const;
debe6624
JS
98 void SetHeight( int height );
99 void SetWidth( int width );
100 void SetDepth( int depth );
c801d85f 101
44216b3b 102 wxMask *GetMask() const;
c801d85f 103 void SetMask( wxMask *mask );
44216b3b 104
219f895a 105 void Resize( int height, int width );
44216b3b 106
debe6624 107 bool SaveFile( const wxString &name, int type, wxPalette *palette = NULL );
44216b3b 108 bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
debe6624 109
44216b3b
VZ
110 wxPalette *GetPalette() const;
111 wxPalette *GetColourMap() const
c801d85f
KB
112 { return GetPalette(); };
113
6f65e337 114 private:
44216b3b 115
6f65e337
JS
116 friend wxDC;
117 friend wxPaintDC;
118 friend wxMemoryDC;
716b7364 119 friend wxToolBar;
53b28675
RR
120 friend wxBitmapButton;
121 friend wxStaticBitmap;
c801d85f 122
44216b3b
VZ
123 GdkPixmap *GetPixmap() const;
124 GdkBitmap *GetBitmap() const;
125
126 void DestroyImage();
127 void RecreateImage();
128 void Render();
129
c801d85f
KB
130 // no data :-)
131};
132
133#endif // __GTKBITMAPH__