X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..050c9e3c90c58b05d5b3f7384d1556ca9669f13e:/src/gtk1/bitmap.cpp diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index d81d01c970..1f62c2a11b 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -11,6 +11,9 @@ #pragma implementation "bitmap.h" #endif +#include "wx/defs.h" + +#include "wx/palette.h" #include "wx/bitmap.h" #include "wx/icon.h" #include "wx/filefn.h" @@ -252,14 +255,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject) wxBitmap::wxBitmap() { - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } wxBitmap::wxBitmap( int width, int height, int depth ) { Create( width, height, depth ); - - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } bool wxBitmap::Create( int width, int height, int depth ) @@ -319,8 +319,6 @@ bool wxBitmap::CreateFromXpm( const char **bits ) M_BMPDATA->m_bpp = visual->depth; // ? - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); - return TRUE; } @@ -331,8 +329,6 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) m_refData = new wxBitmapRefData(); - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); - // ------ // convertion to mono bitmap: // ------ @@ -771,15 +767,11 @@ wxImage wxBitmap::ConvertToImage() const wxBitmap::wxBitmap( const wxBitmap& bmp ) { Ref( bmp ); - - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } wxBitmap::wxBitmap( const wxString &filename, int type ) { LoadFile( filename, type ); - - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth)) @@ -794,19 +786,17 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth M_BMPDATA->m_bpp = 1; wxCHECK_RET( M_BMPDATA->m_bitmap, wxT("couldn't create bitmap") ); - - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } wxBitmap::~wxBitmap() { - if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this); } wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp ) { - if (*this == bmp) return (*this); - Ref( bmp ); + if ( m_refData != bmp.m_refData ) + Ref( bmp ); + return *this; } @@ -862,6 +852,12 @@ void wxBitmap::SetMask( wxMask *mask ) M_BMPDATA->m_mask = mask; } +bool wxBitmap::CopyFromIcon(const wxIcon& icon) +{ + *this = icon; + return TRUE; +} + wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const { wxCHECK_MSG( Ok() &&