]>
Commit | Line | Data |
---|---|---|
b3c86150 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/dfb/bitmap.h | |
3 | // Purpose: wxBitmap class | |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2006-08-04 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2006 REA Elektronik GmbH | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_DFB_BITMAP_H_ | |
12 | #define _WX_DFB_BITMAP_H_ | |
13 | ||
52c8d32a | 14 | #include "wx/dfb/dfbptr.h" |
b3c86150 VS |
15 | |
16 | wxDFB_DECLARE_INTERFACE(IDirectFBSurface); | |
17 | ||
b3c86150 VS |
18 | //----------------------------------------------------------------------------- |
19 | // wxBitmap | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
452418c4 | 22 | class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase |
b3c86150 | 23 | { |
452418c4 | 24 | DECLARE_ABSTRACT_CLASS(wxBitmapHandler) |
b3c86150 VS |
25 | }; |
26 | ||
27 | class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase | |
28 | { | |
29 | public: | |
30 | wxBitmap() {} | |
4562386d | 31 | wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); } |
b3c86150 VS |
32 | wxBitmap(int width, int height, int depth = -1); |
33 | wxBitmap(const char bits[], int width, int height, int depth = 1); | |
34 | wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); | |
452418c4 | 35 | wxBitmap(const char* const* bits); |
b3c86150 VS |
36 | #if wxUSE_IMAGE |
37 | wxBitmap(const wxImage& image, int depth = -1); | |
38 | #endif | |
39 | ||
40 | bool Ok() const; | |
41 | bool operator==(const wxBitmap& bmp) const; | |
42 | bool operator!=(const wxBitmap& bmp) const { return !(*this == bmp); } | |
43 | ||
4562386d | 44 | bool Create(const wxIDirectFBSurfacePtr& surface); |
b3c86150 VS |
45 | bool Create(int width, int height, int depth = -1); |
46 | ||
47 | virtual int GetHeight() const; | |
48 | virtual int GetWidth() const; | |
49 | virtual int GetDepth() const; | |
50 | ||
51 | #if wxUSE_IMAGE | |
52 | virtual wxImage ConvertToImage() const; | |
53 | #endif | |
54 | ||
55 | virtual wxMask *GetMask() const; | |
56 | virtual void SetMask(wxMask *mask); | |
57 | ||
58 | virtual wxBitmap GetSubBitmap(const wxRect& rect) const; | |
59 | ||
60 | virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const; | |
61 | virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); | |
62 | ||
63 | #if wxUSE_PALETTE | |
64 | virtual wxPalette *GetPalette() const; | |
65 | virtual void SetPalette(const wxPalette& palette); | |
66 | #endif | |
67 | ||
68 | // copies the contents and mask of the given (colour) icon to the bitmap | |
69 | virtual bool CopyFromIcon(const wxIcon& icon); | |
70 | ||
71 | static void InitStandardHandlers(); | |
72 | ||
73 | // implementation: | |
74 | virtual void SetHeight(int height); | |
75 | virtual void SetWidth(int width); | |
76 | virtual void SetDepth(int depth); | |
77 | ||
78 | // get underlying native representation: | |
52c8d32a | 79 | wxIDirectFBSurfacePtr GetDirectFBSurface() const; |
b3c86150 VS |
80 | |
81 | protected: | |
b3c86150 VS |
82 | // ref counting code |
83 | virtual wxObjectRefData *CreateRefData() const; | |
84 | virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; | |
85 | ||
86 | DECLARE_DYNAMIC_CLASS(wxBitmap) | |
87 | }; | |
88 | ||
89 | #endif // _WX_DFB_BITMAP_H_ |