]> git.saurik.com Git - wxWidgets.git/commitdiff
Ref counting fixes and compile fixes.
authorRobert Roebling <robert@roebling.de>
Mon, 4 Feb 2002 10:42:16 +0000 (10:42 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 4 Feb 2002 10:42:16 +0000 (10:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/region.h
include/wx/gtk1/region.h
src/common/object.cpp
src/gtk/region.cpp
src/gtk1/region.cpp

index d98a1f9cff1d3fa3a20e2c806f260059012b1c1b..63d7f35896f32d307ba63f5921bcd90f01abd16e 100644 (file)
@@ -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);
 
index d98a1f9cff1d3fa3a20e2c806f260059012b1c1b..63d7f35896f32d307ba63f5921bcd90f01abd16e 100644 (file)
@@ -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);
 
index 96f54f4277e4f2b8edc3b894b1d7cc66e2dfec8a..1fe178f04f95efbd4d6b588647fbd164a4e47fbf 100644 (file)
@@ -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!") );
index b446807937899ed6efd924a37fbbe4d61ba93884..c0a7af603f35e8866d854b50de9faefe32fabb84 100644 (file)
@@ -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 );
 }
 
index b446807937899ed6efd924a37fbbe4d61ba93884..c0a7af603f35e8866d854b50de9faefe32fabb84 100644 (file)
@@ -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 );
 }