]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/mgl/bitmap.h
Digital Mars doesn't like the identifiers being declared later
[wxWidgets.git] / include / wx / mgl / bitmap.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: bitmap.h
3// Author: Vaclav Slavik
4// RCS-ID: $Id$
5// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
6// Licence: wxWindows licence
7/////////////////////////////////////////////////////////////////////////////
8
9#ifndef __WX_BITMAP_H__
10#define __WX_BITMAP_H__
11
12//-----------------------------------------------------------------------------
13// classes
14//-----------------------------------------------------------------------------
15
16class WXDLLEXPORT wxDC;
17class WXDLLEXPORT wxMemoryDC;
18
19class MGLDevCtx;
20struct bitmap_t;
21
22//-----------------------------------------------------------------------------
23// wxBitmap
24//-----------------------------------------------------------------------------
25
26class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase
27{
28 DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
29};
30
31class WXDLLEXPORT wxBitmap: public wxBitmapBase
32{
33public:
34 wxBitmap() {}
35 wxBitmap(int width, int height, int depth = -1);
36 wxBitmap(const char bits[], int width, int height, int depth = 1);
37 wxBitmap(const char* const* bits);
38 wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
39 wxBitmap(const wxImage& image, int depth = -1);
40 virtual ~wxBitmap() {}
41 bool operator == (const wxBitmap& bmp) const;
42 bool operator != (const wxBitmap& bmp) const;
43 bool Ok() const { return IsOk(); }
44 bool IsOk() const;
45
46 bool Create(int width, int height, int depth = -1);
47
48 virtual int GetHeight() const;
49 virtual int GetWidth() const;
50 virtual int GetDepth() const;
51
52 virtual wxImage ConvertToImage() const;
53
54 virtual wxMask *GetMask() const;
55 virtual void SetMask(wxMask *mask);
56
57 virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
58
59 virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
60 virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
61
62 virtual wxPalette *GetPalette() const;
63 virtual void SetPalette(const wxPalette& palette);
64
65 // copies the contents and mask of the given (colour) icon to the bitmap
66 virtual bool CopyFromIcon(const wxIcon& icon);
67
68 static void InitStandardHandlers();
69
70 // implementation:
71 virtual void SetHeight(int height);
72 virtual void SetWidth(int width);
73 virtual void SetDepth(int depth);
74
75 virtual wxColour QuantizeColour(const wxColour& colour) const;
76
77 // get underlying native representation:
78 bitmap_t *GetMGLbitmap_t() const;
79
80protected:
81 // creates temporary DC for access to bitmap's data:
82 MGLDevCtx *CreateTmpDC() const;
83 // sets fg & bg colours for 1bit bitmaps:
84 void SetMonoPalette(const wxColour& fg, const wxColour& bg);
85
86private:
87 DECLARE_DYNAMIC_CLASS(wxBitmap)
88
89 friend class wxDC;
90 friend class wxMemoryDC;
91};
92
93#endif // __WX_BITMAP_H__