// wxRegionRefData
// ========================================================================
-class wxRegionRefData : public wxObjectRefData,
+class wxRegionRefData : public wxGDIRefData,
public REGION
{
public:
wxRegionRefData()
- : wxObjectRefData(),
+ : wxGDIRefData(),
REGION()
{
size = 1;
}
wxRegionRefData(const wxPoint& topLeft, const wxPoint& bottomRight)
- : wxObjectRefData(),
+ : wxGDIRefData(),
REGION()
{
rects = (BOX*)malloc(sizeof(BOX));
}
wxRegionRefData(const wxRect& rect)
- : wxObjectRefData(),
+ : wxGDIRefData(),
REGION(rect)
{
rects = (BOX*)malloc(sizeof(BOX));
}
wxRegionRefData(const wxRegionRefData& refData)
- : wxObjectRefData(),
+ : wxGDIRefData(),
REGION()
{
size = refData.size;
void wxRegionGeneric::Clear()
{
UnRef();
+ if (!m_refData)
+ m_refData = new wxRegionRefData(wxRect(0,0,0,0));
}
-wxObjectRefData *wxRegionGeneric::CreateRefData() const
+wxGDIRefData *wxRegionGeneric::CreateGDIRefData() const
{
return new wxRegionRefData;
}
-wxObjectRefData *wxRegionGeneric::CloneRefData(const wxObjectRefData *data) const
+wxGDIRefData *wxRegionGeneric::CloneGDIRefData(const wxGDIRefData *data) const
{
return new wxRegionRefData(*(wxRegionRefData *)data);
}
return REGION::XUnionRegion(®ion,M_REGIONDATA,M_REGIONDATA);
}
-bool wxRegionGeneric::DoUnionWithRegion(const wxRegionGeneric& region)
+bool wxRegionGeneric::DoUnionWithRegion(const wxRegion& region)
{
AllocExclusive();
return REGION::XUnionRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA);
}
-bool wxRegionGeneric::DoIntersect(const wxRegionGeneric& region)
+bool wxRegionGeneric::DoIntersect(const wxRegion& region)
{
AllocExclusive();
return REGION::XIntersectRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA);
}
-bool wxRegionGeneric::DoSubtract(const wxRegionGeneric& region)
+bool wxRegionGeneric::DoSubtract(const wxRegion& region)
{
if ( region.IsEmpty() )
{
return REGION::XSubtractRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA);
}
-bool wxRegionGeneric::DoXor(const wxRegionGeneric& region)
+bool wxRegionGeneric::DoXor(const wxRegion& region)
{
AllocExclusive();
return REGION::XXorRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA);
}
// Does the region contain the point (x,y)?
-wxRegionContain wxRegionGeneric::DoContainsPoint(long x, long y) const
+wxRegionContain wxRegionGeneric::DoContainsPoint(wxCoord x, wxCoord y) const
{
wxASSERT(m_refData);
return REGION::XPointInRegion(M_REGIONDATA,x,y) ? wxInRegion : wxOutRegion;