Mercurial > cpython-lru_cache-weakref
annotate Mac/Modules/cg/_CGmodule.c @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | c34e34057714 |
| children | fd25030223b0 |
| rev | line source |
|---|---|
| 21386 | 1 |
| 2 /* =========================== Module _CG =========================== */ | |
| 3 | |
| 4 #include "Python.h" | |
| 5 | |
| 6 | |
| 7 | |
| 8 #include "pymactoolbox.h" | |
| 9 | |
| 10 /* Macro to test whether a weak-loaded CFM function exists */ | |
| 11 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ | |
|
30973
53e4b7fe0969
Getting rid of WITHOUT_FRAMEWORKS and ACCESSOR_CALLS_ARE_FUNCTIONS:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26769
diff
changeset
|
12 PyErr_SetString(PyExc_NotImplementedError, \ |
|
53e4b7fe0969
Getting rid of WITHOUT_FRAMEWORKS and ACCESSOR_CALLS_ARE_FUNCTIONS:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26769
diff
changeset
|
13 "Not available in this shared library/OS version"); \ |
|
53e4b7fe0969
Getting rid of WITHOUT_FRAMEWORKS and ACCESSOR_CALLS_ARE_FUNCTIONS:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26769
diff
changeset
|
14 return NULL; \ |
| 21386 | 15 }} while(0) |
| 16 | |
| 17 | |
|
21390
96bbb3d0c6a0
include the proper header for Mach-O
Just van Rossum <just@letterror.com>
parents:
21386
diff
changeset
|
18 #include <ApplicationServices/ApplicationServices.h> |
| 21386 | 19 |
| 20 extern int GrafObj_Convert(PyObject *, GrafPtr *); | |
| 21 | |
| 22 /* | |
| 23 ** Manual converters | |
| 24 */ | |
| 25 | |
| 26 PyObject *CGPoint_New(CGPoint *itself) | |
| 27 { | |
| 28 | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
29 return Py_BuildValue("(ff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
30 itself->x, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
31 itself->y); |
| 21386 | 32 } |
| 33 | |
| 34 int | |
| 35 CGPoint_Convert(PyObject *v, CGPoint *p_itself) | |
| 36 { | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
37 if( !PyArg_Parse(v, "(ff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
38 &p_itself->x, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
39 &p_itself->y) ) |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
40 return 0; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
41 return 1; |
| 21386 | 42 } |
| 43 | |
| 44 PyObject *CGRect_New(CGRect *itself) | |
| 45 { | |
| 46 | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
47 return Py_BuildValue("(ffff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
48 itself->origin.x, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
49 itself->origin.y, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
50 itself->size.width, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
51 itself->size.height); |
| 21386 | 52 } |
| 53 | |
| 54 int | |
| 55 CGRect_Convert(PyObject *v, CGRect *p_itself) | |
| 56 { | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
57 if( !PyArg_Parse(v, "(ffff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
58 &p_itself->origin.x, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
59 &p_itself->origin.y, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
60 &p_itself->size.width, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
61 &p_itself->size.height) ) |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
62 return 0; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
63 return 1; |
| 21386 | 64 } |
| 65 | |
| 66 PyObject *CGAffineTransform_New(CGAffineTransform *itself) | |
| 67 { | |
| 68 | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
69 return Py_BuildValue("(ffffff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
70 itself->a, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
71 itself->b, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
72 itself->c, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
73 itself->d, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
74 itself->tx, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
75 itself->ty); |
| 21386 | 76 } |
| 77 | |
| 78 int | |
| 79 CGAffineTransform_Convert(PyObject *v, CGAffineTransform *p_itself) | |
| 80 { | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
81 if( !PyArg_Parse(v, "(ffffff)", |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
82 &p_itself->a, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
83 &p_itself->b, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
84 &p_itself->c, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
85 &p_itself->d, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
86 &p_itself->tx, |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
87 &p_itself->ty) ) |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
88 return 0; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
89 return 1; |
| 21386 | 90 } |
| 91 | |
| 92 static PyObject *CG_Error; | |
| 93 | |
| 94 /* -------------------- Object type CGContextRef -------------------- */ | |
| 95 | |
| 96 PyTypeObject CGContextRef_Type; | |
| 97 | |
|
26720
a12e1727850a
Regenerated with inheritance-aware xxxx_Check() macros.
Jack Jansen <jack.jansen@cwi.nl>
parents:
26524
diff
changeset
|
98 #define CGContextRefObj_Check(x) ((x)->ob_type == &CGContextRef_Type || PyObject_TypeCheck((x), &CGContextRef_Type)) |
| 21386 | 99 |
| 100 typedef struct CGContextRefObject { | |
| 101 PyObject_HEAD | |
| 102 CGContextRef ob_itself; | |
| 103 } CGContextRefObject; | |
| 104 | |
| 105 PyObject *CGContextRefObj_New(CGContextRef itself) | |
| 106 { | |
| 107 CGContextRefObject *it; | |
| 108 it = PyObject_NEW(CGContextRefObject, &CGContextRef_Type); | |
| 109 if (it == NULL) return NULL; | |
| 110 it->ob_itself = itself; | |
| 111 return (PyObject *)it; | |
| 112 } | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
113 |
| 21386 | 114 int CGContextRefObj_Convert(PyObject *v, CGContextRef *p_itself) |
| 115 { | |
| 116 if (!CGContextRefObj_Check(v)) | |
| 117 { | |
| 118 PyErr_SetString(PyExc_TypeError, "CGContextRef required"); | |
| 119 return 0; | |
| 120 } | |
| 121 *p_itself = ((CGContextRefObject *)v)->ob_itself; | |
| 122 return 1; | |
| 123 } | |
| 124 | |
| 125 static void CGContextRefObj_dealloc(CGContextRefObject *self) | |
| 126 { | |
| 127 CGContextRelease(self->ob_itself); | |
|
26769
aef3a03a79f1
- Various tweaks to shut up compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
26720
diff
changeset
|
128 self->ob_type->tp_free((PyObject *)self); |
| 21386 | 129 } |
| 130 | |
| 131 static PyObject *CGContextRefObj_CGContextSaveGState(CGContextRefObject *_self, PyObject *_args) | |
| 132 { | |
| 133 PyObject *_res = NULL; | |
| 134 if (!PyArg_ParseTuple(_args, "")) | |
| 135 return NULL; | |
| 136 CGContextSaveGState(_self->ob_itself); | |
| 137 Py_INCREF(Py_None); | |
| 138 _res = Py_None; | |
| 139 return _res; | |
| 140 } | |
| 141 | |
| 142 static PyObject *CGContextRefObj_CGContextRestoreGState(CGContextRefObject *_self, PyObject *_args) | |
| 143 { | |
| 144 PyObject *_res = NULL; | |
| 145 if (!PyArg_ParseTuple(_args, "")) | |
| 146 return NULL; | |
| 147 CGContextRestoreGState(_self->ob_itself); | |
| 148 Py_INCREF(Py_None); | |
| 149 _res = Py_None; | |
| 150 return _res; | |
| 151 } | |
| 152 | |
| 153 static PyObject *CGContextRefObj_CGContextScaleCTM(CGContextRefObject *_self, PyObject *_args) | |
| 154 { | |
| 155 PyObject *_res = NULL; | |
| 156 float sx; | |
| 157 float sy; | |
| 158 if (!PyArg_ParseTuple(_args, "ff", | |
| 159 &sx, | |
| 160 &sy)) | |
| 161 return NULL; | |
| 162 CGContextScaleCTM(_self->ob_itself, | |
| 163 sx, | |
| 164 sy); | |
| 165 Py_INCREF(Py_None); | |
| 166 _res = Py_None; | |
| 167 return _res; | |
| 168 } | |
| 169 | |
| 170 static PyObject *CGContextRefObj_CGContextTranslateCTM(CGContextRefObject *_self, PyObject *_args) | |
| 171 { | |
| 172 PyObject *_res = NULL; | |
| 173 float tx; | |
| 174 float ty; | |
| 175 if (!PyArg_ParseTuple(_args, "ff", | |
| 176 &tx, | |
| 177 &ty)) | |
| 178 return NULL; | |
| 179 CGContextTranslateCTM(_self->ob_itself, | |
| 180 tx, | |
| 181 ty); | |
| 182 Py_INCREF(Py_None); | |
| 183 _res = Py_None; | |
| 184 return _res; | |
| 185 } | |
| 186 | |
| 187 static PyObject *CGContextRefObj_CGContextRotateCTM(CGContextRefObject *_self, PyObject *_args) | |
| 188 { | |
| 189 PyObject *_res = NULL; | |
| 190 float angle; | |
| 191 if (!PyArg_ParseTuple(_args, "f", | |
| 192 &angle)) | |
| 193 return NULL; | |
| 194 CGContextRotateCTM(_self->ob_itself, | |
| 195 angle); | |
| 196 Py_INCREF(Py_None); | |
| 197 _res = Py_None; | |
| 198 return _res; | |
| 199 } | |
| 200 | |
| 201 static PyObject *CGContextRefObj_CGContextConcatCTM(CGContextRefObject *_self, PyObject *_args) | |
| 202 { | |
| 203 PyObject *_res = NULL; | |
| 204 CGAffineTransform transform; | |
| 205 if (!PyArg_ParseTuple(_args, "O&", | |
| 206 CGAffineTransform_Convert, &transform)) | |
| 207 return NULL; | |
| 208 CGContextConcatCTM(_self->ob_itself, | |
| 209 transform); | |
| 210 Py_INCREF(Py_None); | |
| 211 _res = Py_None; | |
| 212 return _res; | |
| 213 } | |
| 214 | |
| 215 static PyObject *CGContextRefObj_CGContextGetCTM(CGContextRefObject *_self, PyObject *_args) | |
| 216 { | |
| 217 PyObject *_res = NULL; | |
| 218 CGAffineTransform _rv; | |
| 219 if (!PyArg_ParseTuple(_args, "")) | |
| 220 return NULL; | |
| 221 _rv = CGContextGetCTM(_self->ob_itself); | |
| 222 _res = Py_BuildValue("O&", | |
| 223 CGAffineTransform_New, &_rv); | |
| 224 return _res; | |
| 225 } | |
| 226 | |
| 227 static PyObject *CGContextRefObj_CGContextSetLineWidth(CGContextRefObject *_self, PyObject *_args) | |
| 228 { | |
| 229 PyObject *_res = NULL; | |
| 230 float width; | |
| 231 if (!PyArg_ParseTuple(_args, "f", | |
| 232 &width)) | |
| 233 return NULL; | |
| 234 CGContextSetLineWidth(_self->ob_itself, | |
| 235 width); | |
| 236 Py_INCREF(Py_None); | |
| 237 _res = Py_None; | |
| 238 return _res; | |
| 239 } | |
| 240 | |
| 241 static PyObject *CGContextRefObj_CGContextSetLineCap(CGContextRefObject *_self, PyObject *_args) | |
| 242 { | |
| 243 PyObject *_res = NULL; | |
| 244 int cap; | |
| 245 if (!PyArg_ParseTuple(_args, "i", | |
| 246 &cap)) | |
| 247 return NULL; | |
| 248 CGContextSetLineCap(_self->ob_itself, | |
| 249 cap); | |
| 250 Py_INCREF(Py_None); | |
| 251 _res = Py_None; | |
| 252 return _res; | |
| 253 } | |
| 254 | |
| 255 static PyObject *CGContextRefObj_CGContextSetLineJoin(CGContextRefObject *_self, PyObject *_args) | |
| 256 { | |
| 257 PyObject *_res = NULL; | |
| 258 int join; | |
| 259 if (!PyArg_ParseTuple(_args, "i", | |
| 260 &join)) | |
| 261 return NULL; | |
| 262 CGContextSetLineJoin(_self->ob_itself, | |
| 263 join); | |
| 264 Py_INCREF(Py_None); | |
| 265 _res = Py_None; | |
| 266 return _res; | |
| 267 } | |
| 268 | |
| 269 static PyObject *CGContextRefObj_CGContextSetMiterLimit(CGContextRefObject *_self, PyObject *_args) | |
| 270 { | |
| 271 PyObject *_res = NULL; | |
| 272 float limit; | |
| 273 if (!PyArg_ParseTuple(_args, "f", | |
| 274 &limit)) | |
| 275 return NULL; | |
| 276 CGContextSetMiterLimit(_self->ob_itself, | |
| 277 limit); | |
| 278 Py_INCREF(Py_None); | |
| 279 _res = Py_None; | |
| 280 return _res; | |
| 281 } | |
| 282 | |
| 283 static PyObject *CGContextRefObj_CGContextSetFlatness(CGContextRefObject *_self, PyObject *_args) | |
| 284 { | |
| 285 PyObject *_res = NULL; | |
| 286 float flatness; | |
| 287 if (!PyArg_ParseTuple(_args, "f", | |
| 288 &flatness)) | |
| 289 return NULL; | |
| 290 CGContextSetFlatness(_self->ob_itself, | |
| 291 flatness); | |
| 292 Py_INCREF(Py_None); | |
| 293 _res = Py_None; | |
| 294 return _res; | |
| 295 } | |
| 296 | |
| 297 static PyObject *CGContextRefObj_CGContextSetAlpha(CGContextRefObject *_self, PyObject *_args) | |
| 298 { | |
| 299 PyObject *_res = NULL; | |
| 300 float alpha; | |
| 301 if (!PyArg_ParseTuple(_args, "f", | |
| 302 &alpha)) | |
| 303 return NULL; | |
| 304 CGContextSetAlpha(_self->ob_itself, | |
| 305 alpha); | |
| 306 Py_INCREF(Py_None); | |
| 307 _res = Py_None; | |
| 308 return _res; | |
| 309 } | |
| 310 | |
| 311 static PyObject *CGContextRefObj_CGContextBeginPath(CGContextRefObject *_self, PyObject *_args) | |
| 312 { | |
| 313 PyObject *_res = NULL; | |
| 314 if (!PyArg_ParseTuple(_args, "")) | |
| 315 return NULL; | |
| 316 CGContextBeginPath(_self->ob_itself); | |
| 317 Py_INCREF(Py_None); | |
| 318 _res = Py_None; | |
| 319 return _res; | |
| 320 } | |
| 321 | |
| 322 static PyObject *CGContextRefObj_CGContextMoveToPoint(CGContextRefObject *_self, PyObject *_args) | |
| 323 { | |
| 324 PyObject *_res = NULL; | |
| 325 float x; | |
| 326 float y; | |
| 327 if (!PyArg_ParseTuple(_args, "ff", | |
| 328 &x, | |
| 329 &y)) | |
| 330 return NULL; | |
| 331 CGContextMoveToPoint(_self->ob_itself, | |
| 332 x, | |
| 333 y); | |
| 334 Py_INCREF(Py_None); | |
| 335 _res = Py_None; | |
| 336 return _res; | |
| 337 } | |
| 338 | |
| 339 static PyObject *CGContextRefObj_CGContextAddLineToPoint(CGContextRefObject *_self, PyObject *_args) | |
| 340 { | |
| 341 PyObject *_res = NULL; | |
| 342 float x; | |
| 343 float y; | |
| 344 if (!PyArg_ParseTuple(_args, "ff", | |
| 345 &x, | |
| 346 &y)) | |
| 347 return NULL; | |
| 348 CGContextAddLineToPoint(_self->ob_itself, | |
| 349 x, | |
| 350 y); | |
| 351 Py_INCREF(Py_None); | |
| 352 _res = Py_None; | |
| 353 return _res; | |
| 354 } | |
| 355 | |
| 356 static PyObject *CGContextRefObj_CGContextAddCurveToPoint(CGContextRefObject *_self, PyObject *_args) | |
| 357 { | |
| 358 PyObject *_res = NULL; | |
| 359 float cp1x; | |
| 360 float cp1y; | |
| 361 float cp2x; | |
| 362 float cp2y; | |
| 363 float x; | |
| 364 float y; | |
| 365 if (!PyArg_ParseTuple(_args, "ffffff", | |
| 366 &cp1x, | |
| 367 &cp1y, | |
| 368 &cp2x, | |
| 369 &cp2y, | |
| 370 &x, | |
| 371 &y)) | |
| 372 return NULL; | |
| 373 CGContextAddCurveToPoint(_self->ob_itself, | |
| 374 cp1x, | |
| 375 cp1y, | |
| 376 cp2x, | |
| 377 cp2y, | |
| 378 x, | |
| 379 y); | |
| 380 Py_INCREF(Py_None); | |
| 381 _res = Py_None; | |
| 382 return _res; | |
| 383 } | |
| 384 | |
| 385 static PyObject *CGContextRefObj_CGContextAddQuadCurveToPoint(CGContextRefObject *_self, PyObject *_args) | |
| 386 { | |
| 387 PyObject *_res = NULL; | |
| 388 float cpx; | |
| 389 float cpy; | |
| 390 float x; | |
| 391 float y; | |
| 392 if (!PyArg_ParseTuple(_args, "ffff", | |
| 393 &cpx, | |
| 394 &cpy, | |
| 395 &x, | |
| 396 &y)) | |
| 397 return NULL; | |
| 398 CGContextAddQuadCurveToPoint(_self->ob_itself, | |
| 399 cpx, | |
| 400 cpy, | |
| 401 x, | |
| 402 y); | |
| 403 Py_INCREF(Py_None); | |
| 404 _res = Py_None; | |
| 405 return _res; | |
| 406 } | |
| 407 | |
| 408 static PyObject *CGContextRefObj_CGContextClosePath(CGContextRefObject *_self, PyObject *_args) | |
| 409 { | |
| 410 PyObject *_res = NULL; | |
| 411 if (!PyArg_ParseTuple(_args, "")) | |
| 412 return NULL; | |
| 413 CGContextClosePath(_self->ob_itself); | |
| 414 Py_INCREF(Py_None); | |
| 415 _res = Py_None; | |
| 416 return _res; | |
| 417 } | |
| 418 | |
| 419 static PyObject *CGContextRefObj_CGContextAddRect(CGContextRefObject *_self, PyObject *_args) | |
| 420 { | |
| 421 PyObject *_res = NULL; | |
| 422 CGRect rect; | |
| 423 if (!PyArg_ParseTuple(_args, "O&", | |
| 424 CGRect_Convert, &rect)) | |
| 425 return NULL; | |
| 426 CGContextAddRect(_self->ob_itself, | |
| 427 rect); | |
| 428 Py_INCREF(Py_None); | |
| 429 _res = Py_None; | |
| 430 return _res; | |
| 431 } | |
| 432 | |
| 433 static PyObject *CGContextRefObj_CGContextAddArc(CGContextRefObject *_self, PyObject *_args) | |
| 434 { | |
| 435 PyObject *_res = NULL; | |
| 436 float x; | |
| 437 float y; | |
| 438 float radius; | |
| 439 float startAngle; | |
| 440 float endAngle; | |
| 441 int clockwise; | |
| 442 if (!PyArg_ParseTuple(_args, "fffffi", | |
| 443 &x, | |
| 444 &y, | |
| 445 &radius, | |
| 446 &startAngle, | |
| 447 &endAngle, | |
| 448 &clockwise)) | |
| 449 return NULL; | |
| 450 CGContextAddArc(_self->ob_itself, | |
| 451 x, | |
| 452 y, | |
| 453 radius, | |
| 454 startAngle, | |
| 455 endAngle, | |
| 456 clockwise); | |
| 457 Py_INCREF(Py_None); | |
| 458 _res = Py_None; | |
| 459 return _res; | |
| 460 } | |
| 461 | |
| 462 static PyObject *CGContextRefObj_CGContextAddArcToPoint(CGContextRefObject *_self, PyObject *_args) | |
| 463 { | |
| 464 PyObject *_res = NULL; | |
| 465 float x1; | |
| 466 float y1; | |
| 467 float x2; | |
| 468 float y2; | |
| 469 float radius; | |
| 470 if (!PyArg_ParseTuple(_args, "fffff", | |
| 471 &x1, | |
| 472 &y1, | |
| 473 &x2, | |
| 474 &y2, | |
| 475 &radius)) | |
| 476 return NULL; | |
| 477 CGContextAddArcToPoint(_self->ob_itself, | |
| 478 x1, | |
| 479 y1, | |
| 480 x2, | |
| 481 y2, | |
| 482 radius); | |
| 483 Py_INCREF(Py_None); | |
| 484 _res = Py_None; | |
| 485 return _res; | |
| 486 } | |
| 487 | |
| 488 static PyObject *CGContextRefObj_CGContextIsPathEmpty(CGContextRefObject *_self, PyObject *_args) | |
| 489 { | |
| 490 PyObject *_res = NULL; | |
| 491 int _rv; | |
| 492 if (!PyArg_ParseTuple(_args, "")) | |
| 493 return NULL; | |
| 494 _rv = CGContextIsPathEmpty(_self->ob_itself); | |
| 495 _res = Py_BuildValue("i", | |
| 496 _rv); | |
| 497 return _res; | |
| 498 } | |
| 499 | |
| 500 static PyObject *CGContextRefObj_CGContextGetPathCurrentPoint(CGContextRefObject *_self, PyObject *_args) | |
| 501 { | |
| 502 PyObject *_res = NULL; | |
| 503 CGPoint _rv; | |
| 504 if (!PyArg_ParseTuple(_args, "")) | |
| 505 return NULL; | |
| 506 _rv = CGContextGetPathCurrentPoint(_self->ob_itself); | |
| 507 _res = Py_BuildValue("O&", | |
| 508 CGPoint_New, &_rv); | |
| 509 return _res; | |
| 510 } | |
| 511 | |
| 512 static PyObject *CGContextRefObj_CGContextGetPathBoundingBox(CGContextRefObject *_self, PyObject *_args) | |
| 513 { | |
| 514 PyObject *_res = NULL; | |
| 515 CGRect _rv; | |
| 516 if (!PyArg_ParseTuple(_args, "")) | |
| 517 return NULL; | |
| 518 _rv = CGContextGetPathBoundingBox(_self->ob_itself); | |
| 519 _res = Py_BuildValue("O&", | |
| 520 CGRect_New, &_rv); | |
| 521 return _res; | |
| 522 } | |
| 523 | |
| 524 static PyObject *CGContextRefObj_CGContextDrawPath(CGContextRefObject *_self, PyObject *_args) | |
| 525 { | |
| 526 PyObject *_res = NULL; | |
| 527 int mode; | |
| 528 if (!PyArg_ParseTuple(_args, "i", | |
| 529 &mode)) | |
| 530 return NULL; | |
| 531 CGContextDrawPath(_self->ob_itself, | |
| 532 mode); | |
| 533 Py_INCREF(Py_None); | |
| 534 _res = Py_None; | |
| 535 return _res; | |
| 536 } | |
| 537 | |
| 538 static PyObject *CGContextRefObj_CGContextFillPath(CGContextRefObject *_self, PyObject *_args) | |
| 539 { | |
| 540 PyObject *_res = NULL; | |
| 541 if (!PyArg_ParseTuple(_args, "")) | |
| 542 return NULL; | |
| 543 CGContextFillPath(_self->ob_itself); | |
| 544 Py_INCREF(Py_None); | |
| 545 _res = Py_None; | |
| 546 return _res; | |
| 547 } | |
| 548 | |
| 549 static PyObject *CGContextRefObj_CGContextEOFillPath(CGContextRefObject *_self, PyObject *_args) | |
| 550 { | |
| 551 PyObject *_res = NULL; | |
| 552 if (!PyArg_ParseTuple(_args, "")) | |
| 553 return NULL; | |
| 554 CGContextEOFillPath(_self->ob_itself); | |
| 555 Py_INCREF(Py_None); | |
| 556 _res = Py_None; | |
| 557 return _res; | |
| 558 } | |
| 559 | |
| 560 static PyObject *CGContextRefObj_CGContextStrokePath(CGContextRefObject *_self, PyObject *_args) | |
| 561 { | |
| 562 PyObject *_res = NULL; | |
| 563 if (!PyArg_ParseTuple(_args, "")) | |
| 564 return NULL; | |
| 565 CGContextStrokePath(_self->ob_itself); | |
| 566 Py_INCREF(Py_None); | |
| 567 _res = Py_None; | |
| 568 return _res; | |
| 569 } | |
| 570 | |
| 571 static PyObject *CGContextRefObj_CGContextFillRect(CGContextRefObject *_self, PyObject *_args) | |
| 572 { | |
| 573 PyObject *_res = NULL; | |
| 574 CGRect rect; | |
| 575 if (!PyArg_ParseTuple(_args, "O&", | |
| 576 CGRect_Convert, &rect)) | |
| 577 return NULL; | |
| 578 CGContextFillRect(_self->ob_itself, | |
| 579 rect); | |
| 580 Py_INCREF(Py_None); | |
| 581 _res = Py_None; | |
| 582 return _res; | |
| 583 } | |
| 584 | |
| 585 static PyObject *CGContextRefObj_CGContextStrokeRect(CGContextRefObject *_self, PyObject *_args) | |
| 586 { | |
| 587 PyObject *_res = NULL; | |
| 588 CGRect rect; | |
| 589 if (!PyArg_ParseTuple(_args, "O&", | |
| 590 CGRect_Convert, &rect)) | |
| 591 return NULL; | |
| 592 CGContextStrokeRect(_self->ob_itself, | |
| 593 rect); | |
| 594 Py_INCREF(Py_None); | |
| 595 _res = Py_None; | |
| 596 return _res; | |
| 597 } | |
| 598 | |
| 599 static PyObject *CGContextRefObj_CGContextStrokeRectWithWidth(CGContextRefObject *_self, PyObject *_args) | |
| 600 { | |
| 601 PyObject *_res = NULL; | |
| 602 CGRect rect; | |
| 603 float width; | |
| 604 if (!PyArg_ParseTuple(_args, "O&f", | |
| 605 CGRect_Convert, &rect, | |
| 606 &width)) | |
| 607 return NULL; | |
| 608 CGContextStrokeRectWithWidth(_self->ob_itself, | |
| 609 rect, | |
| 610 width); | |
| 611 Py_INCREF(Py_None); | |
| 612 _res = Py_None; | |
| 613 return _res; | |
| 614 } | |
| 615 | |
| 616 static PyObject *CGContextRefObj_CGContextClearRect(CGContextRefObject *_self, PyObject *_args) | |
| 617 { | |
| 618 PyObject *_res = NULL; | |
| 619 CGRect rect; | |
| 620 if (!PyArg_ParseTuple(_args, "O&", | |
| 621 CGRect_Convert, &rect)) | |
| 622 return NULL; | |
| 623 CGContextClearRect(_self->ob_itself, | |
| 624 rect); | |
| 625 Py_INCREF(Py_None); | |
| 626 _res = Py_None; | |
| 627 return _res; | |
| 628 } | |
| 629 | |
| 630 static PyObject *CGContextRefObj_CGContextClip(CGContextRefObject *_self, PyObject *_args) | |
| 631 { | |
| 632 PyObject *_res = NULL; | |
| 633 if (!PyArg_ParseTuple(_args, "")) | |
| 634 return NULL; | |
| 635 CGContextClip(_self->ob_itself); | |
| 636 Py_INCREF(Py_None); | |
| 637 _res = Py_None; | |
| 638 return _res; | |
| 639 } | |
| 640 | |
| 641 static PyObject *CGContextRefObj_CGContextEOClip(CGContextRefObject *_self, PyObject *_args) | |
| 642 { | |
| 643 PyObject *_res = NULL; | |
| 644 if (!PyArg_ParseTuple(_args, "")) | |
| 645 return NULL; | |
| 646 CGContextEOClip(_self->ob_itself); | |
| 647 Py_INCREF(Py_None); | |
| 648 _res = Py_None; | |
| 649 return _res; | |
| 650 } | |
| 651 | |
| 652 static PyObject *CGContextRefObj_CGContextClipToRect(CGContextRefObject *_self, PyObject *_args) | |
| 653 { | |
| 654 PyObject *_res = NULL; | |
| 655 CGRect rect; | |
| 656 if (!PyArg_ParseTuple(_args, "O&", | |
| 657 CGRect_Convert, &rect)) | |
| 658 return NULL; | |
| 659 CGContextClipToRect(_self->ob_itself, | |
| 660 rect); | |
| 661 Py_INCREF(Py_None); | |
| 662 _res = Py_None; | |
| 663 return _res; | |
| 664 } | |
| 665 | |
| 666 static PyObject *CGContextRefObj_CGContextSetGrayFillColor(CGContextRefObject *_self, PyObject *_args) | |
| 667 { | |
| 668 PyObject *_res = NULL; | |
| 669 float gray; | |
| 670 float alpha; | |
| 671 if (!PyArg_ParseTuple(_args, "ff", | |
| 672 &gray, | |
| 673 &alpha)) | |
| 674 return NULL; | |
| 675 CGContextSetGrayFillColor(_self->ob_itself, | |
| 676 gray, | |
| 677 alpha); | |
| 678 Py_INCREF(Py_None); | |
| 679 _res = Py_None; | |
| 680 return _res; | |
| 681 } | |
| 682 | |
| 683 static PyObject *CGContextRefObj_CGContextSetGrayStrokeColor(CGContextRefObject *_self, PyObject *_args) | |
| 684 { | |
| 685 PyObject *_res = NULL; | |
| 686 float gray; | |
| 687 float alpha; | |
| 688 if (!PyArg_ParseTuple(_args, "ff", | |
| 689 &gray, | |
| 690 &alpha)) | |
| 691 return NULL; | |
| 692 CGContextSetGrayStrokeColor(_self->ob_itself, | |
| 693 gray, | |
| 694 alpha); | |
| 695 Py_INCREF(Py_None); | |
| 696 _res = Py_None; | |
| 697 return _res; | |
| 698 } | |
| 699 | |
| 700 static PyObject *CGContextRefObj_CGContextSetRGBFillColor(CGContextRefObject *_self, PyObject *_args) | |
| 701 { | |
| 702 PyObject *_res = NULL; | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
703 float red; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
704 float green; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
705 float blue; |
| 21386 | 706 float alpha; |
| 707 if (!PyArg_ParseTuple(_args, "ffff", | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
708 &red, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
709 &green, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
710 &blue, |
| 21386 | 711 &alpha)) |
| 712 return NULL; | |
| 713 CGContextSetRGBFillColor(_self->ob_itself, | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
714 red, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
715 green, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
716 blue, |
| 21386 | 717 alpha); |
| 718 Py_INCREF(Py_None); | |
| 719 _res = Py_None; | |
| 720 return _res; | |
| 721 } | |
| 722 | |
| 723 static PyObject *CGContextRefObj_CGContextSetRGBStrokeColor(CGContextRefObject *_self, PyObject *_args) | |
| 724 { | |
| 725 PyObject *_res = NULL; | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
726 float red; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
727 float green; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
728 float blue; |
| 21386 | 729 float alpha; |
| 730 if (!PyArg_ParseTuple(_args, "ffff", | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
731 &red, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
732 &green, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
733 &blue, |
| 21386 | 734 &alpha)) |
| 735 return NULL; | |
| 736 CGContextSetRGBStrokeColor(_self->ob_itself, | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
737 red, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
738 green, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
739 blue, |
| 21386 | 740 alpha); |
| 741 Py_INCREF(Py_None); | |
| 742 _res = Py_None; | |
| 743 return _res; | |
| 744 } | |
| 745 | |
| 746 static PyObject *CGContextRefObj_CGContextSetCMYKFillColor(CGContextRefObject *_self, PyObject *_args) | |
| 747 { | |
| 748 PyObject *_res = NULL; | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
749 float cyan; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
750 float magenta; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
751 float yellow; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
752 float black; |
| 21386 | 753 float alpha; |
| 754 if (!PyArg_ParseTuple(_args, "fffff", | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
755 &cyan, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
756 &magenta, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
757 &yellow, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
758 &black, |
| 21386 | 759 &alpha)) |
| 760 return NULL; | |
| 761 CGContextSetCMYKFillColor(_self->ob_itself, | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
762 cyan, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
763 magenta, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
764 yellow, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
765 black, |
| 21386 | 766 alpha); |
| 767 Py_INCREF(Py_None); | |
| 768 _res = Py_None; | |
| 769 return _res; | |
| 770 } | |
| 771 | |
| 772 static PyObject *CGContextRefObj_CGContextSetCMYKStrokeColor(CGContextRefObject *_self, PyObject *_args) | |
| 773 { | |
| 774 PyObject *_res = NULL; | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
775 float cyan; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
776 float magenta; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
777 float yellow; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
778 float black; |
| 21386 | 779 float alpha; |
| 780 if (!PyArg_ParseTuple(_args, "fffff", | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
781 &cyan, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
782 &magenta, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
783 &yellow, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
784 &black, |
| 21386 | 785 &alpha)) |
| 786 return NULL; | |
| 787 CGContextSetCMYKStrokeColor(_self->ob_itself, | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
788 cyan, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
789 magenta, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
790 yellow, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
791 black, |
| 21386 | 792 alpha); |
| 793 Py_INCREF(Py_None); | |
| 794 _res = Py_None; | |
| 795 return _res; | |
| 796 } | |
| 797 | |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
798 static PyObject *CGContextRefObj_CGContextGetInterpolationQuality(CGContextRefObject *_self, PyObject *_args) |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
799 { |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
800 PyObject *_res = NULL; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
801 int _rv; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
802 if (!PyArg_ParseTuple(_args, "")) |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
803 return NULL; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
804 _rv = CGContextGetInterpolationQuality(_self->ob_itself); |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
805 _res = Py_BuildValue("i", |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
806 _rv); |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
807 return _res; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
808 } |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
809 |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
810 static PyObject *CGContextRefObj_CGContextSetInterpolationQuality(CGContextRefObject *_self, PyObject *_args) |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
811 { |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
812 PyObject *_res = NULL; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
813 int quality; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
814 if (!PyArg_ParseTuple(_args, "i", |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
815 &quality)) |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
816 return NULL; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
817 CGContextSetInterpolationQuality(_self->ob_itself, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
818 quality); |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
819 Py_INCREF(Py_None); |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
820 _res = Py_None; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
821 return _res; |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
822 } |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
823 |
| 21386 | 824 static PyObject *CGContextRefObj_CGContextSetCharacterSpacing(CGContextRefObject *_self, PyObject *_args) |
| 825 { | |
| 826 PyObject *_res = NULL; | |
| 827 float spacing; | |
| 828 if (!PyArg_ParseTuple(_args, "f", | |
| 829 &spacing)) | |
| 830 return NULL; | |
| 831 CGContextSetCharacterSpacing(_self->ob_itself, | |
| 832 spacing); | |
| 833 Py_INCREF(Py_None); | |
| 834 _res = Py_None; | |
| 835 return _res; | |
| 836 } | |
| 837 | |
| 838 static PyObject *CGContextRefObj_CGContextSetTextPosition(CGContextRefObject *_self, PyObject *_args) | |
| 839 { | |
| 840 PyObject *_res = NULL; | |
| 841 float x; | |
| 842 float y; | |
| 843 if (!PyArg_ParseTuple(_args, "ff", | |
| 844 &x, | |
| 845 &y)) | |
| 846 return NULL; | |
| 847 CGContextSetTextPosition(_self->ob_itself, | |
| 848 x, | |
| 849 y); | |
| 850 Py_INCREF(Py_None); | |
| 851 _res = Py_None; | |
| 852 return _res; | |
| 853 } | |
| 854 | |
| 855 static PyObject *CGContextRefObj_CGContextGetTextPosition(CGContextRefObject *_self, PyObject *_args) | |
| 856 { | |
| 857 PyObject *_res = NULL; | |
| 858 CGPoint _rv; | |
| 859 if (!PyArg_ParseTuple(_args, "")) | |
| 860 return NULL; | |
| 861 _rv = CGContextGetTextPosition(_self->ob_itself); | |
| 862 _res = Py_BuildValue("O&", | |
| 863 CGPoint_New, &_rv); | |
| 864 return _res; | |
| 865 } | |
| 866 | |
| 867 static PyObject *CGContextRefObj_CGContextSetTextMatrix(CGContextRefObject *_self, PyObject *_args) | |
| 868 { | |
| 869 PyObject *_res = NULL; | |
| 870 CGAffineTransform transform; | |
| 871 if (!PyArg_ParseTuple(_args, "O&", | |
| 872 CGAffineTransform_Convert, &transform)) | |
| 873 return NULL; | |
| 874 CGContextSetTextMatrix(_self->ob_itself, | |
| 875 transform); | |
| 876 Py_INCREF(Py_None); | |
| 877 _res = Py_None; | |
| 878 return _res; | |
| 879 } | |
| 880 | |
| 881 static PyObject *CGContextRefObj_CGContextGetTextMatrix(CGContextRefObject *_self, PyObject *_args) | |
| 882 { | |
| 883 PyObject *_res = NULL; | |
| 884 CGAffineTransform _rv; | |
| 885 if (!PyArg_ParseTuple(_args, "")) | |
| 886 return NULL; | |
| 887 _rv = CGContextGetTextMatrix(_self->ob_itself); | |
| 888 _res = Py_BuildValue("O&", | |
| 889 CGAffineTransform_New, &_rv); | |
| 890 return _res; | |
| 891 } | |
| 892 | |
| 893 static PyObject *CGContextRefObj_CGContextSetTextDrawingMode(CGContextRefObject *_self, PyObject *_args) | |
| 894 { | |
| 895 PyObject *_res = NULL; | |
| 896 int mode; | |
| 897 if (!PyArg_ParseTuple(_args, "i", | |
| 898 &mode)) | |
| 899 return NULL; | |
| 900 CGContextSetTextDrawingMode(_self->ob_itself, | |
| 901 mode); | |
| 902 Py_INCREF(Py_None); | |
| 903 _res = Py_None; | |
| 904 return _res; | |
| 905 } | |
| 906 | |
| 907 static PyObject *CGContextRefObj_CGContextSetFontSize(CGContextRefObject *_self, PyObject *_args) | |
| 908 { | |
| 909 PyObject *_res = NULL; | |
| 910 float size; | |
| 911 if (!PyArg_ParseTuple(_args, "f", | |
| 912 &size)) | |
| 913 return NULL; | |
| 914 CGContextSetFontSize(_self->ob_itself, | |
| 915 size); | |
| 916 Py_INCREF(Py_None); | |
| 917 _res = Py_None; | |
| 918 return _res; | |
| 919 } | |
| 920 | |
| 921 static PyObject *CGContextRefObj_CGContextSelectFont(CGContextRefObject *_self, PyObject *_args) | |
| 922 { | |
| 923 PyObject *_res = NULL; | |
| 924 char * name; | |
| 925 float size; | |
| 926 int textEncoding; | |
| 927 if (!PyArg_ParseTuple(_args, "sfi", | |
| 928 &name, | |
| 929 &size, | |
| 930 &textEncoding)) | |
| 931 return NULL; | |
| 932 CGContextSelectFont(_self->ob_itself, | |
| 933 name, | |
| 934 size, | |
| 935 textEncoding); | |
| 936 Py_INCREF(Py_None); | |
| 937 _res = Py_None; | |
| 938 return _res; | |
| 939 } | |
| 940 | |
| 941 static PyObject *CGContextRefObj_CGContextShowText(CGContextRefObject *_self, PyObject *_args) | |
| 942 { | |
| 943 PyObject *_res = NULL; | |
| 944 char *cstring__in__; | |
| 945 long cstring__len__; | |
| 946 int cstring__in_len__; | |
| 947 if (!PyArg_ParseTuple(_args, "s#", | |
| 948 &cstring__in__, &cstring__in_len__)) | |
| 949 return NULL; | |
| 950 cstring__len__ = cstring__in_len__; | |
| 951 CGContextShowText(_self->ob_itself, | |
| 952 cstring__in__, cstring__len__); | |
| 953 Py_INCREF(Py_None); | |
| 954 _res = Py_None; | |
| 955 return _res; | |
| 956 } | |
| 957 | |
| 958 static PyObject *CGContextRefObj_CGContextShowTextAtPoint(CGContextRefObject *_self, PyObject *_args) | |
| 959 { | |
| 960 PyObject *_res = NULL; | |
| 961 float x; | |
| 962 float y; | |
| 963 char *cstring__in__; | |
| 964 long cstring__len__; | |
| 965 int cstring__in_len__; | |
| 966 if (!PyArg_ParseTuple(_args, "ffs#", | |
| 967 &x, | |
| 968 &y, | |
| 969 &cstring__in__, &cstring__in_len__)) | |
| 970 return NULL; | |
| 971 cstring__len__ = cstring__in_len__; | |
| 972 CGContextShowTextAtPoint(_self->ob_itself, | |
| 973 x, | |
| 974 y, | |
| 975 cstring__in__, cstring__len__); | |
| 976 Py_INCREF(Py_None); | |
| 977 _res = Py_None; | |
| 978 return _res; | |
| 979 } | |
| 980 | |
| 981 static PyObject *CGContextRefObj_CGContextEndPage(CGContextRefObject *_self, PyObject *_args) | |
| 982 { | |
| 983 PyObject *_res = NULL; | |
| 984 if (!PyArg_ParseTuple(_args, "")) | |
| 985 return NULL; | |
| 986 CGContextEndPage(_self->ob_itself); | |
| 987 Py_INCREF(Py_None); | |
| 988 _res = Py_None; | |
| 989 return _res; | |
| 990 } | |
| 991 | |
| 992 static PyObject *CGContextRefObj_CGContextFlush(CGContextRefObject *_self, PyObject *_args) | |
| 993 { | |
| 994 PyObject *_res = NULL; | |
| 995 if (!PyArg_ParseTuple(_args, "")) | |
| 996 return NULL; | |
| 997 CGContextFlush(_self->ob_itself); | |
| 998 Py_INCREF(Py_None); | |
| 999 _res = Py_None; | |
| 1000 return _res; | |
| 1001 } | |
| 1002 | |
| 1003 static PyObject *CGContextRefObj_CGContextSynchronize(CGContextRefObject *_self, PyObject *_args) | |
| 1004 { | |
| 1005 PyObject *_res = NULL; | |
| 1006 if (!PyArg_ParseTuple(_args, "")) | |
| 1007 return NULL; | |
| 1008 CGContextSynchronize(_self->ob_itself); | |
| 1009 Py_INCREF(Py_None); | |
| 1010 _res = Py_None; | |
| 1011 return _res; | |
| 1012 } | |
| 1013 | |
| 1014 static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject *_self, PyObject *_args) | |
| 1015 { | |
| 1016 PyObject *_res = NULL; | |
| 1017 int shouldAntialias; | |
| 1018 if (!PyArg_ParseTuple(_args, "i", | |
| 1019 &shouldAntialias)) | |
| 1020 return NULL; | |
| 1021 CGContextSetShouldAntialias(_self->ob_itself, | |
| 1022 shouldAntialias); | |
| 1023 Py_INCREF(Py_None); | |
| 1024 _res = Py_None; | |
| 1025 return _res; | |
| 1026 } | |
| 1027 | |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1028 #ifndef __LP64__ |
|
22113
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1029 static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1030 { |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1031 PyObject *_res = NULL; |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1032 CGrafPtr port; |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1033 if (!PyArg_ParseTuple(_args, "O&", |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1034 GrafObj_Convert, &port)) |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1035 return NULL; |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1036 SyncCGContextOriginWithPort(_self->ob_itself, |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1037 port); |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1038 Py_INCREF(Py_None); |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1039 _res = Py_None; |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1040 return _res; |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1041 } |
|
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1042 |
|
22125
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1043 static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self, PyObject *_args) |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1044 { |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1045 PyObject *_res = NULL; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1046 Rect portRect; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1047 RgnHandle region; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1048 if (!PyArg_ParseTuple(_args, "O&O&", |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1049 PyMac_GetRect, &portRect, |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1050 ResObj_Convert, ®ion)) |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1051 return NULL; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1052 ClipCGContextToRegion(_self->ob_itself, |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1053 &portRect, |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1054 region); |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1055 Py_INCREF(Py_None); |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1056 _res = Py_None; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1057 return _res; |
|
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1058 } |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1059 #endif |
|
22125
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1060 |
| 21386 | 1061 static PyMethodDef CGContextRefObj_methods[] = { |
| 1062 {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, | |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1063 PyDoc_STR("() -> None")}, |
| 21386 | 1064 {"CGContextRestoreGState", (PyCFunction)CGContextRefObj_CGContextRestoreGState, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1065 PyDoc_STR("() -> None")}, |
| 21386 | 1066 {"CGContextScaleCTM", (PyCFunction)CGContextRefObj_CGContextScaleCTM, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1067 PyDoc_STR("(float sx, float sy) -> None")}, |
| 21386 | 1068 {"CGContextTranslateCTM", (PyCFunction)CGContextRefObj_CGContextTranslateCTM, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1069 PyDoc_STR("(float tx, float ty) -> None")}, |
| 21386 | 1070 {"CGContextRotateCTM", (PyCFunction)CGContextRefObj_CGContextRotateCTM, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1071 PyDoc_STR("(float angle) -> None")}, |
| 21386 | 1072 {"CGContextConcatCTM", (PyCFunction)CGContextRefObj_CGContextConcatCTM, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1073 PyDoc_STR("(CGAffineTransform transform) -> None")}, |
| 21386 | 1074 {"CGContextGetCTM", (PyCFunction)CGContextRefObj_CGContextGetCTM, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1075 PyDoc_STR("() -> (CGAffineTransform _rv)")}, |
| 21386 | 1076 {"CGContextSetLineWidth", (PyCFunction)CGContextRefObj_CGContextSetLineWidth, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1077 PyDoc_STR("(float width) -> None")}, |
| 21386 | 1078 {"CGContextSetLineCap", (PyCFunction)CGContextRefObj_CGContextSetLineCap, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1079 PyDoc_STR("(int cap) -> None")}, |
| 21386 | 1080 {"CGContextSetLineJoin", (PyCFunction)CGContextRefObj_CGContextSetLineJoin, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1081 PyDoc_STR("(int join) -> None")}, |
| 21386 | 1082 {"CGContextSetMiterLimit", (PyCFunction)CGContextRefObj_CGContextSetMiterLimit, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1083 PyDoc_STR("(float limit) -> None")}, |
| 21386 | 1084 {"CGContextSetFlatness", (PyCFunction)CGContextRefObj_CGContextSetFlatness, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1085 PyDoc_STR("(float flatness) -> None")}, |
| 21386 | 1086 {"CGContextSetAlpha", (PyCFunction)CGContextRefObj_CGContextSetAlpha, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1087 PyDoc_STR("(float alpha) -> None")}, |
| 21386 | 1088 {"CGContextBeginPath", (PyCFunction)CGContextRefObj_CGContextBeginPath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1089 PyDoc_STR("() -> None")}, |
| 21386 | 1090 {"CGContextMoveToPoint", (PyCFunction)CGContextRefObj_CGContextMoveToPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1091 PyDoc_STR("(float x, float y) -> None")}, |
| 21386 | 1092 {"CGContextAddLineToPoint", (PyCFunction)CGContextRefObj_CGContextAddLineToPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1093 PyDoc_STR("(float x, float y) -> None")}, |
| 21386 | 1094 {"CGContextAddCurveToPoint", (PyCFunction)CGContextRefObj_CGContextAddCurveToPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1095 PyDoc_STR("(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y) -> None")}, |
| 21386 | 1096 {"CGContextAddQuadCurveToPoint", (PyCFunction)CGContextRefObj_CGContextAddQuadCurveToPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1097 PyDoc_STR("(float cpx, float cpy, float x, float y) -> None")}, |
| 21386 | 1098 {"CGContextClosePath", (PyCFunction)CGContextRefObj_CGContextClosePath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1099 PyDoc_STR("() -> None")}, |
| 21386 | 1100 {"CGContextAddRect", (PyCFunction)CGContextRefObj_CGContextAddRect, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1101 PyDoc_STR("(CGRect rect) -> None")}, |
| 21386 | 1102 {"CGContextAddArc", (PyCFunction)CGContextRefObj_CGContextAddArc, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1103 PyDoc_STR("(float x, float y, float radius, float startAngle, float endAngle, int clockwise) -> None")}, |
| 21386 | 1104 {"CGContextAddArcToPoint", (PyCFunction)CGContextRefObj_CGContextAddArcToPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1105 PyDoc_STR("(float x1, float y1, float x2, float y2, float radius) -> None")}, |
| 21386 | 1106 {"CGContextIsPathEmpty", (PyCFunction)CGContextRefObj_CGContextIsPathEmpty, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1107 PyDoc_STR("() -> (int _rv)")}, |
| 21386 | 1108 {"CGContextGetPathCurrentPoint", (PyCFunction)CGContextRefObj_CGContextGetPathCurrentPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1109 PyDoc_STR("() -> (CGPoint _rv)")}, |
| 21386 | 1110 {"CGContextGetPathBoundingBox", (PyCFunction)CGContextRefObj_CGContextGetPathBoundingBox, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1111 PyDoc_STR("() -> (CGRect _rv)")}, |
| 21386 | 1112 {"CGContextDrawPath", (PyCFunction)CGContextRefObj_CGContextDrawPath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1113 PyDoc_STR("(int mode) -> None")}, |
| 21386 | 1114 {"CGContextFillPath", (PyCFunction)CGContextRefObj_CGContextFillPath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1115 PyDoc_STR("() -> None")}, |
| 21386 | 1116 {"CGContextEOFillPath", (PyCFunction)CGContextRefObj_CGContextEOFillPath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1117 PyDoc_STR("() -> None")}, |
| 21386 | 1118 {"CGContextStrokePath", (PyCFunction)CGContextRefObj_CGContextStrokePath, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1119 PyDoc_STR("() -> None")}, |
| 21386 | 1120 {"CGContextFillRect", (PyCFunction)CGContextRefObj_CGContextFillRect, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1121 PyDoc_STR("(CGRect rect) -> None")}, |
| 21386 | 1122 {"CGContextStrokeRect", (PyCFunction)CGContextRefObj_CGContextStrokeRect, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1123 PyDoc_STR("(CGRect rect) -> None")}, |
| 21386 | 1124 {"CGContextStrokeRectWithWidth", (PyCFunction)CGContextRefObj_CGContextStrokeRectWithWidth, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1125 PyDoc_STR("(CGRect rect, float width) -> None")}, |
| 21386 | 1126 {"CGContextClearRect", (PyCFunction)CGContextRefObj_CGContextClearRect, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1127 PyDoc_STR("(CGRect rect) -> None")}, |
| 21386 | 1128 {"CGContextClip", (PyCFunction)CGContextRefObj_CGContextClip, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1129 PyDoc_STR("() -> None")}, |
| 21386 | 1130 {"CGContextEOClip", (PyCFunction)CGContextRefObj_CGContextEOClip, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1131 PyDoc_STR("() -> None")}, |
| 21386 | 1132 {"CGContextClipToRect", (PyCFunction)CGContextRefObj_CGContextClipToRect, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1133 PyDoc_STR("(CGRect rect) -> None")}, |
| 21386 | 1134 {"CGContextSetGrayFillColor", (PyCFunction)CGContextRefObj_CGContextSetGrayFillColor, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1135 PyDoc_STR("(float gray, float alpha) -> None")}, |
| 21386 | 1136 {"CGContextSetGrayStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetGrayStrokeColor, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1137 PyDoc_STR("(float gray, float alpha) -> None")}, |
| 21386 | 1138 {"CGContextSetRGBFillColor", (PyCFunction)CGContextRefObj_CGContextSetRGBFillColor, 1, |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1139 PyDoc_STR("(float red, float green, float blue, float alpha) -> None")}, |
| 21386 | 1140 {"CGContextSetRGBStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetRGBStrokeColor, 1, |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1141 PyDoc_STR("(float red, float green, float blue, float alpha) -> None")}, |
| 21386 | 1142 {"CGContextSetCMYKFillColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKFillColor, 1, |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1143 PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")}, |
| 21386 | 1144 {"CGContextSetCMYKStrokeColor", (PyCFunction)CGContextRefObj_CGContextSetCMYKStrokeColor, 1, |
|
31091
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1145 PyDoc_STR("(float cyan, float magenta, float yellow, float black, float alpha) -> None")}, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1146 {"CGContextGetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextGetInterpolationQuality, 1, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1147 PyDoc_STR("() -> (int _rv)")}, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1148 {"CGContextSetInterpolationQuality", (PyCFunction)CGContextRefObj_CGContextSetInterpolationQuality, 1, |
|
3861eb467c29
Ported to Universal Headers 3.4.2. Qd and Qt remain to be done.
Jack Jansen <jack.jansen@cwi.nl>
parents:
30982
diff
changeset
|
1149 PyDoc_STR("(int quality) -> None")}, |
| 21386 | 1150 {"CGContextSetCharacterSpacing", (PyCFunction)CGContextRefObj_CGContextSetCharacterSpacing, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1151 PyDoc_STR("(float spacing) -> None")}, |
| 21386 | 1152 {"CGContextSetTextPosition", (PyCFunction)CGContextRefObj_CGContextSetTextPosition, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1153 PyDoc_STR("(float x, float y) -> None")}, |
| 21386 | 1154 {"CGContextGetTextPosition", (PyCFunction)CGContextRefObj_CGContextGetTextPosition, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1155 PyDoc_STR("() -> (CGPoint _rv)")}, |
| 21386 | 1156 {"CGContextSetTextMatrix", (PyCFunction)CGContextRefObj_CGContextSetTextMatrix, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1157 PyDoc_STR("(CGAffineTransform transform) -> None")}, |
| 21386 | 1158 {"CGContextGetTextMatrix", (PyCFunction)CGContextRefObj_CGContextGetTextMatrix, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1159 PyDoc_STR("() -> (CGAffineTransform _rv)")}, |
| 21386 | 1160 {"CGContextSetTextDrawingMode", (PyCFunction)CGContextRefObj_CGContextSetTextDrawingMode, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1161 PyDoc_STR("(int mode) -> None")}, |
| 21386 | 1162 {"CGContextSetFontSize", (PyCFunction)CGContextRefObj_CGContextSetFontSize, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1163 PyDoc_STR("(float size) -> None")}, |
| 21386 | 1164 {"CGContextSelectFont", (PyCFunction)CGContextRefObj_CGContextSelectFont, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1165 PyDoc_STR("(char * name, float size, int textEncoding) -> None")}, |
| 21386 | 1166 {"CGContextShowText", (PyCFunction)CGContextRefObj_CGContextShowText, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1167 PyDoc_STR("(Buffer cstring) -> None")}, |
| 21386 | 1168 {"CGContextShowTextAtPoint", (PyCFunction)CGContextRefObj_CGContextShowTextAtPoint, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1169 PyDoc_STR("(float x, float y, Buffer cstring) -> None")}, |
| 21386 | 1170 {"CGContextEndPage", (PyCFunction)CGContextRefObj_CGContextEndPage, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1171 PyDoc_STR("() -> None")}, |
| 21386 | 1172 {"CGContextFlush", (PyCFunction)CGContextRefObj_CGContextFlush, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1173 PyDoc_STR("() -> None")}, |
| 21386 | 1174 {"CGContextSynchronize", (PyCFunction)CGContextRefObj_CGContextSynchronize, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1175 PyDoc_STR("() -> None")}, |
| 21386 | 1176 {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1177 PyDoc_STR("(int shouldAntialias) -> None")}, |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1178 #ifndef __LP64__ |
|
22113
79f292dbabce
Added support for SyncCGContextOriginWithPort().
Just van Rossum <just@letterror.com>
parents:
21464
diff
changeset
|
1179 {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1180 PyDoc_STR("(CGrafPtr port) -> None")}, |
|
22125
74f16f7a6369
Added ClipCGContextToRegion() from Quickdraw.h.
Just van Rossum <just@letterror.com>
parents:
22113
diff
changeset
|
1181 {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1182 PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1183 #endif |
| 21386 | 1184 {NULL, NULL, 0} |
| 1185 }; | |
| 1186 | |
|
26464
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1187 #define CGContextRefObj_getsetlist NULL |
| 21386 | 1188 |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1189 |
| 21386 | 1190 #define CGContextRefObj_compare NULL |
| 1191 | |
| 1192 #define CGContextRefObj_repr NULL | |
| 1193 | |
| 1194 #define CGContextRefObj_hash NULL | |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1195 #define CGContextRefObj_tp_init 0 |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1196 |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1197 #define CGContextRefObj_tp_alloc PyType_GenericAlloc |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1198 |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1199 static PyObject *CGContextRefObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds) |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1200 { |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1201 PyObject *_self; |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1202 CGContextRef itself; |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1203 char *kw[] = {"itself", 0}; |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1204 |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1205 if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, CGContextRefObj_Convert, &itself)) return NULL; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1206 if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1207 ((CGContextRefObject *)_self)->ob_itself = itself; |
|
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1208 return _self; |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1209 } |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1210 |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1211 #define CGContextRefObj_tp_free PyObject_Del |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1212 |
| 21386 | 1213 |
| 1214 PyTypeObject CGContextRef_Type = { | |
| 1215 PyObject_HEAD_INIT(NULL) | |
| 1216 0, /*ob_size*/ | |
| 1217 "_CG.CGContextRef", /*tp_name*/ | |
| 1218 sizeof(CGContextRefObject), /*tp_basicsize*/ | |
| 1219 0, /*tp_itemsize*/ | |
| 1220 /* methods */ | |
| 1221 (destructor) CGContextRefObj_dealloc, /*tp_dealloc*/ | |
| 1222 0, /*tp_print*/ | |
|
26464
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1223 (getattrfunc)0, /*tp_getattr*/ |
|
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1224 (setattrfunc)0, /*tp_setattr*/ |
| 21386 | 1225 (cmpfunc) CGContextRefObj_compare, /*tp_compare*/ |
| 1226 (reprfunc) CGContextRefObj_repr, /*tp_repr*/ | |
| 1227 (PyNumberMethods *)0, /* tp_as_number */ | |
| 1228 (PySequenceMethods *)0, /* tp_as_sequence */ | |
| 1229 (PyMappingMethods *)0, /* tp_as_mapping */ | |
| 1230 (hashfunc) CGContextRefObj_hash, /*tp_hash*/ | |
|
26464
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1231 0, /*tp_call*/ |
|
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1232 0, /*tp_str*/ |
|
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1233 PyObject_GenericGetAttr, /*tp_getattro*/ |
|
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1234 PyObject_GenericSetAttr, /*tp_setattro */ |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1235 0, /*tp_as_buffer*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1236 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1237 0, /*tp_doc*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1238 0, /*tp_traverse*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1239 0, /*tp_clear*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1240 0, /*tp_richcompare*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1241 0, /*tp_weaklistoffset*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1242 0, /*tp_iter*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1243 0, /*tp_iternext*/ |
|
26464
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1244 CGContextRefObj_methods, /* tp_methods */ |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1245 0, /*tp_members*/ |
|
26464
14fc187334c5
Converted the Carbon modules to use PEP252-style objects, with
Jack Jansen <jack.jansen@cwi.nl>
parents:
24865
diff
changeset
|
1246 CGContextRefObj_getsetlist, /*tp_getset*/ |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1247 0, /*tp_base*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1248 0, /*tp_dict*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1249 0, /*tp_descr_get*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1250 0, /*tp_descr_set*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1251 0, /*tp_dictoffset*/ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1252 CGContextRefObj_tp_init, /* tp_init */ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1253 CGContextRefObj_tp_alloc, /* tp_alloc */ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1254 CGContextRefObj_tp_new, /* tp_new */ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1255 CGContextRefObj_tp_free, /* tp_free */ |
| 21386 | 1256 }; |
| 1257 | |
| 1258 /* ------------------ End object type CGContextRef ------------------ */ | |
| 1259 | |
| 1260 | |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1261 #ifndef __LP64__ |
| 21386 | 1262 static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) |
| 1263 { | |
| 1264 PyObject *_res = NULL; | |
| 1265 GrafPtr port; | |
| 1266 CGContextRef ctx; | |
| 1267 OSStatus _err; | |
| 1268 | |
| 1269 if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1270 return NULL; |
| 21386 | 1271 |
| 1272 _err = CreateCGContextForPort(port, &ctx); | |
| 1273 if (_err != noErr) | |
|
35200
5df1c692bb41
Updated (and regenerated) for name change in tp_init method arguments:
Jack Jansen <jack.jansen@cwi.nl>
parents:
31091
diff
changeset
|
1274 if (_err != noErr) return PyMac_Error(_err); |
| 21386 | 1275 _res = Py_BuildValue("O&", CGContextRefObj_New, ctx); |
| 1276 return _res; | |
| 1277 | |
| 1278 } | |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1279 #endif |
| 21386 | 1280 |
| 1281 static PyMethodDef CG_methods[] = { | |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1282 #ifndef __LP64__ |
| 21386 | 1283 {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, |
|
24865
b54cfa98b66b
Regenerated with PyDoc_STR() around docstrings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
23261
diff
changeset
|
1284 PyDoc_STR("(CGrafPtr) -> CGContextRef")}, |
|
47473
c34e34057714
MacOS X: Enable 4-way universal builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
35200
diff
changeset
|
1285 #endif |
| 21386 | 1286 {NULL, NULL, 0} |
| 1287 }; | |
| 1288 | |
| 1289 | |
| 1290 | |
| 1291 | |
| 1292 void init_CG(void) | |
| 1293 { | |
| 1294 PyObject *m; | |
| 1295 PyObject *d; | |
| 1296 | |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 m = Py_InitModule("_CG", CG_methods); | |
| 1301 d = PyModule_GetDict(m); | |
| 1302 CG_Error = PyMac_GetOSErrException(); | |
| 1303 if (CG_Error == NULL || | |
| 1304 PyDict_SetItemString(d, "Error", CG_Error) != 0) | |
| 1305 return; | |
| 1306 CGContextRef_Type.ob_type = &PyType_Type; | |
|
26769
aef3a03a79f1
- Various tweaks to shut up compiler warnings.
Jack Jansen <jack.jansen@cwi.nl>
parents:
26720
diff
changeset
|
1307 if (PyType_Ready(&CGContextRef_Type) < 0) return; |
| 21386 | 1308 Py_INCREF(&CGContextRef_Type); |
|
26524
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1309 PyModule_AddObject(m, "CGContextRef", (PyObject *)&CGContextRef_Type); |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1310 /* Backward-compatible name */ |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1311 Py_INCREF(&CGContextRef_Type); |
|
7aba859cee54
Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents:
26464
diff
changeset
|
1312 PyModule_AddObject(m, "CGContextRefType", (PyObject *)&CGContextRef_Type); |
| 21386 | 1313 } |
| 1314 | |
| 1315 /* ========================= End module _CG ========================= */ | |
| 1316 |
