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