if (proc != 0) { OS.QDRegionToRects(clipRgn, OS.kQDParseRegionFromTopLeft, proc, newRgn); callback.dispose(); }
if (proc == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); OS.QDRegionToRects(clipRgn, OS.kQDParseRegionFromTopLeft, proc, newRgn); callback.dispose();
public void setTransform(Transform transform) {	if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);	OS.CGContextConcatCTM(handle, data.inverseTransform);	if (transform != null) {		OS.CGContextConcatCTM(handle, transform.handle);		System.arraycopy(transform.handle, 0, data.transform, 0, data.transform.length);		System.arraycopy(transform.handle, 0, data.inverseTransform, 0, data.inverseTransform.length);		OS.CGAffineTransformInvert(data.inverseTransform, data.inverseTransform);	} else {		data.transform = new float[]{1, 0, 0, 1, 0, 0};		data.inverseTransform = new float[]{1, 0, 0, 1, 0, 0};	}	if (data.forePattern != 0) {		OS.CGPatternRelease(data.forePattern);		data.forePattern = data.foregroundPattern.createPattern(handle);		OS.CGContextSetStrokePattern(handle, data.forePattern, data.foreground);	}	if (data.backPattern != 0) {		OS.CGPatternRelease(data.backPattern);		data.backPattern = data.backgroundPattern.createPattern(handle);		OS.CGContextSetFillPattern(handle, data.backPattern, data.background);	}	//TODO - rounds off problems	int clipRgn = data.clipRgn;	if (clipRgn != 0) {		int newRgn = OS.NewRgn();		Callback callback = new Callback(this, "regionToRects", 4);		int proc = callback.getAddress();		if (proc != 0) {			OS.QDRegionToRects(clipRgn, OS.kQDParseRegionFromTopLeft, proc, newRgn);			callback.dispose();		}		OS.DisposeRgn(clipRgn);		data.clipRgn = newRgn;	}}