2 /* =========================== Module Qd ============================ */
8 #define SystemSevenOrLater 1
16 extern PyObject
*ResObj_New(Handle
);
17 extern int ResObj_Convert(PyObject
*, Handle
*);
18 extern PyObject
*OptResObj_New(Handle
);
19 extern int OptResObj_Convert(PyObject
*, Handle
*);
21 extern PyObject
*WinObj_New(WindowPtr
);
22 extern int WinObj_Convert(PyObject
*, WindowPtr
*);
23 extern PyTypeObject Window_Type
;
24 #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
26 extern PyObject
*DlgObj_New(DialogPtr
);
27 extern int DlgObj_Convert(PyObject
*, DialogPtr
*);
28 extern PyTypeObject Dialog_Type
;
29 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
31 extern PyObject
*MenuObj_New(MenuHandle
);
32 extern int MenuObj_Convert(PyObject
*, MenuHandle
*);
34 extern PyObject
*CtlObj_New(ControlHandle
);
35 extern int CtlObj_Convert(PyObject
*, ControlHandle
*);
37 extern PyObject
*GrafObj_New(GrafPtr
);
38 extern int GrafObj_Convert(PyObject
*, GrafPtr
*);
40 extern PyObject
*BMObj_New(BitMapPtr
);
41 extern int BMObj_Convert(PyObject
*, BitMapPtr
*);
43 extern PyObject
*WinObj_WhichWindow(WindowPtr
);
45 #include <QuickDraw.h>
47 #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
50 ** Parse/generate RGB records
52 PyObject
*QdRGB_New(itself
)
56 return Py_BuildValue("lll", (long)itself
->red
, (long)itself
->green
, (long)itself
->blue
);
59 QdRGB_Convert(v
, p_itself
)
63 long red
, green
, blue
;
65 if( !PyArg_ParseTuple(v
, "lll", &red
, &green
, &blue
) )
67 p_itself
->red
= (unsigned short)red
;
68 p_itself
->green
= (unsigned short)green
;
69 p_itself
->blue
= (unsigned short)blue
;
74 ** Generate FontInfo records
77 PyObject
*QdFI_New(itself
)
81 return Py_BuildValue("hhhh", itself
->ascent
, itself
->descent
,
82 itself
->widMax
, itself
->leading
);
87 static PyObject
*Qd_Error
;
89 /* ---------------------- Object type GrafPort ---------------------- */
91 PyTypeObject GrafPort_Type
;
93 #define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type)
95 typedef struct GrafPortObject
{
100 PyObject
*GrafObj_New(itself
)
104 if (itself
== NULL
) return PyMac_Error(resNotFound
);
105 it
= PyObject_NEW(GrafPortObject
, &GrafPort_Type
);
106 if (it
== NULL
) return NULL
;
107 it
->ob_itself
= itself
;
108 return (PyObject
*)it
;
110 GrafObj_Convert(v
, p_itself
)
114 if (DlgObj_Check(v
) || WinObj_Check(v
)) {
115 *p_itself
= ((GrafPortObject
*)v
)->ob_itself
;
118 if (!GrafObj_Check(v
))
120 PyErr_SetString(PyExc_TypeError
, "GrafPort required");
123 *p_itself
= ((GrafPortObject
*)v
)->ob_itself
;
127 static void GrafObj_dealloc(self
)
128 GrafPortObject
*self
;
130 /* Cleanup of self->ob_itself goes here */
134 static PyMethodDef GrafObj_methods
[] = {
138 PyMethodChain GrafObj_chain
= { GrafObj_methods
, NULL
};
140 static PyObject
*GrafObj_getattr(self
, name
)
141 GrafPortObject
*self
;
145 { CGrafPtr itself_color
= (CGrafPtr
)self
->ob_itself
;
147 if ( strcmp(name
, "data") == 0 )
148 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(GrafPort
));
150 if ( (itself_color
->portVersion
&0xc000) == 0xc000 ) {
151 /* Color-only attributes */
153 if ( strcmp(name
, "portBits") == 0 )
154 /* XXXX Do we need HLock() stuff here?? */
155 return BMObj_New((BitMapPtr
)*itself_color
->portPixMap
);
156 if ( strcmp(name
, "grafVars") == 0 )
157 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->visRgn
);
158 if ( strcmp(name
, "chExtra") == 0 )
159 return Py_BuildValue("h", itself_color
->chExtra
);
160 if ( strcmp(name
, "pnLocHFrac") == 0 )
161 return Py_BuildValue("h", itself_color
->pnLocHFrac
);
162 if ( strcmp(name
, "bkPixPat") == 0 )
163 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->bkPixPat
);
164 if ( strcmp(name
, "rgbFgColor") == 0 )
165 return Py_BuildValue("O&", QdRGB_New
, &itself_color
->rgbFgColor
);
166 if ( strcmp(name
, "rgbBkColor") == 0 )
167 return Py_BuildValue("O&", QdRGB_New
, &itself_color
->rgbBkColor
);
168 if ( strcmp(name
, "pnPixPat") == 0 )
169 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->pnPixPat
);
170 if ( strcmp(name
, "fillPixPat") == 0 )
171 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->fillPixPat
);
173 /* Mono-only attributes */
174 if ( strcmp(name
, "portBits") == 0 )
175 return BMObj_New(&self
->ob_itself
->portBits
);
176 if ( strcmp(name
, "bkPat") == 0 )
177 return Py_BuildValue("s#", (char *)&self
->ob_itself
->bkPat
, sizeof(Pattern
));
178 if ( strcmp(name
, "fillPat") == 0 )
179 return Py_BuildValue("s#", (char *)&self
->ob_itself
->fillPat
, sizeof(Pattern
));
180 if ( strcmp(name
, "pnPat") == 0 )
181 return Py_BuildValue("s#", (char *)&self
->ob_itself
->pnPat
, sizeof(Pattern
));
184 ** Accessible for both color/mono windows.
185 ** portVersion is really color-only, but we put it here
188 if ( strcmp(name
, "portVersion") == 0 )
189 return Py_BuildValue("h", itself_color
->portVersion
);
190 if ( strcmp(name
, "device") == 0 )
191 return PyInt_FromLong((long)self
->ob_itself
->device
);
192 if ( strcmp(name
, "portRect") == 0 )
193 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->portRect
);
194 if ( strcmp(name
, "visRgn") == 0 )
195 return Py_BuildValue("O&", ResObj_New
, (Handle
)self
->ob_itself
->visRgn
);
196 if ( strcmp(name
, "clipRgn") == 0 )
197 return Py_BuildValue("O&", ResObj_New
, (Handle
)self
->ob_itself
->clipRgn
);
198 if ( strcmp(name
, "pnLoc") == 0 )
199 return Py_BuildValue("O&", PyMac_BuildPoint
, self
->ob_itself
->pnLoc
);
200 if ( strcmp(name
, "pnSize") == 0 )
201 return Py_BuildValue("O&", PyMac_BuildPoint
, self
->ob_itself
->pnSize
);
202 if ( strcmp(name
, "pnMode") == 0 )
203 return Py_BuildValue("h", self
->ob_itself
->pnMode
);
204 if ( strcmp(name
, "pnVis") == 0 )
205 return Py_BuildValue("h", self
->ob_itself
->pnVis
);
206 if ( strcmp(name
, "txFont") == 0 )
207 return Py_BuildValue("h", self
->ob_itself
->txFont
);
208 if ( strcmp(name
, "txFace") == 0 )
209 return Py_BuildValue("h", (short)self
->ob_itself
->txFace
);
210 if ( strcmp(name
, "txMode") == 0 )
211 return Py_BuildValue("h", self
->ob_itself
->txMode
);
212 if ( strcmp(name
, "txSize") == 0 )
213 return Py_BuildValue("h", self
->ob_itself
->txSize
);
214 if ( strcmp(name
, "spExtra") == 0 )
215 return Py_BuildValue("O&", PyMac_BuildFixed
, self
->ob_itself
->spExtra
);
216 /* XXXX Add more, as needed */
217 /* This one is so we can compare grafports: */
218 if ( strcmp(name
, "_id") == 0 )
219 return Py_BuildValue("l", (long)self
->ob_itself
);
221 return Py_FindMethodInChain(&GrafObj_chain
, (PyObject
*)self
, name
);
224 #define GrafObj_setattr NULL
226 PyTypeObject GrafPort_Type
= {
227 PyObject_HEAD_INIT(&PyType_Type
)
229 "GrafPort", /*tp_name*/
230 sizeof(GrafPortObject
), /*tp_basicsize*/
233 (destructor
) GrafObj_dealloc
, /*tp_dealloc*/
235 (getattrfunc
) GrafObj_getattr
, /*tp_getattr*/
236 (setattrfunc
) GrafObj_setattr
, /*tp_setattr*/
239 /* -------------------- End object type GrafPort -------------------- */
242 /* ----------------------- Object type BitMap ----------------------- */
244 PyTypeObject BitMap_Type
;
246 #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type)
248 typedef struct BitMapObject
{
251 PyObject
*referred_object
;
252 BitMap
*referred_bitmap
;
255 PyObject
*BMObj_New(itself
)
259 if (itself
== NULL
) return PyMac_Error(resNotFound
);
260 it
= PyObject_NEW(BitMapObject
, &BitMap_Type
);
261 if (it
== NULL
) return NULL
;
262 it
->ob_itself
= itself
;
263 it
->referred_object
= NULL
;
264 it
->referred_bitmap
= NULL
;
265 return (PyObject
*)it
;
267 BMObj_Convert(v
, p_itself
)
273 PyErr_SetString(PyExc_TypeError
, "BitMap required");
276 *p_itself
= ((BitMapObject
*)v
)->ob_itself
;
280 static void BMObj_dealloc(self
)
283 Py_XDECREF(self
->referred_object
);
284 if (self
->referred_bitmap
) free(self
->referred_bitmap
);
288 static PyMethodDef BMObj_methods
[] = {
292 PyMethodChain BMObj_chain
= { BMObj_methods
, NULL
};
294 static PyObject
*BMObj_getattr(self
, name
)
298 if ( strcmp(name
, "baseAddr") == 0 )
299 return PyInt_FromLong((long)self
->ob_itself
->baseAddr
);
300 if ( strcmp(name
, "rowBytes") == 0 )
301 return PyInt_FromLong((long)self
->ob_itself
->rowBytes
);
302 if ( strcmp(name
, "bounds") == 0 )
303 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->bounds
);
304 /* XXXX Add more, as needed */
305 if ( strcmp(name
, "bitmap_data") == 0 )
306 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(BitMap
));
307 if ( strcmp(name
, "pixmap_data") == 0 )
308 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(PixMap
));
310 return Py_FindMethodInChain(&BMObj_chain
, (PyObject
*)self
, name
);
313 #define BMObj_setattr NULL
315 PyTypeObject BitMap_Type
= {
316 PyObject_HEAD_INIT(&PyType_Type
)
318 "BitMap", /*tp_name*/
319 sizeof(BitMapObject
), /*tp_basicsize*/
322 (destructor
) BMObj_dealloc
, /*tp_dealloc*/
324 (getattrfunc
) BMObj_getattr
, /*tp_getattr*/
325 (setattrfunc
) BMObj_setattr
, /*tp_setattr*/
328 /* --------------------- End object type BitMap --------------------- */
331 /* ------------------ Object type QDGlobalsAccess ------------------- */
333 staticforward PyTypeObject QDGlobalsAccess_Type
;
335 #define QDGA_Check(x) ((x)->ob_type == &QDGlobalsAccess_Type)
337 typedef struct QDGlobalsAccessObject
{
339 } QDGlobalsAccessObject
;
341 static PyObject
*QDGA_New()
343 QDGlobalsAccessObject
*it
;
344 it
= PyObject_NEW(QDGlobalsAccessObject
, &QDGlobalsAccess_Type
);
345 if (it
== NULL
) return NULL
;
346 return (PyObject
*)it
;
349 static void QDGA_dealloc(self
)
350 QDGlobalsAccessObject
*self
;
355 static PyMethodDef QDGA_methods
[] = {
359 static PyMethodChain QDGA_chain
= { QDGA_methods
, NULL
};
361 static PyObject
*QDGA_getattr(self
, name
)
362 QDGlobalsAccessObject
*self
;
366 if ( strcmp(name
, "arrow") == 0 )
367 return PyString_FromStringAndSize((char *)&qd
.arrow
, sizeof(qd
.arrow
));
368 if ( strcmp(name
, "black") == 0 )
369 return PyString_FromStringAndSize((char *)&qd
.black
, sizeof(qd
.black
));
370 if ( strcmp(name
, "white") == 0 )
371 return PyString_FromStringAndSize((char *)&qd
.white
, sizeof(qd
.white
));
372 if ( strcmp(name
, "gray") == 0 )
373 return PyString_FromStringAndSize((char *)&qd
.gray
, sizeof(qd
.gray
));
374 if ( strcmp(name
, "ltGray") == 0 )
375 return PyString_FromStringAndSize((char *)&qd
.ltGray
, sizeof(qd
.ltGray
));
376 if ( strcmp(name
, "dkGray") == 0 )
377 return PyString_FromStringAndSize((char *)&qd
.dkGray
, sizeof(qd
.dkGray
));
378 if ( strcmp(name
, "screenBits") == 0 )
379 return BMObj_New(&qd
.screenBits
);
380 if ( strcmp(name
, "thePort") == 0 )
381 return GrafObj_New(qd
.thePort
);
382 if ( strcmp(name
, "randSeed") == 0 )
383 return Py_BuildValue("l", &qd
.randSeed
);
385 return Py_FindMethodInChain(&QDGA_chain
, (PyObject
*)self
, name
);
388 #define QDGA_setattr NULL
390 staticforward PyTypeObject QDGlobalsAccess_Type
= {
391 PyObject_HEAD_INIT(&PyType_Type
)
393 "QDGlobalsAccess", /*tp_name*/
394 sizeof(QDGlobalsAccessObject
), /*tp_basicsize*/
397 (destructor
) QDGA_dealloc
, /*tp_dealloc*/
399 (getattrfunc
) QDGA_getattr
, /*tp_getattr*/
400 (setattrfunc
) QDGA_setattr
, /*tp_setattr*/
403 /* ---------------- End object type QDGlobalsAccess ----------------- */
406 static PyObject
*Qd_MacSetPort(_self
, _args
)
410 PyObject
*_res
= NULL
;
412 if (!PyArg_ParseTuple(_args
, "O&",
413 GrafObj_Convert
, &port
))
421 static PyObject
*Qd_GetPort(_self
, _args
)
425 PyObject
*_res
= NULL
;
427 if (!PyArg_ParseTuple(_args
, ""))
430 _res
= Py_BuildValue("O&",
435 static PyObject
*Qd_GrafDevice(_self
, _args
)
439 PyObject
*_res
= NULL
;
441 if (!PyArg_ParseTuple(_args
, "h",
450 static PyObject
*Qd_SetPortBits(_self
, _args
)
454 PyObject
*_res
= NULL
;
456 if (!PyArg_ParseTuple(_args
, "O&",
465 static PyObject
*Qd_PortSize(_self
, _args
)
469 PyObject
*_res
= NULL
;
472 if (!PyArg_ParseTuple(_args
, "hh",
483 static PyObject
*Qd_MovePortTo(_self
, _args
)
487 PyObject
*_res
= NULL
;
490 if (!PyArg_ParseTuple(_args
, "hh",
494 MovePortTo(leftGlobal
,
501 static PyObject
*Qd_SetOrigin(_self
, _args
)
505 PyObject
*_res
= NULL
;
508 if (!PyArg_ParseTuple(_args
, "hh",
519 static PyObject
*Qd_SetClip(_self
, _args
)
523 PyObject
*_res
= NULL
;
525 if (!PyArg_ParseTuple(_args
, "O&",
526 ResObj_Convert
, &rgn
))
534 static PyObject
*Qd_GetClip(_self
, _args
)
538 PyObject
*_res
= NULL
;
540 if (!PyArg_ParseTuple(_args
, "O&",
541 ResObj_Convert
, &rgn
))
549 static PyObject
*Qd_ClipRect(_self
, _args
)
553 PyObject
*_res
= NULL
;
555 if (!PyArg_ParseTuple(_args
, "O&",
564 static PyObject
*Qd_BackPat(_self
, _args
)
568 PyObject
*_res
= NULL
;
571 if (!PyArg_ParseTuple(_args
, "s#",
572 (char **)&pat__in__
, &pat__in_len__
))
574 if (pat__in_len__
!= sizeof(Pattern
))
576 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
586 static PyObject
*Qd_InitCursor(_self
, _args
)
590 PyObject
*_res
= NULL
;
591 if (!PyArg_ParseTuple(_args
, ""))
599 static PyObject
*Qd_MacSetCursor(_self
, _args
)
603 PyObject
*_res
= NULL
;
606 if (!PyArg_ParseTuple(_args
, "s#",
607 (char **)&crsr__in__
, &crsr__in_len__
))
609 if (crsr__in_len__
!= sizeof(Cursor
))
611 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
614 MacSetCursor(crsr__in__
);
621 static PyObject
*Qd_HideCursor(_self
, _args
)
625 PyObject
*_res
= NULL
;
626 if (!PyArg_ParseTuple(_args
, ""))
634 static PyObject
*Qd_MacShowCursor(_self
, _args
)
638 PyObject
*_res
= NULL
;
639 if (!PyArg_ParseTuple(_args
, ""))
647 static PyObject
*Qd_ObscureCursor(_self
, _args
)
651 PyObject
*_res
= NULL
;
652 if (!PyArg_ParseTuple(_args
, ""))
660 static PyObject
*Qd_HidePen(_self
, _args
)
664 PyObject
*_res
= NULL
;
665 if (!PyArg_ParseTuple(_args
, ""))
673 static PyObject
*Qd_ShowPen(_self
, _args
)
677 PyObject
*_res
= NULL
;
678 if (!PyArg_ParseTuple(_args
, ""))
686 static PyObject
*Qd_GetPen(_self
, _args
)
690 PyObject
*_res
= NULL
;
692 if (!PyArg_ParseTuple(_args
, ""))
695 _res
= Py_BuildValue("O&",
696 PyMac_BuildPoint
, pt
);
700 static PyObject
*Qd_GetPenState(_self
, _args
)
704 PyObject
*_res
= NULL
;
705 PenState pnState__out__
;
706 if (!PyArg_ParseTuple(_args
, ""))
708 GetPenState(&pnState__out__
);
709 _res
= Py_BuildValue("s#",
710 (char *)&pnState__out__
, (int)sizeof(PenState
));
715 static PyObject
*Qd_SetPenState(_self
, _args
)
719 PyObject
*_res
= NULL
;
720 PenState
*pnState__in__
;
721 int pnState__in_len__
;
722 if (!PyArg_ParseTuple(_args
, "s#",
723 (char **)&pnState__in__
, &pnState__in_len__
))
725 if (pnState__in_len__
!= sizeof(PenState
))
727 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(PenState)");
728 goto pnState__error__
;
730 SetPenState(pnState__in__
);
737 static PyObject
*Qd_PenSize(_self
, _args
)
741 PyObject
*_res
= NULL
;
744 if (!PyArg_ParseTuple(_args
, "hh",
755 static PyObject
*Qd_PenMode(_self
, _args
)
759 PyObject
*_res
= NULL
;
761 if (!PyArg_ParseTuple(_args
, "h",
770 static PyObject
*Qd_PenPat(_self
, _args
)
774 PyObject
*_res
= NULL
;
777 if (!PyArg_ParseTuple(_args
, "s#",
778 (char **)&pat__in__
, &pat__in_len__
))
780 if (pat__in_len__
!= sizeof(Pattern
))
782 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
792 static PyObject
*Qd_PenNormal(_self
, _args
)
796 PyObject
*_res
= NULL
;
797 if (!PyArg_ParseTuple(_args
, ""))
805 static PyObject
*Qd_MoveTo(_self
, _args
)
809 PyObject
*_res
= NULL
;
812 if (!PyArg_ParseTuple(_args
, "hh",
823 static PyObject
*Qd_Move(_self
, _args
)
827 PyObject
*_res
= NULL
;
830 if (!PyArg_ParseTuple(_args
, "hh",
841 static PyObject
*Qd_MacLineTo(_self
, _args
)
845 PyObject
*_res
= NULL
;
848 if (!PyArg_ParseTuple(_args
, "hh",
859 static PyObject
*Qd_Line(_self
, _args
)
863 PyObject
*_res
= NULL
;
866 if (!PyArg_ParseTuple(_args
, "hh",
877 static PyObject
*Qd_ForeColor(_self
, _args
)
881 PyObject
*_res
= NULL
;
883 if (!PyArg_ParseTuple(_args
, "l",
892 static PyObject
*Qd_BackColor(_self
, _args
)
896 PyObject
*_res
= NULL
;
898 if (!PyArg_ParseTuple(_args
, "l",
907 static PyObject
*Qd_ColorBit(_self
, _args
)
911 PyObject
*_res
= NULL
;
913 if (!PyArg_ParseTuple(_args
, "h",
922 static PyObject
*Qd_MacSetRect(_self
, _args
)
926 PyObject
*_res
= NULL
;
932 if (!PyArg_ParseTuple(_args
, "hhhh",
943 _res
= Py_BuildValue("O&",
944 PyMac_BuildRect
, &r
);
948 static PyObject
*Qd_MacOffsetRect(_self
, _args
)
952 PyObject
*_res
= NULL
;
956 if (!PyArg_ParseTuple(_args
, "O&hh",
964 _res
= Py_BuildValue("O&",
965 PyMac_BuildRect
, &r
);
969 static PyObject
*Qd_MacInsetRect(_self
, _args
)
973 PyObject
*_res
= NULL
;
977 if (!PyArg_ParseTuple(_args
, "O&hh",
985 _res
= Py_BuildValue("O&",
986 PyMac_BuildRect
, &r
);
990 static PyObject
*Qd_SectRect(_self
, _args
)
994 PyObject
*_res
= NULL
;
999 if (!PyArg_ParseTuple(_args
, "O&O&",
1000 PyMac_GetRect
, &src1
,
1001 PyMac_GetRect
, &src2
))
1003 _rv
= SectRect(&src1
,
1006 _res
= Py_BuildValue("bO&",
1008 PyMac_BuildRect
, &dstRect
);
1012 static PyObject
*Qd_MacUnionRect(_self
, _args
)
1016 PyObject
*_res
= NULL
;
1020 if (!PyArg_ParseTuple(_args
, "O&O&",
1021 PyMac_GetRect
, &src1
,
1022 PyMac_GetRect
, &src2
))
1027 _res
= Py_BuildValue("O&",
1028 PyMac_BuildRect
, &dstRect
);
1032 static PyObject
*Qd_MacEqualRect(_self
, _args
)
1036 PyObject
*_res
= NULL
;
1040 if (!PyArg_ParseTuple(_args
, "O&O&",
1041 PyMac_GetRect
, &rect1
,
1042 PyMac_GetRect
, &rect2
))
1044 _rv
= MacEqualRect(&rect1
,
1046 _res
= Py_BuildValue("b",
1051 static PyObject
*Qd_EmptyRect(_self
, _args
)
1055 PyObject
*_res
= NULL
;
1058 if (!PyArg_ParseTuple(_args
, "O&",
1061 _rv
= EmptyRect(&r
);
1062 _res
= Py_BuildValue("b",
1067 static PyObject
*Qd_MacFrameRect(_self
, _args
)
1071 PyObject
*_res
= NULL
;
1073 if (!PyArg_ParseTuple(_args
, "O&",
1082 static PyObject
*Qd_PaintRect(_self
, _args
)
1086 PyObject
*_res
= NULL
;
1088 if (!PyArg_ParseTuple(_args
, "O&",
1097 static PyObject
*Qd_EraseRect(_self
, _args
)
1101 PyObject
*_res
= NULL
;
1103 if (!PyArg_ParseTuple(_args
, "O&",
1112 static PyObject
*Qd_MacInvertRect(_self
, _args
)
1116 PyObject
*_res
= NULL
;
1118 if (!PyArg_ParseTuple(_args
, "O&",
1127 static PyObject
*Qd_MacFillRect(_self
, _args
)
1131 PyObject
*_res
= NULL
;
1135 if (!PyArg_ParseTuple(_args
, "O&s#",
1137 (char **)&pat__in__
, &pat__in_len__
))
1139 if (pat__in_len__
!= sizeof(Pattern
))
1141 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1152 static PyObject
*Qd_FrameOval(_self
, _args
)
1156 PyObject
*_res
= NULL
;
1158 if (!PyArg_ParseTuple(_args
, "O&",
1167 static PyObject
*Qd_PaintOval(_self
, _args
)
1171 PyObject
*_res
= NULL
;
1173 if (!PyArg_ParseTuple(_args
, "O&",
1182 static PyObject
*Qd_EraseOval(_self
, _args
)
1186 PyObject
*_res
= NULL
;
1188 if (!PyArg_ParseTuple(_args
, "O&",
1197 static PyObject
*Qd_InvertOval(_self
, _args
)
1201 PyObject
*_res
= NULL
;
1203 if (!PyArg_ParseTuple(_args
, "O&",
1212 static PyObject
*Qd_FillOval(_self
, _args
)
1216 PyObject
*_res
= NULL
;
1220 if (!PyArg_ParseTuple(_args
, "O&s#",
1222 (char **)&pat__in__
, &pat__in_len__
))
1224 if (pat__in_len__
!= sizeof(Pattern
))
1226 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1237 static PyObject
*Qd_FrameRoundRect(_self
, _args
)
1241 PyObject
*_res
= NULL
;
1245 if (!PyArg_ParseTuple(_args
, "O&hh",
1258 static PyObject
*Qd_PaintRoundRect(_self
, _args
)
1262 PyObject
*_res
= NULL
;
1266 if (!PyArg_ParseTuple(_args
, "O&hh",
1279 static PyObject
*Qd_EraseRoundRect(_self
, _args
)
1283 PyObject
*_res
= NULL
;
1287 if (!PyArg_ParseTuple(_args
, "O&hh",
1300 static PyObject
*Qd_InvertRoundRect(_self
, _args
)
1304 PyObject
*_res
= NULL
;
1308 if (!PyArg_ParseTuple(_args
, "O&hh",
1321 static PyObject
*Qd_FillRoundRect(_self
, _args
)
1325 PyObject
*_res
= NULL
;
1331 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1335 (char **)&pat__in__
, &pat__in_len__
))
1337 if (pat__in_len__
!= sizeof(Pattern
))
1339 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1352 static PyObject
*Qd_FrameArc(_self
, _args
)
1356 PyObject
*_res
= NULL
;
1360 if (!PyArg_ParseTuple(_args
, "O&hh",
1373 static PyObject
*Qd_PaintArc(_self
, _args
)
1377 PyObject
*_res
= NULL
;
1381 if (!PyArg_ParseTuple(_args
, "O&hh",
1394 static PyObject
*Qd_EraseArc(_self
, _args
)
1398 PyObject
*_res
= NULL
;
1402 if (!PyArg_ParseTuple(_args
, "O&hh",
1415 static PyObject
*Qd_InvertArc(_self
, _args
)
1419 PyObject
*_res
= NULL
;
1423 if (!PyArg_ParseTuple(_args
, "O&hh",
1436 static PyObject
*Qd_FillArc(_self
, _args
)
1440 PyObject
*_res
= NULL
;
1446 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1450 (char **)&pat__in__
, &pat__in_len__
))
1452 if (pat__in_len__
!= sizeof(Pattern
))
1454 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1467 static PyObject
*Qd_NewRgn(_self
, _args
)
1471 PyObject
*_res
= NULL
;
1473 if (!PyArg_ParseTuple(_args
, ""))
1476 _res
= Py_BuildValue("O&",
1481 static PyObject
*Qd_OpenRgn(_self
, _args
)
1485 PyObject
*_res
= NULL
;
1486 if (!PyArg_ParseTuple(_args
, ""))
1494 static PyObject
*Qd_CloseRgn(_self
, _args
)
1498 PyObject
*_res
= NULL
;
1500 if (!PyArg_ParseTuple(_args
, "O&",
1501 ResObj_Convert
, &dstRgn
))
1509 static PyObject
*Qd_BitMapToRegion(_self
, _args
)
1513 PyObject
*_res
= NULL
;
1517 if (!PyArg_ParseTuple(_args
, "O&O&",
1518 ResObj_Convert
, ®ion
,
1519 BMObj_Convert
, &bMap
))
1521 _err
= BitMapToRegion(region
,
1523 if (_err
!= noErr
) return PyMac_Error(_err
);
1529 static PyObject
*Qd_DisposeRgn(_self
, _args
)
1533 PyObject
*_res
= NULL
;
1535 if (!PyArg_ParseTuple(_args
, "O&",
1536 ResObj_Convert
, &rgn
))
1544 static PyObject
*Qd_MacCopyRgn(_self
, _args
)
1548 PyObject
*_res
= NULL
;
1551 if (!PyArg_ParseTuple(_args
, "O&O&",
1552 ResObj_Convert
, &srcRgn
,
1553 ResObj_Convert
, &dstRgn
))
1562 static PyObject
*Qd_SetEmptyRgn(_self
, _args
)
1566 PyObject
*_res
= NULL
;
1568 if (!PyArg_ParseTuple(_args
, "O&",
1569 ResObj_Convert
, &rgn
))
1577 static PyObject
*Qd_MacSetRectRgn(_self
, _args
)
1581 PyObject
*_res
= NULL
;
1587 if (!PyArg_ParseTuple(_args
, "O&hhhh",
1588 ResObj_Convert
, &rgn
,
1604 static PyObject
*Qd_RectRgn(_self
, _args
)
1608 PyObject
*_res
= NULL
;
1611 if (!PyArg_ParseTuple(_args
, "O&O&",
1612 ResObj_Convert
, &rgn
,
1622 static PyObject
*Qd_MacOffsetRgn(_self
, _args
)
1626 PyObject
*_res
= NULL
;
1630 if (!PyArg_ParseTuple(_args
, "O&hh",
1631 ResObj_Convert
, &rgn
,
1643 static PyObject
*Qd_InsetRgn(_self
, _args
)
1647 PyObject
*_res
= NULL
;
1651 if (!PyArg_ParseTuple(_args
, "O&hh",
1652 ResObj_Convert
, &rgn
,
1664 static PyObject
*Qd_SectRgn(_self
, _args
)
1668 PyObject
*_res
= NULL
;
1672 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1673 ResObj_Convert
, &srcRgnA
,
1674 ResObj_Convert
, &srcRgnB
,
1675 ResObj_Convert
, &dstRgn
))
1685 static PyObject
*Qd_MacUnionRgn(_self
, _args
)
1689 PyObject
*_res
= NULL
;
1693 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1694 ResObj_Convert
, &srcRgnA
,
1695 ResObj_Convert
, &srcRgnB
,
1696 ResObj_Convert
, &dstRgn
))
1698 MacUnionRgn(srcRgnA
,
1706 static PyObject
*Qd_DiffRgn(_self
, _args
)
1710 PyObject
*_res
= NULL
;
1714 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1715 ResObj_Convert
, &srcRgnA
,
1716 ResObj_Convert
, &srcRgnB
,
1717 ResObj_Convert
, &dstRgn
))
1727 static PyObject
*Qd_MacXorRgn(_self
, _args
)
1731 PyObject
*_res
= NULL
;
1735 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1736 ResObj_Convert
, &srcRgnA
,
1737 ResObj_Convert
, &srcRgnB
,
1738 ResObj_Convert
, &dstRgn
))
1748 static PyObject
*Qd_RectInRgn(_self
, _args
)
1752 PyObject
*_res
= NULL
;
1756 if (!PyArg_ParseTuple(_args
, "O&O&",
1758 ResObj_Convert
, &rgn
))
1762 _res
= Py_BuildValue("b",
1767 static PyObject
*Qd_MacEqualRgn(_self
, _args
)
1771 PyObject
*_res
= NULL
;
1775 if (!PyArg_ParseTuple(_args
, "O&O&",
1776 ResObj_Convert
, &rgnA
,
1777 ResObj_Convert
, &rgnB
))
1779 _rv
= MacEqualRgn(rgnA
,
1781 _res
= Py_BuildValue("b",
1786 static PyObject
*Qd_EmptyRgn(_self
, _args
)
1790 PyObject
*_res
= NULL
;
1793 if (!PyArg_ParseTuple(_args
, "O&",
1794 ResObj_Convert
, &rgn
))
1796 _rv
= EmptyRgn(rgn
);
1797 _res
= Py_BuildValue("b",
1802 static PyObject
*Qd_MacFrameRgn(_self
, _args
)
1806 PyObject
*_res
= NULL
;
1808 if (!PyArg_ParseTuple(_args
, "O&",
1809 ResObj_Convert
, &rgn
))
1817 static PyObject
*Qd_MacPaintRgn(_self
, _args
)
1821 PyObject
*_res
= NULL
;
1823 if (!PyArg_ParseTuple(_args
, "O&",
1824 ResObj_Convert
, &rgn
))
1832 static PyObject
*Qd_EraseRgn(_self
, _args
)
1836 PyObject
*_res
= NULL
;
1838 if (!PyArg_ParseTuple(_args
, "O&",
1839 ResObj_Convert
, &rgn
))
1847 static PyObject
*Qd_MacInvertRgn(_self
, _args
)
1851 PyObject
*_res
= NULL
;
1853 if (!PyArg_ParseTuple(_args
, "O&",
1854 ResObj_Convert
, &rgn
))
1862 static PyObject
*Qd_MacFillRgn(_self
, _args
)
1866 PyObject
*_res
= NULL
;
1870 if (!PyArg_ParseTuple(_args
, "O&s#",
1871 ResObj_Convert
, &rgn
,
1872 (char **)&pat__in__
, &pat__in_len__
))
1874 if (pat__in_len__
!= sizeof(Pattern
))
1876 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1887 static PyObject
*Qd_ScrollRect(_self
, _args
)
1891 PyObject
*_res
= NULL
;
1895 RgnHandle updateRgn
;
1896 if (!PyArg_ParseTuple(_args
, "O&hhO&",
1900 ResObj_Convert
, &updateRgn
))
1911 static PyObject
*Qd_CopyBits(_self
, _args
)
1915 PyObject
*_res
= NULL
;
1922 if (!PyArg_ParseTuple(_args
, "O&O&O&O&hO&",
1923 BMObj_Convert
, &srcBits
,
1924 BMObj_Convert
, &dstBits
,
1925 PyMac_GetRect
, &srcRect
,
1926 PyMac_GetRect
, &dstRect
,
1928 OptResObj_Convert
, &maskRgn
))
1941 static PyObject
*Qd_CopyMask(_self
, _args
)
1945 PyObject
*_res
= NULL
;
1952 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&",
1953 BMObj_Convert
, &srcBits
,
1954 BMObj_Convert
, &maskBits
,
1955 BMObj_Convert
, &dstBits
,
1956 PyMac_GetRect
, &srcRect
,
1957 PyMac_GetRect
, &maskRect
,
1958 PyMac_GetRect
, &dstRect
))
1971 static PyObject
*Qd_OpenPicture(_self
, _args
)
1975 PyObject
*_res
= NULL
;
1978 if (!PyArg_ParseTuple(_args
, "O&",
1979 PyMac_GetRect
, &picFrame
))
1981 _rv
= OpenPicture(&picFrame
);
1982 _res
= Py_BuildValue("O&",
1987 static PyObject
*Qd_PicComment(_self
, _args
)
1991 PyObject
*_res
= NULL
;
1995 if (!PyArg_ParseTuple(_args
, "hhO&",
1998 ResObj_Convert
, &dataHandle
))
2008 static PyObject
*Qd_ClosePicture(_self
, _args
)
2012 PyObject
*_res
= NULL
;
2013 if (!PyArg_ParseTuple(_args
, ""))
2021 static PyObject
*Qd_DrawPicture(_self
, _args
)
2025 PyObject
*_res
= NULL
;
2026 PicHandle myPicture
;
2028 if (!PyArg_ParseTuple(_args
, "O&O&",
2029 ResObj_Convert
, &myPicture
,
2030 PyMac_GetRect
, &dstRect
))
2032 DrawPicture(myPicture
,
2039 static PyObject
*Qd_KillPicture(_self
, _args
)
2043 PyObject
*_res
= NULL
;
2044 PicHandle myPicture
;
2045 if (!PyArg_ParseTuple(_args
, "O&",
2046 ResObj_Convert
, &myPicture
))
2048 KillPicture(myPicture
);
2054 static PyObject
*Qd_OpenPoly(_self
, _args
)
2058 PyObject
*_res
= NULL
;
2060 if (!PyArg_ParseTuple(_args
, ""))
2063 _res
= Py_BuildValue("O&",
2068 static PyObject
*Qd_ClosePoly(_self
, _args
)
2072 PyObject
*_res
= NULL
;
2073 if (!PyArg_ParseTuple(_args
, ""))
2081 static PyObject
*Qd_KillPoly(_self
, _args
)
2085 PyObject
*_res
= NULL
;
2087 if (!PyArg_ParseTuple(_args
, "O&",
2088 ResObj_Convert
, &poly
))
2096 static PyObject
*Qd_OffsetPoly(_self
, _args
)
2100 PyObject
*_res
= NULL
;
2104 if (!PyArg_ParseTuple(_args
, "O&hh",
2105 ResObj_Convert
, &poly
,
2117 static PyObject
*Qd_FramePoly(_self
, _args
)
2121 PyObject
*_res
= NULL
;
2123 if (!PyArg_ParseTuple(_args
, "O&",
2124 ResObj_Convert
, &poly
))
2132 static PyObject
*Qd_PaintPoly(_self
, _args
)
2136 PyObject
*_res
= NULL
;
2138 if (!PyArg_ParseTuple(_args
, "O&",
2139 ResObj_Convert
, &poly
))
2147 static PyObject
*Qd_ErasePoly(_self
, _args
)
2151 PyObject
*_res
= NULL
;
2153 if (!PyArg_ParseTuple(_args
, "O&",
2154 ResObj_Convert
, &poly
))
2162 static PyObject
*Qd_InvertPoly(_self
, _args
)
2166 PyObject
*_res
= NULL
;
2168 if (!PyArg_ParseTuple(_args
, "O&",
2169 ResObj_Convert
, &poly
))
2177 static PyObject
*Qd_FillPoly(_self
, _args
)
2181 PyObject
*_res
= NULL
;
2185 if (!PyArg_ParseTuple(_args
, "O&s#",
2186 ResObj_Convert
, &poly
,
2187 (char **)&pat__in__
, &pat__in_len__
))
2189 if (pat__in_len__
!= sizeof(Pattern
))
2191 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2202 static PyObject
*Qd_SetPt(_self
, _args
)
2206 PyObject
*_res
= NULL
;
2210 if (!PyArg_ParseTuple(_args
, "hh",
2217 _res
= Py_BuildValue("O&",
2218 PyMac_BuildPoint
, pt
);
2222 static PyObject
*Qd_LocalToGlobal(_self
, _args
)
2226 PyObject
*_res
= NULL
;
2228 if (!PyArg_ParseTuple(_args
, "O&",
2229 PyMac_GetPoint
, &pt
))
2232 _res
= Py_BuildValue("O&",
2233 PyMac_BuildPoint
, pt
);
2237 static PyObject
*Qd_GlobalToLocal(_self
, _args
)
2241 PyObject
*_res
= NULL
;
2243 if (!PyArg_ParseTuple(_args
, "O&",
2244 PyMac_GetPoint
, &pt
))
2247 _res
= Py_BuildValue("O&",
2248 PyMac_BuildPoint
, pt
);
2252 static PyObject
*Qd_Random(_self
, _args
)
2256 PyObject
*_res
= NULL
;
2258 if (!PyArg_ParseTuple(_args
, ""))
2261 _res
= Py_BuildValue("h",
2266 static PyObject
*Qd_MacGetPixel(_self
, _args
)
2270 PyObject
*_res
= NULL
;
2274 if (!PyArg_ParseTuple(_args
, "hh",
2278 _rv
= MacGetPixel(h
,
2280 _res
= Py_BuildValue("b",
2285 static PyObject
*Qd_ScalePt(_self
, _args
)
2289 PyObject
*_res
= NULL
;
2293 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2294 PyMac_GetPoint
, &pt
,
2295 PyMac_GetRect
, &srcRect
,
2296 PyMac_GetRect
, &dstRect
))
2301 _res
= Py_BuildValue("O&",
2302 PyMac_BuildPoint
, pt
);
2306 static PyObject
*Qd_MapPt(_self
, _args
)
2310 PyObject
*_res
= NULL
;
2314 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2315 PyMac_GetPoint
, &pt
,
2316 PyMac_GetRect
, &srcRect
,
2317 PyMac_GetRect
, &dstRect
))
2322 _res
= Py_BuildValue("O&",
2323 PyMac_BuildPoint
, pt
);
2327 static PyObject
*Qd_MapRect(_self
, _args
)
2331 PyObject
*_res
= NULL
;
2335 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2337 PyMac_GetRect
, &srcRect
,
2338 PyMac_GetRect
, &dstRect
))
2343 _res
= Py_BuildValue("O&",
2344 PyMac_BuildRect
, &r
);
2348 static PyObject
*Qd_MapRgn(_self
, _args
)
2352 PyObject
*_res
= NULL
;
2356 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2357 ResObj_Convert
, &rgn
,
2358 PyMac_GetRect
, &srcRect
,
2359 PyMac_GetRect
, &dstRect
))
2369 static PyObject
*Qd_MapPoly(_self
, _args
)
2373 PyObject
*_res
= NULL
;
2377 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2378 ResObj_Convert
, &poly
,
2379 PyMac_GetRect
, &srcRect
,
2380 PyMac_GetRect
, &dstRect
))
2390 static PyObject
*Qd_StdBits(_self
, _args
)
2394 PyObject
*_res
= NULL
;
2400 if (!PyArg_ParseTuple(_args
, "O&O&O&hO&",
2401 BMObj_Convert
, &srcBits
,
2402 PyMac_GetRect
, &srcRect
,
2403 PyMac_GetRect
, &dstRect
,
2405 OptResObj_Convert
, &maskRgn
))
2417 static PyObject
*Qd_AddPt(_self
, _args
)
2421 PyObject
*_res
= NULL
;
2424 if (!PyArg_ParseTuple(_args
, "O&O&",
2425 PyMac_GetPoint
, &src
,
2426 PyMac_GetPoint
, &dst
))
2430 _res
= Py_BuildValue("O&",
2431 PyMac_BuildPoint
, dst
);
2435 static PyObject
*Qd_EqualPt(_self
, _args
)
2439 PyObject
*_res
= NULL
;
2443 if (!PyArg_ParseTuple(_args
, "O&O&",
2444 PyMac_GetPoint
, &pt1
,
2445 PyMac_GetPoint
, &pt2
))
2449 _res
= Py_BuildValue("b",
2454 static PyObject
*Qd_MacPtInRect(_self
, _args
)
2458 PyObject
*_res
= NULL
;
2462 if (!PyArg_ParseTuple(_args
, "O&O&",
2463 PyMac_GetPoint
, &pt
,
2466 _rv
= MacPtInRect(pt
,
2468 _res
= Py_BuildValue("b",
2473 static PyObject
*Qd_Pt2Rect(_self
, _args
)
2477 PyObject
*_res
= NULL
;
2481 if (!PyArg_ParseTuple(_args
, "O&O&",
2482 PyMac_GetPoint
, &pt1
,
2483 PyMac_GetPoint
, &pt2
))
2488 _res
= Py_BuildValue("O&",
2489 PyMac_BuildRect
, &dstRect
);
2493 static PyObject
*Qd_PtToAngle(_self
, _args
)
2497 PyObject
*_res
= NULL
;
2501 if (!PyArg_ParseTuple(_args
, "O&O&",
2503 PyMac_GetPoint
, &pt
))
2508 _res
= Py_BuildValue("h",
2513 static PyObject
*Qd_SubPt(_self
, _args
)
2517 PyObject
*_res
= NULL
;
2520 if (!PyArg_ParseTuple(_args
, "O&O&",
2521 PyMac_GetPoint
, &src
,
2522 PyMac_GetPoint
, &dst
))
2526 _res
= Py_BuildValue("O&",
2527 PyMac_BuildPoint
, dst
);
2531 static PyObject
*Qd_PtInRgn(_self
, _args
)
2535 PyObject
*_res
= NULL
;
2539 if (!PyArg_ParseTuple(_args
, "O&O&",
2540 PyMac_GetPoint
, &pt
,
2541 ResObj_Convert
, &rgn
))
2545 _res
= Py_BuildValue("b",
2550 static PyObject
*Qd_NewPixMap(_self
, _args
)
2554 PyObject
*_res
= NULL
;
2556 if (!PyArg_ParseTuple(_args
, ""))
2559 _res
= Py_BuildValue("O&",
2564 static PyObject
*Qd_DisposePixMap(_self
, _args
)
2568 PyObject
*_res
= NULL
;
2570 if (!PyArg_ParseTuple(_args
, "O&",
2571 ResObj_Convert
, &pm
))
2579 static PyObject
*Qd_CopyPixMap(_self
, _args
)
2583 PyObject
*_res
= NULL
;
2586 if (!PyArg_ParseTuple(_args
, "O&O&",
2587 ResObj_Convert
, &srcPM
,
2588 ResObj_Convert
, &dstPM
))
2597 static PyObject
*Qd_NewPixPat(_self
, _args
)
2601 PyObject
*_res
= NULL
;
2603 if (!PyArg_ParseTuple(_args
, ""))
2606 _res
= Py_BuildValue("O&",
2611 static PyObject
*Qd_DisposePixPat(_self
, _args
)
2615 PyObject
*_res
= NULL
;
2617 if (!PyArg_ParseTuple(_args
, "O&",
2618 ResObj_Convert
, &pp
))
2626 static PyObject
*Qd_CopyPixPat(_self
, _args
)
2630 PyObject
*_res
= NULL
;
2633 if (!PyArg_ParseTuple(_args
, "O&O&",
2634 ResObj_Convert
, &srcPP
,
2635 ResObj_Convert
, &dstPP
))
2644 static PyObject
*Qd_PenPixPat(_self
, _args
)
2648 PyObject
*_res
= NULL
;
2650 if (!PyArg_ParseTuple(_args
, "O&",
2651 ResObj_Convert
, &pp
))
2659 static PyObject
*Qd_BackPixPat(_self
, _args
)
2663 PyObject
*_res
= NULL
;
2665 if (!PyArg_ParseTuple(_args
, "O&",
2666 ResObj_Convert
, &pp
))
2674 static PyObject
*Qd_GetPixPat(_self
, _args
)
2678 PyObject
*_res
= NULL
;
2681 if (!PyArg_ParseTuple(_args
, "h",
2684 _rv
= GetPixPat(patID
);
2685 _res
= Py_BuildValue("O&",
2690 static PyObject
*Qd_MakeRGBPat(_self
, _args
)
2694 PyObject
*_res
= NULL
;
2697 if (!PyArg_ParseTuple(_args
, "O&O&",
2698 ResObj_Convert
, &pp
,
2699 QdRGB_Convert
, &myColor
))
2708 static PyObject
*Qd_FillCRect(_self
, _args
)
2712 PyObject
*_res
= NULL
;
2715 if (!PyArg_ParseTuple(_args
, "O&O&",
2717 ResObj_Convert
, &pp
))
2726 static PyObject
*Qd_FillCOval(_self
, _args
)
2730 PyObject
*_res
= NULL
;
2733 if (!PyArg_ParseTuple(_args
, "O&O&",
2735 ResObj_Convert
, &pp
))
2744 static PyObject
*Qd_FillCRoundRect(_self
, _args
)
2748 PyObject
*_res
= NULL
;
2753 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2757 ResObj_Convert
, &pp
))
2768 static PyObject
*Qd_FillCArc(_self
, _args
)
2772 PyObject
*_res
= NULL
;
2777 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2781 ResObj_Convert
, &pp
))
2792 static PyObject
*Qd_FillCRgn(_self
, _args
)
2796 PyObject
*_res
= NULL
;
2799 if (!PyArg_ParseTuple(_args
, "O&O&",
2800 ResObj_Convert
, &rgn
,
2801 ResObj_Convert
, &pp
))
2810 static PyObject
*Qd_FillCPoly(_self
, _args
)
2814 PyObject
*_res
= NULL
;
2817 if (!PyArg_ParseTuple(_args
, "O&O&",
2818 ResObj_Convert
, &poly
,
2819 ResObj_Convert
, &pp
))
2828 static PyObject
*Qd_RGBForeColor(_self
, _args
)
2832 PyObject
*_res
= NULL
;
2834 if (!PyArg_ParseTuple(_args
, "O&",
2835 QdRGB_Convert
, &color
))
2837 RGBForeColor(&color
);
2843 static PyObject
*Qd_RGBBackColor(_self
, _args
)
2847 PyObject
*_res
= NULL
;
2849 if (!PyArg_ParseTuple(_args
, "O&",
2850 QdRGB_Convert
, &color
))
2852 RGBBackColor(&color
);
2858 static PyObject
*Qd_SetCPixel(_self
, _args
)
2862 PyObject
*_res
= NULL
;
2866 if (!PyArg_ParseTuple(_args
, "hhO&",
2869 QdRGB_Convert
, &cPix
))
2879 static PyObject
*Qd_SetPortPix(_self
, _args
)
2883 PyObject
*_res
= NULL
;
2885 if (!PyArg_ParseTuple(_args
, "O&",
2886 ResObj_Convert
, &pm
))
2894 static PyObject
*Qd_GetCPixel(_self
, _args
)
2898 PyObject
*_res
= NULL
;
2902 if (!PyArg_ParseTuple(_args
, "hh",
2909 _res
= Py_BuildValue("O&",
2914 static PyObject
*Qd_GetForeColor(_self
, _args
)
2918 PyObject
*_res
= NULL
;
2920 if (!PyArg_ParseTuple(_args
, ""))
2922 GetForeColor(&color
);
2923 _res
= Py_BuildValue("O&",
2928 static PyObject
*Qd_GetBackColor(_self
, _args
)
2932 PyObject
*_res
= NULL
;
2934 if (!PyArg_ParseTuple(_args
, ""))
2936 GetBackColor(&color
);
2937 _res
= Py_BuildValue("O&",
2942 static PyObject
*Qd_OpColor(_self
, _args
)
2946 PyObject
*_res
= NULL
;
2948 if (!PyArg_ParseTuple(_args
, "O&",
2949 QdRGB_Convert
, &color
))
2957 static PyObject
*Qd_HiliteColor(_self
, _args
)
2961 PyObject
*_res
= NULL
;
2963 if (!PyArg_ParseTuple(_args
, "O&",
2964 QdRGB_Convert
, &color
))
2966 HiliteColor(&color
);
2972 static PyObject
*Qd_DisposeCTable(_self
, _args
)
2976 PyObject
*_res
= NULL
;
2978 if (!PyArg_ParseTuple(_args
, "O&",
2979 ResObj_Convert
, &cTable
))
2981 DisposeCTable(cTable
);
2987 static PyObject
*Qd_GetCTable(_self
, _args
)
2991 PyObject
*_res
= NULL
;
2994 if (!PyArg_ParseTuple(_args
, "h",
2997 _rv
= GetCTable(ctID
);
2998 _res
= Py_BuildValue("O&",
3003 static PyObject
*Qd_GetCCursor(_self
, _args
)
3007 PyObject
*_res
= NULL
;
3010 if (!PyArg_ParseTuple(_args
, "h",
3013 _rv
= GetCCursor(crsrID
);
3014 _res
= Py_BuildValue("O&",
3019 static PyObject
*Qd_SetCCursor(_self
, _args
)
3023 PyObject
*_res
= NULL
;
3025 if (!PyArg_ParseTuple(_args
, "O&",
3026 ResObj_Convert
, &cCrsr
))
3034 static PyObject
*Qd_AllocCursor(_self
, _args
)
3038 PyObject
*_res
= NULL
;
3039 if (!PyArg_ParseTuple(_args
, ""))
3047 static PyObject
*Qd_DisposeCCursor(_self
, _args
)
3051 PyObject
*_res
= NULL
;
3053 if (!PyArg_ParseTuple(_args
, "O&",
3054 ResObj_Convert
, &cCrsr
))
3056 DisposeCCursor(cCrsr
);
3062 static PyObject
*Qd_GetMaxDevice(_self
, _args
)
3066 PyObject
*_res
= NULL
;
3069 if (!PyArg_ParseTuple(_args
, "O&",
3070 PyMac_GetRect
, &globalRect
))
3072 _rv
= GetMaxDevice(&globalRect
);
3073 _res
= Py_BuildValue("O&",
3078 static PyObject
*Qd_GetCTSeed(_self
, _args
)
3082 PyObject
*_res
= NULL
;
3084 if (!PyArg_ParseTuple(_args
, ""))
3087 _res
= Py_BuildValue("l",
3092 static PyObject
*Qd_GetDeviceList(_self
, _args
)
3096 PyObject
*_res
= NULL
;
3098 if (!PyArg_ParseTuple(_args
, ""))
3100 _rv
= GetDeviceList();
3101 _res
= Py_BuildValue("O&",
3106 static PyObject
*Qd_GetMainDevice(_self
, _args
)
3110 PyObject
*_res
= NULL
;
3112 if (!PyArg_ParseTuple(_args
, ""))
3114 _rv
= GetMainDevice();
3115 _res
= Py_BuildValue("O&",
3120 static PyObject
*Qd_GetNextDevice(_self
, _args
)
3124 PyObject
*_res
= NULL
;
3127 if (!PyArg_ParseTuple(_args
, "O&",
3128 ResObj_Convert
, &curDevice
))
3130 _rv
= GetNextDevice(curDevice
);
3131 _res
= Py_BuildValue("O&",
3136 static PyObject
*Qd_TestDeviceAttribute(_self
, _args
)
3140 PyObject
*_res
= NULL
;
3144 if (!PyArg_ParseTuple(_args
, "O&h",
3145 ResObj_Convert
, &gdh
,
3148 _rv
= TestDeviceAttribute(gdh
,
3150 _res
= Py_BuildValue("b",
3155 static PyObject
*Qd_SetDeviceAttribute(_self
, _args
)
3159 PyObject
*_res
= NULL
;
3163 if (!PyArg_ParseTuple(_args
, "O&hb",
3164 ResObj_Convert
, &gdh
,
3168 SetDeviceAttribute(gdh
,
3176 static PyObject
*Qd_InitGDevice(_self
, _args
)
3180 PyObject
*_res
= NULL
;
3184 if (!PyArg_ParseTuple(_args
, "hlO&",
3187 ResObj_Convert
, &gdh
))
3189 InitGDevice(qdRefNum
,
3197 static PyObject
*Qd_NewGDevice(_self
, _args
)
3201 PyObject
*_res
= NULL
;
3205 if (!PyArg_ParseTuple(_args
, "hl",
3209 _rv
= NewGDevice(refNum
,
3211 _res
= Py_BuildValue("O&",
3216 static PyObject
*Qd_DisposeGDevice(_self
, _args
)
3220 PyObject
*_res
= NULL
;
3222 if (!PyArg_ParseTuple(_args
, "O&",
3223 ResObj_Convert
, &gdh
))
3225 DisposeGDevice(gdh
);
3231 static PyObject
*Qd_SetGDevice(_self
, _args
)
3235 PyObject
*_res
= NULL
;
3237 if (!PyArg_ParseTuple(_args
, "O&",
3238 ResObj_Convert
, &gd
))
3246 static PyObject
*Qd_GetGDevice(_self
, _args
)
3250 PyObject
*_res
= NULL
;
3252 if (!PyArg_ParseTuple(_args
, ""))
3255 _res
= Py_BuildValue("O&",
3260 static PyObject
*Qd_Color2Index(_self
, _args
)
3264 PyObject
*_res
= NULL
;
3267 if (!PyArg_ParseTuple(_args
, "O&",
3268 QdRGB_Convert
, &myColor
))
3270 _rv
= Color2Index(&myColor
);
3271 _res
= Py_BuildValue("l",
3276 static PyObject
*Qd_Index2Color(_self
, _args
)
3280 PyObject
*_res
= NULL
;
3283 if (!PyArg_ParseTuple(_args
, "l",
3288 _res
= Py_BuildValue("O&",
3289 QdRGB_New
, &aColor
);
3293 static PyObject
*Qd_InvertColor(_self
, _args
)
3297 PyObject
*_res
= NULL
;
3299 if (!PyArg_ParseTuple(_args
, ""))
3301 InvertColor(&myColor
);
3302 _res
= Py_BuildValue("O&",
3303 QdRGB_New
, &myColor
);
3307 static PyObject
*Qd_RealColor(_self
, _args
)
3311 PyObject
*_res
= NULL
;
3314 if (!PyArg_ParseTuple(_args
, "O&",
3315 QdRGB_Convert
, &color
))
3317 _rv
= RealColor(&color
);
3318 _res
= Py_BuildValue("b",
3323 static PyObject
*Qd_GetSubTable(_self
, _args
)
3327 PyObject
*_res
= NULL
;
3328 CTabHandle myColors
;
3330 CTabHandle targetTbl
;
3331 if (!PyArg_ParseTuple(_args
, "O&hO&",
3332 ResObj_Convert
, &myColors
,
3334 ResObj_Convert
, &targetTbl
))
3336 GetSubTable(myColors
,
3344 static PyObject
*Qd_MakeITable(_self
, _args
)
3348 PyObject
*_res
= NULL
;
3352 if (!PyArg_ParseTuple(_args
, "O&O&h",
3353 ResObj_Convert
, &cTabH
,
3354 ResObj_Convert
, &iTabH
,
3365 static PyObject
*Qd_SetClientID(_self
, _args
)
3369 PyObject
*_res
= NULL
;
3371 if (!PyArg_ParseTuple(_args
, "h",
3380 static PyObject
*Qd_ProtectEntry(_self
, _args
)
3384 PyObject
*_res
= NULL
;
3387 if (!PyArg_ParseTuple(_args
, "hb",
3398 static PyObject
*Qd_ReserveEntry(_self
, _args
)
3402 PyObject
*_res
= NULL
;
3405 if (!PyArg_ParseTuple(_args
, "hb",
3416 static PyObject
*Qd_QDError(_self
, _args
)
3420 PyObject
*_res
= NULL
;
3422 if (!PyArg_ParseTuple(_args
, ""))
3425 _res
= Py_BuildValue("h",
3430 static PyObject
*Qd_CopyDeepMask(_self
, _args
)
3434 PyObject
*_res
= NULL
;
3443 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&hO&",
3444 BMObj_Convert
, &srcBits
,
3445 BMObj_Convert
, &maskBits
,
3446 BMObj_Convert
, &dstBits
,
3447 PyMac_GetRect
, &srcRect
,
3448 PyMac_GetRect
, &maskRect
,
3449 PyMac_GetRect
, &dstRect
,
3451 OptResObj_Convert
, &maskRgn
))
3453 CopyDeepMask(srcBits
,
3466 static PyObject
*Qd_GetPattern(_self
, _args
)
3470 PyObject
*_res
= NULL
;
3473 if (!PyArg_ParseTuple(_args
, "h",
3476 _rv
= GetPattern(patternID
);
3477 _res
= Py_BuildValue("O&",
3482 static PyObject
*Qd_MacGetCursor(_self
, _args
)
3486 PyObject
*_res
= NULL
;
3489 if (!PyArg_ParseTuple(_args
, "h",
3492 _rv
= MacGetCursor(cursorID
);
3493 _res
= Py_BuildValue("O&",
3498 static PyObject
*Qd_GetPicture(_self
, _args
)
3502 PyObject
*_res
= NULL
;
3505 if (!PyArg_ParseTuple(_args
, "h",
3508 _rv
= GetPicture(pictureID
);
3509 _res
= Py_BuildValue("O&",
3514 static PyObject
*Qd_DeltaPoint(_self
, _args
)
3518 PyObject
*_res
= NULL
;
3522 if (!PyArg_ParseTuple(_args
, "O&O&",
3523 PyMac_GetPoint
, &ptA
,
3524 PyMac_GetPoint
, &ptB
))
3526 _rv
= DeltaPoint(ptA
,
3528 _res
= Py_BuildValue("l",
3533 static PyObject
*Qd_ShieldCursor(_self
, _args
)
3537 PyObject
*_res
= NULL
;
3540 if (!PyArg_ParseTuple(_args
, "O&O&",
3541 PyMac_GetRect
, &shieldRect
,
3542 PyMac_GetPoint
, &offsetPt
))
3544 ShieldCursor(&shieldRect
,
3551 static PyObject
*Qd_ScreenRes(_self
, _args
)
3555 PyObject
*_res
= NULL
;
3558 if (!PyArg_ParseTuple(_args
, ""))
3560 ScreenRes(&scrnHRes
,
3562 _res
= Py_BuildValue("hh",
3568 static PyObject
*Qd_GetIndPattern(_self
, _args
)
3572 PyObject
*_res
= NULL
;
3573 Pattern thePat__out__
;
3574 short patternListID
;
3576 if (!PyArg_ParseTuple(_args
, "hh",
3580 GetIndPattern(&thePat__out__
,
3583 _res
= Py_BuildValue("s#",
3584 (char *)&thePat__out__
, (int)sizeof(Pattern
));
3589 static PyObject
*Qd_SlopeFromAngle(_self
, _args
)
3593 PyObject
*_res
= NULL
;
3596 if (!PyArg_ParseTuple(_args
, "h",
3599 _rv
= SlopeFromAngle(angle
);
3600 _res
= Py_BuildValue("O&",
3601 PyMac_BuildFixed
, _rv
);
3605 static PyObject
*Qd_AngleFromSlope(_self
, _args
)
3609 PyObject
*_res
= NULL
;
3612 if (!PyArg_ParseTuple(_args
, "O&",
3613 PyMac_GetFixed
, &slope
))
3615 _rv
= AngleFromSlope(slope
);
3616 _res
= Py_BuildValue("h",
3621 static PyObject
*Qd_TextFont(_self
, _args
)
3625 PyObject
*_res
= NULL
;
3627 if (!PyArg_ParseTuple(_args
, "h",
3636 static PyObject
*Qd_TextFace(_self
, _args
)
3640 PyObject
*_res
= NULL
;
3641 StyleParameter face
;
3642 if (!PyArg_ParseTuple(_args
, "h",
3651 static PyObject
*Qd_TextMode(_self
, _args
)
3655 PyObject
*_res
= NULL
;
3657 if (!PyArg_ParseTuple(_args
, "h",
3666 static PyObject
*Qd_TextSize(_self
, _args
)
3670 PyObject
*_res
= NULL
;
3672 if (!PyArg_ParseTuple(_args
, "h",
3681 static PyObject
*Qd_SpaceExtra(_self
, _args
)
3685 PyObject
*_res
= NULL
;
3687 if (!PyArg_ParseTuple(_args
, "O&",
3688 PyMac_GetFixed
, &extra
))
3696 static PyObject
*Qd_DrawChar(_self
, _args
)
3700 PyObject
*_res
= NULL
;
3702 if (!PyArg_ParseTuple(_args
, "h",
3711 static PyObject
*Qd_DrawString(_self
, _args
)
3715 PyObject
*_res
= NULL
;
3717 if (!PyArg_ParseTuple(_args
, "O&",
3718 PyMac_GetStr255
, s
))
3726 static PyObject
*Qd_MacDrawText(_self
, _args
)
3730 PyObject
*_res
= NULL
;
3731 char *textBuf__in__
;
3733 int textBuf__in_len__
;
3736 if (!PyArg_ParseTuple(_args
, "s#hh",
3737 &textBuf__in__
, &textBuf__in_len__
,
3741 MacDrawText(textBuf__in__
,
3750 static PyObject
*Qd_CharWidth(_self
, _args
)
3754 PyObject
*_res
= NULL
;
3757 if (!PyArg_ParseTuple(_args
, "h",
3760 _rv
= CharWidth(ch
);
3761 _res
= Py_BuildValue("h",
3766 static PyObject
*Qd_StringWidth(_self
, _args
)
3770 PyObject
*_res
= NULL
;
3773 if (!PyArg_ParseTuple(_args
, "O&",
3774 PyMac_GetStr255
, s
))
3776 _rv
= StringWidth(s
);
3777 _res
= Py_BuildValue("h",
3782 static PyObject
*Qd_TextWidth(_self
, _args
)
3786 PyObject
*_res
= NULL
;
3788 char *textBuf__in__
;
3790 int textBuf__in_len__
;
3793 if (!PyArg_ParseTuple(_args
, "s#hh",
3794 &textBuf__in__
, &textBuf__in_len__
,
3798 _rv
= TextWidth(textBuf__in__
,
3801 _res
= Py_BuildValue("h",
3807 static PyObject
*Qd_GetFontInfo(_self
, _args
)
3811 PyObject
*_res
= NULL
;
3813 if (!PyArg_ParseTuple(_args
, ""))
3816 _res
= Py_BuildValue("O&",
3821 static PyObject
*Qd_CharExtra(_self
, _args
)
3825 PyObject
*_res
= NULL
;
3827 if (!PyArg_ParseTuple(_args
, "O&",
3828 PyMac_GetFixed
, &extra
))
3836 static PyObject
*Qd_SetPort(_self
, _args
)
3840 PyObject
*_res
= NULL
;
3842 if (!PyArg_ParseTuple(_args
, "O&",
3843 GrafObj_Convert
, &thePort
))
3851 static PyObject
*Qd_GetCursor(_self
, _args
)
3855 PyObject
*_res
= NULL
;
3858 if (!PyArg_ParseTuple(_args
, "h",
3861 _rv
= GetCursor(cursorID
);
3862 _res
= Py_BuildValue("O&",
3867 static PyObject
*Qd_SetCursor(_self
, _args
)
3871 PyObject
*_res
= NULL
;
3874 if (!PyArg_ParseTuple(_args
, "s#",
3875 (char **)&crsr__in__
, &crsr__in_len__
))
3877 if (crsr__in_len__
!= sizeof(Cursor
))
3879 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
3882 SetCursor(crsr__in__
);
3889 static PyObject
*Qd_ShowCursor(_self
, _args
)
3893 PyObject
*_res
= NULL
;
3894 if (!PyArg_ParseTuple(_args
, ""))
3902 static PyObject
*Qd_LineTo(_self
, _args
)
3906 PyObject
*_res
= NULL
;
3909 if (!PyArg_ParseTuple(_args
, "hh",
3920 static PyObject
*Qd_SetRect(_self
, _args
)
3924 PyObject
*_res
= NULL
;
3930 if (!PyArg_ParseTuple(_args
, "hhhh",
3941 _res
= Py_BuildValue("O&",
3942 PyMac_BuildRect
, &r
);
3946 static PyObject
*Qd_OffsetRect(_self
, _args
)
3950 PyObject
*_res
= NULL
;
3954 if (!PyArg_ParseTuple(_args
, "O&hh",
3962 _res
= Py_BuildValue("O&",
3963 PyMac_BuildRect
, &r
);
3967 static PyObject
*Qd_InsetRect(_self
, _args
)
3971 PyObject
*_res
= NULL
;
3975 if (!PyArg_ParseTuple(_args
, "O&hh",
3983 _res
= Py_BuildValue("O&",
3984 PyMac_BuildRect
, &r
);
3988 static PyObject
*Qd_UnionRect(_self
, _args
)
3992 PyObject
*_res
= NULL
;
3996 if (!PyArg_ParseTuple(_args
, "O&O&",
3997 PyMac_GetRect
, &src1
,
3998 PyMac_GetRect
, &src2
))
4003 _res
= Py_BuildValue("O&",
4004 PyMac_BuildRect
, &dstRect
);
4008 static PyObject
*Qd_EqualRect(_self
, _args
)
4012 PyObject
*_res
= NULL
;
4016 if (!PyArg_ParseTuple(_args
, "O&O&",
4017 PyMac_GetRect
, &rect1
,
4018 PyMac_GetRect
, &rect2
))
4020 _rv
= EqualRect(&rect1
,
4022 _res
= Py_BuildValue("b",
4027 static PyObject
*Qd_FrameRect(_self
, _args
)
4031 PyObject
*_res
= NULL
;
4033 if (!PyArg_ParseTuple(_args
, "O&",
4042 static PyObject
*Qd_InvertRect(_self
, _args
)
4046 PyObject
*_res
= NULL
;
4048 if (!PyArg_ParseTuple(_args
, "O&",
4057 static PyObject
*Qd_FillRect(_self
, _args
)
4061 PyObject
*_res
= NULL
;
4065 if (!PyArg_ParseTuple(_args
, "O&s#",
4067 (char **)&pat__in__
, &pat__in_len__
))
4069 if (pat__in_len__
!= sizeof(Pattern
))
4071 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
4082 static PyObject
*Qd_CopyRgn(_self
, _args
)
4086 PyObject
*_res
= NULL
;
4089 if (!PyArg_ParseTuple(_args
, "O&O&",
4090 ResObj_Convert
, &srcRgn
,
4091 ResObj_Convert
, &dstRgn
))
4100 static PyObject
*Qd_SetRectRgn(_self
, _args
)
4104 PyObject
*_res
= NULL
;
4110 if (!PyArg_ParseTuple(_args
, "O&hhhh",
4111 ResObj_Convert
, &rgn
,
4127 static PyObject
*Qd_OffsetRgn(_self
, _args
)
4131 PyObject
*_res
= NULL
;
4135 if (!PyArg_ParseTuple(_args
, "O&hh",
4136 ResObj_Convert
, &rgn
,
4148 static PyObject
*Qd_UnionRgn(_self
, _args
)
4152 PyObject
*_res
= NULL
;
4156 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4157 ResObj_Convert
, &srcRgnA
,
4158 ResObj_Convert
, &srcRgnB
,
4159 ResObj_Convert
, &dstRgn
))
4169 static PyObject
*Qd_XorRgn(_self
, _args
)
4173 PyObject
*_res
= NULL
;
4177 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4178 ResObj_Convert
, &srcRgnA
,
4179 ResObj_Convert
, &srcRgnB
,
4180 ResObj_Convert
, &dstRgn
))
4190 static PyObject
*Qd_EqualRgn(_self
, _args
)
4194 PyObject
*_res
= NULL
;
4198 if (!PyArg_ParseTuple(_args
, "O&O&",
4199 ResObj_Convert
, &rgnA
,
4200 ResObj_Convert
, &rgnB
))
4202 _rv
= EqualRgn(rgnA
,
4204 _res
= Py_BuildValue("b",
4209 static PyObject
*Qd_FrameRgn(_self
, _args
)
4213 PyObject
*_res
= NULL
;
4215 if (!PyArg_ParseTuple(_args
, "O&",
4216 ResObj_Convert
, &rgn
))
4224 static PyObject
*Qd_PaintRgn(_self
, _args
)
4228 PyObject
*_res
= NULL
;
4230 if (!PyArg_ParseTuple(_args
, "O&",
4231 ResObj_Convert
, &rgn
))
4239 static PyObject
*Qd_InvertRgn(_self
, _args
)
4243 PyObject
*_res
= NULL
;
4245 if (!PyArg_ParseTuple(_args
, "O&",
4246 ResObj_Convert
, &rgn
))
4254 static PyObject
*Qd_FillRgn(_self
, _args
)
4258 PyObject
*_res
= NULL
;
4262 if (!PyArg_ParseTuple(_args
, "O&s#",
4263 ResObj_Convert
, &rgn
,
4264 (char **)&pat__in__
, &pat__in_len__
))
4266 if (pat__in_len__
!= sizeof(Pattern
))
4268 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
4279 static PyObject
*Qd_GetPixel(_self
, _args
)
4283 PyObject
*_res
= NULL
;
4287 if (!PyArg_ParseTuple(_args
, "hh",
4293 _res
= Py_BuildValue("b",
4298 static PyObject
*Qd_PtInRect(_self
, _args
)
4302 PyObject
*_res
= NULL
;
4306 if (!PyArg_ParseTuple(_args
, "O&O&",
4307 PyMac_GetPoint
, &pt
,
4312 _res
= Py_BuildValue("b",
4317 static PyObject
*Qd_DrawText(_self
, _args
)
4321 PyObject
*_res
= NULL
;
4322 char *textBuf__in__
;
4324 int textBuf__in_len__
;
4327 if (!PyArg_ParseTuple(_args
, "s#hh",
4328 &textBuf__in__
, &textBuf__in_len__
,
4332 DrawText(textBuf__in__
,
4341 static PyObject
*Qd_BitMap(_self
, _args
)
4345 PyObject
*_res
= NULL
;
4353 if ( !PyArg_ParseTuple(_args
, "O!iO&", &PyString_Type
, &source
, &rowbytes
, PyMac_GetRect
,
4356 data
= PyString_AsString(source
);
4357 if ((ptr
=(BitMap
*)malloc(sizeof(BitMap
))) == NULL
)
4358 return PyErr_NoMemory();
4359 ptr
->baseAddr
= (Ptr
)data
;
4360 ptr
->rowBytes
= rowbytes
;
4361 ptr
->bounds
= bounds
;
4362 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
4366 ((BitMapObject
*)_res
)->referred_object
= source
;
4368 ((BitMapObject
*)_res
)->referred_bitmap
= ptr
;
4373 static PyObject
*Qd_RawBitMap(_self
, _args
)
4377 PyObject
*_res
= NULL
;
4382 if ( !PyArg_ParseTuple(_args
, "O!", &PyString_Type
, &source
) )
4384 if ( PyString_Size(source
) != sizeof(BitMap
) && PyString_Size(source
) != sizeof(PixMap
) ) {
4385 PyErr_BadArgument();
4388 ptr
= (BitMapPtr
)PyString_AsString(source
);
4389 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
4392 ((BitMapObject
*)_res
)->referred_object
= source
;
4398 static PyMethodDef Qd_methods
[] = {
4399 {"MacSetPort", (PyCFunction
)Qd_MacSetPort
, 1,
4400 "(GrafPtr port) -> None"},
4401 {"GetPort", (PyCFunction
)Qd_GetPort
, 1,
4402 "() -> (GrafPtr port)"},
4403 {"GrafDevice", (PyCFunction
)Qd_GrafDevice
, 1,
4404 "(short device) -> None"},
4405 {"SetPortBits", (PyCFunction
)Qd_SetPortBits
, 1,
4406 "(BitMapPtr bm) -> None"},
4407 {"PortSize", (PyCFunction
)Qd_PortSize
, 1,
4408 "(short width, short height) -> None"},
4409 {"MovePortTo", (PyCFunction
)Qd_MovePortTo
, 1,
4410 "(short leftGlobal, short topGlobal) -> None"},
4411 {"SetOrigin", (PyCFunction
)Qd_SetOrigin
, 1,
4412 "(short h, short v) -> None"},
4413 {"SetClip", (PyCFunction
)Qd_SetClip
, 1,
4414 "(RgnHandle rgn) -> None"},
4415 {"GetClip", (PyCFunction
)Qd_GetClip
, 1,
4416 "(RgnHandle rgn) -> None"},
4417 {"ClipRect", (PyCFunction
)Qd_ClipRect
, 1,
4418 "(Rect r) -> None"},
4419 {"BackPat", (PyCFunction
)Qd_BackPat
, 1,
4420 "(Pattern pat) -> None"},
4421 {"InitCursor", (PyCFunction
)Qd_InitCursor
, 1,
4423 {"MacSetCursor", (PyCFunction
)Qd_MacSetCursor
, 1,
4424 "(Cursor crsr) -> None"},
4425 {"HideCursor", (PyCFunction
)Qd_HideCursor
, 1,
4427 {"MacShowCursor", (PyCFunction
)Qd_MacShowCursor
, 1,
4429 {"ObscureCursor", (PyCFunction
)Qd_ObscureCursor
, 1,
4431 {"HidePen", (PyCFunction
)Qd_HidePen
, 1,
4433 {"ShowPen", (PyCFunction
)Qd_ShowPen
, 1,
4435 {"GetPen", (PyCFunction
)Qd_GetPen
, 1,
4436 "() -> (Point pt)"},
4437 {"GetPenState", (PyCFunction
)Qd_GetPenState
, 1,
4438 "() -> (PenState pnState)"},
4439 {"SetPenState", (PyCFunction
)Qd_SetPenState
, 1,
4440 "(PenState pnState) -> None"},
4441 {"PenSize", (PyCFunction
)Qd_PenSize
, 1,
4442 "(short width, short height) -> None"},
4443 {"PenMode", (PyCFunction
)Qd_PenMode
, 1,
4444 "(short mode) -> None"},
4445 {"PenPat", (PyCFunction
)Qd_PenPat
, 1,
4446 "(Pattern pat) -> None"},
4447 {"PenNormal", (PyCFunction
)Qd_PenNormal
, 1,
4449 {"MoveTo", (PyCFunction
)Qd_MoveTo
, 1,
4450 "(short h, short v) -> None"},
4451 {"Move", (PyCFunction
)Qd_Move
, 1,
4452 "(short dh, short dv) -> None"},
4453 {"MacLineTo", (PyCFunction
)Qd_MacLineTo
, 1,
4454 "(short h, short v) -> None"},
4455 {"Line", (PyCFunction
)Qd_Line
, 1,
4456 "(short dh, short dv) -> None"},
4457 {"ForeColor", (PyCFunction
)Qd_ForeColor
, 1,
4458 "(long color) -> None"},
4459 {"BackColor", (PyCFunction
)Qd_BackColor
, 1,
4460 "(long color) -> None"},
4461 {"ColorBit", (PyCFunction
)Qd_ColorBit
, 1,
4462 "(short whichBit) -> None"},
4463 {"MacSetRect", (PyCFunction
)Qd_MacSetRect
, 1,
4464 "(short left, short top, short right, short bottom) -> (Rect r)"},
4465 {"MacOffsetRect", (PyCFunction
)Qd_MacOffsetRect
, 1,
4466 "(Rect r, short dh, short dv) -> (Rect r)"},
4467 {"MacInsetRect", (PyCFunction
)Qd_MacInsetRect
, 1,
4468 "(Rect r, short dh, short dv) -> (Rect r)"},
4469 {"SectRect", (PyCFunction
)Qd_SectRect
, 1,
4470 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
4471 {"MacUnionRect", (PyCFunction
)Qd_MacUnionRect
, 1,
4472 "(Rect src1, Rect src2) -> (Rect dstRect)"},
4473 {"MacEqualRect", (PyCFunction
)Qd_MacEqualRect
, 1,
4474 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
4475 {"EmptyRect", (PyCFunction
)Qd_EmptyRect
, 1,
4476 "(Rect r) -> (Boolean _rv)"},
4477 {"MacFrameRect", (PyCFunction
)Qd_MacFrameRect
, 1,
4478 "(Rect r) -> None"},
4479 {"PaintRect", (PyCFunction
)Qd_PaintRect
, 1,
4480 "(Rect r) -> None"},
4481 {"EraseRect", (PyCFunction
)Qd_EraseRect
, 1,
4482 "(Rect r) -> None"},
4483 {"MacInvertRect", (PyCFunction
)Qd_MacInvertRect
, 1,
4484 "(Rect r) -> None"},
4485 {"MacFillRect", (PyCFunction
)Qd_MacFillRect
, 1,
4486 "(Rect r, Pattern pat) -> None"},
4487 {"FrameOval", (PyCFunction
)Qd_FrameOval
, 1,
4488 "(Rect r) -> None"},
4489 {"PaintOval", (PyCFunction
)Qd_PaintOval
, 1,
4490 "(Rect r) -> None"},
4491 {"EraseOval", (PyCFunction
)Qd_EraseOval
, 1,
4492 "(Rect r) -> None"},
4493 {"InvertOval", (PyCFunction
)Qd_InvertOval
, 1,
4494 "(Rect r) -> None"},
4495 {"FillOval", (PyCFunction
)Qd_FillOval
, 1,
4496 "(Rect r, Pattern pat) -> None"},
4497 {"FrameRoundRect", (PyCFunction
)Qd_FrameRoundRect
, 1,
4498 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4499 {"PaintRoundRect", (PyCFunction
)Qd_PaintRoundRect
, 1,
4500 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4501 {"EraseRoundRect", (PyCFunction
)Qd_EraseRoundRect
, 1,
4502 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4503 {"InvertRoundRect", (PyCFunction
)Qd_InvertRoundRect
, 1,
4504 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4505 {"FillRoundRect", (PyCFunction
)Qd_FillRoundRect
, 1,
4506 "(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None"},
4507 {"FrameArc", (PyCFunction
)Qd_FrameArc
, 1,
4508 "(Rect r, short startAngle, short arcAngle) -> None"},
4509 {"PaintArc", (PyCFunction
)Qd_PaintArc
, 1,
4510 "(Rect r, short startAngle, short arcAngle) -> None"},
4511 {"EraseArc", (PyCFunction
)Qd_EraseArc
, 1,
4512 "(Rect r, short startAngle, short arcAngle) -> None"},
4513 {"InvertArc", (PyCFunction
)Qd_InvertArc
, 1,
4514 "(Rect r, short startAngle, short arcAngle) -> None"},
4515 {"FillArc", (PyCFunction
)Qd_FillArc
, 1,
4516 "(Rect r, short startAngle, short arcAngle, Pattern pat) -> None"},
4517 {"NewRgn", (PyCFunction
)Qd_NewRgn
, 1,
4518 "() -> (RgnHandle _rv)"},
4519 {"OpenRgn", (PyCFunction
)Qd_OpenRgn
, 1,
4521 {"CloseRgn", (PyCFunction
)Qd_CloseRgn
, 1,
4522 "(RgnHandle dstRgn) -> None"},
4523 {"BitMapToRegion", (PyCFunction
)Qd_BitMapToRegion
, 1,
4524 "(RgnHandle region, BitMapPtr bMap) -> None"},
4525 {"DisposeRgn", (PyCFunction
)Qd_DisposeRgn
, 1,
4526 "(RgnHandle rgn) -> None"},
4527 {"MacCopyRgn", (PyCFunction
)Qd_MacCopyRgn
, 1,
4528 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
4529 {"SetEmptyRgn", (PyCFunction
)Qd_SetEmptyRgn
, 1,
4530 "(RgnHandle rgn) -> None"},
4531 {"MacSetRectRgn", (PyCFunction
)Qd_MacSetRectRgn
, 1,
4532 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
4533 {"RectRgn", (PyCFunction
)Qd_RectRgn
, 1,
4534 "(RgnHandle rgn, Rect r) -> None"},
4535 {"MacOffsetRgn", (PyCFunction
)Qd_MacOffsetRgn
, 1,
4536 "(RgnHandle rgn, short dh, short dv) -> None"},
4537 {"InsetRgn", (PyCFunction
)Qd_InsetRgn
, 1,
4538 "(RgnHandle rgn, short dh, short dv) -> None"},
4539 {"SectRgn", (PyCFunction
)Qd_SectRgn
, 1,
4540 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4541 {"MacUnionRgn", (PyCFunction
)Qd_MacUnionRgn
, 1,
4542 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4543 {"DiffRgn", (PyCFunction
)Qd_DiffRgn
, 1,
4544 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4545 {"MacXorRgn", (PyCFunction
)Qd_MacXorRgn
, 1,
4546 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4547 {"RectInRgn", (PyCFunction
)Qd_RectInRgn
, 1,
4548 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
4549 {"MacEqualRgn", (PyCFunction
)Qd_MacEqualRgn
, 1,
4550 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
4551 {"EmptyRgn", (PyCFunction
)Qd_EmptyRgn
, 1,
4552 "(RgnHandle rgn) -> (Boolean _rv)"},
4553 {"MacFrameRgn", (PyCFunction
)Qd_MacFrameRgn
, 1,
4554 "(RgnHandle rgn) -> None"},
4555 {"MacPaintRgn", (PyCFunction
)Qd_MacPaintRgn
, 1,
4556 "(RgnHandle rgn) -> None"},
4557 {"EraseRgn", (PyCFunction
)Qd_EraseRgn
, 1,
4558 "(RgnHandle rgn) -> None"},
4559 {"MacInvertRgn", (PyCFunction
)Qd_MacInvertRgn
, 1,
4560 "(RgnHandle rgn) -> None"},
4561 {"MacFillRgn", (PyCFunction
)Qd_MacFillRgn
, 1,
4562 "(RgnHandle rgn, Pattern pat) -> None"},
4563 {"ScrollRect", (PyCFunction
)Qd_ScrollRect
, 1,
4564 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
4565 {"CopyBits", (PyCFunction
)Qd_CopyBits
, 1,
4566 "(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4567 {"CopyMask", (PyCFunction
)Qd_CopyMask
, 1,
4568 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None"},
4569 {"OpenPicture", (PyCFunction
)Qd_OpenPicture
, 1,
4570 "(Rect picFrame) -> (PicHandle _rv)"},
4571 {"PicComment", (PyCFunction
)Qd_PicComment
, 1,
4572 "(short kind, short dataSize, Handle dataHandle) -> None"},
4573 {"ClosePicture", (PyCFunction
)Qd_ClosePicture
, 1,
4575 {"DrawPicture", (PyCFunction
)Qd_DrawPicture
, 1,
4576 "(PicHandle myPicture, Rect dstRect) -> None"},
4577 {"KillPicture", (PyCFunction
)Qd_KillPicture
, 1,
4578 "(PicHandle myPicture) -> None"},
4579 {"OpenPoly", (PyCFunction
)Qd_OpenPoly
, 1,
4580 "() -> (PolyHandle _rv)"},
4581 {"ClosePoly", (PyCFunction
)Qd_ClosePoly
, 1,
4583 {"KillPoly", (PyCFunction
)Qd_KillPoly
, 1,
4584 "(PolyHandle poly) -> None"},
4585 {"OffsetPoly", (PyCFunction
)Qd_OffsetPoly
, 1,
4586 "(PolyHandle poly, short dh, short dv) -> None"},
4587 {"FramePoly", (PyCFunction
)Qd_FramePoly
, 1,
4588 "(PolyHandle poly) -> None"},
4589 {"PaintPoly", (PyCFunction
)Qd_PaintPoly
, 1,
4590 "(PolyHandle poly) -> None"},
4591 {"ErasePoly", (PyCFunction
)Qd_ErasePoly
, 1,
4592 "(PolyHandle poly) -> None"},
4593 {"InvertPoly", (PyCFunction
)Qd_InvertPoly
, 1,
4594 "(PolyHandle poly) -> None"},
4595 {"FillPoly", (PyCFunction
)Qd_FillPoly
, 1,
4596 "(PolyHandle poly, Pattern pat) -> None"},
4597 {"SetPt", (PyCFunction
)Qd_SetPt
, 1,
4598 "(short h, short v) -> (Point pt)"},
4599 {"LocalToGlobal", (PyCFunction
)Qd_LocalToGlobal
, 1,
4600 "(Point pt) -> (Point pt)"},
4601 {"GlobalToLocal", (PyCFunction
)Qd_GlobalToLocal
, 1,
4602 "(Point pt) -> (Point pt)"},
4603 {"Random", (PyCFunction
)Qd_Random
, 1,
4604 "() -> (short _rv)"},
4605 {"MacGetPixel", (PyCFunction
)Qd_MacGetPixel
, 1,
4606 "(short h, short v) -> (Boolean _rv)"},
4607 {"ScalePt", (PyCFunction
)Qd_ScalePt
, 1,
4608 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
4609 {"MapPt", (PyCFunction
)Qd_MapPt
, 1,
4610 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
4611 {"MapRect", (PyCFunction
)Qd_MapRect
, 1,
4612 "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
4613 {"MapRgn", (PyCFunction
)Qd_MapRgn
, 1,
4614 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
4615 {"MapPoly", (PyCFunction
)Qd_MapPoly
, 1,
4616 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
4617 {"StdBits", (PyCFunction
)Qd_StdBits
, 1,
4618 "(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4619 {"AddPt", (PyCFunction
)Qd_AddPt
, 1,
4620 "(Point src, Point dst) -> (Point dst)"},
4621 {"EqualPt", (PyCFunction
)Qd_EqualPt
, 1,
4622 "(Point pt1, Point pt2) -> (Boolean _rv)"},
4623 {"MacPtInRect", (PyCFunction
)Qd_MacPtInRect
, 1,
4624 "(Point pt, Rect r) -> (Boolean _rv)"},
4625 {"Pt2Rect", (PyCFunction
)Qd_Pt2Rect
, 1,
4626 "(Point pt1, Point pt2) -> (Rect dstRect)"},
4627 {"PtToAngle", (PyCFunction
)Qd_PtToAngle
, 1,
4628 "(Rect r, Point pt) -> (short angle)"},
4629 {"SubPt", (PyCFunction
)Qd_SubPt
, 1,
4630 "(Point src, Point dst) -> (Point dst)"},
4631 {"PtInRgn", (PyCFunction
)Qd_PtInRgn
, 1,
4632 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
4633 {"NewPixMap", (PyCFunction
)Qd_NewPixMap
, 1,
4634 "() -> (PixMapHandle _rv)"},
4635 {"DisposePixMap", (PyCFunction
)Qd_DisposePixMap
, 1,
4636 "(PixMapHandle pm) -> None"},
4637 {"CopyPixMap", (PyCFunction
)Qd_CopyPixMap
, 1,
4638 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
4639 {"NewPixPat", (PyCFunction
)Qd_NewPixPat
, 1,
4640 "() -> (PixPatHandle _rv)"},
4641 {"DisposePixPat", (PyCFunction
)Qd_DisposePixPat
, 1,
4642 "(PixPatHandle pp) -> None"},
4643 {"CopyPixPat", (PyCFunction
)Qd_CopyPixPat
, 1,
4644 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
4645 {"PenPixPat", (PyCFunction
)Qd_PenPixPat
, 1,
4646 "(PixPatHandle pp) -> None"},
4647 {"BackPixPat", (PyCFunction
)Qd_BackPixPat
, 1,
4648 "(PixPatHandle pp) -> None"},
4649 {"GetPixPat", (PyCFunction
)Qd_GetPixPat
, 1,
4650 "(short patID) -> (PixPatHandle _rv)"},
4651 {"MakeRGBPat", (PyCFunction
)Qd_MakeRGBPat
, 1,
4652 "(PixPatHandle pp, RGBColor myColor) -> None"},
4653 {"FillCRect", (PyCFunction
)Qd_FillCRect
, 1,
4654 "(Rect r, PixPatHandle pp) -> None"},
4655 {"FillCOval", (PyCFunction
)Qd_FillCOval
, 1,
4656 "(Rect r, PixPatHandle pp) -> None"},
4657 {"FillCRoundRect", (PyCFunction
)Qd_FillCRoundRect
, 1,
4658 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
4659 {"FillCArc", (PyCFunction
)Qd_FillCArc
, 1,
4660 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
4661 {"FillCRgn", (PyCFunction
)Qd_FillCRgn
, 1,
4662 "(RgnHandle rgn, PixPatHandle pp) -> None"},
4663 {"FillCPoly", (PyCFunction
)Qd_FillCPoly
, 1,
4664 "(PolyHandle poly, PixPatHandle pp) -> None"},
4665 {"RGBForeColor", (PyCFunction
)Qd_RGBForeColor
, 1,
4666 "(RGBColor color) -> None"},
4667 {"RGBBackColor", (PyCFunction
)Qd_RGBBackColor
, 1,
4668 "(RGBColor color) -> None"},
4669 {"SetCPixel", (PyCFunction
)Qd_SetCPixel
, 1,
4670 "(short h, short v, RGBColor cPix) -> None"},
4671 {"SetPortPix", (PyCFunction
)Qd_SetPortPix
, 1,
4672 "(PixMapHandle pm) -> None"},
4673 {"GetCPixel", (PyCFunction
)Qd_GetCPixel
, 1,
4674 "(short h, short v) -> (RGBColor cPix)"},
4675 {"GetForeColor", (PyCFunction
)Qd_GetForeColor
, 1,
4676 "() -> (RGBColor color)"},
4677 {"GetBackColor", (PyCFunction
)Qd_GetBackColor
, 1,
4678 "() -> (RGBColor color)"},
4679 {"OpColor", (PyCFunction
)Qd_OpColor
, 1,
4680 "(RGBColor color) -> None"},
4681 {"HiliteColor", (PyCFunction
)Qd_HiliteColor
, 1,
4682 "(RGBColor color) -> None"},
4683 {"DisposeCTable", (PyCFunction
)Qd_DisposeCTable
, 1,
4684 "(CTabHandle cTable) -> None"},
4685 {"GetCTable", (PyCFunction
)Qd_GetCTable
, 1,
4686 "(short ctID) -> (CTabHandle _rv)"},
4687 {"GetCCursor", (PyCFunction
)Qd_GetCCursor
, 1,
4688 "(short crsrID) -> (CCrsrHandle _rv)"},
4689 {"SetCCursor", (PyCFunction
)Qd_SetCCursor
, 1,
4690 "(CCrsrHandle cCrsr) -> None"},
4691 {"AllocCursor", (PyCFunction
)Qd_AllocCursor
, 1,
4693 {"DisposeCCursor", (PyCFunction
)Qd_DisposeCCursor
, 1,
4694 "(CCrsrHandle cCrsr) -> None"},
4695 {"GetMaxDevice", (PyCFunction
)Qd_GetMaxDevice
, 1,
4696 "(Rect globalRect) -> (GDHandle _rv)"},
4697 {"GetCTSeed", (PyCFunction
)Qd_GetCTSeed
, 1,
4698 "() -> (long _rv)"},
4699 {"GetDeviceList", (PyCFunction
)Qd_GetDeviceList
, 1,
4700 "() -> (GDHandle _rv)"},
4701 {"GetMainDevice", (PyCFunction
)Qd_GetMainDevice
, 1,
4702 "() -> (GDHandle _rv)"},
4703 {"GetNextDevice", (PyCFunction
)Qd_GetNextDevice
, 1,
4704 "(GDHandle curDevice) -> (GDHandle _rv)"},
4705 {"TestDeviceAttribute", (PyCFunction
)Qd_TestDeviceAttribute
, 1,
4706 "(GDHandle gdh, short attribute) -> (Boolean _rv)"},
4707 {"SetDeviceAttribute", (PyCFunction
)Qd_SetDeviceAttribute
, 1,
4708 "(GDHandle gdh, short attribute, Boolean value) -> None"},
4709 {"InitGDevice", (PyCFunction
)Qd_InitGDevice
, 1,
4710 "(short qdRefNum, long mode, GDHandle gdh) -> None"},
4711 {"NewGDevice", (PyCFunction
)Qd_NewGDevice
, 1,
4712 "(short refNum, long mode) -> (GDHandle _rv)"},
4713 {"DisposeGDevice", (PyCFunction
)Qd_DisposeGDevice
, 1,
4714 "(GDHandle gdh) -> None"},
4715 {"SetGDevice", (PyCFunction
)Qd_SetGDevice
, 1,
4716 "(GDHandle gd) -> None"},
4717 {"GetGDevice", (PyCFunction
)Qd_GetGDevice
, 1,
4718 "() -> (GDHandle _rv)"},
4719 {"Color2Index", (PyCFunction
)Qd_Color2Index
, 1,
4720 "(RGBColor myColor) -> (long _rv)"},
4721 {"Index2Color", (PyCFunction
)Qd_Index2Color
, 1,
4722 "(long index) -> (RGBColor aColor)"},
4723 {"InvertColor", (PyCFunction
)Qd_InvertColor
, 1,
4724 "() -> (RGBColor myColor)"},
4725 {"RealColor", (PyCFunction
)Qd_RealColor
, 1,
4726 "(RGBColor color) -> (Boolean _rv)"},
4727 {"GetSubTable", (PyCFunction
)Qd_GetSubTable
, 1,
4728 "(CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None"},
4729 {"MakeITable", (PyCFunction
)Qd_MakeITable
, 1,
4730 "(CTabHandle cTabH, ITabHandle iTabH, short res) -> None"},
4731 {"SetClientID", (PyCFunction
)Qd_SetClientID
, 1,
4732 "(short id) -> None"},
4733 {"ProtectEntry", (PyCFunction
)Qd_ProtectEntry
, 1,
4734 "(short index, Boolean protect) -> None"},
4735 {"ReserveEntry", (PyCFunction
)Qd_ReserveEntry
, 1,
4736 "(short index, Boolean reserve) -> None"},
4737 {"QDError", (PyCFunction
)Qd_QDError
, 1,
4738 "() -> (short _rv)"},
4739 {"CopyDeepMask", (PyCFunction
)Qd_CopyDeepMask
, 1,
4740 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4741 {"GetPattern", (PyCFunction
)Qd_GetPattern
, 1,
4742 "(short patternID) -> (PatHandle _rv)"},
4743 {"MacGetCursor", (PyCFunction
)Qd_MacGetCursor
, 1,
4744 "(short cursorID) -> (CursHandle _rv)"},
4745 {"GetPicture", (PyCFunction
)Qd_GetPicture
, 1,
4746 "(short pictureID) -> (PicHandle _rv)"},
4747 {"DeltaPoint", (PyCFunction
)Qd_DeltaPoint
, 1,
4748 "(Point ptA, Point ptB) -> (long _rv)"},
4749 {"ShieldCursor", (PyCFunction
)Qd_ShieldCursor
, 1,
4750 "(Rect shieldRect, Point offsetPt) -> None"},
4751 {"ScreenRes", (PyCFunction
)Qd_ScreenRes
, 1,
4752 "() -> (short scrnHRes, short scrnVRes)"},
4753 {"GetIndPattern", (PyCFunction
)Qd_GetIndPattern
, 1,
4754 "(short patternListID, short index) -> (Pattern thePat)"},
4755 {"SlopeFromAngle", (PyCFunction
)Qd_SlopeFromAngle
, 1,
4756 "(short angle) -> (Fixed _rv)"},
4757 {"AngleFromSlope", (PyCFunction
)Qd_AngleFromSlope
, 1,
4758 "(Fixed slope) -> (short _rv)"},
4759 {"TextFont", (PyCFunction
)Qd_TextFont
, 1,
4760 "(short font) -> None"},
4761 {"TextFace", (PyCFunction
)Qd_TextFace
, 1,
4762 "(StyleParameter face) -> None"},
4763 {"TextMode", (PyCFunction
)Qd_TextMode
, 1,
4764 "(short mode) -> None"},
4765 {"TextSize", (PyCFunction
)Qd_TextSize
, 1,
4766 "(short size) -> None"},
4767 {"SpaceExtra", (PyCFunction
)Qd_SpaceExtra
, 1,
4768 "(Fixed extra) -> None"},
4769 {"DrawChar", (PyCFunction
)Qd_DrawChar
, 1,
4770 "(CharParameter ch) -> None"},
4771 {"DrawString", (PyCFunction
)Qd_DrawString
, 1,
4772 "(Str255 s) -> None"},
4773 {"MacDrawText", (PyCFunction
)Qd_MacDrawText
, 1,
4774 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
4775 {"CharWidth", (PyCFunction
)Qd_CharWidth
, 1,
4776 "(CharParameter ch) -> (short _rv)"},
4777 {"StringWidth", (PyCFunction
)Qd_StringWidth
, 1,
4778 "(Str255 s) -> (short _rv)"},
4779 {"TextWidth", (PyCFunction
)Qd_TextWidth
, 1,
4780 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
4781 {"GetFontInfo", (PyCFunction
)Qd_GetFontInfo
, 1,
4782 "() -> (FontInfo info)"},
4783 {"CharExtra", (PyCFunction
)Qd_CharExtra
, 1,
4784 "(Fixed extra) -> None"},
4785 {"SetPort", (PyCFunction
)Qd_SetPort
, 1,
4786 "(GrafPtr thePort) -> None"},
4787 {"GetCursor", (PyCFunction
)Qd_GetCursor
, 1,
4788 "(short cursorID) -> (CursHandle _rv)"},
4789 {"SetCursor", (PyCFunction
)Qd_SetCursor
, 1,
4790 "(Cursor crsr) -> None"},
4791 {"ShowCursor", (PyCFunction
)Qd_ShowCursor
, 1,
4793 {"LineTo", (PyCFunction
)Qd_LineTo
, 1,
4794 "(short h, short v) -> None"},
4795 {"SetRect", (PyCFunction
)Qd_SetRect
, 1,
4796 "(short left, short top, short right, short bottom) -> (Rect r)"},
4797 {"OffsetRect", (PyCFunction
)Qd_OffsetRect
, 1,
4798 "(Rect r, short dh, short dv) -> (Rect r)"},
4799 {"InsetRect", (PyCFunction
)Qd_InsetRect
, 1,
4800 "(Rect r, short dh, short dv) -> (Rect r)"},
4801 {"UnionRect", (PyCFunction
)Qd_UnionRect
, 1,
4802 "(Rect src1, Rect src2) -> (Rect dstRect)"},
4803 {"EqualRect", (PyCFunction
)Qd_EqualRect
, 1,
4804 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
4805 {"FrameRect", (PyCFunction
)Qd_FrameRect
, 1,
4806 "(Rect r) -> None"},
4807 {"InvertRect", (PyCFunction
)Qd_InvertRect
, 1,
4808 "(Rect r) -> None"},
4809 {"FillRect", (PyCFunction
)Qd_FillRect
, 1,
4810 "(Rect r, Pattern pat) -> None"},
4811 {"CopyRgn", (PyCFunction
)Qd_CopyRgn
, 1,
4812 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
4813 {"SetRectRgn", (PyCFunction
)Qd_SetRectRgn
, 1,
4814 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
4815 {"OffsetRgn", (PyCFunction
)Qd_OffsetRgn
, 1,
4816 "(RgnHandle rgn, short dh, short dv) -> None"},
4817 {"UnionRgn", (PyCFunction
)Qd_UnionRgn
, 1,
4818 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4819 {"XorRgn", (PyCFunction
)Qd_XorRgn
, 1,
4820 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4821 {"EqualRgn", (PyCFunction
)Qd_EqualRgn
, 1,
4822 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
4823 {"FrameRgn", (PyCFunction
)Qd_FrameRgn
, 1,
4824 "(RgnHandle rgn) -> None"},
4825 {"PaintRgn", (PyCFunction
)Qd_PaintRgn
, 1,
4826 "(RgnHandle rgn) -> None"},
4827 {"InvertRgn", (PyCFunction
)Qd_InvertRgn
, 1,
4828 "(RgnHandle rgn) -> None"},
4829 {"FillRgn", (PyCFunction
)Qd_FillRgn
, 1,
4830 "(RgnHandle rgn, Pattern pat) -> None"},
4831 {"GetPixel", (PyCFunction
)Qd_GetPixel
, 1,
4832 "(short h, short v) -> (Boolean _rv)"},
4833 {"PtInRect", (PyCFunction
)Qd_PtInRect
, 1,
4834 "(Point pt, Rect r) -> (Boolean _rv)"},
4835 {"DrawText", (PyCFunction
)Qd_DrawText
, 1,
4836 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
4837 {"BitMap", (PyCFunction
)Qd_BitMap
, 1,
4838 "Take (string, int, Rect) argument and create BitMap"},
4839 {"RawBitMap", (PyCFunction
)Qd_RawBitMap
, 1,
4840 "Take string BitMap and turn into BitMap object"},
4855 m
= Py_InitModule("Qd", Qd_methods
);
4856 d
= PyModule_GetDict(m
);
4857 Qd_Error
= PyMac_GetOSErrException();
4858 if (Qd_Error
== NULL
||
4859 PyDict_SetItemString(d
, "Error", Qd_Error
) != 0)
4860 Py_FatalError("can't initialize Qd.Error");
4861 GrafPort_Type
.ob_type
= &PyType_Type
;
4862 Py_INCREF(&GrafPort_Type
);
4863 if (PyDict_SetItemString(d
, "GrafPortType", (PyObject
*)&GrafPort_Type
) != 0)
4864 Py_FatalError("can't initialize GrafPortType");
4865 BitMap_Type
.ob_type
= &PyType_Type
;
4866 Py_INCREF(&BitMap_Type
);
4867 if (PyDict_SetItemString(d
, "BitMapType", (PyObject
*)&BitMap_Type
) != 0)
4868 Py_FatalError("can't initialize BitMapType");
4869 QDGlobalsAccess_Type
.ob_type
= &PyType_Type
;
4870 Py_INCREF(&QDGlobalsAccess_Type
);
4871 if (PyDict_SetItemString(d
, "QDGlobalsAccessType", (PyObject
*)&QDGlobalsAccess_Type
) != 0)
4872 Py_FatalError("can't initialize QDGlobalsAccessType");
4878 if (o
== NULL
|| PyDict_SetItemString(d
, "qd", o
) != 0)
4879 Py_FatalError("can't initialize Qd.qd");
4885 /* ========================= End module Qd ========================== */