Don't reference removed files in Makefile
[python/dscho.git] / Mac / Modules / qd / Qdmodule.c
blob959df3145da4c26b881ede7f3317a4d4d68d8557
2 /* =========================== Module Qd ============================ */
4 #include "Python.h"
8 #define SystemSevenOrLater 1
10 #include "macglue.h"
11 #include <Memory.h>
12 #include <Dialogs.h>
13 #include <Menus.h>
14 #include <Controls.h>
16 extern PyObject *ResObj_New(Handle);
17 extern int ResObj_Convert(PyObject *, Handle *);
19 extern PyObject *WinObj_New(WindowPtr);
20 extern int WinObj_Convert(PyObject *, WindowPtr *);
22 extern PyObject *DlgObj_New(DialogPtr);
23 extern int DlgObj_Convert(PyObject *, DialogPtr *);
24 extern PyTypeObject Dialog_Type;
25 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
27 extern PyObject *MenuObj_New(MenuHandle);
28 extern int MenuObj_Convert(PyObject *, MenuHandle *);
30 extern PyObject *CtlObj_New(ControlHandle);
31 extern int CtlObj_Convert(PyObject *, ControlHandle *);
33 extern PyObject *WinObj_WhichWindow(WindowPtr);
35 #include <QuickDraw.h>
36 #include <Desk.h>
38 #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
40 static PyObject *Qd_Error;
42 static PyObject *Qd_OpenPort(_self, _args)
43 PyObject *_self;
44 PyObject *_args;
46 PyObject *_res = NULL;
47 WindowPtr port;
48 if (!PyArg_ParseTuple(_args, "O&",
49 WinObj_Convert, &port))
50 return NULL;
51 OpenPort(port);
52 Py_INCREF(Py_None);
53 _res = Py_None;
54 return _res;
57 static PyObject *Qd_InitPort(_self, _args)
58 PyObject *_self;
59 PyObject *_args;
61 PyObject *_res = NULL;
62 WindowPtr port;
63 if (!PyArg_ParseTuple(_args, "O&",
64 WinObj_Convert, &port))
65 return NULL;
66 InitPort(port);
67 Py_INCREF(Py_None);
68 _res = Py_None;
69 return _res;
72 static PyObject *Qd_ClosePort(_self, _args)
73 PyObject *_self;
74 PyObject *_args;
76 PyObject *_res = NULL;
77 WindowPtr port;
78 if (!PyArg_ParseTuple(_args, "O&",
79 WinObj_Convert, &port))
80 return NULL;
81 ClosePort(port);
82 Py_INCREF(Py_None);
83 _res = Py_None;
84 return _res;
87 static PyObject *Qd_SetPort(_self, _args)
88 PyObject *_self;
89 PyObject *_args;
91 PyObject *_res = NULL;
92 WindowPtr port;
93 if (!PyArg_ParseTuple(_args, "O&",
94 WinObj_Convert, &port))
95 return NULL;
96 SetPort(port);
97 Py_INCREF(Py_None);
98 _res = Py_None;
99 return _res;
102 static PyObject *Qd_GetPort(_self, _args)
103 PyObject *_self;
104 PyObject *_args;
106 PyObject *_res = NULL;
107 WindowPtr port;
108 if (!PyArg_ParseTuple(_args, ""))
109 return NULL;
110 GetPort(&port);
111 _res = Py_BuildValue("O&",
112 WinObj_New, port);
113 return _res;
116 static PyObject *Qd_GrafDevice(_self, _args)
117 PyObject *_self;
118 PyObject *_args;
120 PyObject *_res = NULL;
121 short device;
122 if (!PyArg_ParseTuple(_args, "h",
123 &device))
124 return NULL;
125 GrafDevice(device);
126 Py_INCREF(Py_None);
127 _res = Py_None;
128 return _res;
131 static PyObject *Qd_PortSize(_self, _args)
132 PyObject *_self;
133 PyObject *_args;
135 PyObject *_res = NULL;
136 short width;
137 short height;
138 if (!PyArg_ParseTuple(_args, "hh",
139 &width,
140 &height))
141 return NULL;
142 PortSize(width,
143 height);
144 Py_INCREF(Py_None);
145 _res = Py_None;
146 return _res;
149 static PyObject *Qd_MovePortTo(_self, _args)
150 PyObject *_self;
151 PyObject *_args;
153 PyObject *_res = NULL;
154 short leftGlobal;
155 short topGlobal;
156 if (!PyArg_ParseTuple(_args, "hh",
157 &leftGlobal,
158 &topGlobal))
159 return NULL;
160 MovePortTo(leftGlobal,
161 topGlobal);
162 Py_INCREF(Py_None);
163 _res = Py_None;
164 return _res;
167 static PyObject *Qd_SetOrigin(_self, _args)
168 PyObject *_self;
169 PyObject *_args;
171 PyObject *_res = NULL;
172 short h;
173 short v;
174 if (!PyArg_ParseTuple(_args, "hh",
176 &v))
177 return NULL;
178 SetOrigin(h,
180 Py_INCREF(Py_None);
181 _res = Py_None;
182 return _res;
185 static PyObject *Qd_SetClip(_self, _args)
186 PyObject *_self;
187 PyObject *_args;
189 PyObject *_res = NULL;
190 RgnHandle rgn;
191 if (!PyArg_ParseTuple(_args, "O&",
192 ResObj_Convert, &rgn))
193 return NULL;
194 SetClip(rgn);
195 Py_INCREF(Py_None);
196 _res = Py_None;
197 return _res;
200 static PyObject *Qd_GetClip(_self, _args)
201 PyObject *_self;
202 PyObject *_args;
204 PyObject *_res = NULL;
205 RgnHandle rgn;
206 if (!PyArg_ParseTuple(_args, "O&",
207 ResObj_Convert, &rgn))
208 return NULL;
209 GetClip(rgn);
210 Py_INCREF(Py_None);
211 _res = Py_None;
212 return _res;
215 static PyObject *Qd_ClipRect(_self, _args)
216 PyObject *_self;
217 PyObject *_args;
219 PyObject *_res = NULL;
220 Rect r;
221 if (!PyArg_ParseTuple(_args, "O&",
222 PyMac_GetRect, &r))
223 return NULL;
224 ClipRect(&r);
225 Py_INCREF(Py_None);
226 _res = Py_None;
227 return _res;
230 static PyObject *Qd_InitCursor(_self, _args)
231 PyObject *_self;
232 PyObject *_args;
234 PyObject *_res = NULL;
235 if (!PyArg_ParseTuple(_args, ""))
236 return NULL;
237 InitCursor();
238 Py_INCREF(Py_None);
239 _res = Py_None;
240 return _res;
243 static PyObject *Qd_HideCursor(_self, _args)
244 PyObject *_self;
245 PyObject *_args;
247 PyObject *_res = NULL;
248 if (!PyArg_ParseTuple(_args, ""))
249 return NULL;
250 HideCursor();
251 Py_INCREF(Py_None);
252 _res = Py_None;
253 return _res;
256 static PyObject *Qd_ShowCursor(_self, _args)
257 PyObject *_self;
258 PyObject *_args;
260 PyObject *_res = NULL;
261 if (!PyArg_ParseTuple(_args, ""))
262 return NULL;
263 ShowCursor();
264 Py_INCREF(Py_None);
265 _res = Py_None;
266 return _res;
269 static PyObject *Qd_ObscureCursor(_self, _args)
270 PyObject *_self;
271 PyObject *_args;
273 PyObject *_res = NULL;
274 if (!PyArg_ParseTuple(_args, ""))
275 return NULL;
276 ObscureCursor();
277 Py_INCREF(Py_None);
278 _res = Py_None;
279 return _res;
282 static PyObject *Qd_HidePen(_self, _args)
283 PyObject *_self;
284 PyObject *_args;
286 PyObject *_res = NULL;
287 if (!PyArg_ParseTuple(_args, ""))
288 return NULL;
289 HidePen();
290 Py_INCREF(Py_None);
291 _res = Py_None;
292 return _res;
295 static PyObject *Qd_ShowPen(_self, _args)
296 PyObject *_self;
297 PyObject *_args;
299 PyObject *_res = NULL;
300 if (!PyArg_ParseTuple(_args, ""))
301 return NULL;
302 ShowPen();
303 Py_INCREF(Py_None);
304 _res = Py_None;
305 return _res;
308 static PyObject *Qd_GetPen(_self, _args)
309 PyObject *_self;
310 PyObject *_args;
312 PyObject *_res = NULL;
313 Point pt;
314 if (!PyArg_ParseTuple(_args, "O&",
315 PyMac_GetPoint, &pt))
316 return NULL;
317 GetPen(&pt);
318 _res = Py_BuildValue("O&",
319 PyMac_BuildPoint, pt);
320 return _res;
323 static PyObject *Qd_PenSize(_self, _args)
324 PyObject *_self;
325 PyObject *_args;
327 PyObject *_res = NULL;
328 short width;
329 short height;
330 if (!PyArg_ParseTuple(_args, "hh",
331 &width,
332 &height))
333 return NULL;
334 PenSize(width,
335 height);
336 Py_INCREF(Py_None);
337 _res = Py_None;
338 return _res;
341 static PyObject *Qd_PenMode(_self, _args)
342 PyObject *_self;
343 PyObject *_args;
345 PyObject *_res = NULL;
346 short mode;
347 if (!PyArg_ParseTuple(_args, "h",
348 &mode))
349 return NULL;
350 PenMode(mode);
351 Py_INCREF(Py_None);
352 _res = Py_None;
353 return _res;
356 static PyObject *Qd_PenNormal(_self, _args)
357 PyObject *_self;
358 PyObject *_args;
360 PyObject *_res = NULL;
361 if (!PyArg_ParseTuple(_args, ""))
362 return NULL;
363 PenNormal();
364 Py_INCREF(Py_None);
365 _res = Py_None;
366 return _res;
369 static PyObject *Qd_MoveTo(_self, _args)
370 PyObject *_self;
371 PyObject *_args;
373 PyObject *_res = NULL;
374 short h;
375 short v;
376 if (!PyArg_ParseTuple(_args, "hh",
378 &v))
379 return NULL;
380 MoveTo(h,
382 Py_INCREF(Py_None);
383 _res = Py_None;
384 return _res;
387 static PyObject *Qd_Move(_self, _args)
388 PyObject *_self;
389 PyObject *_args;
391 PyObject *_res = NULL;
392 short dh;
393 short dv;
394 if (!PyArg_ParseTuple(_args, "hh",
395 &dh,
396 &dv))
397 return NULL;
398 Move(dh,
399 dv);
400 Py_INCREF(Py_None);
401 _res = Py_None;
402 return _res;
405 static PyObject *Qd_LineTo(_self, _args)
406 PyObject *_self;
407 PyObject *_args;
409 PyObject *_res = NULL;
410 short h;
411 short v;
412 if (!PyArg_ParseTuple(_args, "hh",
414 &v))
415 return NULL;
416 LineTo(h,
418 Py_INCREF(Py_None);
419 _res = Py_None;
420 return _res;
423 static PyObject *Qd_Line(_self, _args)
424 PyObject *_self;
425 PyObject *_args;
427 PyObject *_res = NULL;
428 short dh;
429 short dv;
430 if (!PyArg_ParseTuple(_args, "hh",
431 &dh,
432 &dv))
433 return NULL;
434 Line(dh,
435 dv);
436 Py_INCREF(Py_None);
437 _res = Py_None;
438 return _res;
441 static PyObject *Qd_TextFont(_self, _args)
442 PyObject *_self;
443 PyObject *_args;
445 PyObject *_res = NULL;
446 short font;
447 if (!PyArg_ParseTuple(_args, "h",
448 &font))
449 return NULL;
450 TextFont(font);
451 Py_INCREF(Py_None);
452 _res = Py_None;
453 return _res;
456 static PyObject *Qd_TextFace(_self, _args)
457 PyObject *_self;
458 PyObject *_args;
460 PyObject *_res = NULL;
461 short face;
462 if (!PyArg_ParseTuple(_args, "h",
463 &face))
464 return NULL;
465 TextFace(face);
466 Py_INCREF(Py_None);
467 _res = Py_None;
468 return _res;
471 static PyObject *Qd_TextMode(_self, _args)
472 PyObject *_self;
473 PyObject *_args;
475 PyObject *_res = NULL;
476 short mode;
477 if (!PyArg_ParseTuple(_args, "h",
478 &mode))
479 return NULL;
480 TextMode(mode);
481 Py_INCREF(Py_None);
482 _res = Py_None;
483 return _res;
486 static PyObject *Qd_TextSize(_self, _args)
487 PyObject *_self;
488 PyObject *_args;
490 PyObject *_res = NULL;
491 short size;
492 if (!PyArg_ParseTuple(_args, "h",
493 &size))
494 return NULL;
495 TextSize(size);
496 Py_INCREF(Py_None);
497 _res = Py_None;
498 return _res;
501 static PyObject *Qd_SpaceExtra(_self, _args)
502 PyObject *_self;
503 PyObject *_args;
505 PyObject *_res = NULL;
506 long extra;
507 if (!PyArg_ParseTuple(_args, "l",
508 &extra))
509 return NULL;
510 SpaceExtra(extra);
511 Py_INCREF(Py_None);
512 _res = Py_None;
513 return _res;
516 static PyObject *Qd_DrawChar(_self, _args)
517 PyObject *_self;
518 PyObject *_args;
520 PyObject *_res = NULL;
521 short ch;
522 if (!PyArg_ParseTuple(_args, "h",
523 &ch))
524 return NULL;
525 DrawChar(ch);
526 Py_INCREF(Py_None);
527 _res = Py_None;
528 return _res;
531 static PyObject *Qd_DrawString(_self, _args)
532 PyObject *_self;
533 PyObject *_args;
535 PyObject *_res = NULL;
536 Str255 s;
537 if (!PyArg_ParseTuple(_args, "O&",
538 PyMac_GetStr255, s))
539 return NULL;
540 DrawString(s);
541 Py_INCREF(Py_None);
542 _res = Py_None;
543 return _res;
546 static PyObject *Qd_DrawText(_self, _args)
547 PyObject *_self;
548 PyObject *_args;
550 PyObject *_res = NULL;
551 char *textBuf__in__;
552 int textBuf__len__;
553 int textBuf__in_len__;
554 short firstByte;
555 short byteCount;
556 if (!PyArg_ParseTuple(_args, "s#hh",
557 &textBuf__in__, &textBuf__in_len__,
558 &firstByte,
559 &byteCount))
560 return NULL;
561 DrawText(textBuf__in__,
562 firstByte,
563 byteCount);
564 Py_INCREF(Py_None);
565 _res = Py_None;
566 textBuf__error__: ;
567 return _res;
570 static PyObject *Qd_CharWidth(_self, _args)
571 PyObject *_self;
572 PyObject *_args;
574 PyObject *_res = NULL;
575 short _rv;
576 short ch;
577 if (!PyArg_ParseTuple(_args, "h",
578 &ch))
579 return NULL;
580 _rv = CharWidth(ch);
581 _res = Py_BuildValue("h",
582 _rv);
583 return _res;
586 static PyObject *Qd_StringWidth(_self, _args)
587 PyObject *_self;
588 PyObject *_args;
590 PyObject *_res = NULL;
591 short _rv;
592 Str255 s;
593 if (!PyArg_ParseTuple(_args, "O&",
594 PyMac_GetStr255, s))
595 return NULL;
596 _rv = StringWidth(s);
597 _res = Py_BuildValue("h",
598 _rv);
599 return _res;
602 static PyObject *Qd_TextWidth(_self, _args)
603 PyObject *_self;
604 PyObject *_args;
606 PyObject *_res = NULL;
607 short _rv;
608 char *textBuf__in__;
609 int textBuf__len__;
610 int textBuf__in_len__;
611 short firstByte;
612 short byteCount;
613 if (!PyArg_ParseTuple(_args, "s#hh",
614 &textBuf__in__, &textBuf__in_len__,
615 &firstByte,
616 &byteCount))
617 return NULL;
618 _rv = TextWidth(textBuf__in__,
619 firstByte,
620 byteCount);
621 _res = Py_BuildValue("h",
622 _rv);
623 textBuf__error__: ;
624 return _res;
627 static PyObject *Qd_ForeColor(_self, _args)
628 PyObject *_self;
629 PyObject *_args;
631 PyObject *_res = NULL;
632 long color;
633 if (!PyArg_ParseTuple(_args, "l",
634 &color))
635 return NULL;
636 ForeColor(color);
637 Py_INCREF(Py_None);
638 _res = Py_None;
639 return _res;
642 static PyObject *Qd_BackColor(_self, _args)
643 PyObject *_self;
644 PyObject *_args;
646 PyObject *_res = NULL;
647 long color;
648 if (!PyArg_ParseTuple(_args, "l",
649 &color))
650 return NULL;
651 BackColor(color);
652 Py_INCREF(Py_None);
653 _res = Py_None;
654 return _res;
657 static PyObject *Qd_ColorBit(_self, _args)
658 PyObject *_self;
659 PyObject *_args;
661 PyObject *_res = NULL;
662 short whichBit;
663 if (!PyArg_ParseTuple(_args, "h",
664 &whichBit))
665 return NULL;
666 ColorBit(whichBit);
667 Py_INCREF(Py_None);
668 _res = Py_None;
669 return _res;
672 static PyObject *Qd_SetRect(_self, _args)
673 PyObject *_self;
674 PyObject *_args;
676 PyObject *_res = NULL;
677 Rect r;
678 short left;
679 short top;
680 short right;
681 short bottom;
682 if (!PyArg_ParseTuple(_args, "hhhh",
683 &left,
684 &top,
685 &right,
686 &bottom))
687 return NULL;
688 SetRect(&r,
689 left,
690 top,
691 right,
692 bottom);
693 _res = Py_BuildValue("O&",
694 PyMac_BuildRect, &r);
695 return _res;
698 static PyObject *Qd_OffsetRect(_self, _args)
699 PyObject *_self;
700 PyObject *_args;
702 PyObject *_res = NULL;
703 Rect r;
704 short dh;
705 short dv;
706 if (!PyArg_ParseTuple(_args, "hh",
707 &dh,
708 &dv))
709 return NULL;
710 OffsetRect(&r,
712 dv);
713 _res = Py_BuildValue("O&",
714 PyMac_BuildRect, &r);
715 return _res;
718 static PyObject *Qd_InsetRect(_self, _args)
719 PyObject *_self;
720 PyObject *_args;
722 PyObject *_res = NULL;
723 Rect r;
724 short dh;
725 short dv;
726 if (!PyArg_ParseTuple(_args, "hh",
727 &dh,
728 &dv))
729 return NULL;
730 InsetRect(&r,
732 dv);
733 _res = Py_BuildValue("O&",
734 PyMac_BuildRect, &r);
735 return _res;
738 static PyObject *Qd_SectRect(_self, _args)
739 PyObject *_self;
740 PyObject *_args;
742 PyObject *_res = NULL;
743 Boolean _rv;
744 Rect src1;
745 Rect src2;
746 Rect dstRect;
747 if (!PyArg_ParseTuple(_args, "O&O&",
748 PyMac_GetRect, &src1,
749 PyMac_GetRect, &src2))
750 return NULL;
751 _rv = SectRect(&src1,
752 &src2,
753 &dstRect);
754 _res = Py_BuildValue("bO&",
755 _rv,
756 PyMac_BuildRect, &dstRect);
757 return _res;
760 static PyObject *Qd_UnionRect(_self, _args)
761 PyObject *_self;
762 PyObject *_args;
764 PyObject *_res = NULL;
765 Rect src1;
766 Rect src2;
767 Rect dstRect;
768 if (!PyArg_ParseTuple(_args, "O&O&",
769 PyMac_GetRect, &src1,
770 PyMac_GetRect, &src2))
771 return NULL;
772 UnionRect(&src1,
773 &src2,
774 &dstRect);
775 _res = Py_BuildValue("O&",
776 PyMac_BuildRect, &dstRect);
777 return _res;
780 static PyObject *Qd_EqualRect(_self, _args)
781 PyObject *_self;
782 PyObject *_args;
784 PyObject *_res = NULL;
785 Boolean _rv;
786 Rect rect1;
787 Rect rect2;
788 if (!PyArg_ParseTuple(_args, "O&O&",
789 PyMac_GetRect, &rect1,
790 PyMac_GetRect, &rect2))
791 return NULL;
792 _rv = EqualRect(&rect1,
793 &rect2);
794 _res = Py_BuildValue("b",
795 _rv);
796 return _res;
799 static PyObject *Qd_EmptyRect(_self, _args)
800 PyObject *_self;
801 PyObject *_args;
803 PyObject *_res = NULL;
804 Boolean _rv;
805 Rect r;
806 if (!PyArg_ParseTuple(_args, "O&",
807 PyMac_GetRect, &r))
808 return NULL;
809 _rv = EmptyRect(&r);
810 _res = Py_BuildValue("b",
811 _rv);
812 return _res;
815 static PyObject *Qd_FrameRect(_self, _args)
816 PyObject *_self;
817 PyObject *_args;
819 PyObject *_res = NULL;
820 Rect r;
821 if (!PyArg_ParseTuple(_args, "O&",
822 PyMac_GetRect, &r))
823 return NULL;
824 FrameRect(&r);
825 Py_INCREF(Py_None);
826 _res = Py_None;
827 return _res;
830 static PyObject *Qd_PaintRect(_self, _args)
831 PyObject *_self;
832 PyObject *_args;
834 PyObject *_res = NULL;
835 Rect r;
836 if (!PyArg_ParseTuple(_args, "O&",
837 PyMac_GetRect, &r))
838 return NULL;
839 PaintRect(&r);
840 Py_INCREF(Py_None);
841 _res = Py_None;
842 return _res;
845 static PyObject *Qd_EraseRect(_self, _args)
846 PyObject *_self;
847 PyObject *_args;
849 PyObject *_res = NULL;
850 Rect r;
851 if (!PyArg_ParseTuple(_args, "O&",
852 PyMac_GetRect, &r))
853 return NULL;
854 EraseRect(&r);
855 Py_INCREF(Py_None);
856 _res = Py_None;
857 return _res;
860 static PyObject *Qd_InvertRect(_self, _args)
861 PyObject *_self;
862 PyObject *_args;
864 PyObject *_res = NULL;
865 Rect r;
866 if (!PyArg_ParseTuple(_args, "O&",
867 PyMac_GetRect, &r))
868 return NULL;
869 InvertRect(&r);
870 Py_INCREF(Py_None);
871 _res = Py_None;
872 return _res;
875 static PyObject *Qd_FrameOval(_self, _args)
876 PyObject *_self;
877 PyObject *_args;
879 PyObject *_res = NULL;
880 Rect r;
881 if (!PyArg_ParseTuple(_args, "O&",
882 PyMac_GetRect, &r))
883 return NULL;
884 FrameOval(&r);
885 Py_INCREF(Py_None);
886 _res = Py_None;
887 return _res;
890 static PyObject *Qd_PaintOval(_self, _args)
891 PyObject *_self;
892 PyObject *_args;
894 PyObject *_res = NULL;
895 Rect r;
896 if (!PyArg_ParseTuple(_args, "O&",
897 PyMac_GetRect, &r))
898 return NULL;
899 PaintOval(&r);
900 Py_INCREF(Py_None);
901 _res = Py_None;
902 return _res;
905 static PyObject *Qd_EraseOval(_self, _args)
906 PyObject *_self;
907 PyObject *_args;
909 PyObject *_res = NULL;
910 Rect r;
911 if (!PyArg_ParseTuple(_args, "O&",
912 PyMac_GetRect, &r))
913 return NULL;
914 EraseOval(&r);
915 Py_INCREF(Py_None);
916 _res = Py_None;
917 return _res;
920 static PyObject *Qd_InvertOval(_self, _args)
921 PyObject *_self;
922 PyObject *_args;
924 PyObject *_res = NULL;
925 Rect r;
926 if (!PyArg_ParseTuple(_args, "O&",
927 PyMac_GetRect, &r))
928 return NULL;
929 InvertOval(&r);
930 Py_INCREF(Py_None);
931 _res = Py_None;
932 return _res;
935 static PyObject *Qd_FrameRoundRect(_self, _args)
936 PyObject *_self;
937 PyObject *_args;
939 PyObject *_res = NULL;
940 Rect r;
941 short ovalWidth;
942 short ovalHeight;
943 if (!PyArg_ParseTuple(_args, "O&hh",
944 PyMac_GetRect, &r,
945 &ovalWidth,
946 &ovalHeight))
947 return NULL;
948 FrameRoundRect(&r,
949 ovalWidth,
950 ovalHeight);
951 Py_INCREF(Py_None);
952 _res = Py_None;
953 return _res;
956 static PyObject *Qd_PaintRoundRect(_self, _args)
957 PyObject *_self;
958 PyObject *_args;
960 PyObject *_res = NULL;
961 Rect r;
962 short ovalWidth;
963 short ovalHeight;
964 if (!PyArg_ParseTuple(_args, "O&hh",
965 PyMac_GetRect, &r,
966 &ovalWidth,
967 &ovalHeight))
968 return NULL;
969 PaintRoundRect(&r,
970 ovalWidth,
971 ovalHeight);
972 Py_INCREF(Py_None);
973 _res = Py_None;
974 return _res;
977 static PyObject *Qd_EraseRoundRect(_self, _args)
978 PyObject *_self;
979 PyObject *_args;
981 PyObject *_res = NULL;
982 Rect r;
983 short ovalWidth;
984 short ovalHeight;
985 if (!PyArg_ParseTuple(_args, "O&hh",
986 PyMac_GetRect, &r,
987 &ovalWidth,
988 &ovalHeight))
989 return NULL;
990 EraseRoundRect(&r,
991 ovalWidth,
992 ovalHeight);
993 Py_INCREF(Py_None);
994 _res = Py_None;
995 return _res;
998 static PyObject *Qd_InvertRoundRect(_self, _args)
999 PyObject *_self;
1000 PyObject *_args;
1002 PyObject *_res = NULL;
1003 Rect r;
1004 short ovalWidth;
1005 short ovalHeight;
1006 if (!PyArg_ParseTuple(_args, "O&hh",
1007 PyMac_GetRect, &r,
1008 &ovalWidth,
1009 &ovalHeight))
1010 return NULL;
1011 InvertRoundRect(&r,
1012 ovalWidth,
1013 ovalHeight);
1014 Py_INCREF(Py_None);
1015 _res = Py_None;
1016 return _res;
1019 static PyObject *Qd_FrameArc(_self, _args)
1020 PyObject *_self;
1021 PyObject *_args;
1023 PyObject *_res = NULL;
1024 Rect r;
1025 short startAngle;
1026 short arcAngle;
1027 if (!PyArg_ParseTuple(_args, "O&hh",
1028 PyMac_GetRect, &r,
1029 &startAngle,
1030 &arcAngle))
1031 return NULL;
1032 FrameArc(&r,
1033 startAngle,
1034 arcAngle);
1035 Py_INCREF(Py_None);
1036 _res = Py_None;
1037 return _res;
1040 static PyObject *Qd_PaintArc(_self, _args)
1041 PyObject *_self;
1042 PyObject *_args;
1044 PyObject *_res = NULL;
1045 Rect r;
1046 short startAngle;
1047 short arcAngle;
1048 if (!PyArg_ParseTuple(_args, "O&hh",
1049 PyMac_GetRect, &r,
1050 &startAngle,
1051 &arcAngle))
1052 return NULL;
1053 PaintArc(&r,
1054 startAngle,
1055 arcAngle);
1056 Py_INCREF(Py_None);
1057 _res = Py_None;
1058 return _res;
1061 static PyObject *Qd_EraseArc(_self, _args)
1062 PyObject *_self;
1063 PyObject *_args;
1065 PyObject *_res = NULL;
1066 Rect r;
1067 short startAngle;
1068 short arcAngle;
1069 if (!PyArg_ParseTuple(_args, "O&hh",
1070 PyMac_GetRect, &r,
1071 &startAngle,
1072 &arcAngle))
1073 return NULL;
1074 EraseArc(&r,
1075 startAngle,
1076 arcAngle);
1077 Py_INCREF(Py_None);
1078 _res = Py_None;
1079 return _res;
1082 static PyObject *Qd_InvertArc(_self, _args)
1083 PyObject *_self;
1084 PyObject *_args;
1086 PyObject *_res = NULL;
1087 Rect r;
1088 short startAngle;
1089 short arcAngle;
1090 if (!PyArg_ParseTuple(_args, "O&hh",
1091 PyMac_GetRect, &r,
1092 &startAngle,
1093 &arcAngle))
1094 return NULL;
1095 InvertArc(&r,
1096 startAngle,
1097 arcAngle);
1098 Py_INCREF(Py_None);
1099 _res = Py_None;
1100 return _res;
1103 static PyObject *Qd_NewRgn(_self, _args)
1104 PyObject *_self;
1105 PyObject *_args;
1107 PyObject *_res = NULL;
1108 RgnHandle _rv;
1109 if (!PyArg_ParseTuple(_args, ""))
1110 return NULL;
1111 _rv = NewRgn();
1112 _res = Py_BuildValue("O&",
1113 ResObj_New, _rv);
1114 return _res;
1117 static PyObject *Qd_OpenRgn(_self, _args)
1118 PyObject *_self;
1119 PyObject *_args;
1121 PyObject *_res = NULL;
1122 if (!PyArg_ParseTuple(_args, ""))
1123 return NULL;
1124 OpenRgn();
1125 Py_INCREF(Py_None);
1126 _res = Py_None;
1127 return _res;
1130 static PyObject *Qd_CloseRgn(_self, _args)
1131 PyObject *_self;
1132 PyObject *_args;
1134 PyObject *_res = NULL;
1135 RgnHandle dstRgn;
1136 if (!PyArg_ParseTuple(_args, "O&",
1137 ResObj_Convert, &dstRgn))
1138 return NULL;
1139 CloseRgn(dstRgn);
1140 Py_INCREF(Py_None);
1141 _res = Py_None;
1142 return _res;
1145 static PyObject *Qd_DisposeRgn(_self, _args)
1146 PyObject *_self;
1147 PyObject *_args;
1149 PyObject *_res = NULL;
1150 RgnHandle rgn;
1151 if (!PyArg_ParseTuple(_args, "O&",
1152 ResObj_Convert, &rgn))
1153 return NULL;
1154 DisposeRgn(rgn);
1155 Py_INCREF(Py_None);
1156 _res = Py_None;
1157 return _res;
1160 static PyObject *Qd_CopyRgn(_self, _args)
1161 PyObject *_self;
1162 PyObject *_args;
1164 PyObject *_res = NULL;
1165 RgnHandle srcRgn;
1166 RgnHandle dstRgn;
1167 if (!PyArg_ParseTuple(_args, "O&O&",
1168 ResObj_Convert, &srcRgn,
1169 ResObj_Convert, &dstRgn))
1170 return NULL;
1171 CopyRgn(srcRgn,
1172 dstRgn);
1173 Py_INCREF(Py_None);
1174 _res = Py_None;
1175 return _res;
1178 static PyObject *Qd_SetEmptyRgn(_self, _args)
1179 PyObject *_self;
1180 PyObject *_args;
1182 PyObject *_res = NULL;
1183 RgnHandle rgn;
1184 if (!PyArg_ParseTuple(_args, "O&",
1185 ResObj_Convert, &rgn))
1186 return NULL;
1187 SetEmptyRgn(rgn);
1188 Py_INCREF(Py_None);
1189 _res = Py_None;
1190 return _res;
1193 static PyObject *Qd_SetRectRgn(_self, _args)
1194 PyObject *_self;
1195 PyObject *_args;
1197 PyObject *_res = NULL;
1198 RgnHandle rgn;
1199 short left;
1200 short top;
1201 short right;
1202 short bottom;
1203 if (!PyArg_ParseTuple(_args, "O&hhhh",
1204 ResObj_Convert, &rgn,
1205 &left,
1206 &top,
1207 &right,
1208 &bottom))
1209 return NULL;
1210 SetRectRgn(rgn,
1211 left,
1212 top,
1213 right,
1214 bottom);
1215 Py_INCREF(Py_None);
1216 _res = Py_None;
1217 return _res;
1220 static PyObject *Qd_RectRgn(_self, _args)
1221 PyObject *_self;
1222 PyObject *_args;
1224 PyObject *_res = NULL;
1225 RgnHandle rgn;
1226 Rect r;
1227 if (!PyArg_ParseTuple(_args, "O&O&",
1228 ResObj_Convert, &rgn,
1229 PyMac_GetRect, &r))
1230 return NULL;
1231 RectRgn(rgn,
1232 &r);
1233 Py_INCREF(Py_None);
1234 _res = Py_None;
1235 return _res;
1238 static PyObject *Qd_OffsetRgn(_self, _args)
1239 PyObject *_self;
1240 PyObject *_args;
1242 PyObject *_res = NULL;
1243 RgnHandle rgn;
1244 short dh;
1245 short dv;
1246 if (!PyArg_ParseTuple(_args, "O&hh",
1247 ResObj_Convert, &rgn,
1248 &dh,
1249 &dv))
1250 return NULL;
1251 OffsetRgn(rgn,
1253 dv);
1254 Py_INCREF(Py_None);
1255 _res = Py_None;
1256 return _res;
1259 static PyObject *Qd_InsetRgn(_self, _args)
1260 PyObject *_self;
1261 PyObject *_args;
1263 PyObject *_res = NULL;
1264 RgnHandle rgn;
1265 short dh;
1266 short dv;
1267 if (!PyArg_ParseTuple(_args, "O&hh",
1268 ResObj_Convert, &rgn,
1269 &dh,
1270 &dv))
1271 return NULL;
1272 InsetRgn(rgn,
1274 dv);
1275 Py_INCREF(Py_None);
1276 _res = Py_None;
1277 return _res;
1280 static PyObject *Qd_SectRgn(_self, _args)
1281 PyObject *_self;
1282 PyObject *_args;
1284 PyObject *_res = NULL;
1285 RgnHandle srcRgnA;
1286 RgnHandle srcRgnB;
1287 RgnHandle dstRgn;
1288 if (!PyArg_ParseTuple(_args, "O&O&O&",
1289 ResObj_Convert, &srcRgnA,
1290 ResObj_Convert, &srcRgnB,
1291 ResObj_Convert, &dstRgn))
1292 return NULL;
1293 SectRgn(srcRgnA,
1294 srcRgnB,
1295 dstRgn);
1296 Py_INCREF(Py_None);
1297 _res = Py_None;
1298 return _res;
1301 static PyObject *Qd_UnionRgn(_self, _args)
1302 PyObject *_self;
1303 PyObject *_args;
1305 PyObject *_res = NULL;
1306 RgnHandle srcRgnA;
1307 RgnHandle srcRgnB;
1308 RgnHandle dstRgn;
1309 if (!PyArg_ParseTuple(_args, "O&O&O&",
1310 ResObj_Convert, &srcRgnA,
1311 ResObj_Convert, &srcRgnB,
1312 ResObj_Convert, &dstRgn))
1313 return NULL;
1314 UnionRgn(srcRgnA,
1315 srcRgnB,
1316 dstRgn);
1317 Py_INCREF(Py_None);
1318 _res = Py_None;
1319 return _res;
1322 static PyObject *Qd_DiffRgn(_self, _args)
1323 PyObject *_self;
1324 PyObject *_args;
1326 PyObject *_res = NULL;
1327 RgnHandle srcRgnA;
1328 RgnHandle srcRgnB;
1329 RgnHandle dstRgn;
1330 if (!PyArg_ParseTuple(_args, "O&O&O&",
1331 ResObj_Convert, &srcRgnA,
1332 ResObj_Convert, &srcRgnB,
1333 ResObj_Convert, &dstRgn))
1334 return NULL;
1335 DiffRgn(srcRgnA,
1336 srcRgnB,
1337 dstRgn);
1338 Py_INCREF(Py_None);
1339 _res = Py_None;
1340 return _res;
1343 static PyObject *Qd_XorRgn(_self, _args)
1344 PyObject *_self;
1345 PyObject *_args;
1347 PyObject *_res = NULL;
1348 RgnHandle srcRgnA;
1349 RgnHandle srcRgnB;
1350 RgnHandle dstRgn;
1351 if (!PyArg_ParseTuple(_args, "O&O&O&",
1352 ResObj_Convert, &srcRgnA,
1353 ResObj_Convert, &srcRgnB,
1354 ResObj_Convert, &dstRgn))
1355 return NULL;
1356 XorRgn(srcRgnA,
1357 srcRgnB,
1358 dstRgn);
1359 Py_INCREF(Py_None);
1360 _res = Py_None;
1361 return _res;
1364 static PyObject *Qd_RectInRgn(_self, _args)
1365 PyObject *_self;
1366 PyObject *_args;
1368 PyObject *_res = NULL;
1369 Boolean _rv;
1370 Rect r;
1371 RgnHandle rgn;
1372 if (!PyArg_ParseTuple(_args, "O&O&",
1373 PyMac_GetRect, &r,
1374 ResObj_Convert, &rgn))
1375 return NULL;
1376 _rv = RectInRgn(&r,
1377 rgn);
1378 _res = Py_BuildValue("b",
1379 _rv);
1380 return _res;
1383 static PyObject *Qd_EqualRgn(_self, _args)
1384 PyObject *_self;
1385 PyObject *_args;
1387 PyObject *_res = NULL;
1388 Boolean _rv;
1389 RgnHandle rgnA;
1390 RgnHandle rgnB;
1391 if (!PyArg_ParseTuple(_args, "O&O&",
1392 ResObj_Convert, &rgnA,
1393 ResObj_Convert, &rgnB))
1394 return NULL;
1395 _rv = EqualRgn(rgnA,
1396 rgnB);
1397 _res = Py_BuildValue("b",
1398 _rv);
1399 return _res;
1402 static PyObject *Qd_EmptyRgn(_self, _args)
1403 PyObject *_self;
1404 PyObject *_args;
1406 PyObject *_res = NULL;
1407 Boolean _rv;
1408 RgnHandle rgn;
1409 if (!PyArg_ParseTuple(_args, "O&",
1410 ResObj_Convert, &rgn))
1411 return NULL;
1412 _rv = EmptyRgn(rgn);
1413 _res = Py_BuildValue("b",
1414 _rv);
1415 return _res;
1418 static PyObject *Qd_FrameRgn(_self, _args)
1419 PyObject *_self;
1420 PyObject *_args;
1422 PyObject *_res = NULL;
1423 RgnHandle rgn;
1424 if (!PyArg_ParseTuple(_args, "O&",
1425 ResObj_Convert, &rgn))
1426 return NULL;
1427 FrameRgn(rgn);
1428 Py_INCREF(Py_None);
1429 _res = Py_None;
1430 return _res;
1433 static PyObject *Qd_PaintRgn(_self, _args)
1434 PyObject *_self;
1435 PyObject *_args;
1437 PyObject *_res = NULL;
1438 RgnHandle rgn;
1439 if (!PyArg_ParseTuple(_args, "O&",
1440 ResObj_Convert, &rgn))
1441 return NULL;
1442 PaintRgn(rgn);
1443 Py_INCREF(Py_None);
1444 _res = Py_None;
1445 return _res;
1448 static PyObject *Qd_EraseRgn(_self, _args)
1449 PyObject *_self;
1450 PyObject *_args;
1452 PyObject *_res = NULL;
1453 RgnHandle rgn;
1454 if (!PyArg_ParseTuple(_args, "O&",
1455 ResObj_Convert, &rgn))
1456 return NULL;
1457 EraseRgn(rgn);
1458 Py_INCREF(Py_None);
1459 _res = Py_None;
1460 return _res;
1463 static PyObject *Qd_InvertRgn(_self, _args)
1464 PyObject *_self;
1465 PyObject *_args;
1467 PyObject *_res = NULL;
1468 RgnHandle rgn;
1469 if (!PyArg_ParseTuple(_args, "O&",
1470 ResObj_Convert, &rgn))
1471 return NULL;
1472 InvertRgn(rgn);
1473 Py_INCREF(Py_None);
1474 _res = Py_None;
1475 return _res;
1478 static PyObject *Qd_ScrollRect(_self, _args)
1479 PyObject *_self;
1480 PyObject *_args;
1482 PyObject *_res = NULL;
1483 Rect r;
1484 short dh;
1485 short dv;
1486 RgnHandle updateRgn;
1487 if (!PyArg_ParseTuple(_args, "O&hhO&",
1488 PyMac_GetRect, &r,
1489 &dh,
1490 &dv,
1491 ResObj_Convert, &updateRgn))
1492 return NULL;
1493 ScrollRect(&r,
1496 updateRgn);
1497 Py_INCREF(Py_None);
1498 _res = Py_None;
1499 return _res;
1502 static PyObject *Qd_OpenPicture(_self, _args)
1503 PyObject *_self;
1504 PyObject *_args;
1506 PyObject *_res = NULL;
1507 PicHandle _rv;
1508 Rect picFrame;
1509 if (!PyArg_ParseTuple(_args, "O&",
1510 PyMac_GetRect, &picFrame))
1511 return NULL;
1512 _rv = OpenPicture(&picFrame);
1513 _res = Py_BuildValue("O&",
1514 ResObj_New, _rv);
1515 return _res;
1518 static PyObject *Qd_PicComment(_self, _args)
1519 PyObject *_self;
1520 PyObject *_args;
1522 PyObject *_res = NULL;
1523 short kind;
1524 short dataSize;
1525 Handle dataHandle;
1526 if (!PyArg_ParseTuple(_args, "hhO&",
1527 &kind,
1528 &dataSize,
1529 ResObj_Convert, &dataHandle))
1530 return NULL;
1531 PicComment(kind,
1532 dataSize,
1533 dataHandle);
1534 Py_INCREF(Py_None);
1535 _res = Py_None;
1536 return _res;
1539 static PyObject *Qd_ClosePicture(_self, _args)
1540 PyObject *_self;
1541 PyObject *_args;
1543 PyObject *_res = NULL;
1544 if (!PyArg_ParseTuple(_args, ""))
1545 return NULL;
1546 ClosePicture();
1547 Py_INCREF(Py_None);
1548 _res = Py_None;
1549 return _res;
1552 static PyObject *Qd_DrawPicture(_self, _args)
1553 PyObject *_self;
1554 PyObject *_args;
1556 PyObject *_res = NULL;
1557 PicHandle myPicture;
1558 Rect dstRect;
1559 if (!PyArg_ParseTuple(_args, "O&O&",
1560 ResObj_Convert, &myPicture,
1561 PyMac_GetRect, &dstRect))
1562 return NULL;
1563 DrawPicture(myPicture,
1564 &dstRect);
1565 Py_INCREF(Py_None);
1566 _res = Py_None;
1567 return _res;
1570 static PyObject *Qd_KillPicture(_self, _args)
1571 PyObject *_self;
1572 PyObject *_args;
1574 PyObject *_res = NULL;
1575 PicHandle myPicture;
1576 if (!PyArg_ParseTuple(_args, "O&",
1577 ResObj_Convert, &myPicture))
1578 return NULL;
1579 KillPicture(myPicture);
1580 Py_INCREF(Py_None);
1581 _res = Py_None;
1582 return _res;
1585 static PyObject *Qd_OpenPoly(_self, _args)
1586 PyObject *_self;
1587 PyObject *_args;
1589 PyObject *_res = NULL;
1590 PolyHandle _rv;
1591 if (!PyArg_ParseTuple(_args, ""))
1592 return NULL;
1593 _rv = OpenPoly();
1594 _res = Py_BuildValue("O&",
1595 ResObj_New, _rv);
1596 return _res;
1599 static PyObject *Qd_ClosePoly(_self, _args)
1600 PyObject *_self;
1601 PyObject *_args;
1603 PyObject *_res = NULL;
1604 if (!PyArg_ParseTuple(_args, ""))
1605 return NULL;
1606 ClosePoly();
1607 Py_INCREF(Py_None);
1608 _res = Py_None;
1609 return _res;
1612 static PyObject *Qd_KillPoly(_self, _args)
1613 PyObject *_self;
1614 PyObject *_args;
1616 PyObject *_res = NULL;
1617 PolyHandle poly;
1618 if (!PyArg_ParseTuple(_args, "O&",
1619 ResObj_Convert, &poly))
1620 return NULL;
1621 KillPoly(poly);
1622 Py_INCREF(Py_None);
1623 _res = Py_None;
1624 return _res;
1627 static PyObject *Qd_OffsetPoly(_self, _args)
1628 PyObject *_self;
1629 PyObject *_args;
1631 PyObject *_res = NULL;
1632 PolyHandle poly;
1633 short dh;
1634 short dv;
1635 if (!PyArg_ParseTuple(_args, "O&hh",
1636 ResObj_Convert, &poly,
1637 &dh,
1638 &dv))
1639 return NULL;
1640 OffsetPoly(poly,
1642 dv);
1643 Py_INCREF(Py_None);
1644 _res = Py_None;
1645 return _res;
1648 static PyObject *Qd_FramePoly(_self, _args)
1649 PyObject *_self;
1650 PyObject *_args;
1652 PyObject *_res = NULL;
1653 PolyHandle poly;
1654 if (!PyArg_ParseTuple(_args, "O&",
1655 ResObj_Convert, &poly))
1656 return NULL;
1657 FramePoly(poly);
1658 Py_INCREF(Py_None);
1659 _res = Py_None;
1660 return _res;
1663 static PyObject *Qd_PaintPoly(_self, _args)
1664 PyObject *_self;
1665 PyObject *_args;
1667 PyObject *_res = NULL;
1668 PolyHandle poly;
1669 if (!PyArg_ParseTuple(_args, "O&",
1670 ResObj_Convert, &poly))
1671 return NULL;
1672 PaintPoly(poly);
1673 Py_INCREF(Py_None);
1674 _res = Py_None;
1675 return _res;
1678 static PyObject *Qd_ErasePoly(_self, _args)
1679 PyObject *_self;
1680 PyObject *_args;
1682 PyObject *_res = NULL;
1683 PolyHandle poly;
1684 if (!PyArg_ParseTuple(_args, "O&",
1685 ResObj_Convert, &poly))
1686 return NULL;
1687 ErasePoly(poly);
1688 Py_INCREF(Py_None);
1689 _res = Py_None;
1690 return _res;
1693 static PyObject *Qd_InvertPoly(_self, _args)
1694 PyObject *_self;
1695 PyObject *_args;
1697 PyObject *_res = NULL;
1698 PolyHandle poly;
1699 if (!PyArg_ParseTuple(_args, "O&",
1700 ResObj_Convert, &poly))
1701 return NULL;
1702 InvertPoly(poly);
1703 Py_INCREF(Py_None);
1704 _res = Py_None;
1705 return _res;
1708 static PyObject *Qd_SetPt(_self, _args)
1709 PyObject *_self;
1710 PyObject *_args;
1712 PyObject *_res = NULL;
1713 Point pt;
1714 short h;
1715 short v;
1716 if (!PyArg_ParseTuple(_args, "O&hh",
1717 PyMac_GetPoint, &pt,
1719 &v))
1720 return NULL;
1721 SetPt(&pt,
1724 _res = Py_BuildValue("O&",
1725 PyMac_BuildPoint, pt);
1726 return _res;
1729 static PyObject *Qd_LocalToGlobal(_self, _args)
1730 PyObject *_self;
1731 PyObject *_args;
1733 PyObject *_res = NULL;
1734 Point pt;
1735 if (!PyArg_ParseTuple(_args, "O&",
1736 PyMac_GetPoint, &pt))
1737 return NULL;
1738 LocalToGlobal(&pt);
1739 _res = Py_BuildValue("O&",
1740 PyMac_BuildPoint, pt);
1741 return _res;
1744 static PyObject *Qd_GlobalToLocal(_self, _args)
1745 PyObject *_self;
1746 PyObject *_args;
1748 PyObject *_res = NULL;
1749 Point pt;
1750 if (!PyArg_ParseTuple(_args, "O&",
1751 PyMac_GetPoint, &pt))
1752 return NULL;
1753 GlobalToLocal(&pt);
1754 _res = Py_BuildValue("O&",
1755 PyMac_BuildPoint, pt);
1756 return _res;
1759 static PyObject *Qd_Random(_self, _args)
1760 PyObject *_self;
1761 PyObject *_args;
1763 PyObject *_res = NULL;
1764 short _rv;
1765 if (!PyArg_ParseTuple(_args, ""))
1766 return NULL;
1767 _rv = Random();
1768 _res = Py_BuildValue("h",
1769 _rv);
1770 return _res;
1773 static PyObject *Qd_GetPixel(_self, _args)
1774 PyObject *_self;
1775 PyObject *_args;
1777 PyObject *_res = NULL;
1778 Boolean _rv;
1779 short h;
1780 short v;
1781 if (!PyArg_ParseTuple(_args, "hh",
1783 &v))
1784 return NULL;
1785 _rv = GetPixel(h,
1787 _res = Py_BuildValue("b",
1788 _rv);
1789 return _res;
1792 static PyObject *Qd_ScalePt(_self, _args)
1793 PyObject *_self;
1794 PyObject *_args;
1796 PyObject *_res = NULL;
1797 Point pt;
1798 Rect srcRect;
1799 Rect dstRect;
1800 if (!PyArg_ParseTuple(_args, "O&O&O&",
1801 PyMac_GetPoint, &pt,
1802 PyMac_GetRect, &srcRect,
1803 PyMac_GetRect, &dstRect))
1804 return NULL;
1805 ScalePt(&pt,
1806 &srcRect,
1807 &dstRect);
1808 _res = Py_BuildValue("O&",
1809 PyMac_BuildPoint, pt);
1810 return _res;
1813 static PyObject *Qd_MapPt(_self, _args)
1814 PyObject *_self;
1815 PyObject *_args;
1817 PyObject *_res = NULL;
1818 Point pt;
1819 Rect srcRect;
1820 Rect dstRect;
1821 if (!PyArg_ParseTuple(_args, "O&O&O&",
1822 PyMac_GetPoint, &pt,
1823 PyMac_GetRect, &srcRect,
1824 PyMac_GetRect, &dstRect))
1825 return NULL;
1826 MapPt(&pt,
1827 &srcRect,
1828 &dstRect);
1829 _res = Py_BuildValue("O&",
1830 PyMac_BuildPoint, pt);
1831 return _res;
1834 static PyObject *Qd_MapRect(_self, _args)
1835 PyObject *_self;
1836 PyObject *_args;
1838 PyObject *_res = NULL;
1839 Rect r;
1840 Rect srcRect;
1841 Rect dstRect;
1842 if (!PyArg_ParseTuple(_args, "O&O&",
1843 PyMac_GetRect, &srcRect,
1844 PyMac_GetRect, &dstRect))
1845 return NULL;
1846 MapRect(&r,
1847 &srcRect,
1848 &dstRect);
1849 _res = Py_BuildValue("O&",
1850 PyMac_BuildRect, &r);
1851 return _res;
1854 static PyObject *Qd_MapRgn(_self, _args)
1855 PyObject *_self;
1856 PyObject *_args;
1858 PyObject *_res = NULL;
1859 RgnHandle rgn;
1860 Rect srcRect;
1861 Rect dstRect;
1862 if (!PyArg_ParseTuple(_args, "O&O&O&",
1863 ResObj_Convert, &rgn,
1864 PyMac_GetRect, &srcRect,
1865 PyMac_GetRect, &dstRect))
1866 return NULL;
1867 MapRgn(rgn,
1868 &srcRect,
1869 &dstRect);
1870 Py_INCREF(Py_None);
1871 _res = Py_None;
1872 return _res;
1875 static PyObject *Qd_MapPoly(_self, _args)
1876 PyObject *_self;
1877 PyObject *_args;
1879 PyObject *_res = NULL;
1880 PolyHandle poly;
1881 Rect srcRect;
1882 Rect dstRect;
1883 if (!PyArg_ParseTuple(_args, "O&O&O&",
1884 ResObj_Convert, &poly,
1885 PyMac_GetRect, &srcRect,
1886 PyMac_GetRect, &dstRect))
1887 return NULL;
1888 MapPoly(poly,
1889 &srcRect,
1890 &dstRect);
1891 Py_INCREF(Py_None);
1892 _res = Py_None;
1893 return _res;
1896 static PyObject *Qd_AddPt(_self, _args)
1897 PyObject *_self;
1898 PyObject *_args;
1900 PyObject *_res = NULL;
1901 Point src;
1902 Point dst;
1903 if (!PyArg_ParseTuple(_args, "O&O&",
1904 PyMac_GetPoint, &src,
1905 PyMac_GetPoint, &dst))
1906 return NULL;
1907 AddPt(src,
1908 &dst);
1909 _res = Py_BuildValue("O&",
1910 PyMac_BuildPoint, dst);
1911 return _res;
1914 static PyObject *Qd_EqualPt(_self, _args)
1915 PyObject *_self;
1916 PyObject *_args;
1918 PyObject *_res = NULL;
1919 Boolean _rv;
1920 Point pt1;
1921 Point pt2;
1922 if (!PyArg_ParseTuple(_args, "O&O&",
1923 PyMac_GetPoint, &pt1,
1924 PyMac_GetPoint, &pt2))
1925 return NULL;
1926 _rv = EqualPt(pt1,
1927 pt2);
1928 _res = Py_BuildValue("b",
1929 _rv);
1930 return _res;
1933 static PyObject *Qd_PtInRect(_self, _args)
1934 PyObject *_self;
1935 PyObject *_args;
1937 PyObject *_res = NULL;
1938 Boolean _rv;
1939 Point pt;
1940 Rect r;
1941 if (!PyArg_ParseTuple(_args, "O&O&",
1942 PyMac_GetPoint, &pt,
1943 PyMac_GetRect, &r))
1944 return NULL;
1945 _rv = PtInRect(pt,
1946 &r);
1947 _res = Py_BuildValue("b",
1948 _rv);
1949 return _res;
1952 static PyObject *Qd_Pt2Rect(_self, _args)
1953 PyObject *_self;
1954 PyObject *_args;
1956 PyObject *_res = NULL;
1957 Point pt1;
1958 Point pt2;
1959 Rect dstRect;
1960 if (!PyArg_ParseTuple(_args, "O&O&",
1961 PyMac_GetPoint, &pt1,
1962 PyMac_GetPoint, &pt2))
1963 return NULL;
1964 Pt2Rect(pt1,
1965 pt2,
1966 &dstRect);
1967 _res = Py_BuildValue("O&",
1968 PyMac_BuildRect, &dstRect);
1969 return _res;
1972 static PyObject *Qd_PtToAngle(_self, _args)
1973 PyObject *_self;
1974 PyObject *_args;
1976 PyObject *_res = NULL;
1977 Rect r;
1978 Point pt;
1979 short angle;
1980 if (!PyArg_ParseTuple(_args, "O&O&",
1981 PyMac_GetRect, &r,
1982 PyMac_GetPoint, &pt))
1983 return NULL;
1984 PtToAngle(&r,
1986 &angle);
1987 _res = Py_BuildValue("h",
1988 angle);
1989 return _res;
1992 static PyObject *Qd_PtInRgn(_self, _args)
1993 PyObject *_self;
1994 PyObject *_args;
1996 PyObject *_res = NULL;
1997 Boolean _rv;
1998 Point pt;
1999 RgnHandle rgn;
2000 if (!PyArg_ParseTuple(_args, "O&O&",
2001 PyMac_GetPoint, &pt,
2002 ResObj_Convert, &rgn))
2003 return NULL;
2004 _rv = PtInRgn(pt,
2005 rgn);
2006 _res = Py_BuildValue("b",
2007 _rv);
2008 return _res;
2011 static PyObject *Qd_NewPixMap(_self, _args)
2012 PyObject *_self;
2013 PyObject *_args;
2015 PyObject *_res = NULL;
2016 PixMapHandle _rv;
2017 if (!PyArg_ParseTuple(_args, ""))
2018 return NULL;
2019 _rv = NewPixMap();
2020 _res = Py_BuildValue("O&",
2021 ResObj_New, _rv);
2022 return _res;
2025 static PyObject *Qd_DisposPixMap(_self, _args)
2026 PyObject *_self;
2027 PyObject *_args;
2029 PyObject *_res = NULL;
2030 PixMapHandle pm;
2031 if (!PyArg_ParseTuple(_args, "O&",
2032 ResObj_Convert, &pm))
2033 return NULL;
2034 DisposPixMap(pm);
2035 Py_INCREF(Py_None);
2036 _res = Py_None;
2037 return _res;
2040 static PyObject *Qd_DisposePixMap(_self, _args)
2041 PyObject *_self;
2042 PyObject *_args;
2044 PyObject *_res = NULL;
2045 PixMapHandle pm;
2046 if (!PyArg_ParseTuple(_args, "O&",
2047 ResObj_Convert, &pm))
2048 return NULL;
2049 DisposePixMap(pm);
2050 Py_INCREF(Py_None);
2051 _res = Py_None;
2052 return _res;
2055 static PyObject *Qd_CopyPixMap(_self, _args)
2056 PyObject *_self;
2057 PyObject *_args;
2059 PyObject *_res = NULL;
2060 PixMapHandle srcPM;
2061 PixMapHandle dstPM;
2062 if (!PyArg_ParseTuple(_args, "O&O&",
2063 ResObj_Convert, &srcPM,
2064 ResObj_Convert, &dstPM))
2065 return NULL;
2066 CopyPixMap(srcPM,
2067 dstPM);
2068 Py_INCREF(Py_None);
2069 _res = Py_None;
2070 return _res;
2073 static PyObject *Qd_NewPixPat(_self, _args)
2074 PyObject *_self;
2075 PyObject *_args;
2077 PyObject *_res = NULL;
2078 PixPatHandle _rv;
2079 if (!PyArg_ParseTuple(_args, ""))
2080 return NULL;
2081 _rv = NewPixPat();
2082 _res = Py_BuildValue("O&",
2083 ResObj_New, _rv);
2084 return _res;
2087 static PyObject *Qd_DisposPixPat(_self, _args)
2088 PyObject *_self;
2089 PyObject *_args;
2091 PyObject *_res = NULL;
2092 PixPatHandle pp;
2093 if (!PyArg_ParseTuple(_args, "O&",
2094 ResObj_Convert, &pp))
2095 return NULL;
2096 DisposPixPat(pp);
2097 Py_INCREF(Py_None);
2098 _res = Py_None;
2099 return _res;
2102 static PyObject *Qd_DisposePixPat(_self, _args)
2103 PyObject *_self;
2104 PyObject *_args;
2106 PyObject *_res = NULL;
2107 PixPatHandle pp;
2108 if (!PyArg_ParseTuple(_args, "O&",
2109 ResObj_Convert, &pp))
2110 return NULL;
2111 DisposePixPat(pp);
2112 Py_INCREF(Py_None);
2113 _res = Py_None;
2114 return _res;
2117 static PyObject *Qd_CopyPixPat(_self, _args)
2118 PyObject *_self;
2119 PyObject *_args;
2121 PyObject *_res = NULL;
2122 PixPatHandle srcPP;
2123 PixPatHandle dstPP;
2124 if (!PyArg_ParseTuple(_args, "O&O&",
2125 ResObj_Convert, &srcPP,
2126 ResObj_Convert, &dstPP))
2127 return NULL;
2128 CopyPixPat(srcPP,
2129 dstPP);
2130 Py_INCREF(Py_None);
2131 _res = Py_None;
2132 return _res;
2135 static PyObject *Qd_PenPixPat(_self, _args)
2136 PyObject *_self;
2137 PyObject *_args;
2139 PyObject *_res = NULL;
2140 PixPatHandle pp;
2141 if (!PyArg_ParseTuple(_args, "O&",
2142 ResObj_Convert, &pp))
2143 return NULL;
2144 PenPixPat(pp);
2145 Py_INCREF(Py_None);
2146 _res = Py_None;
2147 return _res;
2150 static PyObject *Qd_BackPixPat(_self, _args)
2151 PyObject *_self;
2152 PyObject *_args;
2154 PyObject *_res = NULL;
2155 PixPatHandle pp;
2156 if (!PyArg_ParseTuple(_args, "O&",
2157 ResObj_Convert, &pp))
2158 return NULL;
2159 BackPixPat(pp);
2160 Py_INCREF(Py_None);
2161 _res = Py_None;
2162 return _res;
2165 static PyObject *Qd_GetPixPat(_self, _args)
2166 PyObject *_self;
2167 PyObject *_args;
2169 PyObject *_res = NULL;
2170 PixPatHandle _rv;
2171 short patID;
2172 if (!PyArg_ParseTuple(_args, "h",
2173 &patID))
2174 return NULL;
2175 _rv = GetPixPat(patID);
2176 _res = Py_BuildValue("O&",
2177 ResObj_New, _rv);
2178 return _res;
2181 static PyObject *Qd_FillCRect(_self, _args)
2182 PyObject *_self;
2183 PyObject *_args;
2185 PyObject *_res = NULL;
2186 Rect r;
2187 PixPatHandle pp;
2188 if (!PyArg_ParseTuple(_args, "O&O&",
2189 PyMac_GetRect, &r,
2190 ResObj_Convert, &pp))
2191 return NULL;
2192 FillCRect(&r,
2193 pp);
2194 Py_INCREF(Py_None);
2195 _res = Py_None;
2196 return _res;
2199 static PyObject *Qd_FillCOval(_self, _args)
2200 PyObject *_self;
2201 PyObject *_args;
2203 PyObject *_res = NULL;
2204 Rect r;
2205 PixPatHandle pp;
2206 if (!PyArg_ParseTuple(_args, "O&O&",
2207 PyMac_GetRect, &r,
2208 ResObj_Convert, &pp))
2209 return NULL;
2210 FillCOval(&r,
2211 pp);
2212 Py_INCREF(Py_None);
2213 _res = Py_None;
2214 return _res;
2217 static PyObject *Qd_FillCRoundRect(_self, _args)
2218 PyObject *_self;
2219 PyObject *_args;
2221 PyObject *_res = NULL;
2222 Rect r;
2223 short ovalWidth;
2224 short ovalHeight;
2225 PixPatHandle pp;
2226 if (!PyArg_ParseTuple(_args, "O&hhO&",
2227 PyMac_GetRect, &r,
2228 &ovalWidth,
2229 &ovalHeight,
2230 ResObj_Convert, &pp))
2231 return NULL;
2232 FillCRoundRect(&r,
2233 ovalWidth,
2234 ovalHeight,
2235 pp);
2236 Py_INCREF(Py_None);
2237 _res = Py_None;
2238 return _res;
2241 static PyObject *Qd_FillCArc(_self, _args)
2242 PyObject *_self;
2243 PyObject *_args;
2245 PyObject *_res = NULL;
2246 Rect r;
2247 short startAngle;
2248 short arcAngle;
2249 PixPatHandle pp;
2250 if (!PyArg_ParseTuple(_args, "O&hhO&",
2251 PyMac_GetRect, &r,
2252 &startAngle,
2253 &arcAngle,
2254 ResObj_Convert, &pp))
2255 return NULL;
2256 FillCArc(&r,
2257 startAngle,
2258 arcAngle,
2259 pp);
2260 Py_INCREF(Py_None);
2261 _res = Py_None;
2262 return _res;
2265 static PyObject *Qd_FillCRgn(_self, _args)
2266 PyObject *_self;
2267 PyObject *_args;
2269 PyObject *_res = NULL;
2270 RgnHandle rgn;
2271 PixPatHandle pp;
2272 if (!PyArg_ParseTuple(_args, "O&O&",
2273 ResObj_Convert, &rgn,
2274 ResObj_Convert, &pp))
2275 return NULL;
2276 FillCRgn(rgn,
2277 pp);
2278 Py_INCREF(Py_None);
2279 _res = Py_None;
2280 return _res;
2283 static PyObject *Qd_FillCPoly(_self, _args)
2284 PyObject *_self;
2285 PyObject *_args;
2287 PyObject *_res = NULL;
2288 PolyHandle poly;
2289 PixPatHandle pp;
2290 if (!PyArg_ParseTuple(_args, "O&O&",
2291 ResObj_Convert, &poly,
2292 ResObj_Convert, &pp))
2293 return NULL;
2294 FillCPoly(poly,
2295 pp);
2296 Py_INCREF(Py_None);
2297 _res = Py_None;
2298 return _res;
2301 static PyObject *Qd_SetPortPix(_self, _args)
2302 PyObject *_self;
2303 PyObject *_args;
2305 PyObject *_res = NULL;
2306 PixMapHandle pm;
2307 if (!PyArg_ParseTuple(_args, "O&",
2308 ResObj_Convert, &pm))
2309 return NULL;
2310 SetPortPix(pm);
2311 Py_INCREF(Py_None);
2312 _res = Py_None;
2313 return _res;
2316 static PyObject *Qd_AllocCursor(_self, _args)
2317 PyObject *_self;
2318 PyObject *_args;
2320 PyObject *_res = NULL;
2321 if (!PyArg_ParseTuple(_args, ""))
2322 return NULL;
2323 AllocCursor();
2324 Py_INCREF(Py_None);
2325 _res = Py_None;
2326 return _res;
2329 static PyObject *Qd_CharExtra(_self, _args)
2330 PyObject *_self;
2331 PyObject *_args;
2333 PyObject *_res = NULL;
2334 long extra;
2335 if (!PyArg_ParseTuple(_args, "l",
2336 &extra))
2337 return NULL;
2338 CharExtra(extra);
2339 Py_INCREF(Py_None);
2340 _res = Py_None;
2341 return _res;
2344 static PyObject *Qd_GetCTSeed(_self, _args)
2345 PyObject *_self;
2346 PyObject *_args;
2348 PyObject *_res = NULL;
2349 long _rv;
2350 if (!PyArg_ParseTuple(_args, ""))
2351 return NULL;
2352 _rv = GetCTSeed();
2353 _res = Py_BuildValue("l",
2354 _rv);
2355 return _res;
2358 static PyObject *Qd_SubPt(_self, _args)
2359 PyObject *_self;
2360 PyObject *_args;
2362 PyObject *_res = NULL;
2363 Point src;
2364 Point dst;
2365 if (!PyArg_ParseTuple(_args, "O&O&",
2366 PyMac_GetPoint, &src,
2367 PyMac_GetPoint, &dst))
2368 return NULL;
2369 SubPt(src,
2370 &dst);
2371 _res = Py_BuildValue("O&",
2372 PyMac_BuildPoint, dst);
2373 return _res;
2376 static PyObject *Qd_SetClientID(_self, _args)
2377 PyObject *_self;
2378 PyObject *_args;
2380 PyObject *_res = NULL;
2381 short id;
2382 if (!PyArg_ParseTuple(_args, "h",
2383 &id))
2384 return NULL;
2385 SetClientID(id);
2386 Py_INCREF(Py_None);
2387 _res = Py_None;
2388 return _res;
2391 static PyObject *Qd_ProtectEntry(_self, _args)
2392 PyObject *_self;
2393 PyObject *_args;
2395 PyObject *_res = NULL;
2396 short index;
2397 Boolean protect;
2398 if (!PyArg_ParseTuple(_args, "hb",
2399 &index,
2400 &protect))
2401 return NULL;
2402 ProtectEntry(index,
2403 protect);
2404 Py_INCREF(Py_None);
2405 _res = Py_None;
2406 return _res;
2409 static PyObject *Qd_ReserveEntry(_self, _args)
2410 PyObject *_self;
2411 PyObject *_args;
2413 PyObject *_res = NULL;
2414 short index;
2415 Boolean reserve;
2416 if (!PyArg_ParseTuple(_args, "hb",
2417 &index,
2418 &reserve))
2419 return NULL;
2420 ReserveEntry(index,
2421 reserve);
2422 Py_INCREF(Py_None);
2423 _res = Py_None;
2424 return _res;
2427 static PyObject *Qd_QDError(_self, _args)
2428 PyObject *_self;
2429 PyObject *_args;
2431 PyObject *_res = NULL;
2432 short _rv;
2433 if (!PyArg_ParseTuple(_args, ""))
2434 return NULL;
2435 _rv = QDError();
2436 _res = Py_BuildValue("h",
2437 _rv);
2438 return _res;
2441 static PyMethodDef Qd_methods[] = {
2442 {"OpenPort", (PyCFunction)Qd_OpenPort, 1,
2443 "(WindowPtr port) -> None"},
2444 {"InitPort", (PyCFunction)Qd_InitPort, 1,
2445 "(WindowPtr port) -> None"},
2446 {"ClosePort", (PyCFunction)Qd_ClosePort, 1,
2447 "(WindowPtr port) -> None"},
2448 {"SetPort", (PyCFunction)Qd_SetPort, 1,
2449 "(WindowPtr port) -> None"},
2450 {"GetPort", (PyCFunction)Qd_GetPort, 1,
2451 "() -> (WindowPtr port)"},
2452 {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
2453 "(short device) -> None"},
2454 {"PortSize", (PyCFunction)Qd_PortSize, 1,
2455 "(short width, short height) -> None"},
2456 {"MovePortTo", (PyCFunction)Qd_MovePortTo, 1,
2457 "(short leftGlobal, short topGlobal) -> None"},
2458 {"SetOrigin", (PyCFunction)Qd_SetOrigin, 1,
2459 "(short h, short v) -> None"},
2460 {"SetClip", (PyCFunction)Qd_SetClip, 1,
2461 "(RgnHandle rgn) -> None"},
2462 {"GetClip", (PyCFunction)Qd_GetClip, 1,
2463 "(RgnHandle rgn) -> None"},
2464 {"ClipRect", (PyCFunction)Qd_ClipRect, 1,
2465 "(Rect r) -> None"},
2466 {"InitCursor", (PyCFunction)Qd_InitCursor, 1,
2467 "() -> None"},
2468 {"HideCursor", (PyCFunction)Qd_HideCursor, 1,
2469 "() -> None"},
2470 {"ShowCursor", (PyCFunction)Qd_ShowCursor, 1,
2471 "() -> None"},
2472 {"ObscureCursor", (PyCFunction)Qd_ObscureCursor, 1,
2473 "() -> None"},
2474 {"HidePen", (PyCFunction)Qd_HidePen, 1,
2475 "() -> None"},
2476 {"ShowPen", (PyCFunction)Qd_ShowPen, 1,
2477 "() -> None"},
2478 {"GetPen", (PyCFunction)Qd_GetPen, 1,
2479 "(Point pt) -> (Point pt)"},
2480 {"PenSize", (PyCFunction)Qd_PenSize, 1,
2481 "(short width, short height) -> None"},
2482 {"PenMode", (PyCFunction)Qd_PenMode, 1,
2483 "(short mode) -> None"},
2484 {"PenNormal", (PyCFunction)Qd_PenNormal, 1,
2485 "() -> None"},
2486 {"MoveTo", (PyCFunction)Qd_MoveTo, 1,
2487 "(short h, short v) -> None"},
2488 {"Move", (PyCFunction)Qd_Move, 1,
2489 "(short dh, short dv) -> None"},
2490 {"LineTo", (PyCFunction)Qd_LineTo, 1,
2491 "(short h, short v) -> None"},
2492 {"Line", (PyCFunction)Qd_Line, 1,
2493 "(short dh, short dv) -> None"},
2494 {"TextFont", (PyCFunction)Qd_TextFont, 1,
2495 "(short font) -> None"},
2496 {"TextFace", (PyCFunction)Qd_TextFace, 1,
2497 "(short face) -> None"},
2498 {"TextMode", (PyCFunction)Qd_TextMode, 1,
2499 "(short mode) -> None"},
2500 {"TextSize", (PyCFunction)Qd_TextSize, 1,
2501 "(short size) -> None"},
2502 {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1,
2503 "(long extra) -> None"},
2504 {"DrawChar", (PyCFunction)Qd_DrawChar, 1,
2505 "(short ch) -> None"},
2506 {"DrawString", (PyCFunction)Qd_DrawString, 1,
2507 "(Str255 s) -> None"},
2508 {"DrawText", (PyCFunction)Qd_DrawText, 1,
2509 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
2510 {"CharWidth", (PyCFunction)Qd_CharWidth, 1,
2511 "(short ch) -> (short _rv)"},
2512 {"StringWidth", (PyCFunction)Qd_StringWidth, 1,
2513 "(Str255 s) -> (short _rv)"},
2514 {"TextWidth", (PyCFunction)Qd_TextWidth, 1,
2515 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
2516 {"ForeColor", (PyCFunction)Qd_ForeColor, 1,
2517 "(long color) -> None"},
2518 {"BackColor", (PyCFunction)Qd_BackColor, 1,
2519 "(long color) -> None"},
2520 {"ColorBit", (PyCFunction)Qd_ColorBit, 1,
2521 "(short whichBit) -> None"},
2522 {"SetRect", (PyCFunction)Qd_SetRect, 1,
2523 "(short left, short top, short right, short bottom) -> (Rect r)"},
2524 {"OffsetRect", (PyCFunction)Qd_OffsetRect, 1,
2525 "(short dh, short dv) -> (Rect r)"},
2526 {"InsetRect", (PyCFunction)Qd_InsetRect, 1,
2527 "(short dh, short dv) -> (Rect r)"},
2528 {"SectRect", (PyCFunction)Qd_SectRect, 1,
2529 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
2530 {"UnionRect", (PyCFunction)Qd_UnionRect, 1,
2531 "(Rect src1, Rect src2) -> (Rect dstRect)"},
2532 {"EqualRect", (PyCFunction)Qd_EqualRect, 1,
2533 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
2534 {"EmptyRect", (PyCFunction)Qd_EmptyRect, 1,
2535 "(Rect r) -> (Boolean _rv)"},
2536 {"FrameRect", (PyCFunction)Qd_FrameRect, 1,
2537 "(Rect r) -> None"},
2538 {"PaintRect", (PyCFunction)Qd_PaintRect, 1,
2539 "(Rect r) -> None"},
2540 {"EraseRect", (PyCFunction)Qd_EraseRect, 1,
2541 "(Rect r) -> None"},
2542 {"InvertRect", (PyCFunction)Qd_InvertRect, 1,
2543 "(Rect r) -> None"},
2544 {"FrameOval", (PyCFunction)Qd_FrameOval, 1,
2545 "(Rect r) -> None"},
2546 {"PaintOval", (PyCFunction)Qd_PaintOval, 1,
2547 "(Rect r) -> None"},
2548 {"EraseOval", (PyCFunction)Qd_EraseOval, 1,
2549 "(Rect r) -> None"},
2550 {"InvertOval", (PyCFunction)Qd_InvertOval, 1,
2551 "(Rect r) -> None"},
2552 {"FrameRoundRect", (PyCFunction)Qd_FrameRoundRect, 1,
2553 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2554 {"PaintRoundRect", (PyCFunction)Qd_PaintRoundRect, 1,
2555 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2556 {"EraseRoundRect", (PyCFunction)Qd_EraseRoundRect, 1,
2557 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2558 {"InvertRoundRect", (PyCFunction)Qd_InvertRoundRect, 1,
2559 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2560 {"FrameArc", (PyCFunction)Qd_FrameArc, 1,
2561 "(Rect r, short startAngle, short arcAngle) -> None"},
2562 {"PaintArc", (PyCFunction)Qd_PaintArc, 1,
2563 "(Rect r, short startAngle, short arcAngle) -> None"},
2564 {"EraseArc", (PyCFunction)Qd_EraseArc, 1,
2565 "(Rect r, short startAngle, short arcAngle) -> None"},
2566 {"InvertArc", (PyCFunction)Qd_InvertArc, 1,
2567 "(Rect r, short startAngle, short arcAngle) -> None"},
2568 {"NewRgn", (PyCFunction)Qd_NewRgn, 1,
2569 "() -> (RgnHandle _rv)"},
2570 {"OpenRgn", (PyCFunction)Qd_OpenRgn, 1,
2571 "() -> None"},
2572 {"CloseRgn", (PyCFunction)Qd_CloseRgn, 1,
2573 "(RgnHandle dstRgn) -> None"},
2574 {"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
2575 "(RgnHandle rgn) -> None"},
2576 {"CopyRgn", (PyCFunction)Qd_CopyRgn, 1,
2577 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
2578 {"SetEmptyRgn", (PyCFunction)Qd_SetEmptyRgn, 1,
2579 "(RgnHandle rgn) -> None"},
2580 {"SetRectRgn", (PyCFunction)Qd_SetRectRgn, 1,
2581 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
2582 {"RectRgn", (PyCFunction)Qd_RectRgn, 1,
2583 "(RgnHandle rgn, Rect r) -> None"},
2584 {"OffsetRgn", (PyCFunction)Qd_OffsetRgn, 1,
2585 "(RgnHandle rgn, short dh, short dv) -> None"},
2586 {"InsetRgn", (PyCFunction)Qd_InsetRgn, 1,
2587 "(RgnHandle rgn, short dh, short dv) -> None"},
2588 {"SectRgn", (PyCFunction)Qd_SectRgn, 1,
2589 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2590 {"UnionRgn", (PyCFunction)Qd_UnionRgn, 1,
2591 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2592 {"DiffRgn", (PyCFunction)Qd_DiffRgn, 1,
2593 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2594 {"XorRgn", (PyCFunction)Qd_XorRgn, 1,
2595 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2596 {"RectInRgn", (PyCFunction)Qd_RectInRgn, 1,
2597 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
2598 {"EqualRgn", (PyCFunction)Qd_EqualRgn, 1,
2599 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
2600 {"EmptyRgn", (PyCFunction)Qd_EmptyRgn, 1,
2601 "(RgnHandle rgn) -> (Boolean _rv)"},
2602 {"FrameRgn", (PyCFunction)Qd_FrameRgn, 1,
2603 "(RgnHandle rgn) -> None"},
2604 {"PaintRgn", (PyCFunction)Qd_PaintRgn, 1,
2605 "(RgnHandle rgn) -> None"},
2606 {"EraseRgn", (PyCFunction)Qd_EraseRgn, 1,
2607 "(RgnHandle rgn) -> None"},
2608 {"InvertRgn", (PyCFunction)Qd_InvertRgn, 1,
2609 "(RgnHandle rgn) -> None"},
2610 {"ScrollRect", (PyCFunction)Qd_ScrollRect, 1,
2611 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
2612 {"OpenPicture", (PyCFunction)Qd_OpenPicture, 1,
2613 "(Rect picFrame) -> (PicHandle _rv)"},
2614 {"PicComment", (PyCFunction)Qd_PicComment, 1,
2615 "(short kind, short dataSize, Handle dataHandle) -> None"},
2616 {"ClosePicture", (PyCFunction)Qd_ClosePicture, 1,
2617 "() -> None"},
2618 {"DrawPicture", (PyCFunction)Qd_DrawPicture, 1,
2619 "(PicHandle myPicture, Rect dstRect) -> None"},
2620 {"KillPicture", (PyCFunction)Qd_KillPicture, 1,
2621 "(PicHandle myPicture) -> None"},
2622 {"OpenPoly", (PyCFunction)Qd_OpenPoly, 1,
2623 "() -> (PolyHandle _rv)"},
2624 {"ClosePoly", (PyCFunction)Qd_ClosePoly, 1,
2625 "() -> None"},
2626 {"KillPoly", (PyCFunction)Qd_KillPoly, 1,
2627 "(PolyHandle poly) -> None"},
2628 {"OffsetPoly", (PyCFunction)Qd_OffsetPoly, 1,
2629 "(PolyHandle poly, short dh, short dv) -> None"},
2630 {"FramePoly", (PyCFunction)Qd_FramePoly, 1,
2631 "(PolyHandle poly) -> None"},
2632 {"PaintPoly", (PyCFunction)Qd_PaintPoly, 1,
2633 "(PolyHandle poly) -> None"},
2634 {"ErasePoly", (PyCFunction)Qd_ErasePoly, 1,
2635 "(PolyHandle poly) -> None"},
2636 {"InvertPoly", (PyCFunction)Qd_InvertPoly, 1,
2637 "(PolyHandle poly) -> None"},
2638 {"SetPt", (PyCFunction)Qd_SetPt, 1,
2639 "(Point pt, short h, short v) -> (Point pt)"},
2640 {"LocalToGlobal", (PyCFunction)Qd_LocalToGlobal, 1,
2641 "(Point pt) -> (Point pt)"},
2642 {"GlobalToLocal", (PyCFunction)Qd_GlobalToLocal, 1,
2643 "(Point pt) -> (Point pt)"},
2644 {"Random", (PyCFunction)Qd_Random, 1,
2645 "() -> (short _rv)"},
2646 {"GetPixel", (PyCFunction)Qd_GetPixel, 1,
2647 "(short h, short v) -> (Boolean _rv)"},
2648 {"ScalePt", (PyCFunction)Qd_ScalePt, 1,
2649 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2650 {"MapPt", (PyCFunction)Qd_MapPt, 1,
2651 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2652 {"MapRect", (PyCFunction)Qd_MapRect, 1,
2653 "(Rect srcRect, Rect dstRect) -> (Rect r)"},
2654 {"MapRgn", (PyCFunction)Qd_MapRgn, 1,
2655 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
2656 {"MapPoly", (PyCFunction)Qd_MapPoly, 1,
2657 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
2658 {"AddPt", (PyCFunction)Qd_AddPt, 1,
2659 "(Point src, Point dst) -> (Point dst)"},
2660 {"EqualPt", (PyCFunction)Qd_EqualPt, 1,
2661 "(Point pt1, Point pt2) -> (Boolean _rv)"},
2662 {"PtInRect", (PyCFunction)Qd_PtInRect, 1,
2663 "(Point pt, Rect r) -> (Boolean _rv)"},
2664 {"Pt2Rect", (PyCFunction)Qd_Pt2Rect, 1,
2665 "(Point pt1, Point pt2) -> (Rect dstRect)"},
2666 {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1,
2667 "(Rect r, Point pt) -> (short angle)"},
2668 {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1,
2669 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
2670 {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1,
2671 "() -> (PixMapHandle _rv)"},
2672 {"DisposPixMap", (PyCFunction)Qd_DisposPixMap, 1,
2673 "(PixMapHandle pm) -> None"},
2674 {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1,
2675 "(PixMapHandle pm) -> None"},
2676 {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1,
2677 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
2678 {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1,
2679 "() -> (PixPatHandle _rv)"},
2680 {"DisposPixPat", (PyCFunction)Qd_DisposPixPat, 1,
2681 "(PixPatHandle pp) -> None"},
2682 {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1,
2683 "(PixPatHandle pp) -> None"},
2684 {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1,
2685 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
2686 {"PenPixPat", (PyCFunction)Qd_PenPixPat, 1,
2687 "(PixPatHandle pp) -> None"},
2688 {"BackPixPat", (PyCFunction)Qd_BackPixPat, 1,
2689 "(PixPatHandle pp) -> None"},
2690 {"GetPixPat", (PyCFunction)Qd_GetPixPat, 1,
2691 "(short patID) -> (PixPatHandle _rv)"},
2692 {"FillCRect", (PyCFunction)Qd_FillCRect, 1,
2693 "(Rect r, PixPatHandle pp) -> None"},
2694 {"FillCOval", (PyCFunction)Qd_FillCOval, 1,
2695 "(Rect r, PixPatHandle pp) -> None"},
2696 {"FillCRoundRect", (PyCFunction)Qd_FillCRoundRect, 1,
2697 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
2698 {"FillCArc", (PyCFunction)Qd_FillCArc, 1,
2699 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
2700 {"FillCRgn", (PyCFunction)Qd_FillCRgn, 1,
2701 "(RgnHandle rgn, PixPatHandle pp) -> None"},
2702 {"FillCPoly", (PyCFunction)Qd_FillCPoly, 1,
2703 "(PolyHandle poly, PixPatHandle pp) -> None"},
2704 {"SetPortPix", (PyCFunction)Qd_SetPortPix, 1,
2705 "(PixMapHandle pm) -> None"},
2706 {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1,
2707 "() -> None"},
2708 {"CharExtra", (PyCFunction)Qd_CharExtra, 1,
2709 "(long extra) -> None"},
2710 {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1,
2711 "() -> (long _rv)"},
2712 {"SubPt", (PyCFunction)Qd_SubPt, 1,
2713 "(Point src, Point dst) -> (Point dst)"},
2714 {"SetClientID", (PyCFunction)Qd_SetClientID, 1,
2715 "(short id) -> None"},
2716 {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1,
2717 "(short index, Boolean protect) -> None"},
2718 {"ReserveEntry", (PyCFunction)Qd_ReserveEntry, 1,
2719 "(short index, Boolean reserve) -> None"},
2720 {"QDError", (PyCFunction)Qd_QDError, 1,
2721 "() -> (short _rv)"},
2722 {NULL, NULL, 0}
2728 void initQd()
2730 PyObject *m;
2731 PyObject *d;
2736 m = Py_InitModule("Qd", Qd_methods);
2737 d = PyModule_GetDict(m);
2738 Qd_Error = PyMac_GetOSErrException();
2739 if (Qd_Error == NULL ||
2740 PyDict_SetItemString(d, "Error", Qd_Error) != 0)
2741 Py_FatalError("can't initialize Qd.Error");
2744 /* ========================= End module Qd ========================== */