+ HIShapeRef shape = HIShapeCreateWithQDRgn( (RgnHandle) region.GetWXHRGN() );
+ HIShapeReplacePathInCGContext( shape, m_cgContext );
+ CGContextClip( m_cgContext );
+ CFRelease( shape );
+}
+
+// clips drawings to the rect
+void wxMacCoreGraphicsContext::Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h )
+{
+ HIRect r = CGRectMake( x , y , w , h );
+ CGContextClipToRect( m_cgContext, r );
+}
+
+ // resets the clipping to original extent
+void wxMacCoreGraphicsContext::ResetClip()
+{
+ CGContextRestoreGState( m_cgContext );
+ CGContextSaveGState( m_cgContext );