blob: 7174d3b72f5c4881a52efc0b29b518ccb35548a3 [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);
Jack Jansend4c26461995-08-17 14:35:56 +000017extern PyObject *ResObj_OptNew(Handle);
Guido van Rossum17448e21995-01-30 11:53:55 +000018extern int ResObj_Convert(PyObject *, Handle *);
19
20extern PyObject *WinObj_New(WindowPtr);
21extern int WinObj_Convert(PyObject *, WindowPtr *);
Jack Jansen330381c1995-11-15 15:18:01 +000022extern PyTypeObject Window_Type;
23#define WinObj_Check(x) ((x)->ob_type == &Window_Type)
Guido van Rossum17448e21995-01-30 11:53:55 +000024
25extern PyObject *DlgObj_New(DialogPtr);
26extern int DlgObj_Convert(PyObject *, DialogPtr *);
27extern PyTypeObject Dialog_Type;
28#define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
29
30extern PyObject *MenuObj_New(MenuHandle);
31extern int MenuObj_Convert(PyObject *, MenuHandle *);
32
33extern PyObject *CtlObj_New(ControlHandle);
34extern int CtlObj_Convert(PyObject *, ControlHandle *);
35
Jack Jansen330381c1995-11-15 15:18:01 +000036extern PyObject *GrafObj_New(GrafPtr);
37extern int GrafObj_Convert(PyObject *, GrafPtr *);
38
Guido van Rossum17448e21995-01-30 11:53:55 +000039extern PyObject *WinObj_WhichWindow(WindowPtr);
40
41#include <QuickDraw.h>
42#include <Desk.h>
43
44#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
45
46static PyObject *Qd_Error;
47
Jack Jansen330381c1995-11-15 15:18:01 +000048/* ---------------------- Object type GrafPort ---------------------- */
49
50PyTypeObject GrafPort_Type;
51
52#define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type)
53
54typedef struct GrafPortObject {
55 PyObject_HEAD
56 GrafPtr ob_itself;
57} GrafPortObject;
58
59PyObject *GrafObj_New(itself)
60 GrafPtr itself;
Guido van Rossum17448e21995-01-30 11:53:55 +000061{
Jack Jansen330381c1995-11-15 15:18:01 +000062 GrafPortObject *it;
63 if (itself == NULL) return PyMac_Error(resNotFound);
64 it = PyObject_NEW(GrafPortObject, &GrafPort_Type);
65 if (it == NULL) return NULL;
66 it->ob_itself = itself;
67 return (PyObject *)it;
68}
69GrafObj_Convert(v, p_itself)
70 PyObject *v;
71 GrafPtr *p_itself;
72{
73 if (DlgObj_Check(v) || WinObj_Check(v)) {
74 *p_itself = ((GrafPortObject *)v)->ob_itself;
75 return 1;
76 }
77 if (!GrafObj_Check(v))
78 {
79 PyErr_SetString(PyExc_TypeError, "GrafPort required");
80 return 0;
81 }
82 *p_itself = ((GrafPortObject *)v)->ob_itself;
83 return 1;
Guido van Rossum17448e21995-01-30 11:53:55 +000084}
85
Jack Jansen330381c1995-11-15 15:18:01 +000086static void GrafObj_dealloc(self)
87 GrafPortObject *self;
Guido van Rossum17448e21995-01-30 11:53:55 +000088{
Jack Jansen330381c1995-11-15 15:18:01 +000089 /* Cleanup of self->ob_itself goes here */
90 PyMem_DEL(self);
Guido van Rossume56db431995-03-19 22:49:50 +000091}
92
Jack Jansen330381c1995-11-15 15:18:01 +000093static PyMethodDef GrafObj_methods[] = {
94 {NULL, NULL, 0}
95};
96
97PyMethodChain GrafObj_chain = { GrafObj_methods, NULL };
98
99static PyObject *GrafObj_getattr(self, name)
100 GrafPortObject *self;
101 char *name;
Guido van Rossume56db431995-03-19 22:49:50 +0000102{
Jack Jansen330381c1995-11-15 15:18:01 +0000103 if ( strcmp(name, "device") == 0 )
104 return PyInt_FromLong((long)self->ob_itself->device);
105 if ( strcmp(name, "portRect") == 0 )
106 return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->portRect);
107 /* XXXX Add more, as needed */
108
109 return Py_FindMethodInChain(&GrafObj_chain, (PyObject *)self, name);
Guido van Rossum17448e21995-01-30 11:53:55 +0000110}
111
Jack Jansen330381c1995-11-15 15:18:01 +0000112#define GrafObj_setattr NULL
113
114PyTypeObject GrafPort_Type = {
115 PyObject_HEAD_INIT(&PyType_Type)
116 0, /*ob_size*/
117 "GrafPort", /*tp_name*/
118 sizeof(GrafPortObject), /*tp_basicsize*/
119 0, /*tp_itemsize*/
120 /* methods */
121 (destructor) GrafObj_dealloc, /*tp_dealloc*/
122 0, /*tp_print*/
123 (getattrfunc) GrafObj_getattr, /*tp_getattr*/
124 (setattrfunc) GrafObj_setattr, /*tp_setattr*/
125};
126
127/* -------------------- End object type GrafPort -------------------- */
128
129
Guido van Rossum17448e21995-01-30 11:53:55 +0000130static PyObject *Qd_SetPort(_self, _args)
131 PyObject *_self;
132 PyObject *_args;
133{
134 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +0000135 GrafPtr port;
Guido van Rossum17448e21995-01-30 11:53:55 +0000136 if (!PyArg_ParseTuple(_args, "O&",
Jack Jansen330381c1995-11-15 15:18:01 +0000137 GrafObj_Convert, &port))
Guido van Rossum17448e21995-01-30 11:53:55 +0000138 return NULL;
Guido van Rossume56db431995-03-19 22:49:50 +0000139 SetPort(port);
140 Py_INCREF(Py_None);
141 _res = Py_None;
142 return _res;
143}
144
145static PyObject *Qd_GetPort(_self, _args)
146 PyObject *_self;
147 PyObject *_args;
148{
149 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +0000150 GrafPtr port;
Guido van Rossume56db431995-03-19 22:49:50 +0000151 if (!PyArg_ParseTuple(_args, ""))
152 return NULL;
153 GetPort(&port);
154 _res = Py_BuildValue("O&",
Jack Jansen330381c1995-11-15 15:18:01 +0000155 GrafObj_New, port);
Guido van Rossume56db431995-03-19 22:49:50 +0000156 return _res;
157}
158
159static PyObject *Qd_GrafDevice(_self, _args)
160 PyObject *_self;
161 PyObject *_args;
162{
163 PyObject *_res = NULL;
164 short device;
165 if (!PyArg_ParseTuple(_args, "h",
166 &device))
167 return NULL;
168 GrafDevice(device);
169 Py_INCREF(Py_None);
170 _res = Py_None;
171 return _res;
172}
173
174static PyObject *Qd_PortSize(_self, _args)
175 PyObject *_self;
176 PyObject *_args;
177{
178 PyObject *_res = NULL;
179 short width;
180 short height;
181 if (!PyArg_ParseTuple(_args, "hh",
182 &width,
183 &height))
184 return NULL;
185 PortSize(width,
186 height);
187 Py_INCREF(Py_None);
188 _res = Py_None;
189 return _res;
190}
191
192static PyObject *Qd_MovePortTo(_self, _args)
193 PyObject *_self;
194 PyObject *_args;
195{
196 PyObject *_res = NULL;
197 short leftGlobal;
198 short topGlobal;
199 if (!PyArg_ParseTuple(_args, "hh",
200 &leftGlobal,
201 &topGlobal))
202 return NULL;
203 MovePortTo(leftGlobal,
204 topGlobal);
205 Py_INCREF(Py_None);
206 _res = Py_None;
207 return _res;
208}
209
210static PyObject *Qd_SetOrigin(_self, _args)
211 PyObject *_self;
212 PyObject *_args;
213{
214 PyObject *_res = NULL;
215 short h;
216 short v;
217 if (!PyArg_ParseTuple(_args, "hh",
218 &h,
219 &v))
220 return NULL;
221 SetOrigin(h,
222 v);
223 Py_INCREF(Py_None);
224 _res = Py_None;
225 return _res;
226}
227
228static PyObject *Qd_SetClip(_self, _args)
229 PyObject *_self;
230 PyObject *_args;
231{
232 PyObject *_res = NULL;
233 RgnHandle rgn;
234 if (!PyArg_ParseTuple(_args, "O&",
235 ResObj_Convert, &rgn))
236 return NULL;
237 SetClip(rgn);
238 Py_INCREF(Py_None);
239 _res = Py_None;
240 return _res;
241}
242
243static PyObject *Qd_GetClip(_self, _args)
244 PyObject *_self;
245 PyObject *_args;
246{
247 PyObject *_res = NULL;
248 RgnHandle rgn;
249 if (!PyArg_ParseTuple(_args, "O&",
250 ResObj_Convert, &rgn))
251 return NULL;
252 GetClip(rgn);
Guido van Rossum17448e21995-01-30 11:53:55 +0000253 Py_INCREF(Py_None);
254 _res = Py_None;
255 return _res;
256}
257
258static PyObject *Qd_ClipRect(_self, _args)
259 PyObject *_self;
260 PyObject *_args;
261{
262 PyObject *_res = NULL;
263 Rect r;
264 if (!PyArg_ParseTuple(_args, "O&",
265 PyMac_GetRect, &r))
266 return NULL;
267 ClipRect(&r);
268 Py_INCREF(Py_None);
269 _res = Py_None;
270 return _res;
271}
272
Guido van Rossume56db431995-03-19 22:49:50 +0000273static PyObject *Qd_InitCursor(_self, _args)
274 PyObject *_self;
275 PyObject *_args;
276{
277 PyObject *_res = NULL;
278 if (!PyArg_ParseTuple(_args, ""))
279 return NULL;
280 InitCursor();
281 Py_INCREF(Py_None);
282 _res = Py_None;
283 return _res;
284}
285
286static PyObject *Qd_HideCursor(_self, _args)
287 PyObject *_self;
288 PyObject *_args;
289{
290 PyObject *_res = NULL;
291 if (!PyArg_ParseTuple(_args, ""))
292 return NULL;
293 HideCursor();
294 Py_INCREF(Py_None);
295 _res = Py_None;
296 return _res;
297}
298
299static PyObject *Qd_ShowCursor(_self, _args)
300 PyObject *_self;
301 PyObject *_args;
302{
303 PyObject *_res = NULL;
304 if (!PyArg_ParseTuple(_args, ""))
305 return NULL;
306 ShowCursor();
307 Py_INCREF(Py_None);
308 _res = Py_None;
309 return _res;
310}
311
312static PyObject *Qd_ObscureCursor(_self, _args)
313 PyObject *_self;
314 PyObject *_args;
315{
316 PyObject *_res = NULL;
317 if (!PyArg_ParseTuple(_args, ""))
318 return NULL;
319 ObscureCursor();
320 Py_INCREF(Py_None);
321 _res = Py_None;
322 return _res;
323}
324
325static PyObject *Qd_HidePen(_self, _args)
326 PyObject *_self;
327 PyObject *_args;
328{
329 PyObject *_res = NULL;
330 if (!PyArg_ParseTuple(_args, ""))
331 return NULL;
332 HidePen();
333 Py_INCREF(Py_None);
334 _res = Py_None;
335 return _res;
336}
337
338static PyObject *Qd_ShowPen(_self, _args)
339 PyObject *_self;
340 PyObject *_args;
341{
342 PyObject *_res = NULL;
343 if (!PyArg_ParseTuple(_args, ""))
344 return NULL;
345 ShowPen();
346 Py_INCREF(Py_None);
347 _res = Py_None;
348 return _res;
349}
350
351static PyObject *Qd_GetPen(_self, _args)
352 PyObject *_self;
353 PyObject *_args;
354{
355 PyObject *_res = NULL;
356 Point pt;
357 if (!PyArg_ParseTuple(_args, "O&",
358 PyMac_GetPoint, &pt))
359 return NULL;
360 GetPen(&pt);
361 _res = Py_BuildValue("O&",
362 PyMac_BuildPoint, pt);
363 return _res;
364}
365
366static PyObject *Qd_PenSize(_self, _args)
367 PyObject *_self;
368 PyObject *_args;
369{
370 PyObject *_res = NULL;
371 short width;
372 short height;
373 if (!PyArg_ParseTuple(_args, "hh",
374 &width,
375 &height))
376 return NULL;
377 PenSize(width,
378 height);
379 Py_INCREF(Py_None);
380 _res = Py_None;
381 return _res;
382}
383
384static PyObject *Qd_PenMode(_self, _args)
385 PyObject *_self;
386 PyObject *_args;
387{
388 PyObject *_res = NULL;
389 short mode;
390 if (!PyArg_ParseTuple(_args, "h",
391 &mode))
392 return NULL;
393 PenMode(mode);
394 Py_INCREF(Py_None);
395 _res = Py_None;
396 return _res;
397}
398
399static PyObject *Qd_PenNormal(_self, _args)
400 PyObject *_self;
401 PyObject *_args;
402{
403 PyObject *_res = NULL;
404 if (!PyArg_ParseTuple(_args, ""))
405 return NULL;
406 PenNormal();
407 Py_INCREF(Py_None);
408 _res = Py_None;
409 return _res;
410}
411
412static PyObject *Qd_MoveTo(_self, _args)
413 PyObject *_self;
414 PyObject *_args;
415{
416 PyObject *_res = NULL;
417 short h;
418 short v;
419 if (!PyArg_ParseTuple(_args, "hh",
420 &h,
421 &v))
422 return NULL;
423 MoveTo(h,
424 v);
425 Py_INCREF(Py_None);
426 _res = Py_None;
427 return _res;
428}
429
430static PyObject *Qd_Move(_self, _args)
431 PyObject *_self;
432 PyObject *_args;
433{
434 PyObject *_res = NULL;
435 short dh;
436 short dv;
437 if (!PyArg_ParseTuple(_args, "hh",
438 &dh,
439 &dv))
440 return NULL;
441 Move(dh,
442 dv);
443 Py_INCREF(Py_None);
444 _res = Py_None;
445 return _res;
446}
447
448static PyObject *Qd_LineTo(_self, _args)
449 PyObject *_self;
450 PyObject *_args;
451{
452 PyObject *_res = NULL;
453 short h;
454 short v;
455 if (!PyArg_ParseTuple(_args, "hh",
456 &h,
457 &v))
458 return NULL;
459 LineTo(h,
460 v);
461 Py_INCREF(Py_None);
462 _res = Py_None;
463 return _res;
464}
465
466static PyObject *Qd_Line(_self, _args)
467 PyObject *_self;
468 PyObject *_args;
469{
470 PyObject *_res = NULL;
471 short dh;
472 short dv;
473 if (!PyArg_ParseTuple(_args, "hh",
474 &dh,
475 &dv))
476 return NULL;
477 Line(dh,
478 dv);
479 Py_INCREF(Py_None);
480 _res = Py_None;
481 return _res;
482}
483
Guido van Rossume56db431995-03-19 22:49:50 +0000484static PyObject *Qd_ForeColor(_self, _args)
485 PyObject *_self;
486 PyObject *_args;
487{
488 PyObject *_res = NULL;
489 long color;
490 if (!PyArg_ParseTuple(_args, "l",
491 &color))
492 return NULL;
493 ForeColor(color);
494 Py_INCREF(Py_None);
495 _res = Py_None;
496 return _res;
497}
498
499static PyObject *Qd_BackColor(_self, _args)
500 PyObject *_self;
501 PyObject *_args;
502{
503 PyObject *_res = NULL;
504 long color;
505 if (!PyArg_ParseTuple(_args, "l",
506 &color))
507 return NULL;
508 BackColor(color);
509 Py_INCREF(Py_None);
510 _res = Py_None;
511 return _res;
512}
513
514static PyObject *Qd_ColorBit(_self, _args)
515 PyObject *_self;
516 PyObject *_args;
517{
518 PyObject *_res = NULL;
519 short whichBit;
520 if (!PyArg_ParseTuple(_args, "h",
521 &whichBit))
522 return NULL;
523 ColorBit(whichBit);
524 Py_INCREF(Py_None);
525 _res = Py_None;
526 return _res;
527}
528
529static PyObject *Qd_SetRect(_self, _args)
530 PyObject *_self;
531 PyObject *_args;
532{
533 PyObject *_res = NULL;
534 Rect r;
535 short left;
536 short top;
537 short right;
538 short bottom;
539 if (!PyArg_ParseTuple(_args, "hhhh",
540 &left,
541 &top,
542 &right,
543 &bottom))
544 return NULL;
545 SetRect(&r,
546 left,
547 top,
548 right,
549 bottom);
550 _res = Py_BuildValue("O&",
551 PyMac_BuildRect, &r);
552 return _res;
553}
554
555static PyObject *Qd_OffsetRect(_self, _args)
556 PyObject *_self;
557 PyObject *_args;
558{
559 PyObject *_res = NULL;
560 Rect r;
561 short dh;
562 short dv;
Jack Jansen54c8f7e1995-11-14 10:46:01 +0000563 if (!PyArg_ParseTuple(_args, "O&hh",
564 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +0000565 &dh,
566 &dv))
567 return NULL;
568 OffsetRect(&r,
569 dh,
570 dv);
571 _res = Py_BuildValue("O&",
572 PyMac_BuildRect, &r);
573 return _res;
574}
575
576static PyObject *Qd_InsetRect(_self, _args)
577 PyObject *_self;
578 PyObject *_args;
579{
580 PyObject *_res = NULL;
581 Rect r;
582 short dh;
583 short dv;
Jack Jansen54c8f7e1995-11-14 10:46:01 +0000584 if (!PyArg_ParseTuple(_args, "O&hh",
585 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +0000586 &dh,
587 &dv))
588 return NULL;
589 InsetRect(&r,
590 dh,
591 dv);
592 _res = Py_BuildValue("O&",
593 PyMac_BuildRect, &r);
594 return _res;
595}
596
597static PyObject *Qd_SectRect(_self, _args)
598 PyObject *_self;
599 PyObject *_args;
600{
601 PyObject *_res = NULL;
602 Boolean _rv;
603 Rect src1;
604 Rect src2;
605 Rect dstRect;
606 if (!PyArg_ParseTuple(_args, "O&O&",
607 PyMac_GetRect, &src1,
608 PyMac_GetRect, &src2))
609 return NULL;
610 _rv = SectRect(&src1,
611 &src2,
612 &dstRect);
613 _res = Py_BuildValue("bO&",
614 _rv,
615 PyMac_BuildRect, &dstRect);
616 return _res;
617}
618
619static PyObject *Qd_UnionRect(_self, _args)
620 PyObject *_self;
621 PyObject *_args;
622{
623 PyObject *_res = NULL;
624 Rect src1;
625 Rect src2;
626 Rect dstRect;
627 if (!PyArg_ParseTuple(_args, "O&O&",
628 PyMac_GetRect, &src1,
629 PyMac_GetRect, &src2))
630 return NULL;
631 UnionRect(&src1,
632 &src2,
633 &dstRect);
634 _res = Py_BuildValue("O&",
635 PyMac_BuildRect, &dstRect);
636 return _res;
637}
638
639static PyObject *Qd_EqualRect(_self, _args)
640 PyObject *_self;
641 PyObject *_args;
642{
643 PyObject *_res = NULL;
644 Boolean _rv;
645 Rect rect1;
646 Rect rect2;
647 if (!PyArg_ParseTuple(_args, "O&O&",
648 PyMac_GetRect, &rect1,
649 PyMac_GetRect, &rect2))
650 return NULL;
651 _rv = EqualRect(&rect1,
652 &rect2);
653 _res = Py_BuildValue("b",
654 _rv);
655 return _res;
656}
657
658static PyObject *Qd_EmptyRect(_self, _args)
659 PyObject *_self;
660 PyObject *_args;
661{
662 PyObject *_res = NULL;
663 Boolean _rv;
664 Rect r;
665 if (!PyArg_ParseTuple(_args, "O&",
666 PyMac_GetRect, &r))
667 return NULL;
668 _rv = EmptyRect(&r);
669 _res = Py_BuildValue("b",
670 _rv);
671 return _res;
672}
673
674static PyObject *Qd_FrameRect(_self, _args)
675 PyObject *_self;
676 PyObject *_args;
677{
678 PyObject *_res = NULL;
679 Rect r;
680 if (!PyArg_ParseTuple(_args, "O&",
681 PyMac_GetRect, &r))
682 return NULL;
683 FrameRect(&r);
684 Py_INCREF(Py_None);
685 _res = Py_None;
686 return _res;
687}
688
689static PyObject *Qd_PaintRect(_self, _args)
690 PyObject *_self;
691 PyObject *_args;
692{
693 PyObject *_res = NULL;
694 Rect r;
695 if (!PyArg_ParseTuple(_args, "O&",
696 PyMac_GetRect, &r))
697 return NULL;
698 PaintRect(&r);
699 Py_INCREF(Py_None);
700 _res = Py_None;
701 return _res;
702}
703
Guido van Rossum17448e21995-01-30 11:53:55 +0000704static PyObject *Qd_EraseRect(_self, _args)
705 PyObject *_self;
706 PyObject *_args;
707{
708 PyObject *_res = NULL;
709 Rect r;
710 if (!PyArg_ParseTuple(_args, "O&",
711 PyMac_GetRect, &r))
712 return NULL;
713 EraseRect(&r);
714 Py_INCREF(Py_None);
715 _res = Py_None;
716 return _res;
717}
718
Guido van Rossume56db431995-03-19 22:49:50 +0000719static PyObject *Qd_InvertRect(_self, _args)
Guido van Rossum17448e21995-01-30 11:53:55 +0000720 PyObject *_self;
721 PyObject *_args;
722{
723 PyObject *_res = NULL;
Guido van Rossume56db431995-03-19 22:49:50 +0000724 Rect r;
Guido van Rossum17448e21995-01-30 11:53:55 +0000725 if (!PyArg_ParseTuple(_args, "O&",
Guido van Rossume56db431995-03-19 22:49:50 +0000726 PyMac_GetRect, &r))
Guido van Rossum17448e21995-01-30 11:53:55 +0000727 return NULL;
Guido van Rossume56db431995-03-19 22:49:50 +0000728 InvertRect(&r);
Guido van Rossum17448e21995-01-30 11:53:55 +0000729 Py_INCREF(Py_None);
730 _res = Py_None;
731 return _res;
732}
733
Guido van Rossume56db431995-03-19 22:49:50 +0000734static PyObject *Qd_FrameOval(_self, _args)
735 PyObject *_self;
736 PyObject *_args;
737{
738 PyObject *_res = NULL;
739 Rect r;
740 if (!PyArg_ParseTuple(_args, "O&",
741 PyMac_GetRect, &r))
742 return NULL;
743 FrameOval(&r);
744 Py_INCREF(Py_None);
745 _res = Py_None;
746 return _res;
747}
748
749static PyObject *Qd_PaintOval(_self, _args)
750 PyObject *_self;
751 PyObject *_args;
752{
753 PyObject *_res = NULL;
754 Rect r;
755 if (!PyArg_ParseTuple(_args, "O&",
756 PyMac_GetRect, &r))
757 return NULL;
758 PaintOval(&r);
759 Py_INCREF(Py_None);
760 _res = Py_None;
761 return _res;
762}
763
764static PyObject *Qd_EraseOval(_self, _args)
765 PyObject *_self;
766 PyObject *_args;
767{
768 PyObject *_res = NULL;
769 Rect r;
770 if (!PyArg_ParseTuple(_args, "O&",
771 PyMac_GetRect, &r))
772 return NULL;
773 EraseOval(&r);
774 Py_INCREF(Py_None);
775 _res = Py_None;
776 return _res;
777}
778
779static PyObject *Qd_InvertOval(_self, _args)
780 PyObject *_self;
781 PyObject *_args;
782{
783 PyObject *_res = NULL;
784 Rect r;
785 if (!PyArg_ParseTuple(_args, "O&",
786 PyMac_GetRect, &r))
787 return NULL;
788 InvertOval(&r);
789 Py_INCREF(Py_None);
790 _res = Py_None;
791 return _res;
792}
793
794static PyObject *Qd_FrameRoundRect(_self, _args)
795 PyObject *_self;
796 PyObject *_args;
797{
798 PyObject *_res = NULL;
799 Rect r;
800 short ovalWidth;
801 short ovalHeight;
802 if (!PyArg_ParseTuple(_args, "O&hh",
803 PyMac_GetRect, &r,
804 &ovalWidth,
805 &ovalHeight))
806 return NULL;
807 FrameRoundRect(&r,
808 ovalWidth,
809 ovalHeight);
810 Py_INCREF(Py_None);
811 _res = Py_None;
812 return _res;
813}
814
815static PyObject *Qd_PaintRoundRect(_self, _args)
816 PyObject *_self;
817 PyObject *_args;
818{
819 PyObject *_res = NULL;
820 Rect r;
821 short ovalWidth;
822 short ovalHeight;
823 if (!PyArg_ParseTuple(_args, "O&hh",
824 PyMac_GetRect, &r,
825 &ovalWidth,
826 &ovalHeight))
827 return NULL;
828 PaintRoundRect(&r,
829 ovalWidth,
830 ovalHeight);
831 Py_INCREF(Py_None);
832 _res = Py_None;
833 return _res;
834}
835
836static PyObject *Qd_EraseRoundRect(_self, _args)
837 PyObject *_self;
838 PyObject *_args;
839{
840 PyObject *_res = NULL;
841 Rect r;
842 short ovalWidth;
843 short ovalHeight;
844 if (!PyArg_ParseTuple(_args, "O&hh",
845 PyMac_GetRect, &r,
846 &ovalWidth,
847 &ovalHeight))
848 return NULL;
849 EraseRoundRect(&r,
850 ovalWidth,
851 ovalHeight);
852 Py_INCREF(Py_None);
853 _res = Py_None;
854 return _res;
855}
856
857static PyObject *Qd_InvertRoundRect(_self, _args)
858 PyObject *_self;
859 PyObject *_args;
860{
861 PyObject *_res = NULL;
862 Rect r;
863 short ovalWidth;
864 short ovalHeight;
865 if (!PyArg_ParseTuple(_args, "O&hh",
866 PyMac_GetRect, &r,
867 &ovalWidth,
868 &ovalHeight))
869 return NULL;
870 InvertRoundRect(&r,
871 ovalWidth,
872 ovalHeight);
873 Py_INCREF(Py_None);
874 _res = Py_None;
875 return _res;
876}
877
878static PyObject *Qd_FrameArc(_self, _args)
879 PyObject *_self;
880 PyObject *_args;
881{
882 PyObject *_res = NULL;
883 Rect r;
884 short startAngle;
885 short arcAngle;
886 if (!PyArg_ParseTuple(_args, "O&hh",
887 PyMac_GetRect, &r,
888 &startAngle,
889 &arcAngle))
890 return NULL;
891 FrameArc(&r,
892 startAngle,
893 arcAngle);
894 Py_INCREF(Py_None);
895 _res = Py_None;
896 return _res;
897}
898
899static PyObject *Qd_PaintArc(_self, _args)
900 PyObject *_self;
901 PyObject *_args;
902{
903 PyObject *_res = NULL;
904 Rect r;
905 short startAngle;
906 short arcAngle;
907 if (!PyArg_ParseTuple(_args, "O&hh",
908 PyMac_GetRect, &r,
909 &startAngle,
910 &arcAngle))
911 return NULL;
912 PaintArc(&r,
913 startAngle,
914 arcAngle);
915 Py_INCREF(Py_None);
916 _res = Py_None;
917 return _res;
918}
919
920static PyObject *Qd_EraseArc(_self, _args)
921 PyObject *_self;
922 PyObject *_args;
923{
924 PyObject *_res = NULL;
925 Rect r;
926 short startAngle;
927 short arcAngle;
928 if (!PyArg_ParseTuple(_args, "O&hh",
929 PyMac_GetRect, &r,
930 &startAngle,
931 &arcAngle))
932 return NULL;
933 EraseArc(&r,
934 startAngle,
935 arcAngle);
936 Py_INCREF(Py_None);
937 _res = Py_None;
938 return _res;
939}
940
941static PyObject *Qd_InvertArc(_self, _args)
942 PyObject *_self;
943 PyObject *_args;
944{
945 PyObject *_res = NULL;
946 Rect r;
947 short startAngle;
948 short arcAngle;
949 if (!PyArg_ParseTuple(_args, "O&hh",
950 PyMac_GetRect, &r,
951 &startAngle,
952 &arcAngle))
953 return NULL;
954 InvertArc(&r,
955 startAngle,
956 arcAngle);
957 Py_INCREF(Py_None);
958 _res = Py_None;
959 return _res;
960}
961
962static PyObject *Qd_NewRgn(_self, _args)
963 PyObject *_self;
964 PyObject *_args;
965{
966 PyObject *_res = NULL;
967 RgnHandle _rv;
968 if (!PyArg_ParseTuple(_args, ""))
969 return NULL;
970 _rv = NewRgn();
971 _res = Py_BuildValue("O&",
972 ResObj_New, _rv);
973 return _res;
974}
975
976static PyObject *Qd_OpenRgn(_self, _args)
977 PyObject *_self;
978 PyObject *_args;
979{
980 PyObject *_res = NULL;
981 if (!PyArg_ParseTuple(_args, ""))
982 return NULL;
983 OpenRgn();
984 Py_INCREF(Py_None);
985 _res = Py_None;
986 return _res;
987}
988
989static PyObject *Qd_CloseRgn(_self, _args)
990 PyObject *_self;
991 PyObject *_args;
992{
993 PyObject *_res = NULL;
994 RgnHandle dstRgn;
995 if (!PyArg_ParseTuple(_args, "O&",
996 ResObj_Convert, &dstRgn))
997 return NULL;
998 CloseRgn(dstRgn);
999 Py_INCREF(Py_None);
1000 _res = Py_None;
1001 return _res;
1002}
1003
1004static PyObject *Qd_DisposeRgn(_self, _args)
1005 PyObject *_self;
1006 PyObject *_args;
1007{
1008 PyObject *_res = NULL;
1009 RgnHandle rgn;
1010 if (!PyArg_ParseTuple(_args, "O&",
1011 ResObj_Convert, &rgn))
1012 return NULL;
1013 DisposeRgn(rgn);
1014 Py_INCREF(Py_None);
1015 _res = Py_None;
1016 return _res;
1017}
1018
1019static PyObject *Qd_CopyRgn(_self, _args)
1020 PyObject *_self;
1021 PyObject *_args;
1022{
1023 PyObject *_res = NULL;
1024 RgnHandle srcRgn;
1025 RgnHandle dstRgn;
1026 if (!PyArg_ParseTuple(_args, "O&O&",
1027 ResObj_Convert, &srcRgn,
1028 ResObj_Convert, &dstRgn))
1029 return NULL;
1030 CopyRgn(srcRgn,
1031 dstRgn);
1032 Py_INCREF(Py_None);
1033 _res = Py_None;
1034 return _res;
1035}
1036
1037static PyObject *Qd_SetEmptyRgn(_self, _args)
1038 PyObject *_self;
1039 PyObject *_args;
1040{
1041 PyObject *_res = NULL;
1042 RgnHandle rgn;
1043 if (!PyArg_ParseTuple(_args, "O&",
1044 ResObj_Convert, &rgn))
1045 return NULL;
1046 SetEmptyRgn(rgn);
1047 Py_INCREF(Py_None);
1048 _res = Py_None;
1049 return _res;
1050}
1051
1052static PyObject *Qd_SetRectRgn(_self, _args)
1053 PyObject *_self;
1054 PyObject *_args;
1055{
1056 PyObject *_res = NULL;
1057 RgnHandle rgn;
1058 short left;
1059 short top;
1060 short right;
1061 short bottom;
1062 if (!PyArg_ParseTuple(_args, "O&hhhh",
1063 ResObj_Convert, &rgn,
1064 &left,
1065 &top,
1066 &right,
1067 &bottom))
1068 return NULL;
1069 SetRectRgn(rgn,
1070 left,
1071 top,
1072 right,
1073 bottom);
1074 Py_INCREF(Py_None);
1075 _res = Py_None;
1076 return _res;
1077}
1078
1079static PyObject *Qd_RectRgn(_self, _args)
1080 PyObject *_self;
1081 PyObject *_args;
1082{
1083 PyObject *_res = NULL;
1084 RgnHandle rgn;
1085 Rect r;
1086 if (!PyArg_ParseTuple(_args, "O&O&",
1087 ResObj_Convert, &rgn,
1088 PyMac_GetRect, &r))
1089 return NULL;
1090 RectRgn(rgn,
1091 &r);
1092 Py_INCREF(Py_None);
1093 _res = Py_None;
1094 return _res;
1095}
1096
1097static PyObject *Qd_OffsetRgn(_self, _args)
1098 PyObject *_self;
1099 PyObject *_args;
1100{
1101 PyObject *_res = NULL;
1102 RgnHandle rgn;
1103 short dh;
1104 short dv;
1105 if (!PyArg_ParseTuple(_args, "O&hh",
1106 ResObj_Convert, &rgn,
1107 &dh,
1108 &dv))
1109 return NULL;
1110 OffsetRgn(rgn,
1111 dh,
1112 dv);
1113 Py_INCREF(Py_None);
1114 _res = Py_None;
1115 return _res;
1116}
1117
1118static PyObject *Qd_InsetRgn(_self, _args)
1119 PyObject *_self;
1120 PyObject *_args;
1121{
1122 PyObject *_res = NULL;
1123 RgnHandle rgn;
1124 short dh;
1125 short dv;
1126 if (!PyArg_ParseTuple(_args, "O&hh",
1127 ResObj_Convert, &rgn,
1128 &dh,
1129 &dv))
1130 return NULL;
1131 InsetRgn(rgn,
1132 dh,
1133 dv);
1134 Py_INCREF(Py_None);
1135 _res = Py_None;
1136 return _res;
1137}
1138
1139static PyObject *Qd_SectRgn(_self, _args)
1140 PyObject *_self;
1141 PyObject *_args;
1142{
1143 PyObject *_res = NULL;
1144 RgnHandle srcRgnA;
1145 RgnHandle srcRgnB;
1146 RgnHandle dstRgn;
1147 if (!PyArg_ParseTuple(_args, "O&O&O&",
1148 ResObj_Convert, &srcRgnA,
1149 ResObj_Convert, &srcRgnB,
1150 ResObj_Convert, &dstRgn))
1151 return NULL;
1152 SectRgn(srcRgnA,
1153 srcRgnB,
1154 dstRgn);
1155 Py_INCREF(Py_None);
1156 _res = Py_None;
1157 return _res;
1158}
1159
1160static PyObject *Qd_UnionRgn(_self, _args)
1161 PyObject *_self;
1162 PyObject *_args;
1163{
1164 PyObject *_res = NULL;
1165 RgnHandle srcRgnA;
1166 RgnHandle srcRgnB;
1167 RgnHandle dstRgn;
1168 if (!PyArg_ParseTuple(_args, "O&O&O&",
1169 ResObj_Convert, &srcRgnA,
1170 ResObj_Convert, &srcRgnB,
1171 ResObj_Convert, &dstRgn))
1172 return NULL;
1173 UnionRgn(srcRgnA,
1174 srcRgnB,
1175 dstRgn);
1176 Py_INCREF(Py_None);
1177 _res = Py_None;
1178 return _res;
1179}
1180
1181static PyObject *Qd_DiffRgn(_self, _args)
1182 PyObject *_self;
1183 PyObject *_args;
1184{
1185 PyObject *_res = NULL;
1186 RgnHandle srcRgnA;
1187 RgnHandle srcRgnB;
1188 RgnHandle dstRgn;
1189 if (!PyArg_ParseTuple(_args, "O&O&O&",
1190 ResObj_Convert, &srcRgnA,
1191 ResObj_Convert, &srcRgnB,
1192 ResObj_Convert, &dstRgn))
1193 return NULL;
1194 DiffRgn(srcRgnA,
1195 srcRgnB,
1196 dstRgn);
1197 Py_INCREF(Py_None);
1198 _res = Py_None;
1199 return _res;
1200}
1201
1202static PyObject *Qd_XorRgn(_self, _args)
1203 PyObject *_self;
1204 PyObject *_args;
1205{
1206 PyObject *_res = NULL;
1207 RgnHandle srcRgnA;
1208 RgnHandle srcRgnB;
1209 RgnHandle dstRgn;
1210 if (!PyArg_ParseTuple(_args, "O&O&O&",
1211 ResObj_Convert, &srcRgnA,
1212 ResObj_Convert, &srcRgnB,
1213 ResObj_Convert, &dstRgn))
1214 return NULL;
1215 XorRgn(srcRgnA,
1216 srcRgnB,
1217 dstRgn);
1218 Py_INCREF(Py_None);
1219 _res = Py_None;
1220 return _res;
1221}
1222
1223static PyObject *Qd_RectInRgn(_self, _args)
1224 PyObject *_self;
1225 PyObject *_args;
1226{
1227 PyObject *_res = NULL;
1228 Boolean _rv;
1229 Rect r;
1230 RgnHandle rgn;
1231 if (!PyArg_ParseTuple(_args, "O&O&",
1232 PyMac_GetRect, &r,
1233 ResObj_Convert, &rgn))
1234 return NULL;
1235 _rv = RectInRgn(&r,
1236 rgn);
1237 _res = Py_BuildValue("b",
1238 _rv);
1239 return _res;
1240}
1241
1242static PyObject *Qd_EqualRgn(_self, _args)
1243 PyObject *_self;
1244 PyObject *_args;
1245{
1246 PyObject *_res = NULL;
1247 Boolean _rv;
1248 RgnHandle rgnA;
1249 RgnHandle rgnB;
1250 if (!PyArg_ParseTuple(_args, "O&O&",
1251 ResObj_Convert, &rgnA,
1252 ResObj_Convert, &rgnB))
1253 return NULL;
1254 _rv = EqualRgn(rgnA,
1255 rgnB);
1256 _res = Py_BuildValue("b",
1257 _rv);
1258 return _res;
1259}
1260
1261static PyObject *Qd_EmptyRgn(_self, _args)
1262 PyObject *_self;
1263 PyObject *_args;
1264{
1265 PyObject *_res = NULL;
1266 Boolean _rv;
1267 RgnHandle rgn;
1268 if (!PyArg_ParseTuple(_args, "O&",
1269 ResObj_Convert, &rgn))
1270 return NULL;
1271 _rv = EmptyRgn(rgn);
1272 _res = Py_BuildValue("b",
1273 _rv);
1274 return _res;
1275}
1276
1277static PyObject *Qd_FrameRgn(_self, _args)
1278 PyObject *_self;
1279 PyObject *_args;
1280{
1281 PyObject *_res = NULL;
1282 RgnHandle rgn;
1283 if (!PyArg_ParseTuple(_args, "O&",
1284 ResObj_Convert, &rgn))
1285 return NULL;
1286 FrameRgn(rgn);
1287 Py_INCREF(Py_None);
1288 _res = Py_None;
1289 return _res;
1290}
1291
1292static PyObject *Qd_PaintRgn(_self, _args)
1293 PyObject *_self;
1294 PyObject *_args;
1295{
1296 PyObject *_res = NULL;
1297 RgnHandle rgn;
1298 if (!PyArg_ParseTuple(_args, "O&",
1299 ResObj_Convert, &rgn))
1300 return NULL;
1301 PaintRgn(rgn);
1302 Py_INCREF(Py_None);
1303 _res = Py_None;
1304 return _res;
1305}
1306
1307static PyObject *Qd_EraseRgn(_self, _args)
1308 PyObject *_self;
1309 PyObject *_args;
1310{
1311 PyObject *_res = NULL;
1312 RgnHandle rgn;
1313 if (!PyArg_ParseTuple(_args, "O&",
1314 ResObj_Convert, &rgn))
1315 return NULL;
1316 EraseRgn(rgn);
1317 Py_INCREF(Py_None);
1318 _res = Py_None;
1319 return _res;
1320}
1321
1322static PyObject *Qd_InvertRgn(_self, _args)
1323 PyObject *_self;
1324 PyObject *_args;
1325{
1326 PyObject *_res = NULL;
1327 RgnHandle rgn;
1328 if (!PyArg_ParseTuple(_args, "O&",
1329 ResObj_Convert, &rgn))
1330 return NULL;
1331 InvertRgn(rgn);
1332 Py_INCREF(Py_None);
1333 _res = Py_None;
1334 return _res;
1335}
1336
1337static PyObject *Qd_ScrollRect(_self, _args)
1338 PyObject *_self;
1339 PyObject *_args;
1340{
1341 PyObject *_res = NULL;
1342 Rect r;
1343 short dh;
1344 short dv;
1345 RgnHandle updateRgn;
1346 if (!PyArg_ParseTuple(_args, "O&hhO&",
1347 PyMac_GetRect, &r,
1348 &dh,
1349 &dv,
1350 ResObj_Convert, &updateRgn))
1351 return NULL;
1352 ScrollRect(&r,
1353 dh,
1354 dv,
1355 updateRgn);
1356 Py_INCREF(Py_None);
1357 _res = Py_None;
1358 return _res;
1359}
1360
1361static PyObject *Qd_OpenPicture(_self, _args)
1362 PyObject *_self;
1363 PyObject *_args;
1364{
1365 PyObject *_res = NULL;
1366 PicHandle _rv;
1367 Rect picFrame;
1368 if (!PyArg_ParseTuple(_args, "O&",
1369 PyMac_GetRect, &picFrame))
1370 return NULL;
1371 _rv = OpenPicture(&picFrame);
1372 _res = Py_BuildValue("O&",
1373 ResObj_New, _rv);
1374 return _res;
1375}
1376
1377static PyObject *Qd_PicComment(_self, _args)
1378 PyObject *_self;
1379 PyObject *_args;
1380{
1381 PyObject *_res = NULL;
1382 short kind;
1383 short dataSize;
1384 Handle dataHandle;
1385 if (!PyArg_ParseTuple(_args, "hhO&",
1386 &kind,
1387 &dataSize,
1388 ResObj_Convert, &dataHandle))
1389 return NULL;
1390 PicComment(kind,
1391 dataSize,
1392 dataHandle);
1393 Py_INCREF(Py_None);
1394 _res = Py_None;
1395 return _res;
1396}
1397
1398static PyObject *Qd_ClosePicture(_self, _args)
1399 PyObject *_self;
1400 PyObject *_args;
1401{
1402 PyObject *_res = NULL;
1403 if (!PyArg_ParseTuple(_args, ""))
1404 return NULL;
1405 ClosePicture();
1406 Py_INCREF(Py_None);
1407 _res = Py_None;
1408 return _res;
1409}
1410
1411static PyObject *Qd_DrawPicture(_self, _args)
1412 PyObject *_self;
1413 PyObject *_args;
1414{
1415 PyObject *_res = NULL;
1416 PicHandle myPicture;
1417 Rect dstRect;
1418 if (!PyArg_ParseTuple(_args, "O&O&",
1419 ResObj_Convert, &myPicture,
1420 PyMac_GetRect, &dstRect))
1421 return NULL;
1422 DrawPicture(myPicture,
1423 &dstRect);
1424 Py_INCREF(Py_None);
1425 _res = Py_None;
1426 return _res;
1427}
1428
1429static PyObject *Qd_KillPicture(_self, _args)
1430 PyObject *_self;
1431 PyObject *_args;
1432{
1433 PyObject *_res = NULL;
1434 PicHandle myPicture;
1435 if (!PyArg_ParseTuple(_args, "O&",
1436 ResObj_Convert, &myPicture))
1437 return NULL;
1438 KillPicture(myPicture);
1439 Py_INCREF(Py_None);
1440 _res = Py_None;
1441 return _res;
1442}
1443
1444static PyObject *Qd_OpenPoly(_self, _args)
1445 PyObject *_self;
1446 PyObject *_args;
1447{
1448 PyObject *_res = NULL;
1449 PolyHandle _rv;
1450 if (!PyArg_ParseTuple(_args, ""))
1451 return NULL;
1452 _rv = OpenPoly();
1453 _res = Py_BuildValue("O&",
1454 ResObj_New, _rv);
1455 return _res;
1456}
1457
1458static PyObject *Qd_ClosePoly(_self, _args)
1459 PyObject *_self;
1460 PyObject *_args;
1461{
1462 PyObject *_res = NULL;
1463 if (!PyArg_ParseTuple(_args, ""))
1464 return NULL;
1465 ClosePoly();
1466 Py_INCREF(Py_None);
1467 _res = Py_None;
1468 return _res;
1469}
1470
1471static PyObject *Qd_KillPoly(_self, _args)
1472 PyObject *_self;
1473 PyObject *_args;
1474{
1475 PyObject *_res = NULL;
1476 PolyHandle poly;
1477 if (!PyArg_ParseTuple(_args, "O&",
1478 ResObj_Convert, &poly))
1479 return NULL;
1480 KillPoly(poly);
1481 Py_INCREF(Py_None);
1482 _res = Py_None;
1483 return _res;
1484}
1485
1486static PyObject *Qd_OffsetPoly(_self, _args)
1487 PyObject *_self;
1488 PyObject *_args;
1489{
1490 PyObject *_res = NULL;
1491 PolyHandle poly;
1492 short dh;
1493 short dv;
1494 if (!PyArg_ParseTuple(_args, "O&hh",
1495 ResObj_Convert, &poly,
1496 &dh,
1497 &dv))
1498 return NULL;
1499 OffsetPoly(poly,
1500 dh,
1501 dv);
1502 Py_INCREF(Py_None);
1503 _res = Py_None;
1504 return _res;
1505}
1506
1507static PyObject *Qd_FramePoly(_self, _args)
1508 PyObject *_self;
1509 PyObject *_args;
1510{
1511 PyObject *_res = NULL;
1512 PolyHandle poly;
1513 if (!PyArg_ParseTuple(_args, "O&",
1514 ResObj_Convert, &poly))
1515 return NULL;
1516 FramePoly(poly);
1517 Py_INCREF(Py_None);
1518 _res = Py_None;
1519 return _res;
1520}
1521
1522static PyObject *Qd_PaintPoly(_self, _args)
1523 PyObject *_self;
1524 PyObject *_args;
1525{
1526 PyObject *_res = NULL;
1527 PolyHandle poly;
1528 if (!PyArg_ParseTuple(_args, "O&",
1529 ResObj_Convert, &poly))
1530 return NULL;
1531 PaintPoly(poly);
1532 Py_INCREF(Py_None);
1533 _res = Py_None;
1534 return _res;
1535}
1536
1537static PyObject *Qd_ErasePoly(_self, _args)
1538 PyObject *_self;
1539 PyObject *_args;
1540{
1541 PyObject *_res = NULL;
1542 PolyHandle poly;
1543 if (!PyArg_ParseTuple(_args, "O&",
1544 ResObj_Convert, &poly))
1545 return NULL;
1546 ErasePoly(poly);
1547 Py_INCREF(Py_None);
1548 _res = Py_None;
1549 return _res;
1550}
1551
1552static PyObject *Qd_InvertPoly(_self, _args)
1553 PyObject *_self;
1554 PyObject *_args;
1555{
1556 PyObject *_res = NULL;
1557 PolyHandle poly;
1558 if (!PyArg_ParseTuple(_args, "O&",
1559 ResObj_Convert, &poly))
1560 return NULL;
1561 InvertPoly(poly);
1562 Py_INCREF(Py_None);
1563 _res = Py_None;
1564 return _res;
1565}
1566
1567static PyObject *Qd_SetPt(_self, _args)
1568 PyObject *_self;
1569 PyObject *_args;
1570{
1571 PyObject *_res = NULL;
1572 Point pt;
1573 short h;
1574 short v;
1575 if (!PyArg_ParseTuple(_args, "O&hh",
1576 PyMac_GetPoint, &pt,
1577 &h,
1578 &v))
1579 return NULL;
1580 SetPt(&pt,
1581 h,
1582 v);
1583 _res = Py_BuildValue("O&",
1584 PyMac_BuildPoint, pt);
1585 return _res;
1586}
1587
1588static PyObject *Qd_LocalToGlobal(_self, _args)
1589 PyObject *_self;
1590 PyObject *_args;
1591{
1592 PyObject *_res = NULL;
1593 Point pt;
1594 if (!PyArg_ParseTuple(_args, "O&",
1595 PyMac_GetPoint, &pt))
1596 return NULL;
1597 LocalToGlobal(&pt);
1598 _res = Py_BuildValue("O&",
1599 PyMac_BuildPoint, pt);
1600 return _res;
1601}
1602
1603static PyObject *Qd_GlobalToLocal(_self, _args)
1604 PyObject *_self;
1605 PyObject *_args;
1606{
1607 PyObject *_res = NULL;
1608 Point pt;
1609 if (!PyArg_ParseTuple(_args, "O&",
1610 PyMac_GetPoint, &pt))
1611 return NULL;
1612 GlobalToLocal(&pt);
1613 _res = Py_BuildValue("O&",
1614 PyMac_BuildPoint, pt);
1615 return _res;
1616}
1617
1618static PyObject *Qd_Random(_self, _args)
1619 PyObject *_self;
1620 PyObject *_args;
1621{
1622 PyObject *_res = NULL;
1623 short _rv;
1624 if (!PyArg_ParseTuple(_args, ""))
1625 return NULL;
1626 _rv = Random();
1627 _res = Py_BuildValue("h",
1628 _rv);
1629 return _res;
1630}
1631
1632static PyObject *Qd_GetPixel(_self, _args)
1633 PyObject *_self;
1634 PyObject *_args;
1635{
1636 PyObject *_res = NULL;
1637 Boolean _rv;
1638 short h;
1639 short v;
1640 if (!PyArg_ParseTuple(_args, "hh",
1641 &h,
1642 &v))
1643 return NULL;
1644 _rv = GetPixel(h,
1645 v);
1646 _res = Py_BuildValue("b",
1647 _rv);
1648 return _res;
1649}
1650
1651static PyObject *Qd_ScalePt(_self, _args)
1652 PyObject *_self;
1653 PyObject *_args;
1654{
1655 PyObject *_res = NULL;
1656 Point pt;
1657 Rect srcRect;
1658 Rect dstRect;
1659 if (!PyArg_ParseTuple(_args, "O&O&O&",
1660 PyMac_GetPoint, &pt,
1661 PyMac_GetRect, &srcRect,
1662 PyMac_GetRect, &dstRect))
1663 return NULL;
1664 ScalePt(&pt,
1665 &srcRect,
1666 &dstRect);
1667 _res = Py_BuildValue("O&",
1668 PyMac_BuildPoint, pt);
1669 return _res;
1670}
1671
1672static PyObject *Qd_MapPt(_self, _args)
1673 PyObject *_self;
1674 PyObject *_args;
1675{
1676 PyObject *_res = NULL;
1677 Point pt;
1678 Rect srcRect;
1679 Rect dstRect;
1680 if (!PyArg_ParseTuple(_args, "O&O&O&",
1681 PyMac_GetPoint, &pt,
1682 PyMac_GetRect, &srcRect,
1683 PyMac_GetRect, &dstRect))
1684 return NULL;
1685 MapPt(&pt,
1686 &srcRect,
1687 &dstRect);
1688 _res = Py_BuildValue("O&",
1689 PyMac_BuildPoint, pt);
1690 return _res;
1691}
1692
1693static PyObject *Qd_MapRect(_self, _args)
1694 PyObject *_self;
1695 PyObject *_args;
1696{
1697 PyObject *_res = NULL;
1698 Rect r;
1699 Rect srcRect;
1700 Rect dstRect;
Jack Jansen54c8f7e1995-11-14 10:46:01 +00001701 if (!PyArg_ParseTuple(_args, "O&O&O&",
1702 PyMac_GetRect, &r,
Guido van Rossume56db431995-03-19 22:49:50 +00001703 PyMac_GetRect, &srcRect,
1704 PyMac_GetRect, &dstRect))
1705 return NULL;
1706 MapRect(&r,
1707 &srcRect,
1708 &dstRect);
1709 _res = Py_BuildValue("O&",
1710 PyMac_BuildRect, &r);
1711 return _res;
1712}
1713
1714static PyObject *Qd_MapRgn(_self, _args)
1715 PyObject *_self;
1716 PyObject *_args;
1717{
1718 PyObject *_res = NULL;
1719 RgnHandle rgn;
1720 Rect srcRect;
1721 Rect dstRect;
1722 if (!PyArg_ParseTuple(_args, "O&O&O&",
1723 ResObj_Convert, &rgn,
1724 PyMac_GetRect, &srcRect,
1725 PyMac_GetRect, &dstRect))
1726 return NULL;
1727 MapRgn(rgn,
1728 &srcRect,
1729 &dstRect);
1730 Py_INCREF(Py_None);
1731 _res = Py_None;
1732 return _res;
1733}
1734
1735static PyObject *Qd_MapPoly(_self, _args)
1736 PyObject *_self;
1737 PyObject *_args;
1738{
1739 PyObject *_res = NULL;
1740 PolyHandle poly;
1741 Rect srcRect;
1742 Rect dstRect;
1743 if (!PyArg_ParseTuple(_args, "O&O&O&",
1744 ResObj_Convert, &poly,
1745 PyMac_GetRect, &srcRect,
1746 PyMac_GetRect, &dstRect))
1747 return NULL;
1748 MapPoly(poly,
1749 &srcRect,
1750 &dstRect);
1751 Py_INCREF(Py_None);
1752 _res = Py_None;
1753 return _res;
1754}
1755
1756static PyObject *Qd_AddPt(_self, _args)
1757 PyObject *_self;
1758 PyObject *_args;
1759{
1760 PyObject *_res = NULL;
1761 Point src;
1762 Point dst;
1763 if (!PyArg_ParseTuple(_args, "O&O&",
1764 PyMac_GetPoint, &src,
1765 PyMac_GetPoint, &dst))
1766 return NULL;
1767 AddPt(src,
1768 &dst);
1769 _res = Py_BuildValue("O&",
1770 PyMac_BuildPoint, dst);
1771 return _res;
1772}
1773
1774static PyObject *Qd_EqualPt(_self, _args)
1775 PyObject *_self;
1776 PyObject *_args;
1777{
1778 PyObject *_res = NULL;
1779 Boolean _rv;
1780 Point pt1;
1781 Point pt2;
1782 if (!PyArg_ParseTuple(_args, "O&O&",
1783 PyMac_GetPoint, &pt1,
1784 PyMac_GetPoint, &pt2))
1785 return NULL;
1786 _rv = EqualPt(pt1,
1787 pt2);
1788 _res = Py_BuildValue("b",
1789 _rv);
1790 return _res;
1791}
1792
1793static PyObject *Qd_PtInRect(_self, _args)
1794 PyObject *_self;
1795 PyObject *_args;
1796{
1797 PyObject *_res = NULL;
1798 Boolean _rv;
1799 Point pt;
1800 Rect r;
1801 if (!PyArg_ParseTuple(_args, "O&O&",
1802 PyMac_GetPoint, &pt,
1803 PyMac_GetRect, &r))
1804 return NULL;
1805 _rv = PtInRect(pt,
1806 &r);
1807 _res = Py_BuildValue("b",
1808 _rv);
1809 return _res;
1810}
1811
1812static PyObject *Qd_Pt2Rect(_self, _args)
1813 PyObject *_self;
1814 PyObject *_args;
1815{
1816 PyObject *_res = NULL;
1817 Point pt1;
1818 Point pt2;
1819 Rect dstRect;
1820 if (!PyArg_ParseTuple(_args, "O&O&",
1821 PyMac_GetPoint, &pt1,
1822 PyMac_GetPoint, &pt2))
1823 return NULL;
1824 Pt2Rect(pt1,
1825 pt2,
1826 &dstRect);
1827 _res = Py_BuildValue("O&",
1828 PyMac_BuildRect, &dstRect);
1829 return _res;
1830}
1831
1832static PyObject *Qd_PtToAngle(_self, _args)
1833 PyObject *_self;
1834 PyObject *_args;
1835{
1836 PyObject *_res = NULL;
1837 Rect r;
1838 Point pt;
1839 short angle;
1840 if (!PyArg_ParseTuple(_args, "O&O&",
1841 PyMac_GetRect, &r,
1842 PyMac_GetPoint, &pt))
1843 return NULL;
1844 PtToAngle(&r,
1845 pt,
1846 &angle);
1847 _res = Py_BuildValue("h",
1848 angle);
1849 return _res;
1850}
1851
Jack Jansenb81cf9d1995-06-06 13:08:40 +00001852static PyObject *Qd_SubPt(_self, _args)
1853 PyObject *_self;
1854 PyObject *_args;
1855{
1856 PyObject *_res = NULL;
1857 Point src;
1858 Point dst;
1859 if (!PyArg_ParseTuple(_args, "O&O&",
1860 PyMac_GetPoint, &src,
1861 PyMac_GetPoint, &dst))
1862 return NULL;
1863 SubPt(src,
1864 &dst);
1865 _res = Py_BuildValue("O&",
1866 PyMac_BuildPoint, dst);
1867 return _res;
1868}
1869
Guido van Rossume56db431995-03-19 22:49:50 +00001870static PyObject *Qd_PtInRgn(_self, _args)
1871 PyObject *_self;
1872 PyObject *_args;
1873{
1874 PyObject *_res = NULL;
1875 Boolean _rv;
1876 Point pt;
1877 RgnHandle rgn;
1878 if (!PyArg_ParseTuple(_args, "O&O&",
1879 PyMac_GetPoint, &pt,
1880 ResObj_Convert, &rgn))
1881 return NULL;
1882 _rv = PtInRgn(pt,
1883 rgn);
1884 _res = Py_BuildValue("b",
1885 _rv);
1886 return _res;
1887}
1888
1889static PyObject *Qd_NewPixMap(_self, _args)
1890 PyObject *_self;
1891 PyObject *_args;
1892{
1893 PyObject *_res = NULL;
1894 PixMapHandle _rv;
1895 if (!PyArg_ParseTuple(_args, ""))
1896 return NULL;
1897 _rv = NewPixMap();
1898 _res = Py_BuildValue("O&",
1899 ResObj_New, _rv);
1900 return _res;
1901}
1902
Guido van Rossume56db431995-03-19 22:49:50 +00001903static PyObject *Qd_DisposePixMap(_self, _args)
1904 PyObject *_self;
1905 PyObject *_args;
1906{
1907 PyObject *_res = NULL;
1908 PixMapHandle pm;
1909 if (!PyArg_ParseTuple(_args, "O&",
1910 ResObj_Convert, &pm))
1911 return NULL;
1912 DisposePixMap(pm);
1913 Py_INCREF(Py_None);
1914 _res = Py_None;
1915 return _res;
1916}
1917
1918static PyObject *Qd_CopyPixMap(_self, _args)
1919 PyObject *_self;
1920 PyObject *_args;
1921{
1922 PyObject *_res = NULL;
1923 PixMapHandle srcPM;
1924 PixMapHandle dstPM;
1925 if (!PyArg_ParseTuple(_args, "O&O&",
1926 ResObj_Convert, &srcPM,
1927 ResObj_Convert, &dstPM))
1928 return NULL;
1929 CopyPixMap(srcPM,
1930 dstPM);
1931 Py_INCREF(Py_None);
1932 _res = Py_None;
1933 return _res;
1934}
1935
1936static PyObject *Qd_NewPixPat(_self, _args)
1937 PyObject *_self;
1938 PyObject *_args;
1939{
1940 PyObject *_res = NULL;
1941 PixPatHandle _rv;
1942 if (!PyArg_ParseTuple(_args, ""))
1943 return NULL;
1944 _rv = NewPixPat();
1945 _res = Py_BuildValue("O&",
1946 ResObj_New, _rv);
1947 return _res;
1948}
1949
Guido van Rossume56db431995-03-19 22:49:50 +00001950static PyObject *Qd_DisposePixPat(_self, _args)
1951 PyObject *_self;
1952 PyObject *_args;
1953{
1954 PyObject *_res = NULL;
1955 PixPatHandle pp;
1956 if (!PyArg_ParseTuple(_args, "O&",
1957 ResObj_Convert, &pp))
1958 return NULL;
1959 DisposePixPat(pp);
1960 Py_INCREF(Py_None);
1961 _res = Py_None;
1962 return _res;
1963}
1964
1965static PyObject *Qd_CopyPixPat(_self, _args)
1966 PyObject *_self;
1967 PyObject *_args;
1968{
1969 PyObject *_res = NULL;
1970 PixPatHandle srcPP;
1971 PixPatHandle dstPP;
1972 if (!PyArg_ParseTuple(_args, "O&O&",
1973 ResObj_Convert, &srcPP,
1974 ResObj_Convert, &dstPP))
1975 return NULL;
1976 CopyPixPat(srcPP,
1977 dstPP);
1978 Py_INCREF(Py_None);
1979 _res = Py_None;
1980 return _res;
1981}
1982
1983static PyObject *Qd_PenPixPat(_self, _args)
1984 PyObject *_self;
1985 PyObject *_args;
1986{
1987 PyObject *_res = NULL;
1988 PixPatHandle pp;
1989 if (!PyArg_ParseTuple(_args, "O&",
1990 ResObj_Convert, &pp))
1991 return NULL;
1992 PenPixPat(pp);
1993 Py_INCREF(Py_None);
1994 _res = Py_None;
1995 return _res;
1996}
1997
1998static PyObject *Qd_BackPixPat(_self, _args)
1999 PyObject *_self;
2000 PyObject *_args;
2001{
2002 PyObject *_res = NULL;
2003 PixPatHandle pp;
2004 if (!PyArg_ParseTuple(_args, "O&",
2005 ResObj_Convert, &pp))
2006 return NULL;
2007 BackPixPat(pp);
2008 Py_INCREF(Py_None);
2009 _res = Py_None;
2010 return _res;
2011}
2012
2013static PyObject *Qd_GetPixPat(_self, _args)
2014 PyObject *_self;
2015 PyObject *_args;
2016{
2017 PyObject *_res = NULL;
2018 PixPatHandle _rv;
2019 short patID;
2020 if (!PyArg_ParseTuple(_args, "h",
2021 &patID))
2022 return NULL;
2023 _rv = GetPixPat(patID);
2024 _res = Py_BuildValue("O&",
2025 ResObj_New, _rv);
2026 return _res;
2027}
2028
2029static PyObject *Qd_FillCRect(_self, _args)
2030 PyObject *_self;
2031 PyObject *_args;
2032{
2033 PyObject *_res = NULL;
2034 Rect r;
2035 PixPatHandle pp;
2036 if (!PyArg_ParseTuple(_args, "O&O&",
2037 PyMac_GetRect, &r,
2038 ResObj_Convert, &pp))
2039 return NULL;
2040 FillCRect(&r,
2041 pp);
2042 Py_INCREF(Py_None);
2043 _res = Py_None;
2044 return _res;
2045}
2046
2047static PyObject *Qd_FillCOval(_self, _args)
2048 PyObject *_self;
2049 PyObject *_args;
2050{
2051 PyObject *_res = NULL;
2052 Rect r;
2053 PixPatHandle pp;
2054 if (!PyArg_ParseTuple(_args, "O&O&",
2055 PyMac_GetRect, &r,
2056 ResObj_Convert, &pp))
2057 return NULL;
2058 FillCOval(&r,
2059 pp);
2060 Py_INCREF(Py_None);
2061 _res = Py_None;
2062 return _res;
2063}
2064
2065static PyObject *Qd_FillCRoundRect(_self, _args)
2066 PyObject *_self;
2067 PyObject *_args;
2068{
2069 PyObject *_res = NULL;
2070 Rect r;
2071 short ovalWidth;
2072 short ovalHeight;
2073 PixPatHandle pp;
2074 if (!PyArg_ParseTuple(_args, "O&hhO&",
2075 PyMac_GetRect, &r,
2076 &ovalWidth,
2077 &ovalHeight,
2078 ResObj_Convert, &pp))
2079 return NULL;
2080 FillCRoundRect(&r,
2081 ovalWidth,
2082 ovalHeight,
2083 pp);
2084 Py_INCREF(Py_None);
2085 _res = Py_None;
2086 return _res;
2087}
2088
2089static PyObject *Qd_FillCArc(_self, _args)
2090 PyObject *_self;
2091 PyObject *_args;
2092{
2093 PyObject *_res = NULL;
2094 Rect r;
2095 short startAngle;
2096 short arcAngle;
2097 PixPatHandle pp;
2098 if (!PyArg_ParseTuple(_args, "O&hhO&",
2099 PyMac_GetRect, &r,
2100 &startAngle,
2101 &arcAngle,
2102 ResObj_Convert, &pp))
2103 return NULL;
2104 FillCArc(&r,
2105 startAngle,
2106 arcAngle,
2107 pp);
2108 Py_INCREF(Py_None);
2109 _res = Py_None;
2110 return _res;
2111}
2112
2113static PyObject *Qd_FillCRgn(_self, _args)
2114 PyObject *_self;
2115 PyObject *_args;
2116{
2117 PyObject *_res = NULL;
2118 RgnHandle rgn;
2119 PixPatHandle pp;
2120 if (!PyArg_ParseTuple(_args, "O&O&",
2121 ResObj_Convert, &rgn,
2122 ResObj_Convert, &pp))
2123 return NULL;
2124 FillCRgn(rgn,
2125 pp);
2126 Py_INCREF(Py_None);
2127 _res = Py_None;
2128 return _res;
2129}
2130
2131static PyObject *Qd_FillCPoly(_self, _args)
2132 PyObject *_self;
2133 PyObject *_args;
2134{
2135 PyObject *_res = NULL;
2136 PolyHandle poly;
2137 PixPatHandle pp;
2138 if (!PyArg_ParseTuple(_args, "O&O&",
2139 ResObj_Convert, &poly,
2140 ResObj_Convert, &pp))
2141 return NULL;
2142 FillCPoly(poly,
2143 pp);
2144 Py_INCREF(Py_None);
2145 _res = Py_None;
2146 return _res;
2147}
2148
2149static PyObject *Qd_SetPortPix(_self, _args)
2150 PyObject *_self;
2151 PyObject *_args;
2152{
2153 PyObject *_res = NULL;
2154 PixMapHandle pm;
2155 if (!PyArg_ParseTuple(_args, "O&",
2156 ResObj_Convert, &pm))
2157 return NULL;
2158 SetPortPix(pm);
2159 Py_INCREF(Py_None);
2160 _res = Py_None;
2161 return _res;
2162}
2163
2164static PyObject *Qd_AllocCursor(_self, _args)
2165 PyObject *_self;
2166 PyObject *_args;
2167{
2168 PyObject *_res = NULL;
2169 if (!PyArg_ParseTuple(_args, ""))
2170 return NULL;
2171 AllocCursor();
2172 Py_INCREF(Py_None);
2173 _res = Py_None;
2174 return _res;
2175}
2176
Guido van Rossume56db431995-03-19 22:49:50 +00002177static PyObject *Qd_GetCTSeed(_self, _args)
2178 PyObject *_self;
2179 PyObject *_args;
2180{
2181 PyObject *_res = NULL;
2182 long _rv;
2183 if (!PyArg_ParseTuple(_args, ""))
2184 return NULL;
2185 _rv = GetCTSeed();
2186 _res = Py_BuildValue("l",
2187 _rv);
2188 return _res;
2189}
2190
Guido van Rossume56db431995-03-19 22:49:50 +00002191static PyObject *Qd_SetClientID(_self, _args)
2192 PyObject *_self;
2193 PyObject *_args;
2194{
2195 PyObject *_res = NULL;
2196 short id;
2197 if (!PyArg_ParseTuple(_args, "h",
2198 &id))
2199 return NULL;
2200 SetClientID(id);
2201 Py_INCREF(Py_None);
2202 _res = Py_None;
2203 return _res;
2204}
2205
2206static PyObject *Qd_ProtectEntry(_self, _args)
2207 PyObject *_self;
2208 PyObject *_args;
2209{
2210 PyObject *_res = NULL;
2211 short index;
2212 Boolean protect;
2213 if (!PyArg_ParseTuple(_args, "hb",
2214 &index,
2215 &protect))
2216 return NULL;
2217 ProtectEntry(index,
2218 protect);
2219 Py_INCREF(Py_None);
2220 _res = Py_None;
2221 return _res;
2222}
2223
2224static PyObject *Qd_ReserveEntry(_self, _args)
2225 PyObject *_self;
2226 PyObject *_args;
2227{
2228 PyObject *_res = NULL;
2229 short index;
2230 Boolean reserve;
2231 if (!PyArg_ParseTuple(_args, "hb",
2232 &index,
2233 &reserve))
2234 return NULL;
2235 ReserveEntry(index,
2236 reserve);
2237 Py_INCREF(Py_None);
2238 _res = Py_None;
2239 return _res;
2240}
2241
2242static PyObject *Qd_QDError(_self, _args)
2243 PyObject *_self;
2244 PyObject *_args;
2245{
2246 PyObject *_res = NULL;
2247 short _rv;
2248 if (!PyArg_ParseTuple(_args, ""))
2249 return NULL;
2250 _rv = QDError();
2251 _res = Py_BuildValue("h",
2252 _rv);
2253 return _res;
2254}
2255
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002256static PyObject *Qd_GetPattern(_self, _args)
2257 PyObject *_self;
2258 PyObject *_args;
2259{
2260 PyObject *_res = NULL;
2261 PatHandle _rv;
2262 short patternID;
2263 if (!PyArg_ParseTuple(_args, "h",
2264 &patternID))
2265 return NULL;
2266 _rv = GetPattern(patternID);
2267 _res = Py_BuildValue("O&",
2268 ResObj_New, _rv);
2269 return _res;
2270}
2271
2272static PyObject *Qd_GetCursor(_self, _args)
2273 PyObject *_self;
2274 PyObject *_args;
2275{
2276 PyObject *_res = NULL;
2277 CursHandle _rv;
2278 short cursorID;
2279 if (!PyArg_ParseTuple(_args, "h",
2280 &cursorID))
2281 return NULL;
2282 _rv = GetCursor(cursorID);
2283 _res = Py_BuildValue("O&",
2284 ResObj_New, _rv);
2285 return _res;
2286}
2287
2288static PyObject *Qd_GetPicture(_self, _args)
2289 PyObject *_self;
2290 PyObject *_args;
2291{
2292 PyObject *_res = NULL;
2293 PicHandle _rv;
2294 short pictureID;
2295 if (!PyArg_ParseTuple(_args, "h",
2296 &pictureID))
2297 return NULL;
2298 _rv = GetPicture(pictureID);
2299 _res = Py_BuildValue("O&",
2300 ResObj_New, _rv);
2301 return _res;
2302}
2303
2304static PyObject *Qd_DeltaPoint(_self, _args)
2305 PyObject *_self;
2306 PyObject *_args;
2307{
2308 PyObject *_res = NULL;
2309 long _rv;
2310 Point ptA;
2311 Point ptB;
2312 if (!PyArg_ParseTuple(_args, "O&O&",
2313 PyMac_GetPoint, &ptA,
2314 PyMac_GetPoint, &ptB))
2315 return NULL;
2316 _rv = DeltaPoint(ptA,
2317 ptB);
2318 _res = Py_BuildValue("l",
2319 _rv);
2320 return _res;
2321}
2322
2323static PyObject *Qd_ShieldCursor(_self, _args)
2324 PyObject *_self;
2325 PyObject *_args;
2326{
2327 PyObject *_res = NULL;
2328 Rect shieldRect;
2329 Point offsetPt;
2330 if (!PyArg_ParseTuple(_args, "O&O&",
2331 PyMac_GetRect, &shieldRect,
2332 PyMac_GetPoint, &offsetPt))
2333 return NULL;
2334 ShieldCursor(&shieldRect,
2335 offsetPt);
2336 Py_INCREF(Py_None);
2337 _res = Py_None;
2338 return _res;
2339}
2340
2341static PyObject *Qd_ScreenRes(_self, _args)
2342 PyObject *_self;
2343 PyObject *_args;
2344{
2345 PyObject *_res = NULL;
2346 short scrnHRes;
2347 short scrnVRes;
2348 if (!PyArg_ParseTuple(_args, ""))
2349 return NULL;
2350 ScreenRes(&scrnHRes,
2351 &scrnVRes);
2352 _res = Py_BuildValue("hh",
2353 scrnHRes,
2354 scrnVRes);
2355 return _res;
2356}
2357
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002358static PyObject *Qd_TextFont(_self, _args)
2359 PyObject *_self;
2360 PyObject *_args;
2361{
2362 PyObject *_res = NULL;
2363 short font;
2364 if (!PyArg_ParseTuple(_args, "h",
2365 &font))
2366 return NULL;
2367 TextFont(font);
2368 Py_INCREF(Py_None);
2369 _res = Py_None;
2370 return _res;
2371}
2372
2373static PyObject *Qd_TextFace(_self, _args)
2374 PyObject *_self;
2375 PyObject *_args;
2376{
2377 PyObject *_res = NULL;
2378 short face;
2379 if (!PyArg_ParseTuple(_args, "h",
2380 &face))
2381 return NULL;
2382 TextFace(face);
2383 Py_INCREF(Py_None);
2384 _res = Py_None;
2385 return _res;
2386}
2387
2388static PyObject *Qd_TextMode(_self, _args)
2389 PyObject *_self;
2390 PyObject *_args;
2391{
2392 PyObject *_res = NULL;
2393 short mode;
2394 if (!PyArg_ParseTuple(_args, "h",
2395 &mode))
2396 return NULL;
2397 TextMode(mode);
2398 Py_INCREF(Py_None);
2399 _res = Py_None;
2400 return _res;
2401}
2402
2403static PyObject *Qd_TextSize(_self, _args)
2404 PyObject *_self;
2405 PyObject *_args;
2406{
2407 PyObject *_res = NULL;
2408 short size;
2409 if (!PyArg_ParseTuple(_args, "h",
2410 &size))
2411 return NULL;
2412 TextSize(size);
2413 Py_INCREF(Py_None);
2414 _res = Py_None;
2415 return _res;
2416}
2417
2418static PyObject *Qd_SpaceExtra(_self, _args)
2419 PyObject *_self;
2420 PyObject *_args;
2421{
2422 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +00002423 Fixed extra;
2424 if (!PyArg_ParseTuple(_args, "O&",
2425 PyMac_GetFixed, &extra))
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002426 return NULL;
2427 SpaceExtra(extra);
2428 Py_INCREF(Py_None);
2429 _res = Py_None;
2430 return _res;
2431}
2432
2433static PyObject *Qd_DrawChar(_self, _args)
2434 PyObject *_self;
2435 PyObject *_args;
2436{
2437 PyObject *_res = NULL;
2438 short ch;
2439 if (!PyArg_ParseTuple(_args, "h",
2440 &ch))
2441 return NULL;
2442 DrawChar(ch);
2443 Py_INCREF(Py_None);
2444 _res = Py_None;
2445 return _res;
2446}
2447
2448static PyObject *Qd_DrawString(_self, _args)
2449 PyObject *_self;
2450 PyObject *_args;
2451{
2452 PyObject *_res = NULL;
2453 Str255 s;
2454 if (!PyArg_ParseTuple(_args, "O&",
2455 PyMac_GetStr255, s))
2456 return NULL;
2457 DrawString(s);
2458 Py_INCREF(Py_None);
2459 _res = Py_None;
2460 return _res;
2461}
2462
2463static PyObject *Qd_DrawText(_self, _args)
2464 PyObject *_self;
2465 PyObject *_args;
2466{
2467 PyObject *_res = NULL;
2468 char *textBuf__in__;
2469 int textBuf__len__;
2470 int textBuf__in_len__;
2471 short firstByte;
2472 short byteCount;
2473 if (!PyArg_ParseTuple(_args, "s#hh",
2474 &textBuf__in__, &textBuf__in_len__,
2475 &firstByte,
2476 &byteCount))
2477 return NULL;
2478 DrawText(textBuf__in__,
2479 firstByte,
2480 byteCount);
2481 Py_INCREF(Py_None);
2482 _res = Py_None;
2483 textBuf__error__: ;
2484 return _res;
2485}
2486
2487static PyObject *Qd_CharWidth(_self, _args)
2488 PyObject *_self;
2489 PyObject *_args;
2490{
2491 PyObject *_res = NULL;
2492 short _rv;
2493 short ch;
2494 if (!PyArg_ParseTuple(_args, "h",
2495 &ch))
2496 return NULL;
2497 _rv = CharWidth(ch);
2498 _res = Py_BuildValue("h",
2499 _rv);
2500 return _res;
2501}
2502
2503static PyObject *Qd_StringWidth(_self, _args)
2504 PyObject *_self;
2505 PyObject *_args;
2506{
2507 PyObject *_res = NULL;
2508 short _rv;
2509 Str255 s;
2510 if (!PyArg_ParseTuple(_args, "O&",
2511 PyMac_GetStr255, s))
2512 return NULL;
2513 _rv = StringWidth(s);
2514 _res = Py_BuildValue("h",
2515 _rv);
2516 return _res;
2517}
2518
2519static PyObject *Qd_TextWidth(_self, _args)
2520 PyObject *_self;
2521 PyObject *_args;
2522{
2523 PyObject *_res = NULL;
2524 short _rv;
2525 char *textBuf__in__;
2526 int textBuf__len__;
2527 int textBuf__in_len__;
2528 short firstByte;
2529 short byteCount;
2530 if (!PyArg_ParseTuple(_args, "s#hh",
2531 &textBuf__in__, &textBuf__in_len__,
2532 &firstByte,
2533 &byteCount))
2534 return NULL;
2535 _rv = TextWidth(textBuf__in__,
2536 firstByte,
2537 byteCount);
2538 _res = Py_BuildValue("h",
2539 _rv);
2540 textBuf__error__: ;
2541 return _res;
2542}
2543
2544static PyObject *Qd_CharExtra(_self, _args)
2545 PyObject *_self;
2546 PyObject *_args;
2547{
2548 PyObject *_res = NULL;
Jack Jansen330381c1995-11-15 15:18:01 +00002549 Fixed extra;
2550 if (!PyArg_ParseTuple(_args, "O&",
2551 PyMac_GetFixed, &extra))
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002552 return NULL;
2553 CharExtra(extra);
2554 Py_INCREF(Py_None);
2555 _res = Py_None;
2556 return _res;
2557}
2558
Guido van Rossum17448e21995-01-30 11:53:55 +00002559static PyMethodDef Qd_methods[] = {
Guido van Rossum17448e21995-01-30 11:53:55 +00002560 {"SetPort", (PyCFunction)Qd_SetPort, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00002561 "(GrafPtr port) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00002562 {"GetPort", (PyCFunction)Qd_GetPort, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00002563 "() -> (GrafPtr port)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002564 {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
2565 "(short device) -> None"},
2566 {"PortSize", (PyCFunction)Qd_PortSize, 1,
2567 "(short width, short height) -> None"},
2568 {"MovePortTo", (PyCFunction)Qd_MovePortTo, 1,
2569 "(short leftGlobal, short topGlobal) -> None"},
2570 {"SetOrigin", (PyCFunction)Qd_SetOrigin, 1,
2571 "(short h, short v) -> None"},
2572 {"SetClip", (PyCFunction)Qd_SetClip, 1,
2573 "(RgnHandle rgn) -> None"},
2574 {"GetClip", (PyCFunction)Qd_GetClip, 1,
2575 "(RgnHandle rgn) -> None"},
Guido van Rossum17448e21995-01-30 11:53:55 +00002576 {"ClipRect", (PyCFunction)Qd_ClipRect, 1,
2577 "(Rect r) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00002578 {"InitCursor", (PyCFunction)Qd_InitCursor, 1,
2579 "() -> None"},
2580 {"HideCursor", (PyCFunction)Qd_HideCursor, 1,
2581 "() -> None"},
2582 {"ShowCursor", (PyCFunction)Qd_ShowCursor, 1,
2583 "() -> None"},
2584 {"ObscureCursor", (PyCFunction)Qd_ObscureCursor, 1,
2585 "() -> None"},
2586 {"HidePen", (PyCFunction)Qd_HidePen, 1,
2587 "() -> None"},
2588 {"ShowPen", (PyCFunction)Qd_ShowPen, 1,
2589 "() -> None"},
2590 {"GetPen", (PyCFunction)Qd_GetPen, 1,
2591 "(Point pt) -> (Point pt)"},
2592 {"PenSize", (PyCFunction)Qd_PenSize, 1,
2593 "(short width, short height) -> None"},
2594 {"PenMode", (PyCFunction)Qd_PenMode, 1,
2595 "(short mode) -> None"},
2596 {"PenNormal", (PyCFunction)Qd_PenNormal, 1,
2597 "() -> None"},
2598 {"MoveTo", (PyCFunction)Qd_MoveTo, 1,
2599 "(short h, short v) -> None"},
2600 {"Move", (PyCFunction)Qd_Move, 1,
2601 "(short dh, short dv) -> None"},
2602 {"LineTo", (PyCFunction)Qd_LineTo, 1,
2603 "(short h, short v) -> None"},
2604 {"Line", (PyCFunction)Qd_Line, 1,
2605 "(short dh, short dv) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00002606 {"ForeColor", (PyCFunction)Qd_ForeColor, 1,
2607 "(long color) -> None"},
2608 {"BackColor", (PyCFunction)Qd_BackColor, 1,
2609 "(long color) -> None"},
2610 {"ColorBit", (PyCFunction)Qd_ColorBit, 1,
2611 "(short whichBit) -> None"},
2612 {"SetRect", (PyCFunction)Qd_SetRect, 1,
2613 "(short left, short top, short right, short bottom) -> (Rect r)"},
2614 {"OffsetRect", (PyCFunction)Qd_OffsetRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002615 "(Rect r, short dh, short dv) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002616 {"InsetRect", (PyCFunction)Qd_InsetRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002617 "(Rect r, short dh, short dv) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002618 {"SectRect", (PyCFunction)Qd_SectRect, 1,
2619 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
2620 {"UnionRect", (PyCFunction)Qd_UnionRect, 1,
2621 "(Rect src1, Rect src2) -> (Rect dstRect)"},
2622 {"EqualRect", (PyCFunction)Qd_EqualRect, 1,
2623 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
2624 {"EmptyRect", (PyCFunction)Qd_EmptyRect, 1,
2625 "(Rect r) -> (Boolean _rv)"},
2626 {"FrameRect", (PyCFunction)Qd_FrameRect, 1,
2627 "(Rect r) -> None"},
2628 {"PaintRect", (PyCFunction)Qd_PaintRect, 1,
2629 "(Rect r) -> None"},
Guido van Rossum17448e21995-01-30 11:53:55 +00002630 {"EraseRect", (PyCFunction)Qd_EraseRect, 1,
2631 "(Rect r) -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00002632 {"InvertRect", (PyCFunction)Qd_InvertRect, 1,
2633 "(Rect r) -> None"},
2634 {"FrameOval", (PyCFunction)Qd_FrameOval, 1,
2635 "(Rect r) -> None"},
2636 {"PaintOval", (PyCFunction)Qd_PaintOval, 1,
2637 "(Rect r) -> None"},
2638 {"EraseOval", (PyCFunction)Qd_EraseOval, 1,
2639 "(Rect r) -> None"},
2640 {"InvertOval", (PyCFunction)Qd_InvertOval, 1,
2641 "(Rect r) -> None"},
2642 {"FrameRoundRect", (PyCFunction)Qd_FrameRoundRect, 1,
2643 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2644 {"PaintRoundRect", (PyCFunction)Qd_PaintRoundRect, 1,
2645 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2646 {"EraseRoundRect", (PyCFunction)Qd_EraseRoundRect, 1,
2647 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2648 {"InvertRoundRect", (PyCFunction)Qd_InvertRoundRect, 1,
2649 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2650 {"FrameArc", (PyCFunction)Qd_FrameArc, 1,
2651 "(Rect r, short startAngle, short arcAngle) -> None"},
2652 {"PaintArc", (PyCFunction)Qd_PaintArc, 1,
2653 "(Rect r, short startAngle, short arcAngle) -> None"},
2654 {"EraseArc", (PyCFunction)Qd_EraseArc, 1,
2655 "(Rect r, short startAngle, short arcAngle) -> None"},
2656 {"InvertArc", (PyCFunction)Qd_InvertArc, 1,
2657 "(Rect r, short startAngle, short arcAngle) -> None"},
2658 {"NewRgn", (PyCFunction)Qd_NewRgn, 1,
2659 "() -> (RgnHandle _rv)"},
2660 {"OpenRgn", (PyCFunction)Qd_OpenRgn, 1,
2661 "() -> None"},
2662 {"CloseRgn", (PyCFunction)Qd_CloseRgn, 1,
2663 "(RgnHandle dstRgn) -> None"},
2664 {"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
2665 "(RgnHandle rgn) -> None"},
2666 {"CopyRgn", (PyCFunction)Qd_CopyRgn, 1,
2667 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
2668 {"SetEmptyRgn", (PyCFunction)Qd_SetEmptyRgn, 1,
2669 "(RgnHandle rgn) -> None"},
2670 {"SetRectRgn", (PyCFunction)Qd_SetRectRgn, 1,
2671 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
2672 {"RectRgn", (PyCFunction)Qd_RectRgn, 1,
2673 "(RgnHandle rgn, Rect r) -> None"},
2674 {"OffsetRgn", (PyCFunction)Qd_OffsetRgn, 1,
2675 "(RgnHandle rgn, short dh, short dv) -> None"},
2676 {"InsetRgn", (PyCFunction)Qd_InsetRgn, 1,
2677 "(RgnHandle rgn, short dh, short dv) -> None"},
2678 {"SectRgn", (PyCFunction)Qd_SectRgn, 1,
2679 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2680 {"UnionRgn", (PyCFunction)Qd_UnionRgn, 1,
2681 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2682 {"DiffRgn", (PyCFunction)Qd_DiffRgn, 1,
2683 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2684 {"XorRgn", (PyCFunction)Qd_XorRgn, 1,
2685 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2686 {"RectInRgn", (PyCFunction)Qd_RectInRgn, 1,
2687 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
2688 {"EqualRgn", (PyCFunction)Qd_EqualRgn, 1,
2689 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
2690 {"EmptyRgn", (PyCFunction)Qd_EmptyRgn, 1,
2691 "(RgnHandle rgn) -> (Boolean _rv)"},
2692 {"FrameRgn", (PyCFunction)Qd_FrameRgn, 1,
2693 "(RgnHandle rgn) -> None"},
2694 {"PaintRgn", (PyCFunction)Qd_PaintRgn, 1,
2695 "(RgnHandle rgn) -> None"},
2696 {"EraseRgn", (PyCFunction)Qd_EraseRgn, 1,
2697 "(RgnHandle rgn) -> None"},
2698 {"InvertRgn", (PyCFunction)Qd_InvertRgn, 1,
2699 "(RgnHandle rgn) -> None"},
2700 {"ScrollRect", (PyCFunction)Qd_ScrollRect, 1,
2701 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
2702 {"OpenPicture", (PyCFunction)Qd_OpenPicture, 1,
2703 "(Rect picFrame) -> (PicHandle _rv)"},
2704 {"PicComment", (PyCFunction)Qd_PicComment, 1,
2705 "(short kind, short dataSize, Handle dataHandle) -> None"},
2706 {"ClosePicture", (PyCFunction)Qd_ClosePicture, 1,
2707 "() -> None"},
2708 {"DrawPicture", (PyCFunction)Qd_DrawPicture, 1,
2709 "(PicHandle myPicture, Rect dstRect) -> None"},
2710 {"KillPicture", (PyCFunction)Qd_KillPicture, 1,
2711 "(PicHandle myPicture) -> None"},
2712 {"OpenPoly", (PyCFunction)Qd_OpenPoly, 1,
2713 "() -> (PolyHandle _rv)"},
2714 {"ClosePoly", (PyCFunction)Qd_ClosePoly, 1,
2715 "() -> None"},
2716 {"KillPoly", (PyCFunction)Qd_KillPoly, 1,
2717 "(PolyHandle poly) -> None"},
2718 {"OffsetPoly", (PyCFunction)Qd_OffsetPoly, 1,
2719 "(PolyHandle poly, short dh, short dv) -> None"},
2720 {"FramePoly", (PyCFunction)Qd_FramePoly, 1,
2721 "(PolyHandle poly) -> None"},
2722 {"PaintPoly", (PyCFunction)Qd_PaintPoly, 1,
2723 "(PolyHandle poly) -> None"},
2724 {"ErasePoly", (PyCFunction)Qd_ErasePoly, 1,
2725 "(PolyHandle poly) -> None"},
2726 {"InvertPoly", (PyCFunction)Qd_InvertPoly, 1,
2727 "(PolyHandle poly) -> None"},
2728 {"SetPt", (PyCFunction)Qd_SetPt, 1,
2729 "(Point pt, short h, short v) -> (Point pt)"},
2730 {"LocalToGlobal", (PyCFunction)Qd_LocalToGlobal, 1,
2731 "(Point pt) -> (Point pt)"},
2732 {"GlobalToLocal", (PyCFunction)Qd_GlobalToLocal, 1,
2733 "(Point pt) -> (Point pt)"},
2734 {"Random", (PyCFunction)Qd_Random, 1,
2735 "() -> (short _rv)"},
2736 {"GetPixel", (PyCFunction)Qd_GetPixel, 1,
2737 "(short h, short v) -> (Boolean _rv)"},
2738 {"ScalePt", (PyCFunction)Qd_ScalePt, 1,
2739 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2740 {"MapPt", (PyCFunction)Qd_MapPt, 1,
2741 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2742 {"MapRect", (PyCFunction)Qd_MapRect, 1,
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002743 "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002744 {"MapRgn", (PyCFunction)Qd_MapRgn, 1,
2745 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
2746 {"MapPoly", (PyCFunction)Qd_MapPoly, 1,
2747 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
2748 {"AddPt", (PyCFunction)Qd_AddPt, 1,
2749 "(Point src, Point dst) -> (Point dst)"},
2750 {"EqualPt", (PyCFunction)Qd_EqualPt, 1,
2751 "(Point pt1, Point pt2) -> (Boolean _rv)"},
2752 {"PtInRect", (PyCFunction)Qd_PtInRect, 1,
2753 "(Point pt, Rect r) -> (Boolean _rv)"},
2754 {"Pt2Rect", (PyCFunction)Qd_Pt2Rect, 1,
2755 "(Point pt1, Point pt2) -> (Rect dstRect)"},
2756 {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1,
2757 "(Rect r, Point pt) -> (short angle)"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002758 {"SubPt", (PyCFunction)Qd_SubPt, 1,
2759 "(Point src, Point dst) -> (Point dst)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002760 {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1,
2761 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
2762 {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1,
2763 "() -> (PixMapHandle _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002764 {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1,
2765 "(PixMapHandle pm) -> None"},
2766 {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1,
2767 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
2768 {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1,
2769 "() -> (PixPatHandle _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002770 {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1,
2771 "(PixPatHandle pp) -> None"},
2772 {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1,
2773 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
2774 {"PenPixPat", (PyCFunction)Qd_PenPixPat, 1,
2775 "(PixPatHandle pp) -> None"},
2776 {"BackPixPat", (PyCFunction)Qd_BackPixPat, 1,
2777 "(PixPatHandle pp) -> None"},
2778 {"GetPixPat", (PyCFunction)Qd_GetPixPat, 1,
2779 "(short patID) -> (PixPatHandle _rv)"},
2780 {"FillCRect", (PyCFunction)Qd_FillCRect, 1,
2781 "(Rect r, PixPatHandle pp) -> None"},
2782 {"FillCOval", (PyCFunction)Qd_FillCOval, 1,
2783 "(Rect r, PixPatHandle pp) -> None"},
2784 {"FillCRoundRect", (PyCFunction)Qd_FillCRoundRect, 1,
2785 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
2786 {"FillCArc", (PyCFunction)Qd_FillCArc, 1,
2787 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
2788 {"FillCRgn", (PyCFunction)Qd_FillCRgn, 1,
2789 "(RgnHandle rgn, PixPatHandle pp) -> None"},
2790 {"FillCPoly", (PyCFunction)Qd_FillCPoly, 1,
2791 "(PolyHandle poly, PixPatHandle pp) -> None"},
2792 {"SetPortPix", (PyCFunction)Qd_SetPortPix, 1,
2793 "(PixMapHandle pm) -> None"},
2794 {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1,
2795 "() -> None"},
Guido van Rossume56db431995-03-19 22:49:50 +00002796 {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1,
2797 "() -> (long _rv)"},
Guido van Rossume56db431995-03-19 22:49:50 +00002798 {"SetClientID", (PyCFunction)Qd_SetClientID, 1,
2799 "(short id) -> None"},
2800 {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1,
2801 "(short index, Boolean protect) -> None"},
2802 {"ReserveEntry", (PyCFunction)Qd_ReserveEntry, 1,
2803 "(short index, Boolean reserve) -> None"},
2804 {"QDError", (PyCFunction)Qd_QDError, 1,
2805 "() -> (short _rv)"},
Jack Jansen54c8f7e1995-11-14 10:46:01 +00002806 {"GetPattern", (PyCFunction)Qd_GetPattern, 1,
2807 "(short patternID) -> (PatHandle _rv)"},
2808 {"GetCursor", (PyCFunction)Qd_GetCursor, 1,
2809 "(short cursorID) -> (CursHandle _rv)"},
2810 {"GetPicture", (PyCFunction)Qd_GetPicture, 1,
2811 "(short pictureID) -> (PicHandle _rv)"},
2812 {"DeltaPoint", (PyCFunction)Qd_DeltaPoint, 1,
2813 "(Point ptA, Point ptB) -> (long _rv)"},
2814 {"ShieldCursor", (PyCFunction)Qd_ShieldCursor, 1,
2815 "(Rect shieldRect, Point offsetPt) -> None"},
2816 {"ScreenRes", (PyCFunction)Qd_ScreenRes, 1,
2817 "() -> (short scrnHRes, short scrnVRes)"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002818 {"TextFont", (PyCFunction)Qd_TextFont, 1,
2819 "(short font) -> None"},
2820 {"TextFace", (PyCFunction)Qd_TextFace, 1,
2821 "(short face) -> None"},
2822 {"TextMode", (PyCFunction)Qd_TextMode, 1,
2823 "(short mode) -> None"},
2824 {"TextSize", (PyCFunction)Qd_TextSize, 1,
2825 "(short size) -> None"},
2826 {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00002827 "(Fixed extra) -> None"},
Jack Jansenb81cf9d1995-06-06 13:08:40 +00002828 {"DrawChar", (PyCFunction)Qd_DrawChar, 1,
2829 "(short ch) -> None"},
2830 {"DrawString", (PyCFunction)Qd_DrawString, 1,
2831 "(Str255 s) -> None"},
2832 {"DrawText", (PyCFunction)Qd_DrawText, 1,
2833 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
2834 {"CharWidth", (PyCFunction)Qd_CharWidth, 1,
2835 "(short ch) -> (short _rv)"},
2836 {"StringWidth", (PyCFunction)Qd_StringWidth, 1,
2837 "(Str255 s) -> (short _rv)"},
2838 {"TextWidth", (PyCFunction)Qd_TextWidth, 1,
2839 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
2840 {"CharExtra", (PyCFunction)Qd_CharExtra, 1,
Jack Jansen330381c1995-11-15 15:18:01 +00002841 "(Fixed extra) -> None"},
Guido van Rossum17448e21995-01-30 11:53:55 +00002842 {NULL, NULL, 0}
2843};
2844
2845
2846
2847
2848void initQd()
2849{
2850 PyObject *m;
2851 PyObject *d;
2852
2853
2854
2855
2856 m = Py_InitModule("Qd", Qd_methods);
2857 d = PyModule_GetDict(m);
2858 Qd_Error = PyMac_GetOSErrException();
2859 if (Qd_Error == NULL ||
2860 PyDict_SetItemString(d, "Error", Qd_Error) != 0)
2861 Py_FatalError("can't initialize Qd.Error");
2862}
2863
2864/* ========================= End module Qd ========================== */
2865