git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4920
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegionRefData: public wxObjectRefData
{
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegionRefData: public wxObjectRefData
{
wxRegionRefData();
~wxRegionRefData();
wxRegionRefData();
~wxRegionRefData();
GdkRegion *m_region;
wxList m_rects;
};
GdkRegion *m_region;
wxList m_rects;
};
- wxNode *node = GetRectList()->First();
- while (node)
- {
- wxRect *r = (wxRect*)node->Data();
- if (node == GetRectList()->First())
- {
- x = r->x;
- y = r->y;
- w = r->width;
- h = r->height;
- }
- else
- {
- if (r->x < x)
- {
- x = r->x;
- w += x - r->x;
- }
- if (r->y < y)
- {
- y = r->y;
- h += y - r->y;
- }
- if (r->width+r->x > x+w)
- {
- w = r->x + r->width - x;
- }
- if (r->height+r->y > y+h)
- {
- h = r->y + r->height - y;
- }
- }
- node = node->Next();
- }
+ GdkRectangle rect;
+ gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
+ x = rect.x;
+ y = rect.y;
+ w = rect.width;
+ h = rect.height;
}
wxRect wxRegion::GetBox() const
}
wxRect wxRegion::GetBox() const
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegionRefData: public wxObjectRefData
{
//-----------------------------------------------------------------------------
// wxRegion
//-----------------------------------------------------------------------------
class wxRegionRefData: public wxObjectRefData
{
wxRegionRefData();
~wxRegionRefData();
wxRegionRefData();
~wxRegionRefData();
GdkRegion *m_region;
wxList m_rects;
};
GdkRegion *m_region;
wxList m_rects;
};
- wxNode *node = GetRectList()->First();
- while (node)
- {
- wxRect *r = (wxRect*)node->Data();
- if (node == GetRectList()->First())
- {
- x = r->x;
- y = r->y;
- w = r->width;
- h = r->height;
- }
- else
- {
- if (r->x < x)
- {
- x = r->x;
- w += x - r->x;
- }
- if (r->y < y)
- {
- y = r->y;
- h += y - r->y;
- }
- if (r->width+r->x > x+w)
- {
- w = r->x + r->width - x;
- }
- if (r->height+r->y > y+h)
- {
- h = r->y + r->height - y;
- }
- }
- node = node->Next();
- }
+ GdkRectangle rect;
+ gdk_region_get_clipbox( M_REGIONDATA->m_region, &rect );
+ x = rect.x;
+ y = rect.y;
+ w = rect.width;
+ h = rect.height;
}
wxRect wxRegion::GetBox() const
}
wxRect wxRegion::GetBox() const