git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13989
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
GdkRegion *GetRegion() const;
protected:
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);
// common part of ctors for a rectangle region
void InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
GdkRegion *GetRegion() const;
protected:
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);
// common part of ctors for a rectangle region
void InitRect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
-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!") );
{
// if you use AllocExclusive() you must override this method
wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") );
+ // 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
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxRegion comparison
// ----------------------------------------------------------------------------
rect.y = y;
rect.width = width;
rect.height = height;
rect.y = y;
rect.width = width;
rect.height = height;
if (!m_refData)
{
m_refData = new wxRegionRefData();
if (!m_refData)
{
m_refData = new wxRegionRefData();
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
return Intersect( reg );
}
return Intersect( reg );
}
+ // 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
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxRegion comparison
// ----------------------------------------------------------------------------
rect.y = y;
rect.width = width;
rect.height = height;
rect.y = y;
rect.width = width;
rect.height = height;
if (!m_refData)
{
m_refData = new wxRegionRefData();
if (!m_refData)
{
m_refData = new wxRegionRefData();
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
return Intersect( reg );
}
return Intersect( reg );
}