Dummy implementation for copying bitmaps.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis 2006-11-01 01:01:32 +00:00
parent 7bb82a7415
commit cd7ff8087b
2 changed files with 36 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class WXDLLEXPORT wxBitmapRefData : public wxGDIImageRefData
{
public:
wxBitmapRefData();
wxBitmapRefData(const wxBitmapRefData &tocopy);
virtual ~wxBitmapRefData() { Free(); }
virtual void Free();
@ -215,6 +216,10 @@ protected:
bool CreateFromImage(const wxImage& image, int depth);
// ref counting code
virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
private:
bool CopyFromIconOrCursor(const wxGDIImage& rIcon);
@ -230,6 +235,7 @@ class WXDLLEXPORT wxMask : public wxObject
{
public:
wxMask();
wxMask( const wxMask& tocopy);
// Construct a mask from a bitmap and a colour indicating the transparent
// area

View File

@ -57,6 +57,20 @@ wxBitmapRefData::wxBitmapRefData()
m_hBitmap = (WXHBITMAP) NULL;
} // end of wxBitmapRefData::wxBitmapRefData
wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData &tocopy)
{
m_nQuality = tocopy.m_nQuality;
m_pSelectedInto = NULL; // don't copy this
m_nNumColors = tocopy.m_nNumColors;
// copy the mask
if (tocopy.m_pBitmapMask)
m_pBitmapMask = new wxMask(*tocopy.m_pBitmapMask);
// TODO: how to copy an HBITMAP?
m_hBitmap = tocopy.m_hBitmap;
}
void wxBitmapRefData::Free()
{
if ( m_pSelectedInto )
@ -81,6 +95,16 @@ void wxBitmapRefData::Free()
// wxBitmap creation
// ----------------------------------------------------------------------------
wxObjectRefData* wxBitmap::CreateRefData() const
{
return new wxBitmapRefData;
}
wxObjectRefData* wxBitmap::CloneRefData(const wxObjectRefData* data) const
{
return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data));
}
// this function should be called from all wxBitmap ctors
void wxBitmap::Init()
{
@ -1196,6 +1220,12 @@ wxMask::wxMask()
m_hMaskBitmap = 0;
} // end of wxMask::wxMask
wxMask::wxMask(const wxMask& tocopy)
{
// TODO: how to copy a WXHBITMAP?
m_hMaskBitmap = tocopy.m_hMaskBitmap;
} // end of wxMask::wxMask
// Construct a mask from a bitmap and a colour indicating
// the transparent area
wxMask::wxMask(