]>
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 | 15 | |
c3ee7025 VS |
16 | class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; |
17 | ||
b3c86150 VS |
18 | wxDFB_DECLARE_INTERFACE(IDirectFBSurface); |
19 | ||
b3c86150 VS |
20 | //----------------------------------------------------------------------------- |
21 | // wxBitmap | |
22 | //----------------------------------------------------------------------------- | |
23 | ||
452418c4 | 24 | class WXDLLIMPEXP_CORE wxBitmapHandler: public wxBitmapHandlerBase |
b3c86150 | 25 | { |
452418c4 | 26 | DECLARE_ABSTRACT_CLASS(wxBitmapHandler) |
b3c86150 VS |
27 | }; |
28 | ||
29 | class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase | |
30 | { | |
31 | public: | |
32 | wxBitmap() {} | |
4562386d | 33 | wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); } |
b3c86150 VS |
34 | wxBitmap(int width, int height, int depth = -1); |
35 | wxBitmap(const char bits[], int width, int height, int depth = 1); | |
36 | wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); | |
452418c4 | 37 | wxBitmap(const char* const* bits); |
b3c86150 VS |
38 | #if wxUSE_IMAGE |
39 | wxBitmap(const wxImage& image, int depth = -1); | |
40 | #endif | |
41 | ||
b7cacb43 VZ |
42 | bool Ok() const { return IsOk(); } |
43 | bool IsOk() const; | |
b3c86150 | 44 | |
4562386d | 45 | bool Create(const wxIDirectFBSurfacePtr& surface); |
b3c86150 VS |
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 | #if wxUSE_IMAGE | |
53 | virtual wxImage ConvertToImage() const; | |
54 | #endif | |
55 | ||
56 | virtual wxMask *GetMask() const; | |
57 | virtual void SetMask(wxMask *mask); | |
58 | ||
59 | virtual wxBitmap GetSubBitmap(const wxRect& rect) const; | |
60 | ||
61 | virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const; | |
62 | virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); | |
63 | ||
64 | #if wxUSE_PALETTE | |
65 | virtual wxPalette *GetPalette() const; | |
66 | virtual void SetPalette(const wxPalette& palette); | |
67 | #endif | |
68 | ||
69 | // copies the contents and mask of the given (colour) icon to the bitmap | |
70 | virtual bool CopyFromIcon(const wxIcon& icon); | |
71 | ||
72 | static void InitStandardHandlers(); | |
73 | ||
c3ee7025 VS |
74 | // raw bitmap access support functions |
75 | void *GetRawData(wxPixelDataBase& data, int bpp); | |
76 | void UngetRawData(wxPixelDataBase& data); | |
77 | ||
78 | bool HasAlpha() const; | |
79 | ||
b3c86150 VS |
80 | // implementation: |
81 | virtual void SetHeight(int height); | |
82 | virtual void SetWidth(int width); | |
83 | virtual void SetDepth(int depth); | |
84 | ||
85 | // get underlying native representation: | |
52c8d32a | 86 | wxIDirectFBSurfacePtr GetDirectFBSurface() const; |
b3c86150 VS |
87 | |
88 | protected: | |
b3c86150 VS |
89 | // ref counting code |
90 | virtual wxObjectRefData *CreateRefData() const; | |
91 | virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; | |
92 | ||
e2badebb VS |
93 | bool CreateWithFormat(int width, int height, int dfbFormat); |
94 | ||
b3c86150 VS |
95 | DECLARE_DYNAMIC_CLASS(wxBitmap) |
96 | }; | |
97 | ||
98 | #endif // _WX_DFB_BITMAP_H_ |