]>
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 | ||
8f884a0d | 24 | class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase |
b3c86150 VS |
25 | { |
26 | public: | |
27 | wxBitmap() {} | |
4562386d | 28 | wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); } |
732d8c74 FM |
29 | wxBitmap(int width, int height, int depth = -1) { Create(width, height, depth); } |
30 | wxBitmap(const wxSize& sz, int depth = -1) { Create(sz, depth); } | |
b3c86150 | 31 | wxBitmap(const char bits[], int width, int height, int depth = 1); |
cbea3ec6 | 32 | wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); |
452418c4 | 33 | wxBitmap(const char* const* bits); |
b3c86150 VS |
34 | #if wxUSE_IMAGE |
35 | wxBitmap(const wxImage& image, int depth = -1); | |
36 | #endif | |
37 | ||
4562386d | 38 | bool Create(const wxIDirectFBSurfacePtr& surface); |
732d8c74 FM |
39 | bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); |
40 | bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) | |
41 | { return Create(sz.GetWidth(), sz.GetHeight(), depth); } | |
b3c86150 VS |
42 | |
43 | virtual int GetHeight() const; | |
44 | virtual int GetWidth() const; | |
45 | virtual int GetDepth() const; | |
46 | ||
47 | #if wxUSE_IMAGE | |
48 | virtual wxImage ConvertToImage() const; | |
49 | #endif | |
50 | ||
51 | virtual wxMask *GetMask() const; | |
52 | virtual void SetMask(wxMask *mask); | |
53 | ||
54 | virtual wxBitmap GetSubBitmap(const wxRect& rect) const; | |
55 | ||
e86f2cc8 | 56 | virtual bool SaveFile(const wxString &name, wxBitmapType type, |
d3b9f782 | 57 | const wxPalette *palette = NULL) const; |
cbea3ec6 | 58 | virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); |
b3c86150 VS |
59 | |
60 | #if wxUSE_PALETTE | |
61 | virtual wxPalette *GetPalette() const; | |
62 | virtual void SetPalette(const wxPalette& palette); | |
63 | #endif | |
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 | ||
c3ee7025 VS |
70 | // raw bitmap access support functions |
71 | void *GetRawData(wxPixelDataBase& data, int bpp); | |
72 | void UngetRawData(wxPixelDataBase& data); | |
73 | ||
74 | bool HasAlpha() const; | |
75 | ||
b3c86150 VS |
76 | // implementation: |
77 | virtual void SetHeight(int height); | |
78 | virtual void SetWidth(int width); | |
79 | virtual void SetDepth(int depth); | |
80 | ||
81 | // get underlying native representation: | |
52c8d32a | 82 | wxIDirectFBSurfacePtr GetDirectFBSurface() const; |
b3c86150 VS |
83 | |
84 | protected: | |
8f884a0d VZ |
85 | virtual wxGDIRefData *CreateGDIRefData() const; |
86 | virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const; | |
b3c86150 | 87 | |
e2badebb VS |
88 | bool CreateWithFormat(int width, int height, int dfbFormat); |
89 | ||
b3c86150 VS |
90 | DECLARE_DYNAMIC_CLASS(wxBitmap) |
91 | }; | |
92 | ||
93 | #endif // _WX_DFB_BITMAP_H_ |