m_macRgn.reset( HIShapeCreateMutable() );
}
- wxRegionRefData(HIShapeRef hRegion)
+ wxRegionRefData(wxCFRef<HIShapeRef> ®ion)
{
- m_macRgn.reset( HIShapeCreateMutableCopy(hRegion) );
+ m_macRgn.reset( HIShapeCreateMutableCopy(region) );
}
wxRegionRefData(long x, long y, long w, long h)
wxRegion::wxRegion(WXHRGN hRegion )
{
- m_refData = new wxRegionRefData(hRegion);
+ wxCFRef< HIShapeRef > shape( (HIShapeRef) hRegion );
+ m_refData = new wxRegionRefData(shape);
}
wxRegion::wxRegion(long x, long y, long w, long h)
wxUnusedVar(n);
wxUnusedVar(points);
-#if 0 // ndef __LP64__
- m_refData = new wxRegionRefData;
+#ifndef __LP64__
// TODO : any APIs ?
// OS X somehow does not collect the region invisibly as before, so sometimes things
if ( x1 != x2 || y1 != y2 )
::LineTo( x1, y1 ) ;
- CloseRgn( M_REGION ) ;
-
+ RgnHandle tempRgn = NewRgn();
+ CloseRgn( tempRgn ) ;
+
::SetGWorld( oldWorld, oldGDHandle );
+ wxCFRef<HIShapeRef> tempShape( HIShapeCreateWithQDRgn(tempRgn ) );
+ m_refData = new wxRegionRefData(tempShape);
+ DisposeRgn( tempRgn );
+ }
+ else
+ {
+ m_refData = new wxRegionRefData;
}
#else
wxFAIL_MSG( "not implemented" );
// m_refData unrefed in ~wxObject
}
+wxGDIRefData *wxRegion::CreateGDIRefData() const
+{
+ return new wxRegionRefData;
+}
+
+wxGDIRefData *wxRegion::CloneGDIRefData(const wxGDIRefData *data) const
+{
+ return new wxRegionRefData(*wx_static_cast(const wxRegionRefData *, data));
+}
+
//-----------------------------------------------------------------------------
//# Modify region
//-----------------------------------------------------------------------------