]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dfb/bitmap.h
added wxWeakRef<T> (slightly modified patch 1860953)
[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 wxBitmapHandler : public wxBitmapHandlerBase
b3c86150 25{
452418c4 26 DECLARE_ABSTRACT_CLASS(wxBitmapHandler)
b3c86150
VS
27};
28
8f884a0d 29class WXDLLIMPEXP_CORE wxBitmap : public wxBitmapBase
b3c86150
VS
30{
31public:
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
4562386d 42 bool Create(const wxIDirectFBSurfacePtr& surface);
b3c86150
VS
43 bool Create(int width, int height, int depth = -1);
44
45 virtual int GetHeight() const;
46 virtual int GetWidth() const;
47 virtual int GetDepth() const;
48
49#if wxUSE_IMAGE
50 virtual wxImage ConvertToImage() const;
51#endif
52
53 virtual wxMask *GetMask() const;
54 virtual void SetMask(wxMask *mask);
55
56 virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
57
58 virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
59 virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
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_