]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/gtk/bitmap.h
wxWave class for wxGTK (linux)
[wxWidgets.git] / include / wx / gtk / bitmap.h
... / ...
CommitLineData
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
28class wxMask;
29class wxBitmap;
30
31//-----------------------------------------------------------------------------
32// wxMask
33//-----------------------------------------------------------------------------
34
35class 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
63class wxBitmap: public wxObject
64{
65 DECLARE_DYNAMIC_CLASS(wxBitmap)
66
67 public:
68
69 wxBitmap();
70 wxBitmap( int width, int height, int depth = -1 );
71 wxBitmap( const char bits[], int width, int height, int depth = 1 );
72 wxBitmap( const wxImage &image );
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 wxImage ConvertToImage() const;
84
85 int GetHeight() const;
86 int GetWidth() const;
87 int GetDepth() const;
88 void SetHeight( int height );
89 void SetWidth( int width );
90 void SetDepth( int depth );
91
92 wxMask *GetMask() const;
93 void SetMask( wxMask *mask );
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 // no data :-)
108};
109
110#endif // __GTKBITMAPH__