]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dfb/bitmap.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / dfb / bitmap.h
CommitLineData
b3c86150
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dfb/bitmap.h
3// Purpose: wxBitmap class
4// Author: Vaclav Slavik
5// Created: 2006-08-04
b3c86150
VS
6// Copyright: (c) 2006 REA Elektronik GmbH
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_DFB_BITMAP_H_
11#define _WX_DFB_BITMAP_H_
12
52c8d32a 13#include "wx/dfb/dfbptr.h"
b3c86150 14
c3ee7025
VS
15class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
16
b3c86150
VS
17wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
18
b3c86150
VS
19//-----------------------------------------------------------------------------
20// wxBitmap
21//-----------------------------------------------------------------------------
22
8f884a0d 23class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
b3c86150
VS
24{
25public:
26 wxBitmap() {}
4562386d 27 wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
732d8c74
FM
28 wxBitmap(int width, int height, int depth = -1) { Create(width, height, depth); }
29 wxBitmap(const wxSize& sz, int depth = -1) { Create(sz, depth); }
b3c86150 30 wxBitmap(const char bits[], int width, int height, int depth = 1);
cbea3ec6 31 wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
452418c4 32 wxBitmap(const char* const* bits);
b3c86150
VS
33#if wxUSE_IMAGE
34 wxBitmap(const wxImage& image, int depth = -1);
35#endif
36
4562386d 37 bool Create(const wxIDirectFBSurfacePtr& surface);
732d8c74
FM
38 bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
39 bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
40 { return Create(sz.GetWidth(), sz.GetHeight(), depth); }
7f74897f
SC
41 bool Create(int width, int height, const wxDC& WXUNUSED(dc))
42 { return Create(width,height); }
b3c86150
VS
43
44 virtual int GetHeight() const;
45 virtual int GetWidth() const;
46 virtual int GetDepth() const;
47
48#if wxUSE_IMAGE
49 virtual wxImage ConvertToImage() const;
50#endif
51
52 virtual wxMask *GetMask() const;
53 virtual void SetMask(wxMask *mask);
54
55 virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
56
e86f2cc8 57 virtual bool SaveFile(const wxString &name, wxBitmapType type,
d3b9f782 58 const wxPalette *palette = NULL) const;
cbea3ec6 59 virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
b3c86150
VS
60
61#if wxUSE_PALETTE
62 virtual wxPalette *GetPalette() const;
63 virtual void SetPalette(const wxPalette& palette);
64#endif
65
66 // copies the contents and mask of the given (colour) icon to the bitmap
67 virtual bool CopyFromIcon(const wxIcon& icon);
68
69 static void InitStandardHandlers();
70
c3ee7025
VS
71 // raw bitmap access support functions
72 void *GetRawData(wxPixelDataBase& data, int bpp);
73 void UngetRawData(wxPixelDataBase& data);
74
75 bool HasAlpha() const;
76
b3c86150
VS
77 // implementation:
78 virtual void SetHeight(int height);
79 virtual void SetWidth(int width);
80 virtual void SetDepth(int depth);
81
82 // get underlying native representation:
52c8d32a 83 wxIDirectFBSurfacePtr GetDirectFBSurface() const;
b3c86150
VS
84
85protected:
8f884a0d
VZ
86 virtual wxGDIRefData *CreateGDIRefData() const;
87 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
b3c86150 88
e2badebb
VS
89 bool CreateWithFormat(int width, int height, int dfbFormat);
90
b3c86150
VS
91 DECLARE_DYNAMIC_CLASS(wxBitmap)
92};
93
94#endif // _WX_DFB_BITMAP_H_