mirror of https://github.com/python/cpython.git
Added ClipCGContextToRegion() from Quickdraw.h.
This commit is contained in:
parent
aa158be623
commit
dd989e1ce7
Binary file not shown.
|
@ -57,3 +57,4 @@ CGContextSaveGState
|
||||||
CGContextRelease
|
CGContextRelease
|
||||||
CreateCGContextForPort
|
CreateCGContextForPort
|
||||||
SyncCGContextOriginWithPort
|
SyncCGContextOriginWithPort
|
||||||
|
ClipCGContextToRegion
|
||||||
|
|
|
@ -1129,6 +1129,23 @@ static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject
|
||||||
return _res;
|
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[] = {
|
static PyMethodDef CGContextRefObj_methods[] = {
|
||||||
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
|
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
|
||||||
"() -> None"},
|
"() -> None"},
|
||||||
|
@ -1244,6 +1261,8 @@ static PyMethodDef CGContextRefObj_methods[] = {
|
||||||
"(int shouldAntialias) -> None"},
|
"(int shouldAntialias) -> None"},
|
||||||
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
|
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
|
||||||
"(CGrafPtr port) -> None"},
|
"(CGrafPtr port) -> None"},
|
||||||
|
{"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1,
|
||||||
|
"(Rect portRect, RgnHandle region) -> None"},
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
from macsupport import *
|
from macsupport import *
|
||||||
|
|
||||||
CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
|
CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
|
||||||
|
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
|
||||||
|
|
||||||
# Create the type objects
|
# Create the type objects
|
||||||
|
|
||||||
|
@ -283,6 +284,15 @@ def outputCleanupStructMembers(self):
|
||||||
)
|
)
|
||||||
CGContextRef_methods.append(f)
|
CGContextRef_methods.append(f)
|
||||||
|
|
||||||
|
# manual method, lives in Quickdraw.h
|
||||||
|
f = Method(void, 'ClipCGContextToRegion',
|
||||||
|
(CGContextRef, 'ctx', InMode),
|
||||||
|
(Rect, 'portRect', InMode),
|
||||||
|
(RgnHandle, 'region', InMode),
|
||||||
|
)
|
||||||
|
CGContextRef_methods.append(f)
|
||||||
|
|
||||||
|
|
||||||
CreateCGContextForPort_body = """\
|
CreateCGContextForPort_body = """\
|
||||||
GrafPtr port;
|
GrafPtr port;
|
||||||
CGContextRef ctx;
|
CGContextRef ctx;
|
||||||
|
|
Loading…
Reference in New Issue