- 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):
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{
public:
- wxBitmapBase() : wxGDIObject() {}
- virtual ~wxBitmapBase() {}
-
/*
Derived class must implement these:
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;
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
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
wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
- wxBrush(const wxBrush& brush)
- : wxBrushBase()
- { Ref(brush); }
~wxBrush();
// ------------------------------------------------------------------------
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; }
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);
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; }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font)
- : wxFontBase()
- {
- Init();
- Ref(font);
- }
+ wxFont() { }
wxFont(int size,
int family,
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);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
virtual bool RealizeResource();
protected:
- // common part of all ctors
- void Init();
-
void Unshare();
private:
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 );
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); }
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
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; }
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;
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;
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;
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;
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; }
wxCursor();
wxCursor( int cursorId );
- wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
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;
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);
}
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
{
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
{
}
- 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); }
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;
~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;
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 );
// -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
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
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);
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; }
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) ;
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
wxColour( const wxChar *colourName )
{ InitFromName(colourName); }
- // copy ctors and assignment operators
- wxColour( const wxColour& col );
- wxColour& operator = ( const wxColour& col );
-
// dtor
~wxColour();
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);
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; }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font)
- : wxFontBase()
- {
- Init();
- Ref(font);
- }
+ wxFont() { }
wxFont(int size,
int family,
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);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
void* MacGetATSUStyle() const ;
protected:
- // common part of all ctors
- void Init();
-
void Unshare();
private:
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 );
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); }
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
- // Copy constructor
- wxMetafile(const wxMetafile& metafile)
- : wxGDIObject()
- { Ref(metafile); }
-
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
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; }
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();
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; }
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; }
~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();
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
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);
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; }
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) ;
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
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);
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; }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font)
- : wxFontBase()
- {
- Init();
- Ref(font);
- }
+ wxFont() { }
wxFont(int size,
int family,
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);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
wxUint32 GetMacATSUFontID() const;
protected:
- // common part of all ctors
- void Init();
-
void Unshare();
private:
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 );
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); }
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
- // Copy constructor
- wxMetafile(const wxMetafile& metafile)
- : wxGDIObject()
- { Ref(metafile); }
-
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
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; }
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();
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; }
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; }
~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();
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;
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;
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);
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;
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font) { Init(); Ref(font); }
+ wxFont() { }
wxFont(const wxNativeFontInfo& info)
{
- Init();
-
(void)Create(info);
}
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
~wxFont() {}
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
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;
{
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);
{
}
- 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); }
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;
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;
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);
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; }
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);
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
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font) { Init(); Ref(font); }
+ wxFont() { }
wxFont(int size,
int family,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
- // common part of all ctors
- void Init();
-
void Unshare();
private:
public:
wxIcon();
- // Copy constructors
- inline wxIcon(const wxIcon& icon) { Ref(icon); }
-
// Initialize with XBM data
wxIcon(const char bits[], int width, int height);
// 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
public:
wxPalette();
- wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
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; }
{
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);
// 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); }
{
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);
// 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)
{
#endif // __WXDEBUG__
protected:
- // common part of all ctors
- void Init();
-
virtual wxGDIImageRefData *CreateData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
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);
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); }
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();
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,
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); }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
+ wxFont() { }
wxFont(int size,
int family,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
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);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const;
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
- // common part of all ctors
- void Init();
-
void Unshare();
private:
// default
wxIcon() { }
- // copy
- wxIcon(const wxIcon& icon) : wxGDIImage(icon) { Ref(icon); }
-
// from raw data
wxIcon(const char bits[], int width, int height);
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
{
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
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
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);
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; }
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;
virtual ~wxRegion();
- // Copying
- wxRegion(const wxRegion& r) : wxGDIObject(r)
- { Ref(r); }
- wxRegion& operator = (const wxRegion& r)
- { Ref(r); return (*this); }
-
// Modify region
// -------------
#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
// ----------------------------------------------------------------------------
{
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;
}
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;
,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
// 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[]
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);
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; }
public:
wxCursor();
- // Copy constructors
- wxCursor(const wxCursor& rCursor) { Ref(rCursor); }
wxCursor(const wxImage& rImage);
wxCursor( const char acBits[]
);
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; }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& rFont) { Init(); Ref(rFont); }
+ wxFont() { }
wxFont( int nSize
,int nFamily
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
)
{
- Init();
-
(void)Create( nSize
,nFamily
,nStyle
)
{
- Init();
-
(void)Create( rInfo
,hFont
);
virtual ~wxFont();
- //
- // Assignment
- //
- wxFont& operator=(const wxFont& rFont);
-
//
// Implement base class pure virtuals
//
protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo);
- //
- // Common part of all ctors
- //
- void Init(void);
void Unshare(void);
private:
public:
wxIcon();
- // Copy constructors
- inline wxIcon(const wxIcon& icon) { Ref(icon); }
-
wxIcon( const char bits[]
,int nWidth
,int nHeight
,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
{
DECLARE_DYNAMIC_CLASS(wxMetafile)
public:
- // Copy constructor
- inline wxMetafile(const wxMetafile& metafile)
- { Ref(metafile); }
-
wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void);
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
public:
wxPalette();
- inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); }
wxPalette( int n
,const unsigned char* pRed
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
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
wxRegion();
~wxRegion();
- //
- // Copying
- //
- inline wxRegion(const wxRegion& rSrc)
- { Ref(rSrc); }
- inline wxRegion& operator = (const wxRegion& rSrc)
- { Ref(rSrc); return (*this); }
-
//
// Modify region
//
// default ctor
wxAcceleratorTable();
- // copy ctor
- wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
-
// load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource);
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; }
// 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);
// 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);
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);
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); }
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,
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); }
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
+ wxFont() { }
wxFont(int size,
int family,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
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);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const;
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
- // common part of all ctors
- void Init();
-
void Unshare();
private:
// default
wxIcon() { }
- // copy
- wxIcon(const wxIcon& icon) { Ref(icon); }
-
// from raw data
wxIcon(const char bits[], int width, int height);
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
{
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
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
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);
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; }
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;
virtual ~wxRegion();
- // Copying
- wxRegion(const wxRegion& r) : wxGDIObject(r)
- { Ref(r); }
- wxRegion& operator = (const wxRegion& r)
- { Ref(r); return (*this); }
-
// Modify region
// -------------
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;
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;
// 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; }
wxCursor();
wxCursor( int cursorId );
- wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE
wxCursor( const wxImage & image );
#endif
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;
{
public:
// ctors and such
- wxFont() { Init(); }
- wxFont(const wxFont& font) { Init(); Ref(font); }
+ wxFont() { }
wxFont(int size,
int family,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
- Init();
-
(void)Create(size, family, style, weight, underlined, face, encoding);
}
virtual ~wxFont();
- // assignment
- wxFont& operator=(const wxFont& font);
-
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
- // common part of all ctors
- void Init();
-
void Unshare();
private:
{
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
{
}
- 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); }
public:
wxPalette();
- wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette();
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; }
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;
~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;
// TODO: delete font data
}
-void wxFont::Init()
-{
-}
-
bool wxFont::Create(const wxNativeFontInfo&)
{
return FALSE;
}
}
-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
}
#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);
// 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
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;
return image;
}
-wxBitmap::wxBitmap( const wxBitmap& bmp )
- : wxBitmapBase()
-{
- Ref( bmp );
-}
-
wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type )
{
LoadFile( filename, type );
{
}
-wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
-{
- if ( m_refData != bmp.m_refData )
- Ref( bmp );
-
- return *this;
-}
-
bool wxBitmap::operator == ( const wxBitmap& bmp ) const
{
return m_refData == bmp.m_refData;
gdk_bitmap_unref( mask );
}
-
-wxCursor::wxCursor( const wxCursor &cursor )
- : wxObject()
-{
- Ref( cursor );
-}
-
#if wxUSE_IMAGE
wxCursor::wxCursor( const wxImage & image )
{
}
-wxCursor& wxCursor::operator = ( const wxCursor& cursor )
-{
- if (*this == cursor)
- return (*this);
-
- Ref( cursor );
-
- return *this;
-}
-
bool wxCursor::operator == ( const wxCursor& cursor ) const
{
return m_refData == cursor.m_refData;
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-void wxFont::Init()
-{
-}
-
wxFont::wxFont(const wxNativeFontInfo& info)
{
- Init();
-
Create( info.GetPointSize(),
info.GetFamily(),
info.GetStyle(),
{
}
-wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap()
-{
- Ref(icon);
-}
-
-wxIcon& wxIcon::operator = ( const wxIcon& icon )
-{
- if (*this == icon) return (*this);
- Ref(icon);
- return *this;
-}
-
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
{
wxIcon *icon = (wxIcon*)(&bmp);
wxComposeRGBColor( &m_pixel, m_red, m_blue, m_green );
}
-wxColour::wxColour (const wxColour& col)
- : wxObject()
-{
- m_red = col.m_red;
- m_green = col.m_green;
- m_blue = col.m_blue;
- m_isInit = col.m_isInit;
-
- memcpy( &m_pixel, &col.m_pixel, 6 );
-}
-
-wxColour& wxColour::operator =(const wxColour& col)
-{
- m_red = col.m_red;
- m_green = col.m_green;
- m_blue = col.m_blue;
- m_isInit = col.m_isInit;
-
- memcpy( &m_pixel, &col.m_pixel, 6 );
-
- return *this;
-}
-
void wxColour::InitFromName(const wxString& name)
{
if ( wxTheColourDatabase )
// wxFont
// ----------------------------------------------------------------------------
-void wxFont::Init()
-{
-}
-
bool wxFont::Create(const wxNativeFontInfo& info)
{
return Create(
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
-
-void wxFont::Init()
-{
}
bool wxFont::Create(const wxNativeFontInfo& info)
return image;
}
-wxBitmap::wxBitmap(const wxBitmap& bmp)
-{
- Ref(bmp);
-}
-
wxBitmap::wxBitmap(const wxString &filename, wxBitmapType type)
{
LoadFile(filename, type);
delete bdc;
}
-wxBitmap& wxBitmap::operator = (const wxBitmap& bmp)
-{
- if ( *this == bmp ) return (*this);
- Ref(bmp);
- return *this;
-}
-
bool wxBitmap::operator == (const wxBitmap& bmp) const
{
return (m_refData == bmp.m_refData);
M_BRUSHDATA->m_style = wxSTIPPLE;
}
-wxBrush::wxBrush(const wxBrush &brush)
-{
- Ref(brush);
-}
-
-wxBrush& wxBrush::operator = (const wxBrush& brush)
-{
- if (*this == brush) return (*this);
- Ref(brush);
- return *this;
-}
-
bool wxBrush::operator == (const wxBrush& brush) const
{
return m_refData == brush.m_refData;
}
}
-wxCursor::wxCursor(const wxCursor &cursor)
-{
- Ref(cursor);
-}
-
wxCursor::~wxCursor()
{
// wxObject unrefs data
}
-wxCursor& wxCursor::operator = (const wxCursor& cursor)
-{
- if ( *this == cursor )
- return (*this);
- Ref(cursor);
- return *this;
-}
-
bool wxCursor::operator == (const wxCursor& cursor) const
{
return (m_refData == cursor.m_refData);
{
}
-wxIcon::wxIcon(const wxIcon& icon) : wxBitmap()
-{
- Ref(icon);
-}
-
-wxIcon& wxIcon::operator = (const wxIcon& icon)
-{
- if (*this == icon)
- return (*this);
- Ref(icon);
- return *this;
-}
-
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
{
wxIcon *icon = (wxIcon*)(&bmp);
Create(n, red, green, blue);
}
-wxPalette::wxPalette(const wxPalette& palette)
-{
- 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;
wxBitmapToPixPattern(stipple, &(M_PENDATA->m_pixPattern), NULL);
}
-wxPen::wxPen(const wxPen& pen)
-{
- Ref(pen);
-}
-
-wxPen& wxPen::operator = (const wxPen& pen)
-{
- if (*this == pen) return (*this);
- Ref(pen);
- return *this;
-}
-
bool wxPen::operator == (const wxPen& pen) const
{
return m_refData == pen.m_refData;
wxFont::wxFont(const wxNativeFontInfo& info)
{
- Init();
-
(void)Create(info.GetXFontName());
}
-void wxFont::Init()
-{
-}
-
bool wxFont::Create(int pointSize,
int family,
int style,
// wxBitmap creation
// ----------------------------------------------------------------------------
-// this function should be called from all wxBitmap ctors
-void wxBitmap::Init()
-{
- // m_refData = NULL; done in the base class ctor
-}
-
wxGDIImageRefData *wxBitmap::CreateData() const
{
return new wxBitmapRefData;
wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
{
- Init();
-
#ifndef __WXMICROWIN__
wxBitmapRefData *refData = new wxBitmapRefData;
m_refData = refData;
bool wxBitmap::CreateFromXpm(const char **data)
{
#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
- Init();
-
wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") )
wxXPMDecoder decoder;
wxBitmap::wxBitmap(int w, int h, int d)
{
- Init();
-
(void)Create(w, h, d);
}
wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
{
- Init();
-
(void)Create(w, h, dc);
}
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
{
- Init();
-
(void)Create(data, type, width, height, depth);
}
wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
{
- Init();
-
LoadFile(filename, (int)type);
}
// wxBrush house keeping stuff
// ----------------------------------------------------------------------------
-wxBrush& wxBrush::operator=(const wxBrush& brush)
-{
- if ( this != &brush )
- {
- Ref(brush);
- }
-
- return *this;
-}
-
bool wxBrush::operator==(const wxBrush& brush) const
{
const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData;
m_green = 0;
}
-wxColour::wxColour(const wxColour& col)
- :wxObject()
-{
- *this = col;
-}
-
-wxColour& wxColour::operator=(const wxColour& col)
-{
- m_red = col.m_red;
- m_green = col.m_green;
- m_blue = col.m_blue;
- m_isInit = col.m_isInit;
- m_pixel = col.m_pixel;
- return *this;
-}
-
void wxColour::InitFromName(const wxString& name)
{
if ( wxTheColourDatabase )
// wxFont
// ----------------------------------------------------------------------------
-void wxFont::Init()
-{
-}
-
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
{
UnRef();
// wxFont
// ----------------------------------------------------------------------------
-void wxFont::Init()
-{
-} // end of wxFont::Init
-
bool wxFont::Create( const wxNativeFontInfo& rInfo,
WXHFONT hFont )
{
// wxBrush house keeping stuff
// ----------------------------------------------------------------------------
-wxBrush& wxBrush::operator=(const wxBrush& brush)
-{
- return *this;
-}
-
bool wxBrush::operator==(const wxBrush& brush) const
{
return false;
// wxFont
// ----------------------------------------------------------------------------
-void wxFont::Init()
-{
-}
-
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
{
return false;
// wxUSE_NANOX
}
-wxBitmap::wxBitmap( const wxBitmap& bmp )
-{
- Ref( bmp );
-}
-
wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type )
{
LoadFile( filename, type );
{
}
-wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
-{
- if ( m_refData != bmp.m_refData )
- Ref( bmp );
-
- return *this;
-}
-
bool wxBitmap::operator == ( const wxBitmap& bmp ) const
{
return m_refData == bmp.m_refData;
wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") );
}
-
-wxCursor::wxCursor( const wxCursor &cursor )
-{
- Ref( cursor );
-}
-
#if wxUSE_IMAGE
wxCursor::wxCursor( const wxImage & image )
{
{
}
-wxCursor& wxCursor::operator = ( const wxCursor& cursor )
-{
- if (*this == cursor)
- return (*this);
-
- Ref( cursor );
-
- return *this;
-}
-
bool wxCursor::operator == ( const wxCursor& cursor ) const
{
return m_refData == cursor.m_refData;
// wxFont
// ----------------------------------------------------------------------------
-void wxFont::Init()
-{
-}
-
wxFont::wxFont(const wxNativeFontInfo& info)
{
- Init();
-
#if wxUSE_UNICODE
Create( info.GetPointSize(),
info.GetFamily(),
{
}
-wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap()
-{
- Ref(icon);
-}
-
-wxIcon& wxIcon::operator = ( const wxIcon& icon )
-{
- if (*this == icon) return (*this);
- Ref(icon);
- return *this;
-}
-
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
{
wxIcon *icon = (wxIcon*)(&bmp);