diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2005-07-03 20:59:44 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2005-07-03 20:59:44 (GMT) |
commit | 918a9e2f63a037de2a32e2b009944a0e5c693742 (patch) | |
tree | 951482c937428033e9ba8ce37bf6678503b3c163 /Mac/Modules/cg | |
parent | a6af76cbe4e5b188ccdba0b628f9d75771c623c1 (diff) | |
download | cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.zip cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.gz cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.bz2 |
Updated (and regenerated) for name change in tp_init method arguments:
they are now _self, _args and _kwds.
Diffstat (limited to 'Mac/Modules/cg')
-rwxr-xr-x | Mac/Modules/cg/_CGmodule.c | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c index 378bfa4..8115614 100755 --- a/Mac/Modules/cg/_CGmodule.c +++ b/Mac/Modules/cg/_CGmodule.c @@ -26,67 +26,67 @@ extern int GrafObj_Convert(PyObject *, GrafPtr *); PyObject *CGPoint_New(CGPoint *itself) { - return Py_BuildValue("(ff)", - itself->x, - itself->y); + return Py_BuildValue("(ff)", + itself->x, + itself->y); } int CGPoint_Convert(PyObject *v, CGPoint *p_itself) { - if( !PyArg_Parse(v, "(ff)", - &p_itself->x, - &p_itself->y) ) - return 0; - return 1; + if( !PyArg_Parse(v, "(ff)", + &p_itself->x, + &p_itself->y) ) + return 0; + return 1; } PyObject *CGRect_New(CGRect *itself) { - return Py_BuildValue("(ffff)", - itself->origin.x, - itself->origin.y, - itself->size.width, - itself->size.height); + return Py_BuildValue("(ffff)", + itself->origin.x, + itself->origin.y, + itself->size.width, + itself->size.height); } int CGRect_Convert(PyObject *v, CGRect *p_itself) { - if( !PyArg_Parse(v, "(ffff)", - &p_itself->origin.x, - &p_itself->origin.y, - &p_itself->size.width, - &p_itself->size.height) ) - return 0; - return 1; + if( !PyArg_Parse(v, "(ffff)", + &p_itself->origin.x, + &p_itself->origin.y, + &p_itself->size.width, + &p_itself->size.height) ) + return 0; + return 1; } PyObject *CGAffineTransform_New(CGAffineTransform *itself) { - return Py_BuildValue("(ffffff)", - itself->a, - itself->b, - itself->c, - itself->d, - itself->tx, - itself->ty); + return Py_BuildValue("(ffffff)", + itself->a, + itself->b, + itself->c, + itself->d, + itself->tx, + itself->ty); } int CGAffineTransform_Convert(PyObject *v, CGAffineTransform *p_itself) { - if( !PyArg_Parse(v, "(ffffff)", - &p_itself->a, - &p_itself->b, - &p_itself->c, - &p_itself->d, - &p_itself->tx, - &p_itself->ty) ) - return 0; - return 1; + if( !PyArg_Parse(v, "(ffffff)", + &p_itself->a, + &p_itself->b, + &p_itself->c, + &p_itself->d, + &p_itself->tx, + &p_itself->ty) ) + return 0; + return 1; } static PyObject *CG_Error; @@ -110,6 +110,7 @@ PyObject *CGContextRefObj_New(CGContextRef itself) it->ob_itself = itself; return (PyObject *)it; } + int CGContextRefObj_Convert(PyObject *v, CGContextRef *p_itself) { if (!CGContextRefObj_Check(v)) @@ -1191,16 +1192,16 @@ static PyMethodDef CGContextRefObj_methods[] = { #define CGContextRefObj_tp_alloc PyType_GenericAlloc -static PyObject *CGContextRefObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +static PyObject *CGContextRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds) { - PyObject *self; + PyObject *_self; CGContextRef itself; char *kw[] = {"itself", 0}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, CGContextRefObj_Convert, &itself)) return NULL; - if ((self = type->tp_alloc(type, 0)) == NULL) return NULL; - ((CGContextRefObject *)self)->ob_itself = itself; - return self; + if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CGContextRefObj_Convert, &itself)) return NULL; + if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL; + ((CGContextRefObject *)_self)->ob_itself = itself; + return _self; } #define CGContextRefObj_tp_free PyObject_Del @@ -1261,11 +1262,11 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) OSStatus _err; if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) - return NULL; + return NULL; _err = CreateCGContextForPort(port, &ctx); if (_err != noErr) - if (_err != noErr) return PyMac_Error(_err); + if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", CGContextRefObj_New, ctx); return _res; |