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