+wxList *wxRegion::GetRectList() const
+{
+ return &(M_REGIONDATA->m_rects);
+}
+
+//-----------------------------------------------------------------------------
+// wxRegion
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator,wxObject);
+
+wxRegionIterator::wxRegionIterator(void)
+{
+ m_current = 0;
+}
+
+wxRegionIterator::wxRegionIterator( const wxRegion& region )
+{
+ m_region = region;
+ m_current = 0;
+}
+
+void wxRegionIterator::Reset( const wxRegion& region )
+{
+ m_region = region;
+ m_current = 0;
+}
+
+wxRegionIterator::operator bool (void) const
+{
+ return m_current < m_region.GetRectList()->Number();
+}
+
+bool wxRegionIterator::HaveRects(void) const
+{
+ return m_current < m_region.GetRectList()->Number();
+}
+
+void wxRegionIterator::operator ++ (void)
+{
+ if (m_current < m_region.GetRectList()->Number()) ++m_current;
+}
+
+void wxRegionIterator::operator ++ (int)
+{
+ if (m_current < m_region.GetRectList()->Number()) ++m_current;
+}
+
+long wxRegionIterator::GetX(void) const
+{
+ wxNode *node = m_region.GetRectList()->Nth( m_current );
+ if (!node) return 0;
+ wxRect *r = (wxRect*)node->Data();
+ return r->x;
+}
+
+long wxRegionIterator::GetY(void) const
+{
+ wxNode *node = m_region.GetRectList()->Nth( m_current );
+ if (!node) return 0;
+ wxRect *r = (wxRect*)node->Data();
+ return r->y;
+}
+
+long wxRegionIterator::GetW(void) const
+{
+ wxNode *node = m_region.GetRectList()->Nth( m_current );
+ if (!node) return 0;
+ wxRect *r = (wxRect*)node->Data();
+ return r->width;
+}
+
+long wxRegionIterator::GetH(void) const
+{
+ wxNode *node = m_region.GetRectList()->Nth( m_current );
+ if (!node) return 0;
+ wxRect *r = (wxRect*)node->Data();
+ return r->height;
+}
+
+