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 #define GrafObj_compare NULL
228 #define GrafObj_repr NULL
230 #define GrafObj_hash NULL
232 PyTypeObject GrafPort_Type
= {
233 PyObject_HEAD_INIT(&PyType_Type
)
235 "GrafPort", /*tp_name*/
236 sizeof(GrafPortObject
), /*tp_basicsize*/
239 (destructor
) GrafObj_dealloc
, /*tp_dealloc*/
241 (getattrfunc
) GrafObj_getattr
, /*tp_getattr*/
242 (setattrfunc
) GrafObj_setattr
, /*tp_setattr*/
243 (cmpfunc
) GrafObj_compare
, /*tp_compare*/
244 (reprfunc
) GrafObj_repr
, /*tp_repr*/
245 (PyNumberMethods
*)0, /* tp_as_number */
246 (PySequenceMethods
*)0, /* tp_as_sequence */
247 (PyMappingMethods
*)0, /* tp_as_mapping */
248 (hashfunc
) GrafObj_hash
, /*tp_hash*/
251 /* -------------------- End object type GrafPort -------------------- */
254 /* ----------------------- Object type BitMap ----------------------- */
256 PyTypeObject BitMap_Type
;
258 #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type)
260 typedef struct BitMapObject
{
263 PyObject
*referred_object
;
264 BitMap
*referred_bitmap
;
267 PyObject
*BMObj_New(itself
)
271 if (itself
== NULL
) return PyMac_Error(resNotFound
);
272 it
= PyObject_NEW(BitMapObject
, &BitMap_Type
);
273 if (it
== NULL
) return NULL
;
274 it
->ob_itself
= itself
;
275 it
->referred_object
= NULL
;
276 it
->referred_bitmap
= NULL
;
277 return (PyObject
*)it
;
279 BMObj_Convert(v
, p_itself
)
285 PyErr_SetString(PyExc_TypeError
, "BitMap required");
288 *p_itself
= ((BitMapObject
*)v
)->ob_itself
;
292 static void BMObj_dealloc(self
)
295 Py_XDECREF(self
->referred_object
);
296 if (self
->referred_bitmap
) free(self
->referred_bitmap
);
300 static PyMethodDef BMObj_methods
[] = {
304 PyMethodChain BMObj_chain
= { BMObj_methods
, NULL
};
306 static PyObject
*BMObj_getattr(self
, name
)
310 if ( strcmp(name
, "baseAddr") == 0 )
311 return PyInt_FromLong((long)self
->ob_itself
->baseAddr
);
312 if ( strcmp(name
, "rowBytes") == 0 )
313 return PyInt_FromLong((long)self
->ob_itself
->rowBytes
);
314 if ( strcmp(name
, "bounds") == 0 )
315 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->bounds
);
316 /* XXXX Add more, as needed */
317 if ( strcmp(name
, "bitmap_data") == 0 )
318 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(BitMap
));
319 if ( strcmp(name
, "pixmap_data") == 0 )
320 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(PixMap
));
322 return Py_FindMethodInChain(&BMObj_chain
, (PyObject
*)self
, name
);
325 #define BMObj_setattr NULL
327 #define BMObj_compare NULL
329 #define BMObj_repr NULL
331 #define BMObj_hash NULL
333 PyTypeObject BitMap_Type
= {
334 PyObject_HEAD_INIT(&PyType_Type
)
336 "BitMap", /*tp_name*/
337 sizeof(BitMapObject
), /*tp_basicsize*/
340 (destructor
) BMObj_dealloc
, /*tp_dealloc*/
342 (getattrfunc
) BMObj_getattr
, /*tp_getattr*/
343 (setattrfunc
) BMObj_setattr
, /*tp_setattr*/
344 (cmpfunc
) BMObj_compare
, /*tp_compare*/
345 (reprfunc
) BMObj_repr
, /*tp_repr*/
346 (PyNumberMethods
*)0, /* tp_as_number */
347 (PySequenceMethods
*)0, /* tp_as_sequence */
348 (PyMappingMethods
*)0, /* tp_as_mapping */
349 (hashfunc
) BMObj_hash
, /*tp_hash*/
352 /* --------------------- End object type BitMap --------------------- */
355 /* ------------------ Object type QDGlobalsAccess ------------------- */
357 staticforward PyTypeObject QDGlobalsAccess_Type
;
359 #define QDGA_Check(x) ((x)->ob_type == &QDGlobalsAccess_Type)
361 typedef struct QDGlobalsAccessObject
{
363 } QDGlobalsAccessObject
;
365 static PyObject
*QDGA_New()
367 QDGlobalsAccessObject
*it
;
368 it
= PyObject_NEW(QDGlobalsAccessObject
, &QDGlobalsAccess_Type
);
369 if (it
== NULL
) return NULL
;
370 return (PyObject
*)it
;
373 static void QDGA_dealloc(self
)
374 QDGlobalsAccessObject
*self
;
379 static PyMethodDef QDGA_methods
[] = {
383 static PyMethodChain QDGA_chain
= { QDGA_methods
, NULL
};
385 static PyObject
*QDGA_getattr(self
, name
)
386 QDGlobalsAccessObject
*self
;
390 if ( strcmp(name
, "arrow") == 0 )
391 return PyString_FromStringAndSize((char *)&qd
.arrow
, sizeof(qd
.arrow
));
392 if ( strcmp(name
, "black") == 0 )
393 return PyString_FromStringAndSize((char *)&qd
.black
, sizeof(qd
.black
));
394 if ( strcmp(name
, "white") == 0 )
395 return PyString_FromStringAndSize((char *)&qd
.white
, sizeof(qd
.white
));
396 if ( strcmp(name
, "gray") == 0 )
397 return PyString_FromStringAndSize((char *)&qd
.gray
, sizeof(qd
.gray
));
398 if ( strcmp(name
, "ltGray") == 0 )
399 return PyString_FromStringAndSize((char *)&qd
.ltGray
, sizeof(qd
.ltGray
));
400 if ( strcmp(name
, "dkGray") == 0 )
401 return PyString_FromStringAndSize((char *)&qd
.dkGray
, sizeof(qd
.dkGray
));
402 if ( strcmp(name
, "screenBits") == 0 )
403 return BMObj_New(&qd
.screenBits
);
404 if ( strcmp(name
, "thePort") == 0 )
405 return GrafObj_New(qd
.thePort
);
406 if ( strcmp(name
, "randSeed") == 0 )
407 return Py_BuildValue("l", &qd
.randSeed
);
409 return Py_FindMethodInChain(&QDGA_chain
, (PyObject
*)self
, name
);
412 #define QDGA_setattr NULL
414 #define QDGA_compare NULL
416 #define QDGA_repr NULL
418 #define QDGA_hash NULL
420 staticforward PyTypeObject QDGlobalsAccess_Type
= {
421 PyObject_HEAD_INIT(&PyType_Type
)
423 "QDGlobalsAccess", /*tp_name*/
424 sizeof(QDGlobalsAccessObject
), /*tp_basicsize*/
427 (destructor
) QDGA_dealloc
, /*tp_dealloc*/
429 (getattrfunc
) QDGA_getattr
, /*tp_getattr*/
430 (setattrfunc
) QDGA_setattr
, /*tp_setattr*/
431 (cmpfunc
) QDGA_compare
, /*tp_compare*/
432 (reprfunc
) QDGA_repr
, /*tp_repr*/
433 (PyNumberMethods
*)0, /* tp_as_number */
434 (PySequenceMethods
*)0, /* tp_as_sequence */
435 (PyMappingMethods
*)0, /* tp_as_mapping */
436 (hashfunc
) QDGA_hash
, /*tp_hash*/
439 /* ---------------- End object type QDGlobalsAccess ----------------- */
442 static PyObject
*Qd_MacSetPort(_self
, _args
)
446 PyObject
*_res
= NULL
;
448 if (!PyArg_ParseTuple(_args
, "O&",
449 GrafObj_Convert
, &port
))
457 static PyObject
*Qd_GetPort(_self
, _args
)
461 PyObject
*_res
= NULL
;
463 if (!PyArg_ParseTuple(_args
, ""))
466 _res
= Py_BuildValue("O&",
471 static PyObject
*Qd_GrafDevice(_self
, _args
)
475 PyObject
*_res
= NULL
;
477 if (!PyArg_ParseTuple(_args
, "h",
486 static PyObject
*Qd_SetPortBits(_self
, _args
)
490 PyObject
*_res
= NULL
;
492 if (!PyArg_ParseTuple(_args
, "O&",
501 static PyObject
*Qd_PortSize(_self
, _args
)
505 PyObject
*_res
= NULL
;
508 if (!PyArg_ParseTuple(_args
, "hh",
519 static PyObject
*Qd_MovePortTo(_self
, _args
)
523 PyObject
*_res
= NULL
;
526 if (!PyArg_ParseTuple(_args
, "hh",
530 MovePortTo(leftGlobal
,
537 static PyObject
*Qd_SetOrigin(_self
, _args
)
541 PyObject
*_res
= NULL
;
544 if (!PyArg_ParseTuple(_args
, "hh",
555 static PyObject
*Qd_SetClip(_self
, _args
)
559 PyObject
*_res
= NULL
;
561 if (!PyArg_ParseTuple(_args
, "O&",
562 ResObj_Convert
, &rgn
))
570 static PyObject
*Qd_GetClip(_self
, _args
)
574 PyObject
*_res
= NULL
;
576 if (!PyArg_ParseTuple(_args
, "O&",
577 ResObj_Convert
, &rgn
))
585 static PyObject
*Qd_ClipRect(_self
, _args
)
589 PyObject
*_res
= NULL
;
591 if (!PyArg_ParseTuple(_args
, "O&",
600 static PyObject
*Qd_BackPat(_self
, _args
)
604 PyObject
*_res
= NULL
;
607 if (!PyArg_ParseTuple(_args
, "s#",
608 (char **)&pat__in__
, &pat__in_len__
))
610 if (pat__in_len__
!= sizeof(Pattern
))
612 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
622 static PyObject
*Qd_InitCursor(_self
, _args
)
626 PyObject
*_res
= NULL
;
627 if (!PyArg_ParseTuple(_args
, ""))
635 static PyObject
*Qd_MacSetCursor(_self
, _args
)
639 PyObject
*_res
= NULL
;
642 if (!PyArg_ParseTuple(_args
, "s#",
643 (char **)&crsr__in__
, &crsr__in_len__
))
645 if (crsr__in_len__
!= sizeof(Cursor
))
647 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
650 MacSetCursor(crsr__in__
);
657 static PyObject
*Qd_HideCursor(_self
, _args
)
661 PyObject
*_res
= NULL
;
662 if (!PyArg_ParseTuple(_args
, ""))
670 static PyObject
*Qd_MacShowCursor(_self
, _args
)
674 PyObject
*_res
= NULL
;
675 if (!PyArg_ParseTuple(_args
, ""))
683 static PyObject
*Qd_ObscureCursor(_self
, _args
)
687 PyObject
*_res
= NULL
;
688 if (!PyArg_ParseTuple(_args
, ""))
696 static PyObject
*Qd_HidePen(_self
, _args
)
700 PyObject
*_res
= NULL
;
701 if (!PyArg_ParseTuple(_args
, ""))
709 static PyObject
*Qd_ShowPen(_self
, _args
)
713 PyObject
*_res
= NULL
;
714 if (!PyArg_ParseTuple(_args
, ""))
722 static PyObject
*Qd_GetPen(_self
, _args
)
726 PyObject
*_res
= NULL
;
728 if (!PyArg_ParseTuple(_args
, ""))
731 _res
= Py_BuildValue("O&",
732 PyMac_BuildPoint
, pt
);
736 static PyObject
*Qd_GetPenState(_self
, _args
)
740 PyObject
*_res
= NULL
;
741 PenState pnState__out__
;
742 if (!PyArg_ParseTuple(_args
, ""))
744 GetPenState(&pnState__out__
);
745 _res
= Py_BuildValue("s#",
746 (char *)&pnState__out__
, (int)sizeof(PenState
));
751 static PyObject
*Qd_SetPenState(_self
, _args
)
755 PyObject
*_res
= NULL
;
756 PenState
*pnState__in__
;
757 int pnState__in_len__
;
758 if (!PyArg_ParseTuple(_args
, "s#",
759 (char **)&pnState__in__
, &pnState__in_len__
))
761 if (pnState__in_len__
!= sizeof(PenState
))
763 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(PenState)");
764 goto pnState__error__
;
766 SetPenState(pnState__in__
);
773 static PyObject
*Qd_PenSize(_self
, _args
)
777 PyObject
*_res
= NULL
;
780 if (!PyArg_ParseTuple(_args
, "hh",
791 static PyObject
*Qd_PenMode(_self
, _args
)
795 PyObject
*_res
= NULL
;
797 if (!PyArg_ParseTuple(_args
, "h",
806 static PyObject
*Qd_PenPat(_self
, _args
)
810 PyObject
*_res
= NULL
;
813 if (!PyArg_ParseTuple(_args
, "s#",
814 (char **)&pat__in__
, &pat__in_len__
))
816 if (pat__in_len__
!= sizeof(Pattern
))
818 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
828 static PyObject
*Qd_PenNormal(_self
, _args
)
832 PyObject
*_res
= NULL
;
833 if (!PyArg_ParseTuple(_args
, ""))
841 static PyObject
*Qd_MoveTo(_self
, _args
)
845 PyObject
*_res
= NULL
;
848 if (!PyArg_ParseTuple(_args
, "hh",
859 static PyObject
*Qd_Move(_self
, _args
)
863 PyObject
*_res
= NULL
;
866 if (!PyArg_ParseTuple(_args
, "hh",
877 static PyObject
*Qd_MacLineTo(_self
, _args
)
881 PyObject
*_res
= NULL
;
884 if (!PyArg_ParseTuple(_args
, "hh",
895 static PyObject
*Qd_Line(_self
, _args
)
899 PyObject
*_res
= NULL
;
902 if (!PyArg_ParseTuple(_args
, "hh",
913 static PyObject
*Qd_ForeColor(_self
, _args
)
917 PyObject
*_res
= NULL
;
919 if (!PyArg_ParseTuple(_args
, "l",
928 static PyObject
*Qd_BackColor(_self
, _args
)
932 PyObject
*_res
= NULL
;
934 if (!PyArg_ParseTuple(_args
, "l",
943 static PyObject
*Qd_ColorBit(_self
, _args
)
947 PyObject
*_res
= NULL
;
949 if (!PyArg_ParseTuple(_args
, "h",
958 static PyObject
*Qd_MacSetRect(_self
, _args
)
962 PyObject
*_res
= NULL
;
968 if (!PyArg_ParseTuple(_args
, "hhhh",
979 _res
= Py_BuildValue("O&",
980 PyMac_BuildRect
, &r
);
984 static PyObject
*Qd_MacOffsetRect(_self
, _args
)
988 PyObject
*_res
= NULL
;
992 if (!PyArg_ParseTuple(_args
, "O&hh",
1000 _res
= Py_BuildValue("O&",
1001 PyMac_BuildRect
, &r
);
1005 static PyObject
*Qd_MacInsetRect(_self
, _args
)
1009 PyObject
*_res
= NULL
;
1013 if (!PyArg_ParseTuple(_args
, "O&hh",
1021 _res
= Py_BuildValue("O&",
1022 PyMac_BuildRect
, &r
);
1026 static PyObject
*Qd_SectRect(_self
, _args
)
1030 PyObject
*_res
= NULL
;
1035 if (!PyArg_ParseTuple(_args
, "O&O&",
1036 PyMac_GetRect
, &src1
,
1037 PyMac_GetRect
, &src2
))
1039 _rv
= SectRect(&src1
,
1042 _res
= Py_BuildValue("bO&",
1044 PyMac_BuildRect
, &dstRect
);
1048 static PyObject
*Qd_MacUnionRect(_self
, _args
)
1052 PyObject
*_res
= NULL
;
1056 if (!PyArg_ParseTuple(_args
, "O&O&",
1057 PyMac_GetRect
, &src1
,
1058 PyMac_GetRect
, &src2
))
1063 _res
= Py_BuildValue("O&",
1064 PyMac_BuildRect
, &dstRect
);
1068 static PyObject
*Qd_MacEqualRect(_self
, _args
)
1072 PyObject
*_res
= NULL
;
1076 if (!PyArg_ParseTuple(_args
, "O&O&",
1077 PyMac_GetRect
, &rect1
,
1078 PyMac_GetRect
, &rect2
))
1080 _rv
= MacEqualRect(&rect1
,
1082 _res
= Py_BuildValue("b",
1087 static PyObject
*Qd_EmptyRect(_self
, _args
)
1091 PyObject
*_res
= NULL
;
1094 if (!PyArg_ParseTuple(_args
, "O&",
1097 _rv
= EmptyRect(&r
);
1098 _res
= Py_BuildValue("b",
1103 static PyObject
*Qd_MacFrameRect(_self
, _args
)
1107 PyObject
*_res
= NULL
;
1109 if (!PyArg_ParseTuple(_args
, "O&",
1118 static PyObject
*Qd_PaintRect(_self
, _args
)
1122 PyObject
*_res
= NULL
;
1124 if (!PyArg_ParseTuple(_args
, "O&",
1133 static PyObject
*Qd_EraseRect(_self
, _args
)
1137 PyObject
*_res
= NULL
;
1139 if (!PyArg_ParseTuple(_args
, "O&",
1148 static PyObject
*Qd_MacInvertRect(_self
, _args
)
1152 PyObject
*_res
= NULL
;
1154 if (!PyArg_ParseTuple(_args
, "O&",
1163 static PyObject
*Qd_MacFillRect(_self
, _args
)
1167 PyObject
*_res
= NULL
;
1171 if (!PyArg_ParseTuple(_args
, "O&s#",
1173 (char **)&pat__in__
, &pat__in_len__
))
1175 if (pat__in_len__
!= sizeof(Pattern
))
1177 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1188 static PyObject
*Qd_FrameOval(_self
, _args
)
1192 PyObject
*_res
= NULL
;
1194 if (!PyArg_ParseTuple(_args
, "O&",
1203 static PyObject
*Qd_PaintOval(_self
, _args
)
1207 PyObject
*_res
= NULL
;
1209 if (!PyArg_ParseTuple(_args
, "O&",
1218 static PyObject
*Qd_EraseOval(_self
, _args
)
1222 PyObject
*_res
= NULL
;
1224 if (!PyArg_ParseTuple(_args
, "O&",
1233 static PyObject
*Qd_InvertOval(_self
, _args
)
1237 PyObject
*_res
= NULL
;
1239 if (!PyArg_ParseTuple(_args
, "O&",
1248 static PyObject
*Qd_FillOval(_self
, _args
)
1252 PyObject
*_res
= NULL
;
1256 if (!PyArg_ParseTuple(_args
, "O&s#",
1258 (char **)&pat__in__
, &pat__in_len__
))
1260 if (pat__in_len__
!= sizeof(Pattern
))
1262 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1273 static PyObject
*Qd_FrameRoundRect(_self
, _args
)
1277 PyObject
*_res
= NULL
;
1281 if (!PyArg_ParseTuple(_args
, "O&hh",
1294 static PyObject
*Qd_PaintRoundRect(_self
, _args
)
1298 PyObject
*_res
= NULL
;
1302 if (!PyArg_ParseTuple(_args
, "O&hh",
1315 static PyObject
*Qd_EraseRoundRect(_self
, _args
)
1319 PyObject
*_res
= NULL
;
1323 if (!PyArg_ParseTuple(_args
, "O&hh",
1336 static PyObject
*Qd_InvertRoundRect(_self
, _args
)
1340 PyObject
*_res
= NULL
;
1344 if (!PyArg_ParseTuple(_args
, "O&hh",
1357 static PyObject
*Qd_FillRoundRect(_self
, _args
)
1361 PyObject
*_res
= NULL
;
1367 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1371 (char **)&pat__in__
, &pat__in_len__
))
1373 if (pat__in_len__
!= sizeof(Pattern
))
1375 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1388 static PyObject
*Qd_FrameArc(_self
, _args
)
1392 PyObject
*_res
= NULL
;
1396 if (!PyArg_ParseTuple(_args
, "O&hh",
1409 static PyObject
*Qd_PaintArc(_self
, _args
)
1413 PyObject
*_res
= NULL
;
1417 if (!PyArg_ParseTuple(_args
, "O&hh",
1430 static PyObject
*Qd_EraseArc(_self
, _args
)
1434 PyObject
*_res
= NULL
;
1438 if (!PyArg_ParseTuple(_args
, "O&hh",
1451 static PyObject
*Qd_InvertArc(_self
, _args
)
1455 PyObject
*_res
= NULL
;
1459 if (!PyArg_ParseTuple(_args
, "O&hh",
1472 static PyObject
*Qd_FillArc(_self
, _args
)
1476 PyObject
*_res
= NULL
;
1482 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1486 (char **)&pat__in__
, &pat__in_len__
))
1488 if (pat__in_len__
!= sizeof(Pattern
))
1490 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1503 static PyObject
*Qd_NewRgn(_self
, _args
)
1507 PyObject
*_res
= NULL
;
1509 if (!PyArg_ParseTuple(_args
, ""))
1512 _res
= Py_BuildValue("O&",
1517 static PyObject
*Qd_OpenRgn(_self
, _args
)
1521 PyObject
*_res
= NULL
;
1522 if (!PyArg_ParseTuple(_args
, ""))
1530 static PyObject
*Qd_CloseRgn(_self
, _args
)
1534 PyObject
*_res
= NULL
;
1536 if (!PyArg_ParseTuple(_args
, "O&",
1537 ResObj_Convert
, &dstRgn
))
1545 static PyObject
*Qd_BitMapToRegion(_self
, _args
)
1549 PyObject
*_res
= NULL
;
1553 if (!PyArg_ParseTuple(_args
, "O&O&",
1554 ResObj_Convert
, ®ion
,
1555 BMObj_Convert
, &bMap
))
1557 _err
= BitMapToRegion(region
,
1559 if (_err
!= noErr
) return PyMac_Error(_err
);
1565 static PyObject
*Qd_DisposeRgn(_self
, _args
)
1569 PyObject
*_res
= NULL
;
1571 if (!PyArg_ParseTuple(_args
, "O&",
1572 ResObj_Convert
, &rgn
))
1580 static PyObject
*Qd_MacCopyRgn(_self
, _args
)
1584 PyObject
*_res
= NULL
;
1587 if (!PyArg_ParseTuple(_args
, "O&O&",
1588 ResObj_Convert
, &srcRgn
,
1589 ResObj_Convert
, &dstRgn
))
1598 static PyObject
*Qd_SetEmptyRgn(_self
, _args
)
1602 PyObject
*_res
= NULL
;
1604 if (!PyArg_ParseTuple(_args
, "O&",
1605 ResObj_Convert
, &rgn
))
1613 static PyObject
*Qd_MacSetRectRgn(_self
, _args
)
1617 PyObject
*_res
= NULL
;
1623 if (!PyArg_ParseTuple(_args
, "O&hhhh",
1624 ResObj_Convert
, &rgn
,
1640 static PyObject
*Qd_RectRgn(_self
, _args
)
1644 PyObject
*_res
= NULL
;
1647 if (!PyArg_ParseTuple(_args
, "O&O&",
1648 ResObj_Convert
, &rgn
,
1658 static PyObject
*Qd_MacOffsetRgn(_self
, _args
)
1662 PyObject
*_res
= NULL
;
1666 if (!PyArg_ParseTuple(_args
, "O&hh",
1667 ResObj_Convert
, &rgn
,
1679 static PyObject
*Qd_InsetRgn(_self
, _args
)
1683 PyObject
*_res
= NULL
;
1687 if (!PyArg_ParseTuple(_args
, "O&hh",
1688 ResObj_Convert
, &rgn
,
1700 static PyObject
*Qd_SectRgn(_self
, _args
)
1704 PyObject
*_res
= NULL
;
1708 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1709 ResObj_Convert
, &srcRgnA
,
1710 ResObj_Convert
, &srcRgnB
,
1711 ResObj_Convert
, &dstRgn
))
1721 static PyObject
*Qd_MacUnionRgn(_self
, _args
)
1725 PyObject
*_res
= NULL
;
1729 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1730 ResObj_Convert
, &srcRgnA
,
1731 ResObj_Convert
, &srcRgnB
,
1732 ResObj_Convert
, &dstRgn
))
1734 MacUnionRgn(srcRgnA
,
1742 static PyObject
*Qd_DiffRgn(_self
, _args
)
1746 PyObject
*_res
= NULL
;
1750 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1751 ResObj_Convert
, &srcRgnA
,
1752 ResObj_Convert
, &srcRgnB
,
1753 ResObj_Convert
, &dstRgn
))
1763 static PyObject
*Qd_MacXorRgn(_self
, _args
)
1767 PyObject
*_res
= NULL
;
1771 if (!PyArg_ParseTuple(_args
, "O&O&O&",
1772 ResObj_Convert
, &srcRgnA
,
1773 ResObj_Convert
, &srcRgnB
,
1774 ResObj_Convert
, &dstRgn
))
1784 static PyObject
*Qd_RectInRgn(_self
, _args
)
1788 PyObject
*_res
= NULL
;
1792 if (!PyArg_ParseTuple(_args
, "O&O&",
1794 ResObj_Convert
, &rgn
))
1798 _res
= Py_BuildValue("b",
1803 static PyObject
*Qd_MacEqualRgn(_self
, _args
)
1807 PyObject
*_res
= NULL
;
1811 if (!PyArg_ParseTuple(_args
, "O&O&",
1812 ResObj_Convert
, &rgnA
,
1813 ResObj_Convert
, &rgnB
))
1815 _rv
= MacEqualRgn(rgnA
,
1817 _res
= Py_BuildValue("b",
1822 static PyObject
*Qd_EmptyRgn(_self
, _args
)
1826 PyObject
*_res
= NULL
;
1829 if (!PyArg_ParseTuple(_args
, "O&",
1830 ResObj_Convert
, &rgn
))
1832 _rv
= EmptyRgn(rgn
);
1833 _res
= Py_BuildValue("b",
1838 static PyObject
*Qd_MacFrameRgn(_self
, _args
)
1842 PyObject
*_res
= NULL
;
1844 if (!PyArg_ParseTuple(_args
, "O&",
1845 ResObj_Convert
, &rgn
))
1853 static PyObject
*Qd_MacPaintRgn(_self
, _args
)
1857 PyObject
*_res
= NULL
;
1859 if (!PyArg_ParseTuple(_args
, "O&",
1860 ResObj_Convert
, &rgn
))
1868 static PyObject
*Qd_EraseRgn(_self
, _args
)
1872 PyObject
*_res
= NULL
;
1874 if (!PyArg_ParseTuple(_args
, "O&",
1875 ResObj_Convert
, &rgn
))
1883 static PyObject
*Qd_MacInvertRgn(_self
, _args
)
1887 PyObject
*_res
= NULL
;
1889 if (!PyArg_ParseTuple(_args
, "O&",
1890 ResObj_Convert
, &rgn
))
1898 static PyObject
*Qd_MacFillRgn(_self
, _args
)
1902 PyObject
*_res
= NULL
;
1906 if (!PyArg_ParseTuple(_args
, "O&s#",
1907 ResObj_Convert
, &rgn
,
1908 (char **)&pat__in__
, &pat__in_len__
))
1910 if (pat__in_len__
!= sizeof(Pattern
))
1912 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1923 static PyObject
*Qd_ScrollRect(_self
, _args
)
1927 PyObject
*_res
= NULL
;
1931 RgnHandle updateRgn
;
1932 if (!PyArg_ParseTuple(_args
, "O&hhO&",
1936 ResObj_Convert
, &updateRgn
))
1947 static PyObject
*Qd_CopyBits(_self
, _args
)
1951 PyObject
*_res
= NULL
;
1958 if (!PyArg_ParseTuple(_args
, "O&O&O&O&hO&",
1959 BMObj_Convert
, &srcBits
,
1960 BMObj_Convert
, &dstBits
,
1961 PyMac_GetRect
, &srcRect
,
1962 PyMac_GetRect
, &dstRect
,
1964 OptResObj_Convert
, &maskRgn
))
1977 static PyObject
*Qd_CopyMask(_self
, _args
)
1981 PyObject
*_res
= NULL
;
1988 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&",
1989 BMObj_Convert
, &srcBits
,
1990 BMObj_Convert
, &maskBits
,
1991 BMObj_Convert
, &dstBits
,
1992 PyMac_GetRect
, &srcRect
,
1993 PyMac_GetRect
, &maskRect
,
1994 PyMac_GetRect
, &dstRect
))
2007 static PyObject
*Qd_OpenPicture(_self
, _args
)
2011 PyObject
*_res
= NULL
;
2014 if (!PyArg_ParseTuple(_args
, "O&",
2015 PyMac_GetRect
, &picFrame
))
2017 _rv
= OpenPicture(&picFrame
);
2018 _res
= Py_BuildValue("O&",
2023 static PyObject
*Qd_PicComment(_self
, _args
)
2027 PyObject
*_res
= NULL
;
2031 if (!PyArg_ParseTuple(_args
, "hhO&",
2034 ResObj_Convert
, &dataHandle
))
2044 static PyObject
*Qd_ClosePicture(_self
, _args
)
2048 PyObject
*_res
= NULL
;
2049 if (!PyArg_ParseTuple(_args
, ""))
2057 static PyObject
*Qd_DrawPicture(_self
, _args
)
2061 PyObject
*_res
= NULL
;
2062 PicHandle myPicture
;
2064 if (!PyArg_ParseTuple(_args
, "O&O&",
2065 ResObj_Convert
, &myPicture
,
2066 PyMac_GetRect
, &dstRect
))
2068 DrawPicture(myPicture
,
2075 static PyObject
*Qd_KillPicture(_self
, _args
)
2079 PyObject
*_res
= NULL
;
2080 PicHandle myPicture
;
2081 if (!PyArg_ParseTuple(_args
, "O&",
2082 ResObj_Convert
, &myPicture
))
2084 KillPicture(myPicture
);
2090 static PyObject
*Qd_OpenPoly(_self
, _args
)
2094 PyObject
*_res
= NULL
;
2096 if (!PyArg_ParseTuple(_args
, ""))
2099 _res
= Py_BuildValue("O&",
2104 static PyObject
*Qd_ClosePoly(_self
, _args
)
2108 PyObject
*_res
= NULL
;
2109 if (!PyArg_ParseTuple(_args
, ""))
2117 static PyObject
*Qd_KillPoly(_self
, _args
)
2121 PyObject
*_res
= NULL
;
2123 if (!PyArg_ParseTuple(_args
, "O&",
2124 ResObj_Convert
, &poly
))
2132 static PyObject
*Qd_OffsetPoly(_self
, _args
)
2136 PyObject
*_res
= NULL
;
2140 if (!PyArg_ParseTuple(_args
, "O&hh",
2141 ResObj_Convert
, &poly
,
2153 static PyObject
*Qd_FramePoly(_self
, _args
)
2157 PyObject
*_res
= NULL
;
2159 if (!PyArg_ParseTuple(_args
, "O&",
2160 ResObj_Convert
, &poly
))
2168 static PyObject
*Qd_PaintPoly(_self
, _args
)
2172 PyObject
*_res
= NULL
;
2174 if (!PyArg_ParseTuple(_args
, "O&",
2175 ResObj_Convert
, &poly
))
2183 static PyObject
*Qd_ErasePoly(_self
, _args
)
2187 PyObject
*_res
= NULL
;
2189 if (!PyArg_ParseTuple(_args
, "O&",
2190 ResObj_Convert
, &poly
))
2198 static PyObject
*Qd_InvertPoly(_self
, _args
)
2202 PyObject
*_res
= NULL
;
2204 if (!PyArg_ParseTuple(_args
, "O&",
2205 ResObj_Convert
, &poly
))
2213 static PyObject
*Qd_FillPoly(_self
, _args
)
2217 PyObject
*_res
= NULL
;
2221 if (!PyArg_ParseTuple(_args
, "O&s#",
2222 ResObj_Convert
, &poly
,
2223 (char **)&pat__in__
, &pat__in_len__
))
2225 if (pat__in_len__
!= sizeof(Pattern
))
2227 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2238 static PyObject
*Qd_SetPt(_self
, _args
)
2242 PyObject
*_res
= NULL
;
2246 if (!PyArg_ParseTuple(_args
, "hh",
2253 _res
= Py_BuildValue("O&",
2254 PyMac_BuildPoint
, pt
);
2258 static PyObject
*Qd_LocalToGlobal(_self
, _args
)
2262 PyObject
*_res
= NULL
;
2264 if (!PyArg_ParseTuple(_args
, "O&",
2265 PyMac_GetPoint
, &pt
))
2268 _res
= Py_BuildValue("O&",
2269 PyMac_BuildPoint
, pt
);
2273 static PyObject
*Qd_GlobalToLocal(_self
, _args
)
2277 PyObject
*_res
= NULL
;
2279 if (!PyArg_ParseTuple(_args
, "O&",
2280 PyMac_GetPoint
, &pt
))
2283 _res
= Py_BuildValue("O&",
2284 PyMac_BuildPoint
, pt
);
2288 static PyObject
*Qd_Random(_self
, _args
)
2292 PyObject
*_res
= NULL
;
2294 if (!PyArg_ParseTuple(_args
, ""))
2297 _res
= Py_BuildValue("h",
2302 static PyObject
*Qd_MacGetPixel(_self
, _args
)
2306 PyObject
*_res
= NULL
;
2310 if (!PyArg_ParseTuple(_args
, "hh",
2314 _rv
= MacGetPixel(h
,
2316 _res
= Py_BuildValue("b",
2321 static PyObject
*Qd_ScalePt(_self
, _args
)
2325 PyObject
*_res
= NULL
;
2329 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2330 PyMac_GetPoint
, &pt
,
2331 PyMac_GetRect
, &srcRect
,
2332 PyMac_GetRect
, &dstRect
))
2337 _res
= Py_BuildValue("O&",
2338 PyMac_BuildPoint
, pt
);
2342 static PyObject
*Qd_MapPt(_self
, _args
)
2346 PyObject
*_res
= NULL
;
2350 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2351 PyMac_GetPoint
, &pt
,
2352 PyMac_GetRect
, &srcRect
,
2353 PyMac_GetRect
, &dstRect
))
2358 _res
= Py_BuildValue("O&",
2359 PyMac_BuildPoint
, pt
);
2363 static PyObject
*Qd_MapRect(_self
, _args
)
2367 PyObject
*_res
= NULL
;
2371 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2373 PyMac_GetRect
, &srcRect
,
2374 PyMac_GetRect
, &dstRect
))
2379 _res
= Py_BuildValue("O&",
2380 PyMac_BuildRect
, &r
);
2384 static PyObject
*Qd_MapRgn(_self
, _args
)
2388 PyObject
*_res
= NULL
;
2392 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2393 ResObj_Convert
, &rgn
,
2394 PyMac_GetRect
, &srcRect
,
2395 PyMac_GetRect
, &dstRect
))
2405 static PyObject
*Qd_MapPoly(_self
, _args
)
2409 PyObject
*_res
= NULL
;
2413 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2414 ResObj_Convert
, &poly
,
2415 PyMac_GetRect
, &srcRect
,
2416 PyMac_GetRect
, &dstRect
))
2426 static PyObject
*Qd_StdBits(_self
, _args
)
2430 PyObject
*_res
= NULL
;
2436 if (!PyArg_ParseTuple(_args
, "O&O&O&hO&",
2437 BMObj_Convert
, &srcBits
,
2438 PyMac_GetRect
, &srcRect
,
2439 PyMac_GetRect
, &dstRect
,
2441 OptResObj_Convert
, &maskRgn
))
2453 static PyObject
*Qd_AddPt(_self
, _args
)
2457 PyObject
*_res
= NULL
;
2460 if (!PyArg_ParseTuple(_args
, "O&O&",
2461 PyMac_GetPoint
, &src
,
2462 PyMac_GetPoint
, &dst
))
2466 _res
= Py_BuildValue("O&",
2467 PyMac_BuildPoint
, dst
);
2471 static PyObject
*Qd_EqualPt(_self
, _args
)
2475 PyObject
*_res
= NULL
;
2479 if (!PyArg_ParseTuple(_args
, "O&O&",
2480 PyMac_GetPoint
, &pt1
,
2481 PyMac_GetPoint
, &pt2
))
2485 _res
= Py_BuildValue("b",
2490 static PyObject
*Qd_MacPtInRect(_self
, _args
)
2494 PyObject
*_res
= NULL
;
2498 if (!PyArg_ParseTuple(_args
, "O&O&",
2499 PyMac_GetPoint
, &pt
,
2502 _rv
= MacPtInRect(pt
,
2504 _res
= Py_BuildValue("b",
2509 static PyObject
*Qd_Pt2Rect(_self
, _args
)
2513 PyObject
*_res
= NULL
;
2517 if (!PyArg_ParseTuple(_args
, "O&O&",
2518 PyMac_GetPoint
, &pt1
,
2519 PyMac_GetPoint
, &pt2
))
2524 _res
= Py_BuildValue("O&",
2525 PyMac_BuildRect
, &dstRect
);
2529 static PyObject
*Qd_PtToAngle(_self
, _args
)
2533 PyObject
*_res
= NULL
;
2537 if (!PyArg_ParseTuple(_args
, "O&O&",
2539 PyMac_GetPoint
, &pt
))
2544 _res
= Py_BuildValue("h",
2549 static PyObject
*Qd_SubPt(_self
, _args
)
2553 PyObject
*_res
= NULL
;
2556 if (!PyArg_ParseTuple(_args
, "O&O&",
2557 PyMac_GetPoint
, &src
,
2558 PyMac_GetPoint
, &dst
))
2562 _res
= Py_BuildValue("O&",
2563 PyMac_BuildPoint
, dst
);
2567 static PyObject
*Qd_PtInRgn(_self
, _args
)
2571 PyObject
*_res
= NULL
;
2575 if (!PyArg_ParseTuple(_args
, "O&O&",
2576 PyMac_GetPoint
, &pt
,
2577 ResObj_Convert
, &rgn
))
2581 _res
= Py_BuildValue("b",
2586 static PyObject
*Qd_NewPixMap(_self
, _args
)
2590 PyObject
*_res
= NULL
;
2592 if (!PyArg_ParseTuple(_args
, ""))
2595 _res
= Py_BuildValue("O&",
2600 static PyObject
*Qd_DisposePixMap(_self
, _args
)
2604 PyObject
*_res
= NULL
;
2606 if (!PyArg_ParseTuple(_args
, "O&",
2607 ResObj_Convert
, &pm
))
2615 static PyObject
*Qd_CopyPixMap(_self
, _args
)
2619 PyObject
*_res
= NULL
;
2622 if (!PyArg_ParseTuple(_args
, "O&O&",
2623 ResObj_Convert
, &srcPM
,
2624 ResObj_Convert
, &dstPM
))
2633 static PyObject
*Qd_NewPixPat(_self
, _args
)
2637 PyObject
*_res
= NULL
;
2639 if (!PyArg_ParseTuple(_args
, ""))
2642 _res
= Py_BuildValue("O&",
2647 static PyObject
*Qd_DisposePixPat(_self
, _args
)
2651 PyObject
*_res
= NULL
;
2653 if (!PyArg_ParseTuple(_args
, "O&",
2654 ResObj_Convert
, &pp
))
2662 static PyObject
*Qd_CopyPixPat(_self
, _args
)
2666 PyObject
*_res
= NULL
;
2669 if (!PyArg_ParseTuple(_args
, "O&O&",
2670 ResObj_Convert
, &srcPP
,
2671 ResObj_Convert
, &dstPP
))
2680 static PyObject
*Qd_PenPixPat(_self
, _args
)
2684 PyObject
*_res
= NULL
;
2686 if (!PyArg_ParseTuple(_args
, "O&",
2687 ResObj_Convert
, &pp
))
2695 static PyObject
*Qd_BackPixPat(_self
, _args
)
2699 PyObject
*_res
= NULL
;
2701 if (!PyArg_ParseTuple(_args
, "O&",
2702 ResObj_Convert
, &pp
))
2710 static PyObject
*Qd_GetPixPat(_self
, _args
)
2714 PyObject
*_res
= NULL
;
2717 if (!PyArg_ParseTuple(_args
, "h",
2720 _rv
= GetPixPat(patID
);
2721 _res
= Py_BuildValue("O&",
2726 static PyObject
*Qd_MakeRGBPat(_self
, _args
)
2730 PyObject
*_res
= NULL
;
2733 if (!PyArg_ParseTuple(_args
, "O&O&",
2734 ResObj_Convert
, &pp
,
2735 QdRGB_Convert
, &myColor
))
2744 static PyObject
*Qd_FillCRect(_self
, _args
)
2748 PyObject
*_res
= NULL
;
2751 if (!PyArg_ParseTuple(_args
, "O&O&",
2753 ResObj_Convert
, &pp
))
2762 static PyObject
*Qd_FillCOval(_self
, _args
)
2766 PyObject
*_res
= NULL
;
2769 if (!PyArg_ParseTuple(_args
, "O&O&",
2771 ResObj_Convert
, &pp
))
2780 static PyObject
*Qd_FillCRoundRect(_self
, _args
)
2784 PyObject
*_res
= NULL
;
2789 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2793 ResObj_Convert
, &pp
))
2804 static PyObject
*Qd_FillCArc(_self
, _args
)
2808 PyObject
*_res
= NULL
;
2813 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2817 ResObj_Convert
, &pp
))
2828 static PyObject
*Qd_FillCRgn(_self
, _args
)
2832 PyObject
*_res
= NULL
;
2835 if (!PyArg_ParseTuple(_args
, "O&O&",
2836 ResObj_Convert
, &rgn
,
2837 ResObj_Convert
, &pp
))
2846 static PyObject
*Qd_FillCPoly(_self
, _args
)
2850 PyObject
*_res
= NULL
;
2853 if (!PyArg_ParseTuple(_args
, "O&O&",
2854 ResObj_Convert
, &poly
,
2855 ResObj_Convert
, &pp
))
2864 static PyObject
*Qd_RGBForeColor(_self
, _args
)
2868 PyObject
*_res
= NULL
;
2870 if (!PyArg_ParseTuple(_args
, "O&",
2871 QdRGB_Convert
, &color
))
2873 RGBForeColor(&color
);
2879 static PyObject
*Qd_RGBBackColor(_self
, _args
)
2883 PyObject
*_res
= NULL
;
2885 if (!PyArg_ParseTuple(_args
, "O&",
2886 QdRGB_Convert
, &color
))
2888 RGBBackColor(&color
);
2894 static PyObject
*Qd_SetCPixel(_self
, _args
)
2898 PyObject
*_res
= NULL
;
2902 if (!PyArg_ParseTuple(_args
, "hhO&",
2905 QdRGB_Convert
, &cPix
))
2915 static PyObject
*Qd_SetPortPix(_self
, _args
)
2919 PyObject
*_res
= NULL
;
2921 if (!PyArg_ParseTuple(_args
, "O&",
2922 ResObj_Convert
, &pm
))
2930 static PyObject
*Qd_GetCPixel(_self
, _args
)
2934 PyObject
*_res
= NULL
;
2938 if (!PyArg_ParseTuple(_args
, "hh",
2945 _res
= Py_BuildValue("O&",
2950 static PyObject
*Qd_GetForeColor(_self
, _args
)
2954 PyObject
*_res
= NULL
;
2956 if (!PyArg_ParseTuple(_args
, ""))
2958 GetForeColor(&color
);
2959 _res
= Py_BuildValue("O&",
2964 static PyObject
*Qd_GetBackColor(_self
, _args
)
2968 PyObject
*_res
= NULL
;
2970 if (!PyArg_ParseTuple(_args
, ""))
2972 GetBackColor(&color
);
2973 _res
= Py_BuildValue("O&",
2978 static PyObject
*Qd_OpColor(_self
, _args
)
2982 PyObject
*_res
= NULL
;
2984 if (!PyArg_ParseTuple(_args
, "O&",
2985 QdRGB_Convert
, &color
))
2993 static PyObject
*Qd_HiliteColor(_self
, _args
)
2997 PyObject
*_res
= NULL
;
2999 if (!PyArg_ParseTuple(_args
, "O&",
3000 QdRGB_Convert
, &color
))
3002 HiliteColor(&color
);
3008 static PyObject
*Qd_DisposeCTable(_self
, _args
)
3012 PyObject
*_res
= NULL
;
3014 if (!PyArg_ParseTuple(_args
, "O&",
3015 ResObj_Convert
, &cTable
))
3017 DisposeCTable(cTable
);
3023 static PyObject
*Qd_GetCTable(_self
, _args
)
3027 PyObject
*_res
= NULL
;
3030 if (!PyArg_ParseTuple(_args
, "h",
3033 _rv
= GetCTable(ctID
);
3034 _res
= Py_BuildValue("O&",
3039 static PyObject
*Qd_GetCCursor(_self
, _args
)
3043 PyObject
*_res
= NULL
;
3046 if (!PyArg_ParseTuple(_args
, "h",
3049 _rv
= GetCCursor(crsrID
);
3050 _res
= Py_BuildValue("O&",
3055 static PyObject
*Qd_SetCCursor(_self
, _args
)
3059 PyObject
*_res
= NULL
;
3061 if (!PyArg_ParseTuple(_args
, "O&",
3062 ResObj_Convert
, &cCrsr
))
3070 static PyObject
*Qd_AllocCursor(_self
, _args
)
3074 PyObject
*_res
= NULL
;
3075 if (!PyArg_ParseTuple(_args
, ""))
3083 static PyObject
*Qd_DisposeCCursor(_self
, _args
)
3087 PyObject
*_res
= NULL
;
3089 if (!PyArg_ParseTuple(_args
, "O&",
3090 ResObj_Convert
, &cCrsr
))
3092 DisposeCCursor(cCrsr
);
3098 static PyObject
*Qd_GetMaxDevice(_self
, _args
)
3102 PyObject
*_res
= NULL
;
3105 if (!PyArg_ParseTuple(_args
, "O&",
3106 PyMac_GetRect
, &globalRect
))
3108 _rv
= GetMaxDevice(&globalRect
);
3109 _res
= Py_BuildValue("O&",
3114 static PyObject
*Qd_GetCTSeed(_self
, _args
)
3118 PyObject
*_res
= NULL
;
3120 if (!PyArg_ParseTuple(_args
, ""))
3123 _res
= Py_BuildValue("l",
3128 static PyObject
*Qd_GetDeviceList(_self
, _args
)
3132 PyObject
*_res
= NULL
;
3134 if (!PyArg_ParseTuple(_args
, ""))
3136 _rv
= GetDeviceList();
3137 _res
= Py_BuildValue("O&",
3142 static PyObject
*Qd_GetMainDevice(_self
, _args
)
3146 PyObject
*_res
= NULL
;
3148 if (!PyArg_ParseTuple(_args
, ""))
3150 _rv
= GetMainDevice();
3151 _res
= Py_BuildValue("O&",
3156 static PyObject
*Qd_GetNextDevice(_self
, _args
)
3160 PyObject
*_res
= NULL
;
3163 if (!PyArg_ParseTuple(_args
, "O&",
3164 ResObj_Convert
, &curDevice
))
3166 _rv
= GetNextDevice(curDevice
);
3167 _res
= Py_BuildValue("O&",
3172 static PyObject
*Qd_TestDeviceAttribute(_self
, _args
)
3176 PyObject
*_res
= NULL
;
3180 if (!PyArg_ParseTuple(_args
, "O&h",
3181 ResObj_Convert
, &gdh
,
3184 _rv
= TestDeviceAttribute(gdh
,
3186 _res
= Py_BuildValue("b",
3191 static PyObject
*Qd_SetDeviceAttribute(_self
, _args
)
3195 PyObject
*_res
= NULL
;
3199 if (!PyArg_ParseTuple(_args
, "O&hb",
3200 ResObj_Convert
, &gdh
,
3204 SetDeviceAttribute(gdh
,
3212 static PyObject
*Qd_InitGDevice(_self
, _args
)
3216 PyObject
*_res
= NULL
;
3220 if (!PyArg_ParseTuple(_args
, "hlO&",
3223 ResObj_Convert
, &gdh
))
3225 InitGDevice(qdRefNum
,
3233 static PyObject
*Qd_NewGDevice(_self
, _args
)
3237 PyObject
*_res
= NULL
;
3241 if (!PyArg_ParseTuple(_args
, "hl",
3245 _rv
= NewGDevice(refNum
,
3247 _res
= Py_BuildValue("O&",
3252 static PyObject
*Qd_DisposeGDevice(_self
, _args
)
3256 PyObject
*_res
= NULL
;
3258 if (!PyArg_ParseTuple(_args
, "O&",
3259 ResObj_Convert
, &gdh
))
3261 DisposeGDevice(gdh
);
3267 static PyObject
*Qd_SetGDevice(_self
, _args
)
3271 PyObject
*_res
= NULL
;
3273 if (!PyArg_ParseTuple(_args
, "O&",
3274 ResObj_Convert
, &gd
))
3282 static PyObject
*Qd_GetGDevice(_self
, _args
)
3286 PyObject
*_res
= NULL
;
3288 if (!PyArg_ParseTuple(_args
, ""))
3291 _res
= Py_BuildValue("O&",
3296 static PyObject
*Qd_Color2Index(_self
, _args
)
3300 PyObject
*_res
= NULL
;
3303 if (!PyArg_ParseTuple(_args
, "O&",
3304 QdRGB_Convert
, &myColor
))
3306 _rv
= Color2Index(&myColor
);
3307 _res
= Py_BuildValue("l",
3312 static PyObject
*Qd_Index2Color(_self
, _args
)
3316 PyObject
*_res
= NULL
;
3319 if (!PyArg_ParseTuple(_args
, "l",
3324 _res
= Py_BuildValue("O&",
3325 QdRGB_New
, &aColor
);
3329 static PyObject
*Qd_InvertColor(_self
, _args
)
3333 PyObject
*_res
= NULL
;
3335 if (!PyArg_ParseTuple(_args
, ""))
3337 InvertColor(&myColor
);
3338 _res
= Py_BuildValue("O&",
3339 QdRGB_New
, &myColor
);
3343 static PyObject
*Qd_RealColor(_self
, _args
)
3347 PyObject
*_res
= NULL
;
3350 if (!PyArg_ParseTuple(_args
, "O&",
3351 QdRGB_Convert
, &color
))
3353 _rv
= RealColor(&color
);
3354 _res
= Py_BuildValue("b",
3359 static PyObject
*Qd_GetSubTable(_self
, _args
)
3363 PyObject
*_res
= NULL
;
3364 CTabHandle myColors
;
3366 CTabHandle targetTbl
;
3367 if (!PyArg_ParseTuple(_args
, "O&hO&",
3368 ResObj_Convert
, &myColors
,
3370 ResObj_Convert
, &targetTbl
))
3372 GetSubTable(myColors
,
3380 static PyObject
*Qd_MakeITable(_self
, _args
)
3384 PyObject
*_res
= NULL
;
3388 if (!PyArg_ParseTuple(_args
, "O&O&h",
3389 ResObj_Convert
, &cTabH
,
3390 ResObj_Convert
, &iTabH
,
3401 static PyObject
*Qd_SetClientID(_self
, _args
)
3405 PyObject
*_res
= NULL
;
3407 if (!PyArg_ParseTuple(_args
, "h",
3416 static PyObject
*Qd_ProtectEntry(_self
, _args
)
3420 PyObject
*_res
= NULL
;
3423 if (!PyArg_ParseTuple(_args
, "hb",
3434 static PyObject
*Qd_ReserveEntry(_self
, _args
)
3438 PyObject
*_res
= NULL
;
3441 if (!PyArg_ParseTuple(_args
, "hb",
3452 static PyObject
*Qd_QDError(_self
, _args
)
3456 PyObject
*_res
= NULL
;
3458 if (!PyArg_ParseTuple(_args
, ""))
3461 _res
= Py_BuildValue("h",
3466 static PyObject
*Qd_CopyDeepMask(_self
, _args
)
3470 PyObject
*_res
= NULL
;
3479 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&hO&",
3480 BMObj_Convert
, &srcBits
,
3481 BMObj_Convert
, &maskBits
,
3482 BMObj_Convert
, &dstBits
,
3483 PyMac_GetRect
, &srcRect
,
3484 PyMac_GetRect
, &maskRect
,
3485 PyMac_GetRect
, &dstRect
,
3487 OptResObj_Convert
, &maskRgn
))
3489 CopyDeepMask(srcBits
,
3502 static PyObject
*Qd_GetPattern(_self
, _args
)
3506 PyObject
*_res
= NULL
;
3509 if (!PyArg_ParseTuple(_args
, "h",
3512 _rv
= GetPattern(patternID
);
3513 _res
= Py_BuildValue("O&",
3518 static PyObject
*Qd_MacGetCursor(_self
, _args
)
3522 PyObject
*_res
= NULL
;
3525 if (!PyArg_ParseTuple(_args
, "h",
3528 _rv
= MacGetCursor(cursorID
);
3529 _res
= Py_BuildValue("O&",
3534 static PyObject
*Qd_GetPicture(_self
, _args
)
3538 PyObject
*_res
= NULL
;
3541 if (!PyArg_ParseTuple(_args
, "h",
3544 _rv
= GetPicture(pictureID
);
3545 _res
= Py_BuildValue("O&",
3550 static PyObject
*Qd_DeltaPoint(_self
, _args
)
3554 PyObject
*_res
= NULL
;
3558 if (!PyArg_ParseTuple(_args
, "O&O&",
3559 PyMac_GetPoint
, &ptA
,
3560 PyMac_GetPoint
, &ptB
))
3562 _rv
= DeltaPoint(ptA
,
3564 _res
= Py_BuildValue("l",
3569 static PyObject
*Qd_ShieldCursor(_self
, _args
)
3573 PyObject
*_res
= NULL
;
3576 if (!PyArg_ParseTuple(_args
, "O&O&",
3577 PyMac_GetRect
, &shieldRect
,
3578 PyMac_GetPoint
, &offsetPt
))
3580 ShieldCursor(&shieldRect
,
3587 static PyObject
*Qd_ScreenRes(_self
, _args
)
3591 PyObject
*_res
= NULL
;
3594 if (!PyArg_ParseTuple(_args
, ""))
3596 ScreenRes(&scrnHRes
,
3598 _res
= Py_BuildValue("hh",
3604 static PyObject
*Qd_GetIndPattern(_self
, _args
)
3608 PyObject
*_res
= NULL
;
3609 Pattern thePat__out__
;
3610 short patternListID
;
3612 if (!PyArg_ParseTuple(_args
, "hh",
3616 GetIndPattern(&thePat__out__
,
3619 _res
= Py_BuildValue("s#",
3620 (char *)&thePat__out__
, (int)sizeof(Pattern
));
3625 static PyObject
*Qd_SlopeFromAngle(_self
, _args
)
3629 PyObject
*_res
= NULL
;
3632 if (!PyArg_ParseTuple(_args
, "h",
3635 _rv
= SlopeFromAngle(angle
);
3636 _res
= Py_BuildValue("O&",
3637 PyMac_BuildFixed
, _rv
);
3641 static PyObject
*Qd_AngleFromSlope(_self
, _args
)
3645 PyObject
*_res
= NULL
;
3648 if (!PyArg_ParseTuple(_args
, "O&",
3649 PyMac_GetFixed
, &slope
))
3651 _rv
= AngleFromSlope(slope
);
3652 _res
= Py_BuildValue("h",
3657 static PyObject
*Qd_TextFont(_self
, _args
)
3661 PyObject
*_res
= NULL
;
3663 if (!PyArg_ParseTuple(_args
, "h",
3672 static PyObject
*Qd_TextFace(_self
, _args
)
3676 PyObject
*_res
= NULL
;
3677 StyleParameter face
;
3678 if (!PyArg_ParseTuple(_args
, "h",
3687 static PyObject
*Qd_TextMode(_self
, _args
)
3691 PyObject
*_res
= NULL
;
3693 if (!PyArg_ParseTuple(_args
, "h",
3702 static PyObject
*Qd_TextSize(_self
, _args
)
3706 PyObject
*_res
= NULL
;
3708 if (!PyArg_ParseTuple(_args
, "h",
3717 static PyObject
*Qd_SpaceExtra(_self
, _args
)
3721 PyObject
*_res
= NULL
;
3723 if (!PyArg_ParseTuple(_args
, "O&",
3724 PyMac_GetFixed
, &extra
))
3732 static PyObject
*Qd_DrawChar(_self
, _args
)
3736 PyObject
*_res
= NULL
;
3738 if (!PyArg_ParseTuple(_args
, "h",
3747 static PyObject
*Qd_DrawString(_self
, _args
)
3751 PyObject
*_res
= NULL
;
3753 if (!PyArg_ParseTuple(_args
, "O&",
3754 PyMac_GetStr255
, s
))
3762 static PyObject
*Qd_MacDrawText(_self
, _args
)
3766 PyObject
*_res
= NULL
;
3767 char *textBuf__in__
;
3769 int textBuf__in_len__
;
3772 if (!PyArg_ParseTuple(_args
, "s#hh",
3773 &textBuf__in__
, &textBuf__in_len__
,
3777 MacDrawText(textBuf__in__
,
3786 static PyObject
*Qd_CharWidth(_self
, _args
)
3790 PyObject
*_res
= NULL
;
3793 if (!PyArg_ParseTuple(_args
, "h",
3796 _rv
= CharWidth(ch
);
3797 _res
= Py_BuildValue("h",
3802 static PyObject
*Qd_StringWidth(_self
, _args
)
3806 PyObject
*_res
= NULL
;
3809 if (!PyArg_ParseTuple(_args
, "O&",
3810 PyMac_GetStr255
, s
))
3812 _rv
= StringWidth(s
);
3813 _res
= Py_BuildValue("h",
3818 static PyObject
*Qd_TextWidth(_self
, _args
)
3822 PyObject
*_res
= NULL
;
3824 char *textBuf__in__
;
3826 int textBuf__in_len__
;
3829 if (!PyArg_ParseTuple(_args
, "s#hh",
3830 &textBuf__in__
, &textBuf__in_len__
,
3834 _rv
= TextWidth(textBuf__in__
,
3837 _res
= Py_BuildValue("h",
3843 static PyObject
*Qd_GetFontInfo(_self
, _args
)
3847 PyObject
*_res
= NULL
;
3849 if (!PyArg_ParseTuple(_args
, ""))
3852 _res
= Py_BuildValue("O&",
3857 static PyObject
*Qd_CharExtra(_self
, _args
)
3861 PyObject
*_res
= NULL
;
3863 if (!PyArg_ParseTuple(_args
, "O&",
3864 PyMac_GetFixed
, &extra
))
3872 static PyObject
*Qd_SetPort(_self
, _args
)
3876 PyObject
*_res
= NULL
;
3878 if (!PyArg_ParseTuple(_args
, "O&",
3879 GrafObj_Convert
, &thePort
))
3887 static PyObject
*Qd_GetCursor(_self
, _args
)
3891 PyObject
*_res
= NULL
;
3894 if (!PyArg_ParseTuple(_args
, "h",
3897 _rv
= GetCursor(cursorID
);
3898 _res
= Py_BuildValue("O&",
3903 static PyObject
*Qd_SetCursor(_self
, _args
)
3907 PyObject
*_res
= NULL
;
3910 if (!PyArg_ParseTuple(_args
, "s#",
3911 (char **)&crsr__in__
, &crsr__in_len__
))
3913 if (crsr__in_len__
!= sizeof(Cursor
))
3915 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
3918 SetCursor(crsr__in__
);
3925 static PyObject
*Qd_ShowCursor(_self
, _args
)
3929 PyObject
*_res
= NULL
;
3930 if (!PyArg_ParseTuple(_args
, ""))
3938 static PyObject
*Qd_LineTo(_self
, _args
)
3942 PyObject
*_res
= NULL
;
3945 if (!PyArg_ParseTuple(_args
, "hh",
3956 static PyObject
*Qd_SetRect(_self
, _args
)
3960 PyObject
*_res
= NULL
;
3966 if (!PyArg_ParseTuple(_args
, "hhhh",
3977 _res
= Py_BuildValue("O&",
3978 PyMac_BuildRect
, &r
);
3982 static PyObject
*Qd_OffsetRect(_self
, _args
)
3986 PyObject
*_res
= NULL
;
3990 if (!PyArg_ParseTuple(_args
, "O&hh",
3998 _res
= Py_BuildValue("O&",
3999 PyMac_BuildRect
, &r
);
4003 static PyObject
*Qd_InsetRect(_self
, _args
)
4007 PyObject
*_res
= NULL
;
4011 if (!PyArg_ParseTuple(_args
, "O&hh",
4019 _res
= Py_BuildValue("O&",
4020 PyMac_BuildRect
, &r
);
4024 static PyObject
*Qd_UnionRect(_self
, _args
)
4028 PyObject
*_res
= NULL
;
4032 if (!PyArg_ParseTuple(_args
, "O&O&",
4033 PyMac_GetRect
, &src1
,
4034 PyMac_GetRect
, &src2
))
4039 _res
= Py_BuildValue("O&",
4040 PyMac_BuildRect
, &dstRect
);
4044 static PyObject
*Qd_EqualRect(_self
, _args
)
4048 PyObject
*_res
= NULL
;
4052 if (!PyArg_ParseTuple(_args
, "O&O&",
4053 PyMac_GetRect
, &rect1
,
4054 PyMac_GetRect
, &rect2
))
4056 _rv
= EqualRect(&rect1
,
4058 _res
= Py_BuildValue("b",
4063 static PyObject
*Qd_FrameRect(_self
, _args
)
4067 PyObject
*_res
= NULL
;
4069 if (!PyArg_ParseTuple(_args
, "O&",
4078 static PyObject
*Qd_InvertRect(_self
, _args
)
4082 PyObject
*_res
= NULL
;
4084 if (!PyArg_ParseTuple(_args
, "O&",
4093 static PyObject
*Qd_FillRect(_self
, _args
)
4097 PyObject
*_res
= NULL
;
4101 if (!PyArg_ParseTuple(_args
, "O&s#",
4103 (char **)&pat__in__
, &pat__in_len__
))
4105 if (pat__in_len__
!= sizeof(Pattern
))
4107 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
4118 static PyObject
*Qd_CopyRgn(_self
, _args
)
4122 PyObject
*_res
= NULL
;
4125 if (!PyArg_ParseTuple(_args
, "O&O&",
4126 ResObj_Convert
, &srcRgn
,
4127 ResObj_Convert
, &dstRgn
))
4136 static PyObject
*Qd_SetRectRgn(_self
, _args
)
4140 PyObject
*_res
= NULL
;
4146 if (!PyArg_ParseTuple(_args
, "O&hhhh",
4147 ResObj_Convert
, &rgn
,
4163 static PyObject
*Qd_OffsetRgn(_self
, _args
)
4167 PyObject
*_res
= NULL
;
4171 if (!PyArg_ParseTuple(_args
, "O&hh",
4172 ResObj_Convert
, &rgn
,
4184 static PyObject
*Qd_UnionRgn(_self
, _args
)
4188 PyObject
*_res
= NULL
;
4192 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4193 ResObj_Convert
, &srcRgnA
,
4194 ResObj_Convert
, &srcRgnB
,
4195 ResObj_Convert
, &dstRgn
))
4205 static PyObject
*Qd_XorRgn(_self
, _args
)
4209 PyObject
*_res
= NULL
;
4213 if (!PyArg_ParseTuple(_args
, "O&O&O&",
4214 ResObj_Convert
, &srcRgnA
,
4215 ResObj_Convert
, &srcRgnB
,
4216 ResObj_Convert
, &dstRgn
))
4226 static PyObject
*Qd_EqualRgn(_self
, _args
)
4230 PyObject
*_res
= NULL
;
4234 if (!PyArg_ParseTuple(_args
, "O&O&",
4235 ResObj_Convert
, &rgnA
,
4236 ResObj_Convert
, &rgnB
))
4238 _rv
= EqualRgn(rgnA
,
4240 _res
= Py_BuildValue("b",
4245 static PyObject
*Qd_FrameRgn(_self
, _args
)
4249 PyObject
*_res
= NULL
;
4251 if (!PyArg_ParseTuple(_args
, "O&",
4252 ResObj_Convert
, &rgn
))
4260 static PyObject
*Qd_PaintRgn(_self
, _args
)
4264 PyObject
*_res
= NULL
;
4266 if (!PyArg_ParseTuple(_args
, "O&",
4267 ResObj_Convert
, &rgn
))
4275 static PyObject
*Qd_InvertRgn(_self
, _args
)
4279 PyObject
*_res
= NULL
;
4281 if (!PyArg_ParseTuple(_args
, "O&",
4282 ResObj_Convert
, &rgn
))
4290 static PyObject
*Qd_FillRgn(_self
, _args
)
4294 PyObject
*_res
= NULL
;
4298 if (!PyArg_ParseTuple(_args
, "O&s#",
4299 ResObj_Convert
, &rgn
,
4300 (char **)&pat__in__
, &pat__in_len__
))
4302 if (pat__in_len__
!= sizeof(Pattern
))
4304 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
4315 static PyObject
*Qd_GetPixel(_self
, _args
)
4319 PyObject
*_res
= NULL
;
4323 if (!PyArg_ParseTuple(_args
, "hh",
4329 _res
= Py_BuildValue("b",
4334 static PyObject
*Qd_PtInRect(_self
, _args
)
4338 PyObject
*_res
= NULL
;
4342 if (!PyArg_ParseTuple(_args
, "O&O&",
4343 PyMac_GetPoint
, &pt
,
4348 _res
= Py_BuildValue("b",
4353 static PyObject
*Qd_DrawText(_self
, _args
)
4357 PyObject
*_res
= NULL
;
4358 char *textBuf__in__
;
4360 int textBuf__in_len__
;
4363 if (!PyArg_ParseTuple(_args
, "s#hh",
4364 &textBuf__in__
, &textBuf__in_len__
,
4368 DrawText(textBuf__in__
,
4377 static PyObject
*Qd_BitMap(_self
, _args
)
4381 PyObject
*_res
= NULL
;
4389 if ( !PyArg_ParseTuple(_args
, "O!iO&", &PyString_Type
, &source
, &rowbytes
, PyMac_GetRect
,
4392 data
= PyString_AsString(source
);
4393 if ((ptr
=(BitMap
*)malloc(sizeof(BitMap
))) == NULL
)
4394 return PyErr_NoMemory();
4395 ptr
->baseAddr
= (Ptr
)data
;
4396 ptr
->rowBytes
= rowbytes
;
4397 ptr
->bounds
= bounds
;
4398 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
4402 ((BitMapObject
*)_res
)->referred_object
= source
;
4404 ((BitMapObject
*)_res
)->referred_bitmap
= ptr
;
4409 static PyObject
*Qd_RawBitMap(_self
, _args
)
4413 PyObject
*_res
= NULL
;
4418 if ( !PyArg_ParseTuple(_args
, "O!", &PyString_Type
, &source
) )
4420 if ( PyString_Size(source
) != sizeof(BitMap
) && PyString_Size(source
) != sizeof(PixMap
) ) {
4421 PyErr_BadArgument();
4424 ptr
= (BitMapPtr
)PyString_AsString(source
);
4425 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
4428 ((BitMapObject
*)_res
)->referred_object
= source
;
4434 static PyMethodDef Qd_methods
[] = {
4435 {"MacSetPort", (PyCFunction
)Qd_MacSetPort
, 1,
4436 "(GrafPtr port) -> None"},
4437 {"GetPort", (PyCFunction
)Qd_GetPort
, 1,
4438 "() -> (GrafPtr port)"},
4439 {"GrafDevice", (PyCFunction
)Qd_GrafDevice
, 1,
4440 "(short device) -> None"},
4441 {"SetPortBits", (PyCFunction
)Qd_SetPortBits
, 1,
4442 "(BitMapPtr bm) -> None"},
4443 {"PortSize", (PyCFunction
)Qd_PortSize
, 1,
4444 "(short width, short height) -> None"},
4445 {"MovePortTo", (PyCFunction
)Qd_MovePortTo
, 1,
4446 "(short leftGlobal, short topGlobal) -> None"},
4447 {"SetOrigin", (PyCFunction
)Qd_SetOrigin
, 1,
4448 "(short h, short v) -> None"},
4449 {"SetClip", (PyCFunction
)Qd_SetClip
, 1,
4450 "(RgnHandle rgn) -> None"},
4451 {"GetClip", (PyCFunction
)Qd_GetClip
, 1,
4452 "(RgnHandle rgn) -> None"},
4453 {"ClipRect", (PyCFunction
)Qd_ClipRect
, 1,
4454 "(Rect r) -> None"},
4455 {"BackPat", (PyCFunction
)Qd_BackPat
, 1,
4456 "(Pattern pat) -> None"},
4457 {"InitCursor", (PyCFunction
)Qd_InitCursor
, 1,
4459 {"MacSetCursor", (PyCFunction
)Qd_MacSetCursor
, 1,
4460 "(Cursor crsr) -> None"},
4461 {"HideCursor", (PyCFunction
)Qd_HideCursor
, 1,
4463 {"MacShowCursor", (PyCFunction
)Qd_MacShowCursor
, 1,
4465 {"ObscureCursor", (PyCFunction
)Qd_ObscureCursor
, 1,
4467 {"HidePen", (PyCFunction
)Qd_HidePen
, 1,
4469 {"ShowPen", (PyCFunction
)Qd_ShowPen
, 1,
4471 {"GetPen", (PyCFunction
)Qd_GetPen
, 1,
4472 "() -> (Point pt)"},
4473 {"GetPenState", (PyCFunction
)Qd_GetPenState
, 1,
4474 "() -> (PenState pnState)"},
4475 {"SetPenState", (PyCFunction
)Qd_SetPenState
, 1,
4476 "(PenState pnState) -> None"},
4477 {"PenSize", (PyCFunction
)Qd_PenSize
, 1,
4478 "(short width, short height) -> None"},
4479 {"PenMode", (PyCFunction
)Qd_PenMode
, 1,
4480 "(short mode) -> None"},
4481 {"PenPat", (PyCFunction
)Qd_PenPat
, 1,
4482 "(Pattern pat) -> None"},
4483 {"PenNormal", (PyCFunction
)Qd_PenNormal
, 1,
4485 {"MoveTo", (PyCFunction
)Qd_MoveTo
, 1,
4486 "(short h, short v) -> None"},
4487 {"Move", (PyCFunction
)Qd_Move
, 1,
4488 "(short dh, short dv) -> None"},
4489 {"MacLineTo", (PyCFunction
)Qd_MacLineTo
, 1,
4490 "(short h, short v) -> None"},
4491 {"Line", (PyCFunction
)Qd_Line
, 1,
4492 "(short dh, short dv) -> None"},
4493 {"ForeColor", (PyCFunction
)Qd_ForeColor
, 1,
4494 "(long color) -> None"},
4495 {"BackColor", (PyCFunction
)Qd_BackColor
, 1,
4496 "(long color) -> None"},
4497 {"ColorBit", (PyCFunction
)Qd_ColorBit
, 1,
4498 "(short whichBit) -> None"},
4499 {"MacSetRect", (PyCFunction
)Qd_MacSetRect
, 1,
4500 "(short left, short top, short right, short bottom) -> (Rect r)"},
4501 {"MacOffsetRect", (PyCFunction
)Qd_MacOffsetRect
, 1,
4502 "(Rect r, short dh, short dv) -> (Rect r)"},
4503 {"MacInsetRect", (PyCFunction
)Qd_MacInsetRect
, 1,
4504 "(Rect r, short dh, short dv) -> (Rect r)"},
4505 {"SectRect", (PyCFunction
)Qd_SectRect
, 1,
4506 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
4507 {"MacUnionRect", (PyCFunction
)Qd_MacUnionRect
, 1,
4508 "(Rect src1, Rect src2) -> (Rect dstRect)"},
4509 {"MacEqualRect", (PyCFunction
)Qd_MacEqualRect
, 1,
4510 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
4511 {"EmptyRect", (PyCFunction
)Qd_EmptyRect
, 1,
4512 "(Rect r) -> (Boolean _rv)"},
4513 {"MacFrameRect", (PyCFunction
)Qd_MacFrameRect
, 1,
4514 "(Rect r) -> None"},
4515 {"PaintRect", (PyCFunction
)Qd_PaintRect
, 1,
4516 "(Rect r) -> None"},
4517 {"EraseRect", (PyCFunction
)Qd_EraseRect
, 1,
4518 "(Rect r) -> None"},
4519 {"MacInvertRect", (PyCFunction
)Qd_MacInvertRect
, 1,
4520 "(Rect r) -> None"},
4521 {"MacFillRect", (PyCFunction
)Qd_MacFillRect
, 1,
4522 "(Rect r, Pattern pat) -> None"},
4523 {"FrameOval", (PyCFunction
)Qd_FrameOval
, 1,
4524 "(Rect r) -> None"},
4525 {"PaintOval", (PyCFunction
)Qd_PaintOval
, 1,
4526 "(Rect r) -> None"},
4527 {"EraseOval", (PyCFunction
)Qd_EraseOval
, 1,
4528 "(Rect r) -> None"},
4529 {"InvertOval", (PyCFunction
)Qd_InvertOval
, 1,
4530 "(Rect r) -> None"},
4531 {"FillOval", (PyCFunction
)Qd_FillOval
, 1,
4532 "(Rect r, Pattern pat) -> None"},
4533 {"FrameRoundRect", (PyCFunction
)Qd_FrameRoundRect
, 1,
4534 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4535 {"PaintRoundRect", (PyCFunction
)Qd_PaintRoundRect
, 1,
4536 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4537 {"EraseRoundRect", (PyCFunction
)Qd_EraseRoundRect
, 1,
4538 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4539 {"InvertRoundRect", (PyCFunction
)Qd_InvertRoundRect
, 1,
4540 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
4541 {"FillRoundRect", (PyCFunction
)Qd_FillRoundRect
, 1,
4542 "(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None"},
4543 {"FrameArc", (PyCFunction
)Qd_FrameArc
, 1,
4544 "(Rect r, short startAngle, short arcAngle) -> None"},
4545 {"PaintArc", (PyCFunction
)Qd_PaintArc
, 1,
4546 "(Rect r, short startAngle, short arcAngle) -> None"},
4547 {"EraseArc", (PyCFunction
)Qd_EraseArc
, 1,
4548 "(Rect r, short startAngle, short arcAngle) -> None"},
4549 {"InvertArc", (PyCFunction
)Qd_InvertArc
, 1,
4550 "(Rect r, short startAngle, short arcAngle) -> None"},
4551 {"FillArc", (PyCFunction
)Qd_FillArc
, 1,
4552 "(Rect r, short startAngle, short arcAngle, Pattern pat) -> None"},
4553 {"NewRgn", (PyCFunction
)Qd_NewRgn
, 1,
4554 "() -> (RgnHandle _rv)"},
4555 {"OpenRgn", (PyCFunction
)Qd_OpenRgn
, 1,
4557 {"CloseRgn", (PyCFunction
)Qd_CloseRgn
, 1,
4558 "(RgnHandle dstRgn) -> None"},
4559 {"BitMapToRegion", (PyCFunction
)Qd_BitMapToRegion
, 1,
4560 "(RgnHandle region, BitMapPtr bMap) -> None"},
4561 {"DisposeRgn", (PyCFunction
)Qd_DisposeRgn
, 1,
4562 "(RgnHandle rgn) -> None"},
4563 {"MacCopyRgn", (PyCFunction
)Qd_MacCopyRgn
, 1,
4564 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
4565 {"SetEmptyRgn", (PyCFunction
)Qd_SetEmptyRgn
, 1,
4566 "(RgnHandle rgn) -> None"},
4567 {"MacSetRectRgn", (PyCFunction
)Qd_MacSetRectRgn
, 1,
4568 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
4569 {"RectRgn", (PyCFunction
)Qd_RectRgn
, 1,
4570 "(RgnHandle rgn, Rect r) -> None"},
4571 {"MacOffsetRgn", (PyCFunction
)Qd_MacOffsetRgn
, 1,
4572 "(RgnHandle rgn, short dh, short dv) -> None"},
4573 {"InsetRgn", (PyCFunction
)Qd_InsetRgn
, 1,
4574 "(RgnHandle rgn, short dh, short dv) -> None"},
4575 {"SectRgn", (PyCFunction
)Qd_SectRgn
, 1,
4576 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4577 {"MacUnionRgn", (PyCFunction
)Qd_MacUnionRgn
, 1,
4578 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4579 {"DiffRgn", (PyCFunction
)Qd_DiffRgn
, 1,
4580 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4581 {"MacXorRgn", (PyCFunction
)Qd_MacXorRgn
, 1,
4582 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4583 {"RectInRgn", (PyCFunction
)Qd_RectInRgn
, 1,
4584 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
4585 {"MacEqualRgn", (PyCFunction
)Qd_MacEqualRgn
, 1,
4586 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
4587 {"EmptyRgn", (PyCFunction
)Qd_EmptyRgn
, 1,
4588 "(RgnHandle rgn) -> (Boolean _rv)"},
4589 {"MacFrameRgn", (PyCFunction
)Qd_MacFrameRgn
, 1,
4590 "(RgnHandle rgn) -> None"},
4591 {"MacPaintRgn", (PyCFunction
)Qd_MacPaintRgn
, 1,
4592 "(RgnHandle rgn) -> None"},
4593 {"EraseRgn", (PyCFunction
)Qd_EraseRgn
, 1,
4594 "(RgnHandle rgn) -> None"},
4595 {"MacInvertRgn", (PyCFunction
)Qd_MacInvertRgn
, 1,
4596 "(RgnHandle rgn) -> None"},
4597 {"MacFillRgn", (PyCFunction
)Qd_MacFillRgn
, 1,
4598 "(RgnHandle rgn, Pattern pat) -> None"},
4599 {"ScrollRect", (PyCFunction
)Qd_ScrollRect
, 1,
4600 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
4601 {"CopyBits", (PyCFunction
)Qd_CopyBits
, 1,
4602 "(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4603 {"CopyMask", (PyCFunction
)Qd_CopyMask
, 1,
4604 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None"},
4605 {"OpenPicture", (PyCFunction
)Qd_OpenPicture
, 1,
4606 "(Rect picFrame) -> (PicHandle _rv)"},
4607 {"PicComment", (PyCFunction
)Qd_PicComment
, 1,
4608 "(short kind, short dataSize, Handle dataHandle) -> None"},
4609 {"ClosePicture", (PyCFunction
)Qd_ClosePicture
, 1,
4611 {"DrawPicture", (PyCFunction
)Qd_DrawPicture
, 1,
4612 "(PicHandle myPicture, Rect dstRect) -> None"},
4613 {"KillPicture", (PyCFunction
)Qd_KillPicture
, 1,
4614 "(PicHandle myPicture) -> None"},
4615 {"OpenPoly", (PyCFunction
)Qd_OpenPoly
, 1,
4616 "() -> (PolyHandle _rv)"},
4617 {"ClosePoly", (PyCFunction
)Qd_ClosePoly
, 1,
4619 {"KillPoly", (PyCFunction
)Qd_KillPoly
, 1,
4620 "(PolyHandle poly) -> None"},
4621 {"OffsetPoly", (PyCFunction
)Qd_OffsetPoly
, 1,
4622 "(PolyHandle poly, short dh, short dv) -> None"},
4623 {"FramePoly", (PyCFunction
)Qd_FramePoly
, 1,
4624 "(PolyHandle poly) -> None"},
4625 {"PaintPoly", (PyCFunction
)Qd_PaintPoly
, 1,
4626 "(PolyHandle poly) -> None"},
4627 {"ErasePoly", (PyCFunction
)Qd_ErasePoly
, 1,
4628 "(PolyHandle poly) -> None"},
4629 {"InvertPoly", (PyCFunction
)Qd_InvertPoly
, 1,
4630 "(PolyHandle poly) -> None"},
4631 {"FillPoly", (PyCFunction
)Qd_FillPoly
, 1,
4632 "(PolyHandle poly, Pattern pat) -> None"},
4633 {"SetPt", (PyCFunction
)Qd_SetPt
, 1,
4634 "(short h, short v) -> (Point pt)"},
4635 {"LocalToGlobal", (PyCFunction
)Qd_LocalToGlobal
, 1,
4636 "(Point pt) -> (Point pt)"},
4637 {"GlobalToLocal", (PyCFunction
)Qd_GlobalToLocal
, 1,
4638 "(Point pt) -> (Point pt)"},
4639 {"Random", (PyCFunction
)Qd_Random
, 1,
4640 "() -> (short _rv)"},
4641 {"MacGetPixel", (PyCFunction
)Qd_MacGetPixel
, 1,
4642 "(short h, short v) -> (Boolean _rv)"},
4643 {"ScalePt", (PyCFunction
)Qd_ScalePt
, 1,
4644 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
4645 {"MapPt", (PyCFunction
)Qd_MapPt
, 1,
4646 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
4647 {"MapRect", (PyCFunction
)Qd_MapRect
, 1,
4648 "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
4649 {"MapRgn", (PyCFunction
)Qd_MapRgn
, 1,
4650 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
4651 {"MapPoly", (PyCFunction
)Qd_MapPoly
, 1,
4652 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
4653 {"StdBits", (PyCFunction
)Qd_StdBits
, 1,
4654 "(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4655 {"AddPt", (PyCFunction
)Qd_AddPt
, 1,
4656 "(Point src, Point dst) -> (Point dst)"},
4657 {"EqualPt", (PyCFunction
)Qd_EqualPt
, 1,
4658 "(Point pt1, Point pt2) -> (Boolean _rv)"},
4659 {"MacPtInRect", (PyCFunction
)Qd_MacPtInRect
, 1,
4660 "(Point pt, Rect r) -> (Boolean _rv)"},
4661 {"Pt2Rect", (PyCFunction
)Qd_Pt2Rect
, 1,
4662 "(Point pt1, Point pt2) -> (Rect dstRect)"},
4663 {"PtToAngle", (PyCFunction
)Qd_PtToAngle
, 1,
4664 "(Rect r, Point pt) -> (short angle)"},
4665 {"SubPt", (PyCFunction
)Qd_SubPt
, 1,
4666 "(Point src, Point dst) -> (Point dst)"},
4667 {"PtInRgn", (PyCFunction
)Qd_PtInRgn
, 1,
4668 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
4669 {"NewPixMap", (PyCFunction
)Qd_NewPixMap
, 1,
4670 "() -> (PixMapHandle _rv)"},
4671 {"DisposePixMap", (PyCFunction
)Qd_DisposePixMap
, 1,
4672 "(PixMapHandle pm) -> None"},
4673 {"CopyPixMap", (PyCFunction
)Qd_CopyPixMap
, 1,
4674 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
4675 {"NewPixPat", (PyCFunction
)Qd_NewPixPat
, 1,
4676 "() -> (PixPatHandle _rv)"},
4677 {"DisposePixPat", (PyCFunction
)Qd_DisposePixPat
, 1,
4678 "(PixPatHandle pp) -> None"},
4679 {"CopyPixPat", (PyCFunction
)Qd_CopyPixPat
, 1,
4680 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
4681 {"PenPixPat", (PyCFunction
)Qd_PenPixPat
, 1,
4682 "(PixPatHandle pp) -> None"},
4683 {"BackPixPat", (PyCFunction
)Qd_BackPixPat
, 1,
4684 "(PixPatHandle pp) -> None"},
4685 {"GetPixPat", (PyCFunction
)Qd_GetPixPat
, 1,
4686 "(short patID) -> (PixPatHandle _rv)"},
4687 {"MakeRGBPat", (PyCFunction
)Qd_MakeRGBPat
, 1,
4688 "(PixPatHandle pp, RGBColor myColor) -> None"},
4689 {"FillCRect", (PyCFunction
)Qd_FillCRect
, 1,
4690 "(Rect r, PixPatHandle pp) -> None"},
4691 {"FillCOval", (PyCFunction
)Qd_FillCOval
, 1,
4692 "(Rect r, PixPatHandle pp) -> None"},
4693 {"FillCRoundRect", (PyCFunction
)Qd_FillCRoundRect
, 1,
4694 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
4695 {"FillCArc", (PyCFunction
)Qd_FillCArc
, 1,
4696 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
4697 {"FillCRgn", (PyCFunction
)Qd_FillCRgn
, 1,
4698 "(RgnHandle rgn, PixPatHandle pp) -> None"},
4699 {"FillCPoly", (PyCFunction
)Qd_FillCPoly
, 1,
4700 "(PolyHandle poly, PixPatHandle pp) -> None"},
4701 {"RGBForeColor", (PyCFunction
)Qd_RGBForeColor
, 1,
4702 "(RGBColor color) -> None"},
4703 {"RGBBackColor", (PyCFunction
)Qd_RGBBackColor
, 1,
4704 "(RGBColor color) -> None"},
4705 {"SetCPixel", (PyCFunction
)Qd_SetCPixel
, 1,
4706 "(short h, short v, RGBColor cPix) -> None"},
4707 {"SetPortPix", (PyCFunction
)Qd_SetPortPix
, 1,
4708 "(PixMapHandle pm) -> None"},
4709 {"GetCPixel", (PyCFunction
)Qd_GetCPixel
, 1,
4710 "(short h, short v) -> (RGBColor cPix)"},
4711 {"GetForeColor", (PyCFunction
)Qd_GetForeColor
, 1,
4712 "() -> (RGBColor color)"},
4713 {"GetBackColor", (PyCFunction
)Qd_GetBackColor
, 1,
4714 "() -> (RGBColor color)"},
4715 {"OpColor", (PyCFunction
)Qd_OpColor
, 1,
4716 "(RGBColor color) -> None"},
4717 {"HiliteColor", (PyCFunction
)Qd_HiliteColor
, 1,
4718 "(RGBColor color) -> None"},
4719 {"DisposeCTable", (PyCFunction
)Qd_DisposeCTable
, 1,
4720 "(CTabHandle cTable) -> None"},
4721 {"GetCTable", (PyCFunction
)Qd_GetCTable
, 1,
4722 "(short ctID) -> (CTabHandle _rv)"},
4723 {"GetCCursor", (PyCFunction
)Qd_GetCCursor
, 1,
4724 "(short crsrID) -> (CCrsrHandle _rv)"},
4725 {"SetCCursor", (PyCFunction
)Qd_SetCCursor
, 1,
4726 "(CCrsrHandle cCrsr) -> None"},
4727 {"AllocCursor", (PyCFunction
)Qd_AllocCursor
, 1,
4729 {"DisposeCCursor", (PyCFunction
)Qd_DisposeCCursor
, 1,
4730 "(CCrsrHandle cCrsr) -> None"},
4731 {"GetMaxDevice", (PyCFunction
)Qd_GetMaxDevice
, 1,
4732 "(Rect globalRect) -> (GDHandle _rv)"},
4733 {"GetCTSeed", (PyCFunction
)Qd_GetCTSeed
, 1,
4734 "() -> (long _rv)"},
4735 {"GetDeviceList", (PyCFunction
)Qd_GetDeviceList
, 1,
4736 "() -> (GDHandle _rv)"},
4737 {"GetMainDevice", (PyCFunction
)Qd_GetMainDevice
, 1,
4738 "() -> (GDHandle _rv)"},
4739 {"GetNextDevice", (PyCFunction
)Qd_GetNextDevice
, 1,
4740 "(GDHandle curDevice) -> (GDHandle _rv)"},
4741 {"TestDeviceAttribute", (PyCFunction
)Qd_TestDeviceAttribute
, 1,
4742 "(GDHandle gdh, short attribute) -> (Boolean _rv)"},
4743 {"SetDeviceAttribute", (PyCFunction
)Qd_SetDeviceAttribute
, 1,
4744 "(GDHandle gdh, short attribute, Boolean value) -> None"},
4745 {"InitGDevice", (PyCFunction
)Qd_InitGDevice
, 1,
4746 "(short qdRefNum, long mode, GDHandle gdh) -> None"},
4747 {"NewGDevice", (PyCFunction
)Qd_NewGDevice
, 1,
4748 "(short refNum, long mode) -> (GDHandle _rv)"},
4749 {"DisposeGDevice", (PyCFunction
)Qd_DisposeGDevice
, 1,
4750 "(GDHandle gdh) -> None"},
4751 {"SetGDevice", (PyCFunction
)Qd_SetGDevice
, 1,
4752 "(GDHandle gd) -> None"},
4753 {"GetGDevice", (PyCFunction
)Qd_GetGDevice
, 1,
4754 "() -> (GDHandle _rv)"},
4755 {"Color2Index", (PyCFunction
)Qd_Color2Index
, 1,
4756 "(RGBColor myColor) -> (long _rv)"},
4757 {"Index2Color", (PyCFunction
)Qd_Index2Color
, 1,
4758 "(long index) -> (RGBColor aColor)"},
4759 {"InvertColor", (PyCFunction
)Qd_InvertColor
, 1,
4760 "() -> (RGBColor myColor)"},
4761 {"RealColor", (PyCFunction
)Qd_RealColor
, 1,
4762 "(RGBColor color) -> (Boolean _rv)"},
4763 {"GetSubTable", (PyCFunction
)Qd_GetSubTable
, 1,
4764 "(CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None"},
4765 {"MakeITable", (PyCFunction
)Qd_MakeITable
, 1,
4766 "(CTabHandle cTabH, ITabHandle iTabH, short res) -> None"},
4767 {"SetClientID", (PyCFunction
)Qd_SetClientID
, 1,
4768 "(short id) -> None"},
4769 {"ProtectEntry", (PyCFunction
)Qd_ProtectEntry
, 1,
4770 "(short index, Boolean protect) -> None"},
4771 {"ReserveEntry", (PyCFunction
)Qd_ReserveEntry
, 1,
4772 "(short index, Boolean reserve) -> None"},
4773 {"QDError", (PyCFunction
)Qd_QDError
, 1,
4774 "() -> (short _rv)"},
4775 {"CopyDeepMask", (PyCFunction
)Qd_CopyDeepMask
, 1,
4776 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
4777 {"GetPattern", (PyCFunction
)Qd_GetPattern
, 1,
4778 "(short patternID) -> (PatHandle _rv)"},
4779 {"MacGetCursor", (PyCFunction
)Qd_MacGetCursor
, 1,
4780 "(short cursorID) -> (CursHandle _rv)"},
4781 {"GetPicture", (PyCFunction
)Qd_GetPicture
, 1,
4782 "(short pictureID) -> (PicHandle _rv)"},
4783 {"DeltaPoint", (PyCFunction
)Qd_DeltaPoint
, 1,
4784 "(Point ptA, Point ptB) -> (long _rv)"},
4785 {"ShieldCursor", (PyCFunction
)Qd_ShieldCursor
, 1,
4786 "(Rect shieldRect, Point offsetPt) -> None"},
4787 {"ScreenRes", (PyCFunction
)Qd_ScreenRes
, 1,
4788 "() -> (short scrnHRes, short scrnVRes)"},
4789 {"GetIndPattern", (PyCFunction
)Qd_GetIndPattern
, 1,
4790 "(short patternListID, short index) -> (Pattern thePat)"},
4791 {"SlopeFromAngle", (PyCFunction
)Qd_SlopeFromAngle
, 1,
4792 "(short angle) -> (Fixed _rv)"},
4793 {"AngleFromSlope", (PyCFunction
)Qd_AngleFromSlope
, 1,
4794 "(Fixed slope) -> (short _rv)"},
4795 {"TextFont", (PyCFunction
)Qd_TextFont
, 1,
4796 "(short font) -> None"},
4797 {"TextFace", (PyCFunction
)Qd_TextFace
, 1,
4798 "(StyleParameter face) -> None"},
4799 {"TextMode", (PyCFunction
)Qd_TextMode
, 1,
4800 "(short mode) -> None"},
4801 {"TextSize", (PyCFunction
)Qd_TextSize
, 1,
4802 "(short size) -> None"},
4803 {"SpaceExtra", (PyCFunction
)Qd_SpaceExtra
, 1,
4804 "(Fixed extra) -> None"},
4805 {"DrawChar", (PyCFunction
)Qd_DrawChar
, 1,
4806 "(CharParameter ch) -> None"},
4807 {"DrawString", (PyCFunction
)Qd_DrawString
, 1,
4808 "(Str255 s) -> None"},
4809 {"MacDrawText", (PyCFunction
)Qd_MacDrawText
, 1,
4810 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
4811 {"CharWidth", (PyCFunction
)Qd_CharWidth
, 1,
4812 "(CharParameter ch) -> (short _rv)"},
4813 {"StringWidth", (PyCFunction
)Qd_StringWidth
, 1,
4814 "(Str255 s) -> (short _rv)"},
4815 {"TextWidth", (PyCFunction
)Qd_TextWidth
, 1,
4816 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
4817 {"GetFontInfo", (PyCFunction
)Qd_GetFontInfo
, 1,
4818 "() -> (FontInfo info)"},
4819 {"CharExtra", (PyCFunction
)Qd_CharExtra
, 1,
4820 "(Fixed extra) -> None"},
4821 {"SetPort", (PyCFunction
)Qd_SetPort
, 1,
4822 "(GrafPtr thePort) -> None"},
4823 {"GetCursor", (PyCFunction
)Qd_GetCursor
, 1,
4824 "(short cursorID) -> (CursHandle _rv)"},
4825 {"SetCursor", (PyCFunction
)Qd_SetCursor
, 1,
4826 "(Cursor crsr) -> None"},
4827 {"ShowCursor", (PyCFunction
)Qd_ShowCursor
, 1,
4829 {"LineTo", (PyCFunction
)Qd_LineTo
, 1,
4830 "(short h, short v) -> None"},
4831 {"SetRect", (PyCFunction
)Qd_SetRect
, 1,
4832 "(short left, short top, short right, short bottom) -> (Rect r)"},
4833 {"OffsetRect", (PyCFunction
)Qd_OffsetRect
, 1,
4834 "(Rect r, short dh, short dv) -> (Rect r)"},
4835 {"InsetRect", (PyCFunction
)Qd_InsetRect
, 1,
4836 "(Rect r, short dh, short dv) -> (Rect r)"},
4837 {"UnionRect", (PyCFunction
)Qd_UnionRect
, 1,
4838 "(Rect src1, Rect src2) -> (Rect dstRect)"},
4839 {"EqualRect", (PyCFunction
)Qd_EqualRect
, 1,
4840 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
4841 {"FrameRect", (PyCFunction
)Qd_FrameRect
, 1,
4842 "(Rect r) -> None"},
4843 {"InvertRect", (PyCFunction
)Qd_InvertRect
, 1,
4844 "(Rect r) -> None"},
4845 {"FillRect", (PyCFunction
)Qd_FillRect
, 1,
4846 "(Rect r, Pattern pat) -> None"},
4847 {"CopyRgn", (PyCFunction
)Qd_CopyRgn
, 1,
4848 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
4849 {"SetRectRgn", (PyCFunction
)Qd_SetRectRgn
, 1,
4850 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
4851 {"OffsetRgn", (PyCFunction
)Qd_OffsetRgn
, 1,
4852 "(RgnHandle rgn, short dh, short dv) -> None"},
4853 {"UnionRgn", (PyCFunction
)Qd_UnionRgn
, 1,
4854 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4855 {"XorRgn", (PyCFunction
)Qd_XorRgn
, 1,
4856 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
4857 {"EqualRgn", (PyCFunction
)Qd_EqualRgn
, 1,
4858 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
4859 {"FrameRgn", (PyCFunction
)Qd_FrameRgn
, 1,
4860 "(RgnHandle rgn) -> None"},
4861 {"PaintRgn", (PyCFunction
)Qd_PaintRgn
, 1,
4862 "(RgnHandle rgn) -> None"},
4863 {"InvertRgn", (PyCFunction
)Qd_InvertRgn
, 1,
4864 "(RgnHandle rgn) -> None"},
4865 {"FillRgn", (PyCFunction
)Qd_FillRgn
, 1,
4866 "(RgnHandle rgn, Pattern pat) -> None"},
4867 {"GetPixel", (PyCFunction
)Qd_GetPixel
, 1,
4868 "(short h, short v) -> (Boolean _rv)"},
4869 {"PtInRect", (PyCFunction
)Qd_PtInRect
, 1,
4870 "(Point pt, Rect r) -> (Boolean _rv)"},
4871 {"DrawText", (PyCFunction
)Qd_DrawText
, 1,
4872 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
4873 {"BitMap", (PyCFunction
)Qd_BitMap
, 1,
4874 "Take (string, int, Rect) argument and create BitMap"},
4875 {"RawBitMap", (PyCFunction
)Qd_RawBitMap
, 1,
4876 "Take string BitMap and turn into BitMap object"},
4891 m
= Py_InitModule("Qd", Qd_methods
);
4892 d
= PyModule_GetDict(m
);
4893 Qd_Error
= PyMac_GetOSErrException();
4894 if (Qd_Error
== NULL
||
4895 PyDict_SetItemString(d
, "Error", Qd_Error
) != 0)
4896 Py_FatalError("can't initialize Qd.Error");
4897 GrafPort_Type
.ob_type
= &PyType_Type
;
4898 Py_INCREF(&GrafPort_Type
);
4899 if (PyDict_SetItemString(d
, "GrafPortType", (PyObject
*)&GrafPort_Type
) != 0)
4900 Py_FatalError("can't initialize GrafPortType");
4901 BitMap_Type
.ob_type
= &PyType_Type
;
4902 Py_INCREF(&BitMap_Type
);
4903 if (PyDict_SetItemString(d
, "BitMapType", (PyObject
*)&BitMap_Type
) != 0)
4904 Py_FatalError("can't initialize BitMapType");
4905 QDGlobalsAccess_Type
.ob_type
= &PyType_Type
;
4906 Py_INCREF(&QDGlobalsAccess_Type
);
4907 if (PyDict_SetItemString(d
, "QDGlobalsAccessType", (PyObject
*)&QDGlobalsAccess_Type
) != 0)
4908 Py_FatalError("can't initialize QDGlobalsAccessType");
4914 if (o
== NULL
|| PyDict_SetItemString(d
, "qd", o
) != 0)
4915 Py_FatalError("can't initialize Qd.qd");
4921 /* ========================= End module Qd ========================== */