-wxCoord wxRegionIterator::GetX() const
-{
- wxNode *node = m_region.GetRectList()->Nth( m_current );
- if (!node) return 0;
- wxRect *r = (wxRect*)node->Data();
- return r->x;
-}
-
-wxCoord wxRegionIterator::GetY() const
-{
- wxNode *node = m_region.GetRectList()->Nth( m_current );
- if (!node) return 0;
- wxRect *r = (wxRect*)node->Data();
- return r->y;
-}
-
-wxCoord wxRegionIterator::GetW() const
-{
- wxNode *node = m_region.GetRectList()->Nth( m_current );
- if (!node) return 0;
- wxRect *r = (wxRect*)node->Data();
- return r->width;
-}
-
-wxCoord wxRegionIterator::GetH() const
-{
- wxNode *node = m_region.GetRectList()->Nth( m_current );
- if (!node) return 0;
- wxRect *r = (wxRect*)node->Data();
- return r->height;
-}
-
-#else
-
-// the following structures must match the private structures
-// in X11 region code ( xc/lib/X11/region.h )
-
-// this makes the Region type transparent
-// and we have access to the region rectangles
-
-struct _XBox {
- short x1, x2, y1, y2;
-};
-
-struct _XRegion {
- long size , numRects;
- _XBox *rects, extents;
-};
-
-class wxRIRefData: public wxObjectRefData
-{
-public:
-
- wxRIRefData() : m_rects(0), m_numRects(0){}
- ~wxRIRefData();
-
- wxRect *m_rects;
- size_t m_numRects;
-
- void CreateRects( const wxRegion& r );
-};
-
-wxRIRefData::~wxRIRefData()
-{
- delete m_rects;
-}
-
-#include <gdk/gdkprivate.h>
-
-void wxRIRefData::CreateRects( const wxRegion& region )
-{
- if( m_rects )
- delete m_rects;
- m_rects = 0;
- m_numRects= 0;
- GdkRegion *gdkregion= region.GetRegion();
- if( gdkregion ){
- Region r= ((GdkRegionPrivate *)gdkregion)->xregion;
- if( r ){
- m_numRects= r->numRects;
- if( m_numRects )
- {
- m_rects= new wxRect[m_numRects];
- for( size_t i=0; i<m_numRects; ++i )