Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da6081f

Browse files
committed
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Completely untested.
1 parent fe3fe4a commit da6081f

18 files changed

Lines changed: 425 additions & 225 deletions

Mac/Modules/cg/_CGmodule.c

Lines changed: 76 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -699,20 +699,20 @@ static PyObject *CGContextRefObj_CGContextSetGrayStrokeColor(CGContextRefObject
699699
static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_self, PyObject *_args)
700700
{
701701
PyObject *_res = NULL;
702-
float r;
703-
float g;
704-
float b;
702+
float red;
703+
float green;
704+
float blue;
705705
float alpha;
706706
if (!PyArg_ParseTuple(_args, "ffff",
707-
&r,
708-
&g,
709-
&b,
707+
&red,
708+
&green,
709+
&blue,
710710
&alpha))
711711
return NULL;
712712
CGContextSetRGBFillColor(_self->ob_itself,
713-
r,
714-
g,
715-
b,
713+
red,
714+
green,
715+
blue,
716716
alpha);
717717
Py_INCREF(Py_None);
718718
_res = Py_None;
@@ -722,20 +722,20 @@ static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_s
722722
static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *_self, PyObject *_args)
723723
{
724724
PyObject *_res = NULL;
725-
float r;
726-
float g;
727-
float b;
725+
float red;
726+
float green;
727+
float blue;
728728
float alpha;
729729
if (!PyArg_ParseTuple(_args, "ffff",
730-
&r,
731-
&g,
732-
&b,
730+
&red,
731+
&green,
732+
&blue,
733733
&alpha))
734734
return NULL;
735735
CGContextSetRGBStrokeColor(_self->ob_itself,
736-
r,
737-
g,
738-
b,
736+
red,
737+
green,
738+
blue,
739739
alpha);
740740
Py_INCREF(Py_None);
741741
_res = Py_None;
@@ -745,23 +745,23 @@ static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *
745745
static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_self, PyObject *_args)
746746
{
747747
PyObject *_res = NULL;
748-
float c;
749-
float m;
750-
float y;
751-
float k;
748+
float cyan;
749+
float magenta;
750+
float yellow;
751+
float black;
752752
float alpha;
753753
if (!PyArg_ParseTuple(_args, "fffff",
754-
&c,
755-
&m,
756-
&y,
757-
&k,
754+
&cyan,
755+
&magenta,
756+
&yellow,
757+
&black,
758758
&alpha))
759759
return NULL;
760760
CGContextSetCMYKFillColor(_self->ob_itself,
761-
c,
762-
m,
763-
y,
764-
k,
761+
cyan,
762+
magenta,
763+
yellow,
764+
black,
765765
alpha);
766766
Py_INCREF(Py_None);
767767
_res = Py_None;
@@ -771,29 +771,55 @@ static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_
771771
static PyObject *CGContextRefObj_CGContextSetCMYKStrokeColor(CGContextRefObject *_self, PyObject *_args)
772772
{
773773
PyObject *_res = NULL;
774-
float c;
775-
float m;
776-
float y;
777-
float k;
774+
float cyan;
775+
float magenta;
776+
float yellow;
777+
float black;
778778
float alpha;
779779
if (!PyArg_ParseTuple(_args, "fffff",
780-
&c,
781-
&m,
782-
&y,
783-
&k,
780+
&cyan,
781+
&magenta,
782+
&yellow,
783+
&black,
784784
&alpha))
785785
return NULL;
786786
CGContextSetCMYKStrokeColor(_self->ob_itself,
787-
c,
788-
m,
789-
y,
790-
k,
787+
cyan,
788+
magenta,
789+
yellow,
790+
black,
791791
alpha);
792792
Py_INCREF(Py_None);
793793
_res = Py_None;
794794
return _res;
795795
}
796796

797+
static PyObject *CGContextRefObj_CGContextGetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
798+
{
799+
PyObject *_res = NULL;
800+
int _rv;
801+
if (!PyArg_ParseTuple(_args, ""))
802+
return NULL;
803+
_rv = CGContextGetInterpolationQuality(_self->ob_itself);
804+
_res = Py_BuildValue("i",
805+
_rv);
806+
return _res;
807+
}
808+
809+
static PyObject *CGContextRefObj_CGContextSetInterpolationQuality(CGContextRefObject *_self, PyObject *_args)
810+
{
811+
PyObject *_res = NULL;
812+
int quality;
813+
if (!PyArg_ParseTuple(_args, "i",
814+
&quality))
815+
return NULL;
816+
CGContextSetInterpolationQuality(_self->ob_itself,
817+
quality);
818+
Py_INCREF(Py_None);
819+
_res = Py_None;
820+
return _res;
821+
}
822+
797823
static PyObject *CGContextRefObj_CGContextSetCharacterSpacing(CGContextRefObject *_self, PyObject *_args)
798824
{
799825
PyObject *_res = NULL;
@@ -1107,13 +1133,17 @@ static PyMethodDef CGContextRefObj_methods[] = {
11071133
{"CGContextSetGrayStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetGrayStrokeColor, 1,
11081134
PyDoc_STR("(float gray, float alpha) -> None")},
11091135
{"CGContextSetRGBFillColor", (PyCFunction)CGContextRefObj_CGContextSetRGBFillColor, 1,
1110-
PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
1136+
PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
11111137
{"CGContextSetRGBStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetRGBStrokeColor, 1,
1112-
PyDoc_STR("(float r, float g, float b, float alpha) -> None")},
1138+
PyDoc_STR("(float red, float green, float blue, float alpha) -> None")},
11131139
{"CGContextSetCMYKFillColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKFillColor, 1,
1114-
PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
1140+
PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
11151141
{"CGContextSetCMYKStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKStrokeColor, 1,
1116-
PyDoc_STR("(float c, float m, float y, float k, float alpha) -> None")},
1142+
PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")},
1143+
{"CGContextGetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextGetInterpolationQuality, 1,
1144+
PyDoc_STR("() -> (int _rv)")},
1145+
{"CGContextSetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextSetInterpolationQuality, 1,
1146+
PyDoc_STR("(int quality) -> None")},
11171147
{"CGContextSetCharacterSpacing", (PyCFunction)CGContextRefObj_CGContextSetCharacterSpacing, 1,
11181148
PyDoc_STR("(float spacing) -> None")},
11191149
{"CGContextSetTextPosition", (PyCFunction)CGContextRefObj_CGContextSetTextPosition, 1,

Mac/Modules/cg/cgsupport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def mkvalueArgs(self, name):
114114
CGLineJoin = int
115115
CGTextDrawingMode = int
116116
CGPathDrawingMode = int
117+
CGInterpolationQuality = int
117118

118119
# The real objects
119120
CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")

0 commit comments

Comments
 (0)