summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cg/_CGmodule.c
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2002-03-04 10:31:32 (GMT)
committerJust van Rossum <just@letterror.com>2002-03-04 10:31:32 (GMT)
commitdd989e1ce795dac837b51e40883dbd6f38dd9dd8 (patch)
treeceaae069c5b4b72d9e31da293b4fd7ffaa640e05 /Mac/Modules/cg/_CGmodule.c
parentaa158be6233d8df6d87bf6e20f59e62ef2114a44 (diff)
downloadcpython-dd989e1ce795dac837b51e40883dbd6f38dd9dd8.zip
cpython-dd989e1ce795dac837b51e40883dbd6f38dd9dd8.tar.gz
cpython-dd989e1ce795dac837b51e40883dbd6f38dd9dd8.tar.bz2
Added ClipCGContextToRegion() from Quickdraw.h.
Diffstat (limited to 'Mac/Modules/cg/_CGmodule.c')
-rwxr-xr-xMac/Modules/cg/_CGmodule.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c
index aaa5389..9849cf7 100755
--- a/Mac/Modules/cg/_CGmodule.c
+++ b/Mac/Modules/cg/_CGmodule.c
@@ -1129,6 +1129,23 @@ static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject
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, &region))
+ 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,
"() -> None"},
@@ -1244,6 +1261,8 @@ static PyMethodDef CGContextRefObj_methods[] = {
"(int shouldAntialias) -> None"},
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
"(CGrafPtr port) -> None"},
+ {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1,
+ "(Rect portRect, RgnHandle region) -> None"},
{NULL, NULL, 0}
};