From 38b504e9e3ef3049815779e8c18b62f690ec4ed2 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Sat, 2 Mar 2002 10:20:44 +0000 Subject: [PATCH] Added support for SyncCGContextOriginWithPort(). --- Mac/Modules/cg/CGStubLib | Bin 3014 -> 2744 bytes Mac/Modules/cg/CGStubLib.exp | 1 + Mac/Modules/cg/_CGmodule.c | 16 ++++++++++++++++ Mac/Modules/cg/cgsupport.py | 8 ++++++++ 4 files changed, 25 insertions(+) diff --git a/Mac/Modules/cg/CGStubLib b/Mac/Modules/cg/CGStubLib index 74de90927ee50226baa5e058d5359c5b4be42177..8b374a1c21a74d15a6f1ba4ce773809321ed72b1 100755 GIT binary patch literal 2744 zcmd^>%WoS+9LInA2qcIQ$99ZUTU8Mhg_cGN%Ao}Wb+$=F8e?M{Qq)5_vB&YkX2;Bq zlZKaiD5}H(=&6@VTo53EgaktB1r-T_Ku8Ex0z@PbAh>WUARY&x{Kn3VckSdaV5RYX z_WOIxZyq~d7)Sw_(0|z|4Pjfrwh!A4*dD_sbpx9ZF!(;+F?MJYrRM|DTFDp7`=oKV zYk_Uv(xmlzbE8>BALG)ik31Fe-44EnS44-w6?`t*J;{|{?>!pZemV>=Fo0N<(v?}H>DkKRRdW@3|*I&)E8r3GL6^UqQp-jc1>(d47 zq*rrDQ%m!-owCRRSGcU}ih4U;i*xGtmP+L)T3#*Z3zv8<33R&hreAGv=DSaJOPljr zLAS11zg8rxT`Sfp$5;+WY!{U$g1e`?xjUuqto986^EwT}NmWo@ZjvfaSU8iDfAn}+ zaP~NLn8$dpY0mY$K0|4KW|t7O>=-f6$>uI0($pX0cy6=8O1SX4qS=BJ^<&QiB|PHY z=}k&Yu4pW|weXf`k2m5jD~Jf4_{dJ0El973)F*6jml@XbYdF(0th;Ov1Tu7XttmG3 zAab=@j#n!z`U-T^uv4To$72DFlz{;cwMflr@pZaGvfXs~Ui7->S$~Qdy6XCo4slcE zyk>*w8s+Zwi129;dIzY;ySVEX-8HwnjO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&gA0wsI&3VilNv=#%!C6)pZtg1ccS0$iaQy;_C z6C2cq&M}?v8ojNKw|Gq}kLZ0_2?K5dI{jRrJTdT2XAj_mp_eu&ap?erjA3{KYl!); zD~{pr3ZNg8H6*w{9FN}tT}{L;F+3s$38>eCF>D#CUOdyiF_&~DWt4%WNpIZ|+Dlp~ zrI2e zc-&&W-4fdFLG1$~DR!b0olAN+khGOaTHhi~&I-MuWWZk18kh9-M$#6XX@X(s_mW|L zl{AkeJrv%~&ib9GP0~@m{UU|fT+*CLT2&=|EmC_*p?@bC!}pTD?l_>GbOxW!G9m@@ zDIcWStyIR9@;Pk%v~;!rk2-h_h$n>x2T6~fJi`ol*e<5+0xVhuz!g7gA7(>FY*f0z zotJ9`E#gM`fX^c+G?*z`*~5hrcZ15uq3dJi!7C#s8ILQ|R!m=1W+beF&ax) O^?1a>>J9HV@5q0byy{l~ 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;