blob: 88cddaf7d30116996e6df13e25a8968f3f4186ac [file] [log] [blame]
Guido van Rossum17448e21995-01-30 11:53:55 +00001
2/* =========================== Module Qd ============================ */
3
4#include "Python.h"
5
6
7
8#define SystemSevenOrLater 1
9
10#include "macglue.h"
11#include <Memory.h>
12#include <Dialogs.h>
13#include <Menus.h>
14#include <Controls.h>
15
16extern PyObject *ResObj_New(Handle);
17extern int ResObj_Convert(PyObject *, Handle *);
Jack Jansen425e9eb1995-12-12 15:02:03 +000018extern PyObject *OptResObj_New(Handle);
19extern int OptResObj_Convert(PyObject *, Handle *);
Guido van Rossum17448e21995-01-30 11:53:55 +000020
21extern PyObject *WinObj_New(WindowPtr);
22extern int WinObj_Convert(PyObject *, WindowPtr *);
Jack Jansen330381c1995-11-15 15:18:01 +000023extern PyTypeObject Window_Type;
24#define WinObj_Check(x) ((x)->ob_type == &Window_Type)
Guido van Rossum17448e21995-01-30 11:53:55 +000025
26extern PyObject *DlgObj_New(DialogPtr);
27extern int DlgObj_Convert(PyObject *, DialogPtr *);
28extern PyTypeObject Dialog_Type;
29#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
30
31extern PyObject *MenuObj_New(MenuHandle);
32extern int MenuObj_Convert(PyObject *, MenuHandle *);
33
34extern PyObject *CtlObj_New(ControlHandle);
35extern int CtlObj_Convert(PyObject *, ControlHandle *);
36
Jack Jansen330381c1995-11-15 15:18:01 +000037extern PyObject *GrafObj_New(GrafPtr);
38extern int GrafObj_Convert(PyObject *, GrafPtr *);
39
Jack Jansen41058c01995-11-16 22:48:29 +000040extern PyObject *BMObj_New(BitMapPtr);
41extern int BMObj_Convert(PyObject *, BitMapPtr *);
42
Jack Jansenb5394061996-01-05 18:06:41 +000043extern PyObject *PMObj_New(PixMapHandle);
44extern int PMObj_Convert(PyObject *, PixMapHandle *);
45
Guido van Rossum17448e21995-01-30 11:53:55 +000046extern PyObject *WinObj_WhichWindow(WindowPtr);
47
48#include <QuickDraw.h>
49#include <Desk.h>
50
51#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
52
Jack Jansen232f3cd1995-12-09 14:04:31 +000053/*
54** Parse/generate RGB records
55*/
56PyObject *QdRGB_New(itself)
57 RGBColorPtr itself;
58{
59
60 return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue);
61}
62
63QdRGB_Convert(v, p_itself)
64 PyObject *v;
65 RGBColorPtr p_itself;
66{
67 long red, green, blue;
68
69 if( !PyArg_ParseTuple(v, "lll", &red, &green, &blue) )
70 return 0;
71 p_itself->red = (unsigned short)red;
72 p_itself->green = (unsigned short)green;
73 p_itself->blue = (unsigned short)blue;
74 return 1;
75}
76
Jack Jansen3a50f8a1996-01-11 16:17:14 +000077/*
78** Generate FontInfo records
79*/
80static
81PyObject *QdFI_New(itself)
82 FontInfo *itself;
83{
84
85 return Py_BuildValue("hhhh", itself->ascent, itself->descent,
86 itself->widMax, itself->leading);
87}
88
89
Jack Jansen232f3cd1995-12-09 14:04:31 +000090
Guido van Rossum17448e21995-01-30 11:53:55 +000091static PyObject *Qd_Error;
92
Jack Jansen330381c1995-11-15 15:18:01 +000093/* ---------------------- Object type GrafPort ---------------------- */
94
95PyTypeObject GrafPort_Type;
96
97#define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type)
98
99typedef struct GrafPortObject {
100 PyObject_HEAD
101 GrafPtr ob_itself;
102} GrafPortObject;
103
104PyObject *GrafObj_New(itself)
105 GrafPtr itself;
Guido van Rossum17448e21995-01-30 11:53:55 +0000106{
Jack Jansen330381c1995-11-15 15:18:01 +0000107 GrafPortObject *it;
108 if (itself == NULL) return PyMac_Error(resNotFound);
109 it = PyObject_NEW(GrafPortObject, &GrafPort_Type);
110 if (it == NULL) return NULL;
111 it->ob_itself = itself;
112 return (PyObject *)it;
113}
114GrafObj_Convert(v, p_itself)
115 PyObject *v;
116 GrafPtr *p_itself;
117{
118 if (DlgObj_Check(v) || WinObj_Check(v)) {
119 *p_itself = ((GrafPortObject *)v)->ob_itself;
120 return 1;
121 }
122 if (!GrafObj_Check(v))
123 {
124 PyErr_SetString(PyExc_TypeError, "GrafPort required");
125 return 0;
126 }
127 *p_itself = ((GrafPortObject *)v)->ob_itself;
128 return 1;
Guido van Rossum17448e21995-01-30 11:53:55 +0000129}
130
Jack Jansen330381c1995-11-15 15:18:01 +0000131static void GrafObj_dealloc(self)
132 GrafPortObject *self;
Guido van Rossum17448e21995-01-30 11:53:55 +0000133{
Jack Jansen330381c1995-11-15 15:18:01 +0000134 /* Cleanup of self->ob_itself goes here */
135 PyMem_DEL(self);
Guido van Rossume56db431995-03-19 22:49:50 +0000136}
137
Jack Jansen330381c1995-11-15 15:18:01 +0000138static PyMethodDef GrafObj_methods[] = {
139 {NULL, NULL, 0}
140};
141
142PyMethodChain GrafObj_chain = { GrafObj_methods, NULL };
143
144static PyObject *GrafObj_getattr(self, name)
145 GrafPortObject *self;
146 char *name;
Guido van Rossume56db431995-03-19 22:49:50 +0000147{
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000148
149 { CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
Jack Jansen330381c1995-11-15 15:18:01 +0000150
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000151 if ( strcmp(name, "data") == 0 )
152 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(GrafPort));
153
154 if ( (itself_color->portVersion&0xc000) == 0xc000 ) {
155 /* Color-only attributes */
156
157 if ( strcmp(name, "portBits") == 0 )
158 /* XXXX Do we need HLock() stuff here?? */
159 return BMObj_New((BitMapPtr)*itself_color->portPixMap);
160 if ( strcmp(name, "grafVars") == 0 )
161 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->visRgn);
162 if ( strcmp(name, "chExtra") == 0 )
163 return Py_BuildValue("h", itself_color->chExtra);
164 if ( strcmp(name, "pnLocHFrac") == 0 )
165 return Py_BuildValue("h", itself_color->pnLocHFrac);
Jack Jansen61f3df41996-01-15 14:39:56 +0000166 if ( strcmp(name, "bkPixPat") == 0 )
167 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->bkPixPat);
168 if ( strcmp(name, "rgbFgColor") == 0 )
169 return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbFgColor);
170 if ( strcmp(name, "rgbBkColor") == 0 )
171 return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbBkColor);
172 if ( strcmp(name, "pnPixPat") == 0 )
173 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->pnPixPat);
174 if ( strcmp(name, "fillPixPat") == 0 )
175 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->fillPixPat);
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000176 } else {
177 /* Mono-only attributes */
178 if ( strcmp(name, "portBits") == 0 )
179 return BMObj_New(&self->ob_itself->portBits);
Jack Jansen61f3df41996-01-15 14:39:56 +0000180 if ( strcmp(name, "bkPat") == 0 )
181 return Py_BuildValue("s#", (char *)&self->ob_itself->bkPat, sizeof(Pattern));
182 if ( strcmp(name, "fillPat") == 0 )
183 return Py_BuildValue("s#", (char *)&self->ob_itself->fillPat, sizeof(Pattern));
184 if ( strcmp(name, "pnPat") == 0 )
185 return Py_BuildValue("s#", (char *)&self->ob_itself->pnPat, sizeof(Pattern));
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000186 }
187 /*
188 ** Accessible for both color/mono windows.
189 ** portVersion is really color-only, but we put it here
190 ** for convenience
191 */
192 if ( strcmp(name, "portVersion") == 0 )
193 return Py_BuildValue("h", itself_color->portVersion);
194 if ( strcmp(name, "device") == 0 )
195 return PyInt_FromLong((long)self->ob_itself->device);
196 if ( strcmp(name, "portRect") == 0 )
197 return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->portRect);
198 if ( strcmp(name, "visRgn") == 0 )
199 return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->visRgn);
200 if ( strcmp(name, "clipRgn") == 0 )
201 return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->clipRgn);
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000202 if ( strcmp(name, "pnLoc") == 0 )
203 return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnLoc);
204 if ( strcmp(name, "pnSize") == 0 )
205 return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnSize);
206 if ( strcmp(name, "pnMode") == 0 )
207 return Py_BuildValue("h", self->ob_itself->pnMode);
Jack Jansen3a50f8a1996-01-11 16:17:14 +0000208 if ( strcmp(name, "pnVis") == 0 )
209 return Py_BuildValue("h", self->ob_itself->pnVis);
210 if ( strcmp(name, "txFont") == 0 )
211 return Py_BuildValue("h", self->ob_itself->txFont);
212 if ( strcmp(name, "txFace") == 0 )
213 return Py_BuildValue("h", (short)self->ob_itself->txFace);
214 if ( strcmp(name, "txMode") == 0 )
215 return Py_BuildValue("h", self->ob_itself->txMode);
216 if ( strcmp(name, "txSize") == 0 )
217 return Py_BuildValue("h", self->ob_itself->txSize);
218 if ( strcmp(name, "spExtra") == 0 )
219 return Py_BuildValue("O&", PyMac_BuildFixed, self->ob_itself->spExtra);
220 /* XXXX Add more, as needed */
221 }
Jack Jansen330381c1995-11-15 15:18:01 +0000222 return Py_FindMethodInChain(&GrafObj_chain, (PyObject *)self, name);
Guido van Rossum17448e21995-01-30 11:53:55 +0000223}
224
Jack Jansen330381c1995-11-15 15:18:01 +0000225#define GrafObj_setattr NULL
226
227PyTypeObject GrafPort_Type = {
228 PyObject_HEAD_INIT(&PyType_Type)
229 0, /*ob_size*/
230 "GrafPort", /*tp_name*/
231 sizeof(GrafPortObject), /*tp_basicsize*/
232 0, /*tp_itemsize*/
233 /* methods */
234 (destructor) GrafObj_dealloc, /*tp_dealloc*/
235 0, /*tp_print*/
236 (getattrfunc) GrafObj_getattr, /*tp_getattr*/
237 (setattrfunc) GrafObj_setattr, /*tp_setattr*/
238};
239
240/* -------------------- End object type GrafPort -------------------- */
241
242
Jack Jansen41058c01995-11-16 22:48:29 +0000243/* ----------------------- Object type BitMap ----------------------- */
244
245PyTypeObject BitMap_Type;
246
247#define BMObj_Check(x) ((x)->ob_type == &BitMap_Type)
248
249typedef struct BitMapObject {
250 PyObject_HEAD
251 BitMapPtr ob_itself;
252 PyObject *referred_object;
253 BitMap *referred_bitmap;
254} BitMapObject;
255
256PyObject *BMObj_New(itself)
257 BitMapPtr itself;
258{
259 BitMapObject *it;
260 if (itself == NULL) return PyMac_Error(resNotFound);
261 it = PyObject_NEW(BitMapObject, &BitMap_Type);
262 if (it == NULL) return NULL;
263 it->ob_itself = itself;
264 it->referred_object = NULL;
265 it->referred_bitmap = NULL;
266 return (PyObject *)it;
267}
268BMObj_Convert(v, p_itself)
269 PyObject *v;
270 BitMapPtr *p_itself;
271{
272 if (!BMObj_Check(v))
273 {
274 PyErr_SetString(PyExc_TypeError, "BitMap required");
275 return 0;
276 }
277 *p_itself = ((BitMapObject *)v)->ob_itself;
278 return 1;
279}
280
281static void BMObj_dealloc(self)
282 BitMapObject *self;
283{
284 Py_XDECREF(self->referred_object);
285 if (self->referred_bitmap) free(self->referred_bitmap);
286 PyMem_DEL(self);
287}
288
289static PyMethodDef BMObj_methods[] = {
290 {NULL, NULL, 0}
291};
292
293PyMethodChain BMObj_chain = { BMObj_methods, NULL };
294
295static PyObject *BMObj_getattr(self, name)
296 BitMapObject *self;
297 char *name;
298{
299 if ( strcmp(name, "baseAddr") == 0 )
300 return PyInt_FromLong((long)self->ob_itself->baseAddr);
301 if ( strcmp(name, "rowBytes") == 0 )
302 return PyInt_FromLong((long)self->ob_itself->rowBytes);
303 if ( strcmp(name, "bounds") == 0 )
304 return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->bounds);
305 /* XXXX Add more, as needed */
Jack Jansen425e9eb1995-12-12 15:02:03 +0000306 if ( strcmp(name, "bitmap_data") == 0 )
307 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(BitMap));
308 if ( strcmp(name, "pixmap_data") == 0 )
309 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(PixMap));
Jack Jansen41058c01995-11-16 22:48:29 +0000310
311 return Py_FindMethodInChain(&BMObj_chain, (PyObject *)self, name);
312}
313
314#define BMObj_setattr NULL
315
316PyTypeObject BitMap_Type = {
317 PyObject_HEAD_INIT(&PyType_Type)
318 0, /*ob_size*/
319 "BitMap", /*tp_name*/
320 sizeof(BitMapObject), /*tp_basicsize*/
321 0, /*tp_itemsize*/
322 /* methods */
323 (destructor) BMObj_dealloc, /*tp_dealloc*/
324 0, /*tp_print*/
325 (getattrfunc) BMObj_getattr, /*tp_getattr*/
326 (setattrfunc) BMObj_setattr, /*tp_setattr*/
327};
328
329/* --------------------- End object type BitMap --------------------- */
330
331
Jack Jansenbdd07471996-01-29 15:44:03 +0000332/* ------------------ Object type QDGlobalsAccess ------------------- */
333
334staticforward PyTypeObject QDGlobalsAccess_Type;
335
336#define QDGA_Check(x) ((x)->ob_type == &QDGlobalsAccess_Type)
337
338typedef struct QDGlobalsAccessObject {
339 PyObject_HEAD
340} QDGlobalsAccessObject;
341
342static PyObject *QDGA_New()
343{
344 QDGlobalsAccessObject *it;
345 it = PyObject_NEW(QDGlobalsAccessObject, &QDGlobalsAccess_Type);
346 if (it == NULL) return NULL;
347 return (PyObject *)it;
348}
349
350static void QDGA_dealloc(self)
351 QDGlobalsAccessObject *self;
352{
353 PyMem_DEL(self);
354}
355
356static PyMethodDef QDGA_methods[] = {
357 {NULL, NULL, 0}
358};
359
360static PyMethodChain QDGA_chain = { QDGA_methods, NULL };
361
362static PyObject *QDGA_getattr(self, name)
363 QDGlobalsAccessObject *self;
364 char *name;
365{
366
367 if ( strcmp(name, "arrow") == 0 )
368 return PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
369 if ( strcmp(name, "black") == 0 )
370 return PyString_FromStringAndSize((char *)&qd.black, sizeof(qd.black));
371 if ( strcmp(name, "white") == 0 )
372 return PyString_FromStringAndSize((char *)&qd.white, sizeof(qd.white));
373 if ( strcmp(name, "gray") == 0 )
374 return PyString_FromStringAndSize((char *)&qd.gray, sizeof(qd.gray));
375 if ( strcmp(name, "ltGray") == 0 )
376 return PyString_FromStringAndSize((char *)&qd.ltGray, sizeof(qd.ltGray));
377 if ( strcmp(name, "dkGray") == 0 )
378 return PyString_FromStringAndSize((char *)&qd.dkGray, sizeof(qd.dkGray));
379 if ( strcmp(name, "screenBits") == 0 )
380 return BMObj_New(&qd.screenBits);
381 if ( strcmp(name, "thePort") == 0 )
382 return GrafObj_New(qd.thePort);
383 if ( strcmp(name, "randSeed") == 0 )
384 return Py_BuildValue("l", &qd.randSeed);
385
386 return Py_FindMethodInChain(&QDGA_chain, (PyObject *)self, name);
387}
388
389#define QDGA_setattr NULL
390
391staticforward PyTypeObject QDGlobalsAccess_Type = {
392 PyObject_HEAD_INIT(&PyType_Type)
393 0, /*ob_size*/
394 "QDGlobalsAccess", /*tp_name*/
395 sizeof(QDGlobalsAccessObject), /*tp_basicsize*/
396 0, /*tp_itemsize*/
397 /* methods */
398 (destructor) QDGA_dealloc, /*tp_dealloc*/
399 0, /*tp_print*/
400 (getattrfunc) QDGA_getattr, /*tp_getattr*/
401 (setattrfunc) QDGA_setattr, /*tp_setattr*/
402};
403
404/* ---------------- End object type QDGlobalsAccess ----------------- */
405
406
Guido van Rossum17448e21995-01-30 11:53:55 +0000407static PyObject *Qd_SetPort(_self, _args)
408 PyObject *_self;
409 PyObject *_args;
410{
411 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +0000412 GrafPtr port;
Guido van Rossum17448e21995-01-30 11:53:55 +0000413 if (!PyArg_ParseTuple(_args, "O&",
Jack Jansen330381c1995-11-15 15:18:01 +0000414 GrafObj_Convert, &port))
Guido van Rossum17448e21995-01-30 11:53:55 +0000415 return NULL;
Guido van Rossume56db431995-03-19 22:49:50 +0000416 SetPort(port);
417 Py_INCREF(Py_None);
418 _res = Py_None;
419 return _res;
420}
421
422static PyObject *Qd_GetPort(_self, _args)
423 PyObject *_self;
424 PyObject *_args;
425{
426 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +0000427 GrafPtr port;
Guido van Rossume56db431995-03-19 22:49:50 +0000428 if (!PyArg_ParseTuple(_args, ""))
429 return NULL;
430 GetPort(&port);
431 _res = Py_BuildValue("O&",
Jack Jansen330381c1995-11-15 15:18:01 +0000432 GrafObj_New, port);
Guido van Rossume56db431995-03-19 22:49:50 +0000433 return _res;
434}
435
436static PyObject *Qd_GrafDevice(_self, _args)
437 PyObject *_self;
438 PyObject *_args;
439{
440 PyObject *_res = NULL;
441 short device;
442 if (!PyArg_ParseTuple(_args, "h",
443 &device))
444 return NULL;
445 GrafDevice(device);
446 Py_INCREF(Py_None);
447 _res = Py_None;
448 return _res;
449}
450
Jack Jansen41058c01995-11-16 22:48:29 +0000451static PyObject *Qd_SetPortBits(_self, _args)
452 PyObject *_self;
453 PyObject *_args;
454{
455 PyObject *_res = NULL;
456 BitMapPtr bm;
457 if (!PyArg_ParseTuple(_args, "O&",
458 BMObj_Convert, &bm))
459 return NULL;
460 SetPortBits(bm);
461 Py_INCREF(Py_None);
462 _res = Py_None;
463 return _res;
464}
465
Guido van Rossume56db431995-03-19 22:49:50 +0000466static PyObject *Qd_PortSize(_self, _args)
467 PyObject *_self;
468 PyObject *_args;
469{
470 PyObject *_res = NULL;
471 short width;
472 short height;
473 if (!PyArg_ParseTuple(_args, "hh",
474 &width,
475 &height))
476 return NULL;
477 PortSize(width,
478 height);
479 Py_INCREF(Py_None);
480 _res = Py_None;
481 return _res;
482}
483
484static PyObject *Qd_MovePortTo(_self, _args)
485 PyObject *_self;
486 PyObject *_args;
487{
488 PyObject *_res = NULL;
489 short leftGlobal;
490 short topGlobal;
491 if (!PyArg_ParseTuple(_args, "hh",
492 &leftGlobal,
493 &topGlobal))
494 return NULL;
495 MovePortTo(leftGlobal,
496 topGlobal);
497 Py_INCREF(Py_None);
498 _res = Py_None;
499 return _res;
500}
501
502static PyObject *Qd_SetOrigin(_self, _args)
503 PyObject *_self;
504 PyObject *_args;
505{
506 PyObject *_res = NULL;
507 short h;
508 short v;
509 if (!PyArg_ParseTuple(_args, "hh",
510 &h,
511 &v))
512 return NULL;
513 SetOrigin(h,
514 v);
515 Py_INCREF(Py_None);
516 _res = Py_None;
517 return _res;
518}
519
520static PyObject *Qd_SetClip(_self, _args)
521 PyObject *_self;
522 PyObject *_args;
523{
524 PyObject *_res = NULL;
525 RgnHandle rgn;
526 if (!PyArg_ParseTuple(_args, "O&",
527 ResObj_Convert, &rgn))
528 return NULL;
529 SetClip(rgn);
530 Py_INCREF(Py_None);
531 _res = Py_None;
532 return _res;
533}
534
535static PyObject *Qd_GetClip(_self, _args)
536 PyObject *_self;
537 PyObject *_args;
538{
539 PyObject *_res = NULL;
540 RgnHandle rgn;
541 if (!PyArg_ParseTuple(_args, "O&",
542 ResObj_Convert, &rgn))
543 return NULL;
544 GetClip(rgn);
Guido van Rossum17448e21995-01-30 11:53:55 +0000545 Py_INCREF(Py_None);
546 _res = Py_None;
547 return _res;
548}
549
550static PyObject *Qd_ClipRect(_self, _args)
551 PyObject *_self;
552 PyObject *_args;
553{
554 PyObject *_res = NULL;
555 Rect r;
556 if (!PyArg_ParseTuple(_args, "O&",
557 PyMac_GetRect, &r))
558 return NULL;
559 ClipRect(&r);
560 Py_INCREF(Py_None);
561 _res = Py_None;
562 return _res;
563}
564
Jack Jansen04a02e71996-01-06 17:12:58 +0000565static PyObject *Qd_BackPat(_self, _args)
566 PyObject *_self;
567 PyObject *_args;
568{
569 PyObject *_res = NULL;
570 Pattern *pat__in__;
571 int pat__in_len__;
572 if (!PyArg_ParseTuple(_args, "s#",
573 (char **)&pat__in__, &pat__in_len__))
574 return NULL;
575 if (pat__in_len__ != sizeof(Pattern))
576 {
577 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
578 goto pat__error__;
579 }
580 BackPat(pat__in__);
581 Py_INCREF(Py_None);
582 _res = Py_None;
583 pat__error__: ;
584 return _res;
585}
586
Guido van Rossume56db431995-03-19 22:49:50 +0000587static PyObject *Qd_InitCursor(_self, _args)
588 PyObject *_self;
589 PyObject *_args;
590{
591 PyObject *_res = NULL;
592 if (!PyArg_ParseTuple(_args, ""))
593 return NULL;
594 InitCursor();
595 Py_INCREF(Py_None);
596 _res = Py_None;
597 return _res;
598}
599
Jack Jansenb5394061996-01-05 18:06:41 +0000600static PyObject *Qd_SetCursor(_self, _args)
601 PyObject *_self;
602 PyObject *_args;
603{
604 PyObject *_res = NULL;
605 Cursor *crsr__in__;
606 int crsr__in_len__;
607 if (!PyArg_ParseTuple(_args, "s#",
608 (char **)&crsr__in__, &crsr__in_len__))
609 return NULL;
610 if (crsr__in_len__ != sizeof(Cursor))
611 {
612 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Cursor)");
613 goto crsr__error__;
614 }
615 SetCursor(crsr__in__);
616 Py_INCREF(Py_None);
617 _res = Py_None;
618 crsr__error__: ;
619 return _res;
620}
621
Guido van Rossume56db431995-03-19 22:49:50 +0000622static PyObject *Qd_HideCursor(_self, _args)
623 PyObject *_self;
624 PyObject *_args;
625{
626 PyObject *_res = NULL;
627 if (!PyArg_ParseTuple(_args, ""))
628 return NULL;
629 HideCursor();
630 Py_INCREF(Py_None);
631 _res = Py_None;
632 return _res;
633}
634
635static PyObject *Qd_ShowCursor(_self, _args)
636 PyObject *_self;
637 PyObject *_args;
638{
639 PyObject *_res = NULL;
640 if (!PyArg_ParseTuple(_args, ""))
641 return NULL;
642 ShowCursor();
643 Py_INCREF(Py_None);
644 _res = Py_None;
645 return _res;
646}
647
648static PyObject *Qd_ObscureCursor(_self, _args)
649 PyObject *_self;
650 PyObject *_args;
651{
652 PyObject *_res = NULL;
653 if (!PyArg_ParseTuple(_args, ""))
654 return NULL;
655 ObscureCursor();
656 Py_INCREF(Py_None);
657 _res = Py_None;
658 return _res;
659}
660
661static PyObject *Qd_HidePen(_self, _args)
662 PyObject *_self;
663 PyObject *_args;
664{
665 PyObject *_res = NULL;
666 if (!PyArg_ParseTuple(_args, ""))
667 return NULL;
668 HidePen();
669 Py_INCREF(Py_None);
670 _res = Py_None;
671 return _res;
672}
673
674static PyObject *Qd_ShowPen(_self, _args)
675 PyObject *_self;
676 PyObject *_args;
677{
678 PyObject *_res = NULL;
679 if (!PyArg_ParseTuple(_args, ""))
680 return NULL;
681 ShowPen();
682 Py_INCREF(Py_None);
683 _res = Py_None;
684 return _res;
685}
686
687static PyObject *Qd_GetPen(_self, _args)
688 PyObject *_self;
689 PyObject *_args;
690{
691 PyObject *_res = NULL;
692 Point pt;
Jack Jansen1d8ede71996-01-08 23:47:31 +0000693 if (!PyArg_ParseTuple(_args, ""))
Guido van Rossume56db431995-03-19 22:49:50 +0000694 return NULL;
695 GetPen(&pt);
696 _res = Py_BuildValue("O&",
697 PyMac_BuildPoint, pt);
698 return _res;
699}
700
Jack Jansen04a02e71996-01-06 17:12:58 +0000701static PyObject *Qd_GetPenState(_self, _args)
702 PyObject *_self;
703 PyObject *_args;
704{
705 PyObject *_res = NULL;
706 PenState pnState__out__;
707 if (!PyArg_ParseTuple(_args, ""))
708 return NULL;
709 GetPenState(&pnState__out__);
710 _res = Py_BuildValue("s#",
711 (char *)&pnState__out__, (int)sizeof(PenState));
712 pnState__error__: ;
713 return _res;
714}
715
716static PyObject *Qd_SetPenState(_self, _args)
717 PyObject *_self;
718 PyObject *_args;
719{
720 PyObject *_res = NULL;
721 PenState *pnState__in__;
722 int pnState__in_len__;
723 if (!PyArg_ParseTuple(_args, "s#",
724 (char **)&pnState__in__, &pnState__in_len__))
725 return NULL;
726 if (pnState__in_len__ != sizeof(PenState))
727 {
728 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(PenState)");
729 goto pnState__error__;
730 }
731 SetPenState(pnState__in__);
732 Py_INCREF(Py_None);
733 _res = Py_None;
734 pnState__error__: ;
735 return _res;
736}
737
Guido van Rossume56db431995-03-19 22:49:50 +0000738static PyObject *Qd_PenSize(_self, _args)
739 PyObject *_self;
740 PyObject *_args;
741{
742 PyObject *_res = NULL;
743 short width;
744 short height;
745 if (!PyArg_ParseTuple(_args, "hh",
746 &width,
747 &height))
748 return NULL;
749 PenSize(width,
750 height);
751 Py_INCREF(Py_None);
752 _res = Py_None;
753 return _res;
754}
755
756static PyObject *Qd_PenMode(_self, _args)
757 PyObject *_self;
758 PyObject *_args;
759{
760 PyObject *_res = NULL;
761 short mode;
762 if (!PyArg_ParseTuple(_args, "h",
763 &mode))
764 return NULL;
765 PenMode(mode);
766 Py_INCREF(Py_None);
767 _res = Py_None;
768 return _res;
769}
770
Jack Jansen04a02e71996-01-06 17:12:58 +0000771static PyObject *Qd_PenPat(_self, _args)
772 PyObject *_self;
773 PyObject *_args;
774{
775 PyObject *_res = NULL;
776 Pattern *pat__in__;
777 int pat__in_len__;
778 if (!PyArg_ParseTuple(_args, "s#",
779 (char **)&pat__in__, &pat__in_len__))
780 return NULL;
781 if (pat__in_len__ != sizeof(Pattern))
782 {
783 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
784 goto pat__error__;
785 }
786 PenPat(pat__in__);
787 Py_INCREF(Py_None);
788 _res = Py_None;
789 pat__error__: ;
790 return _res;
791}
792
Guido van Rossume56db431995-03-19 22:49:50 +0000793static PyObject *Qd_PenNormal(_self, _args)
794 PyObject *_self;
795 PyObject *_args;
796{
797 PyObject *_res = NULL;
798 if (!PyArg_ParseTuple(_args, ""))
799 return NULL;
800 PenNormal();
801 Py_INCREF(Py_None);
802 _res = Py_None;
803 return _res;
804}
805
806static PyObject *Qd_MoveTo(_self, _args)
807 PyObject *_self;
808 PyObject *_args;
809{
810 PyObject *_res = NULL;
811 short h;
812 short v;
813 if (!PyArg_ParseTuple(_args, "hh",
814 &h,
815 &v))
816 return NULL;
817 MoveTo(h,
818 v);
819 Py_INCREF(Py_None);
820 _res = Py_None;
821 return _res;
822}
823
824static PyObject *Qd_Move(_self, _args)
825 PyObject *_self;
826 PyObject *_args;
827{
828 PyObject *_res = NULL;
829 short dh;
830 short dv;
831 if (!PyArg_ParseTuple(_args, "hh",
832 &dh,
833 &dv))
834 return NULL;
835 Move(dh,
836 dv);
837 Py_INCREF(Py_None);
838 _res = Py_None;
839 return _res;
840}
841
842static PyObject *Qd_LineTo(_self, _args)
843 PyObject *_self;
844 PyObject *_args;
845{
846 PyObject *_res = NULL;
847 short h;
848 short v;
849 if (!PyArg_ParseTuple(_args, "hh",
850 &h,
851 &v))
852 return NULL;
853 LineTo(h,
854 v);
855 Py_INCREF(Py_None);
856 _res = Py_None;
857 return _res;
858}
859
860static PyObject *Qd_Line(_self, _args)
861 PyObject *_self;
862 PyObject *_args;
863{
864 PyObject *_res = NULL;
865 short dh;
866 short dv;
867 if (!PyArg_ParseTuple(_args, "hh",
868 &dh,
869 &dv))
870 return NULL;
871 Line(dh,
872 dv);
873 Py_INCREF(Py_None);
874 _res = Py_None;
875 return _res;
876}
877
Guido van Rossume56db431995-03-19 22:49:50 +0000878static PyObject *Qd_ForeColor(_self, _args)
879 PyObject *_self;
880 PyObject *_args;
881{
882 PyObject *_res = NULL;
883 long color;
884 if (!PyArg_ParseTuple(_args, "l",
885 &color))
886 return NULL;
887 ForeColor(color);
888 Py_INCREF(Py_None);
889 _res = Py_None;
890 return _res;
891}
892
893static PyObject *Qd_BackColor(_self, _args)
894 PyObject *_self;
895 PyObject *_args;
896{
897 PyObject *_res = NULL;
898 long color;
899 if (!PyArg_ParseTuple(_args, "l",
900 &color))
901 return NULL;
902 BackColor(color);
903 Py_INCREF(Py_None);
904 _res = Py_None;
905 return _res;
906}
907
908static PyObject *Qd_ColorBit(_self, _args)
909 PyObject *_self;
910 PyObject *_args;
911{
912 PyObject *_res = NULL;
913 short whichBit;
914 if (!PyArg_ParseTuple(_args, "h",
915 &whichBit))
916 return NULL;
917 ColorBit(whichBit);
918 Py_INCREF(Py_None);
919 _res = Py_None;
920 return _res;
921}
922
923static PyObject *Qd_SetRect(_self, _args)
924 PyObject *_self;
925 PyObject *_args;
926{
927 PyObject *_res = NULL;
928 Rect r;
929 short left;
930 short top;
931 short right;
932 short bottom;
933 if (!PyArg_ParseTuple(_args, "hhhh",
934 &left,
935 &top,
936 &right,
937 &bottom))
938 return NULL;
939 SetRect(&r,
940 left,
941 top,
942 right,
943 bottom);
944 _res = Py_BuildValue("O&",
945 PyMac_BuildRect, &r);
946 return _res;
947}
948
949static PyObject *Qd_OffsetRect(_self, _args)
950 PyObject *_self;
951 PyObject *_args;
952{
953 PyObject *_res = NULL;
954 Rect r;
955 short dh;
956 short dv;
Jack Jansen54c8f7e1995-11-14 10:46:01 +0000957 if (!PyArg_ParseTuple(_args, "O&hh",
958 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +0000959 &dh,
960 &dv))
961 return NULL;
962 OffsetRect(&r,
963 dh,
964 dv);
965 _res = Py_BuildValue("O&",
966 PyMac_BuildRect, &r);
967 return _res;
968}
969
970static PyObject *Qd_InsetRect(_self, _args)
971 PyObject *_self;
972 PyObject *_args;
973{
974 PyObject *_res = NULL;
975 Rect r;
976 short dh;
977 short dv;
Jack Jansen54c8f7e1995-11-14 10:46:01 +0000978 if (!PyArg_ParseTuple(_args, "O&hh",
979 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +0000980 &dh,
981 &dv))
982 return NULL;
983 InsetRect(&r,
984 dh,
985 dv);
986 _res = Py_BuildValue("O&",
987 PyMac_BuildRect, &r);
988 return _res;
989}
990
991static PyObject *Qd_SectRect(_self, _args)
992 PyObject *_self;
993 PyObject *_args;
994{
995 PyObject *_res = NULL;
996 Boolean _rv;
997 Rect src1;
998 Rect src2;
999 Rect dstRect;
1000 if (!PyArg_ParseTuple(_args, "O&O&",
1001 PyMac_GetRect, &src1,
1002 PyMac_GetRect, &src2))
1003 return NULL;
1004 _rv = SectRect(&src1,
1005 &src2,
1006 &dstRect);
1007 _res = Py_BuildValue("bO&",
1008 _rv,
1009 PyMac_BuildRect, &dstRect);
1010 return _res;
1011}
1012
1013static PyObject *Qd_UnionRect(_self, _args)
1014 PyObject *_self;
1015 PyObject *_args;
1016{
1017 PyObject *_res = NULL;
1018 Rect src1;
1019 Rect src2;
1020 Rect dstRect;
1021 if (!PyArg_ParseTuple(_args, "O&O&",
1022 PyMac_GetRect, &src1,
1023 PyMac_GetRect, &src2))
1024 return NULL;
1025 UnionRect(&src1,
1026 &src2,
1027 &dstRect);
1028 _res = Py_BuildValue("O&",
1029 PyMac_BuildRect, &dstRect);
1030 return _res;
1031}
1032
1033static PyObject *Qd_EqualRect(_self, _args)
1034 PyObject *_self;
1035 PyObject *_args;
1036{
1037 PyObject *_res = NULL;
1038 Boolean _rv;
1039 Rect rect1;
1040 Rect rect2;
1041 if (!PyArg_ParseTuple(_args, "O&O&",
1042 PyMac_GetRect, &rect1,
1043 PyMac_GetRect, &rect2))
1044 return NULL;
1045 _rv = EqualRect(&rect1,
1046 &rect2);
1047 _res = Py_BuildValue("b",
1048 _rv);
1049 return _res;
1050}
1051
1052static PyObject *Qd_EmptyRect(_self, _args)
1053 PyObject *_self;
1054 PyObject *_args;
1055{
1056 PyObject *_res = NULL;
1057 Boolean _rv;
1058 Rect r;
1059 if (!PyArg_ParseTuple(_args, "O&",
1060 PyMac_GetRect, &r))
1061 return NULL;
1062 _rv = EmptyRect(&r);
1063 _res = Py_BuildValue("b",
1064 _rv);
1065 return _res;
1066}
1067
1068static PyObject *Qd_FrameRect(_self, _args)
1069 PyObject *_self;
1070 PyObject *_args;
1071{
1072 PyObject *_res = NULL;
1073 Rect r;
1074 if (!PyArg_ParseTuple(_args, "O&",
1075 PyMac_GetRect, &r))
1076 return NULL;
1077 FrameRect(&r);
1078 Py_INCREF(Py_None);
1079 _res = Py_None;
1080 return _res;
1081}
1082
1083static PyObject *Qd_PaintRect(_self, _args)
1084 PyObject *_self;
1085 PyObject *_args;
1086{
1087 PyObject *_res = NULL;
1088 Rect r;
1089 if (!PyArg_ParseTuple(_args, "O&",
1090 PyMac_GetRect, &r))
1091 return NULL;
1092 PaintRect(&r);
1093 Py_INCREF(Py_None);
1094 _res = Py_None;
1095 return _res;
1096}
1097
Guido van Rossum17448e21995-01-30 11:53:55 +00001098static PyObject *Qd_EraseRect(_self, _args)
1099 PyObject *_self;
1100 PyObject *_args;
1101{
1102 PyObject *_res = NULL;
1103 Rect r;
1104 if (!PyArg_ParseTuple(_args, "O&",
1105 PyMac_GetRect, &r))
1106 return NULL;
1107 EraseRect(&r);
1108 Py_INCREF(Py_None);
1109 _res = Py_None;
1110 return _res;
1111}
1112
Guido van Rossume56db431995-03-19 22:49:50 +00001113static PyObject *Qd_InvertRect(_self, _args)
Guido van Rossum17448e21995-01-30 11:53:55 +00001114 PyObject *_self;
1115 PyObject *_args;
1116{
1117 PyObject *_res = NULL;
Guido van Rossume56db431995-03-19 22:49:50 +00001118 Rect r;
Guido van Rossum17448e21995-01-30 11:53:55 +00001119 if (!PyArg_ParseTuple(_args, "O&",
Guido van Rossume56db431995-03-19 22:49:50 +00001120 PyMac_GetRect, &r))
Guido van Rossum17448e21995-01-30 11:53:55 +00001121 return NULL;
Guido van Rossume56db431995-03-19 22:49:50 +00001122 InvertRect(&r);
Guido van Rossum17448e21995-01-30 11:53:55 +00001123 Py_INCREF(Py_None);
1124 _res = Py_None;
1125 return _res;
1126}
1127
Jack Jansen04a02e71996-01-06 17:12:58 +00001128static PyObject *Qd_FillRect(_self, _args)
1129 PyObject *_self;
1130 PyObject *_args;
1131{
1132 PyObject *_res = NULL;
1133 Rect r;
1134 Pattern *pat__in__;
1135 int pat__in_len__;
1136 if (!PyArg_ParseTuple(_args, "O&s#",
1137 PyMac_GetRect, &r,
1138 (char **)&pat__in__, &pat__in_len__))
1139 return NULL;
1140 if (pat__in_len__ != sizeof(Pattern))
1141 {
1142 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
1143 goto pat__error__;
1144 }
1145 FillRect(&r,
1146 pat__in__);
1147 Py_INCREF(Py_None);
1148 _res = Py_None;
1149 pat__error__: ;
1150 return _res;
1151}
1152
Guido van Rossume56db431995-03-19 22:49:50 +00001153static PyObject *Qd_FrameOval(_self, _args)
1154 PyObject *_self;
1155 PyObject *_args;
1156{
1157 PyObject *_res = NULL;
1158 Rect r;
1159 if (!PyArg_ParseTuple(_args, "O&",
1160 PyMac_GetRect, &r))
1161 return NULL;
1162 FrameOval(&r);
1163 Py_INCREF(Py_None);
1164 _res = Py_None;
1165 return _res;
1166}
1167
1168static PyObject *Qd_PaintOval(_self, _args)
1169 PyObject *_self;
1170 PyObject *_args;
1171{
1172 PyObject *_res = NULL;
1173 Rect r;
1174 if (!PyArg_ParseTuple(_args, "O&",
1175 PyMac_GetRect, &r))
1176 return NULL;
1177 PaintOval(&r);
1178 Py_INCREF(Py_None);
1179 _res = Py_None;
1180 return _res;
1181}
1182
1183static PyObject *Qd_EraseOval(_self, _args)
1184 PyObject *_self;
1185 PyObject *_args;
1186{
1187 PyObject *_res = NULL;
1188 Rect r;
1189 if (!PyArg_ParseTuple(_args, "O&",
1190 PyMac_GetRect, &r))
1191 return NULL;
1192 EraseOval(&r);
1193 Py_INCREF(Py_None);
1194 _res = Py_None;
1195 return _res;
1196}
1197
1198static PyObject *Qd_InvertOval(_self, _args)
1199 PyObject *_self;
1200 PyObject *_args;
1201{
1202 PyObject *_res = NULL;
1203 Rect r;
1204 if (!PyArg_ParseTuple(_args, "O&",
1205 PyMac_GetRect, &r))
1206 return NULL;
1207 InvertOval(&r);
1208 Py_INCREF(Py_None);
1209 _res = Py_None;
1210 return _res;
1211}
1212
Jack Jansen04a02e71996-01-06 17:12:58 +00001213static PyObject *Qd_FillOval(_self, _args)
1214 PyObject *_self;
1215 PyObject *_args;
1216{
1217 PyObject *_res = NULL;
1218 Rect r;
1219 Pattern *pat__in__;
1220 int pat__in_len__;
1221 if (!PyArg_ParseTuple(_args, "O&s#",
1222 PyMac_GetRect, &r,
1223 (char **)&pat__in__, &pat__in_len__))
1224 return NULL;
1225 if (pat__in_len__ != sizeof(Pattern))
1226 {
1227 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
1228 goto pat__error__;
1229 }
1230 FillOval(&r,
1231 pat__in__);
1232 Py_INCREF(Py_None);
1233 _res = Py_None;
1234 pat__error__: ;
1235 return _res;
1236}
1237
Guido van Rossume56db431995-03-19 22:49:50 +00001238static PyObject *Qd_FrameRoundRect(_self, _args)
1239 PyObject *_self;
1240 PyObject *_args;
1241{
1242 PyObject *_res = NULL;
1243 Rect r;
1244 short ovalWidth;
1245 short ovalHeight;
1246 if (!PyArg_ParseTuple(_args, "O&hh",
1247 PyMac_GetRect, &r,
1248 &ovalWidth,
1249 &ovalHeight))
1250 return NULL;
1251 FrameRoundRect(&r,
1252 ovalWidth,
1253 ovalHeight);
1254 Py_INCREF(Py_None);
1255 _res = Py_None;
1256 return _res;
1257}
1258
1259static PyObject *Qd_PaintRoundRect(_self, _args)
1260 PyObject *_self;
1261 PyObject *_args;
1262{
1263 PyObject *_res = NULL;
1264 Rect r;
1265 short ovalWidth;
1266 short ovalHeight;
1267 if (!PyArg_ParseTuple(_args, "O&hh",
1268 PyMac_GetRect, &r,
1269 &ovalWidth,
1270 &ovalHeight))
1271 return NULL;
1272 PaintRoundRect(&r,
1273 ovalWidth,
1274 ovalHeight);
1275 Py_INCREF(Py_None);
1276 _res = Py_None;
1277 return _res;
1278}
1279
1280static PyObject *Qd_EraseRoundRect(_self, _args)
1281 PyObject *_self;
1282 PyObject *_args;
1283{
1284 PyObject *_res = NULL;
1285 Rect r;
1286 short ovalWidth;
1287 short ovalHeight;
1288 if (!PyArg_ParseTuple(_args, "O&hh",
1289 PyMac_GetRect, &r,
1290 &ovalWidth,
1291 &ovalHeight))
1292 return NULL;
1293 EraseRoundRect(&r,
1294 ovalWidth,
1295 ovalHeight);
1296 Py_INCREF(Py_None);
1297 _res = Py_None;
1298 return _res;
1299}
1300
1301static PyObject *Qd_InvertRoundRect(_self, _args)
1302 PyObject *_self;
1303 PyObject *_args;
1304{
1305 PyObject *_res = NULL;
1306 Rect r;
1307 short ovalWidth;
1308 short ovalHeight;
1309 if (!PyArg_ParseTuple(_args, "O&hh",
1310 PyMac_GetRect, &r,
1311 &ovalWidth,
1312 &ovalHeight))
1313 return NULL;
1314 InvertRoundRect(&r,
1315 ovalWidth,
1316 ovalHeight);
1317 Py_INCREF(Py_None);
1318 _res = Py_None;
1319 return _res;
1320}
1321
Jack Jansen04a02e71996-01-06 17:12:58 +00001322static PyObject *Qd_FillRoundRect(_self, _args)
1323 PyObject *_self;
1324 PyObject *_args;
1325{
1326 PyObject *_res = NULL;
1327 Rect r;
1328 short ovalWidth;
1329 short ovalHeight;
1330 Pattern *pat__in__;
1331 int pat__in_len__;
1332 if (!PyArg_ParseTuple(_args, "O&hhs#",
1333 PyMac_GetRect, &r,
1334 &ovalWidth,
1335 &ovalHeight,
1336 (char **)&pat__in__, &pat__in_len__))
1337 return NULL;
1338 if (pat__in_len__ != sizeof(Pattern))
1339 {
1340 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
1341 goto pat__error__;
1342 }
1343 FillRoundRect(&r,
1344 ovalWidth,
1345 ovalHeight,
1346 pat__in__);
1347 Py_INCREF(Py_None);
1348 _res = Py_None;
1349 pat__error__: ;
1350 return _res;
1351}
1352
Guido van Rossume56db431995-03-19 22:49:50 +00001353static PyObject *Qd_FrameArc(_self, _args)
1354 PyObject *_self;
1355 PyObject *_args;
1356{
1357 PyObject *_res = NULL;
1358 Rect r;
1359 short startAngle;
1360 short arcAngle;
1361 if (!PyArg_ParseTuple(_args, "O&hh",
1362 PyMac_GetRect, &r,
1363 &startAngle,
1364 &arcAngle))
1365 return NULL;
1366 FrameArc(&r,
1367 startAngle,
1368 arcAngle);
1369 Py_INCREF(Py_None);
1370 _res = Py_None;
1371 return _res;
1372}
1373
1374static PyObject *Qd_PaintArc(_self, _args)
1375 PyObject *_self;
1376 PyObject *_args;
1377{
1378 PyObject *_res = NULL;
1379 Rect r;
1380 short startAngle;
1381 short arcAngle;
1382 if (!PyArg_ParseTuple(_args, "O&hh",
1383 PyMac_GetRect, &r,
1384 &startAngle,
1385 &arcAngle))
1386 return NULL;
1387 PaintArc(&r,
1388 startAngle,
1389 arcAngle);
1390 Py_INCREF(Py_None);
1391 _res = Py_None;
1392 return _res;
1393}
1394
1395static PyObject *Qd_EraseArc(_self, _args)
1396 PyObject *_self;
1397 PyObject *_args;
1398{
1399 PyObject *_res = NULL;
1400 Rect r;
1401 short startAngle;
1402 short arcAngle;
1403 if (!PyArg_ParseTuple(_args, "O&hh",
1404 PyMac_GetRect, &r,
1405 &startAngle,
1406 &arcAngle))
1407 return NULL;
1408 EraseArc(&r,
1409 startAngle,
1410 arcAngle);
1411 Py_INCREF(Py_None);
1412 _res = Py_None;
1413 return _res;
1414}
1415
1416static PyObject *Qd_InvertArc(_self, _args)
1417 PyObject *_self;
1418 PyObject *_args;
1419{
1420 PyObject *_res = NULL;
1421 Rect r;
1422 short startAngle;
1423 short arcAngle;
1424 if (!PyArg_ParseTuple(_args, "O&hh",
1425 PyMac_GetRect, &r,
1426 &startAngle,
1427 &arcAngle))
1428 return NULL;
1429 InvertArc(&r,
1430 startAngle,
1431 arcAngle);
1432 Py_INCREF(Py_None);
1433 _res = Py_None;
1434 return _res;
1435}
1436
Jack Jansen04a02e71996-01-06 17:12:58 +00001437static PyObject *Qd_FillArc(_self, _args)
1438 PyObject *_self;
1439 PyObject *_args;
1440{
1441 PyObject *_res = NULL;
1442 Rect r;
1443 short startAngle;
1444 short arcAngle;
1445 Pattern *pat__in__;
1446 int pat__in_len__;
1447 if (!PyArg_ParseTuple(_args, "O&hhs#",
1448 PyMac_GetRect, &r,
1449 &startAngle,
1450 &arcAngle,
1451 (char **)&pat__in__, &pat__in_len__))
1452 return NULL;
1453 if (pat__in_len__ != sizeof(Pattern))
1454 {
1455 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
1456 goto pat__error__;
1457 }
1458 FillArc(&r,
1459 startAngle,
1460 arcAngle,
1461 pat__in__);
1462 Py_INCREF(Py_None);
1463 _res = Py_None;
1464 pat__error__: ;
1465 return _res;
1466}
1467
Guido van Rossume56db431995-03-19 22:49:50 +00001468static PyObject *Qd_NewRgn(_self, _args)
1469 PyObject *_self;
1470 PyObject *_args;
1471{
1472 PyObject *_res = NULL;
1473 RgnHandle _rv;
1474 if (!PyArg_ParseTuple(_args, ""))
1475 return NULL;
1476 _rv = NewRgn();
1477 _res = Py_BuildValue("O&",
1478 ResObj_New, _rv);
1479 return _res;
1480}
1481
1482static PyObject *Qd_OpenRgn(_self, _args)
1483 PyObject *_self;
1484 PyObject *_args;
1485{
1486 PyObject *_res = NULL;
1487 if (!PyArg_ParseTuple(_args, ""))
1488 return NULL;
1489 OpenRgn();
1490 Py_INCREF(Py_None);
1491 _res = Py_None;
1492 return _res;
1493}
1494
1495static PyObject *Qd_CloseRgn(_self, _args)
1496 PyObject *_self;
1497 PyObject *_args;
1498{
1499 PyObject *_res = NULL;
1500 RgnHandle dstRgn;
1501 if (!PyArg_ParseTuple(_args, "O&",
1502 ResObj_Convert, &dstRgn))
1503 return NULL;
1504 CloseRgn(dstRgn);
1505 Py_INCREF(Py_None);
1506 _res = Py_None;
1507 return _res;
1508}
1509
Jack Jansen41058c01995-11-16 22:48:29 +00001510static PyObject *Qd_BitMapToRegion(_self, _args)
1511 PyObject *_self;
1512 PyObject *_args;
1513{
1514 PyObject *_res = NULL;
1515 OSErr _err;
1516 RgnHandle region;
1517 BitMapPtr bMap;
1518 if (!PyArg_ParseTuple(_args, "O&O&",
1519 ResObj_Convert, &region,
1520 BMObj_Convert, &bMap))
1521 return NULL;
1522 _err = BitMapToRegion(region,
1523 bMap);
1524 if (_err != noErr) return PyMac_Error(_err);
1525 Py_INCREF(Py_None);
1526 _res = Py_None;
1527 return _res;
1528}
1529
Guido van Rossume56db431995-03-19 22:49:50 +00001530static PyObject *Qd_DisposeRgn(_self, _args)
1531 PyObject *_self;
1532 PyObject *_args;
1533{
1534 PyObject *_res = NULL;
1535 RgnHandle rgn;
1536 if (!PyArg_ParseTuple(_args, "O&",
1537 ResObj_Convert, &rgn))
1538 return NULL;
1539 DisposeRgn(rgn);
1540 Py_INCREF(Py_None);
1541 _res = Py_None;
1542 return _res;
1543}
1544
1545static PyObject *Qd_CopyRgn(_self, _args)
1546 PyObject *_self;
1547 PyObject *_args;
1548{
1549 PyObject *_res = NULL;
1550 RgnHandle srcRgn;
1551 RgnHandle dstRgn;
1552 if (!PyArg_ParseTuple(_args, "O&O&",
1553 ResObj_Convert, &srcRgn,
1554 ResObj_Convert, &dstRgn))
1555 return NULL;
1556 CopyRgn(srcRgn,
1557 dstRgn);
1558 Py_INCREF(Py_None);
1559 _res = Py_None;
1560 return _res;
1561}
1562
1563static PyObject *Qd_SetEmptyRgn(_self, _args)
1564 PyObject *_self;
1565 PyObject *_args;
1566{
1567 PyObject *_res = NULL;
1568 RgnHandle rgn;
1569 if (!PyArg_ParseTuple(_args, "O&",
1570 ResObj_Convert, &rgn))
1571 return NULL;
1572 SetEmptyRgn(rgn);
1573 Py_INCREF(Py_None);
1574 _res = Py_None;
1575 return _res;
1576}
1577
1578static PyObject *Qd_SetRectRgn(_self, _args)
1579 PyObject *_self;
1580 PyObject *_args;
1581{
1582 PyObject *_res = NULL;
1583 RgnHandle rgn;
1584 short left;
1585 short top;
1586 short right;
1587 short bottom;
1588 if (!PyArg_ParseTuple(_args, "O&hhhh",
1589 ResObj_Convert, &rgn,
1590 &left,
1591 &top,
1592 &right,
1593 &bottom))
1594 return NULL;
1595 SetRectRgn(rgn,
1596 left,
1597 top,
1598 right,
1599 bottom);
1600 Py_INCREF(Py_None);
1601 _res = Py_None;
1602 return _res;
1603}
1604
1605static PyObject *Qd_RectRgn(_self, _args)
1606 PyObject *_self;
1607 PyObject *_args;
1608{
1609 PyObject *_res = NULL;
1610 RgnHandle rgn;
1611 Rect r;
1612 if (!PyArg_ParseTuple(_args, "O&O&",
1613 ResObj_Convert, &rgn,
1614 PyMac_GetRect, &r))
1615 return NULL;
1616 RectRgn(rgn,
1617 &r);
1618 Py_INCREF(Py_None);
1619 _res = Py_None;
1620 return _res;
1621}
1622
1623static PyObject *Qd_OffsetRgn(_self, _args)
1624 PyObject *_self;
1625 PyObject *_args;
1626{
1627 PyObject *_res = NULL;
1628 RgnHandle rgn;
1629 short dh;
1630 short dv;
1631 if (!PyArg_ParseTuple(_args, "O&hh",
1632 ResObj_Convert, &rgn,
1633 &dh,
1634 &dv))
1635 return NULL;
1636 OffsetRgn(rgn,
1637 dh,
1638 dv);
1639 Py_INCREF(Py_None);
1640 _res = Py_None;
1641 return _res;
1642}
1643
1644static PyObject *Qd_InsetRgn(_self, _args)
1645 PyObject *_self;
1646 PyObject *_args;
1647{
1648 PyObject *_res = NULL;
1649 RgnHandle rgn;
1650 short dh;
1651 short dv;
1652 if (!PyArg_ParseTuple(_args, "O&hh",
1653 ResObj_Convert, &rgn,
1654 &dh,
1655 &dv))
1656 return NULL;
1657 InsetRgn(rgn,
1658 dh,
1659 dv);
1660 Py_INCREF(Py_None);
1661 _res = Py_None;
1662 return _res;
1663}
1664
1665static PyObject *Qd_SectRgn(_self, _args)
1666 PyObject *_self;
1667 PyObject *_args;
1668{
1669 PyObject *_res = NULL;
1670 RgnHandle srcRgnA;
1671 RgnHandle srcRgnB;
1672 RgnHandle dstRgn;
1673 if (!PyArg_ParseTuple(_args, "O&O&O&",
1674 ResObj_Convert, &srcRgnA,
1675 ResObj_Convert, &srcRgnB,
1676 ResObj_Convert, &dstRgn))
1677 return NULL;
1678 SectRgn(srcRgnA,
1679 srcRgnB,
1680 dstRgn);
1681 Py_INCREF(Py_None);
1682 _res = Py_None;
1683 return _res;
1684}
1685
1686static PyObject *Qd_UnionRgn(_self, _args)
1687 PyObject *_self;
1688 PyObject *_args;
1689{
1690 PyObject *_res = NULL;
1691 RgnHandle srcRgnA;
1692 RgnHandle srcRgnB;
1693 RgnHandle dstRgn;
1694 if (!PyArg_ParseTuple(_args, "O&O&O&",
1695 ResObj_Convert, &srcRgnA,
1696 ResObj_Convert, &srcRgnB,
1697 ResObj_Convert, &dstRgn))
1698 return NULL;
1699 UnionRgn(srcRgnA,
1700 srcRgnB,
1701 dstRgn);
1702 Py_INCREF(Py_None);
1703 _res = Py_None;
1704 return _res;
1705}
1706
1707static PyObject *Qd_DiffRgn(_self, _args)
1708 PyObject *_self;
1709 PyObject *_args;
1710{
1711 PyObject *_res = NULL;
1712 RgnHandle srcRgnA;
1713 RgnHandle srcRgnB;
1714 RgnHandle dstRgn;
1715 if (!PyArg_ParseTuple(_args, "O&O&O&",
1716 ResObj_Convert, &srcRgnA,
1717 ResObj_Convert, &srcRgnB,
1718 ResObj_Convert, &dstRgn))
1719 return NULL;
1720 DiffRgn(srcRgnA,
1721 srcRgnB,
1722 dstRgn);
1723 Py_INCREF(Py_None);
1724 _res = Py_None;
1725 return _res;
1726}
1727
1728static PyObject *Qd_XorRgn(_self, _args)
1729 PyObject *_self;
1730 PyObject *_args;
1731{
1732 PyObject *_res = NULL;
1733 RgnHandle srcRgnA;
1734 RgnHandle srcRgnB;
1735 RgnHandle dstRgn;
1736 if (!PyArg_ParseTuple(_args, "O&O&O&",
1737 ResObj_Convert, &srcRgnA,
1738 ResObj_Convert, &srcRgnB,
1739 ResObj_Convert, &dstRgn))
1740 return NULL;
1741 XorRgn(srcRgnA,
1742 srcRgnB,
1743 dstRgn);
1744 Py_INCREF(Py_None);
1745 _res = Py_None;
1746 return _res;
1747}
1748
1749static PyObject *Qd_RectInRgn(_self, _args)
1750 PyObject *_self;
1751 PyObject *_args;
1752{
1753 PyObject *_res = NULL;
1754 Boolean _rv;
1755 Rect r;
1756 RgnHandle rgn;
1757 if (!PyArg_ParseTuple(_args, "O&O&",
1758 PyMac_GetRect, &r,
1759 ResObj_Convert, &rgn))
1760 return NULL;
1761 _rv = RectInRgn(&r,
1762 rgn);
1763 _res = Py_BuildValue("b",
1764 _rv);
1765 return _res;
1766}
1767
1768static PyObject *Qd_EqualRgn(_self, _args)
1769 PyObject *_self;
1770 PyObject *_args;
1771{
1772 PyObject *_res = NULL;
1773 Boolean _rv;
1774 RgnHandle rgnA;
1775 RgnHandle rgnB;
1776 if (!PyArg_ParseTuple(_args, "O&O&",
1777 ResObj_Convert, &rgnA,
1778 ResObj_Convert, &rgnB))
1779 return NULL;
1780 _rv = EqualRgn(rgnA,
1781 rgnB);
1782 _res = Py_BuildValue("b",
1783 _rv);
1784 return _res;
1785}
1786
1787static PyObject *Qd_EmptyRgn(_self, _args)
1788 PyObject *_self;
1789 PyObject *_args;
1790{
1791 PyObject *_res = NULL;
1792 Boolean _rv;
1793 RgnHandle rgn;
1794 if (!PyArg_ParseTuple(_args, "O&",
1795 ResObj_Convert, &rgn))
1796 return NULL;
1797 _rv = EmptyRgn(rgn);
1798 _res = Py_BuildValue("b",
1799 _rv);
1800 return _res;
1801}
1802
1803static PyObject *Qd_FrameRgn(_self, _args)
1804 PyObject *_self;
1805 PyObject *_args;
1806{
1807 PyObject *_res = NULL;
1808 RgnHandle rgn;
1809 if (!PyArg_ParseTuple(_args, "O&",
1810 ResObj_Convert, &rgn))
1811 return NULL;
1812 FrameRgn(rgn);
1813 Py_INCREF(Py_None);
1814 _res = Py_None;
1815 return _res;
1816}
1817
1818static PyObject *Qd_PaintRgn(_self, _args)
1819 PyObject *_self;
1820 PyObject *_args;
1821{
1822 PyObject *_res = NULL;
1823 RgnHandle rgn;
1824 if (!PyArg_ParseTuple(_args, "O&",
1825 ResObj_Convert, &rgn))
1826 return NULL;
1827 PaintRgn(rgn);
1828 Py_INCREF(Py_None);
1829 _res = Py_None;
1830 return _res;
1831}
1832
1833static PyObject *Qd_EraseRgn(_self, _args)
1834 PyObject *_self;
1835 PyObject *_args;
1836{
1837 PyObject *_res = NULL;
1838 RgnHandle rgn;
1839 if (!PyArg_ParseTuple(_args, "O&",
1840 ResObj_Convert, &rgn))
1841 return NULL;
1842 EraseRgn(rgn);
1843 Py_INCREF(Py_None);
1844 _res = Py_None;
1845 return _res;
1846}
1847
1848static PyObject *Qd_InvertRgn(_self, _args)
1849 PyObject *_self;
1850 PyObject *_args;
1851{
1852 PyObject *_res = NULL;
1853 RgnHandle rgn;
1854 if (!PyArg_ParseTuple(_args, "O&",
1855 ResObj_Convert, &rgn))
1856 return NULL;
1857 InvertRgn(rgn);
1858 Py_INCREF(Py_None);
1859 _res = Py_None;
1860 return _res;
1861}
1862
Jack Jansen04a02e71996-01-06 17:12:58 +00001863static PyObject *Qd_FillRgn(_self, _args)
1864 PyObject *_self;
1865 PyObject *_args;
1866{
1867 PyObject *_res = NULL;
1868 RgnHandle rgn;
1869 Pattern *pat__in__;
1870 int pat__in_len__;
1871 if (!PyArg_ParseTuple(_args, "O&s#",
1872 ResObj_Convert, &rgn,
1873 (char **)&pat__in__, &pat__in_len__))
1874 return NULL;
1875 if (pat__in_len__ != sizeof(Pattern))
1876 {
1877 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
1878 goto pat__error__;
1879 }
1880 FillRgn(rgn,
1881 pat__in__);
1882 Py_INCREF(Py_None);
1883 _res = Py_None;
1884 pat__error__: ;
1885 return _res;
1886}
1887
Guido van Rossume56db431995-03-19 22:49:50 +00001888static PyObject *Qd_ScrollRect(_self, _args)
1889 PyObject *_self;
1890 PyObject *_args;
1891{
1892 PyObject *_res = NULL;
1893 Rect r;
1894 short dh;
1895 short dv;
1896 RgnHandle updateRgn;
1897 if (!PyArg_ParseTuple(_args, "O&hhO&",
1898 PyMac_GetRect, &r,
1899 &dh,
1900 &dv,
1901 ResObj_Convert, &updateRgn))
1902 return NULL;
1903 ScrollRect(&r,
1904 dh,
1905 dv,
1906 updateRgn);
1907 Py_INCREF(Py_None);
1908 _res = Py_None;
1909 return _res;
1910}
1911
Jack Jansen41058c01995-11-16 22:48:29 +00001912static PyObject *Qd_CopyBits(_self, _args)
1913 PyObject *_self;
1914 PyObject *_args;
1915{
1916 PyObject *_res = NULL;
1917 BitMapPtr srcBits;
1918 BitMapPtr dstBits;
1919 Rect srcRect;
1920 Rect dstRect;
1921 short mode;
1922 RgnHandle maskRgn;
1923 if (!PyArg_ParseTuple(_args, "O&O&O&O&hO&",
1924 BMObj_Convert, &srcBits,
1925 BMObj_Convert, &dstBits,
1926 PyMac_GetRect, &srcRect,
1927 PyMac_GetRect, &dstRect,
1928 &mode,
Jack Jansen425e9eb1995-12-12 15:02:03 +00001929 OptResObj_Convert, &maskRgn))
Jack Jansen41058c01995-11-16 22:48:29 +00001930 return NULL;
1931 CopyBits(srcBits,
1932 dstBits,
1933 &srcRect,
1934 &dstRect,
1935 mode,
1936 maskRgn);
1937 Py_INCREF(Py_None);
1938 _res = Py_None;
1939 return _res;
1940}
1941
1942static PyObject *Qd_CopyMask(_self, _args)
1943 PyObject *_self;
1944 PyObject *_args;
1945{
1946 PyObject *_res = NULL;
1947 BitMapPtr srcBits;
1948 BitMapPtr maskBits;
1949 BitMapPtr dstBits;
1950 Rect srcRect;
1951 Rect maskRect;
1952 Rect dstRect;
1953 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&",
1954 BMObj_Convert, &srcBits,
1955 BMObj_Convert, &maskBits,
1956 BMObj_Convert, &dstBits,
1957 PyMac_GetRect, &srcRect,
1958 PyMac_GetRect, &maskRect,
1959 PyMac_GetRect, &dstRect))
1960 return NULL;
1961 CopyMask(srcBits,
1962 maskBits,
1963 dstBits,
1964 &srcRect,
1965 &maskRect,
1966 &dstRect);
1967 Py_INCREF(Py_None);
1968 _res = Py_None;
1969 return _res;
1970}
1971
Guido van Rossume56db431995-03-19 22:49:50 +00001972static PyObject *Qd_OpenPicture(_self, _args)
1973 PyObject *_self;
1974 PyObject *_args;
1975{
1976 PyObject *_res = NULL;
1977 PicHandle _rv;
1978 Rect picFrame;
1979 if (!PyArg_ParseTuple(_args, "O&",
1980 PyMac_GetRect, &picFrame))
1981 return NULL;
1982 _rv = OpenPicture(&picFrame);
1983 _res = Py_BuildValue("O&",
1984 ResObj_New, _rv);
1985 return _res;
1986}
1987
1988static PyObject *Qd_PicComment(_self, _args)
1989 PyObject *_self;
1990 PyObject *_args;
1991{
1992 PyObject *_res = NULL;
1993 short kind;
1994 short dataSize;
1995 Handle dataHandle;
1996 if (!PyArg_ParseTuple(_args, "hhO&",
1997 &kind,
1998 &dataSize,
1999 ResObj_Convert, &dataHandle))
2000 return NULL;
2001 PicComment(kind,
2002 dataSize,
2003 dataHandle);
2004 Py_INCREF(Py_None);
2005 _res = Py_None;
2006 return _res;
2007}
2008
2009static PyObject *Qd_ClosePicture(_self, _args)
2010 PyObject *_self;
2011 PyObject *_args;
2012{
2013 PyObject *_res = NULL;
2014 if (!PyArg_ParseTuple(_args, ""))
2015 return NULL;
2016 ClosePicture();
2017 Py_INCREF(Py_None);
2018 _res = Py_None;
2019 return _res;
2020}
2021
2022static PyObject *Qd_DrawPicture(_self, _args)
2023 PyObject *_self;
2024 PyObject *_args;
2025{
2026 PyObject *_res = NULL;
2027 PicHandle myPicture;
2028 Rect dstRect;
2029 if (!PyArg_ParseTuple(_args, "O&O&",
2030 ResObj_Convert, &myPicture,
2031 PyMac_GetRect, &dstRect))
2032 return NULL;
2033 DrawPicture(myPicture,
2034 &dstRect);
2035 Py_INCREF(Py_None);
2036 _res = Py_None;
2037 return _res;
2038}
2039
2040static PyObject *Qd_KillPicture(_self, _args)
2041 PyObject *_self;
2042 PyObject *_args;
2043{
2044 PyObject *_res = NULL;
2045 PicHandle myPicture;
2046 if (!PyArg_ParseTuple(_args, "O&",
2047 ResObj_Convert, &myPicture))
2048 return NULL;
2049 KillPicture(myPicture);
2050 Py_INCREF(Py_None);
2051 _res = Py_None;
2052 return _res;
2053}
2054
2055static PyObject *Qd_OpenPoly(_self, _args)
2056 PyObject *_self;
2057 PyObject *_args;
2058{
2059 PyObject *_res = NULL;
2060 PolyHandle _rv;
2061 if (!PyArg_ParseTuple(_args, ""))
2062 return NULL;
2063 _rv = OpenPoly();
2064 _res = Py_BuildValue("O&",
2065 ResObj_New, _rv);
2066 return _res;
2067}
2068
2069static PyObject *Qd_ClosePoly(_self, _args)
2070 PyObject *_self;
2071 PyObject *_args;
2072{
2073 PyObject *_res = NULL;
2074 if (!PyArg_ParseTuple(_args, ""))
2075 return NULL;
2076 ClosePoly();
2077 Py_INCREF(Py_None);
2078 _res = Py_None;
2079 return _res;
2080}
2081
2082static PyObject *Qd_KillPoly(_self, _args)
2083 PyObject *_self;
2084 PyObject *_args;
2085{
2086 PyObject *_res = NULL;
2087 PolyHandle poly;
2088 if (!PyArg_ParseTuple(_args, "O&",
2089 ResObj_Convert, &poly))
2090 return NULL;
2091 KillPoly(poly);
2092 Py_INCREF(Py_None);
2093 _res = Py_None;
2094 return _res;
2095}
2096
2097static PyObject *Qd_OffsetPoly(_self, _args)
2098 PyObject *_self;
2099 PyObject *_args;
2100{
2101 PyObject *_res = NULL;
2102 PolyHandle poly;
2103 short dh;
2104 short dv;
2105 if (!PyArg_ParseTuple(_args, "O&hh",
2106 ResObj_Convert, &poly,
2107 &dh,
2108 &dv))
2109 return NULL;
2110 OffsetPoly(poly,
2111 dh,
2112 dv);
2113 Py_INCREF(Py_None);
2114 _res = Py_None;
2115 return _res;
2116}
2117
2118static PyObject *Qd_FramePoly(_self, _args)
2119 PyObject *_self;
2120 PyObject *_args;
2121{
2122 PyObject *_res = NULL;
2123 PolyHandle poly;
2124 if (!PyArg_ParseTuple(_args, "O&",
2125 ResObj_Convert, &poly))
2126 return NULL;
2127 FramePoly(poly);
2128 Py_INCREF(Py_None);
2129 _res = Py_None;
2130 return _res;
2131}
2132
2133static PyObject *Qd_PaintPoly(_self, _args)
2134 PyObject *_self;
2135 PyObject *_args;
2136{
2137 PyObject *_res = NULL;
2138 PolyHandle poly;
2139 if (!PyArg_ParseTuple(_args, "O&",
2140 ResObj_Convert, &poly))
2141 return NULL;
2142 PaintPoly(poly);
2143 Py_INCREF(Py_None);
2144 _res = Py_None;
2145 return _res;
2146}
2147
2148static PyObject *Qd_ErasePoly(_self, _args)
2149 PyObject *_self;
2150 PyObject *_args;
2151{
2152 PyObject *_res = NULL;
2153 PolyHandle poly;
2154 if (!PyArg_ParseTuple(_args, "O&",
2155 ResObj_Convert, &poly))
2156 return NULL;
2157 ErasePoly(poly);
2158 Py_INCREF(Py_None);
2159 _res = Py_None;
2160 return _res;
2161}
2162
2163static PyObject *Qd_InvertPoly(_self, _args)
2164 PyObject *_self;
2165 PyObject *_args;
2166{
2167 PyObject *_res = NULL;
2168 PolyHandle poly;
2169 if (!PyArg_ParseTuple(_args, "O&",
2170 ResObj_Convert, &poly))
2171 return NULL;
2172 InvertPoly(poly);
2173 Py_INCREF(Py_None);
2174 _res = Py_None;
2175 return _res;
2176}
2177
Jack Jansen04a02e71996-01-06 17:12:58 +00002178static PyObject *Qd_FillPoly(_self, _args)
2179 PyObject *_self;
2180 PyObject *_args;
2181{
2182 PyObject *_res = NULL;
2183 PolyHandle poly;
2184 Pattern *pat__in__;
2185 int pat__in_len__;
2186 if (!PyArg_ParseTuple(_args, "O&s#",
2187 ResObj_Convert, &poly,
2188 (char **)&pat__in__, &pat__in_len__))
2189 return NULL;
2190 if (pat__in_len__ != sizeof(Pattern))
2191 {
2192 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
2193 goto pat__error__;
2194 }
2195 FillPoly(poly,
2196 pat__in__);
2197 Py_INCREF(Py_None);
2198 _res = Py_None;
2199 pat__error__: ;
2200 return _res;
2201}
2202
Guido van Rossume56db431995-03-19 22:49:50 +00002203static PyObject *Qd_SetPt(_self, _args)
2204 PyObject *_self;
2205 PyObject *_args;
2206{
2207 PyObject *_res = NULL;
2208 Point pt;
2209 short h;
2210 short v;
Jack Jansen1d8ede71996-01-08 23:47:31 +00002211 if (!PyArg_ParseTuple(_args, "hh",
Guido van Rossume56db431995-03-19 22:49:50 +00002212 &h,
2213 &v))
2214 return NULL;
2215 SetPt(&pt,
2216 h,
2217 v);
2218 _res = Py_BuildValue("O&",
2219 PyMac_BuildPoint, pt);
2220 return _res;
2221}
2222
2223static PyObject *Qd_LocalToGlobal(_self, _args)
2224 PyObject *_self;
2225 PyObject *_args;
2226{
2227 PyObject *_res = NULL;
2228 Point pt;
2229 if (!PyArg_ParseTuple(_args, "O&",
2230 PyMac_GetPoint, &pt))
2231 return NULL;
2232 LocalToGlobal(&pt);
2233 _res = Py_BuildValue("O&",
2234 PyMac_BuildPoint, pt);
2235 return _res;
2236}
2237
2238static PyObject *Qd_GlobalToLocal(_self, _args)
2239 PyObject *_self;
2240 PyObject *_args;
2241{
2242 PyObject *_res = NULL;
2243 Point pt;
2244 if (!PyArg_ParseTuple(_args, "O&",
2245 PyMac_GetPoint, &pt))
2246 return NULL;
2247 GlobalToLocal(&pt);
2248 _res = Py_BuildValue("O&",
2249 PyMac_BuildPoint, pt);
2250 return _res;
2251}
2252
2253static PyObject *Qd_Random(_self, _args)
2254 PyObject *_self;
2255 PyObject *_args;
2256{
2257 PyObject *_res = NULL;
2258 short _rv;
2259 if (!PyArg_ParseTuple(_args, ""))
2260 return NULL;
2261 _rv = Random();
2262 _res = Py_BuildValue("h",
2263 _rv);
2264 return _res;
2265}
2266
2267static PyObject *Qd_GetPixel(_self, _args)
2268 PyObject *_self;
2269 PyObject *_args;
2270{
2271 PyObject *_res = NULL;
2272 Boolean _rv;
2273 short h;
2274 short v;
2275 if (!PyArg_ParseTuple(_args, "hh",
2276 &h,
2277 &v))
2278 return NULL;
2279 _rv = GetPixel(h,
2280 v);
2281 _res = Py_BuildValue("b",
2282 _rv);
2283 return _res;
2284}
2285
2286static PyObject *Qd_ScalePt(_self, _args)
2287 PyObject *_self;
2288 PyObject *_args;
2289{
2290 PyObject *_res = NULL;
2291 Point pt;
2292 Rect srcRect;
2293 Rect dstRect;
2294 if (!PyArg_ParseTuple(_args, "O&O&O&",
2295 PyMac_GetPoint, &pt,
2296 PyMac_GetRect, &srcRect,
2297 PyMac_GetRect, &dstRect))
2298 return NULL;
2299 ScalePt(&pt,
2300 &srcRect,
2301 &dstRect);
2302 _res = Py_BuildValue("O&",
2303 PyMac_BuildPoint, pt);
2304 return _res;
2305}
2306
2307static PyObject *Qd_MapPt(_self, _args)
2308 PyObject *_self;
2309 PyObject *_args;
2310{
2311 PyObject *_res = NULL;
2312 Point pt;
2313 Rect srcRect;
2314 Rect dstRect;
2315 if (!PyArg_ParseTuple(_args, "O&O&O&",
2316 PyMac_GetPoint, &pt,
2317 PyMac_GetRect, &srcRect,
2318 PyMac_GetRect, &dstRect))
2319 return NULL;
2320 MapPt(&pt,
2321 &srcRect,
2322 &dstRect);
2323 _res = Py_BuildValue("O&",
2324 PyMac_BuildPoint, pt);
2325 return _res;
2326}
2327
2328static PyObject *Qd_MapRect(_self, _args)
2329 PyObject *_self;
2330 PyObject *_args;
2331{
2332 PyObject *_res = NULL;
2333 Rect r;
2334 Rect srcRect;
2335 Rect dstRect;
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002336 if (!PyArg_ParseTuple(_args, "O&O&O&",
2337 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +00002338 PyMac_GetRect, &srcRect,
2339 PyMac_GetRect, &dstRect))
2340 return NULL;
2341 MapRect(&r,
2342 &srcRect,
2343 &dstRect);
2344 _res = Py_BuildValue("O&",
2345 PyMac_BuildRect, &r);
2346 return _res;
2347}
2348
2349static PyObject *Qd_MapRgn(_self, _args)
2350 PyObject *_self;
2351 PyObject *_args;
2352{
2353 PyObject *_res = NULL;
2354 RgnHandle rgn;
2355 Rect srcRect;
2356 Rect dstRect;
2357 if (!PyArg_ParseTuple(_args, "O&O&O&",
2358 ResObj_Convert, &rgn,
2359 PyMac_GetRect, &srcRect,
2360 PyMac_GetRect, &dstRect))
2361 return NULL;
2362 MapRgn(rgn,
2363 &srcRect,
2364 &dstRect);
2365 Py_INCREF(Py_None);
2366 _res = Py_None;
2367 return _res;
2368}
2369
2370static PyObject *Qd_MapPoly(_self, _args)
2371 PyObject *_self;
2372 PyObject *_args;
2373{
2374 PyObject *_res = NULL;
2375 PolyHandle poly;
2376 Rect srcRect;
2377 Rect dstRect;
2378 if (!PyArg_ParseTuple(_args, "O&O&O&",
2379 ResObj_Convert, &poly,
2380 PyMac_GetRect, &srcRect,
2381 PyMac_GetRect, &dstRect))
2382 return NULL;
2383 MapPoly(poly,
2384 &srcRect,
2385 &dstRect);
2386 Py_INCREF(Py_None);
2387 _res = Py_None;
2388 return _res;
2389}
2390
Jack Jansen41058c01995-11-16 22:48:29 +00002391static PyObject *Qd_StdBits(_self, _args)
2392 PyObject *_self;
2393 PyObject *_args;
2394{
2395 PyObject *_res = NULL;
2396 BitMapPtr srcBits;
2397 Rect srcRect;
2398 Rect dstRect;
2399 short mode;
2400 RgnHandle maskRgn;
2401 if (!PyArg_ParseTuple(_args, "O&O&O&hO&",
2402 BMObj_Convert, &srcBits,
2403 PyMac_GetRect, &srcRect,
2404 PyMac_GetRect, &dstRect,
2405 &mode,
Jack Jansen425e9eb1995-12-12 15:02:03 +00002406 OptResObj_Convert, &maskRgn))
Jack Jansen41058c01995-11-16 22:48:29 +00002407 return NULL;
2408 StdBits(srcBits,
2409 &srcRect,
2410 &dstRect,
2411 mode,
2412 maskRgn);
2413 Py_INCREF(Py_None);
2414 _res = Py_None;
2415 return _res;
2416}
2417
Guido van Rossume56db431995-03-19 22:49:50 +00002418static PyObject *Qd_AddPt(_self, _args)
2419 PyObject *_self;
2420 PyObject *_args;
2421{
2422 PyObject *_res = NULL;
2423 Point src;
2424 Point dst;
2425 if (!PyArg_ParseTuple(_args, "O&O&",
2426 PyMac_GetPoint, &src,
2427 PyMac_GetPoint, &dst))
2428 return NULL;
2429 AddPt(src,
2430 &dst);
2431 _res = Py_BuildValue("O&",
2432 PyMac_BuildPoint, dst);
2433 return _res;
2434}
2435
2436static PyObject *Qd_EqualPt(_self, _args)
2437 PyObject *_self;
2438 PyObject *_args;
2439{
2440 PyObject *_res = NULL;
2441 Boolean _rv;
2442 Point pt1;
2443 Point pt2;
2444 if (!PyArg_ParseTuple(_args, "O&O&",
2445 PyMac_GetPoint, &pt1,
2446 PyMac_GetPoint, &pt2))
2447 return NULL;
2448 _rv = EqualPt(pt1,
2449 pt2);
2450 _res = Py_BuildValue("b",
2451 _rv);
2452 return _res;
2453}
2454
2455static PyObject *Qd_PtInRect(_self, _args)
2456 PyObject *_self;
2457 PyObject *_args;
2458{
2459 PyObject *_res = NULL;
2460 Boolean _rv;
2461 Point pt;
2462 Rect r;
2463 if (!PyArg_ParseTuple(_args, "O&O&",
2464 PyMac_GetPoint, &pt,
2465 PyMac_GetRect, &r))
2466 return NULL;
2467 _rv = PtInRect(pt,
2468 &r);
2469 _res = Py_BuildValue("b",
2470 _rv);
2471 return _res;
2472}
2473
2474static PyObject *Qd_Pt2Rect(_self, _args)
2475 PyObject *_self;
2476 PyObject *_args;
2477{
2478 PyObject *_res = NULL;
2479 Point pt1;
2480 Point pt2;
2481 Rect dstRect;
2482 if (!PyArg_ParseTuple(_args, "O&O&",
2483 PyMac_GetPoint, &pt1,
2484 PyMac_GetPoint, &pt2))
2485 return NULL;
2486 Pt2Rect(pt1,
2487 pt2,
2488 &dstRect);
2489 _res = Py_BuildValue("O&",
2490 PyMac_BuildRect, &dstRect);
2491 return _res;
2492}
2493
2494static PyObject *Qd_PtToAngle(_self, _args)
2495 PyObject *_self;
2496 PyObject *_args;
2497{
2498 PyObject *_res = NULL;
2499 Rect r;
2500 Point pt;
2501 short angle;
2502 if (!PyArg_ParseTuple(_args, "O&O&",
2503 PyMac_GetRect, &r,
2504 PyMac_GetPoint, &pt))
2505 return NULL;
2506 PtToAngle(&r,
2507 pt,
2508 &angle);
2509 _res = Py_BuildValue("h",
2510 angle);
2511 return _res;
2512}
2513
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002514static PyObject *Qd_SubPt(_self, _args)
2515 PyObject *_self;
2516 PyObject *_args;
2517{
2518 PyObject *_res = NULL;
2519 Point src;
2520 Point dst;
2521 if (!PyArg_ParseTuple(_args, "O&O&",
2522 PyMac_GetPoint, &src,
2523 PyMac_GetPoint, &dst))
2524 return NULL;
2525 SubPt(src,
2526 &dst);
2527 _res = Py_BuildValue("O&",
2528 PyMac_BuildPoint, dst);
2529 return _res;
2530}
2531
Guido van Rossume56db431995-03-19 22:49:50 +00002532static PyObject *Qd_PtInRgn(_self, _args)
2533 PyObject *_self;
2534 PyObject *_args;
2535{
2536 PyObject *_res = NULL;
2537 Boolean _rv;
2538 Point pt;
2539 RgnHandle rgn;
2540 if (!PyArg_ParseTuple(_args, "O&O&",
2541 PyMac_GetPoint, &pt,
2542 ResObj_Convert, &rgn))
2543 return NULL;
2544 _rv = PtInRgn(pt,
2545 rgn);
2546 _res = Py_BuildValue("b",
2547 _rv);
2548 return _res;
2549}
2550
2551static PyObject *Qd_NewPixMap(_self, _args)
2552 PyObject *_self;
2553 PyObject *_args;
2554{
2555 PyObject *_res = NULL;
2556 PixMapHandle _rv;
2557 if (!PyArg_ParseTuple(_args, ""))
2558 return NULL;
2559 _rv = NewPixMap();
2560 _res = Py_BuildValue("O&",
2561 ResObj_New, _rv);
2562 return _res;
2563}
2564
Guido van Rossume56db431995-03-19 22:49:50 +00002565static PyObject *Qd_DisposePixMap(_self, _args)
2566 PyObject *_self;
2567 PyObject *_args;
2568{
2569 PyObject *_res = NULL;
2570 PixMapHandle pm;
2571 if (!PyArg_ParseTuple(_args, "O&",
2572 ResObj_Convert, &pm))
2573 return NULL;
2574 DisposePixMap(pm);
2575 Py_INCREF(Py_None);
2576 _res = Py_None;
2577 return _res;
2578}
2579
2580static PyObject *Qd_CopyPixMap(_self, _args)
2581 PyObject *_self;
2582 PyObject *_args;
2583{
2584 PyObject *_res = NULL;
2585 PixMapHandle srcPM;
2586 PixMapHandle dstPM;
2587 if (!PyArg_ParseTuple(_args, "O&O&",
2588 ResObj_Convert, &srcPM,
2589 ResObj_Convert, &dstPM))
2590 return NULL;
2591 CopyPixMap(srcPM,
2592 dstPM);
2593 Py_INCREF(Py_None);
2594 _res = Py_None;
2595 return _res;
2596}
2597
2598static PyObject *Qd_NewPixPat(_self, _args)
2599 PyObject *_self;
2600 PyObject *_args;
2601{
2602 PyObject *_res = NULL;
2603 PixPatHandle _rv;
2604 if (!PyArg_ParseTuple(_args, ""))
2605 return NULL;
2606 _rv = NewPixPat();
2607 _res = Py_BuildValue("O&",
2608 ResObj_New, _rv);
2609 return _res;
2610}
2611
Guido van Rossume56db431995-03-19 22:49:50 +00002612static PyObject *Qd_DisposePixPat(_self, _args)
2613 PyObject *_self;
2614 PyObject *_args;
2615{
2616 PyObject *_res = NULL;
2617 PixPatHandle pp;
2618 if (!PyArg_ParseTuple(_args, "O&",
2619 ResObj_Convert, &pp))
2620 return NULL;
2621 DisposePixPat(pp);
2622 Py_INCREF(Py_None);
2623 _res = Py_None;
2624 return _res;
2625}
2626
2627static PyObject *Qd_CopyPixPat(_self, _args)
2628 PyObject *_self;
2629 PyObject *_args;
2630{
2631 PyObject *_res = NULL;
2632 PixPatHandle srcPP;
2633 PixPatHandle dstPP;
2634 if (!PyArg_ParseTuple(_args, "O&O&",
2635 ResObj_Convert, &srcPP,
2636 ResObj_Convert, &dstPP))
2637 return NULL;
2638 CopyPixPat(srcPP,
2639 dstPP);
2640 Py_INCREF(Py_None);
2641 _res = Py_None;
2642 return _res;
2643}
2644
2645static PyObject *Qd_PenPixPat(_self, _args)
2646 PyObject *_self;
2647 PyObject *_args;
2648{
2649 PyObject *_res = NULL;
2650 PixPatHandle pp;
2651 if (!PyArg_ParseTuple(_args, "O&",
2652 ResObj_Convert, &pp))
2653 return NULL;
2654 PenPixPat(pp);
2655 Py_INCREF(Py_None);
2656 _res = Py_None;
2657 return _res;
2658}
2659
2660static PyObject *Qd_BackPixPat(_self, _args)
2661 PyObject *_self;
2662 PyObject *_args;
2663{
2664 PyObject *_res = NULL;
2665 PixPatHandle pp;
2666 if (!PyArg_ParseTuple(_args, "O&",
2667 ResObj_Convert, &pp))
2668 return NULL;
2669 BackPixPat(pp);
2670 Py_INCREF(Py_None);
2671 _res = Py_None;
2672 return _res;
2673}
2674
2675static PyObject *Qd_GetPixPat(_self, _args)
2676 PyObject *_self;
2677 PyObject *_args;
2678{
2679 PyObject *_res = NULL;
2680 PixPatHandle _rv;
2681 short patID;
2682 if (!PyArg_ParseTuple(_args, "h",
2683 &patID))
2684 return NULL;
2685 _rv = GetPixPat(patID);
2686 _res = Py_BuildValue("O&",
2687 ResObj_New, _rv);
2688 return _res;
2689}
2690
Jack Jansen232f3cd1995-12-09 14:04:31 +00002691static PyObject *Qd_MakeRGBPat(_self, _args)
2692 PyObject *_self;
2693 PyObject *_args;
2694{
2695 PyObject *_res = NULL;
2696 PixPatHandle pp;
2697 RGBColor myColor;
2698 if (!PyArg_ParseTuple(_args, "O&O&",
2699 ResObj_Convert, &pp,
2700 QdRGB_Convert, &myColor))
2701 return NULL;
2702 MakeRGBPat(pp,
2703 &myColor);
2704 Py_INCREF(Py_None);
2705 _res = Py_None;
2706 return _res;
2707}
2708
Guido van Rossume56db431995-03-19 22:49:50 +00002709static PyObject *Qd_FillCRect(_self, _args)
2710 PyObject *_self;
2711 PyObject *_args;
2712{
2713 PyObject *_res = NULL;
2714 Rect r;
2715 PixPatHandle pp;
2716 if (!PyArg_ParseTuple(_args, "O&O&",
2717 PyMac_GetRect, &r,
2718 ResObj_Convert, &pp))
2719 return NULL;
2720 FillCRect(&r,
2721 pp);
2722 Py_INCREF(Py_None);
2723 _res = Py_None;
2724 return _res;
2725}
2726
2727static PyObject *Qd_FillCOval(_self, _args)
2728 PyObject *_self;
2729 PyObject *_args;
2730{
2731 PyObject *_res = NULL;
2732 Rect r;
2733 PixPatHandle pp;
2734 if (!PyArg_ParseTuple(_args, "O&O&",
2735 PyMac_GetRect, &r,
2736 ResObj_Convert, &pp))
2737 return NULL;
2738 FillCOval(&r,
2739 pp);
2740 Py_INCREF(Py_None);
2741 _res = Py_None;
2742 return _res;
2743}
2744
2745static PyObject *Qd_FillCRoundRect(_self, _args)
2746 PyObject *_self;
2747 PyObject *_args;
2748{
2749 PyObject *_res = NULL;
2750 Rect r;
2751 short ovalWidth;
2752 short ovalHeight;
2753 PixPatHandle pp;
2754 if (!PyArg_ParseTuple(_args, "O&hhO&",
2755 PyMac_GetRect, &r,
2756 &ovalWidth,
2757 &ovalHeight,
2758 ResObj_Convert, &pp))
2759 return NULL;
2760 FillCRoundRect(&r,
2761 ovalWidth,
2762 ovalHeight,
2763 pp);
2764 Py_INCREF(Py_None);
2765 _res = Py_None;
2766 return _res;
2767}
2768
2769static PyObject *Qd_FillCArc(_self, _args)
2770 PyObject *_self;
2771 PyObject *_args;
2772{
2773 PyObject *_res = NULL;
2774 Rect r;
2775 short startAngle;
2776 short arcAngle;
2777 PixPatHandle pp;
2778 if (!PyArg_ParseTuple(_args, "O&hhO&",
2779 PyMac_GetRect, &r,
2780 &startAngle,
2781 &arcAngle,
2782 ResObj_Convert, &pp))
2783 return NULL;
2784 FillCArc(&r,
2785 startAngle,
2786 arcAngle,
2787 pp);
2788 Py_INCREF(Py_None);
2789 _res = Py_None;
2790 return _res;
2791}
2792
2793static PyObject *Qd_FillCRgn(_self, _args)
2794 PyObject *_self;
2795 PyObject *_args;
2796{
2797 PyObject *_res = NULL;
2798 RgnHandle rgn;
2799 PixPatHandle pp;
2800 if (!PyArg_ParseTuple(_args, "O&O&",
2801 ResObj_Convert, &rgn,
2802 ResObj_Convert, &pp))
2803 return NULL;
2804 FillCRgn(rgn,
2805 pp);
2806 Py_INCREF(Py_None);
2807 _res = Py_None;
2808 return _res;
2809}
2810
2811static PyObject *Qd_FillCPoly(_self, _args)
2812 PyObject *_self;
2813 PyObject *_args;
2814{
2815 PyObject *_res = NULL;
2816 PolyHandle poly;
2817 PixPatHandle pp;
2818 if (!PyArg_ParseTuple(_args, "O&O&",
2819 ResObj_Convert, &poly,
2820 ResObj_Convert, &pp))
2821 return NULL;
2822 FillCPoly(poly,
2823 pp);
2824 Py_INCREF(Py_None);
2825 _res = Py_None;
2826 return _res;
2827}
2828
Jack Jansen232f3cd1995-12-09 14:04:31 +00002829static PyObject *Qd_RGBForeColor(_self, _args)
2830 PyObject *_self;
2831 PyObject *_args;
2832{
2833 PyObject *_res = NULL;
2834 RGBColor color;
2835 if (!PyArg_ParseTuple(_args, "O&",
2836 QdRGB_Convert, &color))
2837 return NULL;
2838 RGBForeColor(&color);
2839 Py_INCREF(Py_None);
2840 _res = Py_None;
2841 return _res;
2842}
2843
2844static PyObject *Qd_RGBBackColor(_self, _args)
2845 PyObject *_self;
2846 PyObject *_args;
2847{
2848 PyObject *_res = NULL;
2849 RGBColor color;
2850 if (!PyArg_ParseTuple(_args, "O&",
2851 QdRGB_Convert, &color))
2852 return NULL;
2853 RGBBackColor(&color);
2854 Py_INCREF(Py_None);
2855 _res = Py_None;
2856 return _res;
2857}
2858
2859static PyObject *Qd_SetCPixel(_self, _args)
2860 PyObject *_self;
2861 PyObject *_args;
2862{
2863 PyObject *_res = NULL;
2864 short h;
2865 short v;
2866 RGBColor cPix;
2867 if (!PyArg_ParseTuple(_args, "hhO&",
2868 &h,
2869 &v,
2870 QdRGB_Convert, &cPix))
2871 return NULL;
2872 SetCPixel(h,
2873 v,
2874 &cPix);
2875 Py_INCREF(Py_None);
2876 _res = Py_None;
2877 return _res;
2878}
2879
Guido van Rossume56db431995-03-19 22:49:50 +00002880static PyObject *Qd_SetPortPix(_self, _args)
2881 PyObject *_self;
2882 PyObject *_args;
2883{
2884 PyObject *_res = NULL;
2885 PixMapHandle pm;
2886 if (!PyArg_ParseTuple(_args, "O&",
2887 ResObj_Convert, &pm))
2888 return NULL;
2889 SetPortPix(pm);
2890 Py_INCREF(Py_None);
2891 _res = Py_None;
2892 return _res;
2893}
2894
Jack Jansen232f3cd1995-12-09 14:04:31 +00002895static PyObject *Qd_GetCPixel(_self, _args)
2896 PyObject *_self;
2897 PyObject *_args;
2898{
2899 PyObject *_res = NULL;
2900 short h;
2901 short v;
2902 RGBColor cPix;
2903 if (!PyArg_ParseTuple(_args, "hh",
2904 &h,
2905 &v))
2906 return NULL;
2907 GetCPixel(h,
2908 v,
2909 &cPix);
2910 _res = Py_BuildValue("O&",
2911 QdRGB_New, &cPix);
2912 return _res;
2913}
2914
2915static PyObject *Qd_GetForeColor(_self, _args)
2916 PyObject *_self;
2917 PyObject *_args;
2918{
2919 PyObject *_res = NULL;
2920 RGBColor color;
2921 if (!PyArg_ParseTuple(_args, ""))
2922 return NULL;
2923 GetForeColor(&color);
2924 _res = Py_BuildValue("O&",
2925 QdRGB_New, &color);
2926 return _res;
2927}
2928
2929static PyObject *Qd_GetBackColor(_self, _args)
2930 PyObject *_self;
2931 PyObject *_args;
2932{
2933 PyObject *_res = NULL;
2934 RGBColor color;
2935 if (!PyArg_ParseTuple(_args, ""))
2936 return NULL;
2937 GetBackColor(&color);
2938 _res = Py_BuildValue("O&",
2939 QdRGB_New, &color);
2940 return _res;
2941}
2942
2943static PyObject *Qd_OpColor(_self, _args)
2944 PyObject *_self;
2945 PyObject *_args;
2946{
2947 PyObject *_res = NULL;
2948 RGBColor color;
2949 if (!PyArg_ParseTuple(_args, "O&",
2950 QdRGB_Convert, &color))
2951 return NULL;
2952 OpColor(&color);
2953 Py_INCREF(Py_None);
2954 _res = Py_None;
2955 return _res;
2956}
2957
2958static PyObject *Qd_HiliteColor(_self, _args)
2959 PyObject *_self;
2960 PyObject *_args;
2961{
2962 PyObject *_res = NULL;
2963 RGBColor color;
2964 if (!PyArg_ParseTuple(_args, "O&",
2965 QdRGB_Convert, &color))
2966 return NULL;
2967 HiliteColor(&color);
2968 Py_INCREF(Py_None);
2969 _res = Py_None;
2970 return _res;
2971}
2972
Guido van Rossume56db431995-03-19 22:49:50 +00002973static PyObject *Qd_AllocCursor(_self, _args)
2974 PyObject *_self;
2975 PyObject *_args;
2976{
2977 PyObject *_res = NULL;
2978 if (!PyArg_ParseTuple(_args, ""))
2979 return NULL;
2980 AllocCursor();
2981 Py_INCREF(Py_None);
2982 _res = Py_None;
2983 return _res;
2984}
2985
Guido van Rossume56db431995-03-19 22:49:50 +00002986static PyObject *Qd_GetCTSeed(_self, _args)
2987 PyObject *_self;
2988 PyObject *_args;
2989{
2990 PyObject *_res = NULL;
2991 long _rv;
2992 if (!PyArg_ParseTuple(_args, ""))
2993 return NULL;
2994 _rv = GetCTSeed();
2995 _res = Py_BuildValue("l",
2996 _rv);
2997 return _res;
2998}
2999
Jack Jansen232f3cd1995-12-09 14:04:31 +00003000static PyObject *Qd_Color2Index(_self, _args)
3001 PyObject *_self;
3002 PyObject *_args;
3003{
3004 PyObject *_res = NULL;
3005 long _rv;
3006 RGBColor myColor;
3007 if (!PyArg_ParseTuple(_args, "O&",
3008 QdRGB_Convert, &myColor))
3009 return NULL;
3010 _rv = Color2Index(&myColor);
3011 _res = Py_BuildValue("l",
3012 _rv);
3013 return _res;
3014}
3015
3016static PyObject *Qd_Index2Color(_self, _args)
3017 PyObject *_self;
3018 PyObject *_args;
3019{
3020 PyObject *_res = NULL;
3021 long index;
3022 RGBColor aColor;
3023 if (!PyArg_ParseTuple(_args, "l",
3024 &index))
3025 return NULL;
3026 Index2Color(index,
3027 &aColor);
3028 _res = Py_BuildValue("O&",
3029 QdRGB_New, &aColor);
3030 return _res;
3031}
3032
3033static PyObject *Qd_InvertColor(_self, _args)
3034 PyObject *_self;
3035 PyObject *_args;
3036{
3037 PyObject *_res = NULL;
3038 RGBColor myColor;
3039 if (!PyArg_ParseTuple(_args, ""))
3040 return NULL;
3041 InvertColor(&myColor);
3042 _res = Py_BuildValue("O&",
3043 QdRGB_New, &myColor);
3044 return _res;
3045}
3046
3047static PyObject *Qd_RealColor(_self, _args)
3048 PyObject *_self;
3049 PyObject *_args;
3050{
3051 PyObject *_res = NULL;
3052 Boolean _rv;
3053 RGBColor color;
3054 if (!PyArg_ParseTuple(_args, "O&",
3055 QdRGB_Convert, &color))
3056 return NULL;
3057 _rv = RealColor(&color);
3058 _res = Py_BuildValue("b",
3059 _rv);
3060 return _res;
3061}
3062
Guido van Rossume56db431995-03-19 22:49:50 +00003063static PyObject *Qd_SetClientID(_self, _args)
3064 PyObject *_self;
3065 PyObject *_args;
3066{
3067 PyObject *_res = NULL;
3068 short id;
3069 if (!PyArg_ParseTuple(_args, "h",
3070 &id))
3071 return NULL;
3072 SetClientID(id);
3073 Py_INCREF(Py_None);
3074 _res = Py_None;
3075 return _res;
3076}
3077
3078static PyObject *Qd_ProtectEntry(_self, _args)
3079 PyObject *_self;
3080 PyObject *_args;
3081{
3082 PyObject *_res = NULL;
3083 short index;
3084 Boolean protect;
3085 if (!PyArg_ParseTuple(_args, "hb",
3086 &index,
3087 &protect))
3088 return NULL;
3089 ProtectEntry(index,
3090 protect);
3091 Py_INCREF(Py_None);
3092 _res = Py_None;
3093 return _res;
3094}
3095
3096static PyObject *Qd_ReserveEntry(_self, _args)
3097 PyObject *_self;
3098 PyObject *_args;
3099{
3100 PyObject *_res = NULL;
3101 short index;
3102 Boolean reserve;
3103 if (!PyArg_ParseTuple(_args, "hb",
3104 &index,
3105 &reserve))
3106 return NULL;
3107 ReserveEntry(index,
3108 reserve);
3109 Py_INCREF(Py_None);
3110 _res = Py_None;
3111 return _res;
3112}
3113
3114static PyObject *Qd_QDError(_self, _args)
3115 PyObject *_self;
3116 PyObject *_args;
3117{
3118 PyObject *_res = NULL;
3119 short _rv;
3120 if (!PyArg_ParseTuple(_args, ""))
3121 return NULL;
3122 _rv = QDError();
3123 _res = Py_BuildValue("h",
3124 _rv);
3125 return _res;
3126}
3127
Jack Jansen41058c01995-11-16 22:48:29 +00003128static PyObject *Qd_CopyDeepMask(_self, _args)
3129 PyObject *_self;
3130 PyObject *_args;
3131{
3132 PyObject *_res = NULL;
3133 BitMapPtr srcBits;
3134 BitMapPtr maskBits;
3135 BitMapPtr dstBits;
3136 Rect srcRect;
3137 Rect maskRect;
3138 Rect dstRect;
3139 short mode;
3140 RgnHandle maskRgn;
3141 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&hO&",
3142 BMObj_Convert, &srcBits,
3143 BMObj_Convert, &maskBits,
3144 BMObj_Convert, &dstBits,
3145 PyMac_GetRect, &srcRect,
3146 PyMac_GetRect, &maskRect,
3147 PyMac_GetRect, &dstRect,
3148 &mode,
Jack Jansen425e9eb1995-12-12 15:02:03 +00003149 OptResObj_Convert, &maskRgn))
Jack Jansen41058c01995-11-16 22:48:29 +00003150 return NULL;
3151 CopyDeepMask(srcBits,
3152 maskBits,
3153 dstBits,
3154 &srcRect,
3155 &maskRect,
3156 &dstRect,
3157 mode,
3158 maskRgn);
3159 Py_INCREF(Py_None);
3160 _res = Py_None;
3161 return _res;
3162}
3163
Jack Jansen54c8f7e1995-11-14 10:46:01 +00003164static PyObject *Qd_GetPattern(_self, _args)
3165 PyObject *_self;
3166 PyObject *_args;
3167{
3168 PyObject *_res = NULL;
3169 PatHandle _rv;
3170 short patternID;
3171 if (!PyArg_ParseTuple(_args, "h",
3172 &patternID))
3173 return NULL;
3174 _rv = GetPattern(patternID);
3175 _res = Py_BuildValue("O&",
3176 ResObj_New, _rv);
3177 return _res;
3178}
3179
3180static PyObject *Qd_GetCursor(_self, _args)
3181 PyObject *_self;
3182 PyObject *_args;
3183{
3184 PyObject *_res = NULL;
3185 CursHandle _rv;
3186 short cursorID;
3187 if (!PyArg_ParseTuple(_args, "h",
3188 &cursorID))
3189 return NULL;
3190 _rv = GetCursor(cursorID);
3191 _res = Py_BuildValue("O&",
3192 ResObj_New, _rv);
3193 return _res;
3194}
3195
3196static PyObject *Qd_GetPicture(_self, _args)
3197 PyObject *_self;
3198 PyObject *_args;
3199{
3200 PyObject *_res = NULL;
3201 PicHandle _rv;
3202 short pictureID;
3203 if (!PyArg_ParseTuple(_args, "h",
3204 &pictureID))
3205 return NULL;
3206 _rv = GetPicture(pictureID);
3207 _res = Py_BuildValue("O&",
3208 ResObj_New, _rv);
3209 return _res;
3210}
3211
3212static PyObject *Qd_DeltaPoint(_self, _args)
3213 PyObject *_self;
3214 PyObject *_args;
3215{
3216 PyObject *_res = NULL;
3217 long _rv;
3218 Point ptA;
3219 Point ptB;
3220 if (!PyArg_ParseTuple(_args, "O&O&",
3221 PyMac_GetPoint, &ptA,
3222 PyMac_GetPoint, &ptB))
3223 return NULL;
3224 _rv = DeltaPoint(ptA,
3225 ptB);
3226 _res = Py_BuildValue("l",
3227 _rv);
3228 return _res;
3229}
3230
3231static PyObject *Qd_ShieldCursor(_self, _args)
3232 PyObject *_self;
3233 PyObject *_args;
3234{
3235 PyObject *_res = NULL;
3236 Rect shieldRect;
3237 Point offsetPt;
3238 if (!PyArg_ParseTuple(_args, "O&O&",
3239 PyMac_GetRect, &shieldRect,
3240 PyMac_GetPoint, &offsetPt))
3241 return NULL;
3242 ShieldCursor(&shieldRect,
3243 offsetPt);
3244 Py_INCREF(Py_None);
3245 _res = Py_None;
3246 return _res;
3247}
3248
3249static PyObject *Qd_ScreenRes(_self, _args)
3250 PyObject *_self;
3251 PyObject *_args;
3252{
3253 PyObject *_res = NULL;
3254 short scrnHRes;
3255 short scrnVRes;
3256 if (!PyArg_ParseTuple(_args, ""))
3257 return NULL;
3258 ScreenRes(&scrnHRes,
3259 &scrnVRes);
3260 _res = Py_BuildValue("hh",
3261 scrnHRes,
3262 scrnVRes);
3263 return _res;
3264}
3265
Jack Jansen04a02e71996-01-06 17:12:58 +00003266static PyObject *Qd_GetIndPattern(_self, _args)
3267 PyObject *_self;
3268 PyObject *_args;
3269{
3270 PyObject *_res = NULL;
3271 Pattern thePat__out__;
3272 short patternListID;
3273 short index;
3274 if (!PyArg_ParseTuple(_args, "hh",
3275 &patternListID,
3276 &index))
3277 return NULL;
3278 GetIndPattern(&thePat__out__,
3279 patternListID,
3280 index);
3281 _res = Py_BuildValue("s#",
3282 (char *)&thePat__out__, (int)sizeof(Pattern));
3283 thePat__error__: ;
3284 return _res;
3285}
3286
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003287static PyObject *Qd_TextFont(_self, _args)
3288 PyObject *_self;
3289 PyObject *_args;
3290{
3291 PyObject *_res = NULL;
3292 short font;
3293 if (!PyArg_ParseTuple(_args, "h",
3294 &font))
3295 return NULL;
3296 TextFont(font);
3297 Py_INCREF(Py_None);
3298 _res = Py_None;
3299 return _res;
3300}
3301
3302static PyObject *Qd_TextFace(_self, _args)
3303 PyObject *_self;
3304 PyObject *_args;
3305{
3306 PyObject *_res = NULL;
3307 short face;
3308 if (!PyArg_ParseTuple(_args, "h",
3309 &face))
3310 return NULL;
3311 TextFace(face);
3312 Py_INCREF(Py_None);
3313 _res = Py_None;
3314 return _res;
3315}
3316
3317static PyObject *Qd_TextMode(_self, _args)
3318 PyObject *_self;
3319 PyObject *_args;
3320{
3321 PyObject *_res = NULL;
3322 short mode;
3323 if (!PyArg_ParseTuple(_args, "h",
3324 &mode))
3325 return NULL;
3326 TextMode(mode);
3327 Py_INCREF(Py_None);
3328 _res = Py_None;
3329 return _res;
3330}
3331
3332static PyObject *Qd_TextSize(_self, _args)
3333 PyObject *_self;
3334 PyObject *_args;
3335{
3336 PyObject *_res = NULL;
3337 short size;
3338 if (!PyArg_ParseTuple(_args, "h",
3339 &size))
3340 return NULL;
3341 TextSize(size);
3342 Py_INCREF(Py_None);
3343 _res = Py_None;
3344 return _res;
3345}
3346
3347static PyObject *Qd_SpaceExtra(_self, _args)
3348 PyObject *_self;
3349 PyObject *_args;
3350{
3351 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +00003352 Fixed extra;
3353 if (!PyArg_ParseTuple(_args, "O&",
3354 PyMac_GetFixed, &extra))
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003355 return NULL;
3356 SpaceExtra(extra);
3357 Py_INCREF(Py_None);
3358 _res = Py_None;
3359 return _res;
3360}
3361
3362static PyObject *Qd_DrawChar(_self, _args)
3363 PyObject *_self;
3364 PyObject *_args;
3365{
3366 PyObject *_res = NULL;
3367 short ch;
3368 if (!PyArg_ParseTuple(_args, "h",
3369 &ch))
3370 return NULL;
3371 DrawChar(ch);
3372 Py_INCREF(Py_None);
3373 _res = Py_None;
3374 return _res;
3375}
3376
3377static PyObject *Qd_DrawString(_self, _args)
3378 PyObject *_self;
3379 PyObject *_args;
3380{
3381 PyObject *_res = NULL;
3382 Str255 s;
3383 if (!PyArg_ParseTuple(_args, "O&",
3384 PyMac_GetStr255, s))
3385 return NULL;
3386 DrawString(s);
3387 Py_INCREF(Py_None);
3388 _res = Py_None;
3389 return _res;
3390}
3391
3392static PyObject *Qd_DrawText(_self, _args)
3393 PyObject *_self;
3394 PyObject *_args;
3395{
3396 PyObject *_res = NULL;
3397 char *textBuf__in__;
3398 int textBuf__len__;
3399 int textBuf__in_len__;
3400 short firstByte;
3401 short byteCount;
3402 if (!PyArg_ParseTuple(_args, "s#hh",
3403 &textBuf__in__, &textBuf__in_len__,
3404 &firstByte,
3405 &byteCount))
3406 return NULL;
3407 DrawText(textBuf__in__,
3408 firstByte,
3409 byteCount);
3410 Py_INCREF(Py_None);
3411 _res = Py_None;
3412 textBuf__error__: ;
3413 return _res;
3414}
3415
3416static PyObject *Qd_CharWidth(_self, _args)
3417 PyObject *_self;
3418 PyObject *_args;
3419{
3420 PyObject *_res = NULL;
3421 short _rv;
3422 short ch;
3423 if (!PyArg_ParseTuple(_args, "h",
3424 &ch))
3425 return NULL;
3426 _rv = CharWidth(ch);
3427 _res = Py_BuildValue("h",
3428 _rv);
3429 return _res;
3430}
3431
3432static PyObject *Qd_StringWidth(_self, _args)
3433 PyObject *_self;
3434 PyObject *_args;
3435{
3436 PyObject *_res = NULL;
3437 short _rv;
3438 Str255 s;
3439 if (!PyArg_ParseTuple(_args, "O&",
3440 PyMac_GetStr255, s))
3441 return NULL;
3442 _rv = StringWidth(s);
3443 _res = Py_BuildValue("h",
3444 _rv);
3445 return _res;
3446}
3447
3448static PyObject *Qd_TextWidth(_self, _args)
3449 PyObject *_self;
3450 PyObject *_args;
3451{
3452 PyObject *_res = NULL;
3453 short _rv;
3454 char *textBuf__in__;
3455 int textBuf__len__;
3456 int textBuf__in_len__;
3457 short firstByte;
3458 short byteCount;
3459 if (!PyArg_ParseTuple(_args, "s#hh",
3460 &textBuf__in__, &textBuf__in_len__,
3461 &firstByte,
3462 &byteCount))
3463 return NULL;
3464 _rv = TextWidth(textBuf__in__,
3465 firstByte,
3466 byteCount);
3467 _res = Py_BuildValue("h",
3468 _rv);
3469 textBuf__error__: ;
3470 return _res;
3471}
3472
Jack Jansen3a50f8a1996-01-11 16:17:14 +00003473static PyObject *Qd_GetFontInfo(_self, _args)
3474 PyObject *_self;
3475 PyObject *_args;
3476{
3477 PyObject *_res = NULL;
3478 FontInfo info;
3479 if (!PyArg_ParseTuple(_args, ""))
3480 return NULL;
3481 GetFontInfo(&info);
3482 _res = Py_BuildValue("O&",
3483 QdFI_New, &info);
3484 return _res;
3485}
3486
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003487static PyObject *Qd_CharExtra(_self, _args)
3488 PyObject *_self;
3489 PyObject *_args;
3490{
3491 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +00003492 Fixed extra;
3493 if (!PyArg_ParseTuple(_args, "O&",
3494 PyMac_GetFixed, &extra))
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003495 return NULL;
3496 CharExtra(extra);
3497 Py_INCREF(Py_None);
3498 _res = Py_None;
3499 return _res;
3500}
3501
Jack Jansen41058c01995-11-16 22:48:29 +00003502static PyObject *Qd_BitMap(_self, _args)
3503 PyObject *_self;
3504 PyObject *_args;
3505{
3506 PyObject *_res = NULL;
3507
3508 BitMap *ptr;
3509 PyObject *source;
3510 Rect bounds;
3511 int rowbytes;
3512 char *data;
3513
3514 if ( !PyArg_ParseTuple(_args, "O!iO&", &PyString_Type, &source, &rowbytes, PyMac_GetRect,
3515 &bounds) )
3516 return NULL;
3517 data = PyString_AsString(source);
3518 if ((ptr=(BitMap *)malloc(sizeof(BitMap))) == NULL )
3519 return PyErr_NoMemory();
3520 ptr->baseAddr = (Ptr)data;
3521 ptr->rowBytes = rowbytes;
3522 ptr->bounds = bounds;
3523 if ( (_res = BMObj_New(ptr)) == NULL ) {
3524 free(ptr);
3525 return NULL;
3526 }
3527 ((BitMapObject *)_res)->referred_object = source;
3528 Py_INCREF(source);
3529 ((BitMapObject *)_res)->referred_bitmap = ptr;
3530 return _res;
3531
3532}
3533
Jack Jansen425e9eb1995-12-12 15:02:03 +00003534static PyObject *Qd_RawBitMap(_self, _args)
3535 PyObject *_self;
3536 PyObject *_args;
3537{
3538 PyObject *_res = NULL;
3539
3540 BitMap *ptr;
3541 PyObject *source;
3542
3543 if ( !PyArg_ParseTuple(_args, "O!", &PyString_Type, &source) )
3544 return NULL;
3545 if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
3546 PyErr_BadArgument();
3547 return NULL;
3548 }
3549 ptr = (BitMapPtr)PyString_AsString(source);
3550 if ( (_res = BMObj_New(ptr)) == NULL ) {
3551 return NULL;
3552 }
3553 ((BitMapObject *)_res)->referred_object = source;
3554 Py_INCREF(source);
3555 return _res;
3556
3557}
3558
Guido van Rossum17448e21995-01-30 11:53:55 +00003559static PyMethodDef Qd_methods[] = {
Guido van Rossum17448e21995-01-30 11:53:55 +00003560 {"SetPort", (PyCFunction)Qd_SetPort, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00003561 "(GrafPtr port) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003562 {"GetPort", (PyCFunction)Qd_GetPort, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00003563 "() -> (GrafPtr port)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003564 {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
3565 "(short device) -> None"},
Jack Jansen41058c01995-11-16 22:48:29 +00003566 {"SetPortBits", (PyCFunction)Qd_SetPortBits, 1,
3567 "(BitMapPtr bm) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003568 {"PortSize", (PyCFunction)Qd_PortSize, 1,
3569 "(short width, short height) -> None"},
3570 {"MovePortTo", (PyCFunction)Qd_MovePortTo, 1,
3571 "(short leftGlobal, short topGlobal) -> None"},
3572 {"SetOrigin", (PyCFunction)Qd_SetOrigin, 1,
3573 "(short h, short v) -> None"},
3574 {"SetClip", (PyCFunction)Qd_SetClip, 1,
3575 "(RgnHandle rgn) -> None"},
3576 {"GetClip", (PyCFunction)Qd_GetClip, 1,
3577 "(RgnHandle rgn) -> None"},
Guido van Rossum17448e21995-01-30 11:53:55 +00003578 {"ClipRect", (PyCFunction)Qd_ClipRect, 1,
3579 "(Rect r) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003580 {"BackPat", (PyCFunction)Qd_BackPat, 1,
3581 "(Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003582 {"InitCursor", (PyCFunction)Qd_InitCursor, 1,
3583 "() -> None"},
Jack Jansenb5394061996-01-05 18:06:41 +00003584 {"SetCursor", (PyCFunction)Qd_SetCursor, 1,
3585 "(Cursor crsr) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003586 {"HideCursor", (PyCFunction)Qd_HideCursor, 1,
3587 "() -> None"},
3588 {"ShowCursor", (PyCFunction)Qd_ShowCursor, 1,
3589 "() -> None"},
3590 {"ObscureCursor", (PyCFunction)Qd_ObscureCursor, 1,
3591 "() -> None"},
3592 {"HidePen", (PyCFunction)Qd_HidePen, 1,
3593 "() -> None"},
3594 {"ShowPen", (PyCFunction)Qd_ShowPen, 1,
3595 "() -> None"},
3596 {"GetPen", (PyCFunction)Qd_GetPen, 1,
Jack Jansen1d8ede71996-01-08 23:47:31 +00003597 "() -> (Point pt)"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003598 {"GetPenState", (PyCFunction)Qd_GetPenState, 1,
3599 "() -> (PenState pnState)"},
3600 {"SetPenState", (PyCFunction)Qd_SetPenState, 1,
3601 "(PenState pnState) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003602 {"PenSize", (PyCFunction)Qd_PenSize, 1,
3603 "(short width, short height) -> None"},
3604 {"PenMode", (PyCFunction)Qd_PenMode, 1,
3605 "(short mode) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003606 {"PenPat", (PyCFunction)Qd_PenPat, 1,
3607 "(Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003608 {"PenNormal", (PyCFunction)Qd_PenNormal, 1,
3609 "() -> None"},
3610 {"MoveTo", (PyCFunction)Qd_MoveTo, 1,
3611 "(short h, short v) -> None"},
3612 {"Move", (PyCFunction)Qd_Move, 1,
3613 "(short dh, short dv) -> None"},
3614 {"LineTo", (PyCFunction)Qd_LineTo, 1,
3615 "(short h, short v) -> None"},
3616 {"Line", (PyCFunction)Qd_Line, 1,
3617 "(short dh, short dv) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003618 {"ForeColor", (PyCFunction)Qd_ForeColor, 1,
3619 "(long color) -> None"},
3620 {"BackColor", (PyCFunction)Qd_BackColor, 1,
3621 "(long color) -> None"},
3622 {"ColorBit", (PyCFunction)Qd_ColorBit, 1,
3623 "(short whichBit) -> None"},
3624 {"SetRect", (PyCFunction)Qd_SetRect, 1,
3625 "(short left, short top, short right, short bottom) -> (Rect r)"},
3626 {"OffsetRect", (PyCFunction)Qd_OffsetRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00003627 "(Rect r, short dh, short dv) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003628 {"InsetRect", (PyCFunction)Qd_InsetRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00003629 "(Rect r, short dh, short dv) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003630 {"SectRect", (PyCFunction)Qd_SectRect, 1,
3631 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
3632 {"UnionRect", (PyCFunction)Qd_UnionRect, 1,
3633 "(Rect src1, Rect src2) -> (Rect dstRect)"},
3634 {"EqualRect", (PyCFunction)Qd_EqualRect, 1,
3635 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
3636 {"EmptyRect", (PyCFunction)Qd_EmptyRect, 1,
3637 "(Rect r) -> (Boolean _rv)"},
3638 {"FrameRect", (PyCFunction)Qd_FrameRect, 1,
3639 "(Rect r) -> None"},
3640 {"PaintRect", (PyCFunction)Qd_PaintRect, 1,
3641 "(Rect r) -> None"},
Guido van Rossum17448e21995-01-30 11:53:55 +00003642 {"EraseRect", (PyCFunction)Qd_EraseRect, 1,
3643 "(Rect r) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003644 {"InvertRect", (PyCFunction)Qd_InvertRect, 1,
3645 "(Rect r) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003646 {"FillRect", (PyCFunction)Qd_FillRect, 1,
3647 "(Rect r, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003648 {"FrameOval", (PyCFunction)Qd_FrameOval, 1,
3649 "(Rect r) -> None"},
3650 {"PaintOval", (PyCFunction)Qd_PaintOval, 1,
3651 "(Rect r) -> None"},
3652 {"EraseOval", (PyCFunction)Qd_EraseOval, 1,
3653 "(Rect r) -> None"},
3654 {"InvertOval", (PyCFunction)Qd_InvertOval, 1,
3655 "(Rect r) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003656 {"FillOval", (PyCFunction)Qd_FillOval, 1,
3657 "(Rect r, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003658 {"FrameRoundRect", (PyCFunction)Qd_FrameRoundRect, 1,
3659 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
3660 {"PaintRoundRect", (PyCFunction)Qd_PaintRoundRect, 1,
3661 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
3662 {"EraseRoundRect", (PyCFunction)Qd_EraseRoundRect, 1,
3663 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
3664 {"InvertRoundRect", (PyCFunction)Qd_InvertRoundRect, 1,
3665 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003666 {"FillRoundRect", (PyCFunction)Qd_FillRoundRect, 1,
3667 "(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003668 {"FrameArc", (PyCFunction)Qd_FrameArc, 1,
3669 "(Rect r, short startAngle, short arcAngle) -> None"},
3670 {"PaintArc", (PyCFunction)Qd_PaintArc, 1,
3671 "(Rect r, short startAngle, short arcAngle) -> None"},
3672 {"EraseArc", (PyCFunction)Qd_EraseArc, 1,
3673 "(Rect r, short startAngle, short arcAngle) -> None"},
3674 {"InvertArc", (PyCFunction)Qd_InvertArc, 1,
3675 "(Rect r, short startAngle, short arcAngle) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003676 {"FillArc", (PyCFunction)Qd_FillArc, 1,
3677 "(Rect r, short startAngle, short arcAngle, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003678 {"NewRgn", (PyCFunction)Qd_NewRgn, 1,
3679 "() -> (RgnHandle _rv)"},
3680 {"OpenRgn", (PyCFunction)Qd_OpenRgn, 1,
3681 "() -> None"},
3682 {"CloseRgn", (PyCFunction)Qd_CloseRgn, 1,
3683 "(RgnHandle dstRgn) -> None"},
Jack Jansen41058c01995-11-16 22:48:29 +00003684 {"BitMapToRegion", (PyCFunction)Qd_BitMapToRegion, 1,
3685 "(RgnHandle region, BitMapPtr bMap) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003686 {"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
3687 "(RgnHandle rgn) -> None"},
3688 {"CopyRgn", (PyCFunction)Qd_CopyRgn, 1,
3689 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
3690 {"SetEmptyRgn", (PyCFunction)Qd_SetEmptyRgn, 1,
3691 "(RgnHandle rgn) -> None"},
3692 {"SetRectRgn", (PyCFunction)Qd_SetRectRgn, 1,
3693 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
3694 {"RectRgn", (PyCFunction)Qd_RectRgn, 1,
3695 "(RgnHandle rgn, Rect r) -> None"},
3696 {"OffsetRgn", (PyCFunction)Qd_OffsetRgn, 1,
3697 "(RgnHandle rgn, short dh, short dv) -> None"},
3698 {"InsetRgn", (PyCFunction)Qd_InsetRgn, 1,
3699 "(RgnHandle rgn, short dh, short dv) -> None"},
3700 {"SectRgn", (PyCFunction)Qd_SectRgn, 1,
3701 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
3702 {"UnionRgn", (PyCFunction)Qd_UnionRgn, 1,
3703 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
3704 {"DiffRgn", (PyCFunction)Qd_DiffRgn, 1,
3705 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
3706 {"XorRgn", (PyCFunction)Qd_XorRgn, 1,
3707 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
3708 {"RectInRgn", (PyCFunction)Qd_RectInRgn, 1,
3709 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
3710 {"EqualRgn", (PyCFunction)Qd_EqualRgn, 1,
3711 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
3712 {"EmptyRgn", (PyCFunction)Qd_EmptyRgn, 1,
3713 "(RgnHandle rgn) -> (Boolean _rv)"},
3714 {"FrameRgn", (PyCFunction)Qd_FrameRgn, 1,
3715 "(RgnHandle rgn) -> None"},
3716 {"PaintRgn", (PyCFunction)Qd_PaintRgn, 1,
3717 "(RgnHandle rgn) -> None"},
3718 {"EraseRgn", (PyCFunction)Qd_EraseRgn, 1,
3719 "(RgnHandle rgn) -> None"},
3720 {"InvertRgn", (PyCFunction)Qd_InvertRgn, 1,
3721 "(RgnHandle rgn) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003722 {"FillRgn", (PyCFunction)Qd_FillRgn, 1,
3723 "(RgnHandle rgn, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003724 {"ScrollRect", (PyCFunction)Qd_ScrollRect, 1,
3725 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
Jack Jansen41058c01995-11-16 22:48:29 +00003726 {"CopyBits", (PyCFunction)Qd_CopyBits, 1,
3727 "(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
3728 {"CopyMask", (PyCFunction)Qd_CopyMask, 1,
3729 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003730 {"OpenPicture", (PyCFunction)Qd_OpenPicture, 1,
3731 "(Rect picFrame) -> (PicHandle _rv)"},
3732 {"PicComment", (PyCFunction)Qd_PicComment, 1,
3733 "(short kind, short dataSize, Handle dataHandle) -> None"},
3734 {"ClosePicture", (PyCFunction)Qd_ClosePicture, 1,
3735 "() -> None"},
3736 {"DrawPicture", (PyCFunction)Qd_DrawPicture, 1,
3737 "(PicHandle myPicture, Rect dstRect) -> None"},
3738 {"KillPicture", (PyCFunction)Qd_KillPicture, 1,
3739 "(PicHandle myPicture) -> None"},
3740 {"OpenPoly", (PyCFunction)Qd_OpenPoly, 1,
3741 "() -> (PolyHandle _rv)"},
3742 {"ClosePoly", (PyCFunction)Qd_ClosePoly, 1,
3743 "() -> None"},
3744 {"KillPoly", (PyCFunction)Qd_KillPoly, 1,
3745 "(PolyHandle poly) -> None"},
3746 {"OffsetPoly", (PyCFunction)Qd_OffsetPoly, 1,
3747 "(PolyHandle poly, short dh, short dv) -> None"},
3748 {"FramePoly", (PyCFunction)Qd_FramePoly, 1,
3749 "(PolyHandle poly) -> None"},
3750 {"PaintPoly", (PyCFunction)Qd_PaintPoly, 1,
3751 "(PolyHandle poly) -> None"},
3752 {"ErasePoly", (PyCFunction)Qd_ErasePoly, 1,
3753 "(PolyHandle poly) -> None"},
3754 {"InvertPoly", (PyCFunction)Qd_InvertPoly, 1,
3755 "(PolyHandle poly) -> None"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003756 {"FillPoly", (PyCFunction)Qd_FillPoly, 1,
3757 "(PolyHandle poly, Pattern pat) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003758 {"SetPt", (PyCFunction)Qd_SetPt, 1,
Jack Jansen1d8ede71996-01-08 23:47:31 +00003759 "(short h, short v) -> (Point pt)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003760 {"LocalToGlobal", (PyCFunction)Qd_LocalToGlobal, 1,
3761 "(Point pt) -> (Point pt)"},
3762 {"GlobalToLocal", (PyCFunction)Qd_GlobalToLocal, 1,
3763 "(Point pt) -> (Point pt)"},
3764 {"Random", (PyCFunction)Qd_Random, 1,
3765 "() -> (short _rv)"},
3766 {"GetPixel", (PyCFunction)Qd_GetPixel, 1,
3767 "(short h, short v) -> (Boolean _rv)"},
3768 {"ScalePt", (PyCFunction)Qd_ScalePt, 1,
3769 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
3770 {"MapPt", (PyCFunction)Qd_MapPt, 1,
3771 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
3772 {"MapRect", (PyCFunction)Qd_MapRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00003773 "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003774 {"MapRgn", (PyCFunction)Qd_MapRgn, 1,
3775 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
3776 {"MapPoly", (PyCFunction)Qd_MapPoly, 1,
3777 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
Jack Jansen41058c01995-11-16 22:48:29 +00003778 {"StdBits", (PyCFunction)Qd_StdBits, 1,
3779 "(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003780 {"AddPt", (PyCFunction)Qd_AddPt, 1,
3781 "(Point src, Point dst) -> (Point dst)"},
3782 {"EqualPt", (PyCFunction)Qd_EqualPt, 1,
3783 "(Point pt1, Point pt2) -> (Boolean _rv)"},
3784 {"PtInRect", (PyCFunction)Qd_PtInRect, 1,
3785 "(Point pt, Rect r) -> (Boolean _rv)"},
3786 {"Pt2Rect", (PyCFunction)Qd_Pt2Rect, 1,
3787 "(Point pt1, Point pt2) -> (Rect dstRect)"},
3788 {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1,
3789 "(Rect r, Point pt) -> (short angle)"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003790 {"SubPt", (PyCFunction)Qd_SubPt, 1,
3791 "(Point src, Point dst) -> (Point dst)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003792 {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1,
3793 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
3794 {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1,
3795 "() -> (PixMapHandle _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003796 {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1,
3797 "(PixMapHandle pm) -> None"},
3798 {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1,
3799 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
3800 {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1,
3801 "() -> (PixPatHandle _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003802 {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1,
3803 "(PixPatHandle pp) -> None"},
3804 {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1,
3805 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
3806 {"PenPixPat", (PyCFunction)Qd_PenPixPat, 1,
3807 "(PixPatHandle pp) -> None"},
3808 {"BackPixPat", (PyCFunction)Qd_BackPixPat, 1,
3809 "(PixPatHandle pp) -> None"},
3810 {"GetPixPat", (PyCFunction)Qd_GetPixPat, 1,
3811 "(short patID) -> (PixPatHandle _rv)"},
Jack Jansen232f3cd1995-12-09 14:04:31 +00003812 {"MakeRGBPat", (PyCFunction)Qd_MakeRGBPat, 1,
3813 "(PixPatHandle pp, RGBColor myColor) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003814 {"FillCRect", (PyCFunction)Qd_FillCRect, 1,
3815 "(Rect r, PixPatHandle pp) -> None"},
3816 {"FillCOval", (PyCFunction)Qd_FillCOval, 1,
3817 "(Rect r, PixPatHandle pp) -> None"},
3818 {"FillCRoundRect", (PyCFunction)Qd_FillCRoundRect, 1,
3819 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
3820 {"FillCArc", (PyCFunction)Qd_FillCArc, 1,
3821 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
3822 {"FillCRgn", (PyCFunction)Qd_FillCRgn, 1,
3823 "(RgnHandle rgn, PixPatHandle pp) -> None"},
3824 {"FillCPoly", (PyCFunction)Qd_FillCPoly, 1,
3825 "(PolyHandle poly, PixPatHandle pp) -> None"},
Jack Jansen232f3cd1995-12-09 14:04:31 +00003826 {"RGBForeColor", (PyCFunction)Qd_RGBForeColor, 1,
3827 "(RGBColor color) -> None"},
3828 {"RGBBackColor", (PyCFunction)Qd_RGBBackColor, 1,
3829 "(RGBColor color) -> None"},
3830 {"SetCPixel", (PyCFunction)Qd_SetCPixel, 1,
3831 "(short h, short v, RGBColor cPix) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003832 {"SetPortPix", (PyCFunction)Qd_SetPortPix, 1,
3833 "(PixMapHandle pm) -> None"},
Jack Jansen232f3cd1995-12-09 14:04:31 +00003834 {"GetCPixel", (PyCFunction)Qd_GetCPixel, 1,
3835 "(short h, short v) -> (RGBColor cPix)"},
3836 {"GetForeColor", (PyCFunction)Qd_GetForeColor, 1,
3837 "() -> (RGBColor color)"},
3838 {"GetBackColor", (PyCFunction)Qd_GetBackColor, 1,
3839 "() -> (RGBColor color)"},
3840 {"OpColor", (PyCFunction)Qd_OpColor, 1,
3841 "(RGBColor color) -> None"},
3842 {"HiliteColor", (PyCFunction)Qd_HiliteColor, 1,
3843 "(RGBColor color) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003844 {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1,
3845 "() -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00003846 {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1,
3847 "() -> (long _rv)"},
Jack Jansen232f3cd1995-12-09 14:04:31 +00003848 {"Color2Index", (PyCFunction)Qd_Color2Index, 1,
3849 "(RGBColor myColor) -> (long _rv)"},
3850 {"Index2Color", (PyCFunction)Qd_Index2Color, 1,
3851 "(long index) -> (RGBColor aColor)"},
3852 {"InvertColor", (PyCFunction)Qd_InvertColor, 1,
3853 "() -> (RGBColor myColor)"},
3854 {"RealColor", (PyCFunction)Qd_RealColor, 1,
3855 "(RGBColor color) -> (Boolean _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00003856 {"SetClientID", (PyCFunction)Qd_SetClientID, 1,
3857 "(short id) -> None"},
3858 {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1,
3859 "(short index, Boolean protect) -> None"},
3860 {"ReserveEntry", (PyCFunction)Qd_ReserveEntry, 1,
3861 "(short index, Boolean reserve) -> None"},
3862 {"QDError", (PyCFunction)Qd_QDError, 1,
3863 "() -> (short _rv)"},
Jack Jansen41058c01995-11-16 22:48:29 +00003864 {"CopyDeepMask", (PyCFunction)Qd_CopyDeepMask, 1,
3865 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
Jack Jansen54c8f7e1995-11-14 10:46:01 +00003866 {"GetPattern", (PyCFunction)Qd_GetPattern, 1,
3867 "(short patternID) -> (PatHandle _rv)"},
3868 {"GetCursor", (PyCFunction)Qd_GetCursor, 1,
3869 "(short cursorID) -> (CursHandle _rv)"},
3870 {"GetPicture", (PyCFunction)Qd_GetPicture, 1,
3871 "(short pictureID) -> (PicHandle _rv)"},
3872 {"DeltaPoint", (PyCFunction)Qd_DeltaPoint, 1,
3873 "(Point ptA, Point ptB) -> (long _rv)"},
3874 {"ShieldCursor", (PyCFunction)Qd_ShieldCursor, 1,
3875 "(Rect shieldRect, Point offsetPt) -> None"},
3876 {"ScreenRes", (PyCFunction)Qd_ScreenRes, 1,
3877 "() -> (short scrnHRes, short scrnVRes)"},
Jack Jansen04a02e71996-01-06 17:12:58 +00003878 {"GetIndPattern", (PyCFunction)Qd_GetIndPattern, 1,
3879 "(short patternListID, short index) -> (Pattern thePat)"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003880 {"TextFont", (PyCFunction)Qd_TextFont, 1,
3881 "(short font) -> None"},
3882 {"TextFace", (PyCFunction)Qd_TextFace, 1,
3883 "(short face) -> None"},
3884 {"TextMode", (PyCFunction)Qd_TextMode, 1,
3885 "(short mode) -> None"},
3886 {"TextSize", (PyCFunction)Qd_TextSize, 1,
3887 "(short size) -> None"},
3888 {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00003889 "(Fixed extra) -> None"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003890 {"DrawChar", (PyCFunction)Qd_DrawChar, 1,
3891 "(short ch) -> None"},
3892 {"DrawString", (PyCFunction)Qd_DrawString, 1,
3893 "(Str255 s) -> None"},
3894 {"DrawText", (PyCFunction)Qd_DrawText, 1,
3895 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
3896 {"CharWidth", (PyCFunction)Qd_CharWidth, 1,
3897 "(short ch) -> (short _rv)"},
3898 {"StringWidth", (PyCFunction)Qd_StringWidth, 1,
3899 "(Str255 s) -> (short _rv)"},
3900 {"TextWidth", (PyCFunction)Qd_TextWidth, 1,
3901 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
Jack Jansen3a50f8a1996-01-11 16:17:14 +00003902 {"GetFontInfo", (PyCFunction)Qd_GetFontInfo, 1,
3903 "() -> (FontInfo info)"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00003904 {"CharExtra", (PyCFunction)Qd_CharExtra, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00003905 "(Fixed extra) -> None"},
Jack Jansen41058c01995-11-16 22:48:29 +00003906 {"BitMap", (PyCFunction)Qd_BitMap, 1,
3907 "Take (string, int, Rect) argument and create BitMap"},
Jack Jansen425e9eb1995-12-12 15:02:03 +00003908 {"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,
3909 "Take string BitMap and turn into BitMap object"},
Guido van Rossum17448e21995-01-30 11:53:55 +00003910 {NULL, NULL, 0}
3911};
3912
3913
3914
3915
3916void initQd()
3917{
3918 PyObject *m;
3919 PyObject *d;
3920
3921
3922
3923
3924 m = Py_InitModule("Qd", Qd_methods);
3925 d = PyModule_GetDict(m);
3926 Qd_Error = PyMac_GetOSErrException();
3927 if (Qd_Error == NULL ||
3928 PyDict_SetItemString(d, "Error", Qd_Error) != 0)
3929 Py_FatalError("can't initialize Qd.Error");
Jack Jansenb5394061996-01-05 18:06:41 +00003930
3931 {
3932 PyObject *o;
Jack Jansenbdd07471996-01-29 15:44:03 +00003933
3934 o = QDGA_New();
3935 if (o == NULL || PyDict_SetItemString(d, "qd", o) != 0)
3936 Py_FatalError("can't initialize Qd.qd");
Jack Jansenb5394061996-01-05 18:06:41 +00003937 }
3938
3939
Guido van Rossum17448e21995-01-30 11:53:55 +00003940}
3941
3942/* ========================= End module Qd ========================== */
3943