diff --git a/Mac/Modules/cg/CGStubLib b/Mac/Modules/cg/CGStubLib index 74de90927ee..8b374a1c21a 100755 Binary files a/Mac/Modules/cg/CGStubLib and b/Mac/Modules/cg/CGStubLib differ diff --git a/Mac/Modules/cg/CGStubLib.exp b/Mac/Modules/cg/CGStubLib.exp index 4b034b58119..9f4e592c502 100755 --- a/Mac/Modules/cg/CGStubLib.exp +++ b/Mac/Modules/cg/CGStubLib.exp @@ -56,3 +56,4 @@ CGContextRestoreGState CGContextSaveGState CGContextRelease CreateCGContextForPort +SyncCGContextOriginWithPort diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c index 3bcb2602583..aaa53899a72 100755 --- a/Mac/Modules/cg/_CGmodule.c +++ b/Mac/Modules/cg/_CGmodule.c @@ -1115,6 +1115,20 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject return _res; } +static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) +{ + PyObject *_res = NULL; + CGrafPtr port; + if (!PyArg_ParseTuple(_args, "O&", + GrafObj_Convert, &port)) + return NULL; + SyncCGContextOriginWithPort(_self->ob_itself, + port); + Py_INCREF(Py_None); + _res = Py_None; + return _res; +} + static PyMethodDef CGContextRefObj_methods[] = { {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, "() -> None"}, @@ -1228,6 +1242,8 @@ static PyMethodDef CGContextRefObj_methods[] = { "() -> None"}, {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, "(int shouldAntialias) -> None"}, + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + "(CGrafPtr port) -> None"}, {NULL, NULL, 0} }; diff --git a/Mac/Modules/cg/cgsupport.py b/Mac/Modules/cg/cgsupport.py index e0931e54761..c9255eef29b 100755 --- a/Mac/Modules/cg/cgsupport.py +++ b/Mac/Modules/cg/cgsupport.py @@ -17,6 +17,7 @@ from macsupport import * +CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj") # Create the type objects @@ -275,6 +276,13 @@ def outputCleanupStructMembers(self): # ADD _methods initializer here execfile(INPUTFILE) +# manual method, lives in Quickdraw.h +f = Method(void, 'SyncCGContextOriginWithPort', + (CGContextRef, 'ctx', InMode), + (CGrafPtr, 'port', InMode), +) +CGContextRef_methods.append(f) + CreateCGContextForPort_body = """\ GrafPtr port; CGContextRef ctx;