]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dfb/bitmap.h
added (wxMSW-only) wxToolTip::SetMaxWidth() and improve its default behaviour (#2817)
[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
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
16class WXDLLIMPEXP_FWD_CORE wxPixelDataBase;
17
b3c86150
VS
18wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
19
b3c86150
VS
20//-----------------------------------------------------------------------------
21// wxBitmap
22//-----------------------------------------------------------------------------
23
8f884a0d 24class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
b3c86150
VS
25{
26public:
27 wxBitmap() {}
4562386d 28 wxBitmap(const wxIDirectFBSurfacePtr& surface) { Create(surface); }
b3c86150
VS
29 wxBitmap(int width, int height, int depth = -1);
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);
b3c86150
VS
38 bool Create(int width, int height, int depth = -1);
39
40 virtual int GetHeight() const;
41 virtual int GetWidth() const;
42 virtual int GetDepth() const;
43
44#if wxUSE_IMAGE
45 virtual wxImage ConvertToImage() const;
46#endif
47
48 virtual wxMask *GetMask() const;
49 virtual void SetMask(wxMask *mask);
50
51 virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
52
e86f2cc8 53 virtual bool SaveFile(const wxString &name, wxBitmapType type,
d3b9f782 54 const wxPalette *palette = NULL) const;
cbea3ec6 55 virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
b3c86150
VS
56
57#if wxUSE_PALETTE
58 virtual wxPalette *GetPalette() const;
59 virtual void SetPalette(const wxPalette& palette);
60#endif
61
62 // copies the contents and mask of the given (colour) icon to the bitmap
63 virtual bool CopyFromIcon(const wxIcon& icon);
64
65 static void InitStandardHandlers();
66
c3ee7025
VS
67 // raw bitmap access support functions
68 void *GetRawData(wxPixelDataBase& data, int bpp);
69 void UngetRawData(wxPixelDataBase& data);
70
71 bool HasAlpha() const;
72
b3c86150
VS
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
81protected:
8f884a0d
VZ
82 virtual wxGDIRefData *CreateGDIRefData() const;
83 virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
b3c86150 84
e2badebb
VS
85 bool CreateWithFormat(int width, int height, int dfbFormat);
86
b3c86150
VS
87 DECLARE_DYNAMIC_CLASS(wxBitmap)
88};
89
90#endif // _WX_DFB_BITMAP_H_