projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
another segfault fix
[wxWidgets.git]
/
src
/
gtk
/
bitmap.cpp
diff --git
a/src/gtk/bitmap.cpp
b/src/gtk/bitmap.cpp
index f0ad2fe56bb98c900c7fc78f7c7f9c92e44c45b0..1f62c2a11be98d0aff1282aed4a3abe3aa55ff8d 100644
(file)
--- a/
src/gtk/bitmap.cpp
+++ b/
src/gtk/bitmap.cpp
@@
-11,6
+11,9
@@
#pragma implementation "bitmap.h"
#endif
#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"
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/filefn.h"
@@
-252,14
+255,11
@@
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxBitmap::wxBitmap()
{
wxBitmap::wxBitmap()
{
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::wxBitmap( int width, int height, int depth )
{
Create( width, height, depth );
}
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 )
}
bool wxBitmap::Create( int width, int height, int depth )
@@
-319,12
+319,9
@@
bool wxBitmap::CreateFromXpm( const char **bits )
M_BMPDATA->m_bpp = visual->depth; // ?
M_BMPDATA->m_bpp = visual->depth; // ?
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
-
return TRUE;
}
return TRUE;
}
-
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
{
wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
{
wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
@@
-332,8
+329,6
@@
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
m_refData = new wxBitmapRefData();
m_refData = new wxBitmapRefData();
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
-
// ------
// convertion to mono bitmap:
// ------
// ------
// convertion to mono bitmap:
// ------
@@
-772,15
+767,11
@@
wxImage wxBitmap::ConvertToImage() const
wxBitmap::wxBitmap( const wxBitmap& bmp )
{
Ref( bmp );
wxBitmap::wxBitmap( const wxBitmap& bmp )
{
Ref( bmp );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::wxBitmap( const wxString &filename, int type )
{
LoadFile( filename, type );
}
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))
}
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
@@
-795,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") );
M_BMPDATA->m_bpp = 1;
wxCHECK_RET( M_BMPDATA->m_bitmap, wxT("couldn't create bitmap") );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::~wxBitmap()
{
}
wxBitmap::~wxBitmap()
{
- if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
}
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{
}
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{
- if (*this == bmp) return (*this);
- Ref( bmp );
+ if ( m_refData != bmp.m_refData )
+ Ref( bmp );
+
return *this;
}
return *this;
}
@@
-863,6
+852,12
@@
void wxBitmap::SetMask( wxMask *mask )
M_BMPDATA->m_mask = 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() &&
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
{
wxCHECK_MSG( Ok() &&