great copy ctor/assignment operators cleanup by Paul Cornett (patch 1307665)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-02-09 00:51:23 +00:00
parent 1906f9df59
commit f8855e4725
125 changed files with 44 additions and 892 deletions

View File

@ -40,6 +40,7 @@ All:
- Fixed build error in list.h with VC++ 2005.
- Fixed wxODBC buffer overflow problem in Unicode builds.
- Fixed wxSocketBase::InterruptWait on wxBase.
- Important code cleanup (Paul Cornett)
All (GUI):

View File

@ -79,9 +79,6 @@ private:
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{
public:
wxBitmapBase() : wxGDIObject() {}
virtual ~wxBitmapBase() {}
/*
Derived class must implement these:
@ -90,10 +87,8 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits);
wxBitmap(char **bits);
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = -1);
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const;

View File

@ -68,10 +68,6 @@ class WXDLLEXPORT wxBitmap: public wxGDIObject
public:
// Platform-specific default constructor
wxBitmap();
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxGDIObject()
{ Ref(bitmap); }
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data
@ -138,8 +134,6 @@ public:
int GetBitmapType() const;
inline wxBitmap& operator = (const wxBitmap& bitmap)
{ if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
inline bool operator == (const wxBitmap& bitmap) const
{ return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const

View File

@ -31,9 +31,6 @@ public:
wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush();
// ------------------------------------------------------------------------
@ -44,10 +41,6 @@ public:
virtual void SetStyle(int style) ;
virtual void SetStipple(const wxBitmap& stipple) ;
// assignment
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
// comparison
bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; }

View File

@ -40,11 +40,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
@ -56,7 +51,6 @@ public:
virtual bool Ok() const { return m_refData ; }
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }

View File

@ -95,13 +95,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont() { }
wxFont(int size,
int family,
@ -111,15 +105,11 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
@ -137,9 +127,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -164,9 +151,6 @@ public:
virtual bool RealizeResource();
protected:
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -24,10 +24,6 @@ class WXDLLEXPORT wxIcon: public wxGDIObject
public:
wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
{ Ref(icon); }
wxIcon(const char **data) { CreateFromXpm(data); }
wxIcon(char **data) { CreateFromXpm((const char**)data); }
wxIcon(const char bits[], int width , int height );
@ -44,8 +40,6 @@ public:
bool LoadFile(const wxString& name, wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; }
wxIcon& operator=(const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator==(const wxIcon& icon) const
{ return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -28,17 +28,12 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen();
// wxObjectRefData
wxObjectRefData *CreateRefData() const;
wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
inline wxPen& operator = (const wxPen& pen)
{ if (*this == pen) return (*this); Ref(pen); return *this; }
inline bool operator == (const wxPen& pen) const
{ return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const

View File

@ -23,12 +23,6 @@ public:
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
virtual ~wxAcceleratorTable();
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable& operator=(const wxAcceleratorTable& accel)
{ if ( m_refData != accel.m_refData ) Ref(accel); return *this; }
#if WXWIN_COMPATIBILITY_2_4
bool operator==(const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; }

View File

@ -35,9 +35,7 @@ class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
wxPalette();
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
wxPalette( const wxPalette& palette );
~wxPalette();
wxPalette& operator = ( const wxPalette& palette );
bool operator == ( const wxPalette& palette ) const;
bool operator != ( const wxPalette& palette ) const;
virtual bool Ok() const;

View File

@ -35,13 +35,6 @@ public:
wxRegionGeneric();
~wxRegionGeneric();
//# Copying
wxRegionGeneric(const wxRegionGeneric& r)
: wxGDIObject()
{ Ref(r); }
wxRegionGeneric& operator= (const wxRegionGeneric& r)
{ Ref(r); return (*this); }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegionGeneric& region ) const;

View File

@ -71,11 +71,9 @@ public:
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const;

View File

@ -36,11 +36,6 @@ public:
wxBrush( const wxBitmap &stippleBitmap );
~wxBrush();
wxBrush( const wxBrush &brush )
: wxBrushBase()
{ Ref(brush); }
wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxBrush& brush ) const;

View File

@ -53,12 +53,6 @@ public:
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
#endif
wxColour( const wxColour& col )
: wxGDIObject()
{ Ref(col); }
wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; }
~wxColour();
bool Ok() const { return m_refData != NULL; }

View File

@ -28,7 +28,6 @@ public:
wxCursor();
wxCursor( int cursorId );
wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
@ -36,7 +35,6 @@ public:
int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor ) const;
bool operator != ( const wxCursor& cursor ) const;
bool Ok() const;

View File

@ -29,15 +29,11 @@ class WXDLLIMPEXP_CORE wxFont;
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) : wxFontBase() { Init(); Ref(font); }
wxFont() { }
// wxGTK-specific
wxFont(const wxString& fontname)
{
Init();
Create(fontname);
}
@ -51,8 +47,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -69,9 +63,6 @@ public:
~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;

View File

@ -28,7 +28,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon( const wxIcon& icon);
wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to
@ -45,7 +44,6 @@ public:
{
}
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -36,11 +36,6 @@ public:
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
~wxPen();
wxPen( const wxPen& pen )
: wxGDIObject()
{ Ref(pen); }
wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxPen& pen ) const;

View File

@ -80,11 +80,6 @@ public:
~wxRegion();
wxRegion( const wxRegion& region )
: wxGDIObject()
{ Ref(region); }
wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegion& region ) const;

View File

@ -190,9 +190,6 @@ public:
wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 );
#endif // wxUSE_STREAMS
wxImage( const wxImage& image );
wxImage( const wxImage* image );
bool Create( int width, int height, bool clear = true );
bool Create( int width, int height, unsigned char* data, bool static_data = false );
bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false );
@ -364,13 +361,6 @@ public:
// -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
void RotateHue(double angle);
wxImage& operator = (const wxImage& image)
{
if ( (*this) != image )
Ref(image);
return *this;
}
bool operator == (const wxImage& image) const
{ return m_refData == image.m_refData; }
bool operator != (const wxImage& image) const

View File

@ -22,17 +22,8 @@ public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel)
{ if (accel) Ref(*accel); }
~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
{ if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const

View File

@ -104,13 +104,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase
public:
wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxBitmapBase()
{
Ref(bitmap);
}
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
@ -177,7 +170,6 @@ public:
wxMask *GetMask() const;
void SetMask(wxMask *mask) ;
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
inline bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }

View File

@ -35,9 +35,6 @@ public:
wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush();
virtual void SetColour(const wxColour& col) ;
@ -47,8 +44,6 @@ public:
virtual void MacSetTheme(short macThemeBrush) ;
virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; }
bool operator != (const wxBrush& brush) const

View File

@ -39,10 +39,6 @@ public:
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
// copy ctors and assignment operators
wxColour( const wxColour& col );
wxColour& operator = ( const wxColour& col );
// dtor
~wxColour();

View File

@ -22,11 +22,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
@ -42,7 +37,6 @@ public:
bool CreateFromXpm(const char **bits) ;
virtual bool Ok() const ;
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }

View File

@ -20,13 +20,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont() { }
wxFont(int size,
int family,
@ -36,15 +30,11 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
@ -64,9 +54,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -111,9 +98,6 @@ public:
void* MacGetATSUStyle() const ;
protected:
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -20,13 +20,6 @@ class WXDLLEXPORT wxIcon: public wxGDIObject
public:
wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
: wxGDIObject()
{
Ref(icon);
}
wxIcon(const char **data);
wxIcon(char **data);
wxIcon(const char bits[], int width , int height );
@ -43,8 +36,6 @@ public:
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; }
wxIcon& operator=(const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -39,11 +39,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
// Copy constructor
wxMetafile(const wxMetafile& metafile)
: wxGDIObject()
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
@ -63,7 +58,6 @@ public:
void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; }
inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; }

View File

@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
wxPalette(const wxPalette& palette)
: wxPaletteBase()
{ Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
@ -50,7 +47,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -52,12 +52,8 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }

View File

@ -54,13 +54,6 @@ public:
~wxRegion();
//# Copying
wxRegion(const wxRegion& r)
: wxGDIObject()
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region
// Clear current region
void Clear();

View File

@ -22,17 +22,8 @@ public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel)
{ if (accel) Ref(*accel); }
~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
{ if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const

View File

@ -133,11 +133,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase
public:
wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxBitmapBase()
{ Ref(bitmap); }
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
@ -194,7 +189,6 @@ public:
int GetBitmapType() const;
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
inline bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }

View File

@ -35,9 +35,6 @@ public:
wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush();
virtual void SetColour(const wxColour& col) ;
@ -47,8 +44,6 @@ public:
virtual void SetMacTheme(short macThemeBrush) ;
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; }
bool operator != (const wxBrush& brush) const

View File

@ -43,11 +43,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
@ -63,7 +58,6 @@ public:
bool CreateFromXpm(const char **bits) ;
virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; }
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }

View File

@ -20,13 +20,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont() { }
wxFont(int size,
int family,
@ -36,15 +30,11 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
@ -62,9 +52,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -99,9 +86,6 @@ public:
wxUint32 GetMacATSUFontID() const;
protected:
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -20,11 +20,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap
public:
wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
: wxBitmap()
{ Ref(icon); }
wxIcon(const char **data);
wxIcon(char **data);
wxIcon(const char bits[], int width , int height );
@ -41,8 +36,6 @@ public:
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; }
wxIcon& operator=(const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -50,11 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
// Copy constructor
wxMetafile(const wxMetafile& metafile)
: wxGDIObject()
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
@ -74,7 +69,6 @@ public:
void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; }
inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; }

View File

@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
wxPalette(const wxPalette& palette)
: wxPaletteBase()
{ Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
@ -50,7 +47,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -52,12 +52,8 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }

View File

@ -53,13 +53,6 @@ public:
~wxRegion();
//# Copying
wxRegion(const wxRegion& r)
: wxGDIObject()
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region
// Clear current region
void Clear();

View File

@ -75,11 +75,9 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits) { CreateFromXpm(bits); }
wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
wxBitmap(const wxImage& image, int depth = -1);
~wxBitmap() {}
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const;
bool Ok() const;

View File

@ -33,9 +33,7 @@ public:
wxBrush() {}
wxBrush(const wxColour &colour, int style = wxSOLID);
wxBrush(const wxBitmap &stippleBitmap);
wxBrush(const wxBrush &brush);
~wxBrush() {}
wxBrush& operator = (const wxBrush& brush);
bool operator == (const wxBrush& brush) const;
bool operator != (const wxBrush& brush) const;
bool Ok() const;

View File

@ -26,7 +26,6 @@ public:
wxCursor();
wxCursor(int cursorId);
wxCursor(const wxCursor &cursor);
wxCursor(const char bits[], int width, int height,
int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
@ -34,7 +33,6 @@ public:
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
int hotSpotX = 0, int hotSpotY = 0);
~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == (const wxCursor& cursor) const;
bool operator != (const wxCursor& cursor) const;
bool Ok() const;

View File

@ -30,13 +30,10 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont() { }
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
@ -48,8 +45,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -65,9 +60,6 @@ public:
~wxFont() {}
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -90,9 +82,6 @@ public:
struct font_t *GetMGLfont_t(float scale, bool antialiased);
protected:
// common part of all ctors
void Init() {}
// ref counting code
virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

View File

@ -28,7 +28,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap
{
public:
wxIcon() : wxBitmap() {}
wxIcon(const wxIcon& icon);
wxIcon(const char **bits, int width=-1, int height=-1);
wxIcon(char **bits, int width=-1, int height=-1);
@ -43,7 +42,6 @@ public:
{
}
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -34,9 +34,7 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
wxPalette(const wxPalette& palette);
~wxPalette();
wxPalette& operator = (const wxPalette& palette);
bool operator == (const wxPalette& palette) const;
bool operator != (const wxPalette& palette) const;
virtual bool Ok() const;

View File

@ -33,9 +33,7 @@ public:
wxPen() {}
wxPen(const wxColour &colour, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen);
~wxPen() {}
wxPen& operator = (const wxPen& pen);
bool operator == (const wxPen& pen) const;
bool operator != (const wxPen& pen) const;

View File

@ -49,12 +49,6 @@ public:
wxRegion();
~wxRegion();
//# Copying
inline wxRegion(const wxRegion& r)
{ Ref(r); }
inline wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region
// Clear current region
void Clear(void);

View File

@ -23,14 +23,9 @@ public:
wxAcceleratorTable();
wxAcceleratorTable(const wxString& resource); // Load from .rc resource
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; }

View File

@ -24,10 +24,7 @@ class WXDLLEXPORT wxCursor: public wxObject
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor) { Ref(cursor); }
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
@ -44,8 +41,6 @@ public:
virtual bool Ok() const;
wxCursor& operator = (const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator == (const wxCursor& cursor) const
{ return m_refData == cursor.m_refData; }
bool operator != (const wxCursor& cursor) const

View File

@ -27,8 +27,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont() { }
wxFont(int size,
int family,
@ -38,8 +37,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -60,9 +57,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -120,9 +114,6 @@ public:
protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -20,9 +20,6 @@ class WXDLLEXPORT wxIcon : public wxBitmap
public:
wxIcon();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
// Initialize with XBM data
wxIcon(const char bits[], int width, int height);
@ -58,8 +55,6 @@ public:
// ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp);
wxIcon& operator = (const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const

View File

@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
@ -61,7 +60,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; }
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -20,10 +20,7 @@ class WXDLLEXPORT wxAcceleratorTable : public wxObject
{
public:
// default ctor
wxAcceleratorTable() : wxObject() { }
// copy ctor
wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject(accel) { Ref(accel); }
wxAcceleratorTable() { }
// load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource);
@ -31,13 +28,6 @@ public:
// initialize from array
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
wxAcceleratorTable& operator=(const wxAcceleratorTable& accel)
{
if ( *this != accel )
Ref(accel);
return *this;
}
bool operator==(const wxAcceleratorTable& accel) const;
bool operator!=(const wxAcceleratorTable& accel) const
{ return !(*this == accel); }

View File

@ -39,10 +39,7 @@ class WXDLLEXPORT wxBitmap : public wxGDIImage
{
public:
// default ctor creates an invalid bitmap, you must Create() it later
wxBitmap() { Init(); }
// Copy constructors
wxBitmap(const wxBitmap& bitmap) : wxGDIImage(bitmap) { Init(); Ref(bitmap); }
wxBitmap() { }
// Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1);
@ -79,14 +76,7 @@ public:
// we must have this, otherwise icons are silently copied into bitmaps using
// the copy ctor but the resulting bitmap is invalid!
wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); }
wxBitmap& operator=(const wxBitmap& bitmap)
{
if ( m_refData != bitmap.m_refData )
Ref(bitmap);
return *this;
}
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
wxBitmap& operator=(const wxIcon& icon)
{
@ -172,9 +162,6 @@ public:
#endif // __WXDEBUG__
protected:
// common part of all ctors
void Init();
virtual wxGDIImageRefData *CreateData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

View File

@ -28,7 +28,6 @@ public:
wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush) : wxBrushBase(brush) { Ref(brush); }
virtual ~wxBrush();
virtual void SetColour(const wxColour& col);
@ -36,7 +35,6 @@ public:
virtual void SetStyle(int style);
virtual void SetStipple(const wxBitmap& stipple);
wxBrush& operator=(const wxBrush& brush);
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }

View File

@ -38,11 +38,6 @@ public:
wxColour(const wxString &colourName) { InitFromName(colourName); }
wxColour(const wxChar *colourName) { InitFromName(colourName); }
// copy ctors and assignment operators
wxColour(const wxColour& col);
wxColour& operator=( const wxColour& col);
// dtor
~wxColour();

View File

@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage
public:
// constructors
wxCursor();
wxCursor(const wxCursor& cursor) : wxGDIImage(cursor) { Ref(cursor); }
wxCursor(const wxImage& image);
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
@ -33,9 +32,6 @@ public:
wxCursor(int idCursor);
virtual ~wxCursor();
wxCursor& operator=(const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator==(const wxCursor& cursor) const;
bool operator!=(const wxCursor& cursor) const
{ return !(*this == cursor); }

View File

@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
wxFont() { }
wxFont(int size,
int family,
@ -33,8 +32,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -46,16 +43,12 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(pixelSize, family, style, weight,
underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
Init();
Create(info, hFont);
}
@ -89,9 +82,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const;
@ -145,9 +135,6 @@ protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -44,9 +44,6 @@ public:
// default
wxIcon() { }
// copy
wxIcon(const wxIcon& icon) : wxGDIImage(icon) { Ref(icon); }
// from raw data
wxIcon(const char bits[], int width, int height);
@ -68,8 +65,6 @@ public:
long type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
wxIcon& operator = (const wxIcon& icon)
{ if ( *this != icon ) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const

View File

@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{
public:
wxMetafile(const wxString& file = wxEmptyString);
wxMetafile(const wxMetafile& metafile) { Ref(metafile); }
virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything
@ -69,8 +68,6 @@ public:
void SetWindowsMappingMode(int mm);
// Operators
wxMetafile& operator=(const wxMetafile& metafile)
{ if (*this != metafile) Ref(metafile); return *this; }
bool operator==(const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; }
bool operator!=(const wxMetafile& metafile) const

View File

@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette(void);
inline wxPalette(const wxPalette& palette) : wxPaletteBase(palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(void);
@ -44,7 +43,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -77,17 +77,8 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen) : wxGDIObject(pen) { Ref(pen); }
virtual ~wxPen();
wxPen& operator=(const wxPen& pen)
{
if ( this != &pen )
Ref(pen);
return *this;
}
bool operator==(const wxPen& pen) const
{
const wxPenRefData *penData = (wxPenRefData *)pen.m_refData;

View File

@ -56,12 +56,6 @@ public:
virtual ~wxRegion();
// Copying
wxRegion(const wxRegion& r) : wxGDIObject(r)
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
// Modify region
// -------------

View File

@ -380,6 +380,24 @@ inline void* wxCheckCast(void *ptr)
#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING
// ----------------------------------------------------------------------------
// wxObjectRefData: ref counted data meant to be stored in wxObject
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectRefData
{
friend class WXDLLIMPEXP_BASE wxObject;
public:
wxObjectRefData() : m_count(1) { }
virtual ~wxObjectRefData() { }
int GetRefCount() const { return m_count; }
private:
int m_count;
};
// ----------------------------------------------------------------------------
// wxObject: the root class of wxWidgets object hierarchy
// ----------------------------------------------------------------------------
@ -388,24 +406,22 @@ class WXDLLIMPEXP_BASE wxObject
{
DECLARE_ABSTRACT_CLASS(wxObject)
private:
void InitFrom(const wxObject& other);
public:
wxObject() { m_refData = NULL; }
virtual ~wxObject() { UnRef(); }
wxObject(const wxObject& other)
{
InitFrom(other);
m_refData = other.m_refData;
if (m_refData)
m_refData->m_count++;
}
wxObject& operator=(const wxObject& other)
{
if ( this != &other )
{
UnRef();
InitFrom(other);
Ref(other);
}
return *this;
}
@ -485,25 +501,6 @@ protected:
wxObjectRefData *m_refData;
};
// ----------------------------------------------------------------------------
// wxObjectRefData: ref counted data meant to be stored in wxObject
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectRefData
{
friend class WXDLLIMPEXP_BASE wxObject;
public:
wxObjectRefData() : m_count(1) { }
virtual ~wxObjectRefData() { }
int GetRefCount() const { return m_count; }
private:
int m_count;
};
inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
{
return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL;

View File

@ -38,14 +38,8 @@ public:
,const wxAcceleratorEntry vaEntries[]
); // Load from array
// Copy constructors
inline wxAcceleratorTable(const wxAcceleratorTable& rAccel) { Ref(rAccel); }
inline wxAcceleratorTable(const wxAcceleratorTable* pAccel) { if (pAccel) Ref(*pAccel); }
~wxAcceleratorTable();
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& rAccel)
{ if (*this == rAccel) return (*this); Ref(rAccel); return *this; };
inline bool operator== (const wxAcceleratorTable& rAccel) const
{ return m_refData == rAccel.m_refData; };
inline bool operator!= (const wxAcceleratorTable& rAccel) const

View File

@ -70,7 +70,11 @@ public:
// Copy constructors
inline wxBitmap(const wxBitmap& rBitmap)
{ Init(); Ref(rBitmap); SetHandle(rBitmap.GetHandle()); }
: wxGDIImage(rBitmap)
{
Init();
SetHandle(rBitmap.GetHandle());
}
// Initialize with raw data
wxBitmap( const char bits[]
@ -112,13 +116,6 @@ public:
inline wxBitmap(const wxIcon& rIcon)
{ Init(); CopyFromIcon(rIcon); }
wxBitmap& operator=(const wxBitmap& rBitmap)
{
if ( m_refData != rBitmap.m_refData )
Ref(rBitmap);
return(*this);
}
wxBitmap& operator=(const wxIcon& rIcon)
{
(void)CopyFromIcon(rIcon);

View File

@ -45,10 +45,8 @@ public:
wxBrush();
wxBrush(const wxColour& rCol, int nStyle = wxSOLID);
wxBrush(const wxBitmap& rStipple);
inline wxBrush(const wxBrush& rBrush) { Ref(rBrush); }
~wxBrush();
inline wxBrush& operator = (const wxBrush& rBrush) { if (*this == rBrush) return (*this); Ref(rBrush); return *this; }
inline bool operator == (const wxBrush& rBrush) const { return m_refData == rBrush.m_refData; }
inline bool operator != (const wxBrush& rBrush) const { return m_refData != rBrush.m_refData; }

View File

@ -32,8 +32,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& rCursor) { Ref(rCursor); }
wxCursor(const wxImage& rImage);
wxCursor( const char acBits[]
@ -50,14 +48,6 @@ public:
);
wxCursor(int nCursorType);
inline ~wxCursor() { }
inline wxCursor& operator = (const wxCursor& rCursor)
{
if (*this == rCursor)
return (*this);
Ref(rCursor);
return *this;
}
inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; }
inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; }

View File

@ -25,8 +25,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& rFont) { Init(); Ref(rFont); }
wxFont() { }
wxFont( int nSize
,int nFamily
@ -37,8 +36,6 @@ public:
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
)
{
Init();
(void)Create( nSize
,nFamily
,nStyle
@ -54,8 +51,6 @@ public:
)
{
Init();
(void)Create( rInfo
,hFont
);
@ -77,11 +72,6 @@ public:
virtual ~wxFont();
//
// Assignment
//
wxFont& operator=(const wxFont& rFont);
//
// Implement base class pure virtuals
//
@ -123,10 +113,6 @@ public:
protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo);
//
// Common part of all ctors
//
void Init(void);
void Unshare(void);
private:

View File

@ -40,9 +40,6 @@ class WXDLLEXPORT wxIcon: public wxIconBase
public:
wxIcon();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
wxIcon( const char bits[]
,int nWidth
,int nHeight
@ -67,8 +64,6 @@ public:
,int nDesiredHeight = -1
);
inline wxIcon& operator = (const wxIcon& rIcon)
{ if (*this != rIcon) Ref(rIcon); return *this; }
inline bool operator == (const wxIcon& rIcon) const
{ return m_refData == rIcon.m_refData; }
inline bool operator != (const wxIcon& rIcon) const

View File

@ -50,10 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
// Copy constructor
inline wxMetafile(const wxMetafile& metafile)
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
@ -71,8 +67,6 @@ public:
void SetWindowsMappingMode(int mm);
// Operators
inline wxMetafile& operator = (const wxMetafile& metafile)
{ if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator== (const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; }
inline bool operator!= (const wxMetafile& metafile) const

View File

@ -36,7 +36,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); }
wxPalette( int n
,const unsigned char* pRed
@ -62,7 +61,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& rPalette) { if (*this == rPalette) return (*this); Ref(rPalette); return *this; }
inline bool operator == (const wxPalette& rPalette) const
{ return m_refData == rPalette.m_refData; }
inline bool operator != (const wxPalette& rPalette) const

View File

@ -52,11 +52,8 @@ public:
wxPen( const wxBitmap& rStipple
,int nWidth
);
inline wxPen(const wxPen& rPen) { Ref(rPen); }
~wxPen();
inline wxPen& operator = (const wxPen& rPen)
{ if (*this == rPen) return (*this); Ref(rPen); return *this; }
inline bool operator == (const wxPen& rPen) const
{ return m_refData == rPen.m_refData; }
inline bool operator != (const wxPen& rPen) const

View File

@ -59,14 +59,6 @@ public:
wxRegion();
~wxRegion();
//
// Copying
//
inline wxRegion(const wxRegion& rSrc)
{ Ref(rSrc); }
inline wxRegion& operator = (const wxRegion& rSrc)
{ Ref(rSrc); return (*this); }
//
// Modify region
//

View File

@ -22,9 +22,6 @@ public:
// default ctor
wxAcceleratorTable();
// copy ctor
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
// load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource);
@ -33,8 +30,6 @@ public:
virtual ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
#if WXWIN_COMPATIBILITY_2_4
bool operator==(const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; }

View File

@ -41,9 +41,6 @@ public:
// default ctor creates an invalid bitmap, you must Create() it later
wxBitmap() { Init(); }
// Copy constructors
wxBitmap(const wxBitmap& bitmap) { Init(); Ref(bitmap); }
// Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1);
@ -81,13 +78,6 @@ public:
// the copy ctor but the resulting bitmap is invalid!
wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); }
wxBitmap& operator=(const wxBitmap& bitmap)
{
if ( m_refData != bitmap.m_refData )
Ref(bitmap);
return *this;
}
wxBitmap& operator=(const wxIcon& icon)
{
(void)CopyFromIcon(icon);

View File

@ -28,7 +28,6 @@ public:
wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush) { Ref(brush); }
virtual ~wxBrush();
virtual void SetColour(const wxColour& col);
@ -36,7 +35,6 @@ public:
virtual void SetStyle(int style);
virtual void SetStipple(const wxBitmap& stipple);
wxBrush& operator=(const wxBrush& brush);
bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); }

View File

@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage
public:
// constructors
wxCursor();
wxCursor(const wxCursor& cursor) { Ref(cursor); }
wxCursor(const wxImage& image);
wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1,
@ -33,9 +32,6 @@ public:
wxCursor(int idCursor);
virtual ~wxCursor();
wxCursor& operator=(const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator==(const wxCursor& cursor) const;
bool operator!=(const wxCursor& cursor) const
{ return !(*this == cursor); }

View File

@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
wxFont() { }
wxFont(int size,
int family,
@ -33,8 +32,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -46,16 +43,12 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(pixelSize, family, style, weight,
underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
Init();
Create(info, hFont);
}
@ -89,9 +82,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const;
@ -137,9 +127,6 @@ protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -44,9 +44,6 @@ public:
// default
wxIcon() { }
// copy
wxIcon(const wxIcon& icon) { Ref(icon); }
// from raw data
wxIcon(const char bits[], int width, int height);
@ -68,8 +65,6 @@ public:
long type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
wxIcon& operator = (const wxIcon& icon)
{ if ( *this != icon ) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const

View File

@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{
public:
wxMetafile(const wxString& file = wxEmptyString);
wxMetafile(const wxMetafile& metafile) { Ref(metafile); }
virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything
@ -69,8 +68,6 @@ public:
void SetWindowsMappingMode(int mm);
// Operators
wxMetafile& operator=(const wxMetafile& metafile)
{ if (*this != metafile) Ref(metafile); return *this; }
bool operator==(const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; }
bool operator!=(const wxMetafile& metafile) const

View File

@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette(void);
inline wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(void);
@ -44,7 +43,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -77,17 +77,8 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen) { Ref(pen); }
virtual ~wxPen();
wxPen& operator=(const wxPen& pen)
{
if ( this != &pen )
Ref(pen);
return *this;
}
bool operator==(const wxPen& pen) const
{
const wxPenRefData *penData = (wxPenRefData *)pen.m_refData;

View File

@ -56,12 +56,6 @@ public:
virtual ~wxRegion();
// Copying
wxRegion(const wxRegion& r) : wxGDIObject(r)
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
// Modify region
// -------------

View File

@ -78,11 +78,9 @@ public:
wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
virtual ~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const;

View File

@ -35,9 +35,6 @@ public:
wxBrush( const wxBitmap &stippleBitmap );
~wxBrush();
wxBrush( const wxBrush &brush ) { Ref(brush); }
wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxBrush& brush ) const;

View File

@ -58,9 +58,6 @@ public:
// Get colour from name or wxNullColour
static wxColour CreateByName(const wxString& name);
wxColour( const wxColour& col ) { Ref(col); }
wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; }
~wxColour();
bool Ok() const { return m_refData != NULL; }

View File

@ -28,7 +28,6 @@ public:
wxCursor();
wxCursor( int cursorId );
wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
@ -36,7 +35,6 @@ public:
int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor ) const;
bool operator != ( const wxCursor& cursor ) const;
bool Ok() const;

View File

@ -19,8 +19,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont() { }
wxFont(int size,
int family,
@ -30,8 +29,6 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
@ -56,9 +53,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@ -109,9 +103,6 @@ public:
protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
// common part of all ctors
void Init();
void Unshare();
private:

View File

@ -22,7 +22,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{
public:
wxIcon();
wxIcon( const wxIcon& icon);
wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to
@ -39,7 +38,6 @@ public:
{
}
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public:
wxPalette();
wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
@ -61,7 +60,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; }
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@ -38,9 +38,6 @@ public:
wxPen( const wxBitmap &stipple, int width );
~wxPen();
wxPen( const wxPen& pen ) { Ref(pen); }
wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxPen& pen ) const;

View File

@ -82,9 +82,6 @@ public:
~wxRegion();
wxRegion( const wxRegion& region ) { Ref(region); }
wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; }
bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegion& region ) const;

View File

@ -32,10 +32,6 @@ wxFontRefData::~wxFontRefData()
// TODO: delete font data
}
void wxFont::Init()
{
}
bool wxFont::Create(const wxNativeFontInfo&)
{
return FALSE;

View File

@ -300,14 +300,6 @@ void wxFontBase::SetNativeFontInfoUserDesc(const wxString& info)
}
}
wxFont& wxFont::operator=(const wxFont& font)
{
if ( this != &font )
Ref(font);
return (wxFont &)*this;
}
bool wxFontBase::operator==(const wxFont& font) const
{
// either it is the same font, i.e. they share the same common data or they

View File

@ -148,17 +148,6 @@ wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index )
}
#endif // wxUSE_STREAMS
wxImage::wxImage( const wxImage& image )
: wxObject()
{
Ref(image);
}
wxImage::wxImage( const wxImage* image )
{
if (image) Ref(*image);
}
wxImage::wxImage( const char** xpmData )
{
Create(xpmData);

View File

@ -283,15 +283,6 @@ wxObject *wxCreateDynamicObject(const wxChar *name)
// wxObject
// ----------------------------------------------------------------------------
// Initialize ref data from another object (needed for copy constructor and
// assignment operator)
void wxObject::InitFrom(const wxObject& other)
{
m_refData = other.m_refData;
if ( m_refData )
m_refData->m_count++;
}
void wxObject::Ref(const wxObject& clone)
{
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT

View File

@ -66,23 +66,10 @@ wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green
Create(n, red, green, blue);
}
wxPalette::wxPalette(const wxPalette& palette)
: wxPaletteBase()
{
Ref(palette);
}
wxPalette::~wxPalette()
{
}
wxPalette& wxPalette::operator = (const wxPalette& palette)
{
if (*this == palette) return (*this);
Ref(palette);
return *this;
}
bool wxPalette::operator == (const wxPalette& palette) const
{
return m_refData == palette.m_refData;

Some files were not shown because too many files have changed in this diff Show More