1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dfb/bitmap.h
3 // Purpose: wxBitmap class
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_DFB_BITMAP_H_
12 #define _WX_DFB_BITMAP_H_
14 #include "wx/dfb/dfbptr.h"
16 class WXDLLIMPEXP_FWD_CORE wxPixelDataBase
;
18 wxDFB_DECLARE_INTERFACE(IDirectFBSurface
);
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxBitmapHandler
: public wxBitmapHandlerBase
26 DECLARE_ABSTRACT_CLASS(wxBitmapHandler
)
29 class WXDLLIMPEXP_CORE wxBitmap
: public wxBitmapBase
33 wxBitmap(const wxIDirectFBSurfacePtr
& surface
) { Create(surface
); }
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
);
37 wxBitmap(const char* const* bits
);
39 wxBitmap(const wxImage
& image
, int depth
= -1);
42 bool Create(const wxIDirectFBSurfacePtr
& surface
);
43 bool Create(int width
, int height
, int depth
= -1);
45 virtual int GetHeight() const;
46 virtual int GetWidth() const;
47 virtual int GetDepth() const;
50 virtual wxImage
ConvertToImage() const;
53 virtual wxMask
*GetMask() const;
54 virtual void SetMask(wxMask
*mask
);
56 virtual wxBitmap
GetSubBitmap(const wxRect
& rect
) const;
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
);
62 virtual wxPalette
*GetPalette() const;
63 virtual void SetPalette(const wxPalette
& palette
);
66 // copies the contents and mask of the given (colour) icon to the bitmap
67 virtual bool CopyFromIcon(const wxIcon
& icon
);
69 static void InitStandardHandlers();
71 // raw bitmap access support functions
72 void *GetRawData(wxPixelDataBase
& data
, int bpp
);
73 void UngetRawData(wxPixelDataBase
& data
);
75 bool HasAlpha() const;
78 virtual void SetHeight(int height
);
79 virtual void SetWidth(int width
);
80 virtual void SetDepth(int depth
);
82 // get underlying native representation:
83 wxIDirectFBSurfacePtr
GetDirectFBSurface() const;
86 virtual wxGDIRefData
*CreateGDIRefData() const;
87 virtual wxGDIRefData
*CloneGDIRefData(const wxGDIRefData
*data
) const;
89 bool CreateWithFormat(int width
, int height
, int dfbFormat
);
91 DECLARE_DYNAMIC_CLASS(wxBitmap
)
94 #endif // _WX_DFB_BITMAP_H_