2 /* =========================== Module Qd ============================ */
8 #define SystemSevenOrLater 1
16 extern PyObject
*ResObj_New(Handle
);
17 extern int ResObj_Convert(PyObject
*, Handle
*);
19 extern PyObject
*WinObj_New(WindowPtr
);
20 extern int WinObj_Convert(PyObject
*, WindowPtr
*);
22 extern PyObject
*DlgObj_New(DialogPtr
);
23 extern int DlgObj_Convert(PyObject
*, DialogPtr
*);
24 extern PyTypeObject Dialog_Type
;
25 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
27 extern PyObject
*MenuObj_New(MenuHandle
);
28 extern int MenuObj_Convert(PyObject
*, MenuHandle
*);
30 extern PyObject
*CtlObj_New(ControlHandle
);
31 extern int CtlObj_Convert(PyObject
*, ControlHandle
*);
33 extern PyObject
*WinObj_WhichWindow(WindowPtr
);
35 #include <QuickDraw.h>
38 #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
40 static PyObject
*Qd_Error
;
42 static PyObject
*Qd_OpenPort(_self
, _args
)
46 PyObject
*_res
= NULL
;
48 if (!PyArg_ParseTuple(_args
, "O&",
49 WinObj_Convert
, &port
))
57 static PyObject
*Qd_InitPort(_self
, _args
)
61 PyObject
*_res
= NULL
;
63 if (!PyArg_ParseTuple(_args
, "O&",
64 WinObj_Convert
, &port
))
72 static PyObject
*Qd_ClosePort(_self
, _args
)
76 PyObject
*_res
= NULL
;
78 if (!PyArg_ParseTuple(_args
, "O&",
79 WinObj_Convert
, &port
))
87 static PyObject
*Qd_SetPort(_self
, _args
)
91 PyObject
*_res
= NULL
;
93 if (!PyArg_ParseTuple(_args
, "O&",
94 WinObj_Convert
, &port
))
102 static PyObject
*Qd_GetPort(_self
, _args
)
106 PyObject
*_res
= NULL
;
108 if (!PyArg_ParseTuple(_args
, ""))
111 _res
= Py_BuildValue("O&",
116 static PyObject
*Qd_GrafDevice(_self
, _args
)
120 PyObject
*_res
= NULL
;
122 if (!PyArg_ParseTuple(_args
, "h",
131 static PyObject
*Qd_PortSize(_self
, _args
)
135 PyObject
*_res
= NULL
;
138 if (!PyArg_ParseTuple(_args
, "hh",
149 static PyObject
*Qd_MovePortTo(_self
, _args
)
153 PyObject
*_res
= NULL
;
156 if (!PyArg_ParseTuple(_args
, "hh",
160 MovePortTo(leftGlobal
,
167 static PyObject
*Qd_SetOrigin(_self
, _args
)
171 PyObject
*_res
= NULL
;
174 if (!PyArg_ParseTuple(_args
, "hh",
185 static PyObject
*Qd_SetClip(_self
, _args
)
189 PyObject
*_res
= NULL
;
191 if (!PyArg_ParseTuple(_args
, "O&",
192 ResObj_Convert
, &rgn
))
200 static PyObject
*Qd_GetClip(_self
, _args
)
204 PyObject
*_res
= NULL
;
206 if (!PyArg_ParseTuple(_args
, "O&",
207 ResObj_Convert
, &rgn
))
215 static PyObject
*Qd_ClipRect(_self
, _args
)
219 PyObject
*_res
= NULL
;
221 if (!PyArg_ParseTuple(_args
, "O&",
230 static PyObject
*Qd_InitCursor(_self
, _args
)
234 PyObject
*_res
= NULL
;
235 if (!PyArg_ParseTuple(_args
, ""))
243 static PyObject
*Qd_HideCursor(_self
, _args
)
247 PyObject
*_res
= NULL
;
248 if (!PyArg_ParseTuple(_args
, ""))
256 static PyObject
*Qd_ShowCursor(_self
, _args
)
260 PyObject
*_res
= NULL
;
261 if (!PyArg_ParseTuple(_args
, ""))
269 static PyObject
*Qd_ObscureCursor(_self
, _args
)
273 PyObject
*_res
= NULL
;
274 if (!PyArg_ParseTuple(_args
, ""))
282 static PyObject
*Qd_HidePen(_self
, _args
)
286 PyObject
*_res
= NULL
;
287 if (!PyArg_ParseTuple(_args
, ""))
295 static PyObject
*Qd_ShowPen(_self
, _args
)
299 PyObject
*_res
= NULL
;
300 if (!PyArg_ParseTuple(_args
, ""))
308 static PyObject
*Qd_GetPen(_self
, _args
)
312 PyObject
*_res
= NULL
;
314 if (!PyArg_ParseTuple(_args
, "O&",
315 PyMac_GetPoint
, &pt
))
318 _res
= Py_BuildValue("O&",
319 PyMac_BuildPoint
, pt
);
323 static PyObject
*Qd_PenSize(_self
, _args
)
327 PyObject
*_res
= NULL
;
330 if (!PyArg_ParseTuple(_args
, "hh",
341 static PyObject
*Qd_PenMode(_self
, _args
)
345 PyObject
*_res
= NULL
;
347 if (!PyArg_ParseTuple(_args
, "h",
356 static PyObject
*Qd_PenNormal(_self
, _args
)
360 PyObject
*_res
= NULL
;
361 if (!PyArg_ParseTuple(_args
, ""))
369 static PyObject
*Qd_MoveTo(_self
, _args
)
373 PyObject
*_res
= NULL
;
376 if (!PyArg_ParseTuple(_args
, "hh",
387 static PyObject
*Qd_Move(_self
, _args
)
391 PyObject
*_res
= NULL
;
394 if (!PyArg_ParseTuple(_args
, "hh",
405 static PyObject
*Qd_LineTo(_self
, _args
)
409 PyObject
*_res
= NULL
;
412 if (!PyArg_ParseTuple(_args
, "hh",
423 static PyObject
*Qd_Line(_self
, _args
)
427 PyObject
*_res
= NULL
;
430 if (!PyArg_ParseTuple(_args
, "hh",
441 static PyObject
*Qd_TextFont(_self
, _args
)
445 PyObject
*_res
= NULL
;
447 if (!PyArg_ParseTuple(_args
, "h",
456 static PyObject
*Qd_TextFace(_self
, _args
)
460 PyObject
*_res
= NULL
;
462 if (!PyArg_ParseTuple(_args
, "h",
471 static PyObject
*Qd_TextMode(_self
, _args
)
475 PyObject
*_res
= NULL
;
477 if (!PyArg_ParseTuple(_args
, "h",
486 static PyObject
*Qd_TextSize(_self
, _args
)
490 PyObject
*_res
= NULL
;
492 if (!PyArg_ParseTuple(_args
, "h",
501 static PyObject
*Qd_SpaceExtra(_self
, _args
)
505 PyObject
*_res
= NULL
;
507 if (!PyArg_ParseTuple(_args
, "l",
516 static PyObject
*Qd_DrawChar(_self
, _args
)
520 PyObject
*_res
= NULL
;
522 if (!PyArg_ParseTuple(_args
, "h",
531 static PyObject
*Qd_DrawString(_self
, _args
)
535 PyObject
*_res
= NULL
;
537 if (!PyArg_ParseTuple(_args
, "O&",
546 static PyObject
*Qd_DrawText(_self
, _args
)
550 PyObject
*_res
= NULL
;
553 int textBuf__in_len__
;
556 if (!PyArg_ParseTuple(_args
, "s#hh",
557 &textBuf__in__
, &textBuf__in_len__
,
561 DrawText(textBuf__in__
,
570 static PyObject
*Qd_CharWidth(_self
, _args
)
574 PyObject
*_res
= NULL
;
577 if (!PyArg_ParseTuple(_args
, "h",
581 _res
= Py_BuildValue("h",
586 static PyObject
*Qd_StringWidth(_self
, _args
)
590 PyObject
*_res
= NULL
;
593 if (!PyArg_ParseTuple(_args
, "O&",
596 _rv
= StringWidth(s
);
597 _res
= Py_BuildValue("h",
602 static PyObject
*Qd_TextWidth(_self
, _args
)
606 PyObject
*_res
= NULL
;
610 int textBuf__in_len__
;
613 if (!PyArg_ParseTuple(_args
, "s#hh",
614 &textBuf__in__
, &textBuf__in_len__
,
618 _rv
= TextWidth(textBuf__in__
,
621 _res
= Py_BuildValue("h",
627 static PyObject
*Qd_ForeColor(_self
, _args
)
631 PyObject
*_res
= NULL
;
633 if (!PyArg_ParseTuple(_args
, "l",
642 static PyObject
*Qd_BackColor(_self
, _args
)
646 PyObject
*_res
= NULL
;
648 if (!PyArg_ParseTuple(_args
, "l",
657 static PyObject
*Qd_ColorBit(_self
, _args
)
661 PyObject
*_res
= NULL
;
663 if (!PyArg_ParseTuple(_args
, "h",
672 static PyObject
*Qd_SetRect(_self
, _args
)
676 PyObject
*_res
= NULL
;
682 if (!PyArg_ParseTuple(_args
, "hhhh",
693 _res
= Py_BuildValue("O&",
694 PyMac_BuildRect
, &r
);
698 static PyObject
*Qd_OffsetRect(_self
, _args
)
702 PyObject
*_res
= NULL
;
706 if (!PyArg_ParseTuple(_args
, "hh",
713 _res
= Py_BuildValue("O&",
714 PyMac_BuildRect
, &r
);
718 static PyObject
*Qd_InsetRect(_self
, _args
)
722 PyObject
*_res
= NULL
;
726 if (!PyArg_ParseTuple(_args
, "hh",
733 _res
= Py_BuildValue("O&",
734 PyMac_BuildRect
, &r
);
738 static PyObject
*Qd_SectRect(_self
, _args
)
742 PyObject
*_res
= NULL
;
747 if (!PyArg_ParseTuple(_args
, "O&O&",
748 PyMac_GetRect
, &src1
,
749 PyMac_GetRect
, &src2
))
751 _rv
= SectRect(&src1
,
754 _res
= Py_BuildValue("bO&",
756 PyMac_BuildRect
, &dstRect
);
760 static PyObject
*Qd_UnionRect(_self
, _args
)
764 PyObject
*_res
= NULL
;
768 if (!PyArg_ParseTuple(_args
, "O&O&",
769 PyMac_GetRect
, &src1
,
770 PyMac_GetRect
, &src2
))
775 _res
= Py_BuildValue("O&",
776 PyMac_BuildRect
, &dstRect
);
780 static PyObject
*Qd_EqualRect(_self
, _args
)
784 PyObject
*_res
= NULL
;
788 if (!PyArg_ParseTuple(_args
, "O&O&",
789 PyMac_GetRect
, &rect1
,
790 PyMac_GetRect
, &rect2
))
792 _rv
= EqualRect(&rect1
,
794 _res
= Py_BuildValue("b",
799 static PyObject
*Qd_EmptyRect(_self
, _args
)
803 PyObject
*_res
= NULL
;
806 if (!PyArg_ParseTuple(_args
, "O&",
810 _res
= Py_BuildValue("b",
815 static PyObject
*Qd_FrameRect(_self
, _args
)
819 PyObject
*_res
= NULL
;
821 if (!PyArg_ParseTuple(_args
, "O&",
830 static PyObject
*Qd_PaintRect(_self
, _args
)
834 PyObject
*_res
= NULL
;
836 if (!PyArg_ParseTuple(_args
, "O&",
845 static PyObject
*Qd_EraseRect(_self
, _args
)
849 PyObject
*_res
= NULL
;
851 if (!PyArg_ParseTuple(_args
, "O&",
860 static PyObject
*Qd_InvertRect(_self
, _args
)
864 PyObject
*_res
= NULL
;
866 if (!PyArg_ParseTuple(_args
, "O&",
875 static PyObject
*Qd_FrameOval(_self
, _args
)
879 PyObject
*_res
= NULL
;
881 if (!PyArg_ParseTuple(_args
, "O&",
890 static PyObject
*Qd_PaintOval(_self
, _args
)
894 PyObject
*_res
= NULL
;
896 if (!PyArg_ParseTuple(_args
, "O&",
905 static PyObject
*Qd_EraseOval(_self
, _args
)
909 PyObject
*_res
= NULL
;
911 if (!PyArg_ParseTuple(_args
, "O&",
920 static PyObject
*Qd_InvertOval(_self
, _args
)
924 PyObject
*_res
= NULL
;
926 if (!PyArg_ParseTuple(_args
, "O&",
935 static PyObject
*Qd_FrameRoundRect(_self
, _args
)
939 PyObject
*_res
= NULL
;
943 if (!PyArg_ParseTuple(_args
, "O&hh",
956 static PyObject
*Qd_PaintRoundRect(_self
, _args
)
960 PyObject
*_res
= NULL
;
964 if (!PyArg_ParseTuple(_args
, "O&hh",
977 static PyObject
*Qd_EraseRoundRect(_self
, _args
)
981 PyObject
*_res
= NULL
;
985 if (!PyArg_ParseTuple(_args
, "O&hh",
998 static PyObject
*Qd_InvertRoundRect(_self
, _args
)
1002 PyObject
*_res
= NULL
;
1006 if (!PyArg_ParseTuple(_args
, "O&hh",
1019 static PyObject
*Qd_FrameArc(_self
, _args
)
1023 PyObject
*_res
= NULL
;
1027 if (!PyArg_ParseTuple(_args
, "O&hh",
1040 static PyObject
*Qd_PaintArc(_self
, _args
)
1044 PyObject
*_res
= NULL
;
1048 if (!PyArg_ParseTuple(_args
, "O&hh",
1061 static PyObject
*Qd_EraseArc(_self
, _args
)
1065 PyObject
*_res
= NULL
;
1069 if (!PyArg_ParseTuple(_args
, "O&hh",
1082 static PyObject
*Qd_InvertArc(_self
, _args
)
1086 PyObject
*_res
= NULL
;
1090 if (!PyArg_ParseTuple(_args
, "O&hh",
1103 static PyObject
*Qd_NewRgn(_self
, _args
)
1107 PyObject
*_res
= NULL
;
1109 if (!PyArg_ParseTuple(_args
, ""))
1112 _res
= Py_BuildValue("O&",
1117 static PyObject
*Qd_OpenRgn(_self
, _args
)
1121 PyObject
*_res
= NULL
;
1122 if (!PyArg_ParseTuple(_args
, ""))
1130 static PyObject
*Qd_CloseRgn(_self
, _args
)
1134 PyObject
*_res
= NULL
;
1136 if (!PyArg_ParseTuple(_args
, "O&",
1137 ResObj_Convert
, &dstRgn
))
1145 static PyObject
*Qd_DisposeRgn(_self
, _args
)
1149 PyObject
*_res
= NULL
;
1151 if (!PyArg_ParseTuple(_args
, "O&",
1152 ResObj_Convert
, &rgn
))
1160 static PyObject
*Qd_CopyRgn(_self
, _args
)
1164 PyObject
*_res
= NULL
;
1167 if (!PyArg_ParseTuple(_args
, "O&O&",
1168 ResObj_Convert
, &srcRgn
,
1169 ResObj_Convert
, &dstRgn
))
1178 static PyObject
*Qd_SetEmptyRgn(_self
, _args
)
1182 PyObject
*_res
= NULL
;
1184 if (!PyArg_ParseTuple(_args
, "O&",
1185 ResObj_Convert
, &rgn
))
1193 static PyObject
*Qd_SetRectRgn(_self
, _args
)
1197 PyObject
*_res
= NULL
;
1203 if (!PyArg_ParseTuple(_args
, "O&hhhh",
1204 ResObj_Convert
, &rgn
,
1220 static PyObject
*Qd_RectRgn(_self
, _args
)
1224 PyObject
*_res
= NULL
;
1227 if (!PyArg_ParseTuple(_args
, "O&O&",
1228 ResObj_Convert
, &rgn
,
1238 static PyObject
*Qd_OffsetRgn(_self
, _args
)
1242 PyObject
*_res
= NULL
;
1246 if (!PyArg_ParseTuple(_args
, "O&hh",
1247 ResObj_Convert
, &rgn
,
1259 static PyObject
*Qd_InsetRgn(_self
, _args
)
1263 PyObject
*_res
= NULL
;
1267 if (!PyArg_ParseTuple(_args
, "O&hh",
1268 ResObj_Convert
, &rgn
,
1280 static PyObject
*Qd_SectRgn(_self
, _args
)
1284 PyObject
*_res
= NULL
;
1288 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1289 ResObj_Convert
, &srcRgnA
,
1290 ResObj_Convert
, &srcRgnB
,
1291 ResObj_Convert
, &dstRgn
))
1301 static PyObject
*Qd_UnionRgn(_self
, _args
)
1305 PyObject
*_res
= NULL
;
1309 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1310 ResObj_Convert
, &srcRgnA
,
1311 ResObj_Convert
, &srcRgnB
,
1312 ResObj_Convert
, &dstRgn
))
1322 static PyObject
*Qd_DiffRgn(_self
, _args
)
1326 PyObject
*_res
= NULL
;
1330 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1331 ResObj_Convert
, &srcRgnA
,
1332 ResObj_Convert
, &srcRgnB
,
1333 ResObj_Convert
, &dstRgn
))
1343 static PyObject
*Qd_XorRgn(_self
, _args
)
1347 PyObject
*_res
= NULL
;
1351 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1352 ResObj_Convert
, &srcRgnA
,
1353 ResObj_Convert
, &srcRgnB
,
1354 ResObj_Convert
, &dstRgn
))
1364 static PyObject
*Qd_RectInRgn(_self
, _args
)
1368 PyObject
*_res
= NULL
;
1372 if (!PyArg_ParseTuple(_args
, "O&O&",
1374 ResObj_Convert
, &rgn
))
1378 _res
= Py_BuildValue("b",
1383 static PyObject
*Qd_EqualRgn(_self
, _args
)
1387 PyObject
*_res
= NULL
;
1391 if (!PyArg_ParseTuple(_args
, "O&O&",
1392 ResObj_Convert
, &rgnA
,
1393 ResObj_Convert
, &rgnB
))
1395 _rv
= EqualRgn(rgnA
,
1397 _res
= Py_BuildValue("b",
1402 static PyObject
*Qd_EmptyRgn(_self
, _args
)
1406 PyObject
*_res
= NULL
;
1409 if (!PyArg_ParseTuple(_args
, "O&",
1410 ResObj_Convert
, &rgn
))
1412 _rv
= EmptyRgn(rgn
);
1413 _res
= Py_BuildValue("b",
1418 static PyObject
*Qd_FrameRgn(_self
, _args
)
1422 PyObject
*_res
= NULL
;
1424 if (!PyArg_ParseTuple(_args
, "O&",
1425 ResObj_Convert
, &rgn
))
1433 static PyObject
*Qd_PaintRgn(_self
, _args
)
1437 PyObject
*_res
= NULL
;
1439 if (!PyArg_ParseTuple(_args
, "O&",
1440 ResObj_Convert
, &rgn
))
1448 static PyObject
*Qd_EraseRgn(_self
, _args
)
1452 PyObject
*_res
= NULL
;
1454 if (!PyArg_ParseTuple(_args
, "O&",
1455 ResObj_Convert
, &rgn
))
1463 static PyObject
*Qd_InvertRgn(_self
, _args
)
1467 PyObject
*_res
= NULL
;
1469 if (!PyArg_ParseTuple(_args
, "O&",
1470 ResObj_Convert
, &rgn
))
1478 static PyObject
*Qd_ScrollRect(_self
, _args
)
1482 PyObject
*_res
= NULL
;
1486 RgnHandle updateRgn
;
1487 if (!PyArg_ParseTuple(_args
, "O&hhO&",
1491 ResObj_Convert
, &updateRgn
))
1502 static PyObject
*Qd_OpenPicture(_self
, _args
)
1506 PyObject
*_res
= NULL
;
1509 if (!PyArg_ParseTuple(_args
, "O&",
1510 PyMac_GetRect
, &picFrame
))
1512 _rv
= OpenPicture(&picFrame
);
1513 _res
= Py_BuildValue("O&",
1518 static PyObject
*Qd_PicComment(_self
, _args
)
1522 PyObject
*_res
= NULL
;
1526 if (!PyArg_ParseTuple(_args
, "hhO&",
1529 ResObj_Convert
, &dataHandle
))
1539 static PyObject
*Qd_ClosePicture(_self
, _args
)
1543 PyObject
*_res
= NULL
;
1544 if (!PyArg_ParseTuple(_args
, ""))
1552 static PyObject
*Qd_DrawPicture(_self
, _args
)
1556 PyObject
*_res
= NULL
;
1557 PicHandle myPicture
;
1559 if (!PyArg_ParseTuple(_args
, "O&O&",
1560 ResObj_Convert
, &myPicture
,
1561 PyMac_GetRect
, &dstRect
))
1563 DrawPicture(myPicture
,
1570 static PyObject
*Qd_KillPicture(_self
, _args
)
1574 PyObject
*_res
= NULL
;
1575 PicHandle myPicture
;
1576 if (!PyArg_ParseTuple(_args
, "O&",
1577 ResObj_Convert
, &myPicture
))
1579 KillPicture(myPicture
);
1585 static PyObject
*Qd_OpenPoly(_self
, _args
)
1589 PyObject
*_res
= NULL
;
1591 if (!PyArg_ParseTuple(_args
, ""))
1594 _res
= Py_BuildValue("O&",
1599 static PyObject
*Qd_ClosePoly(_self
, _args
)
1603 PyObject
*_res
= NULL
;
1604 if (!PyArg_ParseTuple(_args
, ""))
1612 static PyObject
*Qd_KillPoly(_self
, _args
)
1616 PyObject
*_res
= NULL
;
1618 if (!PyArg_ParseTuple(_args
, "O&",
1619 ResObj_Convert
, &poly
))
1627 static PyObject
*Qd_OffsetPoly(_self
, _args
)
1631 PyObject
*_res
= NULL
;
1635 if (!PyArg_ParseTuple(_args
, "O&hh",
1636 ResObj_Convert
, &poly
,
1648 static PyObject
*Qd_FramePoly(_self
, _args
)
1652 PyObject
*_res
= NULL
;
1654 if (!PyArg_ParseTuple(_args
, "O&",
1655 ResObj_Convert
, &poly
))
1663 static PyObject
*Qd_PaintPoly(_self
, _args
)
1667 PyObject
*_res
= NULL
;
1669 if (!PyArg_ParseTuple(_args
, "O&",
1670 ResObj_Convert
, &poly
))
1678 static PyObject
*Qd_ErasePoly(_self
, _args
)
1682 PyObject
*_res
= NULL
;
1684 if (!PyArg_ParseTuple(_args
, "O&",
1685 ResObj_Convert
, &poly
))
1693 static PyObject
*Qd_InvertPoly(_self
, _args
)
1697 PyObject
*_res
= NULL
;
1699 if (!PyArg_ParseTuple(_args
, "O&",
1700 ResObj_Convert
, &poly
))
1708 static PyObject
*Qd_SetPt(_self
, _args
)
1712 PyObject
*_res
= NULL
;
1716 if (!PyArg_ParseTuple(_args
, "O&hh",
1717 PyMac_GetPoint
, &pt
,
1724 _res
= Py_BuildValue("O&",
1725 PyMac_BuildPoint
, pt
);
1729 static PyObject
*Qd_LocalToGlobal(_self
, _args
)
1733 PyObject
*_res
= NULL
;
1735 if (!PyArg_ParseTuple(_args
, "O&",
1736 PyMac_GetPoint
, &pt
))
1739 _res
= Py_BuildValue("O&",
1740 PyMac_BuildPoint
, pt
);
1744 static PyObject
*Qd_GlobalToLocal(_self
, _args
)
1748 PyObject
*_res
= NULL
;
1750 if (!PyArg_ParseTuple(_args
, "O&",
1751 PyMac_GetPoint
, &pt
))
1754 _res
= Py_BuildValue("O&",
1755 PyMac_BuildPoint
, pt
);
1759 static PyObject
*Qd_Random(_self
, _args
)
1763 PyObject
*_res
= NULL
;
1765 if (!PyArg_ParseTuple(_args
, ""))
1768 _res
= Py_BuildValue("h",
1773 static PyObject
*Qd_GetPixel(_self
, _args
)
1777 PyObject
*_res
= NULL
;
1781 if (!PyArg_ParseTuple(_args
, "hh",
1787 _res
= Py_BuildValue("b",
1792 static PyObject
*Qd_ScalePt(_self
, _args
)
1796 PyObject
*_res
= NULL
;
1800 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1801 PyMac_GetPoint
, &pt
,
1802 PyMac_GetRect
, &srcRect
,
1803 PyMac_GetRect
, &dstRect
))
1808 _res
= Py_BuildValue("O&",
1809 PyMac_BuildPoint
, pt
);
1813 static PyObject
*Qd_MapPt(_self
, _args
)
1817 PyObject
*_res
= NULL
;
1821 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1822 PyMac_GetPoint
, &pt
,
1823 PyMac_GetRect
, &srcRect
,
1824 PyMac_GetRect
, &dstRect
))
1829 _res
= Py_BuildValue("O&",
1830 PyMac_BuildPoint
, pt
);
1834 static PyObject
*Qd_MapRect(_self
, _args
)
1838 PyObject
*_res
= NULL
;
1842 if (!PyArg_ParseTuple(_args
, "O&O&",
1843 PyMac_GetRect
, &srcRect
,
1844 PyMac_GetRect
, &dstRect
))
1849 _res
= Py_BuildValue("O&",
1850 PyMac_BuildRect
, &r
);
1854 static PyObject
*Qd_MapRgn(_self
, _args
)
1858 PyObject
*_res
= NULL
;
1862 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1863 ResObj_Convert
, &rgn
,
1864 PyMac_GetRect
, &srcRect
,
1865 PyMac_GetRect
, &dstRect
))
1875 static PyObject
*Qd_MapPoly(_self
, _args
)
1879 PyObject
*_res
= NULL
;
1883 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1884 ResObj_Convert
, &poly
,
1885 PyMac_GetRect
, &srcRect
,
1886 PyMac_GetRect
, &dstRect
))
1896 static PyObject
*Qd_AddPt(_self
, _args
)
1900 PyObject
*_res
= NULL
;
1903 if (!PyArg_ParseTuple(_args
, "O&O&",
1904 PyMac_GetPoint
, &src
,
1905 PyMac_GetPoint
, &dst
))
1909 _res
= Py_BuildValue("O&",
1910 PyMac_BuildPoint
, dst
);
1914 static PyObject
*Qd_EqualPt(_self
, _args
)
1918 PyObject
*_res
= NULL
;
1922 if (!PyArg_ParseTuple(_args
, "O&O&",
1923 PyMac_GetPoint
, &pt1
,
1924 PyMac_GetPoint
, &pt2
))
1928 _res
= Py_BuildValue("b",
1933 static PyObject
*Qd_PtInRect(_self
, _args
)
1937 PyObject
*_res
= NULL
;
1941 if (!PyArg_ParseTuple(_args
, "O&O&",
1942 PyMac_GetPoint
, &pt
,
1947 _res
= Py_BuildValue("b",
1952 static PyObject
*Qd_Pt2Rect(_self
, _args
)
1956 PyObject
*_res
= NULL
;
1960 if (!PyArg_ParseTuple(_args
, "O&O&",
1961 PyMac_GetPoint
, &pt1
,
1962 PyMac_GetPoint
, &pt2
))
1967 _res
= Py_BuildValue("O&",
1968 PyMac_BuildRect
, &dstRect
);
1972 static PyObject
*Qd_PtToAngle(_self
, _args
)
1976 PyObject
*_res
= NULL
;
1980 if (!PyArg_ParseTuple(_args
, "O&O&",
1982 PyMac_GetPoint
, &pt
))
1987 _res
= Py_BuildValue("h",
1992 static PyObject
*Qd_PtInRgn(_self
, _args
)
1996 PyObject
*_res
= NULL
;
2000 if (!PyArg_ParseTuple(_args
, "O&O&",
2001 PyMac_GetPoint
, &pt
,
2002 ResObj_Convert
, &rgn
))
2006 _res
= Py_BuildValue("b",
2011 static PyObject
*Qd_NewPixMap(_self
, _args
)
2015 PyObject
*_res
= NULL
;
2017 if (!PyArg_ParseTuple(_args
, ""))
2020 _res
= Py_BuildValue("O&",
2025 static PyObject
*Qd_DisposPixMap(_self
, _args
)
2029 PyObject
*_res
= NULL
;
2031 if (!PyArg_ParseTuple(_args
, "O&",
2032 ResObj_Convert
, &pm
))
2040 static PyObject
*Qd_DisposePixMap(_self
, _args
)
2044 PyObject
*_res
= NULL
;
2046 if (!PyArg_ParseTuple(_args
, "O&",
2047 ResObj_Convert
, &pm
))
2055 static PyObject
*Qd_CopyPixMap(_self
, _args
)
2059 PyObject
*_res
= NULL
;
2062 if (!PyArg_ParseTuple(_args
, "O&O&",
2063 ResObj_Convert
, &srcPM
,
2064 ResObj_Convert
, &dstPM
))
2073 static PyObject
*Qd_NewPixPat(_self
, _args
)
2077 PyObject
*_res
= NULL
;
2079 if (!PyArg_ParseTuple(_args
, ""))
2082 _res
= Py_BuildValue("O&",
2087 static PyObject
*Qd_DisposPixPat(_self
, _args
)
2091 PyObject
*_res
= NULL
;
2093 if (!PyArg_ParseTuple(_args
, "O&",
2094 ResObj_Convert
, &pp
))
2102 static PyObject
*Qd_DisposePixPat(_self
, _args
)
2106 PyObject
*_res
= NULL
;
2108 if (!PyArg_ParseTuple(_args
, "O&",
2109 ResObj_Convert
, &pp
))
2117 static PyObject
*Qd_CopyPixPat(_self
, _args
)
2121 PyObject
*_res
= NULL
;
2124 if (!PyArg_ParseTuple(_args
, "O&O&",
2125 ResObj_Convert
, &srcPP
,
2126 ResObj_Convert
, &dstPP
))
2135 static PyObject
*Qd_PenPixPat(_self
, _args
)
2139 PyObject
*_res
= NULL
;
2141 if (!PyArg_ParseTuple(_args
, "O&",
2142 ResObj_Convert
, &pp
))
2150 static PyObject
*Qd_BackPixPat(_self
, _args
)
2154 PyObject
*_res
= NULL
;
2156 if (!PyArg_ParseTuple(_args
, "O&",
2157 ResObj_Convert
, &pp
))
2165 static PyObject
*Qd_GetPixPat(_self
, _args
)
2169 PyObject
*_res
= NULL
;
2172 if (!PyArg_ParseTuple(_args
, "h",
2175 _rv
= GetPixPat(patID
);
2176 _res
= Py_BuildValue("O&",
2181 static PyObject
*Qd_FillCRect(_self
, _args
)
2185 PyObject
*_res
= NULL
;
2188 if (!PyArg_ParseTuple(_args
, "O&O&",
2190 ResObj_Convert
, &pp
))
2199 static PyObject
*Qd_FillCOval(_self
, _args
)
2203 PyObject
*_res
= NULL
;
2206 if (!PyArg_ParseTuple(_args
, "O&O&",
2208 ResObj_Convert
, &pp
))
2217 static PyObject
*Qd_FillCRoundRect(_self
, _args
)
2221 PyObject
*_res
= NULL
;
2226 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2230 ResObj_Convert
, &pp
))
2241 static PyObject
*Qd_FillCArc(_self
, _args
)
2245 PyObject
*_res
= NULL
;
2250 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2254 ResObj_Convert
, &pp
))
2265 static PyObject
*Qd_FillCRgn(_self
, _args
)
2269 PyObject
*_res
= NULL
;
2272 if (!PyArg_ParseTuple(_args
, "O&O&",
2273 ResObj_Convert
, &rgn
,
2274 ResObj_Convert
, &pp
))
2283 static PyObject
*Qd_FillCPoly(_self
, _args
)
2287 PyObject
*_res
= NULL
;
2290 if (!PyArg_ParseTuple(_args
, "O&O&",
2291 ResObj_Convert
, &poly
,
2292 ResObj_Convert
, &pp
))
2301 static PyObject
*Qd_SetPortPix(_self
, _args
)
2305 PyObject
*_res
= NULL
;
2307 if (!PyArg_ParseTuple(_args
, "O&",
2308 ResObj_Convert
, &pm
))
2316 static PyObject
*Qd_AllocCursor(_self
, _args
)
2320 PyObject
*_res
= NULL
;
2321 if (!PyArg_ParseTuple(_args
, ""))
2329 static PyObject
*Qd_CharExtra(_self
, _args
)
2333 PyObject
*_res
= NULL
;
2335 if (!PyArg_ParseTuple(_args
, "l",
2344 static PyObject
*Qd_GetCTSeed(_self
, _args
)
2348 PyObject
*_res
= NULL
;
2350 if (!PyArg_ParseTuple(_args
, ""))
2353 _res
= Py_BuildValue("l",
2358 static PyObject
*Qd_SubPt(_self
, _args
)
2362 PyObject
*_res
= NULL
;
2365 if (!PyArg_ParseTuple(_args
, "O&O&",
2366 PyMac_GetPoint
, &src
,
2367 PyMac_GetPoint
, &dst
))
2371 _res
= Py_BuildValue("O&",
2372 PyMac_BuildPoint
, dst
);
2376 static PyObject
*Qd_SetClientID(_self
, _args
)
2380 PyObject
*_res
= NULL
;
2382 if (!PyArg_ParseTuple(_args
, "h",
2391 static PyObject
*Qd_ProtectEntry(_self
, _args
)
2395 PyObject
*_res
= NULL
;
2398 if (!PyArg_ParseTuple(_args
, "hb",
2409 static PyObject
*Qd_ReserveEntry(_self
, _args
)
2413 PyObject
*_res
= NULL
;
2416 if (!PyArg_ParseTuple(_args
, "hb",
2427 static PyObject
*Qd_QDError(_self
, _args
)
2431 PyObject
*_res
= NULL
;
2433 if (!PyArg_ParseTuple(_args
, ""))
2436 _res
= Py_BuildValue("h",
2441 static PyMethodDef Qd_methods
[] = {
2442 {"OpenPort", (PyCFunction
)Qd_OpenPort
, 1,
2443 "(WindowPtr port) -> None"},
2444 {"InitPort", (PyCFunction
)Qd_InitPort
, 1,
2445 "(WindowPtr port) -> None"},
2446 {"ClosePort", (PyCFunction
)Qd_ClosePort
, 1,
2447 "(WindowPtr port) -> None"},
2448 {"SetPort", (PyCFunction
)Qd_SetPort
, 1,
2449 "(WindowPtr port) -> None"},
2450 {"GetPort", (PyCFunction
)Qd_GetPort
, 1,
2451 "() -> (WindowPtr port)"},
2452 {"GrafDevice", (PyCFunction
)Qd_GrafDevice
, 1,
2453 "(short device) -> None"},
2454 {"PortSize", (PyCFunction
)Qd_PortSize
, 1,
2455 "(short width, short height) -> None"},
2456 {"MovePortTo", (PyCFunction
)Qd_MovePortTo
, 1,
2457 "(short leftGlobal, short topGlobal) -> None"},
2458 {"SetOrigin", (PyCFunction
)Qd_SetOrigin
, 1,
2459 "(short h, short v) -> None"},
2460 {"SetClip", (PyCFunction
)Qd_SetClip
, 1,
2461 "(RgnHandle rgn) -> None"},
2462 {"GetClip", (PyCFunction
)Qd_GetClip
, 1,
2463 "(RgnHandle rgn) -> None"},
2464 {"ClipRect", (PyCFunction
)Qd_ClipRect
, 1,
2465 "(Rect r) -> None"},
2466 {"InitCursor", (PyCFunction
)Qd_InitCursor
, 1,
2468 {"HideCursor", (PyCFunction
)Qd_HideCursor
, 1,
2470 {"ShowCursor", (PyCFunction
)Qd_ShowCursor
, 1,
2472 {"ObscureCursor", (PyCFunction
)Qd_ObscureCursor
, 1,
2474 {"HidePen", (PyCFunction
)Qd_HidePen
, 1,
2476 {"ShowPen", (PyCFunction
)Qd_ShowPen
, 1,
2478 {"GetPen", (PyCFunction
)Qd_GetPen
, 1,
2479 "(Point pt) -> (Point pt)"},
2480 {"PenSize", (PyCFunction
)Qd_PenSize
, 1,
2481 "(short width, short height) -> None"},
2482 {"PenMode", (PyCFunction
)Qd_PenMode
, 1,
2483 "(short mode) -> None"},
2484 {"PenNormal", (PyCFunction
)Qd_PenNormal
, 1,
2486 {"MoveTo", (PyCFunction
)Qd_MoveTo
, 1,
2487 "(short h, short v) -> None"},
2488 {"Move", (PyCFunction
)Qd_Move
, 1,
2489 "(short dh, short dv) -> None"},
2490 {"LineTo", (PyCFunction
)Qd_LineTo
, 1,
2491 "(short h, short v) -> None"},
2492 {"Line", (PyCFunction
)Qd_Line
, 1,
2493 "(short dh, short dv) -> None"},
2494 {"TextFont", (PyCFunction
)Qd_TextFont
, 1,
2495 "(short font) -> None"},
2496 {"TextFace", (PyCFunction
)Qd_TextFace
, 1,
2497 "(short face) -> None"},
2498 {"TextMode", (PyCFunction
)Qd_TextMode
, 1,
2499 "(short mode) -> None"},
2500 {"TextSize", (PyCFunction
)Qd_TextSize
, 1,
2501 "(short size) -> None"},
2502 {"SpaceExtra", (PyCFunction
)Qd_SpaceExtra
, 1,
2503 "(long extra) -> None"},
2504 {"DrawChar", (PyCFunction
)Qd_DrawChar
, 1,
2505 "(short ch) -> None"},
2506 {"DrawString", (PyCFunction
)Qd_DrawString
, 1,
2507 "(Str255 s) -> None"},
2508 {"DrawText", (PyCFunction
)Qd_DrawText
, 1,
2509 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
2510 {"CharWidth", (PyCFunction
)Qd_CharWidth
, 1,
2511 "(short ch) -> (short _rv)"},
2512 {"StringWidth", (PyCFunction
)Qd_StringWidth
, 1,
2513 "(Str255 s) -> (short _rv)"},
2514 {"TextWidth", (PyCFunction
)Qd_TextWidth
, 1,
2515 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
2516 {"ForeColor", (PyCFunction
)Qd_ForeColor
, 1,
2517 "(long color) -> None"},
2518 {"BackColor", (PyCFunction
)Qd_BackColor
, 1,
2519 "(long color) -> None"},
2520 {"ColorBit", (PyCFunction
)Qd_ColorBit
, 1,
2521 "(short whichBit) -> None"},
2522 {"SetRect", (PyCFunction
)Qd_SetRect
, 1,
2523 "(short left, short top, short right, short bottom) -> (Rect r)"},
2524 {"OffsetRect", (PyCFunction
)Qd_OffsetRect
, 1,
2525 "(short dh, short dv) -> (Rect r)"},
2526 {"InsetRect", (PyCFunction
)Qd_InsetRect
, 1,
2527 "(short dh, short dv) -> (Rect r)"},
2528 {"SectRect", (PyCFunction
)Qd_SectRect
, 1,
2529 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
2530 {"UnionRect", (PyCFunction
)Qd_UnionRect
, 1,
2531 "(Rect src1, Rect src2) -> (Rect dstRect)"},
2532 {"EqualRect", (PyCFunction
)Qd_EqualRect
, 1,
2533 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
2534 {"EmptyRect", (PyCFunction
)Qd_EmptyRect
, 1,
2535 "(Rect r) -> (Boolean _rv)"},
2536 {"FrameRect", (PyCFunction
)Qd_FrameRect
, 1,
2537 "(Rect r) -> None"},
2538 {"PaintRect", (PyCFunction
)Qd_PaintRect
, 1,
2539 "(Rect r) -> None"},
2540 {"EraseRect", (PyCFunction
)Qd_EraseRect
, 1,
2541 "(Rect r) -> None"},
2542 {"InvertRect", (PyCFunction
)Qd_InvertRect
, 1,
2543 "(Rect r) -> None"},
2544 {"FrameOval", (PyCFunction
)Qd_FrameOval
, 1,
2545 "(Rect r) -> None"},
2546 {"PaintOval", (PyCFunction
)Qd_PaintOval
, 1,
2547 "(Rect r) -> None"},
2548 {"EraseOval", (PyCFunction
)Qd_EraseOval
, 1,
2549 "(Rect r) -> None"},
2550 {"InvertOval", (PyCFunction
)Qd_InvertOval
, 1,
2551 "(Rect r) -> None"},
2552 {"FrameRoundRect", (PyCFunction
)Qd_FrameRoundRect
, 1,
2553 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2554 {"PaintRoundRect", (PyCFunction
)Qd_PaintRoundRect
, 1,
2555 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2556 {"EraseRoundRect", (PyCFunction
)Qd_EraseRoundRect
, 1,
2557 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2558 {"InvertRoundRect", (PyCFunction
)Qd_InvertRoundRect
, 1,
2559 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
2560 {"FrameArc", (PyCFunction
)Qd_FrameArc
, 1,
2561 "(Rect r, short startAngle, short arcAngle) -> None"},
2562 {"PaintArc", (PyCFunction
)Qd_PaintArc
, 1,
2563 "(Rect r, short startAngle, short arcAngle) -> None"},
2564 {"EraseArc", (PyCFunction
)Qd_EraseArc
, 1,
2565 "(Rect r, short startAngle, short arcAngle) -> None"},
2566 {"InvertArc", (PyCFunction
)Qd_InvertArc
, 1,
2567 "(Rect r, short startAngle, short arcAngle) -> None"},
2568 {"NewRgn", (PyCFunction
)Qd_NewRgn
, 1,
2569 "() -> (RgnHandle _rv)"},
2570 {"OpenRgn", (PyCFunction
)Qd_OpenRgn
, 1,
2572 {"CloseRgn", (PyCFunction
)Qd_CloseRgn
, 1,
2573 "(RgnHandle dstRgn) -> None"},
2574 {"DisposeRgn", (PyCFunction
)Qd_DisposeRgn
, 1,
2575 "(RgnHandle rgn) -> None"},
2576 {"CopyRgn", (PyCFunction
)Qd_CopyRgn
, 1,
2577 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
2578 {"SetEmptyRgn", (PyCFunction
)Qd_SetEmptyRgn
, 1,
2579 "(RgnHandle rgn) -> None"},
2580 {"SetRectRgn", (PyCFunction
)Qd_SetRectRgn
, 1,
2581 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
2582 {"RectRgn", (PyCFunction
)Qd_RectRgn
, 1,
2583 "(RgnHandle rgn, Rect r) -> None"},
2584 {"OffsetRgn", (PyCFunction
)Qd_OffsetRgn
, 1,
2585 "(RgnHandle rgn, short dh, short dv) -> None"},
2586 {"InsetRgn", (PyCFunction
)Qd_InsetRgn
, 1,
2587 "(RgnHandle rgn, short dh, short dv) -> None"},
2588 {"SectRgn", (PyCFunction
)Qd_SectRgn
, 1,
2589 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2590 {"UnionRgn", (PyCFunction
)Qd_UnionRgn
, 1,
2591 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2592 {"DiffRgn", (PyCFunction
)Qd_DiffRgn
, 1,
2593 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2594 {"XorRgn", (PyCFunction
)Qd_XorRgn
, 1,
2595 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
2596 {"RectInRgn", (PyCFunction
)Qd_RectInRgn
, 1,
2597 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
2598 {"EqualRgn", (PyCFunction
)Qd_EqualRgn
, 1,
2599 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
2600 {"EmptyRgn", (PyCFunction
)Qd_EmptyRgn
, 1,
2601 "(RgnHandle rgn) -> (Boolean _rv)"},
2602 {"FrameRgn", (PyCFunction
)Qd_FrameRgn
, 1,
2603 "(RgnHandle rgn) -> None"},
2604 {"PaintRgn", (PyCFunction
)Qd_PaintRgn
, 1,
2605 "(RgnHandle rgn) -> None"},
2606 {"EraseRgn", (PyCFunction
)Qd_EraseRgn
, 1,
2607 "(RgnHandle rgn) -> None"},
2608 {"InvertRgn", (PyCFunction
)Qd_InvertRgn
, 1,
2609 "(RgnHandle rgn) -> None"},
2610 {"ScrollRect", (PyCFunction
)Qd_ScrollRect
, 1,
2611 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
2612 {"OpenPicture", (PyCFunction
)Qd_OpenPicture
, 1,
2613 "(Rect picFrame) -> (PicHandle _rv)"},
2614 {"PicComment", (PyCFunction
)Qd_PicComment
, 1,
2615 "(short kind, short dataSize, Handle dataHandle) -> None"},
2616 {"ClosePicture", (PyCFunction
)Qd_ClosePicture
, 1,
2618 {"DrawPicture", (PyCFunction
)Qd_DrawPicture
, 1,
2619 "(PicHandle myPicture, Rect dstRect) -> None"},
2620 {"KillPicture", (PyCFunction
)Qd_KillPicture
, 1,
2621 "(PicHandle myPicture) -> None"},
2622 {"OpenPoly", (PyCFunction
)Qd_OpenPoly
, 1,
2623 "() -> (PolyHandle _rv)"},
2624 {"ClosePoly", (PyCFunction
)Qd_ClosePoly
, 1,
2626 {"KillPoly", (PyCFunction
)Qd_KillPoly
, 1,
2627 "(PolyHandle poly) -> None"},
2628 {"OffsetPoly", (PyCFunction
)Qd_OffsetPoly
, 1,
2629 "(PolyHandle poly, short dh, short dv) -> None"},
2630 {"FramePoly", (PyCFunction
)Qd_FramePoly
, 1,
2631 "(PolyHandle poly) -> None"},
2632 {"PaintPoly", (PyCFunction
)Qd_PaintPoly
, 1,
2633 "(PolyHandle poly) -> None"},
2634 {"ErasePoly", (PyCFunction
)Qd_ErasePoly
, 1,
2635 "(PolyHandle poly) -> None"},
2636 {"InvertPoly", (PyCFunction
)Qd_InvertPoly
, 1,
2637 "(PolyHandle poly) -> None"},
2638 {"SetPt", (PyCFunction
)Qd_SetPt
, 1,
2639 "(Point pt, short h, short v) -> (Point pt)"},
2640 {"LocalToGlobal", (PyCFunction
)Qd_LocalToGlobal
, 1,
2641 "(Point pt) -> (Point pt)"},
2642 {"GlobalToLocal", (PyCFunction
)Qd_GlobalToLocal
, 1,
2643 "(Point pt) -> (Point pt)"},
2644 {"Random", (PyCFunction
)Qd_Random
, 1,
2645 "() -> (short _rv)"},
2646 {"GetPixel", (PyCFunction
)Qd_GetPixel
, 1,
2647 "(short h, short v) -> (Boolean _rv)"},
2648 {"ScalePt", (PyCFunction
)Qd_ScalePt
, 1,
2649 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2650 {"MapPt", (PyCFunction
)Qd_MapPt
, 1,
2651 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
2652 {"MapRect", (PyCFunction
)Qd_MapRect
, 1,
2653 "(Rect srcRect, Rect dstRect) -> (Rect r)"},
2654 {"MapRgn", (PyCFunction
)Qd_MapRgn
, 1,
2655 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
2656 {"MapPoly", (PyCFunction
)Qd_MapPoly
, 1,
2657 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
2658 {"AddPt", (PyCFunction
)Qd_AddPt
, 1,
2659 "(Point src, Point dst) -> (Point dst)"},
2660 {"EqualPt", (PyCFunction
)Qd_EqualPt
, 1,
2661 "(Point pt1, Point pt2) -> (Boolean _rv)"},
2662 {"PtInRect", (PyCFunction
)Qd_PtInRect
, 1,
2663 "(Point pt, Rect r) -> (Boolean _rv)"},
2664 {"Pt2Rect", (PyCFunction
)Qd_Pt2Rect
, 1,
2665 "(Point pt1, Point pt2) -> (Rect dstRect)"},
2666 {"PtToAngle", (PyCFunction
)Qd_PtToAngle
, 1,
2667 "(Rect r, Point pt) -> (short angle)"},
2668 {"PtInRgn", (PyCFunction
)Qd_PtInRgn
, 1,
2669 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
2670 {"NewPixMap", (PyCFunction
)Qd_NewPixMap
, 1,
2671 "() -> (PixMapHandle _rv)"},
2672 {"DisposPixMap", (PyCFunction
)Qd_DisposPixMap
, 1,
2673 "(PixMapHandle pm) -> None"},
2674 {"DisposePixMap", (PyCFunction
)Qd_DisposePixMap
, 1,
2675 "(PixMapHandle pm) -> None"},
2676 {"CopyPixMap", (PyCFunction
)Qd_CopyPixMap
, 1,
2677 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
2678 {"NewPixPat", (PyCFunction
)Qd_NewPixPat
, 1,
2679 "() -> (PixPatHandle _rv)"},
2680 {"DisposPixPat", (PyCFunction
)Qd_DisposPixPat
, 1,
2681 "(PixPatHandle pp) -> None"},
2682 {"DisposePixPat", (PyCFunction
)Qd_DisposePixPat
, 1,
2683 "(PixPatHandle pp) -> None"},
2684 {"CopyPixPat", (PyCFunction
)Qd_CopyPixPat
, 1,
2685 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
2686 {"PenPixPat", (PyCFunction
)Qd_PenPixPat
, 1,
2687 "(PixPatHandle pp) -> None"},
2688 {"BackPixPat", (PyCFunction
)Qd_BackPixPat
, 1,
2689 "(PixPatHandle pp) -> None"},
2690 {"GetPixPat", (PyCFunction
)Qd_GetPixPat
, 1,
2691 "(short patID) -> (PixPatHandle _rv)"},
2692 {"FillCRect", (PyCFunction
)Qd_FillCRect
, 1,
2693 "(Rect r, PixPatHandle pp) -> None"},
2694 {"FillCOval", (PyCFunction
)Qd_FillCOval
, 1,
2695 "(Rect r, PixPatHandle pp) -> None"},
2696 {"FillCRoundRect", (PyCFunction
)Qd_FillCRoundRect
, 1,
2697 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
2698 {"FillCArc", (PyCFunction
)Qd_FillCArc
, 1,
2699 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
2700 {"FillCRgn", (PyCFunction
)Qd_FillCRgn
, 1,
2701 "(RgnHandle rgn, PixPatHandle pp) -> None"},
2702 {"FillCPoly", (PyCFunction
)Qd_FillCPoly
, 1,
2703 "(PolyHandle poly, PixPatHandle pp) -> None"},
2704 {"SetPortPix", (PyCFunction
)Qd_SetPortPix
, 1,
2705 "(PixMapHandle pm) -> None"},
2706 {"AllocCursor", (PyCFunction
)Qd_AllocCursor
, 1,
2708 {"CharExtra", (PyCFunction
)Qd_CharExtra
, 1,
2709 "(long extra) -> None"},
2710 {"GetCTSeed", (PyCFunction
)Qd_GetCTSeed
, 1,
2711 "() -> (long _rv)"},
2712 {"SubPt", (PyCFunction
)Qd_SubPt
, 1,
2713 "(Point src, Point dst) -> (Point dst)"},
2714 {"SetClientID", (PyCFunction
)Qd_SetClientID
, 1,
2715 "(short id) -> None"},
2716 {"ProtectEntry", (PyCFunction
)Qd_ProtectEntry
, 1,
2717 "(short index, Boolean protect) -> None"},
2718 {"ReserveEntry", (PyCFunction
)Qd_ReserveEntry
, 1,
2719 "(short index, Boolean reserve) -> None"},
2720 {"QDError", (PyCFunction
)Qd_QDError
, 1,
2721 "() -> (short _rv)"},
2736 m
= Py_InitModule("Qd", Qd_methods
);
2737 d
= PyModule_GetDict(m
);
2738 Qd_Error
= PyMac_GetOSErrException();
2739 if (Qd_Error
== NULL
||
2740 PyDict_SetItemString(d
, "Error", Qd_Error
) != 0)
2741 Py_FatalError("can't initialize Qd.Error");
2744 /* ========================= End module Qd ========================== */