2 /* =========================== Module _Qd =========================== */
9 #include "pymactoolbox.h"
11 /* Macro to test whether a weak-loaded CFM function exists */
12 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
13 PyErr_SetString(PyExc_NotImplementedError, \
14 "Not available in this shared library/OS version"); \
19 #include <Carbon/Carbon.h>
21 #ifdef USE_TOOLBOX_OBJECT_GLUE
22 extern PyObject
*_GrafObj_New(GrafPtr
);
23 extern int _GrafObj_Convert(PyObject
*, GrafPtr
*);
24 extern PyObject
*_BMObj_New(BitMapPtr
);
25 extern int _BMObj_Convert(PyObject
*, BitMapPtr
*);
26 extern PyObject
*_QdRGB_New(RGBColorPtr
);
27 extern int _QdRGB_Convert(PyObject
*, RGBColorPtr
);
29 #define GrafObj_New _GrafObj_New
30 #define GrafObj_Convert _GrafObj_Convert
31 #define BMObj_New _BMObj_New
32 #define BMObj_Convert _BMObj_Convert
33 #define QdRGB_New _QdRGB_New
34 #define QdRGB_Convert _QdRGB_Convert
37 static PyObject
*BMObj_NewCopied(BitMapPtr
);
40 ** Parse/generate RGB records
42 PyObject
*QdRGB_New(RGBColorPtr itself
)
45 return Py_BuildValue("lll", (long)itself
->red
, (long)itself
->green
, (long)itself
->blue
);
48 int QdRGB_Convert(PyObject
*v
, RGBColorPtr p_itself
)
50 long red
, green
, blue
;
52 if( !PyArg_ParseTuple(v
, "lll", &red
, &green
, &blue
) )
54 p_itself
->red
= (unsigned short)red
;
55 p_itself
->green
= (unsigned short)green
;
56 p_itself
->blue
= (unsigned short)blue
;
61 ** Generate FontInfo records
64 PyObject
*QdFI_New(FontInfo
*itself
)
67 return Py_BuildValue("hhhh", itself
->ascent
, itself
->descent
,
68 itself
->widMax
, itself
->leading
);
71 static PyObject
*Qd_Error
;
73 /* ---------------------- Object type GrafPort ---------------------- */
75 PyTypeObject GrafPort_Type
;
77 #define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
79 typedef struct GrafPortObject
{
84 PyObject
*GrafObj_New(GrafPtr itself
)
87 if (itself
== NULL
) return PyMac_Error(resNotFound
);
88 it
= PyObject_NEW(GrafPortObject
, &GrafPort_Type
);
89 if (it
== NULL
) return NULL
;
90 it
->ob_itself
= itself
;
91 return (PyObject
*)it
;
94 int GrafObj_Convert(PyObject
*v
, GrafPtr
*p_itself
)
99 if (WinObj_Convert(v
, &win
) && v
) {
100 *p_itself
= (GrafPtr
)GetWindowPort(win
);
106 if (DlgObj_Check(v
)) {
107 DialogRef dlg
= (DialogRef
)((GrafPortObject
*)v
)->ob_itself
;
108 *p_itself
= (GrafPtr
)GetWindowPort(GetDialogWindow(dlg
));
111 if (WinObj_Check(v
)) {
112 WindowRef win
= (WindowRef
)((GrafPortObject
*)v
)->ob_itself
;
113 *p_itself
= (GrafPtr
)GetWindowPort(win
);
117 if (!GrafObj_Check(v
))
119 PyErr_SetString(PyExc_TypeError
, "GrafPort required");
122 *p_itself
= ((GrafPortObject
*)v
)->ob_itself
;
126 static void GrafObj_dealloc(GrafPortObject
*self
)
128 /* Cleanup of self->ob_itself goes here */
129 self
->ob_type
->tp_free((PyObject
*)self
);
132 static PyObject
*GrafObj_MacSetPort(GrafPortObject
*_self
, PyObject
*_args
)
134 PyObject
*_res
= NULL
;
136 PyMac_PRECHECK(MacSetPort
);
138 if (!PyArg_ParseTuple(_args
, ""))
140 MacSetPort(_self
->ob_itself
);
146 static PyObject
*GrafObj_QDSwapPort(GrafPortObject
*_self
, PyObject
*_args
)
148 PyObject
*_res
= NULL
;
152 PyMac_PRECHECK(QDSwapPort
);
154 if (!PyArg_ParseTuple(_args
, ""))
156 _rv
= QDSwapPort(_self
->ob_itself
,
158 _res
= Py_BuildValue("bO&",
160 GrafObj_New
, outOldPort
);
164 static PyObject
*GrafObj_IsValidPort(GrafPortObject
*_self
, PyObject
*_args
)
166 PyObject
*_res
= NULL
;
169 PyMac_PRECHECK(IsValidPort
);
171 if (!PyArg_ParseTuple(_args
, ""))
173 _rv
= IsValidPort(_self
->ob_itself
);
174 _res
= Py_BuildValue("b",
179 static PyObject
*GrafObj_GetPortPixMap(GrafPortObject
*_self
, PyObject
*_args
)
181 PyObject
*_res
= NULL
;
183 #ifndef GetPortPixMap
184 PyMac_PRECHECK(GetPortPixMap
);
186 if (!PyArg_ParseTuple(_args
, ""))
188 _rv
= GetPortPixMap(_self
->ob_itself
);
189 _res
= Py_BuildValue("O&",
194 static PyObject
*GrafObj_GetPortBitMapForCopyBits(GrafPortObject
*_self
, PyObject
*_args
)
196 PyObject
*_res
= NULL
;
198 #ifndef GetPortBitMapForCopyBits
199 PyMac_PRECHECK(GetPortBitMapForCopyBits
);
201 if (!PyArg_ParseTuple(_args
, ""))
203 _rv
= GetPortBitMapForCopyBits(_self
->ob_itself
);
204 _res
= Py_BuildValue("O&",
209 static PyObject
*GrafObj_GetPortBounds(GrafPortObject
*_self
, PyObject
*_args
)
211 PyObject
*_res
= NULL
;
213 #ifndef GetPortBounds
214 PyMac_PRECHECK(GetPortBounds
);
216 if (!PyArg_ParseTuple(_args
, ""))
218 GetPortBounds(_self
->ob_itself
,
220 _res
= Py_BuildValue("O&",
221 PyMac_BuildRect
, &rect
);
225 static PyObject
*GrafObj_GetPortForeColor(GrafPortObject
*_self
, PyObject
*_args
)
227 PyObject
*_res
= NULL
;
229 #ifndef GetPortForeColor
230 PyMac_PRECHECK(GetPortForeColor
);
232 if (!PyArg_ParseTuple(_args
, ""))
234 GetPortForeColor(_self
->ob_itself
,
236 _res
= Py_BuildValue("O&",
237 QdRGB_New
, &foreColor
);
241 static PyObject
*GrafObj_GetPortBackColor(GrafPortObject
*_self
, PyObject
*_args
)
243 PyObject
*_res
= NULL
;
245 #ifndef GetPortBackColor
246 PyMac_PRECHECK(GetPortBackColor
);
248 if (!PyArg_ParseTuple(_args
, ""))
250 GetPortBackColor(_self
->ob_itself
,
252 _res
= Py_BuildValue("O&",
253 QdRGB_New
, &backColor
);
257 static PyObject
*GrafObj_GetPortOpColor(GrafPortObject
*_self
, PyObject
*_args
)
259 PyObject
*_res
= NULL
;
261 #ifndef GetPortOpColor
262 PyMac_PRECHECK(GetPortOpColor
);
264 if (!PyArg_ParseTuple(_args
, ""))
266 GetPortOpColor(_self
->ob_itself
,
268 _res
= Py_BuildValue("O&",
269 QdRGB_New
, &opColor
);
273 static PyObject
*GrafObj_GetPortHiliteColor(GrafPortObject
*_self
, PyObject
*_args
)
275 PyObject
*_res
= NULL
;
276 RGBColor hiliteColor
;
277 #ifndef GetPortHiliteColor
278 PyMac_PRECHECK(GetPortHiliteColor
);
280 if (!PyArg_ParseTuple(_args
, ""))
282 GetPortHiliteColor(_self
->ob_itself
,
284 _res
= Py_BuildValue("O&",
285 QdRGB_New
, &hiliteColor
);
289 static PyObject
*GrafObj_GetPortTextFont(GrafPortObject
*_self
, PyObject
*_args
)
291 PyObject
*_res
= NULL
;
293 #ifndef GetPortTextFont
294 PyMac_PRECHECK(GetPortTextFont
);
296 if (!PyArg_ParseTuple(_args
, ""))
298 _rv
= GetPortTextFont(_self
->ob_itself
);
299 _res
= Py_BuildValue("h",
304 static PyObject
*GrafObj_GetPortTextFace(GrafPortObject
*_self
, PyObject
*_args
)
306 PyObject
*_res
= NULL
;
308 #ifndef GetPortTextFace
309 PyMac_PRECHECK(GetPortTextFace
);
311 if (!PyArg_ParseTuple(_args
, ""))
313 _rv
= GetPortTextFace(_self
->ob_itself
);
314 _res
= Py_BuildValue("b",
319 static PyObject
*GrafObj_GetPortTextMode(GrafPortObject
*_self
, PyObject
*_args
)
321 PyObject
*_res
= NULL
;
323 #ifndef GetPortTextMode
324 PyMac_PRECHECK(GetPortTextMode
);
326 if (!PyArg_ParseTuple(_args
, ""))
328 _rv
= GetPortTextMode(_self
->ob_itself
);
329 _res
= Py_BuildValue("h",
334 static PyObject
*GrafObj_GetPortTextSize(GrafPortObject
*_self
, PyObject
*_args
)
336 PyObject
*_res
= NULL
;
338 #ifndef GetPortTextSize
339 PyMac_PRECHECK(GetPortTextSize
);
341 if (!PyArg_ParseTuple(_args
, ""))
343 _rv
= GetPortTextSize(_self
->ob_itself
);
344 _res
= Py_BuildValue("h",
349 static PyObject
*GrafObj_GetPortChExtra(GrafPortObject
*_self
, PyObject
*_args
)
351 PyObject
*_res
= NULL
;
353 #ifndef GetPortChExtra
354 PyMac_PRECHECK(GetPortChExtra
);
356 if (!PyArg_ParseTuple(_args
, ""))
358 _rv
= GetPortChExtra(_self
->ob_itself
);
359 _res
= Py_BuildValue("h",
364 static PyObject
*GrafObj_GetPortFracHPenLocation(GrafPortObject
*_self
, PyObject
*_args
)
366 PyObject
*_res
= NULL
;
368 #ifndef GetPortFracHPenLocation
369 PyMac_PRECHECK(GetPortFracHPenLocation
);
371 if (!PyArg_ParseTuple(_args
, ""))
373 _rv
= GetPortFracHPenLocation(_self
->ob_itself
);
374 _res
= Py_BuildValue("h",
379 static PyObject
*GrafObj_GetPortSpExtra(GrafPortObject
*_self
, PyObject
*_args
)
381 PyObject
*_res
= NULL
;
383 #ifndef GetPortSpExtra
384 PyMac_PRECHECK(GetPortSpExtra
);
386 if (!PyArg_ParseTuple(_args
, ""))
388 _rv
= GetPortSpExtra(_self
->ob_itself
);
389 _res
= Py_BuildValue("O&",
390 PyMac_BuildFixed
, _rv
);
394 static PyObject
*GrafObj_GetPortPenVisibility(GrafPortObject
*_self
, PyObject
*_args
)
396 PyObject
*_res
= NULL
;
398 #ifndef GetPortPenVisibility
399 PyMac_PRECHECK(GetPortPenVisibility
);
401 if (!PyArg_ParseTuple(_args
, ""))
403 _rv
= GetPortPenVisibility(_self
->ob_itself
);
404 _res
= Py_BuildValue("h",
409 static PyObject
*GrafObj_GetPortVisibleRegion(GrafPortObject
*_self
, PyObject
*_args
)
411 PyObject
*_res
= NULL
;
414 #ifndef GetPortVisibleRegion
415 PyMac_PRECHECK(GetPortVisibleRegion
);
417 if (!PyArg_ParseTuple(_args
, "O&",
418 ResObj_Convert
, &visRgn
))
420 _rv
= GetPortVisibleRegion(_self
->ob_itself
,
422 _res
= Py_BuildValue("O&",
427 static PyObject
*GrafObj_GetPortClipRegion(GrafPortObject
*_self
, PyObject
*_args
)
429 PyObject
*_res
= NULL
;
432 #ifndef GetPortClipRegion
433 PyMac_PRECHECK(GetPortClipRegion
);
435 if (!PyArg_ParseTuple(_args
, "O&",
436 ResObj_Convert
, &clipRgn
))
438 _rv
= GetPortClipRegion(_self
->ob_itself
,
440 _res
= Py_BuildValue("O&",
445 static PyObject
*GrafObj_GetPortBackPixPat(GrafPortObject
*_self
, PyObject
*_args
)
447 PyObject
*_res
= NULL
;
449 PixPatHandle backPattern
;
450 #ifndef GetPortBackPixPat
451 PyMac_PRECHECK(GetPortBackPixPat
);
453 if (!PyArg_ParseTuple(_args
, "O&",
454 ResObj_Convert
, &backPattern
))
456 _rv
= GetPortBackPixPat(_self
->ob_itself
,
458 _res
= Py_BuildValue("O&",
463 static PyObject
*GrafObj_GetPortPenPixPat(GrafPortObject
*_self
, PyObject
*_args
)
465 PyObject
*_res
= NULL
;
467 PixPatHandle penPattern
;
468 #ifndef GetPortPenPixPat
469 PyMac_PRECHECK(GetPortPenPixPat
);
471 if (!PyArg_ParseTuple(_args
, "O&",
472 ResObj_Convert
, &penPattern
))
474 _rv
= GetPortPenPixPat(_self
->ob_itself
,
476 _res
= Py_BuildValue("O&",
481 static PyObject
*GrafObj_GetPortFillPixPat(GrafPortObject
*_self
, PyObject
*_args
)
483 PyObject
*_res
= NULL
;
485 PixPatHandle fillPattern
;
486 #ifndef GetPortFillPixPat
487 PyMac_PRECHECK(GetPortFillPixPat
);
489 if (!PyArg_ParseTuple(_args
, "O&",
490 ResObj_Convert
, &fillPattern
))
492 _rv
= GetPortFillPixPat(_self
->ob_itself
,
494 _res
= Py_BuildValue("O&",
499 static PyObject
*GrafObj_GetPortPenSize(GrafPortObject
*_self
, PyObject
*_args
)
501 PyObject
*_res
= NULL
;
503 #ifndef GetPortPenSize
504 PyMac_PRECHECK(GetPortPenSize
);
506 if (!PyArg_ParseTuple(_args
, "O&",
507 PyMac_GetPoint
, &penSize
))
509 GetPortPenSize(_self
->ob_itself
,
511 _res
= Py_BuildValue("O&",
512 PyMac_BuildPoint
, penSize
);
516 static PyObject
*GrafObj_GetPortPenMode(GrafPortObject
*_self
, PyObject
*_args
)
518 PyObject
*_res
= NULL
;
520 #ifndef GetPortPenMode
521 PyMac_PRECHECK(GetPortPenMode
);
523 if (!PyArg_ParseTuple(_args
, ""))
525 _rv
= GetPortPenMode(_self
->ob_itself
);
526 _res
= Py_BuildValue("l",
531 static PyObject
*GrafObj_GetPortPenLocation(GrafPortObject
*_self
, PyObject
*_args
)
533 PyObject
*_res
= NULL
;
535 #ifndef GetPortPenLocation
536 PyMac_PRECHECK(GetPortPenLocation
);
538 if (!PyArg_ParseTuple(_args
, "O&",
539 PyMac_GetPoint
, &penLocation
))
541 GetPortPenLocation(_self
->ob_itself
,
543 _res
= Py_BuildValue("O&",
544 PyMac_BuildPoint
, penLocation
);
548 static PyObject
*GrafObj_IsPortRegionBeingDefined(GrafPortObject
*_self
, PyObject
*_args
)
550 PyObject
*_res
= NULL
;
552 #ifndef IsPortRegionBeingDefined
553 PyMac_PRECHECK(IsPortRegionBeingDefined
);
555 if (!PyArg_ParseTuple(_args
, ""))
557 _rv
= IsPortRegionBeingDefined(_self
->ob_itself
);
558 _res
= Py_BuildValue("b",
563 static PyObject
*GrafObj_IsPortPictureBeingDefined(GrafPortObject
*_self
, PyObject
*_args
)
565 PyObject
*_res
= NULL
;
567 #ifndef IsPortPictureBeingDefined
568 PyMac_PRECHECK(IsPortPictureBeingDefined
);
570 if (!PyArg_ParseTuple(_args
, ""))
572 _rv
= IsPortPictureBeingDefined(_self
->ob_itself
);
573 _res
= Py_BuildValue("b",
578 static PyObject
*GrafObj_IsPortPolyBeingDefined(GrafPortObject
*_self
, PyObject
*_args
)
580 PyObject
*_res
= NULL
;
582 #ifndef IsPortPolyBeingDefined
583 PyMac_PRECHECK(IsPortPolyBeingDefined
);
585 if (!PyArg_ParseTuple(_args
, ""))
587 _rv
= IsPortPolyBeingDefined(_self
->ob_itself
);
588 _res
= Py_BuildValue("b",
593 static PyObject
*GrafObj_IsPortOffscreen(GrafPortObject
*_self
, PyObject
*_args
)
595 PyObject
*_res
= NULL
;
597 #ifndef IsPortOffscreen
598 PyMac_PRECHECK(IsPortOffscreen
);
600 if (!PyArg_ParseTuple(_args
, ""))
602 _rv
= IsPortOffscreen(_self
->ob_itself
);
603 _res
= Py_BuildValue("b",
608 static PyObject
*GrafObj_IsPortColor(GrafPortObject
*_self
, PyObject
*_args
)
610 PyObject
*_res
= NULL
;
613 PyMac_PRECHECK(IsPortColor
);
615 if (!PyArg_ParseTuple(_args
, ""))
617 _rv
= IsPortColor(_self
->ob_itself
);
618 _res
= Py_BuildValue("b",
623 static PyObject
*GrafObj_IsPortVisibleRegionEmpty(GrafPortObject
*_self
, PyObject
*_args
)
625 PyObject
*_res
= NULL
;
627 #ifndef IsPortVisibleRegionEmpty
628 PyMac_PRECHECK(IsPortVisibleRegionEmpty
);
630 if (!PyArg_ParseTuple(_args
, ""))
632 _rv
= IsPortVisibleRegionEmpty(_self
->ob_itself
);
633 _res
= Py_BuildValue("b",
638 static PyObject
*GrafObj_IsPortClipRegionEmpty(GrafPortObject
*_self
, PyObject
*_args
)
640 PyObject
*_res
= NULL
;
642 #ifndef IsPortClipRegionEmpty
643 PyMac_PRECHECK(IsPortClipRegionEmpty
);
645 if (!PyArg_ParseTuple(_args
, ""))
647 _rv
= IsPortClipRegionEmpty(_self
->ob_itself
);
648 _res
= Py_BuildValue("b",
653 static PyObject
*GrafObj_SectRegionWithPortClipRegion(GrafPortObject
*_self
, PyObject
*_args
)
655 PyObject
*_res
= NULL
;
657 #ifndef SectRegionWithPortClipRegion
658 PyMac_PRECHECK(SectRegionWithPortClipRegion
);
660 if (!PyArg_ParseTuple(_args
, "O&",
661 ResObj_Convert
, &ioRegion
))
663 SectRegionWithPortClipRegion(_self
->ob_itself
,
670 static PyObject
*GrafObj_SectRegionWithPortVisibleRegion(GrafPortObject
*_self
, PyObject
*_args
)
672 PyObject
*_res
= NULL
;
674 #ifndef SectRegionWithPortVisibleRegion
675 PyMac_PRECHECK(SectRegionWithPortVisibleRegion
);
677 if (!PyArg_ParseTuple(_args
, "O&",
678 ResObj_Convert
, &ioRegion
))
680 SectRegionWithPortVisibleRegion(_self
->ob_itself
,
687 static PyObject
*GrafObj_SwapPortPicSaveHandle(GrafPortObject
*_self
, PyObject
*_args
)
689 PyObject
*_res
= NULL
;
692 #ifndef SwapPortPicSaveHandle
693 PyMac_PRECHECK(SwapPortPicSaveHandle
);
695 if (!PyArg_ParseTuple(_args
, "O&",
696 ResObj_Convert
, &inPicSaveHdl
))
698 _rv
= SwapPortPicSaveHandle(_self
->ob_itself
,
700 _res
= Py_BuildValue("O&",
705 static PyObject
*GrafObj_SwapPortPolySaveHandle(GrafPortObject
*_self
, PyObject
*_args
)
707 PyObject
*_res
= NULL
;
709 Handle inPolySaveHdl
;
710 #ifndef SwapPortPolySaveHandle
711 PyMac_PRECHECK(SwapPortPolySaveHandle
);
713 if (!PyArg_ParseTuple(_args
, "O&",
714 ResObj_Convert
, &inPolySaveHdl
))
716 _rv
= SwapPortPolySaveHandle(_self
->ob_itself
,
718 _res
= Py_BuildValue("O&",
723 static PyObject
*GrafObj_SwapPortRegionSaveHandle(GrafPortObject
*_self
, PyObject
*_args
)
725 PyObject
*_res
= NULL
;
727 Handle inRegionSaveHdl
;
728 #ifndef SwapPortRegionSaveHandle
729 PyMac_PRECHECK(SwapPortRegionSaveHandle
);
731 if (!PyArg_ParseTuple(_args
, "O&",
732 ResObj_Convert
, &inRegionSaveHdl
))
734 _rv
= SwapPortRegionSaveHandle(_self
->ob_itself
,
736 _res
= Py_BuildValue("O&",
741 static PyObject
*GrafObj_SetPortBounds(GrafPortObject
*_self
, PyObject
*_args
)
743 PyObject
*_res
= NULL
;
745 #ifndef SetPortBounds
746 PyMac_PRECHECK(SetPortBounds
);
748 if (!PyArg_ParseTuple(_args
, "O&",
749 PyMac_GetRect
, &rect
))
751 SetPortBounds(_self
->ob_itself
,
758 static PyObject
*GrafObj_SetPortOpColor(GrafPortObject
*_self
, PyObject
*_args
)
760 PyObject
*_res
= NULL
;
762 #ifndef SetPortOpColor
763 PyMac_PRECHECK(SetPortOpColor
);
765 if (!PyArg_ParseTuple(_args
, "O&",
766 QdRGB_Convert
, &opColor
))
768 SetPortOpColor(_self
->ob_itself
,
775 static PyObject
*GrafObj_SetPortTextFont(GrafPortObject
*_self
, PyObject
*_args
)
777 PyObject
*_res
= NULL
;
779 #ifndef SetPortTextFont
780 PyMac_PRECHECK(SetPortTextFont
);
782 if (!PyArg_ParseTuple(_args
, "h",
785 SetPortTextFont(_self
->ob_itself
,
792 static PyObject
*GrafObj_SetPortTextSize(GrafPortObject
*_self
, PyObject
*_args
)
794 PyObject
*_res
= NULL
;
796 #ifndef SetPortTextSize
797 PyMac_PRECHECK(SetPortTextSize
);
799 if (!PyArg_ParseTuple(_args
, "h",
802 SetPortTextSize(_self
->ob_itself
,
809 static PyObject
*GrafObj_SetPortTextFace(GrafPortObject
*_self
, PyObject
*_args
)
811 PyObject
*_res
= NULL
;
813 #ifndef SetPortTextFace
814 PyMac_PRECHECK(SetPortTextFace
);
816 if (!PyArg_ParseTuple(_args
, "h",
819 SetPortTextFace(_self
->ob_itself
,
826 static PyObject
*GrafObj_SetPortTextMode(GrafPortObject
*_self
, PyObject
*_args
)
828 PyObject
*_res
= NULL
;
830 #ifndef SetPortTextMode
831 PyMac_PRECHECK(SetPortTextMode
);
833 if (!PyArg_ParseTuple(_args
, "h",
836 SetPortTextMode(_self
->ob_itself
,
843 static PyObject
*GrafObj_SetPortVisibleRegion(GrafPortObject
*_self
, PyObject
*_args
)
845 PyObject
*_res
= NULL
;
847 #ifndef SetPortVisibleRegion
848 PyMac_PRECHECK(SetPortVisibleRegion
);
850 if (!PyArg_ParseTuple(_args
, "O&",
851 ResObj_Convert
, &visRgn
))
853 SetPortVisibleRegion(_self
->ob_itself
,
860 static PyObject
*GrafObj_SetPortClipRegion(GrafPortObject
*_self
, PyObject
*_args
)
862 PyObject
*_res
= NULL
;
864 #ifndef SetPortClipRegion
865 PyMac_PRECHECK(SetPortClipRegion
);
867 if (!PyArg_ParseTuple(_args
, "O&",
868 ResObj_Convert
, &clipRgn
))
870 SetPortClipRegion(_self
->ob_itself
,
877 static PyObject
*GrafObj_SetPortPenPixPat(GrafPortObject
*_self
, PyObject
*_args
)
879 PyObject
*_res
= NULL
;
880 PixPatHandle penPattern
;
881 #ifndef SetPortPenPixPat
882 PyMac_PRECHECK(SetPortPenPixPat
);
884 if (!PyArg_ParseTuple(_args
, "O&",
885 ResObj_Convert
, &penPattern
))
887 SetPortPenPixPat(_self
->ob_itself
,
894 static PyObject
*GrafObj_SetPortFillPixPat(GrafPortObject
*_self
, PyObject
*_args
)
896 PyObject
*_res
= NULL
;
897 PixPatHandle penPattern
;
898 #ifndef SetPortFillPixPat
899 PyMac_PRECHECK(SetPortFillPixPat
);
901 if (!PyArg_ParseTuple(_args
, "O&",
902 ResObj_Convert
, &penPattern
))
904 SetPortFillPixPat(_self
->ob_itself
,
911 static PyObject
*GrafObj_SetPortBackPixPat(GrafPortObject
*_self
, PyObject
*_args
)
913 PyObject
*_res
= NULL
;
914 PixPatHandle backPattern
;
915 #ifndef SetPortBackPixPat
916 PyMac_PRECHECK(SetPortBackPixPat
);
918 if (!PyArg_ParseTuple(_args
, "O&",
919 ResObj_Convert
, &backPattern
))
921 SetPortBackPixPat(_self
->ob_itself
,
928 static PyObject
*GrafObj_SetPortPenSize(GrafPortObject
*_self
, PyObject
*_args
)
930 PyObject
*_res
= NULL
;
932 #ifndef SetPortPenSize
933 PyMac_PRECHECK(SetPortPenSize
);
935 if (!PyArg_ParseTuple(_args
, "O&",
936 PyMac_GetPoint
, &penSize
))
938 SetPortPenSize(_self
->ob_itself
,
945 static PyObject
*GrafObj_SetPortPenMode(GrafPortObject
*_self
, PyObject
*_args
)
947 PyObject
*_res
= NULL
;
949 #ifndef SetPortPenMode
950 PyMac_PRECHECK(SetPortPenMode
);
952 if (!PyArg_ParseTuple(_args
, "l",
955 SetPortPenMode(_self
->ob_itself
,
962 static PyObject
*GrafObj_SetPortFracHPenLocation(GrafPortObject
*_self
, PyObject
*_args
)
964 PyObject
*_res
= NULL
;
966 #ifndef SetPortFracHPenLocation
967 PyMac_PRECHECK(SetPortFracHPenLocation
);
969 if (!PyArg_ParseTuple(_args
, "h",
972 SetPortFracHPenLocation(_self
->ob_itself
,
979 static PyObject
*GrafObj_DisposePort(GrafPortObject
*_self
, PyObject
*_args
)
981 PyObject
*_res
= NULL
;
983 PyMac_PRECHECK(DisposePort
);
985 if (!PyArg_ParseTuple(_args
, ""))
987 DisposePort(_self
->ob_itself
);
993 static PyObject
*GrafObj_QDLocalToGlobalPoint(GrafPortObject
*_self
, PyObject
*_args
)
995 PyObject
*_res
= NULL
;
997 #ifndef QDLocalToGlobalPoint
998 PyMac_PRECHECK(QDLocalToGlobalPoint
);
1000 if (!PyArg_ParseTuple(_args
, "O&",
1001 PyMac_GetPoint
, &point
))
1003 QDLocalToGlobalPoint(_self
->ob_itself
,
1005 _res
= Py_BuildValue("O&",
1006 PyMac_BuildPoint
, point
);
1010 static PyObject
*GrafObj_QDGlobalToLocalPoint(GrafPortObject
*_self
, PyObject
*_args
)
1012 PyObject
*_res
= NULL
;
1014 #ifndef QDGlobalToLocalPoint
1015 PyMac_PRECHECK(QDGlobalToLocalPoint
);
1017 if (!PyArg_ParseTuple(_args
, "O&",
1018 PyMac_GetPoint
, &point
))
1020 QDGlobalToLocalPoint(_self
->ob_itself
,
1022 _res
= Py_BuildValue("O&",
1023 PyMac_BuildPoint
, point
);
1027 static PyObject
*GrafObj_QDLocalToGlobalRect(GrafPortObject
*_self
, PyObject
*_args
)
1029 PyObject
*_res
= NULL
;
1031 #ifndef QDLocalToGlobalRect
1032 PyMac_PRECHECK(QDLocalToGlobalRect
);
1034 if (!PyArg_ParseTuple(_args
, ""))
1036 QDLocalToGlobalRect(_self
->ob_itself
,
1038 _res
= Py_BuildValue("O&",
1039 PyMac_BuildRect
, &bounds
);
1043 static PyObject
*GrafObj_QDGlobalToLocalRect(GrafPortObject
*_self
, PyObject
*_args
)
1045 PyObject
*_res
= NULL
;
1047 #ifndef QDGlobalToLocalRect
1048 PyMac_PRECHECK(QDGlobalToLocalRect
);
1050 if (!PyArg_ParseTuple(_args
, ""))
1052 QDGlobalToLocalRect(_self
->ob_itself
,
1054 _res
= Py_BuildValue("O&",
1055 PyMac_BuildRect
, &bounds
);
1059 static PyObject
*GrafObj_QDLocalToGlobalRegion(GrafPortObject
*_self
, PyObject
*_args
)
1061 PyObject
*_res
= NULL
;
1064 #ifndef QDLocalToGlobalRegion
1065 PyMac_PRECHECK(QDLocalToGlobalRegion
);
1067 if (!PyArg_ParseTuple(_args
, "O&",
1068 ResObj_Convert
, ®ion
))
1070 _rv
= QDLocalToGlobalRegion(_self
->ob_itself
,
1072 _res
= Py_BuildValue("O&",
1077 static PyObject
*GrafObj_QDGlobalToLocalRegion(GrafPortObject
*_self
, PyObject
*_args
)
1079 PyObject
*_res
= NULL
;
1082 #ifndef QDGlobalToLocalRegion
1083 PyMac_PRECHECK(QDGlobalToLocalRegion
);
1085 if (!PyArg_ParseTuple(_args
, "O&",
1086 ResObj_Convert
, ®ion
))
1088 _rv
= QDGlobalToLocalRegion(_self
->ob_itself
,
1090 _res
= Py_BuildValue("O&",
1095 static PyObject
*GrafObj_QDIsPortBuffered(GrafPortObject
*_self
, PyObject
*_args
)
1097 PyObject
*_res
= NULL
;
1099 #ifndef QDIsPortBuffered
1100 PyMac_PRECHECK(QDIsPortBuffered
);
1102 if (!PyArg_ParseTuple(_args
, ""))
1104 _rv
= QDIsPortBuffered(_self
->ob_itself
);
1105 _res
= Py_BuildValue("b",
1110 static PyObject
*GrafObj_QDIsPortBufferDirty(GrafPortObject
*_self
, PyObject
*_args
)
1112 PyObject
*_res
= NULL
;
1114 #ifndef QDIsPortBufferDirty
1115 PyMac_PRECHECK(QDIsPortBufferDirty
);
1117 if (!PyArg_ParseTuple(_args
, ""))
1119 _rv
= QDIsPortBufferDirty(_self
->ob_itself
);
1120 _res
= Py_BuildValue("b",
1125 static PyObject
*GrafObj_QDFlushPortBuffer(GrafPortObject
*_self
, PyObject
*_args
)
1127 PyObject
*_res
= NULL
;
1129 #ifndef QDFlushPortBuffer
1130 PyMac_PRECHECK(QDFlushPortBuffer
);
1132 if (!PyArg_ParseTuple(_args
, "O&",
1133 OptResObj_Convert
, ®ion
))
1135 QDFlushPortBuffer(_self
->ob_itself
,
1142 static PyObject
*GrafObj_QDGetDirtyRegion(GrafPortObject
*_self
, PyObject
*_args
)
1144 PyObject
*_res
= NULL
;
1147 #ifndef QDGetDirtyRegion
1148 PyMac_PRECHECK(QDGetDirtyRegion
);
1150 if (!PyArg_ParseTuple(_args
, "O&",
1151 ResObj_Convert
, &rgn
))
1153 _err
= QDGetDirtyRegion(_self
->ob_itself
,
1155 if (_err
!= noErr
) return PyMac_Error(_err
);
1161 static PyObject
*GrafObj_QDSetDirtyRegion(GrafPortObject
*_self
, PyObject
*_args
)
1163 PyObject
*_res
= NULL
;
1166 #ifndef QDSetDirtyRegion
1167 PyMac_PRECHECK(QDSetDirtyRegion
);
1169 if (!PyArg_ParseTuple(_args
, "O&",
1170 ResObj_Convert
, &rgn
))
1172 _err
= QDSetDirtyRegion(_self
->ob_itself
,
1174 if (_err
!= noErr
) return PyMac_Error(_err
);
1180 static PyMethodDef GrafObj_methods
[] = {
1181 {"MacSetPort", (PyCFunction
)GrafObj_MacSetPort
, 1,
1182 PyDoc_STR("() -> None")},
1183 {"QDSwapPort", (PyCFunction
)GrafObj_QDSwapPort
, 1,
1184 PyDoc_STR("() -> (Boolean _rv, CGrafPtr outOldPort)")},
1185 {"IsValidPort", (PyCFunction
)GrafObj_IsValidPort
, 1,
1186 PyDoc_STR("() -> (Boolean _rv)")},
1187 {"GetPortPixMap", (PyCFunction
)GrafObj_GetPortPixMap
, 1,
1188 PyDoc_STR("() -> (PixMapHandle _rv)")},
1189 {"GetPortBitMapForCopyBits", (PyCFunction
)GrafObj_GetPortBitMapForCopyBits
, 1,
1190 PyDoc_STR("() -> (const BitMap * _rv)")},
1191 {"GetPortBounds", (PyCFunction
)GrafObj_GetPortBounds
, 1,
1192 PyDoc_STR("() -> (Rect rect)")},
1193 {"GetPortForeColor", (PyCFunction
)GrafObj_GetPortForeColor
, 1,
1194 PyDoc_STR("() -> (RGBColor foreColor)")},
1195 {"GetPortBackColor", (PyCFunction
)GrafObj_GetPortBackColor
, 1,
1196 PyDoc_STR("() -> (RGBColor backColor)")},
1197 {"GetPortOpColor", (PyCFunction
)GrafObj_GetPortOpColor
, 1,
1198 PyDoc_STR("() -> (RGBColor opColor)")},
1199 {"GetPortHiliteColor", (PyCFunction
)GrafObj_GetPortHiliteColor
, 1,
1200 PyDoc_STR("() -> (RGBColor hiliteColor)")},
1201 {"GetPortTextFont", (PyCFunction
)GrafObj_GetPortTextFont
, 1,
1202 PyDoc_STR("() -> (short _rv)")},
1203 {"GetPortTextFace", (PyCFunction
)GrafObj_GetPortTextFace
, 1,
1204 PyDoc_STR("() -> (Style _rv)")},
1205 {"GetPortTextMode", (PyCFunction
)GrafObj_GetPortTextMode
, 1,
1206 PyDoc_STR("() -> (short _rv)")},
1207 {"GetPortTextSize", (PyCFunction
)GrafObj_GetPortTextSize
, 1,
1208 PyDoc_STR("() -> (short _rv)")},
1209 {"GetPortChExtra", (PyCFunction
)GrafObj_GetPortChExtra
, 1,
1210 PyDoc_STR("() -> (short _rv)")},
1211 {"GetPortFracHPenLocation", (PyCFunction
)GrafObj_GetPortFracHPenLocation
, 1,
1212 PyDoc_STR("() -> (short _rv)")},
1213 {"GetPortSpExtra", (PyCFunction
)GrafObj_GetPortSpExtra
, 1,
1214 PyDoc_STR("() -> (Fixed _rv)")},
1215 {"GetPortPenVisibility", (PyCFunction
)GrafObj_GetPortPenVisibility
, 1,
1216 PyDoc_STR("() -> (short _rv)")},
1217 {"GetPortVisibleRegion", (PyCFunction
)GrafObj_GetPortVisibleRegion
, 1,
1218 PyDoc_STR("(RgnHandle visRgn) -> (RgnHandle _rv)")},
1219 {"GetPortClipRegion", (PyCFunction
)GrafObj_GetPortClipRegion
, 1,
1220 PyDoc_STR("(RgnHandle clipRgn) -> (RgnHandle _rv)")},
1221 {"GetPortBackPixPat", (PyCFunction
)GrafObj_GetPortBackPixPat
, 1,
1222 PyDoc_STR("(PixPatHandle backPattern) -> (PixPatHandle _rv)")},
1223 {"GetPortPenPixPat", (PyCFunction
)GrafObj_GetPortPenPixPat
, 1,
1224 PyDoc_STR("(PixPatHandle penPattern) -> (PixPatHandle _rv)")},
1225 {"GetPortFillPixPat", (PyCFunction
)GrafObj_GetPortFillPixPat
, 1,
1226 PyDoc_STR("(PixPatHandle fillPattern) -> (PixPatHandle _rv)")},
1227 {"GetPortPenSize", (PyCFunction
)GrafObj_GetPortPenSize
, 1,
1228 PyDoc_STR("(Point penSize) -> (Point penSize)")},
1229 {"GetPortPenMode", (PyCFunction
)GrafObj_GetPortPenMode
, 1,
1230 PyDoc_STR("() -> (SInt32 _rv)")},
1231 {"GetPortPenLocation", (PyCFunction
)GrafObj_GetPortPenLocation
, 1,
1232 PyDoc_STR("(Point penLocation) -> (Point penLocation)")},
1233 {"IsPortRegionBeingDefined", (PyCFunction
)GrafObj_IsPortRegionBeingDefined
, 1,
1234 PyDoc_STR("() -> (Boolean _rv)")},
1235 {"IsPortPictureBeingDefined", (PyCFunction
)GrafObj_IsPortPictureBeingDefined
, 1,
1236 PyDoc_STR("() -> (Boolean _rv)")},
1237 {"IsPortPolyBeingDefined", (PyCFunction
)GrafObj_IsPortPolyBeingDefined
, 1,
1238 PyDoc_STR("() -> (Boolean _rv)")},
1239 {"IsPortOffscreen", (PyCFunction
)GrafObj_IsPortOffscreen
, 1,
1240 PyDoc_STR("() -> (Boolean _rv)")},
1241 {"IsPortColor", (PyCFunction
)GrafObj_IsPortColor
, 1,
1242 PyDoc_STR("() -> (Boolean _rv)")},
1243 {"IsPortVisibleRegionEmpty", (PyCFunction
)GrafObj_IsPortVisibleRegionEmpty
, 1,
1244 PyDoc_STR("() -> (Boolean _rv)")},
1245 {"IsPortClipRegionEmpty", (PyCFunction
)GrafObj_IsPortClipRegionEmpty
, 1,
1246 PyDoc_STR("() -> (Boolean _rv)")},
1247 {"SectRegionWithPortClipRegion", (PyCFunction
)GrafObj_SectRegionWithPortClipRegion
, 1,
1248 PyDoc_STR("(RgnHandle ioRegion) -> None")},
1249 {"SectRegionWithPortVisibleRegion", (PyCFunction
)GrafObj_SectRegionWithPortVisibleRegion
, 1,
1250 PyDoc_STR("(RgnHandle ioRegion) -> None")},
1251 {"SwapPortPicSaveHandle", (PyCFunction
)GrafObj_SwapPortPicSaveHandle
, 1,
1252 PyDoc_STR("(Handle inPicSaveHdl) -> (Handle _rv)")},
1253 {"SwapPortPolySaveHandle", (PyCFunction
)GrafObj_SwapPortPolySaveHandle
, 1,
1254 PyDoc_STR("(Handle inPolySaveHdl) -> (Handle _rv)")},
1255 {"SwapPortRegionSaveHandle", (PyCFunction
)GrafObj_SwapPortRegionSaveHandle
, 1,
1256 PyDoc_STR("(Handle inRegionSaveHdl) -> (Handle _rv)")},
1257 {"SetPortBounds", (PyCFunction
)GrafObj_SetPortBounds
, 1,
1258 PyDoc_STR("(Rect rect) -> None")},
1259 {"SetPortOpColor", (PyCFunction
)GrafObj_SetPortOpColor
, 1,
1260 PyDoc_STR("(RGBColor opColor) -> None")},
1261 {"SetPortTextFont", (PyCFunction
)GrafObj_SetPortTextFont
, 1,
1262 PyDoc_STR("(short txFont) -> None")},
1263 {"SetPortTextSize", (PyCFunction
)GrafObj_SetPortTextSize
, 1,
1264 PyDoc_STR("(short txSize) -> None")},
1265 {"SetPortTextFace", (PyCFunction
)GrafObj_SetPortTextFace
, 1,
1266 PyDoc_STR("(StyleParameter face) -> None")},
1267 {"SetPortTextMode", (PyCFunction
)GrafObj_SetPortTextMode
, 1,
1268 PyDoc_STR("(short mode) -> None")},
1269 {"SetPortVisibleRegion", (PyCFunction
)GrafObj_SetPortVisibleRegion
, 1,
1270 PyDoc_STR("(RgnHandle visRgn) -> None")},
1271 {"SetPortClipRegion", (PyCFunction
)GrafObj_SetPortClipRegion
, 1,
1272 PyDoc_STR("(RgnHandle clipRgn) -> None")},
1273 {"SetPortPenPixPat", (PyCFunction
)GrafObj_SetPortPenPixPat
, 1,
1274 PyDoc_STR("(PixPatHandle penPattern) -> None")},
1275 {"SetPortFillPixPat", (PyCFunction
)GrafObj_SetPortFillPixPat
, 1,
1276 PyDoc_STR("(PixPatHandle penPattern) -> None")},
1277 {"SetPortBackPixPat", (PyCFunction
)GrafObj_SetPortBackPixPat
, 1,
1278 PyDoc_STR("(PixPatHandle backPattern) -> None")},
1279 {"SetPortPenSize", (PyCFunction
)GrafObj_SetPortPenSize
, 1,
1280 PyDoc_STR("(Point penSize) -> None")},
1281 {"SetPortPenMode", (PyCFunction
)GrafObj_SetPortPenMode
, 1,
1282 PyDoc_STR("(SInt32 penMode) -> None")},
1283 {"SetPortFracHPenLocation", (PyCFunction
)GrafObj_SetPortFracHPenLocation
, 1,
1284 PyDoc_STR("(short pnLocHFrac) -> None")},
1285 {"DisposePort", (PyCFunction
)GrafObj_DisposePort
, 1,
1286 PyDoc_STR("() -> None")},
1287 {"QDLocalToGlobalPoint", (PyCFunction
)GrafObj_QDLocalToGlobalPoint
, 1,
1288 PyDoc_STR("(Point point) -> (Point point)")},
1289 {"QDGlobalToLocalPoint", (PyCFunction
)GrafObj_QDGlobalToLocalPoint
, 1,
1290 PyDoc_STR("(Point point) -> (Point point)")},
1291 {"QDLocalToGlobalRect", (PyCFunction
)GrafObj_QDLocalToGlobalRect
, 1,
1292 PyDoc_STR("() -> (Rect bounds)")},
1293 {"QDGlobalToLocalRect", (PyCFunction
)GrafObj_QDGlobalToLocalRect
, 1,
1294 PyDoc_STR("() -> (Rect bounds)")},
1295 {"QDLocalToGlobalRegion", (PyCFunction
)GrafObj_QDLocalToGlobalRegion
, 1,
1296 PyDoc_STR("(RgnHandle region) -> (RgnHandle _rv)")},
1297 {"QDGlobalToLocalRegion", (PyCFunction
)GrafObj_QDGlobalToLocalRegion
, 1,
1298 PyDoc_STR("(RgnHandle region) -> (RgnHandle _rv)")},
1299 {"QDIsPortBuffered", (PyCFunction
)GrafObj_QDIsPortBuffered
, 1,
1300 PyDoc_STR("() -> (Boolean _rv)")},
1301 {"QDIsPortBufferDirty", (PyCFunction
)GrafObj_QDIsPortBufferDirty
, 1,
1302 PyDoc_STR("() -> (Boolean _rv)")},
1303 {"QDFlushPortBuffer", (PyCFunction
)GrafObj_QDFlushPortBuffer
, 1,
1304 PyDoc_STR("(RgnHandle region) -> None")},
1305 {"QDGetDirtyRegion", (PyCFunction
)GrafObj_QDGetDirtyRegion
, 1,
1306 PyDoc_STR("(RgnHandle rgn) -> None")},
1307 {"QDSetDirtyRegion", (PyCFunction
)GrafObj_QDSetDirtyRegion
, 1,
1308 PyDoc_STR("(RgnHandle rgn) -> None")},
1312 static PyObject
*GrafObj_get_visRgn(GrafPortObject
*self
, void *closure
)
1314 RgnHandle h
=NewRgn(); /* XXXX wrong dispose routine */
1315 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortVisibleRegion(self
->ob_itself
, h
));
1319 #define GrafObj_set_visRgn NULL
1321 static PyObject
*GrafObj_get_clipRgn(GrafPortObject
*self
, void *closure
)
1323 RgnHandle h
=NewRgn(); /* XXXX wrong dispose routine */
1324 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortClipRegion(self
->ob_itself
, h
));
1328 #define GrafObj_set_clipRgn NULL
1330 static PyGetSetDef GrafObj_getsetlist
[] = {
1331 {"visRgn", (getter
)GrafObj_get_visRgn
, (setter
)GrafObj_set_visRgn
, "Convenience attribute: return a copy of the visible region"},
1332 {"clipRgn", (getter
)GrafObj_get_clipRgn
, (setter
)GrafObj_set_clipRgn
, "Convenience attribute: return a copy of the clipping region"},
1333 {NULL
, NULL
, NULL
, NULL
},
1337 #define GrafObj_compare NULL
1339 #define GrafObj_repr NULL
1341 #define GrafObj_hash NULL
1342 #define GrafObj_tp_init 0
1344 #define GrafObj_tp_alloc PyType_GenericAlloc
1346 static PyObject
*GrafObj_tp_new(PyTypeObject
*type
, PyObject
*_args
, PyObject
*_kwds
)
1350 char *kw
[] = {"itself", 0};
1352 if (!PyArg_ParseTupleAndKeywords(_args
, _kwds
, "O&", kw
, GrafObj_Convert
, &itself
)) return NULL
;
1353 if ((_self
= type
->tp_alloc(type
, 0)) == NULL
) return NULL
;
1354 ((GrafPortObject
*)_self
)->ob_itself
= itself
;
1358 #define GrafObj_tp_free PyObject_Del
1361 PyTypeObject GrafPort_Type
= {
1362 PyObject_HEAD_INIT(NULL
)
1364 "_Qd.GrafPort", /*tp_name*/
1365 sizeof(GrafPortObject
), /*tp_basicsize*/
1368 (destructor
) GrafObj_dealloc
, /*tp_dealloc*/
1370 (getattrfunc
)0, /*tp_getattr*/
1371 (setattrfunc
)0, /*tp_setattr*/
1372 (cmpfunc
) GrafObj_compare
, /*tp_compare*/
1373 (reprfunc
) GrafObj_repr
, /*tp_repr*/
1374 (PyNumberMethods
*)0, /* tp_as_number */
1375 (PySequenceMethods
*)0, /* tp_as_sequence */
1376 (PyMappingMethods
*)0, /* tp_as_mapping */
1377 (hashfunc
) GrafObj_hash
, /*tp_hash*/
1380 PyObject_GenericGetAttr
, /*tp_getattro*/
1381 PyObject_GenericSetAttr
, /*tp_setattro */
1383 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_BASETYPE
, /* tp_flags */
1387 0, /*tp_richcompare*/
1388 0, /*tp_weaklistoffset*/
1391 GrafObj_methods
, /* tp_methods */
1393 GrafObj_getsetlist
, /*tp_getset*/
1398 0, /*tp_dictoffset*/
1399 GrafObj_tp_init
, /* tp_init */
1400 GrafObj_tp_alloc
, /* tp_alloc */
1401 GrafObj_tp_new
, /* tp_new */
1402 GrafObj_tp_free
, /* tp_free */
1405 /* -------------------- End object type GrafPort -------------------- */
1408 /* ----------------------- Object type BitMap ----------------------- */
1410 PyTypeObject BitMap_Type
;
1412 #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
1414 typedef struct BitMapObject
{
1416 BitMapPtr ob_itself
;
1417 PyObject
*referred_object
;
1418 BitMap
*referred_bitmap
;
1421 PyObject
*BMObj_New(BitMapPtr itself
)
1424 if (itself
== NULL
) return PyMac_Error(resNotFound
);
1425 it
= PyObject_NEW(BitMapObject
, &BitMap_Type
);
1426 if (it
== NULL
) return NULL
;
1427 it
->ob_itself
= itself
;
1428 it
->referred_object
= NULL
;
1429 it
->referred_bitmap
= NULL
;
1430 return (PyObject
*)it
;
1433 int BMObj_Convert(PyObject
*v
, BitMapPtr
*p_itself
)
1435 if (!BMObj_Check(v
))
1437 PyErr_SetString(PyExc_TypeError
, "BitMap required");
1440 *p_itself
= ((BitMapObject
*)v
)->ob_itself
;
1444 static void BMObj_dealloc(BitMapObject
*self
)
1446 Py_XDECREF(self
->referred_object
);
1447 if (self
->referred_bitmap
) free(self
->referred_bitmap
);
1448 self
->ob_type
->tp_free((PyObject
*)self
);
1451 static PyObject
*BMObj_getdata(BitMapObject
*_self
, PyObject
*_args
)
1453 PyObject
*_res
= NULL
;
1458 if ( !PyArg_ParseTuple(_args
, "ii", &from
, &length
) )
1460 cp
= _self
->ob_itself
->baseAddr
+from
;
1461 _res
= PyString_FromStringAndSize(cp
, length
);
1466 static PyObject
*BMObj_putdata(BitMapObject
*_self
, PyObject
*_args
)
1468 PyObject
*_res
= NULL
;
1473 if ( !PyArg_ParseTuple(_args
, "is#", &from
, &icp
, &length
) )
1475 cp
= _self
->ob_itself
->baseAddr
+from
;
1476 memcpy(cp
, icp
, length
);
1483 static PyMethodDef BMObj_methods
[] = {
1484 {"getdata", (PyCFunction
)BMObj_getdata
, 1,
1485 PyDoc_STR("(int start, int size) -> string. Return bytes from the bitmap")},
1486 {"putdata", (PyCFunction
)BMObj_putdata
, 1,
1487 PyDoc_STR("(int start, string data). Store bytes into the bitmap")},
1491 static PyObject
*BMObj_get_baseAddr(BitMapObject
*self
, void *closure
)
1493 return PyInt_FromLong((long)self
->ob_itself
->baseAddr
);
1496 #define BMObj_set_baseAddr NULL
1498 static PyObject
*BMObj_get_rowBytes(BitMapObject
*self
, void *closure
)
1500 return PyInt_FromLong((long)self
->ob_itself
->rowBytes
);
1503 #define BMObj_set_rowBytes NULL
1505 static PyObject
*BMObj_get_bounds(BitMapObject
*self
, void *closure
)
1507 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->bounds
);
1510 #define BMObj_set_bounds NULL
1512 static PyObject
*BMObj_get_bitmap_data(BitMapObject
*self
, void *closure
)
1514 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(BitMap
));
1517 #define BMObj_set_bitmap_data NULL
1519 static PyObject
*BMObj_get_pixmap_data(BitMapObject
*self
, void *closure
)
1521 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(PixMap
));
1524 #define BMObj_set_pixmap_data NULL
1526 static PyGetSetDef BMObj_getsetlist
[] = {
1527 {"baseAddr", (getter
)BMObj_get_baseAddr
, (setter
)BMObj_set_baseAddr
, NULL
},
1528 {"rowBytes", (getter
)BMObj_get_rowBytes
, (setter
)BMObj_set_rowBytes
, NULL
},
1529 {"bounds", (getter
)BMObj_get_bounds
, (setter
)BMObj_set_bounds
, NULL
},
1530 {"bitmap_data", (getter
)BMObj_get_bitmap_data
, (setter
)BMObj_set_bitmap_data
, NULL
},
1531 {"pixmap_data", (getter
)BMObj_get_pixmap_data
, (setter
)BMObj_set_pixmap_data
, NULL
},
1532 {NULL
, NULL
, NULL
, NULL
},
1536 #define BMObj_compare NULL
1538 #define BMObj_repr NULL
1540 #define BMObj_hash NULL
1541 #define BMObj_tp_init 0
1543 #define BMObj_tp_alloc PyType_GenericAlloc
1545 static PyObject
*BMObj_tp_new(PyTypeObject
*type
, PyObject
*_args
, PyObject
*_kwds
)
1549 char *kw
[] = {"itself", 0};
1551 if (!PyArg_ParseTupleAndKeywords(_args
, _kwds
, "O&", kw
, BMObj_Convert
, &itself
)) return NULL
;
1552 if ((_self
= type
->tp_alloc(type
, 0)) == NULL
) return NULL
;
1553 ((BitMapObject
*)_self
)->ob_itself
= itself
;
1557 #define BMObj_tp_free PyObject_Del
1560 PyTypeObject BitMap_Type
= {
1561 PyObject_HEAD_INIT(NULL
)
1563 "_Qd.BitMap", /*tp_name*/
1564 sizeof(BitMapObject
), /*tp_basicsize*/
1567 (destructor
) BMObj_dealloc
, /*tp_dealloc*/
1569 (getattrfunc
)0, /*tp_getattr*/
1570 (setattrfunc
)0, /*tp_setattr*/
1571 (cmpfunc
) BMObj_compare
, /*tp_compare*/
1572 (reprfunc
) BMObj_repr
, /*tp_repr*/
1573 (PyNumberMethods
*)0, /* tp_as_number */
1574 (PySequenceMethods
*)0, /* tp_as_sequence */
1575 (PyMappingMethods
*)0, /* tp_as_mapping */
1576 (hashfunc
) BMObj_hash
, /*tp_hash*/
1579 PyObject_GenericGetAttr
, /*tp_getattro*/
1580 PyObject_GenericSetAttr
, /*tp_setattro */
1582 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_BASETYPE
, /* tp_flags */
1586 0, /*tp_richcompare*/
1587 0, /*tp_weaklistoffset*/
1590 BMObj_methods
, /* tp_methods */
1592 BMObj_getsetlist
, /*tp_getset*/
1597 0, /*tp_dictoffset*/
1598 BMObj_tp_init
, /* tp_init */
1599 BMObj_tp_alloc
, /* tp_alloc */
1600 BMObj_tp_new
, /* tp_new */
1601 BMObj_tp_free
, /* tp_free */
1604 /* --------------------- End object type BitMap --------------------- */
1607 static PyObject
*Qd_GetPort(PyObject
*_self
, PyObject
*_args
)
1609 PyObject
*_res
= NULL
;
1612 PyMac_PRECHECK(GetPort
);
1614 if (!PyArg_ParseTuple(_args
, ""))
1617 _res
= Py_BuildValue("O&",
1622 static PyObject
*Qd_GrafDevice(PyObject
*_self
, PyObject
*_args
)
1624 PyObject
*_res
= NULL
;
1627 PyMac_PRECHECK(GrafDevice
);
1629 if (!PyArg_ParseTuple(_args
, "h",
1638 static PyObject
*Qd_SetPortBits(PyObject
*_self
, PyObject
*_args
)
1640 PyObject
*_res
= NULL
;
1643 PyMac_PRECHECK(SetPortBits
);
1645 if (!PyArg_ParseTuple(_args
, "O&",
1646 BMObj_Convert
, &bm
))
1654 static PyObject
*Qd_PortSize(PyObject
*_self
, PyObject
*_args
)
1656 PyObject
*_res
= NULL
;
1660 PyMac_PRECHECK(PortSize
);
1662 if (!PyArg_ParseTuple(_args
, "hh",
1673 static PyObject
*Qd_MovePortTo(PyObject
*_self
, PyObject
*_args
)
1675 PyObject
*_res
= NULL
;
1679 PyMac_PRECHECK(MovePortTo
);
1681 if (!PyArg_ParseTuple(_args
, "hh",
1685 MovePortTo(leftGlobal
,
1692 static PyObject
*Qd_SetOrigin(PyObject
*_self
, PyObject
*_args
)
1694 PyObject
*_res
= NULL
;
1698 PyMac_PRECHECK(SetOrigin
);
1700 if (!PyArg_ParseTuple(_args
, "hh",
1711 static PyObject
*Qd_SetClip(PyObject
*_self
, PyObject
*_args
)
1713 PyObject
*_res
= NULL
;
1716 PyMac_PRECHECK(SetClip
);
1718 if (!PyArg_ParseTuple(_args
, "O&",
1719 ResObj_Convert
, &rgn
))
1727 static PyObject
*Qd_GetClip(PyObject
*_self
, PyObject
*_args
)
1729 PyObject
*_res
= NULL
;
1732 PyMac_PRECHECK(GetClip
);
1734 if (!PyArg_ParseTuple(_args
, "O&",
1735 ResObj_Convert
, &rgn
))
1743 static PyObject
*Qd_ClipRect(PyObject
*_self
, PyObject
*_args
)
1745 PyObject
*_res
= NULL
;
1748 PyMac_PRECHECK(ClipRect
);
1750 if (!PyArg_ParseTuple(_args
, "O&",
1759 static PyObject
*Qd_BackPat(PyObject
*_self
, PyObject
*_args
)
1761 PyObject
*_res
= NULL
;
1765 PyMac_PRECHECK(BackPat
);
1767 if (!PyArg_ParseTuple(_args
, "s#",
1768 (char **)&pat__in__
, &pat__in_len__
))
1770 if (pat__in_len__
!= sizeof(Pattern
))
1772 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1782 static PyObject
*Qd_InitCursor(PyObject
*_self
, PyObject
*_args
)
1784 PyObject
*_res
= NULL
;
1786 PyMac_PRECHECK(InitCursor
);
1788 if (!PyArg_ParseTuple(_args
, ""))
1796 static PyObject
*Qd_MacSetCursor(PyObject
*_self
, PyObject
*_args
)
1798 PyObject
*_res
= NULL
;
1801 #ifndef MacSetCursor
1802 PyMac_PRECHECK(MacSetCursor
);
1804 if (!PyArg_ParseTuple(_args
, "s#",
1805 (char **)&crsr__in__
, &crsr__in_len__
))
1807 if (crsr__in_len__
!= sizeof(Cursor
))
1809 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
1812 MacSetCursor(crsr__in__
);
1819 static PyObject
*Qd_HideCursor(PyObject
*_self
, PyObject
*_args
)
1821 PyObject
*_res
= NULL
;
1823 PyMac_PRECHECK(HideCursor
);
1825 if (!PyArg_ParseTuple(_args
, ""))
1833 static PyObject
*Qd_MacShowCursor(PyObject
*_self
, PyObject
*_args
)
1835 PyObject
*_res
= NULL
;
1836 #ifndef MacShowCursor
1837 PyMac_PRECHECK(MacShowCursor
);
1839 if (!PyArg_ParseTuple(_args
, ""))
1847 static PyObject
*Qd_ObscureCursor(PyObject
*_self
, PyObject
*_args
)
1849 PyObject
*_res
= NULL
;
1850 #ifndef ObscureCursor
1851 PyMac_PRECHECK(ObscureCursor
);
1853 if (!PyArg_ParseTuple(_args
, ""))
1861 static PyObject
*Qd_HidePen(PyObject
*_self
, PyObject
*_args
)
1863 PyObject
*_res
= NULL
;
1865 PyMac_PRECHECK(HidePen
);
1867 if (!PyArg_ParseTuple(_args
, ""))
1875 static PyObject
*Qd_ShowPen(PyObject
*_self
, PyObject
*_args
)
1877 PyObject
*_res
= NULL
;
1879 PyMac_PRECHECK(ShowPen
);
1881 if (!PyArg_ParseTuple(_args
, ""))
1889 static PyObject
*Qd_GetPen(PyObject
*_self
, PyObject
*_args
)
1891 PyObject
*_res
= NULL
;
1894 PyMac_PRECHECK(GetPen
);
1896 if (!PyArg_ParseTuple(_args
, ""))
1899 _res
= Py_BuildValue("O&",
1900 PyMac_BuildPoint
, pt
);
1904 static PyObject
*Qd_GetPenState(PyObject
*_self
, PyObject
*_args
)
1906 PyObject
*_res
= NULL
;
1907 PenState pnState__out__
;
1909 PyMac_PRECHECK(GetPenState
);
1911 if (!PyArg_ParseTuple(_args
, ""))
1913 GetPenState(&pnState__out__
);
1914 _res
= Py_BuildValue("s#",
1915 (char *)&pnState__out__
, (int)sizeof(PenState
));
1919 static PyObject
*Qd_SetPenState(PyObject
*_self
, PyObject
*_args
)
1921 PyObject
*_res
= NULL
;
1922 PenState
*pnState__in__
;
1923 int pnState__in_len__
;
1925 PyMac_PRECHECK(SetPenState
);
1927 if (!PyArg_ParseTuple(_args
, "s#",
1928 (char **)&pnState__in__
, &pnState__in_len__
))
1930 if (pnState__in_len__
!= sizeof(PenState
))
1932 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(PenState)");
1933 goto pnState__error__
;
1935 SetPenState(pnState__in__
);
1942 static PyObject
*Qd_PenSize(PyObject
*_self
, PyObject
*_args
)
1944 PyObject
*_res
= NULL
;
1948 PyMac_PRECHECK(PenSize
);
1950 if (!PyArg_ParseTuple(_args
, "hh",
1961 static PyObject
*Qd_PenMode(PyObject
*_self
, PyObject
*_args
)
1963 PyObject
*_res
= NULL
;
1966 PyMac_PRECHECK(PenMode
);
1968 if (!PyArg_ParseTuple(_args
, "h",
1977 static PyObject
*Qd_PenPat(PyObject
*_self
, PyObject
*_args
)
1979 PyObject
*_res
= NULL
;
1983 PyMac_PRECHECK(PenPat
);
1985 if (!PyArg_ParseTuple(_args
, "s#",
1986 (char **)&pat__in__
, &pat__in_len__
))
1988 if (pat__in_len__
!= sizeof(Pattern
))
1990 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2000 static PyObject
*Qd_PenNormal(PyObject
*_self
, PyObject
*_args
)
2002 PyObject
*_res
= NULL
;
2004 PyMac_PRECHECK(PenNormal
);
2006 if (!PyArg_ParseTuple(_args
, ""))
2014 static PyObject
*Qd_MoveTo(PyObject
*_self
, PyObject
*_args
)
2016 PyObject
*_res
= NULL
;
2020 PyMac_PRECHECK(MoveTo
);
2022 if (!PyArg_ParseTuple(_args
, "hh",
2033 static PyObject
*Qd_Move(PyObject
*_self
, PyObject
*_args
)
2035 PyObject
*_res
= NULL
;
2039 PyMac_PRECHECK(Move
);
2041 if (!PyArg_ParseTuple(_args
, "hh",
2052 static PyObject
*Qd_MacLineTo(PyObject
*_self
, PyObject
*_args
)
2054 PyObject
*_res
= NULL
;
2058 PyMac_PRECHECK(MacLineTo
);
2060 if (!PyArg_ParseTuple(_args
, "hh",
2071 static PyObject
*Qd_Line(PyObject
*_self
, PyObject
*_args
)
2073 PyObject
*_res
= NULL
;
2077 PyMac_PRECHECK(Line
);
2079 if (!PyArg_ParseTuple(_args
, "hh",
2090 static PyObject
*Qd_ForeColor(PyObject
*_self
, PyObject
*_args
)
2092 PyObject
*_res
= NULL
;
2095 PyMac_PRECHECK(ForeColor
);
2097 if (!PyArg_ParseTuple(_args
, "l",
2106 static PyObject
*Qd_BackColor(PyObject
*_self
, PyObject
*_args
)
2108 PyObject
*_res
= NULL
;
2111 PyMac_PRECHECK(BackColor
);
2113 if (!PyArg_ParseTuple(_args
, "l",
2122 static PyObject
*Qd_ColorBit(PyObject
*_self
, PyObject
*_args
)
2124 PyObject
*_res
= NULL
;
2127 PyMac_PRECHECK(ColorBit
);
2129 if (!PyArg_ParseTuple(_args
, "h",
2138 static PyObject
*Qd_MacSetRect(PyObject
*_self
, PyObject
*_args
)
2140 PyObject
*_res
= NULL
;
2147 PyMac_PRECHECK(MacSetRect
);
2149 if (!PyArg_ParseTuple(_args
, "hhhh",
2160 _res
= Py_BuildValue("O&",
2161 PyMac_BuildRect
, &r
);
2165 static PyObject
*Qd_MacOffsetRect(PyObject
*_self
, PyObject
*_args
)
2167 PyObject
*_res
= NULL
;
2171 #ifndef MacOffsetRect
2172 PyMac_PRECHECK(MacOffsetRect
);
2174 if (!PyArg_ParseTuple(_args
, "O&hh",
2182 _res
= Py_BuildValue("O&",
2183 PyMac_BuildRect
, &r
);
2187 static PyObject
*Qd_MacInsetRect(PyObject
*_self
, PyObject
*_args
)
2189 PyObject
*_res
= NULL
;
2193 #ifndef MacInsetRect
2194 PyMac_PRECHECK(MacInsetRect
);
2196 if (!PyArg_ParseTuple(_args
, "O&hh",
2204 _res
= Py_BuildValue("O&",
2205 PyMac_BuildRect
, &r
);
2209 static PyObject
*Qd_SectRect(PyObject
*_self
, PyObject
*_args
)
2211 PyObject
*_res
= NULL
;
2217 PyMac_PRECHECK(SectRect
);
2219 if (!PyArg_ParseTuple(_args
, "O&O&",
2220 PyMac_GetRect
, &src1
,
2221 PyMac_GetRect
, &src2
))
2223 _rv
= SectRect(&src1
,
2226 _res
= Py_BuildValue("bO&",
2228 PyMac_BuildRect
, &dstRect
);
2232 static PyObject
*Qd_MacUnionRect(PyObject
*_self
, PyObject
*_args
)
2234 PyObject
*_res
= NULL
;
2238 #ifndef MacUnionRect
2239 PyMac_PRECHECK(MacUnionRect
);
2241 if (!PyArg_ParseTuple(_args
, "O&O&",
2242 PyMac_GetRect
, &src1
,
2243 PyMac_GetRect
, &src2
))
2248 _res
= Py_BuildValue("O&",
2249 PyMac_BuildRect
, &dstRect
);
2253 static PyObject
*Qd_MacEqualRect(PyObject
*_self
, PyObject
*_args
)
2255 PyObject
*_res
= NULL
;
2259 #ifndef MacEqualRect
2260 PyMac_PRECHECK(MacEqualRect
);
2262 if (!PyArg_ParseTuple(_args
, "O&O&",
2263 PyMac_GetRect
, &rect1
,
2264 PyMac_GetRect
, &rect2
))
2266 _rv
= MacEqualRect(&rect1
,
2268 _res
= Py_BuildValue("b",
2273 static PyObject
*Qd_EmptyRect(PyObject
*_self
, PyObject
*_args
)
2275 PyObject
*_res
= NULL
;
2279 PyMac_PRECHECK(EmptyRect
);
2281 if (!PyArg_ParseTuple(_args
, "O&",
2284 _rv
= EmptyRect(&r
);
2285 _res
= Py_BuildValue("b",
2290 static PyObject
*Qd_MacFrameRect(PyObject
*_self
, PyObject
*_args
)
2292 PyObject
*_res
= NULL
;
2294 #ifndef MacFrameRect
2295 PyMac_PRECHECK(MacFrameRect
);
2297 if (!PyArg_ParseTuple(_args
, "O&",
2306 static PyObject
*Qd_PaintRect(PyObject
*_self
, PyObject
*_args
)
2308 PyObject
*_res
= NULL
;
2311 PyMac_PRECHECK(PaintRect
);
2313 if (!PyArg_ParseTuple(_args
, "O&",
2322 static PyObject
*Qd_EraseRect(PyObject
*_self
, PyObject
*_args
)
2324 PyObject
*_res
= NULL
;
2327 PyMac_PRECHECK(EraseRect
);
2329 if (!PyArg_ParseTuple(_args
, "O&",
2338 static PyObject
*Qd_MacInvertRect(PyObject
*_self
, PyObject
*_args
)
2340 PyObject
*_res
= NULL
;
2342 #ifndef MacInvertRect
2343 PyMac_PRECHECK(MacInvertRect
);
2345 if (!PyArg_ParseTuple(_args
, "O&",
2354 static PyObject
*Qd_MacFillRect(PyObject
*_self
, PyObject
*_args
)
2356 PyObject
*_res
= NULL
;
2361 PyMac_PRECHECK(MacFillRect
);
2363 if (!PyArg_ParseTuple(_args
, "O&s#",
2365 (char **)&pat__in__
, &pat__in_len__
))
2367 if (pat__in_len__
!= sizeof(Pattern
))
2369 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2380 static PyObject
*Qd_FrameOval(PyObject
*_self
, PyObject
*_args
)
2382 PyObject
*_res
= NULL
;
2385 PyMac_PRECHECK(FrameOval
);
2387 if (!PyArg_ParseTuple(_args
, "O&",
2396 static PyObject
*Qd_PaintOval(PyObject
*_self
, PyObject
*_args
)
2398 PyObject
*_res
= NULL
;
2401 PyMac_PRECHECK(PaintOval
);
2403 if (!PyArg_ParseTuple(_args
, "O&",
2412 static PyObject
*Qd_EraseOval(PyObject
*_self
, PyObject
*_args
)
2414 PyObject
*_res
= NULL
;
2417 PyMac_PRECHECK(EraseOval
);
2419 if (!PyArg_ParseTuple(_args
, "O&",
2428 static PyObject
*Qd_InvertOval(PyObject
*_self
, PyObject
*_args
)
2430 PyObject
*_res
= NULL
;
2433 PyMac_PRECHECK(InvertOval
);
2435 if (!PyArg_ParseTuple(_args
, "O&",
2444 static PyObject
*Qd_FillOval(PyObject
*_self
, PyObject
*_args
)
2446 PyObject
*_res
= NULL
;
2451 PyMac_PRECHECK(FillOval
);
2453 if (!PyArg_ParseTuple(_args
, "O&s#",
2455 (char **)&pat__in__
, &pat__in_len__
))
2457 if (pat__in_len__
!= sizeof(Pattern
))
2459 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2470 static PyObject
*Qd_FrameRoundRect(PyObject
*_self
, PyObject
*_args
)
2472 PyObject
*_res
= NULL
;
2476 #ifndef FrameRoundRect
2477 PyMac_PRECHECK(FrameRoundRect
);
2479 if (!PyArg_ParseTuple(_args
, "O&hh",
2492 static PyObject
*Qd_PaintRoundRect(PyObject
*_self
, PyObject
*_args
)
2494 PyObject
*_res
= NULL
;
2498 #ifndef PaintRoundRect
2499 PyMac_PRECHECK(PaintRoundRect
);
2501 if (!PyArg_ParseTuple(_args
, "O&hh",
2514 static PyObject
*Qd_EraseRoundRect(PyObject
*_self
, PyObject
*_args
)
2516 PyObject
*_res
= NULL
;
2520 #ifndef EraseRoundRect
2521 PyMac_PRECHECK(EraseRoundRect
);
2523 if (!PyArg_ParseTuple(_args
, "O&hh",
2536 static PyObject
*Qd_InvertRoundRect(PyObject
*_self
, PyObject
*_args
)
2538 PyObject
*_res
= NULL
;
2542 #ifndef InvertRoundRect
2543 PyMac_PRECHECK(InvertRoundRect
);
2545 if (!PyArg_ParseTuple(_args
, "O&hh",
2558 static PyObject
*Qd_FillRoundRect(PyObject
*_self
, PyObject
*_args
)
2560 PyObject
*_res
= NULL
;
2566 #ifndef FillRoundRect
2567 PyMac_PRECHECK(FillRoundRect
);
2569 if (!PyArg_ParseTuple(_args
, "O&hhs#",
2573 (char **)&pat__in__
, &pat__in_len__
))
2575 if (pat__in_len__
!= sizeof(Pattern
))
2577 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2590 static PyObject
*Qd_FrameArc(PyObject
*_self
, PyObject
*_args
)
2592 PyObject
*_res
= NULL
;
2597 PyMac_PRECHECK(FrameArc
);
2599 if (!PyArg_ParseTuple(_args
, "O&hh",
2612 static PyObject
*Qd_PaintArc(PyObject
*_self
, PyObject
*_args
)
2614 PyObject
*_res
= NULL
;
2619 PyMac_PRECHECK(PaintArc
);
2621 if (!PyArg_ParseTuple(_args
, "O&hh",
2634 static PyObject
*Qd_EraseArc(PyObject
*_self
, PyObject
*_args
)
2636 PyObject
*_res
= NULL
;
2641 PyMac_PRECHECK(EraseArc
);
2643 if (!PyArg_ParseTuple(_args
, "O&hh",
2656 static PyObject
*Qd_InvertArc(PyObject
*_self
, PyObject
*_args
)
2658 PyObject
*_res
= NULL
;
2663 PyMac_PRECHECK(InvertArc
);
2665 if (!PyArg_ParseTuple(_args
, "O&hh",
2678 static PyObject
*Qd_FillArc(PyObject
*_self
, PyObject
*_args
)
2680 PyObject
*_res
= NULL
;
2687 PyMac_PRECHECK(FillArc
);
2689 if (!PyArg_ParseTuple(_args
, "O&hhs#",
2693 (char **)&pat__in__
, &pat__in_len__
))
2695 if (pat__in_len__
!= sizeof(Pattern
))
2697 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2710 static PyObject
*Qd_NewRgn(PyObject
*_self
, PyObject
*_args
)
2712 PyObject
*_res
= NULL
;
2715 PyMac_PRECHECK(NewRgn
);
2717 if (!PyArg_ParseTuple(_args
, ""))
2720 _res
= Py_BuildValue("O&",
2725 static PyObject
*Qd_OpenRgn(PyObject
*_self
, PyObject
*_args
)
2727 PyObject
*_res
= NULL
;
2729 PyMac_PRECHECK(OpenRgn
);
2731 if (!PyArg_ParseTuple(_args
, ""))
2739 static PyObject
*Qd_CloseRgn(PyObject
*_self
, PyObject
*_args
)
2741 PyObject
*_res
= NULL
;
2744 PyMac_PRECHECK(CloseRgn
);
2746 if (!PyArg_ParseTuple(_args
, "O&",
2747 ResObj_Convert
, &dstRgn
))
2755 static PyObject
*Qd_BitMapToRegion(PyObject
*_self
, PyObject
*_args
)
2757 PyObject
*_res
= NULL
;
2761 #ifndef BitMapToRegion
2762 PyMac_PRECHECK(BitMapToRegion
);
2764 if (!PyArg_ParseTuple(_args
, "O&O&",
2765 ResObj_Convert
, ®ion
,
2766 BMObj_Convert
, &bMap
))
2768 _err
= BitMapToRegion(region
,
2770 if (_err
!= noErr
) return PyMac_Error(_err
);
2776 static PyObject
*Qd_RgnToHandle(PyObject
*_self
, PyObject
*_args
)
2778 PyObject
*_res
= NULL
;
2780 Handle flattenedRgnDataHdl
;
2782 PyMac_PRECHECK(RgnToHandle
);
2784 if (!PyArg_ParseTuple(_args
, "O&O&",
2785 ResObj_Convert
, ®ion
,
2786 ResObj_Convert
, &flattenedRgnDataHdl
))
2789 flattenedRgnDataHdl
);
2795 static PyObject
*Qd_DisposeRgn(PyObject
*_self
, PyObject
*_args
)
2797 PyObject
*_res
= NULL
;
2800 PyMac_PRECHECK(DisposeRgn
);
2802 if (!PyArg_ParseTuple(_args
, "O&",
2803 ResObj_Convert
, &rgn
))
2811 static PyObject
*Qd_MacCopyRgn(PyObject
*_self
, PyObject
*_args
)
2813 PyObject
*_res
= NULL
;
2817 PyMac_PRECHECK(MacCopyRgn
);
2819 if (!PyArg_ParseTuple(_args
, "O&O&",
2820 ResObj_Convert
, &srcRgn
,
2821 ResObj_Convert
, &dstRgn
))
2830 static PyObject
*Qd_SetEmptyRgn(PyObject
*_self
, PyObject
*_args
)
2832 PyObject
*_res
= NULL
;
2835 PyMac_PRECHECK(SetEmptyRgn
);
2837 if (!PyArg_ParseTuple(_args
, "O&",
2838 ResObj_Convert
, &rgn
))
2846 static PyObject
*Qd_MacSetRectRgn(PyObject
*_self
, PyObject
*_args
)
2848 PyObject
*_res
= NULL
;
2854 #ifndef MacSetRectRgn
2855 PyMac_PRECHECK(MacSetRectRgn
);
2857 if (!PyArg_ParseTuple(_args
, "O&hhhh",
2858 ResObj_Convert
, &rgn
,
2874 static PyObject
*Qd_RectRgn(PyObject
*_self
, PyObject
*_args
)
2876 PyObject
*_res
= NULL
;
2880 PyMac_PRECHECK(RectRgn
);
2882 if (!PyArg_ParseTuple(_args
, "O&O&",
2883 ResObj_Convert
, &rgn
,
2893 static PyObject
*Qd_MacOffsetRgn(PyObject
*_self
, PyObject
*_args
)
2895 PyObject
*_res
= NULL
;
2899 #ifndef MacOffsetRgn
2900 PyMac_PRECHECK(MacOffsetRgn
);
2902 if (!PyArg_ParseTuple(_args
, "O&hh",
2903 ResObj_Convert
, &rgn
,
2915 static PyObject
*Qd_InsetRgn(PyObject
*_self
, PyObject
*_args
)
2917 PyObject
*_res
= NULL
;
2922 PyMac_PRECHECK(InsetRgn
);
2924 if (!PyArg_ParseTuple(_args
, "O&hh",
2925 ResObj_Convert
, &rgn
,
2937 static PyObject
*Qd_SectRgn(PyObject
*_self
, PyObject
*_args
)
2939 PyObject
*_res
= NULL
;
2944 PyMac_PRECHECK(SectRgn
);
2946 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2947 ResObj_Convert
, &srcRgnA
,
2948 ResObj_Convert
, &srcRgnB
,
2949 ResObj_Convert
, &dstRgn
))
2959 static PyObject
*Qd_MacUnionRgn(PyObject
*_self
, PyObject
*_args
)
2961 PyObject
*_res
= NULL
;
2966 PyMac_PRECHECK(MacUnionRgn
);
2968 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2969 ResObj_Convert
, &srcRgnA
,
2970 ResObj_Convert
, &srcRgnB
,
2971 ResObj_Convert
, &dstRgn
))
2973 MacUnionRgn(srcRgnA
,
2981 static PyObject
*Qd_DiffRgn(PyObject
*_self
, PyObject
*_args
)
2983 PyObject
*_res
= NULL
;
2988 PyMac_PRECHECK(DiffRgn
);
2990 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2991 ResObj_Convert
, &srcRgnA
,
2992 ResObj_Convert
, &srcRgnB
,
2993 ResObj_Convert
, &dstRgn
))
3003 static PyObject
*Qd_MacXorRgn(PyObject
*_self
, PyObject
*_args
)
3005 PyObject
*_res
= NULL
;
3010 PyMac_PRECHECK(MacXorRgn
);
3012 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3013 ResObj_Convert
, &srcRgnA
,
3014 ResObj_Convert
, &srcRgnB
,
3015 ResObj_Convert
, &dstRgn
))
3025 static PyObject
*Qd_RectInRgn(PyObject
*_self
, PyObject
*_args
)
3027 PyObject
*_res
= NULL
;
3032 PyMac_PRECHECK(RectInRgn
);
3034 if (!PyArg_ParseTuple(_args
, "O&O&",
3036 ResObj_Convert
, &rgn
))
3040 _res
= Py_BuildValue("b",
3045 static PyObject
*Qd_MacEqualRgn(PyObject
*_self
, PyObject
*_args
)
3047 PyObject
*_res
= NULL
;
3052 PyMac_PRECHECK(MacEqualRgn
);
3054 if (!PyArg_ParseTuple(_args
, "O&O&",
3055 ResObj_Convert
, &rgnA
,
3056 ResObj_Convert
, &rgnB
))
3058 _rv
= MacEqualRgn(rgnA
,
3060 _res
= Py_BuildValue("b",
3065 static PyObject
*Qd_EmptyRgn(PyObject
*_self
, PyObject
*_args
)
3067 PyObject
*_res
= NULL
;
3071 PyMac_PRECHECK(EmptyRgn
);
3073 if (!PyArg_ParseTuple(_args
, "O&",
3074 ResObj_Convert
, &rgn
))
3076 _rv
= EmptyRgn(rgn
);
3077 _res
= Py_BuildValue("b",
3082 static PyObject
*Qd_MacFrameRgn(PyObject
*_self
, PyObject
*_args
)
3084 PyObject
*_res
= NULL
;
3087 PyMac_PRECHECK(MacFrameRgn
);
3089 if (!PyArg_ParseTuple(_args
, "O&",
3090 ResObj_Convert
, &rgn
))
3098 static PyObject
*Qd_MacPaintRgn(PyObject
*_self
, PyObject
*_args
)
3100 PyObject
*_res
= NULL
;
3103 PyMac_PRECHECK(MacPaintRgn
);
3105 if (!PyArg_ParseTuple(_args
, "O&",
3106 ResObj_Convert
, &rgn
))
3114 static PyObject
*Qd_EraseRgn(PyObject
*_self
, PyObject
*_args
)
3116 PyObject
*_res
= NULL
;
3119 PyMac_PRECHECK(EraseRgn
);
3121 if (!PyArg_ParseTuple(_args
, "O&",
3122 ResObj_Convert
, &rgn
))
3130 static PyObject
*Qd_MacInvertRgn(PyObject
*_self
, PyObject
*_args
)
3132 PyObject
*_res
= NULL
;
3134 #ifndef MacInvertRgn
3135 PyMac_PRECHECK(MacInvertRgn
);
3137 if (!PyArg_ParseTuple(_args
, "O&",
3138 ResObj_Convert
, &rgn
))
3146 static PyObject
*Qd_MacFillRgn(PyObject
*_self
, PyObject
*_args
)
3148 PyObject
*_res
= NULL
;
3153 PyMac_PRECHECK(MacFillRgn
);
3155 if (!PyArg_ParseTuple(_args
, "O&s#",
3156 ResObj_Convert
, &rgn
,
3157 (char **)&pat__in__
, &pat__in_len__
))
3159 if (pat__in_len__
!= sizeof(Pattern
))
3161 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
3172 static PyObject
*Qd_ScrollRect(PyObject
*_self
, PyObject
*_args
)
3174 PyObject
*_res
= NULL
;
3178 RgnHandle updateRgn
;
3180 PyMac_PRECHECK(ScrollRect
);
3182 if (!PyArg_ParseTuple(_args
, "O&hhO&",
3186 ResObj_Convert
, &updateRgn
))
3197 static PyObject
*Qd_CopyBits(PyObject
*_self
, PyObject
*_args
)
3199 PyObject
*_res
= NULL
;
3207 PyMac_PRECHECK(CopyBits
);
3209 if (!PyArg_ParseTuple(_args
, "O&O&O&O&hO&",
3210 BMObj_Convert
, &srcBits
,
3211 BMObj_Convert
, &dstBits
,
3212 PyMac_GetRect
, &srcRect
,
3213 PyMac_GetRect
, &dstRect
,
3215 OptResObj_Convert
, &maskRgn
))
3228 static PyObject
*Qd_CopyMask(PyObject
*_self
, PyObject
*_args
)
3230 PyObject
*_res
= NULL
;
3238 PyMac_PRECHECK(CopyMask
);
3240 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&",
3241 BMObj_Convert
, &srcBits
,
3242 BMObj_Convert
, &maskBits
,
3243 BMObj_Convert
, &dstBits
,
3244 PyMac_GetRect
, &srcRect
,
3245 PyMac_GetRect
, &maskRect
,
3246 PyMac_GetRect
, &dstRect
))
3259 static PyObject
*Qd_OpenPicture(PyObject
*_self
, PyObject
*_args
)
3261 PyObject
*_res
= NULL
;
3265 PyMac_PRECHECK(OpenPicture
);
3267 if (!PyArg_ParseTuple(_args
, "O&",
3268 PyMac_GetRect
, &picFrame
))
3270 _rv
= OpenPicture(&picFrame
);
3271 _res
= Py_BuildValue("O&",
3276 static PyObject
*Qd_PicComment(PyObject
*_self
, PyObject
*_args
)
3278 PyObject
*_res
= NULL
;
3283 PyMac_PRECHECK(PicComment
);
3285 if (!PyArg_ParseTuple(_args
, "hhO&",
3288 ResObj_Convert
, &dataHandle
))
3298 static PyObject
*Qd_ClosePicture(PyObject
*_self
, PyObject
*_args
)
3300 PyObject
*_res
= NULL
;
3301 #ifndef ClosePicture
3302 PyMac_PRECHECK(ClosePicture
);
3304 if (!PyArg_ParseTuple(_args
, ""))
3312 static PyObject
*Qd_DrawPicture(PyObject
*_self
, PyObject
*_args
)
3314 PyObject
*_res
= NULL
;
3315 PicHandle myPicture
;
3318 PyMac_PRECHECK(DrawPicture
);
3320 if (!PyArg_ParseTuple(_args
, "O&O&",
3321 ResObj_Convert
, &myPicture
,
3322 PyMac_GetRect
, &dstRect
))
3324 DrawPicture(myPicture
,
3331 static PyObject
*Qd_KillPicture(PyObject
*_self
, PyObject
*_args
)
3333 PyObject
*_res
= NULL
;
3334 PicHandle myPicture
;
3336 PyMac_PRECHECK(KillPicture
);
3338 if (!PyArg_ParseTuple(_args
, "O&",
3339 ResObj_Convert
, &myPicture
))
3341 KillPicture(myPicture
);
3347 static PyObject
*Qd_OpenPoly(PyObject
*_self
, PyObject
*_args
)
3349 PyObject
*_res
= NULL
;
3352 PyMac_PRECHECK(OpenPoly
);
3354 if (!PyArg_ParseTuple(_args
, ""))
3357 _res
= Py_BuildValue("O&",
3362 static PyObject
*Qd_ClosePoly(PyObject
*_self
, PyObject
*_args
)
3364 PyObject
*_res
= NULL
;
3366 PyMac_PRECHECK(ClosePoly
);
3368 if (!PyArg_ParseTuple(_args
, ""))
3376 static PyObject
*Qd_KillPoly(PyObject
*_self
, PyObject
*_args
)
3378 PyObject
*_res
= NULL
;
3381 PyMac_PRECHECK(KillPoly
);
3383 if (!PyArg_ParseTuple(_args
, "O&",
3384 ResObj_Convert
, &poly
))
3392 static PyObject
*Qd_OffsetPoly(PyObject
*_self
, PyObject
*_args
)
3394 PyObject
*_res
= NULL
;
3399 PyMac_PRECHECK(OffsetPoly
);
3401 if (!PyArg_ParseTuple(_args
, "O&hh",
3402 ResObj_Convert
, &poly
,
3414 static PyObject
*Qd_FramePoly(PyObject
*_self
, PyObject
*_args
)
3416 PyObject
*_res
= NULL
;
3419 PyMac_PRECHECK(FramePoly
);
3421 if (!PyArg_ParseTuple(_args
, "O&",
3422 ResObj_Convert
, &poly
))
3430 static PyObject
*Qd_PaintPoly(PyObject
*_self
, PyObject
*_args
)
3432 PyObject
*_res
= NULL
;
3435 PyMac_PRECHECK(PaintPoly
);
3437 if (!PyArg_ParseTuple(_args
, "O&",
3438 ResObj_Convert
, &poly
))
3446 static PyObject
*Qd_ErasePoly(PyObject
*_self
, PyObject
*_args
)
3448 PyObject
*_res
= NULL
;
3451 PyMac_PRECHECK(ErasePoly
);
3453 if (!PyArg_ParseTuple(_args
, "O&",
3454 ResObj_Convert
, &poly
))
3462 static PyObject
*Qd_InvertPoly(PyObject
*_self
, PyObject
*_args
)
3464 PyObject
*_res
= NULL
;
3467 PyMac_PRECHECK(InvertPoly
);
3469 if (!PyArg_ParseTuple(_args
, "O&",
3470 ResObj_Convert
, &poly
))
3478 static PyObject
*Qd_FillPoly(PyObject
*_self
, PyObject
*_args
)
3480 PyObject
*_res
= NULL
;
3485 PyMac_PRECHECK(FillPoly
);
3487 if (!PyArg_ParseTuple(_args
, "O&s#",
3488 ResObj_Convert
, &poly
,
3489 (char **)&pat__in__
, &pat__in_len__
))
3491 if (pat__in_len__
!= sizeof(Pattern
))
3493 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
3504 static PyObject
*Qd_SetPt(PyObject
*_self
, PyObject
*_args
)
3506 PyObject
*_res
= NULL
;
3511 PyMac_PRECHECK(SetPt
);
3513 if (!PyArg_ParseTuple(_args
, "hh",
3520 _res
= Py_BuildValue("O&",
3521 PyMac_BuildPoint
, pt
);
3525 static PyObject
*Qd_LocalToGlobal(PyObject
*_self
, PyObject
*_args
)
3527 PyObject
*_res
= NULL
;
3529 #ifndef LocalToGlobal
3530 PyMac_PRECHECK(LocalToGlobal
);
3532 if (!PyArg_ParseTuple(_args
, "O&",
3533 PyMac_GetPoint
, &pt
))
3536 _res
= Py_BuildValue("O&",
3537 PyMac_BuildPoint
, pt
);
3541 static PyObject
*Qd_GlobalToLocal(PyObject
*_self
, PyObject
*_args
)
3543 PyObject
*_res
= NULL
;
3545 #ifndef GlobalToLocal
3546 PyMac_PRECHECK(GlobalToLocal
);
3548 if (!PyArg_ParseTuple(_args
, "O&",
3549 PyMac_GetPoint
, &pt
))
3552 _res
= Py_BuildValue("O&",
3553 PyMac_BuildPoint
, pt
);
3557 static PyObject
*Qd_Random(PyObject
*_self
, PyObject
*_args
)
3559 PyObject
*_res
= NULL
;
3562 PyMac_PRECHECK(Random
);
3564 if (!PyArg_ParseTuple(_args
, ""))
3567 _res
= Py_BuildValue("h",
3572 static PyObject
*Qd_MacGetPixel(PyObject
*_self
, PyObject
*_args
)
3574 PyObject
*_res
= NULL
;
3579 PyMac_PRECHECK(MacGetPixel
);
3581 if (!PyArg_ParseTuple(_args
, "hh",
3585 _rv
= MacGetPixel(h
,
3587 _res
= Py_BuildValue("b",
3592 static PyObject
*Qd_ScalePt(PyObject
*_self
, PyObject
*_args
)
3594 PyObject
*_res
= NULL
;
3599 PyMac_PRECHECK(ScalePt
);
3601 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3602 PyMac_GetPoint
, &pt
,
3603 PyMac_GetRect
, &srcRect
,
3604 PyMac_GetRect
, &dstRect
))
3609 _res
= Py_BuildValue("O&",
3610 PyMac_BuildPoint
, pt
);
3614 static PyObject
*Qd_MapPt(PyObject
*_self
, PyObject
*_args
)
3616 PyObject
*_res
= NULL
;
3621 PyMac_PRECHECK(MapPt
);
3623 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3624 PyMac_GetPoint
, &pt
,
3625 PyMac_GetRect
, &srcRect
,
3626 PyMac_GetRect
, &dstRect
))
3631 _res
= Py_BuildValue("O&",
3632 PyMac_BuildPoint
, pt
);
3636 static PyObject
*Qd_MapRect(PyObject
*_self
, PyObject
*_args
)
3638 PyObject
*_res
= NULL
;
3643 PyMac_PRECHECK(MapRect
);
3645 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3647 PyMac_GetRect
, &srcRect
,
3648 PyMac_GetRect
, &dstRect
))
3653 _res
= Py_BuildValue("O&",
3654 PyMac_BuildRect
, &r
);
3658 static PyObject
*Qd_MapRgn(PyObject
*_self
, PyObject
*_args
)
3660 PyObject
*_res
= NULL
;
3665 PyMac_PRECHECK(MapRgn
);
3667 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3668 ResObj_Convert
, &rgn
,
3669 PyMac_GetRect
, &srcRect
,
3670 PyMac_GetRect
, &dstRect
))
3680 static PyObject
*Qd_MapPoly(PyObject
*_self
, PyObject
*_args
)
3682 PyObject
*_res
= NULL
;
3687 PyMac_PRECHECK(MapPoly
);
3689 if (!PyArg_ParseTuple(_args
, "O&O&O&",
3690 ResObj_Convert
, &poly
,
3691 PyMac_GetRect
, &srcRect
,
3692 PyMac_GetRect
, &dstRect
))
3702 static PyObject
*Qd_StdBits(PyObject
*_self
, PyObject
*_args
)
3704 PyObject
*_res
= NULL
;
3711 PyMac_PRECHECK(StdBits
);
3713 if (!PyArg_ParseTuple(_args
, "O&O&O&hO&",
3714 BMObj_Convert
, &srcBits
,
3715 PyMac_GetRect
, &srcRect
,
3716 PyMac_GetRect
, &dstRect
,
3718 OptResObj_Convert
, &maskRgn
))
3730 static PyObject
*Qd_AddPt(PyObject
*_self
, PyObject
*_args
)
3732 PyObject
*_res
= NULL
;
3736 PyMac_PRECHECK(AddPt
);
3738 if (!PyArg_ParseTuple(_args
, "O&O&",
3739 PyMac_GetPoint
, &src
,
3740 PyMac_GetPoint
, &dst
))
3744 _res
= Py_BuildValue("O&",
3745 PyMac_BuildPoint
, dst
);
3749 static PyObject
*Qd_EqualPt(PyObject
*_self
, PyObject
*_args
)
3751 PyObject
*_res
= NULL
;
3756 PyMac_PRECHECK(EqualPt
);
3758 if (!PyArg_ParseTuple(_args
, "O&O&",
3759 PyMac_GetPoint
, &pt1
,
3760 PyMac_GetPoint
, &pt2
))
3764 _res
= Py_BuildValue("b",
3769 static PyObject
*Qd_MacPtInRect(PyObject
*_self
, PyObject
*_args
)
3771 PyObject
*_res
= NULL
;
3776 PyMac_PRECHECK(MacPtInRect
);
3778 if (!PyArg_ParseTuple(_args
, "O&O&",
3779 PyMac_GetPoint
, &pt
,
3782 _rv
= MacPtInRect(pt
,
3784 _res
= Py_BuildValue("b",
3789 static PyObject
*Qd_Pt2Rect(PyObject
*_self
, PyObject
*_args
)
3791 PyObject
*_res
= NULL
;
3796 PyMac_PRECHECK(Pt2Rect
);
3798 if (!PyArg_ParseTuple(_args
, "O&O&",
3799 PyMac_GetPoint
, &pt1
,
3800 PyMac_GetPoint
, &pt2
))
3805 _res
= Py_BuildValue("O&",
3806 PyMac_BuildRect
, &dstRect
);
3810 static PyObject
*Qd_PtToAngle(PyObject
*_self
, PyObject
*_args
)
3812 PyObject
*_res
= NULL
;
3817 PyMac_PRECHECK(PtToAngle
);
3819 if (!PyArg_ParseTuple(_args
, "O&O&",
3821 PyMac_GetPoint
, &pt
))
3826 _res
= Py_BuildValue("h",
3831 static PyObject
*Qd_SubPt(PyObject
*_self
, PyObject
*_args
)
3833 PyObject
*_res
= NULL
;
3837 PyMac_PRECHECK(SubPt
);
3839 if (!PyArg_ParseTuple(_args
, "O&O&",
3840 PyMac_GetPoint
, &src
,
3841 PyMac_GetPoint
, &dst
))
3845 _res
= Py_BuildValue("O&",
3846 PyMac_BuildPoint
, dst
);
3850 static PyObject
*Qd_PtInRgn(PyObject
*_self
, PyObject
*_args
)
3852 PyObject
*_res
= NULL
;
3857 PyMac_PRECHECK(PtInRgn
);
3859 if (!PyArg_ParseTuple(_args
, "O&O&",
3860 PyMac_GetPoint
, &pt
,
3861 ResObj_Convert
, &rgn
))
3865 _res
= Py_BuildValue("b",
3870 static PyObject
*Qd_NewPixMap(PyObject
*_self
, PyObject
*_args
)
3872 PyObject
*_res
= NULL
;
3875 PyMac_PRECHECK(NewPixMap
);
3877 if (!PyArg_ParseTuple(_args
, ""))
3880 _res
= Py_BuildValue("O&",
3885 static PyObject
*Qd_DisposePixMap(PyObject
*_self
, PyObject
*_args
)
3887 PyObject
*_res
= NULL
;
3889 #ifndef DisposePixMap
3890 PyMac_PRECHECK(DisposePixMap
);
3892 if (!PyArg_ParseTuple(_args
, "O&",
3893 ResObj_Convert
, &pm
))
3901 static PyObject
*Qd_CopyPixMap(PyObject
*_self
, PyObject
*_args
)
3903 PyObject
*_res
= NULL
;
3907 PyMac_PRECHECK(CopyPixMap
);
3909 if (!PyArg_ParseTuple(_args
, "O&O&",
3910 ResObj_Convert
, &srcPM
,
3911 ResObj_Convert
, &dstPM
))
3920 static PyObject
*Qd_NewPixPat(PyObject
*_self
, PyObject
*_args
)
3922 PyObject
*_res
= NULL
;
3925 PyMac_PRECHECK(NewPixPat
);
3927 if (!PyArg_ParseTuple(_args
, ""))
3930 _res
= Py_BuildValue("O&",
3935 static PyObject
*Qd_DisposePixPat(PyObject
*_self
, PyObject
*_args
)
3937 PyObject
*_res
= NULL
;
3939 #ifndef DisposePixPat
3940 PyMac_PRECHECK(DisposePixPat
);
3942 if (!PyArg_ParseTuple(_args
, "O&",
3943 ResObj_Convert
, &pp
))
3951 static PyObject
*Qd_CopyPixPat(PyObject
*_self
, PyObject
*_args
)
3953 PyObject
*_res
= NULL
;
3957 PyMac_PRECHECK(CopyPixPat
);
3959 if (!PyArg_ParseTuple(_args
, "O&O&",
3960 ResObj_Convert
, &srcPP
,
3961 ResObj_Convert
, &dstPP
))
3970 static PyObject
*Qd_PenPixPat(PyObject
*_self
, PyObject
*_args
)
3972 PyObject
*_res
= NULL
;
3975 PyMac_PRECHECK(PenPixPat
);
3977 if (!PyArg_ParseTuple(_args
, "O&",
3978 ResObj_Convert
, &pp
))
3986 static PyObject
*Qd_BackPixPat(PyObject
*_self
, PyObject
*_args
)
3988 PyObject
*_res
= NULL
;
3991 PyMac_PRECHECK(BackPixPat
);
3993 if (!PyArg_ParseTuple(_args
, "O&",
3994 ResObj_Convert
, &pp
))
4002 static PyObject
*Qd_GetPixPat(PyObject
*_self
, PyObject
*_args
)
4004 PyObject
*_res
= NULL
;
4008 PyMac_PRECHECK(GetPixPat
);
4010 if (!PyArg_ParseTuple(_args
, "h",
4013 _rv
= GetPixPat(patID
);
4014 _res
= Py_BuildValue("O&",
4019 static PyObject
*Qd_MakeRGBPat(PyObject
*_self
, PyObject
*_args
)
4021 PyObject
*_res
= NULL
;
4025 PyMac_PRECHECK(MakeRGBPat
);
4027 if (!PyArg_ParseTuple(_args
, "O&O&",
4028 ResObj_Convert
, &pp
,
4029 QdRGB_Convert
, &myColor
))
4038 static PyObject
*Qd_FillCRect(PyObject
*_self
, PyObject
*_args
)
4040 PyObject
*_res
= NULL
;
4044 PyMac_PRECHECK(FillCRect
);
4046 if (!PyArg_ParseTuple(_args
, "O&O&",
4048 ResObj_Convert
, &pp
))
4057 static PyObject
*Qd_FillCOval(PyObject
*_self
, PyObject
*_args
)
4059 PyObject
*_res
= NULL
;
4063 PyMac_PRECHECK(FillCOval
);
4065 if (!PyArg_ParseTuple(_args
, "O&O&",
4067 ResObj_Convert
, &pp
))
4076 static PyObject
*Qd_FillCRoundRect(PyObject
*_self
, PyObject
*_args
)
4078 PyObject
*_res
= NULL
;
4083 #ifndef FillCRoundRect
4084 PyMac_PRECHECK(FillCRoundRect
);
4086 if (!PyArg_ParseTuple(_args
, "O&hhO&",
4090 ResObj_Convert
, &pp
))
4101 static PyObject
*Qd_FillCArc(PyObject
*_self
, PyObject
*_args
)
4103 PyObject
*_res
= NULL
;
4109 PyMac_PRECHECK(FillCArc
);
4111 if (!PyArg_ParseTuple(_args
, "O&hhO&",
4115 ResObj_Convert
, &pp
))
4126 static PyObject
*Qd_FillCRgn(PyObject
*_self
, PyObject
*_args
)
4128 PyObject
*_res
= NULL
;
4132 PyMac_PRECHECK(FillCRgn
);
4134 if (!PyArg_ParseTuple(_args
, "O&O&",
4135 ResObj_Convert
, &rgn
,
4136 ResObj_Convert
, &pp
))
4145 static PyObject
*Qd_FillCPoly(PyObject
*_self
, PyObject
*_args
)
4147 PyObject
*_res
= NULL
;
4151 PyMac_PRECHECK(FillCPoly
);
4153 if (!PyArg_ParseTuple(_args
, "O&O&",
4154 ResObj_Convert
, &poly
,
4155 ResObj_Convert
, &pp
))
4164 static PyObject
*Qd_RGBForeColor(PyObject
*_self
, PyObject
*_args
)
4166 PyObject
*_res
= NULL
;
4168 #ifndef RGBForeColor
4169 PyMac_PRECHECK(RGBForeColor
);
4171 if (!PyArg_ParseTuple(_args
, "O&",
4172 QdRGB_Convert
, &color
))
4174 RGBForeColor(&color
);
4180 static PyObject
*Qd_RGBBackColor(PyObject
*_self
, PyObject
*_args
)
4182 PyObject
*_res
= NULL
;
4184 #ifndef RGBBackColor
4185 PyMac_PRECHECK(RGBBackColor
);
4187 if (!PyArg_ParseTuple(_args
, "O&",
4188 QdRGB_Convert
, &color
))
4190 RGBBackColor(&color
);
4196 static PyObject
*Qd_SetCPixel(PyObject
*_self
, PyObject
*_args
)
4198 PyObject
*_res
= NULL
;
4203 PyMac_PRECHECK(SetCPixel
);
4205 if (!PyArg_ParseTuple(_args
, "hhO&",
4208 QdRGB_Convert
, &cPix
))
4218 static PyObject
*Qd_SetPortPix(PyObject
*_self
, PyObject
*_args
)
4220 PyObject
*_res
= NULL
;
4223 PyMac_PRECHECK(SetPortPix
);
4225 if (!PyArg_ParseTuple(_args
, "O&",
4226 ResObj_Convert
, &pm
))
4234 static PyObject
*Qd_GetCPixel(PyObject
*_self
, PyObject
*_args
)
4236 PyObject
*_res
= NULL
;
4241 PyMac_PRECHECK(GetCPixel
);
4243 if (!PyArg_ParseTuple(_args
, "hh",
4250 _res
= Py_BuildValue("O&",
4255 static PyObject
*Qd_GetForeColor(PyObject
*_self
, PyObject
*_args
)
4257 PyObject
*_res
= NULL
;
4259 #ifndef GetForeColor
4260 PyMac_PRECHECK(GetForeColor
);
4262 if (!PyArg_ParseTuple(_args
, ""))
4264 GetForeColor(&color
);
4265 _res
= Py_BuildValue("O&",
4270 static PyObject
*Qd_GetBackColor(PyObject
*_self
, PyObject
*_args
)
4272 PyObject
*_res
= NULL
;
4274 #ifndef GetBackColor
4275 PyMac_PRECHECK(GetBackColor
);
4277 if (!PyArg_ParseTuple(_args
, ""))
4279 GetBackColor(&color
);
4280 _res
= Py_BuildValue("O&",
4285 static PyObject
*Qd_OpColor(PyObject
*_self
, PyObject
*_args
)
4287 PyObject
*_res
= NULL
;
4290 PyMac_PRECHECK(OpColor
);
4292 if (!PyArg_ParseTuple(_args
, "O&",
4293 QdRGB_Convert
, &color
))
4301 static PyObject
*Qd_HiliteColor(PyObject
*_self
, PyObject
*_args
)
4303 PyObject
*_res
= NULL
;
4306 PyMac_PRECHECK(HiliteColor
);
4308 if (!PyArg_ParseTuple(_args
, "O&",
4309 QdRGB_Convert
, &color
))
4311 HiliteColor(&color
);
4317 static PyObject
*Qd_DisposeCTable(PyObject
*_self
, PyObject
*_args
)
4319 PyObject
*_res
= NULL
;
4321 #ifndef DisposeCTable
4322 PyMac_PRECHECK(DisposeCTable
);
4324 if (!PyArg_ParseTuple(_args
, "O&",
4325 ResObj_Convert
, &cTable
))
4327 DisposeCTable(cTable
);
4333 static PyObject
*Qd_GetCTable(PyObject
*_self
, PyObject
*_args
)
4335 PyObject
*_res
= NULL
;
4339 PyMac_PRECHECK(GetCTable
);
4341 if (!PyArg_ParseTuple(_args
, "h",
4344 _rv
= GetCTable(ctID
);
4345 _res
= Py_BuildValue("O&",
4350 static PyObject
*Qd_GetCCursor(PyObject
*_self
, PyObject
*_args
)
4352 PyObject
*_res
= NULL
;
4356 PyMac_PRECHECK(GetCCursor
);
4358 if (!PyArg_ParseTuple(_args
, "h",
4361 _rv
= GetCCursor(crsrID
);
4362 _res
= Py_BuildValue("O&",
4367 static PyObject
*Qd_SetCCursor(PyObject
*_self
, PyObject
*_args
)
4369 PyObject
*_res
= NULL
;
4372 PyMac_PRECHECK(SetCCursor
);
4374 if (!PyArg_ParseTuple(_args
, "O&",
4375 ResObj_Convert
, &cCrsr
))
4383 static PyObject
*Qd_AllocCursor(PyObject
*_self
, PyObject
*_args
)
4385 PyObject
*_res
= NULL
;
4387 PyMac_PRECHECK(AllocCursor
);
4389 if (!PyArg_ParseTuple(_args
, ""))
4397 static PyObject
*Qd_DisposeCCursor(PyObject
*_self
, PyObject
*_args
)
4399 PyObject
*_res
= NULL
;
4401 #ifndef DisposeCCursor
4402 PyMac_PRECHECK(DisposeCCursor
);
4404 if (!PyArg_ParseTuple(_args
, "O&",
4405 ResObj_Convert
, &cCrsr
))
4407 DisposeCCursor(cCrsr
);
4413 static PyObject
*Qd_GetMaxDevice(PyObject
*_self
, PyObject
*_args
)
4415 PyObject
*_res
= NULL
;
4418 #ifndef GetMaxDevice
4419 PyMac_PRECHECK(GetMaxDevice
);
4421 if (!PyArg_ParseTuple(_args
, "O&",
4422 PyMac_GetRect
, &globalRect
))
4424 _rv
= GetMaxDevice(&globalRect
);
4425 _res
= Py_BuildValue("O&",
4430 static PyObject
*Qd_GetCTSeed(PyObject
*_self
, PyObject
*_args
)
4432 PyObject
*_res
= NULL
;
4435 PyMac_PRECHECK(GetCTSeed
);
4437 if (!PyArg_ParseTuple(_args
, ""))
4440 _res
= Py_BuildValue("l",
4445 static PyObject
*Qd_GetDeviceList(PyObject
*_self
, PyObject
*_args
)
4447 PyObject
*_res
= NULL
;
4449 #ifndef GetDeviceList
4450 PyMac_PRECHECK(GetDeviceList
);
4452 if (!PyArg_ParseTuple(_args
, ""))
4454 _rv
= GetDeviceList();
4455 _res
= Py_BuildValue("O&",
4460 static PyObject
*Qd_GetMainDevice(PyObject
*_self
, PyObject
*_args
)
4462 PyObject
*_res
= NULL
;
4464 #ifndef GetMainDevice
4465 PyMac_PRECHECK(GetMainDevice
);
4467 if (!PyArg_ParseTuple(_args
, ""))
4469 _rv
= GetMainDevice();
4470 _res
= Py_BuildValue("O&",
4475 static PyObject
*Qd_GetNextDevice(PyObject
*_self
, PyObject
*_args
)
4477 PyObject
*_res
= NULL
;
4480 #ifndef GetNextDevice
4481 PyMac_PRECHECK(GetNextDevice
);
4483 if (!PyArg_ParseTuple(_args
, "O&",
4484 ResObj_Convert
, &curDevice
))
4486 _rv
= GetNextDevice(curDevice
);
4487 _res
= Py_BuildValue("O&",
4492 static PyObject
*Qd_TestDeviceAttribute(PyObject
*_self
, PyObject
*_args
)
4494 PyObject
*_res
= NULL
;
4498 #ifndef TestDeviceAttribute
4499 PyMac_PRECHECK(TestDeviceAttribute
);
4501 if (!PyArg_ParseTuple(_args
, "O&h",
4502 ResObj_Convert
, &gdh
,
4505 _rv
= TestDeviceAttribute(gdh
,
4507 _res
= Py_BuildValue("b",
4512 static PyObject
*Qd_SetDeviceAttribute(PyObject
*_self
, PyObject
*_args
)
4514 PyObject
*_res
= NULL
;
4518 #ifndef SetDeviceAttribute
4519 PyMac_PRECHECK(SetDeviceAttribute
);
4521 if (!PyArg_ParseTuple(_args
, "O&hb",
4522 ResObj_Convert
, &gdh
,
4526 SetDeviceAttribute(gdh
,
4534 static PyObject
*Qd_InitGDevice(PyObject
*_self
, PyObject
*_args
)
4536 PyObject
*_res
= NULL
;
4541 PyMac_PRECHECK(InitGDevice
);
4543 if (!PyArg_ParseTuple(_args
, "hlO&",
4546 ResObj_Convert
, &gdh
))
4548 InitGDevice(qdRefNum
,
4556 static PyObject
*Qd_NewGDevice(PyObject
*_self
, PyObject
*_args
)
4558 PyObject
*_res
= NULL
;
4563 PyMac_PRECHECK(NewGDevice
);
4565 if (!PyArg_ParseTuple(_args
, "hl",
4569 _rv
= NewGDevice(refNum
,
4571 _res
= Py_BuildValue("O&",
4576 static PyObject
*Qd_DisposeGDevice(PyObject
*_self
, PyObject
*_args
)
4578 PyObject
*_res
= NULL
;
4580 #ifndef DisposeGDevice
4581 PyMac_PRECHECK(DisposeGDevice
);
4583 if (!PyArg_ParseTuple(_args
, "O&",
4584 ResObj_Convert
, &gdh
))
4586 DisposeGDevice(gdh
);
4592 static PyObject
*Qd_SetGDevice(PyObject
*_self
, PyObject
*_args
)
4594 PyObject
*_res
= NULL
;
4597 PyMac_PRECHECK(SetGDevice
);
4599 if (!PyArg_ParseTuple(_args
, "O&",
4600 ResObj_Convert
, &gd
))
4608 static PyObject
*Qd_GetGDevice(PyObject
*_self
, PyObject
*_args
)
4610 PyObject
*_res
= NULL
;
4613 PyMac_PRECHECK(GetGDevice
);
4615 if (!PyArg_ParseTuple(_args
, ""))
4618 _res
= Py_BuildValue("O&",
4623 static PyObject
*Qd_Color2Index(PyObject
*_self
, PyObject
*_args
)
4625 PyObject
*_res
= NULL
;
4629 PyMac_PRECHECK(Color2Index
);
4631 if (!PyArg_ParseTuple(_args
, "O&",
4632 QdRGB_Convert
, &myColor
))
4634 _rv
= Color2Index(&myColor
);
4635 _res
= Py_BuildValue("l",
4640 static PyObject
*Qd_Index2Color(PyObject
*_self
, PyObject
*_args
)
4642 PyObject
*_res
= NULL
;
4646 PyMac_PRECHECK(Index2Color
);
4648 if (!PyArg_ParseTuple(_args
, "l",
4653 _res
= Py_BuildValue("O&",
4654 QdRGB_New
, &aColor
);
4658 static PyObject
*Qd_InvertColor(PyObject
*_self
, PyObject
*_args
)
4660 PyObject
*_res
= NULL
;
4663 PyMac_PRECHECK(InvertColor
);
4665 if (!PyArg_ParseTuple(_args
, ""))
4667 InvertColor(&myColor
);
4668 _res
= Py_BuildValue("O&",
4669 QdRGB_New
, &myColor
);
4673 static PyObject
*Qd_RealColor(PyObject
*_self
, PyObject
*_args
)
4675 PyObject
*_res
= NULL
;
4679 PyMac_PRECHECK(RealColor
);
4681 if (!PyArg_ParseTuple(_args
, "O&",
4682 QdRGB_Convert
, &color
))
4684 _rv
= RealColor(&color
);
4685 _res
= Py_BuildValue("b",
4690 static PyObject
*Qd_GetSubTable(PyObject
*_self
, PyObject
*_args
)
4692 PyObject
*_res
= NULL
;
4693 CTabHandle myColors
;
4695 CTabHandle targetTbl
;
4697 PyMac_PRECHECK(GetSubTable
);
4699 if (!PyArg_ParseTuple(_args
, "O&hO&",
4700 ResObj_Convert
, &myColors
,
4702 ResObj_Convert
, &targetTbl
))
4704 GetSubTable(myColors
,
4712 static PyObject
*Qd_MakeITable(PyObject
*_self
, PyObject
*_args
)
4714 PyObject
*_res
= NULL
;
4719 PyMac_PRECHECK(MakeITable
);
4721 if (!PyArg_ParseTuple(_args
, "O&O&h",
4722 ResObj_Convert
, &cTabH
,
4723 ResObj_Convert
, &iTabH
,
4734 static PyObject
*Qd_SetClientID(PyObject
*_self
, PyObject
*_args
)
4736 PyObject
*_res
= NULL
;
4739 PyMac_PRECHECK(SetClientID
);
4741 if (!PyArg_ParseTuple(_args
, "h",
4750 static PyObject
*Qd_ProtectEntry(PyObject
*_self
, PyObject
*_args
)
4752 PyObject
*_res
= NULL
;
4755 #ifndef ProtectEntry
4756 PyMac_PRECHECK(ProtectEntry
);
4758 if (!PyArg_ParseTuple(_args
, "hb",
4769 static PyObject
*Qd_ReserveEntry(PyObject
*_self
, PyObject
*_args
)
4771 PyObject
*_res
= NULL
;
4774 #ifndef ReserveEntry
4775 PyMac_PRECHECK(ReserveEntry
);
4777 if (!PyArg_ParseTuple(_args
, "hb",
4788 static PyObject
*Qd_QDError(PyObject
*_self
, PyObject
*_args
)
4790 PyObject
*_res
= NULL
;
4793 PyMac_PRECHECK(QDError
);
4795 if (!PyArg_ParseTuple(_args
, ""))
4798 _res
= Py_BuildValue("h",
4803 static PyObject
*Qd_CopyDeepMask(PyObject
*_self
, PyObject
*_args
)
4805 PyObject
*_res
= NULL
;
4814 #ifndef CopyDeepMask
4815 PyMac_PRECHECK(CopyDeepMask
);
4817 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&hO&",
4818 BMObj_Convert
, &srcBits
,
4819 BMObj_Convert
, &maskBits
,
4820 BMObj_Convert
, &dstBits
,
4821 PyMac_GetRect
, &srcRect
,
4822 PyMac_GetRect
, &maskRect
,
4823 PyMac_GetRect
, &dstRect
,
4825 OptResObj_Convert
, &maskRgn
))
4827 CopyDeepMask(srcBits
,
4840 static PyObject
*Qd_GetPattern(PyObject
*_self
, PyObject
*_args
)
4842 PyObject
*_res
= NULL
;
4846 PyMac_PRECHECK(GetPattern
);
4848 if (!PyArg_ParseTuple(_args
, "h",
4851 _rv
= GetPattern(patternID
);
4852 _res
= Py_BuildValue("O&",
4857 static PyObject
*Qd_MacGetCursor(PyObject
*_self
, PyObject
*_args
)
4859 PyObject
*_res
= NULL
;
4862 #ifndef MacGetCursor
4863 PyMac_PRECHECK(MacGetCursor
);
4865 if (!PyArg_ParseTuple(_args
, "h",
4868 _rv
= MacGetCursor(cursorID
);
4869 _res
= Py_BuildValue("O&",
4874 static PyObject
*Qd_GetPicture(PyObject
*_self
, PyObject
*_args
)
4876 PyObject
*_res
= NULL
;
4880 PyMac_PRECHECK(GetPicture
);
4882 if (!PyArg_ParseTuple(_args
, "h",
4885 _rv
= GetPicture(pictureID
);
4886 _res
= Py_BuildValue("O&",
4891 static PyObject
*Qd_DeltaPoint(PyObject
*_self
, PyObject
*_args
)
4893 PyObject
*_res
= NULL
;
4898 PyMac_PRECHECK(DeltaPoint
);
4900 if (!PyArg_ParseTuple(_args
, "O&O&",
4901 PyMac_GetPoint
, &ptA
,
4902 PyMac_GetPoint
, &ptB
))
4904 _rv
= DeltaPoint(ptA
,
4906 _res
= Py_BuildValue("l",
4911 static PyObject
*Qd_ShieldCursor(PyObject
*_self
, PyObject
*_args
)
4913 PyObject
*_res
= NULL
;
4916 #ifndef ShieldCursor
4917 PyMac_PRECHECK(ShieldCursor
);
4919 if (!PyArg_ParseTuple(_args
, "O&O&",
4920 PyMac_GetRect
, &shieldRect
,
4921 PyMac_GetPoint
, &offsetPt
))
4923 ShieldCursor(&shieldRect
,
4930 static PyObject
*Qd_ScreenRes(PyObject
*_self
, PyObject
*_args
)
4932 PyObject
*_res
= NULL
;
4936 PyMac_PRECHECK(ScreenRes
);
4938 if (!PyArg_ParseTuple(_args
, ""))
4940 ScreenRes(&scrnHRes
,
4942 _res
= Py_BuildValue("hh",
4948 static PyObject
*Qd_GetIndPattern(PyObject
*_self
, PyObject
*_args
)
4950 PyObject
*_res
= NULL
;
4951 Pattern thePat__out__
;
4952 short patternListID
;
4954 #ifndef GetIndPattern
4955 PyMac_PRECHECK(GetIndPattern
);
4957 if (!PyArg_ParseTuple(_args
, "hh",
4961 GetIndPattern(&thePat__out__
,
4964 _res
= Py_BuildValue("s#",
4965 (char *)&thePat__out__
, (int)sizeof(Pattern
));
4969 static PyObject
*Qd_SlopeFromAngle(PyObject
*_self
, PyObject
*_args
)
4971 PyObject
*_res
= NULL
;
4974 #ifndef SlopeFromAngle
4975 PyMac_PRECHECK(SlopeFromAngle
);
4977 if (!PyArg_ParseTuple(_args
, "h",
4980 _rv
= SlopeFromAngle(angle
);
4981 _res
= Py_BuildValue("O&",
4982 PyMac_BuildFixed
, _rv
);
4986 static PyObject
*Qd_AngleFromSlope(PyObject
*_self
, PyObject
*_args
)
4988 PyObject
*_res
= NULL
;
4991 #ifndef AngleFromSlope
4992 PyMac_PRECHECK(AngleFromSlope
);
4994 if (!PyArg_ParseTuple(_args
, "O&",
4995 PyMac_GetFixed
, &slope
))
4997 _rv
= AngleFromSlope(slope
);
4998 _res
= Py_BuildValue("h",
5003 static PyObject
*Qd_GetPixBounds(PyObject
*_self
, PyObject
*_args
)
5005 PyObject
*_res
= NULL
;
5006 PixMapHandle pixMap
;
5008 #ifndef GetPixBounds
5009 PyMac_PRECHECK(GetPixBounds
);
5011 if (!PyArg_ParseTuple(_args
, "O&",
5012 ResObj_Convert
, &pixMap
))
5014 GetPixBounds(pixMap
,
5016 _res
= Py_BuildValue("O&",
5017 PyMac_BuildRect
, &bounds
);
5021 static PyObject
*Qd_GetPixDepth(PyObject
*_self
, PyObject
*_args
)
5023 PyObject
*_res
= NULL
;
5025 PixMapHandle pixMap
;
5027 PyMac_PRECHECK(GetPixDepth
);
5029 if (!PyArg_ParseTuple(_args
, "O&",
5030 ResObj_Convert
, &pixMap
))
5032 _rv
= GetPixDepth(pixMap
);
5033 _res
= Py_BuildValue("h",
5038 static PyObject
*Qd_GetQDGlobalsRandomSeed(PyObject
*_self
, PyObject
*_args
)
5040 PyObject
*_res
= NULL
;
5042 #ifndef GetQDGlobalsRandomSeed
5043 PyMac_PRECHECK(GetQDGlobalsRandomSeed
);
5045 if (!PyArg_ParseTuple(_args
, ""))
5047 _rv
= GetQDGlobalsRandomSeed();
5048 _res
= Py_BuildValue("l",
5053 static PyObject
*Qd_GetQDGlobalsScreenBits(PyObject
*_self
, PyObject
*_args
)
5055 PyObject
*_res
= NULL
;
5057 #ifndef GetQDGlobalsScreenBits
5058 PyMac_PRECHECK(GetQDGlobalsScreenBits
);
5060 if (!PyArg_ParseTuple(_args
, ""))
5062 GetQDGlobalsScreenBits(&screenBits
);
5063 _res
= Py_BuildValue("O&",
5064 BMObj_NewCopied
, &screenBits
);
5068 static PyObject
*Qd_GetQDGlobalsArrow(PyObject
*_self
, PyObject
*_args
)
5070 PyObject
*_res
= NULL
;
5071 Cursor arrow__out__
;
5072 #ifndef GetQDGlobalsArrow
5073 PyMac_PRECHECK(GetQDGlobalsArrow
);
5075 if (!PyArg_ParseTuple(_args
, ""))
5077 GetQDGlobalsArrow(&arrow__out__
);
5078 _res
= Py_BuildValue("s#",
5079 (char *)&arrow__out__
, (int)sizeof(Cursor
));
5083 static PyObject
*Qd_GetQDGlobalsDarkGray(PyObject
*_self
, PyObject
*_args
)
5085 PyObject
*_res
= NULL
;
5086 Pattern dkGray__out__
;
5087 #ifndef GetQDGlobalsDarkGray
5088 PyMac_PRECHECK(GetQDGlobalsDarkGray
);
5090 if (!PyArg_ParseTuple(_args
, ""))
5092 GetQDGlobalsDarkGray(&dkGray__out__
);
5093 _res
= Py_BuildValue("s#",
5094 (char *)&dkGray__out__
, (int)sizeof(Pattern
));
5098 static PyObject
*Qd_GetQDGlobalsLightGray(PyObject
*_self
, PyObject
*_args
)
5100 PyObject
*_res
= NULL
;
5101 Pattern ltGray__out__
;
5102 #ifndef GetQDGlobalsLightGray
5103 PyMac_PRECHECK(GetQDGlobalsLightGray
);
5105 if (!PyArg_ParseTuple(_args
, ""))
5107 GetQDGlobalsLightGray(<Gray__out__
);
5108 _res
= Py_BuildValue("s#",
5109 (char *)<Gray__out__
, (int)sizeof(Pattern
));
5113 static PyObject
*Qd_GetQDGlobalsGray(PyObject
*_self
, PyObject
*_args
)
5115 PyObject
*_res
= NULL
;
5116 Pattern gray__out__
;
5117 #ifndef GetQDGlobalsGray
5118 PyMac_PRECHECK(GetQDGlobalsGray
);
5120 if (!PyArg_ParseTuple(_args
, ""))
5122 GetQDGlobalsGray(&gray__out__
);
5123 _res
= Py_BuildValue("s#",
5124 (char *)&gray__out__
, (int)sizeof(Pattern
));
5128 static PyObject
*Qd_GetQDGlobalsBlack(PyObject
*_self
, PyObject
*_args
)
5130 PyObject
*_res
= NULL
;
5131 Pattern black__out__
;
5132 #ifndef GetQDGlobalsBlack
5133 PyMac_PRECHECK(GetQDGlobalsBlack
);
5135 if (!PyArg_ParseTuple(_args
, ""))
5137 GetQDGlobalsBlack(&black__out__
);
5138 _res
= Py_BuildValue("s#",
5139 (char *)&black__out__
, (int)sizeof(Pattern
));
5143 static PyObject
*Qd_GetQDGlobalsWhite(PyObject
*_self
, PyObject
*_args
)
5145 PyObject
*_res
= NULL
;
5146 Pattern white__out__
;
5147 #ifndef GetQDGlobalsWhite
5148 PyMac_PRECHECK(GetQDGlobalsWhite
);
5150 if (!PyArg_ParseTuple(_args
, ""))
5152 GetQDGlobalsWhite(&white__out__
);
5153 _res
= Py_BuildValue("s#",
5154 (char *)&white__out__
, (int)sizeof(Pattern
));
5158 static PyObject
*Qd_GetQDGlobalsThePort(PyObject
*_self
, PyObject
*_args
)
5160 PyObject
*_res
= NULL
;
5162 #ifndef GetQDGlobalsThePort
5163 PyMac_PRECHECK(GetQDGlobalsThePort
);
5165 if (!PyArg_ParseTuple(_args
, ""))
5167 _rv
= GetQDGlobalsThePort();
5168 _res
= Py_BuildValue("O&",
5173 static PyObject
*Qd_SetQDGlobalsRandomSeed(PyObject
*_self
, PyObject
*_args
)
5175 PyObject
*_res
= NULL
;
5177 #ifndef SetQDGlobalsRandomSeed
5178 PyMac_PRECHECK(SetQDGlobalsRandomSeed
);
5180 if (!PyArg_ParseTuple(_args
, "l",
5183 SetQDGlobalsRandomSeed(randomSeed
);
5189 static PyObject
*Qd_SetQDGlobalsArrow(PyObject
*_self
, PyObject
*_args
)
5191 PyObject
*_res
= NULL
;
5192 Cursor
*arrow__in__
;
5193 int arrow__in_len__
;
5194 #ifndef SetQDGlobalsArrow
5195 PyMac_PRECHECK(SetQDGlobalsArrow
);
5197 if (!PyArg_ParseTuple(_args
, "s#",
5198 (char **)&arrow__in__
, &arrow__in_len__
))
5200 if (arrow__in_len__
!= sizeof(Cursor
))
5202 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
5203 goto arrow__error__
;
5205 SetQDGlobalsArrow(arrow__in__
);
5212 static PyObject
*Qd_GetRegionBounds(PyObject
*_self
, PyObject
*_args
)
5214 PyObject
*_res
= NULL
;
5217 #ifndef GetRegionBounds
5218 PyMac_PRECHECK(GetRegionBounds
);
5220 if (!PyArg_ParseTuple(_args
, "O&",
5221 ResObj_Convert
, ®ion
))
5223 GetRegionBounds(region
,
5225 _res
= Py_BuildValue("O&",
5226 PyMac_BuildRect
, &bounds
);
5230 static PyObject
*Qd_IsRegionRectangular(PyObject
*_self
, PyObject
*_args
)
5232 PyObject
*_res
= NULL
;
5235 #ifndef IsRegionRectangular
5236 PyMac_PRECHECK(IsRegionRectangular
);
5238 if (!PyArg_ParseTuple(_args
, "O&",
5239 ResObj_Convert
, ®ion
))
5241 _rv
= IsRegionRectangular(region
);
5242 _res
= Py_BuildValue("b",
5247 static PyObject
*Qd_CreateNewPort(PyObject
*_self
, PyObject
*_args
)
5249 PyObject
*_res
= NULL
;
5251 #ifndef CreateNewPort
5252 PyMac_PRECHECK(CreateNewPort
);
5254 if (!PyArg_ParseTuple(_args
, ""))
5256 _rv
= CreateNewPort();
5257 _res
= Py_BuildValue("O&",
5262 static PyObject
*Qd_SetQDError(PyObject
*_self
, PyObject
*_args
)
5264 PyObject
*_res
= NULL
;
5267 PyMac_PRECHECK(SetQDError
);
5269 if (!PyArg_ParseTuple(_args
, "h",
5278 static PyObject
*Qd_LMGetScrVRes(PyObject
*_self
, PyObject
*_args
)
5280 PyObject
*_res
= NULL
;
5282 #ifndef LMGetScrVRes
5283 PyMac_PRECHECK(LMGetScrVRes
);
5285 if (!PyArg_ParseTuple(_args
, ""))
5287 _rv
= LMGetScrVRes();
5288 _res
= Py_BuildValue("h",
5293 static PyObject
*Qd_LMSetScrVRes(PyObject
*_self
, PyObject
*_args
)
5295 PyObject
*_res
= NULL
;
5297 #ifndef LMSetScrVRes
5298 PyMac_PRECHECK(LMSetScrVRes
);
5300 if (!PyArg_ParseTuple(_args
, "h",
5303 LMSetScrVRes(value
);
5309 static PyObject
*Qd_LMGetScrHRes(PyObject
*_self
, PyObject
*_args
)
5311 PyObject
*_res
= NULL
;
5313 #ifndef LMGetScrHRes
5314 PyMac_PRECHECK(LMGetScrHRes
);
5316 if (!PyArg_ParseTuple(_args
, ""))
5318 _rv
= LMGetScrHRes();
5319 _res
= Py_BuildValue("h",
5324 static PyObject
*Qd_LMSetScrHRes(PyObject
*_self
, PyObject
*_args
)
5326 PyObject
*_res
= NULL
;
5328 #ifndef LMSetScrHRes
5329 PyMac_PRECHECK(LMSetScrHRes
);
5331 if (!PyArg_ParseTuple(_args
, "h",
5334 LMSetScrHRes(value
);
5340 static PyObject
*Qd_LMGetMainDevice(PyObject
*_self
, PyObject
*_args
)
5342 PyObject
*_res
= NULL
;
5344 #ifndef LMGetMainDevice
5345 PyMac_PRECHECK(LMGetMainDevice
);
5347 if (!PyArg_ParseTuple(_args
, ""))
5349 _rv
= LMGetMainDevice();
5350 _res
= Py_BuildValue("O&",
5355 static PyObject
*Qd_LMSetMainDevice(PyObject
*_self
, PyObject
*_args
)
5357 PyObject
*_res
= NULL
;
5359 #ifndef LMSetMainDevice
5360 PyMac_PRECHECK(LMSetMainDevice
);
5362 if (!PyArg_ParseTuple(_args
, "O&",
5363 ResObj_Convert
, &value
))
5365 LMSetMainDevice(value
);
5371 static PyObject
*Qd_LMGetDeviceList(PyObject
*_self
, PyObject
*_args
)
5373 PyObject
*_res
= NULL
;
5375 #ifndef LMGetDeviceList
5376 PyMac_PRECHECK(LMGetDeviceList
);
5378 if (!PyArg_ParseTuple(_args
, ""))
5380 _rv
= LMGetDeviceList();
5381 _res
= Py_BuildValue("O&",
5386 static PyObject
*Qd_LMSetDeviceList(PyObject
*_self
, PyObject
*_args
)
5388 PyObject
*_res
= NULL
;
5390 #ifndef LMSetDeviceList
5391 PyMac_PRECHECK(LMSetDeviceList
);
5393 if (!PyArg_ParseTuple(_args
, "O&",
5394 ResObj_Convert
, &value
))
5396 LMSetDeviceList(value
);
5402 static PyObject
*Qd_LMGetQDColors(PyObject
*_self
, PyObject
*_args
)
5404 PyObject
*_res
= NULL
;
5406 #ifndef LMGetQDColors
5407 PyMac_PRECHECK(LMGetQDColors
);
5409 if (!PyArg_ParseTuple(_args
, ""))
5411 _rv
= LMGetQDColors();
5412 _res
= Py_BuildValue("O&",
5417 static PyObject
*Qd_LMSetQDColors(PyObject
*_self
, PyObject
*_args
)
5419 PyObject
*_res
= NULL
;
5421 #ifndef LMSetQDColors
5422 PyMac_PRECHECK(LMSetQDColors
);
5424 if (!PyArg_ParseTuple(_args
, "O&",
5425 ResObj_Convert
, &value
))
5427 LMSetQDColors(value
);
5433 static PyObject
*Qd_LMGetWidthListHand(PyObject
*_self
, PyObject
*_args
)
5435 PyObject
*_res
= NULL
;
5437 #ifndef LMGetWidthListHand
5438 PyMac_PRECHECK(LMGetWidthListHand
);
5440 if (!PyArg_ParseTuple(_args
, ""))
5442 _rv
= LMGetWidthListHand();
5443 _res
= Py_BuildValue("O&",
5448 static PyObject
*Qd_LMSetWidthListHand(PyObject
*_self
, PyObject
*_args
)
5450 PyObject
*_res
= NULL
;
5452 #ifndef LMSetWidthListHand
5453 PyMac_PRECHECK(LMSetWidthListHand
);
5455 if (!PyArg_ParseTuple(_args
, "O&",
5456 ResObj_Convert
, &value
))
5458 LMSetWidthListHand(value
);
5464 static PyObject
*Qd_LMGetHiliteMode(PyObject
*_self
, PyObject
*_args
)
5466 PyObject
*_res
= NULL
;
5468 #ifndef LMGetHiliteMode
5469 PyMac_PRECHECK(LMGetHiliteMode
);
5471 if (!PyArg_ParseTuple(_args
, ""))
5473 _rv
= LMGetHiliteMode();
5474 _res
= Py_BuildValue("b",
5479 static PyObject
*Qd_LMSetHiliteMode(PyObject
*_self
, PyObject
*_args
)
5481 PyObject
*_res
= NULL
;
5483 #ifndef LMSetHiliteMode
5484 PyMac_PRECHECK(LMSetHiliteMode
);
5486 if (!PyArg_ParseTuple(_args
, "b",
5489 LMSetHiliteMode(value
);
5495 static PyObject
*Qd_LMGetWidthTabHandle(PyObject
*_self
, PyObject
*_args
)
5497 PyObject
*_res
= NULL
;
5499 #ifndef LMGetWidthTabHandle
5500 PyMac_PRECHECK(LMGetWidthTabHandle
);
5502 if (!PyArg_ParseTuple(_args
, ""))
5504 _rv
= LMGetWidthTabHandle();
5505 _res
= Py_BuildValue("O&",
5510 static PyObject
*Qd_LMSetWidthTabHandle(PyObject
*_self
, PyObject
*_args
)
5512 PyObject
*_res
= NULL
;
5514 #ifndef LMSetWidthTabHandle
5515 PyMac_PRECHECK(LMSetWidthTabHandle
);
5517 if (!PyArg_ParseTuple(_args
, "O&",
5518 ResObj_Convert
, &value
))
5520 LMSetWidthTabHandle(value
);
5526 static PyObject
*Qd_LMGetLastSPExtra(PyObject
*_self
, PyObject
*_args
)
5528 PyObject
*_res
= NULL
;
5530 #ifndef LMGetLastSPExtra
5531 PyMac_PRECHECK(LMGetLastSPExtra
);
5533 if (!PyArg_ParseTuple(_args
, ""))
5535 _rv
= LMGetLastSPExtra();
5536 _res
= Py_BuildValue("l",
5541 static PyObject
*Qd_LMSetLastSPExtra(PyObject
*_self
, PyObject
*_args
)
5543 PyObject
*_res
= NULL
;
5545 #ifndef LMSetLastSPExtra
5546 PyMac_PRECHECK(LMSetLastSPExtra
);
5548 if (!PyArg_ParseTuple(_args
, "l",
5551 LMSetLastSPExtra(value
);
5557 static PyObject
*Qd_LMGetLastFOND(PyObject
*_self
, PyObject
*_args
)
5559 PyObject
*_res
= NULL
;
5561 #ifndef LMGetLastFOND
5562 PyMac_PRECHECK(LMGetLastFOND
);
5564 if (!PyArg_ParseTuple(_args
, ""))
5566 _rv
= LMGetLastFOND();
5567 _res
= Py_BuildValue("O&",
5572 static PyObject
*Qd_LMSetLastFOND(PyObject
*_self
, PyObject
*_args
)
5574 PyObject
*_res
= NULL
;
5576 #ifndef LMSetLastFOND
5577 PyMac_PRECHECK(LMSetLastFOND
);
5579 if (!PyArg_ParseTuple(_args
, "O&",
5580 ResObj_Convert
, &value
))
5582 LMSetLastFOND(value
);
5588 static PyObject
*Qd_LMGetFractEnable(PyObject
*_self
, PyObject
*_args
)
5590 PyObject
*_res
= NULL
;
5592 #ifndef LMGetFractEnable
5593 PyMac_PRECHECK(LMGetFractEnable
);
5595 if (!PyArg_ParseTuple(_args
, ""))
5597 _rv
= LMGetFractEnable();
5598 _res
= Py_BuildValue("b",
5603 static PyObject
*Qd_LMSetFractEnable(PyObject
*_self
, PyObject
*_args
)
5605 PyObject
*_res
= NULL
;
5607 #ifndef LMSetFractEnable
5608 PyMac_PRECHECK(LMSetFractEnable
);
5610 if (!PyArg_ParseTuple(_args
, "b",
5613 LMSetFractEnable(value
);
5619 static PyObject
*Qd_LMGetTheGDevice(PyObject
*_self
, PyObject
*_args
)
5621 PyObject
*_res
= NULL
;
5623 #ifndef LMGetTheGDevice
5624 PyMac_PRECHECK(LMGetTheGDevice
);
5626 if (!PyArg_ParseTuple(_args
, ""))
5628 _rv
= LMGetTheGDevice();
5629 _res
= Py_BuildValue("O&",
5634 static PyObject
*Qd_LMSetTheGDevice(PyObject
*_self
, PyObject
*_args
)
5636 PyObject
*_res
= NULL
;
5638 #ifndef LMSetTheGDevice
5639 PyMac_PRECHECK(LMSetTheGDevice
);
5641 if (!PyArg_ParseTuple(_args
, "O&",
5642 ResObj_Convert
, &value
))
5644 LMSetTheGDevice(value
);
5650 static PyObject
*Qd_LMGetHiliteRGB(PyObject
*_self
, PyObject
*_args
)
5652 PyObject
*_res
= NULL
;
5653 RGBColor hiliteRGBValue
;
5654 #ifndef LMGetHiliteRGB
5655 PyMac_PRECHECK(LMGetHiliteRGB
);
5657 if (!PyArg_ParseTuple(_args
, ""))
5659 LMGetHiliteRGB(&hiliteRGBValue
);
5660 _res
= Py_BuildValue("O&",
5661 QdRGB_New
, &hiliteRGBValue
);
5665 static PyObject
*Qd_LMSetHiliteRGB(PyObject
*_self
, PyObject
*_args
)
5667 PyObject
*_res
= NULL
;
5668 RGBColor hiliteRGBValue
;
5669 #ifndef LMSetHiliteRGB
5670 PyMac_PRECHECK(LMSetHiliteRGB
);
5672 if (!PyArg_ParseTuple(_args
, "O&",
5673 QdRGB_Convert
, &hiliteRGBValue
))
5675 LMSetHiliteRGB(&hiliteRGBValue
);
5681 static PyObject
*Qd_LMGetCursorNew(PyObject
*_self
, PyObject
*_args
)
5683 PyObject
*_res
= NULL
;
5685 #ifndef LMGetCursorNew
5686 PyMac_PRECHECK(LMGetCursorNew
);
5688 if (!PyArg_ParseTuple(_args
, ""))
5690 _rv
= LMGetCursorNew();
5691 _res
= Py_BuildValue("b",
5696 static PyObject
*Qd_LMSetCursorNew(PyObject
*_self
, PyObject
*_args
)
5698 PyObject
*_res
= NULL
;
5700 #ifndef LMSetCursorNew
5701 PyMac_PRECHECK(LMSetCursorNew
);
5703 if (!PyArg_ParseTuple(_args
, "b",
5706 LMSetCursorNew(value
);
5712 static PyObject
*Qd_TextFont(PyObject
*_self
, PyObject
*_args
)
5714 PyObject
*_res
= NULL
;
5717 PyMac_PRECHECK(TextFont
);
5719 if (!PyArg_ParseTuple(_args
, "h",
5728 static PyObject
*Qd_TextFace(PyObject
*_self
, PyObject
*_args
)
5730 PyObject
*_res
= NULL
;
5731 StyleParameter face
;
5733 PyMac_PRECHECK(TextFace
);
5735 if (!PyArg_ParseTuple(_args
, "h",
5744 static PyObject
*Qd_TextMode(PyObject
*_self
, PyObject
*_args
)
5746 PyObject
*_res
= NULL
;
5749 PyMac_PRECHECK(TextMode
);
5751 if (!PyArg_ParseTuple(_args
, "h",
5760 static PyObject
*Qd_TextSize(PyObject
*_self
, PyObject
*_args
)
5762 PyObject
*_res
= NULL
;
5765 PyMac_PRECHECK(TextSize
);
5767 if (!PyArg_ParseTuple(_args
, "h",
5776 static PyObject
*Qd_SpaceExtra(PyObject
*_self
, PyObject
*_args
)
5778 PyObject
*_res
= NULL
;
5781 PyMac_PRECHECK(SpaceExtra
);
5783 if (!PyArg_ParseTuple(_args
, "O&",
5784 PyMac_GetFixed
, &extra
))
5792 static PyObject
*Qd_DrawChar(PyObject
*_self
, PyObject
*_args
)
5794 PyObject
*_res
= NULL
;
5797 PyMac_PRECHECK(DrawChar
);
5799 if (!PyArg_ParseTuple(_args
, "h",
5808 static PyObject
*Qd_DrawString(PyObject
*_self
, PyObject
*_args
)
5810 PyObject
*_res
= NULL
;
5813 PyMac_PRECHECK(DrawString
);
5815 if (!PyArg_ParseTuple(_args
, "O&",
5816 PyMac_GetStr255
, s
))
5824 static PyObject
*Qd_MacDrawText(PyObject
*_self
, PyObject
*_args
)
5826 PyObject
*_res
= NULL
;
5827 char *textBuf__in__
;
5828 int textBuf__in_len__
;
5832 PyMac_PRECHECK(MacDrawText
);
5834 if (!PyArg_ParseTuple(_args
, "s#hh",
5835 &textBuf__in__
, &textBuf__in_len__
,
5839 /* Fool compiler warnings */
5840 textBuf__in_len__
= textBuf__in_len__
;
5841 MacDrawText(textBuf__in__
,
5849 static PyObject
*Qd_CharWidth(PyObject
*_self
, PyObject
*_args
)
5851 PyObject
*_res
= NULL
;
5855 PyMac_PRECHECK(CharWidth
);
5857 if (!PyArg_ParseTuple(_args
, "h",
5860 _rv
= CharWidth(ch
);
5861 _res
= Py_BuildValue("h",
5866 static PyObject
*Qd_StringWidth(PyObject
*_self
, PyObject
*_args
)
5868 PyObject
*_res
= NULL
;
5872 PyMac_PRECHECK(StringWidth
);
5874 if (!PyArg_ParseTuple(_args
, "O&",
5875 PyMac_GetStr255
, s
))
5877 _rv
= StringWidth(s
);
5878 _res
= Py_BuildValue("h",
5883 static PyObject
*Qd_TextWidth(PyObject
*_self
, PyObject
*_args
)
5885 PyObject
*_res
= NULL
;
5887 char *textBuf__in__
;
5888 int textBuf__in_len__
;
5892 PyMac_PRECHECK(TextWidth
);
5894 if (!PyArg_ParseTuple(_args
, "s#hh",
5895 &textBuf__in__
, &textBuf__in_len__
,
5899 /* Fool compiler warnings */
5900 textBuf__in_len__
= textBuf__in_len__
;
5901 _rv
= TextWidth(textBuf__in__
,
5904 _res
= Py_BuildValue("h",
5909 static PyObject
*Qd_GetFontInfo(PyObject
*_self
, PyObject
*_args
)
5911 PyObject
*_res
= NULL
;
5914 PyMac_PRECHECK(GetFontInfo
);
5916 if (!PyArg_ParseTuple(_args
, ""))
5919 _res
= Py_BuildValue("O&",
5924 static PyObject
*Qd_CharExtra(PyObject
*_self
, PyObject
*_args
)
5926 PyObject
*_res
= NULL
;
5929 PyMac_PRECHECK(CharExtra
);
5931 if (!PyArg_ParseTuple(_args
, "O&",
5932 PyMac_GetFixed
, &extra
))
5940 static PyObject
*Qd_TruncString(PyObject
*_self
, PyObject
*_args
)
5942 PyObject
*_res
= NULL
;
5946 TruncCode truncWhere
;
5948 PyMac_PRECHECK(TruncString
);
5950 if (!PyArg_ParseTuple(_args
, "hO&h",
5952 PyMac_GetStr255
, theString
,
5955 _rv
= TruncString(width
,
5958 _res
= Py_BuildValue("h",
5963 static PyObject
*Qd_SetPort(PyObject
*_self
, PyObject
*_args
)
5965 PyObject
*_res
= NULL
;
5968 PyMac_PRECHECK(SetPort
);
5970 if (!PyArg_ParseTuple(_args
, "O&",
5971 GrafObj_Convert
, &thePort
))
5979 static PyObject
*Qd_GetCursor(PyObject
*_self
, PyObject
*_args
)
5981 PyObject
*_res
= NULL
;
5985 PyMac_PRECHECK(GetCursor
);
5987 if (!PyArg_ParseTuple(_args
, "h",
5990 _rv
= GetCursor(cursorID
);
5991 _res
= Py_BuildValue("O&",
5996 static PyObject
*Qd_SetCursor(PyObject
*_self
, PyObject
*_args
)
5998 PyObject
*_res
= NULL
;
6002 PyMac_PRECHECK(SetCursor
);
6004 if (!PyArg_ParseTuple(_args
, "s#",
6005 (char **)&crsr__in__
, &crsr__in_len__
))
6007 if (crsr__in_len__
!= sizeof(Cursor
))
6009 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
6012 SetCursor(crsr__in__
);
6019 static PyObject
*Qd_ShowCursor(PyObject
*_self
, PyObject
*_args
)
6021 PyObject
*_res
= NULL
;
6023 PyMac_PRECHECK(ShowCursor
);
6025 if (!PyArg_ParseTuple(_args
, ""))
6033 static PyObject
*Qd_LineTo(PyObject
*_self
, PyObject
*_args
)
6035 PyObject
*_res
= NULL
;
6039 PyMac_PRECHECK(LineTo
);
6041 if (!PyArg_ParseTuple(_args
, "hh",
6052 static PyObject
*Qd_SetRect(PyObject
*_self
, PyObject
*_args
)
6054 PyObject
*_res
= NULL
;
6061 PyMac_PRECHECK(SetRect
);
6063 if (!PyArg_ParseTuple(_args
, "hhhh",
6074 _res
= Py_BuildValue("O&",
6075 PyMac_BuildRect
, &r
);
6079 static PyObject
*Qd_OffsetRect(PyObject
*_self
, PyObject
*_args
)
6081 PyObject
*_res
= NULL
;
6086 PyMac_PRECHECK(OffsetRect
);
6088 if (!PyArg_ParseTuple(_args
, "O&hh",
6096 _res
= Py_BuildValue("O&",
6097 PyMac_BuildRect
, &r
);
6101 static PyObject
*Qd_InsetRect(PyObject
*_self
, PyObject
*_args
)
6103 PyObject
*_res
= NULL
;
6108 PyMac_PRECHECK(InsetRect
);
6110 if (!PyArg_ParseTuple(_args
, "O&hh",
6118 _res
= Py_BuildValue("O&",
6119 PyMac_BuildRect
, &r
);
6123 static PyObject
*Qd_UnionRect(PyObject
*_self
, PyObject
*_args
)
6125 PyObject
*_res
= NULL
;
6130 PyMac_PRECHECK(UnionRect
);
6132 if (!PyArg_ParseTuple(_args
, "O&O&",
6133 PyMac_GetRect
, &src1
,
6134 PyMac_GetRect
, &src2
))
6139 _res
= Py_BuildValue("O&",
6140 PyMac_BuildRect
, &dstRect
);
6144 static PyObject
*Qd_EqualRect(PyObject
*_self
, PyObject
*_args
)
6146 PyObject
*_res
= NULL
;
6151 PyMac_PRECHECK(EqualRect
);
6153 if (!PyArg_ParseTuple(_args
, "O&O&",
6154 PyMac_GetRect
, &rect1
,
6155 PyMac_GetRect
, &rect2
))
6157 _rv
= EqualRect(&rect1
,
6159 _res
= Py_BuildValue("b",
6164 static PyObject
*Qd_FrameRect(PyObject
*_self
, PyObject
*_args
)
6166 PyObject
*_res
= NULL
;
6169 PyMac_PRECHECK(FrameRect
);
6171 if (!PyArg_ParseTuple(_args
, "O&",
6180 static PyObject
*Qd_InvertRect(PyObject
*_self
, PyObject
*_args
)
6182 PyObject
*_res
= NULL
;
6185 PyMac_PRECHECK(InvertRect
);
6187 if (!PyArg_ParseTuple(_args
, "O&",
6196 static PyObject
*Qd_FillRect(PyObject
*_self
, PyObject
*_args
)
6198 PyObject
*_res
= NULL
;
6203 PyMac_PRECHECK(FillRect
);
6205 if (!PyArg_ParseTuple(_args
, "O&s#",
6207 (char **)&pat__in__
, &pat__in_len__
))
6209 if (pat__in_len__
!= sizeof(Pattern
))
6211 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
6222 static PyObject
*Qd_CopyRgn(PyObject
*_self
, PyObject
*_args
)
6224 PyObject
*_res
= NULL
;
6228 PyMac_PRECHECK(CopyRgn
);
6230 if (!PyArg_ParseTuple(_args
, "O&O&",
6231 ResObj_Convert
, &srcRgn
,
6232 ResObj_Convert
, &dstRgn
))
6241 static PyObject
*Qd_SetRectRgn(PyObject
*_self
, PyObject
*_args
)
6243 PyObject
*_res
= NULL
;
6250 PyMac_PRECHECK(SetRectRgn
);
6252 if (!PyArg_ParseTuple(_args
, "O&hhhh",
6253 ResObj_Convert
, &rgn
,
6269 static PyObject
*Qd_OffsetRgn(PyObject
*_self
, PyObject
*_args
)
6271 PyObject
*_res
= NULL
;
6276 PyMac_PRECHECK(OffsetRgn
);
6278 if (!PyArg_ParseTuple(_args
, "O&hh",
6279 ResObj_Convert
, &rgn
,
6291 static PyObject
*Qd_UnionRgn(PyObject
*_self
, PyObject
*_args
)
6293 PyObject
*_res
= NULL
;
6298 PyMac_PRECHECK(UnionRgn
);
6300 if (!PyArg_ParseTuple(_args
, "O&O&O&",
6301 ResObj_Convert
, &srcRgnA
,
6302 ResObj_Convert
, &srcRgnB
,
6303 ResObj_Convert
, &dstRgn
))
6313 static PyObject
*Qd_XorRgn(PyObject
*_self
, PyObject
*_args
)
6315 PyObject
*_res
= NULL
;
6320 PyMac_PRECHECK(XorRgn
);
6322 if (!PyArg_ParseTuple(_args
, "O&O&O&",
6323 ResObj_Convert
, &srcRgnA
,
6324 ResObj_Convert
, &srcRgnB
,
6325 ResObj_Convert
, &dstRgn
))
6335 static PyObject
*Qd_EqualRgn(PyObject
*_self
, PyObject
*_args
)
6337 PyObject
*_res
= NULL
;
6342 PyMac_PRECHECK(EqualRgn
);
6344 if (!PyArg_ParseTuple(_args
, "O&O&",
6345 ResObj_Convert
, &rgnA
,
6346 ResObj_Convert
, &rgnB
))
6348 _rv
= EqualRgn(rgnA
,
6350 _res
= Py_BuildValue("b",
6355 static PyObject
*Qd_FrameRgn(PyObject
*_self
, PyObject
*_args
)
6357 PyObject
*_res
= NULL
;
6360 PyMac_PRECHECK(FrameRgn
);
6362 if (!PyArg_ParseTuple(_args
, "O&",
6363 ResObj_Convert
, &rgn
))
6371 static PyObject
*Qd_PaintRgn(PyObject
*_self
, PyObject
*_args
)
6373 PyObject
*_res
= NULL
;
6376 PyMac_PRECHECK(PaintRgn
);
6378 if (!PyArg_ParseTuple(_args
, "O&",
6379 ResObj_Convert
, &rgn
))
6387 static PyObject
*Qd_InvertRgn(PyObject
*_self
, PyObject
*_args
)
6389 PyObject
*_res
= NULL
;
6392 PyMac_PRECHECK(InvertRgn
);
6394 if (!PyArg_ParseTuple(_args
, "O&",
6395 ResObj_Convert
, &rgn
))
6403 static PyObject
*Qd_FillRgn(PyObject
*_self
, PyObject
*_args
)
6405 PyObject
*_res
= NULL
;
6410 PyMac_PRECHECK(FillRgn
);
6412 if (!PyArg_ParseTuple(_args
, "O&s#",
6413 ResObj_Convert
, &rgn
,
6414 (char **)&pat__in__
, &pat__in_len__
))
6416 if (pat__in_len__
!= sizeof(Pattern
))
6418 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
6429 static PyObject
*Qd_GetPixel(PyObject
*_self
, PyObject
*_args
)
6431 PyObject
*_res
= NULL
;
6436 PyMac_PRECHECK(GetPixel
);
6438 if (!PyArg_ParseTuple(_args
, "hh",
6444 _res
= Py_BuildValue("b",
6449 static PyObject
*Qd_PtInRect(PyObject
*_self
, PyObject
*_args
)
6451 PyObject
*_res
= NULL
;
6456 PyMac_PRECHECK(PtInRect
);
6458 if (!PyArg_ParseTuple(_args
, "O&O&",
6459 PyMac_GetPoint
, &pt
,
6464 _res
= Py_BuildValue("b",
6469 static PyObject
*Qd_DrawText(PyObject
*_self
, PyObject
*_args
)
6471 PyObject
*_res
= NULL
;
6472 char *textBuf__in__
;
6473 int textBuf__in_len__
;
6477 PyMac_PRECHECK(DrawText
);
6479 if (!PyArg_ParseTuple(_args
, "s#hh",
6480 &textBuf__in__
, &textBuf__in_len__
,
6484 /* Fool compiler warnings */
6485 textBuf__in_len__
= textBuf__in_len__
;
6486 DrawText(textBuf__in__
,
6494 static PyObject
*Qd_BitMap(PyObject
*_self
, PyObject
*_args
)
6496 PyObject
*_res
= NULL
;
6504 if ( !PyArg_ParseTuple(_args
, "O!iO&", &PyString_Type
, &source
, &rowbytes
, PyMac_GetRect
,
6507 data
= PyString_AsString(source
);
6508 if ((ptr
=(BitMap
*)malloc(sizeof(BitMap
))) == NULL
)
6509 return PyErr_NoMemory();
6510 ptr
->baseAddr
= (Ptr
)data
;
6511 ptr
->rowBytes
= rowbytes
;
6512 ptr
->bounds
= bounds
;
6513 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
6517 ((BitMapObject
*)_res
)->referred_object
= source
;
6519 ((BitMapObject
*)_res
)->referred_bitmap
= ptr
;
6524 static PyObject
*Qd_RawBitMap(PyObject
*_self
, PyObject
*_args
)
6526 PyObject
*_res
= NULL
;
6531 if ( !PyArg_ParseTuple(_args
, "O!", &PyString_Type
, &source
) )
6533 if ( PyString_Size(source
) != sizeof(BitMap
) && PyString_Size(source
) != sizeof(PixMap
) ) {
6534 PyErr_Format(PyExc_TypeError
,
6535 "Argument size was %ld, should be %lu (sizeof BitMap) or %lu (sizeof PixMap)",
6536 PyString_Size(source
), sizeof(BitMap
), sizeof(PixMap
));
6539 ptr
= (BitMapPtr
)PyString_AsString(source
);
6540 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
6543 ((BitMapObject
*)_res
)->referred_object
= source
;
6548 #endif /* __LP64__ */
6550 static PyMethodDef Qd_methods
[] = {
6552 {"GetPort", (PyCFunction
)Qd_GetPort
, 1,
6553 PyDoc_STR("() -> (GrafPtr port)")},
6554 {"GrafDevice", (PyCFunction
)Qd_GrafDevice
, 1,
6555 PyDoc_STR("(short device) -> None")},
6556 {"SetPortBits", (PyCFunction
)Qd_SetPortBits
, 1,
6557 PyDoc_STR("(BitMapPtr bm) -> None")},
6558 {"PortSize", (PyCFunction
)Qd_PortSize
, 1,
6559 PyDoc_STR("(short width, short height) -> None")},
6560 {"MovePortTo", (PyCFunction
)Qd_MovePortTo
, 1,
6561 PyDoc_STR("(short leftGlobal, short topGlobal) -> None")},
6562 {"SetOrigin", (PyCFunction
)Qd_SetOrigin
, 1,
6563 PyDoc_STR("(short h, short v) -> None")},
6564 {"SetClip", (PyCFunction
)Qd_SetClip
, 1,
6565 PyDoc_STR("(RgnHandle rgn) -> None")},
6566 {"GetClip", (PyCFunction
)Qd_GetClip
, 1,
6567 PyDoc_STR("(RgnHandle rgn) -> None")},
6568 {"ClipRect", (PyCFunction
)Qd_ClipRect
, 1,
6569 PyDoc_STR("(Rect r) -> None")},
6570 {"BackPat", (PyCFunction
)Qd_BackPat
, 1,
6571 PyDoc_STR("(Pattern pat) -> None")},
6572 {"InitCursor", (PyCFunction
)Qd_InitCursor
, 1,
6573 PyDoc_STR("() -> None")},
6574 {"MacSetCursor", (PyCFunction
)Qd_MacSetCursor
, 1,
6575 PyDoc_STR("(Cursor crsr) -> None")},
6576 {"HideCursor", (PyCFunction
)Qd_HideCursor
, 1,
6577 PyDoc_STR("() -> None")},
6578 {"MacShowCursor", (PyCFunction
)Qd_MacShowCursor
, 1,
6579 PyDoc_STR("() -> None")},
6580 {"ObscureCursor", (PyCFunction
)Qd_ObscureCursor
, 1,
6581 PyDoc_STR("() -> None")},
6582 {"HidePen", (PyCFunction
)Qd_HidePen
, 1,
6583 PyDoc_STR("() -> None")},
6584 {"ShowPen", (PyCFunction
)Qd_ShowPen
, 1,
6585 PyDoc_STR("() -> None")},
6586 {"GetPen", (PyCFunction
)Qd_GetPen
, 1,
6587 PyDoc_STR("() -> (Point pt)")},
6588 {"GetPenState", (PyCFunction
)Qd_GetPenState
, 1,
6589 PyDoc_STR("() -> (PenState pnState)")},
6590 {"SetPenState", (PyCFunction
)Qd_SetPenState
, 1,
6591 PyDoc_STR("(PenState pnState) -> None")},
6592 {"PenSize", (PyCFunction
)Qd_PenSize
, 1,
6593 PyDoc_STR("(short width, short height) -> None")},
6594 {"PenMode", (PyCFunction
)Qd_PenMode
, 1,
6595 PyDoc_STR("(short mode) -> None")},
6596 {"PenPat", (PyCFunction
)Qd_PenPat
, 1,
6597 PyDoc_STR("(Pattern pat) -> None")},
6598 {"PenNormal", (PyCFunction
)Qd_PenNormal
, 1,
6599 PyDoc_STR("() -> None")},
6600 {"MoveTo", (PyCFunction
)Qd_MoveTo
, 1,
6601 PyDoc_STR("(short h, short v) -> None")},
6602 {"Move", (PyCFunction
)Qd_Move
, 1,
6603 PyDoc_STR("(short dh, short dv) -> None")},
6604 {"MacLineTo", (PyCFunction
)Qd_MacLineTo
, 1,
6605 PyDoc_STR("(short h, short v) -> None")},
6606 {"Line", (PyCFunction
)Qd_Line
, 1,
6607 PyDoc_STR("(short dh, short dv) -> None")},
6608 {"ForeColor", (PyCFunction
)Qd_ForeColor
, 1,
6609 PyDoc_STR("(long color) -> None")},
6610 {"BackColor", (PyCFunction
)Qd_BackColor
, 1,
6611 PyDoc_STR("(long color) -> None")},
6612 {"ColorBit", (PyCFunction
)Qd_ColorBit
, 1,
6613 PyDoc_STR("(short whichBit) -> None")},
6614 {"MacSetRect", (PyCFunction
)Qd_MacSetRect
, 1,
6615 PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")},
6616 {"MacOffsetRect", (PyCFunction
)Qd_MacOffsetRect
, 1,
6617 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
6618 {"MacInsetRect", (PyCFunction
)Qd_MacInsetRect
, 1,
6619 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
6620 {"SectRect", (PyCFunction
)Qd_SectRect
, 1,
6621 PyDoc_STR("(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)")},
6622 {"MacUnionRect", (PyCFunction
)Qd_MacUnionRect
, 1,
6623 PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")},
6624 {"MacEqualRect", (PyCFunction
)Qd_MacEqualRect
, 1,
6625 PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")},
6626 {"EmptyRect", (PyCFunction
)Qd_EmptyRect
, 1,
6627 PyDoc_STR("(Rect r) -> (Boolean _rv)")},
6628 {"MacFrameRect", (PyCFunction
)Qd_MacFrameRect
, 1,
6629 PyDoc_STR("(Rect r) -> None")},
6630 {"PaintRect", (PyCFunction
)Qd_PaintRect
, 1,
6631 PyDoc_STR("(Rect r) -> None")},
6632 {"EraseRect", (PyCFunction
)Qd_EraseRect
, 1,
6633 PyDoc_STR("(Rect r) -> None")},
6634 {"MacInvertRect", (PyCFunction
)Qd_MacInvertRect
, 1,
6635 PyDoc_STR("(Rect r) -> None")},
6636 {"MacFillRect", (PyCFunction
)Qd_MacFillRect
, 1,
6637 PyDoc_STR("(Rect r, Pattern pat) -> None")},
6638 {"FrameOval", (PyCFunction
)Qd_FrameOval
, 1,
6639 PyDoc_STR("(Rect r) -> None")},
6640 {"PaintOval", (PyCFunction
)Qd_PaintOval
, 1,
6641 PyDoc_STR("(Rect r) -> None")},
6642 {"EraseOval", (PyCFunction
)Qd_EraseOval
, 1,
6643 PyDoc_STR("(Rect r) -> None")},
6644 {"InvertOval", (PyCFunction
)Qd_InvertOval
, 1,
6645 PyDoc_STR("(Rect r) -> None")},
6646 {"FillOval", (PyCFunction
)Qd_FillOval
, 1,
6647 PyDoc_STR("(Rect r, Pattern pat) -> None")},
6648 {"FrameRoundRect", (PyCFunction
)Qd_FrameRoundRect
, 1,
6649 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6650 {"PaintRoundRect", (PyCFunction
)Qd_PaintRoundRect
, 1,
6651 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6652 {"EraseRoundRect", (PyCFunction
)Qd_EraseRoundRect
, 1,
6653 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6654 {"InvertRoundRect", (PyCFunction
)Qd_InvertRoundRect
, 1,
6655 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6656 {"FillRoundRect", (PyCFunction
)Qd_FillRoundRect
, 1,
6657 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None")},
6658 {"FrameArc", (PyCFunction
)Qd_FrameArc
, 1,
6659 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6660 {"PaintArc", (PyCFunction
)Qd_PaintArc
, 1,
6661 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6662 {"EraseArc", (PyCFunction
)Qd_EraseArc
, 1,
6663 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6664 {"InvertArc", (PyCFunction
)Qd_InvertArc
, 1,
6665 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6666 {"FillArc", (PyCFunction
)Qd_FillArc
, 1,
6667 PyDoc_STR("(Rect r, short startAngle, short arcAngle, Pattern pat) -> None")},
6668 {"NewRgn", (PyCFunction
)Qd_NewRgn
, 1,
6669 PyDoc_STR("() -> (RgnHandle _rv)")},
6670 {"OpenRgn", (PyCFunction
)Qd_OpenRgn
, 1,
6671 PyDoc_STR("() -> None")},
6672 {"CloseRgn", (PyCFunction
)Qd_CloseRgn
, 1,
6673 PyDoc_STR("(RgnHandle dstRgn) -> None")},
6674 {"BitMapToRegion", (PyCFunction
)Qd_BitMapToRegion
, 1,
6675 PyDoc_STR("(RgnHandle region, BitMapPtr bMap) -> None")},
6676 {"RgnToHandle", (PyCFunction
)Qd_RgnToHandle
, 1,
6677 PyDoc_STR("(RgnHandle region, Handle flattenedRgnDataHdl) -> None")},
6678 {"DisposeRgn", (PyCFunction
)Qd_DisposeRgn
, 1,
6679 PyDoc_STR("(RgnHandle rgn) -> None")},
6680 {"MacCopyRgn", (PyCFunction
)Qd_MacCopyRgn
, 1,
6681 PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")},
6682 {"SetEmptyRgn", (PyCFunction
)Qd_SetEmptyRgn
, 1,
6683 PyDoc_STR("(RgnHandle rgn) -> None")},
6684 {"MacSetRectRgn", (PyCFunction
)Qd_MacSetRectRgn
, 1,
6685 PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")},
6686 {"RectRgn", (PyCFunction
)Qd_RectRgn
, 1,
6687 PyDoc_STR("(RgnHandle rgn, Rect r) -> None")},
6688 {"MacOffsetRgn", (PyCFunction
)Qd_MacOffsetRgn
, 1,
6689 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
6690 {"InsetRgn", (PyCFunction
)Qd_InsetRgn
, 1,
6691 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
6692 {"SectRgn", (PyCFunction
)Qd_SectRgn
, 1,
6693 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6694 {"MacUnionRgn", (PyCFunction
)Qd_MacUnionRgn
, 1,
6695 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6696 {"DiffRgn", (PyCFunction
)Qd_DiffRgn
, 1,
6697 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6698 {"MacXorRgn", (PyCFunction
)Qd_MacXorRgn
, 1,
6699 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6700 {"RectInRgn", (PyCFunction
)Qd_RectInRgn
, 1,
6701 PyDoc_STR("(Rect r, RgnHandle rgn) -> (Boolean _rv)")},
6702 {"MacEqualRgn", (PyCFunction
)Qd_MacEqualRgn
, 1,
6703 PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")},
6704 {"EmptyRgn", (PyCFunction
)Qd_EmptyRgn
, 1,
6705 PyDoc_STR("(RgnHandle rgn) -> (Boolean _rv)")},
6706 {"MacFrameRgn", (PyCFunction
)Qd_MacFrameRgn
, 1,
6707 PyDoc_STR("(RgnHandle rgn) -> None")},
6708 {"MacPaintRgn", (PyCFunction
)Qd_MacPaintRgn
, 1,
6709 PyDoc_STR("(RgnHandle rgn) -> None")},
6710 {"EraseRgn", (PyCFunction
)Qd_EraseRgn
, 1,
6711 PyDoc_STR("(RgnHandle rgn) -> None")},
6712 {"MacInvertRgn", (PyCFunction
)Qd_MacInvertRgn
, 1,
6713 PyDoc_STR("(RgnHandle rgn) -> None")},
6714 {"MacFillRgn", (PyCFunction
)Qd_MacFillRgn
, 1,
6715 PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")},
6716 {"ScrollRect", (PyCFunction
)Qd_ScrollRect
, 1,
6717 PyDoc_STR("(Rect r, short dh, short dv, RgnHandle updateRgn) -> None")},
6718 {"CopyBits", (PyCFunction
)Qd_CopyBits
, 1,
6719 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6720 {"CopyMask", (PyCFunction
)Qd_CopyMask
, 1,
6721 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None")},
6722 {"OpenPicture", (PyCFunction
)Qd_OpenPicture
, 1,
6723 PyDoc_STR("(Rect picFrame) -> (PicHandle _rv)")},
6724 {"PicComment", (PyCFunction
)Qd_PicComment
, 1,
6725 PyDoc_STR("(short kind, short dataSize, Handle dataHandle) -> None")},
6726 {"ClosePicture", (PyCFunction
)Qd_ClosePicture
, 1,
6727 PyDoc_STR("() -> None")},
6728 {"DrawPicture", (PyCFunction
)Qd_DrawPicture
, 1,
6729 PyDoc_STR("(PicHandle myPicture, Rect dstRect) -> None")},
6730 {"KillPicture", (PyCFunction
)Qd_KillPicture
, 1,
6731 PyDoc_STR("(PicHandle myPicture) -> None")},
6732 {"OpenPoly", (PyCFunction
)Qd_OpenPoly
, 1,
6733 PyDoc_STR("() -> (PolyHandle _rv)")},
6734 {"ClosePoly", (PyCFunction
)Qd_ClosePoly
, 1,
6735 PyDoc_STR("() -> None")},
6736 {"KillPoly", (PyCFunction
)Qd_KillPoly
, 1,
6737 PyDoc_STR("(PolyHandle poly) -> None")},
6738 {"OffsetPoly", (PyCFunction
)Qd_OffsetPoly
, 1,
6739 PyDoc_STR("(PolyHandle poly, short dh, short dv) -> None")},
6740 {"FramePoly", (PyCFunction
)Qd_FramePoly
, 1,
6741 PyDoc_STR("(PolyHandle poly) -> None")},
6742 {"PaintPoly", (PyCFunction
)Qd_PaintPoly
, 1,
6743 PyDoc_STR("(PolyHandle poly) -> None")},
6744 {"ErasePoly", (PyCFunction
)Qd_ErasePoly
, 1,
6745 PyDoc_STR("(PolyHandle poly) -> None")},
6746 {"InvertPoly", (PyCFunction
)Qd_InvertPoly
, 1,
6747 PyDoc_STR("(PolyHandle poly) -> None")},
6748 {"FillPoly", (PyCFunction
)Qd_FillPoly
, 1,
6749 PyDoc_STR("(PolyHandle poly, Pattern pat) -> None")},
6750 {"SetPt", (PyCFunction
)Qd_SetPt
, 1,
6751 PyDoc_STR("(short h, short v) -> (Point pt)")},
6752 {"LocalToGlobal", (PyCFunction
)Qd_LocalToGlobal
, 1,
6753 PyDoc_STR("(Point pt) -> (Point pt)")},
6754 {"GlobalToLocal", (PyCFunction
)Qd_GlobalToLocal
, 1,
6755 PyDoc_STR("(Point pt) -> (Point pt)")},
6756 {"Random", (PyCFunction
)Qd_Random
, 1,
6757 PyDoc_STR("() -> (short _rv)")},
6758 {"MacGetPixel", (PyCFunction
)Qd_MacGetPixel
, 1,
6759 PyDoc_STR("(short h, short v) -> (Boolean _rv)")},
6760 {"ScalePt", (PyCFunction
)Qd_ScalePt
, 1,
6761 PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")},
6762 {"MapPt", (PyCFunction
)Qd_MapPt
, 1,
6763 PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")},
6764 {"MapRect", (PyCFunction
)Qd_MapRect
, 1,
6765 PyDoc_STR("(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)")},
6766 {"MapRgn", (PyCFunction
)Qd_MapRgn
, 1,
6767 PyDoc_STR("(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None")},
6768 {"MapPoly", (PyCFunction
)Qd_MapPoly
, 1,
6769 PyDoc_STR("(PolyHandle poly, Rect srcRect, Rect dstRect) -> None")},
6770 {"StdBits", (PyCFunction
)Qd_StdBits
, 1,
6771 PyDoc_STR("(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6772 {"AddPt", (PyCFunction
)Qd_AddPt
, 1,
6773 PyDoc_STR("(Point src, Point dst) -> (Point dst)")},
6774 {"EqualPt", (PyCFunction
)Qd_EqualPt
, 1,
6775 PyDoc_STR("(Point pt1, Point pt2) -> (Boolean _rv)")},
6776 {"MacPtInRect", (PyCFunction
)Qd_MacPtInRect
, 1,
6777 PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")},
6778 {"Pt2Rect", (PyCFunction
)Qd_Pt2Rect
, 1,
6779 PyDoc_STR("(Point pt1, Point pt2) -> (Rect dstRect)")},
6780 {"PtToAngle", (PyCFunction
)Qd_PtToAngle
, 1,
6781 PyDoc_STR("(Rect r, Point pt) -> (short angle)")},
6782 {"SubPt", (PyCFunction
)Qd_SubPt
, 1,
6783 PyDoc_STR("(Point src, Point dst) -> (Point dst)")},
6784 {"PtInRgn", (PyCFunction
)Qd_PtInRgn
, 1,
6785 PyDoc_STR("(Point pt, RgnHandle rgn) -> (Boolean _rv)")},
6786 {"NewPixMap", (PyCFunction
)Qd_NewPixMap
, 1,
6787 PyDoc_STR("() -> (PixMapHandle _rv)")},
6788 {"DisposePixMap", (PyCFunction
)Qd_DisposePixMap
, 1,
6789 PyDoc_STR("(PixMapHandle pm) -> None")},
6790 {"CopyPixMap", (PyCFunction
)Qd_CopyPixMap
, 1,
6791 PyDoc_STR("(PixMapHandle srcPM, PixMapHandle dstPM) -> None")},
6792 {"NewPixPat", (PyCFunction
)Qd_NewPixPat
, 1,
6793 PyDoc_STR("() -> (PixPatHandle _rv)")},
6794 {"DisposePixPat", (PyCFunction
)Qd_DisposePixPat
, 1,
6795 PyDoc_STR("(PixPatHandle pp) -> None")},
6796 {"CopyPixPat", (PyCFunction
)Qd_CopyPixPat
, 1,
6797 PyDoc_STR("(PixPatHandle srcPP, PixPatHandle dstPP) -> None")},
6798 {"PenPixPat", (PyCFunction
)Qd_PenPixPat
, 1,
6799 PyDoc_STR("(PixPatHandle pp) -> None")},
6800 {"BackPixPat", (PyCFunction
)Qd_BackPixPat
, 1,
6801 PyDoc_STR("(PixPatHandle pp) -> None")},
6802 {"GetPixPat", (PyCFunction
)Qd_GetPixPat
, 1,
6803 PyDoc_STR("(short patID) -> (PixPatHandle _rv)")},
6804 {"MakeRGBPat", (PyCFunction
)Qd_MakeRGBPat
, 1,
6805 PyDoc_STR("(PixPatHandle pp, RGBColor myColor) -> None")},
6806 {"FillCRect", (PyCFunction
)Qd_FillCRect
, 1,
6807 PyDoc_STR("(Rect r, PixPatHandle pp) -> None")},
6808 {"FillCOval", (PyCFunction
)Qd_FillCOval
, 1,
6809 PyDoc_STR("(Rect r, PixPatHandle pp) -> None")},
6810 {"FillCRoundRect", (PyCFunction
)Qd_FillCRoundRect
, 1,
6811 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None")},
6812 {"FillCArc", (PyCFunction
)Qd_FillCArc
, 1,
6813 PyDoc_STR("(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None")},
6814 {"FillCRgn", (PyCFunction
)Qd_FillCRgn
, 1,
6815 PyDoc_STR("(RgnHandle rgn, PixPatHandle pp) -> None")},
6816 {"FillCPoly", (PyCFunction
)Qd_FillCPoly
, 1,
6817 PyDoc_STR("(PolyHandle poly, PixPatHandle pp) -> None")},
6818 {"RGBForeColor", (PyCFunction
)Qd_RGBForeColor
, 1,
6819 PyDoc_STR("(RGBColor color) -> None")},
6820 {"RGBBackColor", (PyCFunction
)Qd_RGBBackColor
, 1,
6821 PyDoc_STR("(RGBColor color) -> None")},
6822 {"SetCPixel", (PyCFunction
)Qd_SetCPixel
, 1,
6823 PyDoc_STR("(short h, short v, RGBColor cPix) -> None")},
6824 {"SetPortPix", (PyCFunction
)Qd_SetPortPix
, 1,
6825 PyDoc_STR("(PixMapHandle pm) -> None")},
6826 {"GetCPixel", (PyCFunction
)Qd_GetCPixel
, 1,
6827 PyDoc_STR("(short h, short v) -> (RGBColor cPix)")},
6828 {"GetForeColor", (PyCFunction
)Qd_GetForeColor
, 1,
6829 PyDoc_STR("() -> (RGBColor color)")},
6830 {"GetBackColor", (PyCFunction
)Qd_GetBackColor
, 1,
6831 PyDoc_STR("() -> (RGBColor color)")},
6832 {"OpColor", (PyCFunction
)Qd_OpColor
, 1,
6833 PyDoc_STR("(RGBColor color) -> None")},
6834 {"HiliteColor", (PyCFunction
)Qd_HiliteColor
, 1,
6835 PyDoc_STR("(RGBColor color) -> None")},
6836 {"DisposeCTable", (PyCFunction
)Qd_DisposeCTable
, 1,
6837 PyDoc_STR("(CTabHandle cTable) -> None")},
6838 {"GetCTable", (PyCFunction
)Qd_GetCTable
, 1,
6839 PyDoc_STR("(short ctID) -> (CTabHandle _rv)")},
6840 {"GetCCursor", (PyCFunction
)Qd_GetCCursor
, 1,
6841 PyDoc_STR("(short crsrID) -> (CCrsrHandle _rv)")},
6842 {"SetCCursor", (PyCFunction
)Qd_SetCCursor
, 1,
6843 PyDoc_STR("(CCrsrHandle cCrsr) -> None")},
6844 {"AllocCursor", (PyCFunction
)Qd_AllocCursor
, 1,
6845 PyDoc_STR("() -> None")},
6846 {"DisposeCCursor", (PyCFunction
)Qd_DisposeCCursor
, 1,
6847 PyDoc_STR("(CCrsrHandle cCrsr) -> None")},
6848 {"GetMaxDevice", (PyCFunction
)Qd_GetMaxDevice
, 1,
6849 PyDoc_STR("(Rect globalRect) -> (GDHandle _rv)")},
6850 {"GetCTSeed", (PyCFunction
)Qd_GetCTSeed
, 1,
6851 PyDoc_STR("() -> (long _rv)")},
6852 {"GetDeviceList", (PyCFunction
)Qd_GetDeviceList
, 1,
6853 PyDoc_STR("() -> (GDHandle _rv)")},
6854 {"GetMainDevice", (PyCFunction
)Qd_GetMainDevice
, 1,
6855 PyDoc_STR("() -> (GDHandle _rv)")},
6856 {"GetNextDevice", (PyCFunction
)Qd_GetNextDevice
, 1,
6857 PyDoc_STR("(GDHandle curDevice) -> (GDHandle _rv)")},
6858 {"TestDeviceAttribute", (PyCFunction
)Qd_TestDeviceAttribute
, 1,
6859 PyDoc_STR("(GDHandle gdh, short attribute) -> (Boolean _rv)")},
6860 {"SetDeviceAttribute", (PyCFunction
)Qd_SetDeviceAttribute
, 1,
6861 PyDoc_STR("(GDHandle gdh, short attribute, Boolean value) -> None")},
6862 {"InitGDevice", (PyCFunction
)Qd_InitGDevice
, 1,
6863 PyDoc_STR("(short qdRefNum, long mode, GDHandle gdh) -> None")},
6864 {"NewGDevice", (PyCFunction
)Qd_NewGDevice
, 1,
6865 PyDoc_STR("(short refNum, long mode) -> (GDHandle _rv)")},
6866 {"DisposeGDevice", (PyCFunction
)Qd_DisposeGDevice
, 1,
6867 PyDoc_STR("(GDHandle gdh) -> None")},
6868 {"SetGDevice", (PyCFunction
)Qd_SetGDevice
, 1,
6869 PyDoc_STR("(GDHandle gd) -> None")},
6870 {"GetGDevice", (PyCFunction
)Qd_GetGDevice
, 1,
6871 PyDoc_STR("() -> (GDHandle _rv)")},
6872 {"Color2Index", (PyCFunction
)Qd_Color2Index
, 1,
6873 PyDoc_STR("(RGBColor myColor) -> (long _rv)")},
6874 {"Index2Color", (PyCFunction
)Qd_Index2Color
, 1,
6875 PyDoc_STR("(long index) -> (RGBColor aColor)")},
6876 {"InvertColor", (PyCFunction
)Qd_InvertColor
, 1,
6877 PyDoc_STR("() -> (RGBColor myColor)")},
6878 {"RealColor", (PyCFunction
)Qd_RealColor
, 1,
6879 PyDoc_STR("(RGBColor color) -> (Boolean _rv)")},
6880 {"GetSubTable", (PyCFunction
)Qd_GetSubTable
, 1,
6881 PyDoc_STR("(CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None")},
6882 {"MakeITable", (PyCFunction
)Qd_MakeITable
, 1,
6883 PyDoc_STR("(CTabHandle cTabH, ITabHandle iTabH, short res) -> None")},
6884 {"SetClientID", (PyCFunction
)Qd_SetClientID
, 1,
6885 PyDoc_STR("(short id) -> None")},
6886 {"ProtectEntry", (PyCFunction
)Qd_ProtectEntry
, 1,
6887 PyDoc_STR("(short index, Boolean protect) -> None")},
6888 {"ReserveEntry", (PyCFunction
)Qd_ReserveEntry
, 1,
6889 PyDoc_STR("(short index, Boolean reserve) -> None")},
6890 {"QDError", (PyCFunction
)Qd_QDError
, 1,
6891 PyDoc_STR("() -> (short _rv)")},
6892 {"CopyDeepMask", (PyCFunction
)Qd_CopyDeepMask
, 1,
6893 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6894 {"GetPattern", (PyCFunction
)Qd_GetPattern
, 1,
6895 PyDoc_STR("(short patternID) -> (PatHandle _rv)")},
6896 {"MacGetCursor", (PyCFunction
)Qd_MacGetCursor
, 1,
6897 PyDoc_STR("(short cursorID) -> (CursHandle _rv)")},
6898 {"GetPicture", (PyCFunction
)Qd_GetPicture
, 1,
6899 PyDoc_STR("(short pictureID) -> (PicHandle _rv)")},
6900 {"DeltaPoint", (PyCFunction
)Qd_DeltaPoint
, 1,
6901 PyDoc_STR("(Point ptA, Point ptB) -> (long _rv)")},
6902 {"ShieldCursor", (PyCFunction
)Qd_ShieldCursor
, 1,
6903 PyDoc_STR("(Rect shieldRect, Point offsetPt) -> None")},
6904 {"ScreenRes", (PyCFunction
)Qd_ScreenRes
, 1,
6905 PyDoc_STR("() -> (short scrnHRes, short scrnVRes)")},
6906 {"GetIndPattern", (PyCFunction
)Qd_GetIndPattern
, 1,
6907 PyDoc_STR("(short patternListID, short index) -> (Pattern thePat)")},
6908 {"SlopeFromAngle", (PyCFunction
)Qd_SlopeFromAngle
, 1,
6909 PyDoc_STR("(short angle) -> (Fixed _rv)")},
6910 {"AngleFromSlope", (PyCFunction
)Qd_AngleFromSlope
, 1,
6911 PyDoc_STR("(Fixed slope) -> (short _rv)")},
6912 {"GetPixBounds", (PyCFunction
)Qd_GetPixBounds
, 1,
6913 PyDoc_STR("(PixMapHandle pixMap) -> (Rect bounds)")},
6914 {"GetPixDepth", (PyCFunction
)Qd_GetPixDepth
, 1,
6915 PyDoc_STR("(PixMapHandle pixMap) -> (short _rv)")},
6916 {"GetQDGlobalsRandomSeed", (PyCFunction
)Qd_GetQDGlobalsRandomSeed
, 1,
6917 PyDoc_STR("() -> (long _rv)")},
6918 {"GetQDGlobalsScreenBits", (PyCFunction
)Qd_GetQDGlobalsScreenBits
, 1,
6919 PyDoc_STR("() -> (BitMap screenBits)")},
6920 {"GetQDGlobalsArrow", (PyCFunction
)Qd_GetQDGlobalsArrow
, 1,
6921 PyDoc_STR("() -> (Cursor arrow)")},
6922 {"GetQDGlobalsDarkGray", (PyCFunction
)Qd_GetQDGlobalsDarkGray
, 1,
6923 PyDoc_STR("() -> (Pattern dkGray)")},
6924 {"GetQDGlobalsLightGray", (PyCFunction
)Qd_GetQDGlobalsLightGray
, 1,
6925 PyDoc_STR("() -> (Pattern ltGray)")},
6926 {"GetQDGlobalsGray", (PyCFunction
)Qd_GetQDGlobalsGray
, 1,
6927 PyDoc_STR("() -> (Pattern gray)")},
6928 {"GetQDGlobalsBlack", (PyCFunction
)Qd_GetQDGlobalsBlack
, 1,
6929 PyDoc_STR("() -> (Pattern black)")},
6930 {"GetQDGlobalsWhite", (PyCFunction
)Qd_GetQDGlobalsWhite
, 1,
6931 PyDoc_STR("() -> (Pattern white)")},
6932 {"GetQDGlobalsThePort", (PyCFunction
)Qd_GetQDGlobalsThePort
, 1,
6933 PyDoc_STR("() -> (CGrafPtr _rv)")},
6934 {"SetQDGlobalsRandomSeed", (PyCFunction
)Qd_SetQDGlobalsRandomSeed
, 1,
6935 PyDoc_STR("(long randomSeed) -> None")},
6936 {"SetQDGlobalsArrow", (PyCFunction
)Qd_SetQDGlobalsArrow
, 1,
6937 PyDoc_STR("(Cursor arrow) -> None")},
6938 {"GetRegionBounds", (PyCFunction
)Qd_GetRegionBounds
, 1,
6939 PyDoc_STR("(RgnHandle region) -> (Rect bounds)")},
6940 {"IsRegionRectangular", (PyCFunction
)Qd_IsRegionRectangular
, 1,
6941 PyDoc_STR("(RgnHandle region) -> (Boolean _rv)")},
6942 {"CreateNewPort", (PyCFunction
)Qd_CreateNewPort
, 1,
6943 PyDoc_STR("() -> (CGrafPtr _rv)")},
6944 {"SetQDError", (PyCFunction
)Qd_SetQDError
, 1,
6945 PyDoc_STR("(OSErr err) -> None")},
6946 {"LMGetScrVRes", (PyCFunction
)Qd_LMGetScrVRes
, 1,
6947 PyDoc_STR("() -> (SInt16 _rv)")},
6948 {"LMSetScrVRes", (PyCFunction
)Qd_LMSetScrVRes
, 1,
6949 PyDoc_STR("(SInt16 value) -> None")},
6950 {"LMGetScrHRes", (PyCFunction
)Qd_LMGetScrHRes
, 1,
6951 PyDoc_STR("() -> (SInt16 _rv)")},
6952 {"LMSetScrHRes", (PyCFunction
)Qd_LMSetScrHRes
, 1,
6953 PyDoc_STR("(SInt16 value) -> None")},
6954 {"LMGetMainDevice", (PyCFunction
)Qd_LMGetMainDevice
, 1,
6955 PyDoc_STR("() -> (GDHandle _rv)")},
6956 {"LMSetMainDevice", (PyCFunction
)Qd_LMSetMainDevice
, 1,
6957 PyDoc_STR("(GDHandle value) -> None")},
6958 {"LMGetDeviceList", (PyCFunction
)Qd_LMGetDeviceList
, 1,
6959 PyDoc_STR("() -> (GDHandle _rv)")},
6960 {"LMSetDeviceList", (PyCFunction
)Qd_LMSetDeviceList
, 1,
6961 PyDoc_STR("(GDHandle value) -> None")},
6962 {"LMGetQDColors", (PyCFunction
)Qd_LMGetQDColors
, 1,
6963 PyDoc_STR("() -> (Handle _rv)")},
6964 {"LMSetQDColors", (PyCFunction
)Qd_LMSetQDColors
, 1,
6965 PyDoc_STR("(Handle value) -> None")},
6966 {"LMGetWidthListHand", (PyCFunction
)Qd_LMGetWidthListHand
, 1,
6967 PyDoc_STR("() -> (Handle _rv)")},
6968 {"LMSetWidthListHand", (PyCFunction
)Qd_LMSetWidthListHand
, 1,
6969 PyDoc_STR("(Handle value) -> None")},
6970 {"LMGetHiliteMode", (PyCFunction
)Qd_LMGetHiliteMode
, 1,
6971 PyDoc_STR("() -> (UInt8 _rv)")},
6972 {"LMSetHiliteMode", (PyCFunction
)Qd_LMSetHiliteMode
, 1,
6973 PyDoc_STR("(UInt8 value) -> None")},
6974 {"LMGetWidthTabHandle", (PyCFunction
)Qd_LMGetWidthTabHandle
, 1,
6975 PyDoc_STR("() -> (Handle _rv)")},
6976 {"LMSetWidthTabHandle", (PyCFunction
)Qd_LMSetWidthTabHandle
, 1,
6977 PyDoc_STR("(Handle value) -> None")},
6978 {"LMGetLastSPExtra", (PyCFunction
)Qd_LMGetLastSPExtra
, 1,
6979 PyDoc_STR("() -> (SInt32 _rv)")},
6980 {"LMSetLastSPExtra", (PyCFunction
)Qd_LMSetLastSPExtra
, 1,
6981 PyDoc_STR("(SInt32 value) -> None")},
6982 {"LMGetLastFOND", (PyCFunction
)Qd_LMGetLastFOND
, 1,
6983 PyDoc_STR("() -> (Handle _rv)")},
6984 {"LMSetLastFOND", (PyCFunction
)Qd_LMSetLastFOND
, 1,
6985 PyDoc_STR("(Handle value) -> None")},
6986 {"LMGetFractEnable", (PyCFunction
)Qd_LMGetFractEnable
, 1,
6987 PyDoc_STR("() -> (UInt8 _rv)")},
6988 {"LMSetFractEnable", (PyCFunction
)Qd_LMSetFractEnable
, 1,
6989 PyDoc_STR("(UInt8 value) -> None")},
6990 {"LMGetTheGDevice", (PyCFunction
)Qd_LMGetTheGDevice
, 1,
6991 PyDoc_STR("() -> (GDHandle _rv)")},
6992 {"LMSetTheGDevice", (PyCFunction
)Qd_LMSetTheGDevice
, 1,
6993 PyDoc_STR("(GDHandle value) -> None")},
6994 {"LMGetHiliteRGB", (PyCFunction
)Qd_LMGetHiliteRGB
, 1,
6995 PyDoc_STR("() -> (RGBColor hiliteRGBValue)")},
6996 {"LMSetHiliteRGB", (PyCFunction
)Qd_LMSetHiliteRGB
, 1,
6997 PyDoc_STR("(RGBColor hiliteRGBValue) -> None")},
6998 {"LMGetCursorNew", (PyCFunction
)Qd_LMGetCursorNew
, 1,
6999 PyDoc_STR("() -> (Boolean _rv)")},
7000 {"LMSetCursorNew", (PyCFunction
)Qd_LMSetCursorNew
, 1,
7001 PyDoc_STR("(Boolean value) -> None")},
7002 {"TextFont", (PyCFunction
)Qd_TextFont
, 1,
7003 PyDoc_STR("(short font) -> None")},
7004 {"TextFace", (PyCFunction
)Qd_TextFace
, 1,
7005 PyDoc_STR("(StyleParameter face) -> None")},
7006 {"TextMode", (PyCFunction
)Qd_TextMode
, 1,
7007 PyDoc_STR("(short mode) -> None")},
7008 {"TextSize", (PyCFunction
)Qd_TextSize
, 1,
7009 PyDoc_STR("(short size) -> None")},
7010 {"SpaceExtra", (PyCFunction
)Qd_SpaceExtra
, 1,
7011 PyDoc_STR("(Fixed extra) -> None")},
7012 {"DrawChar", (PyCFunction
)Qd_DrawChar
, 1,
7013 PyDoc_STR("(CharParameter ch) -> None")},
7014 {"DrawString", (PyCFunction
)Qd_DrawString
, 1,
7015 PyDoc_STR("(Str255 s) -> None")},
7016 {"MacDrawText", (PyCFunction
)Qd_MacDrawText
, 1,
7017 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")},
7018 {"CharWidth", (PyCFunction
)Qd_CharWidth
, 1,
7019 PyDoc_STR("(CharParameter ch) -> (short _rv)")},
7020 {"StringWidth", (PyCFunction
)Qd_StringWidth
, 1,
7021 PyDoc_STR("(Str255 s) -> (short _rv)")},
7022 {"TextWidth", (PyCFunction
)Qd_TextWidth
, 1,
7023 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)")},
7024 {"GetFontInfo", (PyCFunction
)Qd_GetFontInfo
, 1,
7025 PyDoc_STR("() -> (FontInfo info)")},
7026 {"CharExtra", (PyCFunction
)Qd_CharExtra
, 1,
7027 PyDoc_STR("(Fixed extra) -> None")},
7028 {"TruncString", (PyCFunction
)Qd_TruncString
, 1,
7029 PyDoc_STR("(short width, Str255 theString, TruncCode truncWhere) -> (short _rv)")},
7030 {"SetPort", (PyCFunction
)Qd_SetPort
, 1,
7031 PyDoc_STR("(GrafPtr thePort) -> None")},
7032 {"GetCursor", (PyCFunction
)Qd_GetCursor
, 1,
7033 PyDoc_STR("(short cursorID) -> (CursHandle _rv)")},
7034 {"SetCursor", (PyCFunction
)Qd_SetCursor
, 1,
7035 PyDoc_STR("(Cursor crsr) -> None")},
7036 {"ShowCursor", (PyCFunction
)Qd_ShowCursor
, 1,
7037 PyDoc_STR("() -> None")},
7038 {"LineTo", (PyCFunction
)Qd_LineTo
, 1,
7039 PyDoc_STR("(short h, short v) -> None")},
7040 {"SetRect", (PyCFunction
)Qd_SetRect
, 1,
7041 PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")},
7042 {"OffsetRect", (PyCFunction
)Qd_OffsetRect
, 1,
7043 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
7044 {"InsetRect", (PyCFunction
)Qd_InsetRect
, 1,
7045 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
7046 {"UnionRect", (PyCFunction
)Qd_UnionRect
, 1,
7047 PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")},
7048 {"EqualRect", (PyCFunction
)Qd_EqualRect
, 1,
7049 PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")},
7050 {"FrameRect", (PyCFunction
)Qd_FrameRect
, 1,
7051 PyDoc_STR("(Rect r) -> None")},
7052 {"InvertRect", (PyCFunction
)Qd_InvertRect
, 1,
7053 PyDoc_STR("(Rect r) -> None")},
7054 {"FillRect", (PyCFunction
)Qd_FillRect
, 1,
7055 PyDoc_STR("(Rect r, Pattern pat) -> None")},
7056 {"CopyRgn", (PyCFunction
)Qd_CopyRgn
, 1,
7057 PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")},
7058 {"SetRectRgn", (PyCFunction
)Qd_SetRectRgn
, 1,
7059 PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")},
7060 {"OffsetRgn", (PyCFunction
)Qd_OffsetRgn
, 1,
7061 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
7062 {"UnionRgn", (PyCFunction
)Qd_UnionRgn
, 1,
7063 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
7064 {"XorRgn", (PyCFunction
)Qd_XorRgn
, 1,
7065 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
7066 {"EqualRgn", (PyCFunction
)Qd_EqualRgn
, 1,
7067 PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")},
7068 {"FrameRgn", (PyCFunction
)Qd_FrameRgn
, 1,
7069 PyDoc_STR("(RgnHandle rgn) -> None")},
7070 {"PaintRgn", (PyCFunction
)Qd_PaintRgn
, 1,
7071 PyDoc_STR("(RgnHandle rgn) -> None")},
7072 {"InvertRgn", (PyCFunction
)Qd_InvertRgn
, 1,
7073 PyDoc_STR("(RgnHandle rgn) -> None")},
7074 {"FillRgn", (PyCFunction
)Qd_FillRgn
, 1,
7075 PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")},
7076 {"GetPixel", (PyCFunction
)Qd_GetPixel
, 1,
7077 PyDoc_STR("(short h, short v) -> (Boolean _rv)")},
7078 {"PtInRect", (PyCFunction
)Qd_PtInRect
, 1,
7079 PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")},
7080 {"DrawText", (PyCFunction
)Qd_DrawText
, 1,
7081 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")},
7082 {"BitMap", (PyCFunction
)Qd_BitMap
, 1,
7083 PyDoc_STR("Take (string, int, Rect) argument and create BitMap")},
7084 {"RawBitMap", (PyCFunction
)Qd_RawBitMap
, 1,
7085 PyDoc_STR("Take string BitMap and turn into BitMap object")},
7086 #endif /* __LP64__ */
7093 /* Like BMObj_New, but the original bitmap data structure is copied (and
7094 ** released when the object is released)
7096 PyObject
*BMObj_NewCopied(BitMapPtr itself
)
7099 BitMapPtr itself_copy
;
7101 if ((itself_copy
=(BitMapPtr
)malloc(sizeof(BitMap
))) == NULL
)
7102 return PyErr_NoMemory();
7103 *itself_copy
= *itself
;
7104 it
= (BitMapObject
*)BMObj_New(itself_copy
);
7105 it
->referred_bitmap
= itself_copy
;
7106 return (PyObject
*)it
;
7109 #endif /* __LP64__ */
7120 PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr
, BMObj_New
);
7121 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(BitMapPtr
, BMObj_Convert
);
7122 PyMac_INIT_TOOLBOX_OBJECT_NEW(GrafPtr
, GrafObj_New
);
7123 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GrafPtr
, GrafObj_Convert
);
7124 PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr
, QdRGB_New
);
7125 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor
, QdRGB_Convert
);
7127 #endif /* __LP64__ */
7129 m
= Py_InitModule("_Qd", Qd_methods
);
7131 d
= PyModule_GetDict(m
);
7132 Qd_Error
= PyMac_GetOSErrException();
7133 if (Qd_Error
== NULL
||
7134 PyDict_SetItemString(d
, "Error", Qd_Error
) != 0)
7136 GrafPort_Type
.ob_type
= &PyType_Type
;
7137 if (PyType_Ready(&GrafPort_Type
) < 0) return;
7138 Py_INCREF(&GrafPort_Type
);
7139 PyModule_AddObject(m
, "GrafPort", (PyObject
*)&GrafPort_Type
);
7140 /* Backward-compatible name */
7141 Py_INCREF(&GrafPort_Type
);
7142 PyModule_AddObject(m
, "GrafPortType", (PyObject
*)&GrafPort_Type
);
7143 BitMap_Type
.ob_type
= &PyType_Type
;
7144 if (PyType_Ready(&BitMap_Type
) < 0) return;
7145 Py_INCREF(&BitMap_Type
);
7146 PyModule_AddObject(m
, "BitMap", (PyObject
*)&BitMap_Type
);
7147 /* Backward-compatible name */
7148 Py_INCREF(&BitMap_Type
);
7149 PyModule_AddObject(m
, "BitMapType", (PyObject
*)&BitMap_Type
);
7150 #endif /* __LP64__ */
7153 /* ========================= End module _Qd ========================= */