Skip to content

Commit 38b504e

Browse files
committed
Added support for SyncCGContextOriginWithPort().
1 parent a5d78cc commit 38b504e

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

Mac/Modules/cg/CGStubLib

-270 Bytes
Binary file not shown.

Mac/Modules/cg/CGStubLib.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ CGContextRestoreGState
5656
CGContextSaveGState
5757
CGContextRelease
5858
CreateCGContextForPort
59+
SyncCGContextOriginWithPort

Mac/Modules/cg/_CGmodule.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,20 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject
11151115
return _res;
11161116
}
11171117

1118+
static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args)
1119+
{
1120+
PyObject *_res = NULL;
1121+
CGrafPtr port;
1122+
if (!PyArg_ParseTuple(_args, "O&",
1123+
GrafObj_Convert, &port))
1124+
return NULL;
1125+
SyncCGContextOriginWithPort(_self->ob_itself,
1126+
port);
1127+
Py_INCREF(Py_None);
1128+
_res = Py_None;
1129+
return _res;
1130+
}
1131+
11181132
static PyMethodDef CGContextRefObj_methods[] = {
11191133
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
11201134
"() -> None"},
@@ -1228,6 +1242,8 @@ static PyMethodDef CGContextRefObj_methods[] = {
12281242
"() -> None"},
12291243
{"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1,
12301244
"(int shouldAntialias) -> None"},
1245+
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
1246+
"(CGrafPtr port) -> None"},
12311247
{NULL, NULL, 0}
12321248
};
12331249

Mac/Modules/cg/cgsupport.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from macsupport import *
1919

20+
CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
2021

2122
# Create the type objects
2223

@@ -275,6 +276,13 @@ def outputCleanupStructMembers(self):
275276
# ADD _methods initializer here
276277
execfile(INPUTFILE)
277278

279+
# manual method, lives in Quickdraw.h
280+
f = Method(void, 'SyncCGContextOriginWithPort',
281+
(CGContextRef, 'ctx', InMode),
282+
(CGrafPtr, 'port', InMode),
283+
)
284+
CGContextRef_methods.append(f)
285+
278286
CreateCGContextForPort_body = """\
279287
GrafPtr port;
280288
CGContextRef ctx;

0 commit comments

Comments
 (0)