summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cg
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-12-03 23:20:13 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-12-03 23:20:13 (GMT)
commitda6081fccb71541004e3f36f57a9c0971a969e3b (patch)
tree1e2beac551e87964061e6fd9bfca22b35f1c7f2a /Mac/Modules/cg
parentfe3fe4adb5c7a72bfec3c5b7b8ec5e42d8ccc625 (diff)
downloadcpython-da6081fccb71541004e3f36f57a9c0971a969e3b.zip
cpython-da6081fccb71541004e3f36f57a9c0971a969e3b.tar.gz
cpython-da6081fccb71541004e3f36f57a9c0971a969e3b.tar.bz2
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Completely untested.
Diffstat (limited to 'Mac/Modules/cg')
-rwxr-xr-xMac/Modules/cg/_CGmodule.c122
-rwxr-xr-xMac/Modules/cg/cgsupport.py1
2 files changed, 77 insertions, 46 deletions
diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c
index 0889766..378bfa4 100755
--- a/Mac/Modules/cg/_CGmodule.c
+++ b/Mac/Modules/cg/_CGmodule.c
@@ -699,20 +699,20 @@ static PyObject *CGContextRefObj_CGContextSetGrayStrokeColor(CGContextRefObject
static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
- float r;
- float g;
- float b;
+ float red;
+ float green;
+ float blue;
float alpha;
if (!PyArg_ParseTuple(_args, "ffff",
- &r,
- &g,
- &b,
+ &red,
+ &green,
+ &blue,
&alpha))
return NULL;
CGContextSetRGBFillColor(_self->ob_itself,
- r,
- g,
- b,
+ red,
+ green,
+ blue,
alpha);
Py_INCREF(Py_None);
_res = Py_None;
@@ -722,20 +722,20 @@ static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_s
static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
- float r;
- float g;
- float b;
+ float red;
+ float green;
+ float blue;
float alpha;
if (!PyArg_ParseTuple(_args, "ffff",
- &r,
- &g,
- &b,
+ &red,
+ &green,
+ &blue,
&alpha))
return NULL;
CGContextSetRGBStrokeColor(_self->ob_itself,
- r,
- g,
- b,
+ red,
+ green,
+ blue,
alpha);
Py_INCREF(Py_None);
_res = Py_None;
@@ -745,23 +745,23 @@ static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *
static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
- float c;
- float m;
- float y;
- float k;
+ float cyan;
+ float magenta;
+ float yellow;
+ float black;
float alpha;
if (!PyArg_ParseTuple(_args, "fffff",
- &c,
- &m,
- &y,
- &k,
+ &cyan,
+ &magenta,
+ &yellow,
+ &black,
&alpha))
return NULL;
CGContextSetCMYKFillColor(_self->ob_itself,
- c,
- m,
- y,
- k,
+ cyan,
+ magenta,
+ yellow,
+ black,
alpha);
Py_INCREF(Py_None);
_res = Py_None;
@@ -771,29 +771,55 @@ static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_
static PyObject *CGContextRefObj_CGContextSetCMYKStrokeColor(CGContextRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
- float c;
- float m;
- float y;
- float k;
+ float cyan;
+ float magenta;
+ float yellow;
+ float black;
float alpha;
if (!PyArg_ParseTuple(_args, "fffff",
- &c,
- &m,
- &y,
- &k,
+ &cyan,
+ &magenta,
+ &yellow,
+ &black,
&alpha))
return NULL;
CGContextSetCMYKStrokeColor(_self->ob_itself,
- c,
- m,
- y,
- k,
+ cyan,
+ magenta,
+ yellow,
+ black,
alpha);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
+static PyObject *CGContextRefObj_CGContextGetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
+{
+ PyObject *_res = NULL;
+ int _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = CGContextGetInterpolationQuality(_self->ob_itself);
+ _res = Py_BuildValue("i",
+ _rv);
+ return _res;
+}
+
+static PyObject *CGContextRefObj_CGContextSetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
+{
+ PyObject *_res = NULL;
+ int quality;
+ if (!PyArg_ParseTuple(_args, "i",
+ &quality))
+ return NULL;
+ CGContextSetInterpolationQuality(_self->ob_itself,
+ quality);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyObject *CGContextRefObj_CGContextSetCharacterSpacing(CGContextRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1107,13 +1133,17 @@ static PyMethodDef CGContextRefObj_methods[] = {
{"CGContextSetGrayStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetGrayStrokeColor, 1,
PyDoc_STR("(float gray, float alpha) -> None")},
{"CGContextSetRGBFillColor", (PyCFunction)CGContextRefObj_CGContextSetRGBFillColor, 1,
- PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
+ PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
{"CGContextSetRGBStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetRGBStrokeColor, 1,
- PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
+ PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
{"CGContextSetCMYKFillColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKFillColor, 1,
- PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
+ PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
{"CGContextSetCMYKStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKStrokeColor, 1,
- PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
+ PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
+ {"CGContextGetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextGetInterpolationQuality, 1,
+ PyDoc_STR("() -> (int _rv)")},
+ {"CGContextSetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextSetInterpolationQuality, 1,
+ PyDoc_STR("(int quality) -> None")},
{"CGContextSetCharacterSpacing", (PyCFunction)CGContextRefObj_CGContextSetCharacterSpacing, 1,
PyDoc_STR("(float spacing) -> None")},
{"CGContextSetTextPosition", (PyCFunction)CGContextRefObj_CGContextSetTextPosition, 1,
diff --git a/Mac/Modules/cg/cgsupport.py b/Mac/Modules/cg/cgsupport.py
index 1b667c0..7dc2d54 100755
--- a/Mac/Modules/cg/cgsupport.py
+++ b/Mac/Modules/cg/cgsupport.py
@@ -114,6 +114,7 @@ CGLineCap = int
CGLineJoin = int
CGTextDrawingMode = int
CGPathDrawingMode = int
+CGInterpolationQuality = int
# The real objects
CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")