[Python-checkins] CVS: python/dist/src/Mac/Modules/cg _CGmodule.c,1.3,1.3.4.1
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 06 Mar 2002 13:59:47 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/cg
In directory usw-pr-cvs1:/tmp/cvs-serv23624/Python 2.2/Mac/Modules/cg
Modified Files:
Tag: release22-maint
_CGmodule.c
Log Message:
Backport of 1.4 and 1.5:
Added support for SyncCGContextOriginWithPort
Added ClipCGContextToRegion
Index: _CGmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cg/_CGmodule.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** _CGmodule.c 18 Dec 2001 15:38:24 -0000 1.3
--- _CGmodule.c 6 Mar 2002 21:59:45 -0000 1.3.4.1
***************
*** 1116,1119 ****
--- 1116,1150 ----
}
+ 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 PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ Rect portRect;
+ RgnHandle region;
+ if (!PyArg_ParseTuple(_args, "O&O&",
+ PyMac_GetRect, &portRect,
+ ResObj_Convert, ®ion))
+ return NULL;
+ ClipCGContextToRegion(_self->ob_itself,
+ &portRect,
+ region);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
static PyMethodDef CGContextRefObj_methods[] = {
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
***************
*** 1229,1232 ****
--- 1260,1267 ----
{"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1,
"(int shouldAntialias) -> None"},
+ {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
+ "(CGrafPtr port) -> None"},
+ {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1,
+ "(Rect portRect, RgnHandle region) -> None"},
{NULL, NULL, 0}
};