Ref counting fixes and compile fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
45e0dc9477
commit
e0f0b19775
@ -115,6 +115,10 @@ public:
|
||||
GdkRegion *GetRegion() const;
|
||||
|
||||
protected:
|
||||
// ref counting code
|
||||
virtual wxObjectRefData *CreateRefData() const;
|
||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||
|
||||
// common part of ctors for a rectangle region
|
||||
void InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
|
||||
|
||||
|
@ -115,6 +115,10 @@ public:
|
||||
GdkRegion *GetRegion() const;
|
||||
|
||||
protected:
|
||||
// ref counting code
|
||||
virtual wxObjectRefData *CreateRefData() const;
|
||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||
|
||||
// common part of ctors for a rectangle region
|
||||
void InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
|
||||
|
||||
|
@ -282,7 +282,7 @@ wxObjectRefData *wxObject::CreateRefData() const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxObject::CloneRefData(wxObjectRefData * WXUNUSED(data)) const
|
||||
wxObjectRefData *wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const
|
||||
{
|
||||
// if you use AllocExclusive() you must override this method
|
||||
wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") );
|
||||
|
@ -168,8 +168,18 @@ wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle )
|
||||
|
||||
wxRegion::~wxRegion()
|
||||
{
|
||||
// m_refData unrefed in ~wxObject
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CreateRefData() const
|
||||
{
|
||||
return new wxRegionRefData;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
|
||||
{
|
||||
return new wxRegionRefData(*(wxRegionRefData *)data);
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion comparison
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -202,6 +212,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
rect.y = y;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
|
||||
if (!m_refData)
|
||||
{
|
||||
m_refData = new wxRegionRefData();
|
||||
@ -277,6 +288,7 @@ bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
bool wxRegion::Intersect( const wxRect& rect )
|
||||
{
|
||||
wxRegion reg( rect );
|
||||
|
||||
return Intersect( reg );
|
||||
}
|
||||
|
||||
|
@ -168,8 +168,18 @@ wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle )
|
||||
|
||||
wxRegion::~wxRegion()
|
||||
{
|
||||
// m_refData unrefed in ~wxObject
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CreateRefData() const
|
||||
{
|
||||
return new wxRegionRefData;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
|
||||
{
|
||||
return new wxRegionRefData(*(wxRegionRefData *)data);
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion comparison
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -202,6 +212,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
rect.y = y;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
|
||||
if (!m_refData)
|
||||
{
|
||||
m_refData = new wxRegionRefData();
|
||||
@ -277,6 +288,7 @@ bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
bool wxRegion::Intersect( const wxRect& rect )
|
||||
{
|
||||
wxRegion reg( rect );
|
||||
|
||||
return Intersect( reg );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user