2 /* =========================== Module _Qd =========================== */
9 #include "pywintoolbox.h"
12 #include "pymactoolbox.h"
15 /* Macro to test whether a weak-loaded CFM function exists */
16 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
17 PyErr_SetString(PyExc_NotImplementedError, \
18 "Not available in this shared library/OS version"); \
23 #ifdef WITHOUT_FRAMEWORKS
24 #include <QuickDraw.h>
26 #include <Carbon/Carbon.h>
29 #ifdef USE_TOOLBOX_OBJECT_GLUE
30 extern PyObject
*_GrafObj_New(GrafPtr
);
31 extern int _GrafObj_Convert(PyObject
*, GrafPtr
*);
32 extern PyObject
*_BMObj_New(BitMapPtr
);
33 extern int _BMObj_Convert(PyObject
*, BitMapPtr
*);
34 extern PyObject
*_QdRGB_New(RGBColorPtr
);
35 extern int _QdRGB_Convert(PyObject
*, RGBColorPtr
);
37 #define GrafObj_New _GrafObj_New
38 #define GrafObj_Convert _GrafObj_Convert
39 #define BMObj_New _BMObj_New
40 #define BMObj_Convert _BMObj_Convert
41 #define QdRGB_New _QdRGB_New
42 #define QdRGB_Convert _QdRGB_Convert
45 #if !ACCESSOR_CALLS_ARE_FUNCTIONS
46 #define GetPortBitMapForCopyBits(port) ((const struct BitMap *)&((GrafPort *)(port))->portBits)
47 #define GetPortPixMap(port) (((CGrafPtr)(port))->portPixMap)
48 #define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
49 #define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
50 #define GetPortBackColor(port, color) (*(color) = (port)->rgbBkColor, (color))
51 #define GetPortOpColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbOpColor, (color))
52 #define GetPortHiliteColor(port, color) (*(color) = (*(GVarHandle)((port)->grafVars))->rgbHiliteColor, (color))
53 #define GetPortTextFont(port) ((port)->txFont)
54 #define GetPortTextFace(port) ((port)->txFace)
55 #define GetPortTextMode(port) ((port)->txMode)
56 #define GetPortTextSize(port) ((port)->txSize)
57 #define GetPortChExtra(port) ((port)->chExtra)
58 #define GetPortFracHPenLocation(port) ((port)->pnLocHFrac)
59 #define GetPortSpExtra(port) ((port)->spExtra)
60 #define GetPortPenVisibility(port) ((port)->pnVis)
61 #define GetPortVisibleRegion(port, rgn) ((rgn) = (port)->visRgn, (rgn))
62 #define GetPortClipRegion(port, rgn) ((rgn) = (port)->clipRgn, (rgn))
63 #define GetPortBackPixPat(port, pat) ((pat) = (port)->bkPixPat, (pat))
64 #define GetPortPenPixPat(port, pat) ((pat) = (port)->pnPixPat, (pat))
65 #define GetPortFillPixPat(port, pat) ((pat) = (port)->fillPixPat, (pat))
66 #define GetPortPenSize(port, pensize) (*(pensize) = (port)->pnSize, (pensize))
67 #define GetPortPenMode(port) ((port)->pnMode)
68 #define GetPortPenLocation(port, location) ((*location) = (port)->pnLoc, (location))
69 #define IsPortRegionBeingDefined(port) (!!((port)->rgnSave))
70 #define IsPortPictureBeingDefined(port) (!!((port)->picSave))
71 /* #define IsPortOffscreen(port) */
72 /* #define IsPortColor(port) */
74 #define SetPortBounds(port, bounds) ((port)->portRect = *(bounds))
75 #define SetPortOpColor(port, color) ((*(GVarHandle)((port)->grafVars))->rgbOpColor = *(color))
76 #define SetPortVisibleRegion(port, rgn) ((port)->visRgn = (rgn))
77 #define SetPortClipRegion(port, rgn) ((port)->clipRgn = (rgn))
78 #define SetPortBackPixPat(port, pat) ((port)->bkPixPat = (pat))
79 #define SetPortPenPixPat(port, pat) ((port)->pnPixPat = (pat))
80 #define SetPortFillPixPat(port, pat) ((port)->fillPixPat = (pat))
81 #define SetPortPenSize(port, pensize) ((port)->pnSize = (pensize))
82 #define SetPortPenMode(port, mode) ((port)->pnMode = (mode))
83 #define SetPortFracHPenLocation(port, frac) ((port)->pnLocHFrac = (frac))
86 #define GetPixBounds(pixmap, rect) (*(rect) = (*(pixmap))->bounds, (rect))
87 #define GetPixDepth(pixmap) ((*(pixmap))->pixelSize)
90 #define GetRegionBounds(rgn, rect) (*(rect) = (*(rgn))->rgnBBox, (rect))
93 #define GetQDGlobalsRandomSeed() (qd.randSeed)
94 #define GetQDGlobalsScreenBits(bits) (*(bits) = qd.screenBits, (bits))
95 #define GetQDGlobalsArrow(crsr) (*(crsr) = qd.arrow, (crsr))
96 #define GetQDGlobalsDarkGray(pat) (*(pat) = qd.dkGray, (pat))
97 #define GetQDGlobalsLightGray(pat) (*(pat) = qd.ltGray, (pat))
98 #define GetQDGlobalsGray(pat) (*(pat) = qd.gray, (pat))
99 #define GetQDGlobalsBlack(pat) (*(pat) = qd.black, (pat))
100 #define GetQDGlobalsWhite(pat) (*(pat) = qd.white, (pat))
101 #define GetQDGlobalsThePort() ((CGrafPtr)qd.thePort)
103 #define SetQDGlobalsRandomSeed(seed) (qd.randSeed = (seed))
104 #define SetQDGlobalsArrow(crsr) (qd.arrow = *(crsr))
106 #endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
108 #if !TARGET_API_MAC_CARBON
109 #define QDFlushPortBuffer(port, rgn) /* pass */
110 #define QDIsPortBufferDirty(port) 0
111 #define QDIsPortBuffered(port) 0
112 #endif /* !TARGET_API_MAC_CARBON */
114 static PyObject
*BMObj_NewCopied(BitMapPtr
);
117 ** Parse/generate RGB records
119 PyObject
*QdRGB_New(RGBColorPtr itself
)
122 return Py_BuildValue("lll", (long)itself
->red
, (long)itself
->green
, (long)itself
->blue
);
125 int QdRGB_Convert(PyObject
*v
, RGBColorPtr p_itself
)
127 long red
, green
, blue
;
129 if( !PyArg_ParseTuple(v
, "lll", &red
, &green
, &blue
) )
131 p_itself
->red
= (unsigned short)red
;
132 p_itself
->green
= (unsigned short)green
;
133 p_itself
->blue
= (unsigned short)blue
;
138 ** Generate FontInfo records
141 PyObject
*QdFI_New(FontInfo
*itself
)
144 return Py_BuildValue("hhhh", itself
->ascent
, itself
->descent
,
145 itself
->widMax
, itself
->leading
);
148 static PyObject
*Qd_Error
;
150 /* ---------------------- Object type GrafPort ---------------------- */
152 PyTypeObject GrafPort_Type
;
154 #define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type)
156 typedef struct GrafPortObject
{
161 PyObject
*GrafObj_New(GrafPtr itself
)
164 if (itself
== NULL
) return PyMac_Error(resNotFound
);
165 it
= PyObject_NEW(GrafPortObject
, &GrafPort_Type
);
166 if (it
== NULL
) return NULL
;
167 it
->ob_itself
= itself
;
168 return (PyObject
*)it
;
170 int GrafObj_Convert(PyObject
*v
, GrafPtr
*p_itself
)
175 if (WinObj_Convert(v
, &win
) && v
) {
176 *p_itself
= (GrafPtr
)GetWindowPort(win
);
182 if (DlgObj_Check(v
)) {
183 DialogRef dlg
= (DialogRef
)((GrafPortObject
*)v
)->ob_itself
;
184 *p_itself
= (GrafPtr
)GetWindowPort(GetDialogWindow(dlg
));
187 if (WinObj_Check(v
)) {
188 WindowRef win
= (WindowRef
)((GrafPortObject
*)v
)->ob_itself
;
189 *p_itself
= (GrafPtr
)GetWindowPort(win
);
193 if (!GrafObj_Check(v
))
195 PyErr_SetString(PyExc_TypeError
, "GrafPort required");
198 *p_itself
= ((GrafPortObject
*)v
)->ob_itself
;
202 static void GrafObj_dealloc(GrafPortObject
*self
)
204 /* Cleanup of self->ob_itself goes here */
208 static PyMethodDef GrafObj_methods
[] = {
212 PyMethodChain GrafObj_chain
= { GrafObj_methods
, NULL
};
214 static PyObject
*GrafObj_getattr(GrafPortObject
*self
, char *name
)
216 #if !ACCESSOR_CALLS_ARE_FUNCTIONS
218 { CGrafPtr itself_color
= (CGrafPtr
)self
->ob_itself
;
220 if ( strcmp(name
, "data") == 0 )
221 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(GrafPort
));
223 if ( (itself_color
->portVersion
&0xc000) == 0xc000 ) {
224 /* Color-only attributes */
226 if ( strcmp(name
, "portBits") == 0 )
227 /* XXXX Do we need HLock() stuff here?? */
228 return BMObj_New((BitMapPtr
)*itself_color
->portPixMap
);
229 if ( strcmp(name
, "grafVars") == 0 )
230 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->visRgn
);
231 if ( strcmp(name
, "chExtra") == 0 )
232 return Py_BuildValue("h", itself_color
->chExtra
);
233 if ( strcmp(name
, "pnLocHFrac") == 0 )
234 return Py_BuildValue("h", itself_color
->pnLocHFrac
);
235 if ( strcmp(name
, "bkPixPat") == 0 )
236 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->bkPixPat
);
237 if ( strcmp(name
, "rgbFgColor") == 0 )
238 return Py_BuildValue("O&", QdRGB_New
, &itself_color
->rgbFgColor
);
239 if ( strcmp(name
, "rgbBkColor") == 0 )
240 return Py_BuildValue("O&", QdRGB_New
, &itself_color
->rgbBkColor
);
241 if ( strcmp(name
, "pnPixPat") == 0 )
242 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->pnPixPat
);
243 if ( strcmp(name
, "fillPixPat") == 0 )
244 return Py_BuildValue("O&", ResObj_New
, (Handle
)itself_color
->fillPixPat
);
246 /* Mono-only attributes */
247 if ( strcmp(name
, "portBits") == 0 )
248 return BMObj_New(&self
->ob_itself
->portBits
);
249 if ( strcmp(name
, "bkPat") == 0 )
250 return Py_BuildValue("s#", (char *)&self
->ob_itself
->bkPat
, sizeof(Pattern
));
251 if ( strcmp(name
, "fillPat") == 0 )
252 return Py_BuildValue("s#", (char *)&self
->ob_itself
->fillPat
, sizeof(Pattern
));
253 if ( strcmp(name
, "pnPat") == 0 )
254 return Py_BuildValue("s#", (char *)&self
->ob_itself
->pnPat
, sizeof(Pattern
));
257 ** Accessible for both color/mono windows.
258 ** portVersion is really color-only, but we put it here
261 if ( strcmp(name
, "portVersion") == 0 )
262 return Py_BuildValue("h", itself_color
->portVersion
);
263 if ( strcmp(name
, "device") == 0 )
264 return PyInt_FromLong((long)self
->ob_itself
->device
);
265 if ( strcmp(name
, "portRect") == 0 )
266 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->portRect
);
267 if ( strcmp(name
, "visRgn") == 0 )
268 return Py_BuildValue("O&", ResObj_New
, (Handle
)self
->ob_itself
->visRgn
);
269 if ( strcmp(name
, "clipRgn") == 0 )
270 return Py_BuildValue("O&", ResObj_New
, (Handle
)self
->ob_itself
->clipRgn
);
271 if ( strcmp(name
, "pnLoc") == 0 )
272 return Py_BuildValue("O&", PyMac_BuildPoint
, self
->ob_itself
->pnLoc
);
273 if ( strcmp(name
, "pnSize") == 0 )
274 return Py_BuildValue("O&", PyMac_BuildPoint
, self
->ob_itself
->pnSize
);
275 if ( strcmp(name
, "pnMode") == 0 )
276 return Py_BuildValue("h", self
->ob_itself
->pnMode
);
277 if ( strcmp(name
, "pnVis") == 0 )
278 return Py_BuildValue("h", self
->ob_itself
->pnVis
);
279 if ( strcmp(name
, "txFont") == 0 )
280 return Py_BuildValue("h", self
->ob_itself
->txFont
);
281 if ( strcmp(name
, "txFace") == 0 )
282 return Py_BuildValue("h", (short)self
->ob_itself
->txFace
);
283 if ( strcmp(name
, "txMode") == 0 )
284 return Py_BuildValue("h", self
->ob_itself
->txMode
);
285 if ( strcmp(name
, "txSize") == 0 )
286 return Py_BuildValue("h", self
->ob_itself
->txSize
);
287 if ( strcmp(name
, "spExtra") == 0 )
288 return Py_BuildValue("O&", PyMac_BuildFixed
, self
->ob_itself
->spExtra
);
289 /* XXXX Add more, as needed */
290 /* This one is so we can compare grafports: */
291 if ( strcmp(name
, "_id") == 0 )
292 return Py_BuildValue("l", (long)self
->ob_itself
);
296 { CGrafPtr itself_color
= (CGrafPtr
)self
->ob_itself
;
297 if ( strcmp(name
, "portBits") == 0 )
298 return BMObj_New((BitMapPtr
)GetPortBitMapForCopyBits(itself_color
));
299 if ( strcmp(name
, "chExtra") == 0 )
300 return Py_BuildValue("h", GetPortChExtra(itself_color
));
301 if ( strcmp(name
, "pnLocHFrac") == 0 )
302 return Py_BuildValue("h", GetPortFracHPenLocation(itself_color
));
303 if ( strcmp(name
, "bkPixPat") == 0 ) {
305 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortBackPixPat(itself_color
, h
));
307 if ( strcmp(name
, "rgbFgColor") == 0 ) {
309 return Py_BuildValue("O&", QdRGB_New
, GetPortForeColor(itself_color
, &c
));
311 if ( strcmp(name
, "rgbBkColor") == 0 ) {
313 return Py_BuildValue("O&", QdRGB_New
, GetPortBackColor(itself_color
, &c
));
315 if ( strcmp(name
, "pnPixPat") == 0 ) {
316 PixPatHandle h
=NewPixPat(); /* XXXX wrong dispose routine */
318 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortPenPixPat(itself_color
, h
));
320 if ( strcmp(name
, "fillPixPat") == 0 ) {
321 PixPatHandle h
=NewPixPat(); /* XXXX wrong dispose routine */
322 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortFillPixPat(itself_color
, h
));
324 if ( strcmp(name
, "portRect") == 0 ) {
326 return Py_BuildValue("O&", PyMac_BuildRect
, GetPortBounds(itself_color
, &r
));
328 if ( strcmp(name
, "visRgn") == 0 ) {
329 RgnHandle h
=NewRgn(); /* XXXX wrong dispose routine */
330 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortVisibleRegion(itself_color
, h
));
332 if ( strcmp(name
, "clipRgn") == 0 ) {
333 RgnHandle h
=NewRgn(); /* XXXX wrong dispose routine */
334 return Py_BuildValue("O&", ResObj_New
, (Handle
)GetPortClipRegion(itself_color
, h
));
336 if ( strcmp(name
, "pnLoc") == 0 ) {
338 return Py_BuildValue("O&", PyMac_BuildPoint
, *GetPortPenLocation(itself_color
, &p
));
340 if ( strcmp(name
, "pnSize") == 0 ) {
342 return Py_BuildValue("O&", PyMac_BuildPoint
, *GetPortPenSize(itself_color
, &p
));
344 if ( strcmp(name
, "pnMode") == 0 )
345 return Py_BuildValue("h", GetPortPenMode(itself_color
));
346 if ( strcmp(name
, "pnVis") == 0 )
347 return Py_BuildValue("h", GetPortPenVisibility(itself_color
));
348 if ( strcmp(name
, "txFont") == 0 )
349 return Py_BuildValue("h", GetPortTextFont(itself_color
));
350 if ( strcmp(name
, "txFace") == 0 )
351 return Py_BuildValue("h", (short)GetPortTextFace(itself_color
));
352 if ( strcmp(name
, "txMode") == 0 )
353 return Py_BuildValue("h", GetPortTextMode(itself_color
));
354 if ( strcmp(name
, "txSize") == 0 )
355 return Py_BuildValue("h", GetPortTextSize(itself_color
));
356 if ( strcmp(name
, "spExtra") == 0 )
357 return Py_BuildValue("O&", PyMac_BuildFixed
, GetPortSpExtra(itself_color
));
358 /* XXXX Add more, as needed */
359 /* This one is so we can compare grafports: */
360 if ( strcmp(name
, "_id") == 0 )
361 return Py_BuildValue("l", (long)self
->ob_itself
);
364 return Py_FindMethodInChain(&GrafObj_chain
, (PyObject
*)self
, name
);
367 #define GrafObj_setattr NULL
369 #define GrafObj_compare NULL
371 #define GrafObj_repr NULL
373 #define GrafObj_hash NULL
375 PyTypeObject GrafPort_Type
= {
376 PyObject_HEAD_INIT(NULL
)
378 "_Qd.GrafPort", /*tp_name*/
379 sizeof(GrafPortObject
), /*tp_basicsize*/
382 (destructor
) GrafObj_dealloc
, /*tp_dealloc*/
384 (getattrfunc
) GrafObj_getattr
, /*tp_getattr*/
385 (setattrfunc
) GrafObj_setattr
, /*tp_setattr*/
386 (cmpfunc
) GrafObj_compare
, /*tp_compare*/
387 (reprfunc
) GrafObj_repr
, /*tp_repr*/
388 (PyNumberMethods
*)0, /* tp_as_number */
389 (PySequenceMethods
*)0, /* tp_as_sequence */
390 (PyMappingMethods
*)0, /* tp_as_mapping */
391 (hashfunc
) GrafObj_hash
, /*tp_hash*/
394 /* -------------------- End object type GrafPort -------------------- */
397 /* ----------------------- Object type BitMap ----------------------- */
399 PyTypeObject BitMap_Type
;
401 #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type)
403 typedef struct BitMapObject
{
406 PyObject
*referred_object
;
407 BitMap
*referred_bitmap
;
410 PyObject
*BMObj_New(BitMapPtr itself
)
413 if (itself
== NULL
) return PyMac_Error(resNotFound
);
414 it
= PyObject_NEW(BitMapObject
, &BitMap_Type
);
415 if (it
== NULL
) return NULL
;
416 it
->ob_itself
= itself
;
417 it
->referred_object
= NULL
;
418 it
->referred_bitmap
= NULL
;
419 return (PyObject
*)it
;
421 int BMObj_Convert(PyObject
*v
, BitMapPtr
*p_itself
)
425 PyErr_SetString(PyExc_TypeError
, "BitMap required");
428 *p_itself
= ((BitMapObject
*)v
)->ob_itself
;
432 static void BMObj_dealloc(BitMapObject
*self
)
434 Py_XDECREF(self
->referred_object
);
435 if (self
->referred_bitmap
) free(self
->referred_bitmap
);
439 static PyObject
*BMObj_getdata(BitMapObject
*_self
, PyObject
*_args
)
441 PyObject
*_res
= NULL
;
446 if ( !PyArg_ParseTuple(_args
, "ii", &from
, &length
) )
448 cp
= _self
->ob_itself
->baseAddr
+from
;
449 _res
= PyString_FromStringAndSize(cp
, length
);
454 static PyObject
*BMObj_putdata(BitMapObject
*_self
, PyObject
*_args
)
456 PyObject
*_res
= NULL
;
461 if ( !PyArg_ParseTuple(_args
, "is#", &from
, &icp
, &length
) )
463 cp
= _self
->ob_itself
->baseAddr
+from
;
464 memcpy(cp
, icp
, length
);
471 static PyMethodDef BMObj_methods
[] = {
472 {"getdata", (PyCFunction
)BMObj_getdata
, 1,
473 PyDoc_STR("(int start, int size) -> string. Return bytes from the bitmap")},
474 {"putdata", (PyCFunction
)BMObj_putdata
, 1,
475 PyDoc_STR("(int start, string data). Store bytes into the bitmap")},
479 PyMethodChain BMObj_chain
= { BMObj_methods
, NULL
};
481 static PyObject
*BMObj_getattr(BitMapObject
*self
, char *name
)
483 if ( strcmp(name
, "baseAddr") == 0 )
484 return PyInt_FromLong((long)self
->ob_itself
->baseAddr
);
485 if ( strcmp(name
, "rowBytes") == 0 )
486 return PyInt_FromLong((long)self
->ob_itself
->rowBytes
);
487 if ( strcmp(name
, "bounds") == 0 )
488 return Py_BuildValue("O&", PyMac_BuildRect
, &self
->ob_itself
->bounds
);
489 /* XXXX Add more, as needed */
490 if ( strcmp(name
, "bitmap_data") == 0 )
491 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(BitMap
));
492 if ( strcmp(name
, "pixmap_data") == 0 )
493 return PyString_FromStringAndSize((char *)self
->ob_itself
, sizeof(PixMap
));
495 return Py_FindMethodInChain(&BMObj_chain
, (PyObject
*)self
, name
);
498 #define BMObj_setattr NULL
500 #define BMObj_compare NULL
502 #define BMObj_repr NULL
504 #define BMObj_hash NULL
506 PyTypeObject BitMap_Type
= {
507 PyObject_HEAD_INIT(NULL
)
509 "_Qd.BitMap", /*tp_name*/
510 sizeof(BitMapObject
), /*tp_basicsize*/
513 (destructor
) BMObj_dealloc
, /*tp_dealloc*/
515 (getattrfunc
) BMObj_getattr
, /*tp_getattr*/
516 (setattrfunc
) BMObj_setattr
, /*tp_setattr*/
517 (cmpfunc
) BMObj_compare
, /*tp_compare*/
518 (reprfunc
) BMObj_repr
, /*tp_repr*/
519 (PyNumberMethods
*)0, /* tp_as_number */
520 (PySequenceMethods
*)0, /* tp_as_sequence */
521 (PyMappingMethods
*)0, /* tp_as_mapping */
522 (hashfunc
) BMObj_hash
, /*tp_hash*/
525 /* --------------------- End object type BitMap --------------------- */
528 /* ------------------ Object type QDGlobalsAccess ------------------- */
530 static PyTypeObject QDGlobalsAccess_Type
;
532 #define QDGA_Check(x) ((x)->ob_type == &QDGlobalsAccess_Type)
534 typedef struct QDGlobalsAccessObject
{
536 } QDGlobalsAccessObject
;
538 static PyObject
*QDGA_New(void)
540 QDGlobalsAccessObject
*it
;
541 it
= PyObject_NEW(QDGlobalsAccessObject
, &QDGlobalsAccess_Type
);
542 if (it
== NULL
) return NULL
;
543 return (PyObject
*)it
;
546 static void QDGA_dealloc(QDGlobalsAccessObject
*self
)
551 static PyMethodDef QDGA_methods
[] = {
555 static PyMethodChain QDGA_chain
= { QDGA_methods
, NULL
};
557 static PyObject
*QDGA_getattr(QDGlobalsAccessObject
*self
, char *name
)
559 #if !ACCESSOR_CALLS_ARE_FUNCTIONS
561 if ( strcmp(name
, "arrow") == 0 )
562 return PyString_FromStringAndSize((char *)&qd
.arrow
, sizeof(qd
.arrow
));
563 if ( strcmp(name
, "black") == 0 )
564 return PyString_FromStringAndSize((char *)&qd
.black
, sizeof(qd
.black
));
565 if ( strcmp(name
, "white") == 0 )
566 return PyString_FromStringAndSize((char *)&qd
.white
, sizeof(qd
.white
));
567 if ( strcmp(name
, "gray") == 0 )
568 return PyString_FromStringAndSize((char *)&qd
.gray
, sizeof(qd
.gray
));
569 if ( strcmp(name
, "ltGray") == 0 )
570 return PyString_FromStringAndSize((char *)&qd
.ltGray
, sizeof(qd
.ltGray
));
571 if ( strcmp(name
, "dkGray") == 0 )
572 return PyString_FromStringAndSize((char *)&qd
.dkGray
, sizeof(qd
.dkGray
));
573 if ( strcmp(name
, "screenBits") == 0 )
574 return BMObj_New(&qd
.screenBits
);
575 if ( strcmp(name
, "thePort") == 0 )
576 return GrafObj_New(qd
.thePort
);
577 if ( strcmp(name
, "randSeed") == 0 )
578 return Py_BuildValue("l", &qd
.randSeed
);
582 if ( strcmp(name
, "arrow") == 0 ) {
584 GetQDGlobalsArrow(&rv
);
585 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
587 if ( strcmp(name
, "black") == 0 ) {
589 GetQDGlobalsBlack(&rv
);
590 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
592 if ( strcmp(name
, "white") == 0 ) {
594 GetQDGlobalsWhite(&rv
);
595 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
597 if ( strcmp(name
, "gray") == 0 ) {
599 GetQDGlobalsGray(&rv
);
600 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
602 if ( strcmp(name
, "ltGray") == 0 ) {
604 GetQDGlobalsLightGray(&rv
);
605 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
607 if ( strcmp(name
, "dkGray") == 0 ) {
609 GetQDGlobalsDarkGray(&rv
);
610 return PyString_FromStringAndSize((char *)&rv
, sizeof(rv
));
612 if ( strcmp(name
, "screenBits") == 0 ) {
614 GetQDGlobalsScreenBits(&rv
);
615 return BMObj_NewCopied(&rv
);
617 if ( strcmp(name
, "thePort") == 0 )
618 return GrafObj_New(GetQDGlobalsThePort());
619 if ( strcmp(name
, "randSeed") == 0 )
620 return Py_BuildValue("l", GetQDGlobalsRandomSeed());
623 return Py_FindMethodInChain(&QDGA_chain
, (PyObject
*)self
, name
);
626 #define QDGA_setattr NULL
628 #define QDGA_compare NULL
630 #define QDGA_repr NULL
632 #define QDGA_hash NULL
634 static PyTypeObject QDGlobalsAccess_Type
= {
635 PyObject_HEAD_INIT(NULL
)
637 "_Qd.QDGlobalsAccess", /*tp_name*/
638 sizeof(QDGlobalsAccessObject
), /*tp_basicsize*/
641 (destructor
) QDGA_dealloc
, /*tp_dealloc*/
643 (getattrfunc
) QDGA_getattr
, /*tp_getattr*/
644 (setattrfunc
) QDGA_setattr
, /*tp_setattr*/
645 (cmpfunc
) QDGA_compare
, /*tp_compare*/
646 (reprfunc
) QDGA_repr
, /*tp_repr*/
647 (PyNumberMethods
*)0, /* tp_as_number */
648 (PySequenceMethods
*)0, /* tp_as_sequence */
649 (PyMappingMethods
*)0, /* tp_as_mapping */
650 (hashfunc
) QDGA_hash
, /*tp_hash*/
653 /* ---------------- End object type QDGlobalsAccess ----------------- */
656 static PyObject
*Qd_MacSetPort(PyObject
*_self
, PyObject
*_args
)
658 PyObject
*_res
= NULL
;
661 PyMac_PRECHECK(MacSetPort
);
663 if (!PyArg_ParseTuple(_args
, "O&",
664 GrafObj_Convert
, &port
))
672 static PyObject
*Qd_GetPort(PyObject
*_self
, PyObject
*_args
)
674 PyObject
*_res
= NULL
;
677 PyMac_PRECHECK(GetPort
);
679 if (!PyArg_ParseTuple(_args
, ""))
682 _res
= Py_BuildValue("O&",
687 static PyObject
*Qd_GrafDevice(PyObject
*_self
, PyObject
*_args
)
689 PyObject
*_res
= NULL
;
692 PyMac_PRECHECK(GrafDevice
);
694 if (!PyArg_ParseTuple(_args
, "h",
703 static PyObject
*Qd_SetPortBits(PyObject
*_self
, PyObject
*_args
)
705 PyObject
*_res
= NULL
;
708 PyMac_PRECHECK(SetPortBits
);
710 if (!PyArg_ParseTuple(_args
, "O&",
719 static PyObject
*Qd_PortSize(PyObject
*_self
, PyObject
*_args
)
721 PyObject
*_res
= NULL
;
725 PyMac_PRECHECK(PortSize
);
727 if (!PyArg_ParseTuple(_args
, "hh",
738 static PyObject
*Qd_MovePortTo(PyObject
*_self
, PyObject
*_args
)
740 PyObject
*_res
= NULL
;
744 PyMac_PRECHECK(MovePortTo
);
746 if (!PyArg_ParseTuple(_args
, "hh",
750 MovePortTo(leftGlobal
,
757 static PyObject
*Qd_SetOrigin(PyObject
*_self
, PyObject
*_args
)
759 PyObject
*_res
= NULL
;
763 PyMac_PRECHECK(SetOrigin
);
765 if (!PyArg_ParseTuple(_args
, "hh",
776 static PyObject
*Qd_SetClip(PyObject
*_self
, PyObject
*_args
)
778 PyObject
*_res
= NULL
;
781 PyMac_PRECHECK(SetClip
);
783 if (!PyArg_ParseTuple(_args
, "O&",
784 ResObj_Convert
, &rgn
))
792 static PyObject
*Qd_GetClip(PyObject
*_self
, PyObject
*_args
)
794 PyObject
*_res
= NULL
;
797 PyMac_PRECHECK(GetClip
);
799 if (!PyArg_ParseTuple(_args
, "O&",
800 ResObj_Convert
, &rgn
))
808 static PyObject
*Qd_ClipRect(PyObject
*_self
, PyObject
*_args
)
810 PyObject
*_res
= NULL
;
813 PyMac_PRECHECK(ClipRect
);
815 if (!PyArg_ParseTuple(_args
, "O&",
824 static PyObject
*Qd_BackPat(PyObject
*_self
, PyObject
*_args
)
826 PyObject
*_res
= NULL
;
830 PyMac_PRECHECK(BackPat
);
832 if (!PyArg_ParseTuple(_args
, "s#",
833 (char **)&pat__in__
, &pat__in_len__
))
835 if (pat__in_len__
!= sizeof(Pattern
))
837 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
847 static PyObject
*Qd_InitCursor(PyObject
*_self
, PyObject
*_args
)
849 PyObject
*_res
= NULL
;
851 PyMac_PRECHECK(InitCursor
);
853 if (!PyArg_ParseTuple(_args
, ""))
861 static PyObject
*Qd_MacSetCursor(PyObject
*_self
, PyObject
*_args
)
863 PyObject
*_res
= NULL
;
867 PyMac_PRECHECK(MacSetCursor
);
869 if (!PyArg_ParseTuple(_args
, "s#",
870 (char **)&crsr__in__
, &crsr__in_len__
))
872 if (crsr__in_len__
!= sizeof(Cursor
))
874 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
877 MacSetCursor(crsr__in__
);
884 static PyObject
*Qd_HideCursor(PyObject
*_self
, PyObject
*_args
)
886 PyObject
*_res
= NULL
;
888 PyMac_PRECHECK(HideCursor
);
890 if (!PyArg_ParseTuple(_args
, ""))
898 static PyObject
*Qd_MacShowCursor(PyObject
*_self
, PyObject
*_args
)
900 PyObject
*_res
= NULL
;
901 #ifndef MacShowCursor
902 PyMac_PRECHECK(MacShowCursor
);
904 if (!PyArg_ParseTuple(_args
, ""))
912 static PyObject
*Qd_ObscureCursor(PyObject
*_self
, PyObject
*_args
)
914 PyObject
*_res
= NULL
;
915 #ifndef ObscureCursor
916 PyMac_PRECHECK(ObscureCursor
);
918 if (!PyArg_ParseTuple(_args
, ""))
926 static PyObject
*Qd_HidePen(PyObject
*_self
, PyObject
*_args
)
928 PyObject
*_res
= NULL
;
930 PyMac_PRECHECK(HidePen
);
932 if (!PyArg_ParseTuple(_args
, ""))
940 static PyObject
*Qd_ShowPen(PyObject
*_self
, PyObject
*_args
)
942 PyObject
*_res
= NULL
;
944 PyMac_PRECHECK(ShowPen
);
946 if (!PyArg_ParseTuple(_args
, ""))
954 static PyObject
*Qd_GetPen(PyObject
*_self
, PyObject
*_args
)
956 PyObject
*_res
= NULL
;
959 PyMac_PRECHECK(GetPen
);
961 if (!PyArg_ParseTuple(_args
, ""))
964 _res
= Py_BuildValue("O&",
965 PyMac_BuildPoint
, pt
);
969 static PyObject
*Qd_GetPenState(PyObject
*_self
, PyObject
*_args
)
971 PyObject
*_res
= NULL
;
972 PenState pnState__out__
;
974 PyMac_PRECHECK(GetPenState
);
976 if (!PyArg_ParseTuple(_args
, ""))
978 GetPenState(&pnState__out__
);
979 _res
= Py_BuildValue("s#",
980 (char *)&pnState__out__
, (int)sizeof(PenState
));
984 static PyObject
*Qd_SetPenState(PyObject
*_self
, PyObject
*_args
)
986 PyObject
*_res
= NULL
;
987 PenState
*pnState__in__
;
988 int pnState__in_len__
;
990 PyMac_PRECHECK(SetPenState
);
992 if (!PyArg_ParseTuple(_args
, "s#",
993 (char **)&pnState__in__
, &pnState__in_len__
))
995 if (pnState__in_len__
!= sizeof(PenState
))
997 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(PenState)");
998 goto pnState__error__
;
1000 SetPenState(pnState__in__
);
1007 static PyObject
*Qd_PenSize(PyObject
*_self
, PyObject
*_args
)
1009 PyObject
*_res
= NULL
;
1013 PyMac_PRECHECK(PenSize
);
1015 if (!PyArg_ParseTuple(_args
, "hh",
1026 static PyObject
*Qd_PenMode(PyObject
*_self
, PyObject
*_args
)
1028 PyObject
*_res
= NULL
;
1031 PyMac_PRECHECK(PenMode
);
1033 if (!PyArg_ParseTuple(_args
, "h",
1042 static PyObject
*Qd_PenPat(PyObject
*_self
, PyObject
*_args
)
1044 PyObject
*_res
= NULL
;
1048 PyMac_PRECHECK(PenPat
);
1050 if (!PyArg_ParseTuple(_args
, "s#",
1051 (char **)&pat__in__
, &pat__in_len__
))
1053 if (pat__in_len__
!= sizeof(Pattern
))
1055 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1065 static PyObject
*Qd_PenNormal(PyObject
*_self
, PyObject
*_args
)
1067 PyObject
*_res
= NULL
;
1069 PyMac_PRECHECK(PenNormal
);
1071 if (!PyArg_ParseTuple(_args
, ""))
1079 static PyObject
*Qd_MoveTo(PyObject
*_self
, PyObject
*_args
)
1081 PyObject
*_res
= NULL
;
1085 PyMac_PRECHECK(MoveTo
);
1087 if (!PyArg_ParseTuple(_args
, "hh",
1098 static PyObject
*Qd_Move(PyObject
*_self
, PyObject
*_args
)
1100 PyObject
*_res
= NULL
;
1104 PyMac_PRECHECK(Move
);
1106 if (!PyArg_ParseTuple(_args
, "hh",
1117 static PyObject
*Qd_MacLineTo(PyObject
*_self
, PyObject
*_args
)
1119 PyObject
*_res
= NULL
;
1123 PyMac_PRECHECK(MacLineTo
);
1125 if (!PyArg_ParseTuple(_args
, "hh",
1136 static PyObject
*Qd_Line(PyObject
*_self
, PyObject
*_args
)
1138 PyObject
*_res
= NULL
;
1142 PyMac_PRECHECK(Line
);
1144 if (!PyArg_ParseTuple(_args
, "hh",
1155 static PyObject
*Qd_ForeColor(PyObject
*_self
, PyObject
*_args
)
1157 PyObject
*_res
= NULL
;
1160 PyMac_PRECHECK(ForeColor
);
1162 if (!PyArg_ParseTuple(_args
, "l",
1171 static PyObject
*Qd_BackColor(PyObject
*_self
, PyObject
*_args
)
1173 PyObject
*_res
= NULL
;
1176 PyMac_PRECHECK(BackColor
);
1178 if (!PyArg_ParseTuple(_args
, "l",
1187 static PyObject
*Qd_ColorBit(PyObject
*_self
, PyObject
*_args
)
1189 PyObject
*_res
= NULL
;
1192 PyMac_PRECHECK(ColorBit
);
1194 if (!PyArg_ParseTuple(_args
, "h",
1203 static PyObject
*Qd_MacSetRect(PyObject
*_self
, PyObject
*_args
)
1205 PyObject
*_res
= NULL
;
1212 PyMac_PRECHECK(MacSetRect
);
1214 if (!PyArg_ParseTuple(_args
, "hhhh",
1225 _res
= Py_BuildValue("O&",
1226 PyMac_BuildRect
, &r
);
1230 static PyObject
*Qd_MacOffsetRect(PyObject
*_self
, PyObject
*_args
)
1232 PyObject
*_res
= NULL
;
1236 #ifndef MacOffsetRect
1237 PyMac_PRECHECK(MacOffsetRect
);
1239 if (!PyArg_ParseTuple(_args
, "O&hh",
1247 _res
= Py_BuildValue("O&",
1248 PyMac_BuildRect
, &r
);
1252 static PyObject
*Qd_MacInsetRect(PyObject
*_self
, PyObject
*_args
)
1254 PyObject
*_res
= NULL
;
1258 #ifndef MacInsetRect
1259 PyMac_PRECHECK(MacInsetRect
);
1261 if (!PyArg_ParseTuple(_args
, "O&hh",
1269 _res
= Py_BuildValue("O&",
1270 PyMac_BuildRect
, &r
);
1274 static PyObject
*Qd_SectRect(PyObject
*_self
, PyObject
*_args
)
1276 PyObject
*_res
= NULL
;
1282 PyMac_PRECHECK(SectRect
);
1284 if (!PyArg_ParseTuple(_args
, "O&O&",
1285 PyMac_GetRect
, &src1
,
1286 PyMac_GetRect
, &src2
))
1288 _rv
= SectRect(&src1
,
1291 _res
= Py_BuildValue("bO&",
1293 PyMac_BuildRect
, &dstRect
);
1297 static PyObject
*Qd_MacUnionRect(PyObject
*_self
, PyObject
*_args
)
1299 PyObject
*_res
= NULL
;
1303 #ifndef MacUnionRect
1304 PyMac_PRECHECK(MacUnionRect
);
1306 if (!PyArg_ParseTuple(_args
, "O&O&",
1307 PyMac_GetRect
, &src1
,
1308 PyMac_GetRect
, &src2
))
1313 _res
= Py_BuildValue("O&",
1314 PyMac_BuildRect
, &dstRect
);
1318 static PyObject
*Qd_MacEqualRect(PyObject
*_self
, PyObject
*_args
)
1320 PyObject
*_res
= NULL
;
1324 #ifndef MacEqualRect
1325 PyMac_PRECHECK(MacEqualRect
);
1327 if (!PyArg_ParseTuple(_args
, "O&O&",
1328 PyMac_GetRect
, &rect1
,
1329 PyMac_GetRect
, &rect2
))
1331 _rv
= MacEqualRect(&rect1
,
1333 _res
= Py_BuildValue("b",
1338 static PyObject
*Qd_EmptyRect(PyObject
*_self
, PyObject
*_args
)
1340 PyObject
*_res
= NULL
;
1344 PyMac_PRECHECK(EmptyRect
);
1346 if (!PyArg_ParseTuple(_args
, "O&",
1349 _rv
= EmptyRect(&r
);
1350 _res
= Py_BuildValue("b",
1355 static PyObject
*Qd_MacFrameRect(PyObject
*_self
, PyObject
*_args
)
1357 PyObject
*_res
= NULL
;
1359 #ifndef MacFrameRect
1360 PyMac_PRECHECK(MacFrameRect
);
1362 if (!PyArg_ParseTuple(_args
, "O&",
1371 static PyObject
*Qd_PaintRect(PyObject
*_self
, PyObject
*_args
)
1373 PyObject
*_res
= NULL
;
1376 PyMac_PRECHECK(PaintRect
);
1378 if (!PyArg_ParseTuple(_args
, "O&",
1387 static PyObject
*Qd_EraseRect(PyObject
*_self
, PyObject
*_args
)
1389 PyObject
*_res
= NULL
;
1392 PyMac_PRECHECK(EraseRect
);
1394 if (!PyArg_ParseTuple(_args
, "O&",
1403 static PyObject
*Qd_MacInvertRect(PyObject
*_self
, PyObject
*_args
)
1405 PyObject
*_res
= NULL
;
1407 #ifndef MacInvertRect
1408 PyMac_PRECHECK(MacInvertRect
);
1410 if (!PyArg_ParseTuple(_args
, "O&",
1419 static PyObject
*Qd_MacFillRect(PyObject
*_self
, PyObject
*_args
)
1421 PyObject
*_res
= NULL
;
1426 PyMac_PRECHECK(MacFillRect
);
1428 if (!PyArg_ParseTuple(_args
, "O&s#",
1430 (char **)&pat__in__
, &pat__in_len__
))
1432 if (pat__in_len__
!= sizeof(Pattern
))
1434 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1445 static PyObject
*Qd_FrameOval(PyObject
*_self
, PyObject
*_args
)
1447 PyObject
*_res
= NULL
;
1450 PyMac_PRECHECK(FrameOval
);
1452 if (!PyArg_ParseTuple(_args
, "O&",
1461 static PyObject
*Qd_PaintOval(PyObject
*_self
, PyObject
*_args
)
1463 PyObject
*_res
= NULL
;
1466 PyMac_PRECHECK(PaintOval
);
1468 if (!PyArg_ParseTuple(_args
, "O&",
1477 static PyObject
*Qd_EraseOval(PyObject
*_self
, PyObject
*_args
)
1479 PyObject
*_res
= NULL
;
1482 PyMac_PRECHECK(EraseOval
);
1484 if (!PyArg_ParseTuple(_args
, "O&",
1493 static PyObject
*Qd_InvertOval(PyObject
*_self
, PyObject
*_args
)
1495 PyObject
*_res
= NULL
;
1498 PyMac_PRECHECK(InvertOval
);
1500 if (!PyArg_ParseTuple(_args
, "O&",
1509 static PyObject
*Qd_FillOval(PyObject
*_self
, PyObject
*_args
)
1511 PyObject
*_res
= NULL
;
1516 PyMac_PRECHECK(FillOval
);
1518 if (!PyArg_ParseTuple(_args
, "O&s#",
1520 (char **)&pat__in__
, &pat__in_len__
))
1522 if (pat__in_len__
!= sizeof(Pattern
))
1524 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1535 static PyObject
*Qd_FrameRoundRect(PyObject
*_self
, PyObject
*_args
)
1537 PyObject
*_res
= NULL
;
1541 #ifndef FrameRoundRect
1542 PyMac_PRECHECK(FrameRoundRect
);
1544 if (!PyArg_ParseTuple(_args
, "O&hh",
1557 static PyObject
*Qd_PaintRoundRect(PyObject
*_self
, PyObject
*_args
)
1559 PyObject
*_res
= NULL
;
1563 #ifndef PaintRoundRect
1564 PyMac_PRECHECK(PaintRoundRect
);
1566 if (!PyArg_ParseTuple(_args
, "O&hh",
1579 static PyObject
*Qd_EraseRoundRect(PyObject
*_self
, PyObject
*_args
)
1581 PyObject
*_res
= NULL
;
1585 #ifndef EraseRoundRect
1586 PyMac_PRECHECK(EraseRoundRect
);
1588 if (!PyArg_ParseTuple(_args
, "O&hh",
1601 static PyObject
*Qd_InvertRoundRect(PyObject
*_self
, PyObject
*_args
)
1603 PyObject
*_res
= NULL
;
1607 #ifndef InvertRoundRect
1608 PyMac_PRECHECK(InvertRoundRect
);
1610 if (!PyArg_ParseTuple(_args
, "O&hh",
1623 static PyObject
*Qd_FillRoundRect(PyObject
*_self
, PyObject
*_args
)
1625 PyObject
*_res
= NULL
;
1631 #ifndef FillRoundRect
1632 PyMac_PRECHECK(FillRoundRect
);
1634 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1638 (char **)&pat__in__
, &pat__in_len__
))
1640 if (pat__in_len__
!= sizeof(Pattern
))
1642 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1655 static PyObject
*Qd_FrameArc(PyObject
*_self
, PyObject
*_args
)
1657 PyObject
*_res
= NULL
;
1662 PyMac_PRECHECK(FrameArc
);
1664 if (!PyArg_ParseTuple(_args
, "O&hh",
1677 static PyObject
*Qd_PaintArc(PyObject
*_self
, PyObject
*_args
)
1679 PyObject
*_res
= NULL
;
1684 PyMac_PRECHECK(PaintArc
);
1686 if (!PyArg_ParseTuple(_args
, "O&hh",
1699 static PyObject
*Qd_EraseArc(PyObject
*_self
, PyObject
*_args
)
1701 PyObject
*_res
= NULL
;
1706 PyMac_PRECHECK(EraseArc
);
1708 if (!PyArg_ParseTuple(_args
, "O&hh",
1721 static PyObject
*Qd_InvertArc(PyObject
*_self
, PyObject
*_args
)
1723 PyObject
*_res
= NULL
;
1728 PyMac_PRECHECK(InvertArc
);
1730 if (!PyArg_ParseTuple(_args
, "O&hh",
1743 static PyObject
*Qd_FillArc(PyObject
*_self
, PyObject
*_args
)
1745 PyObject
*_res
= NULL
;
1752 PyMac_PRECHECK(FillArc
);
1754 if (!PyArg_ParseTuple(_args
, "O&hhs#",
1758 (char **)&pat__in__
, &pat__in_len__
))
1760 if (pat__in_len__
!= sizeof(Pattern
))
1762 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
1775 static PyObject
*Qd_NewRgn(PyObject
*_self
, PyObject
*_args
)
1777 PyObject
*_res
= NULL
;
1780 PyMac_PRECHECK(NewRgn
);
1782 if (!PyArg_ParseTuple(_args
, ""))
1785 _res
= Py_BuildValue("O&",
1790 static PyObject
*Qd_OpenRgn(PyObject
*_self
, PyObject
*_args
)
1792 PyObject
*_res
= NULL
;
1794 PyMac_PRECHECK(OpenRgn
);
1796 if (!PyArg_ParseTuple(_args
, ""))
1804 static PyObject
*Qd_CloseRgn(PyObject
*_self
, PyObject
*_args
)
1806 PyObject
*_res
= NULL
;
1809 PyMac_PRECHECK(CloseRgn
);
1811 if (!PyArg_ParseTuple(_args
, "O&",
1812 ResObj_Convert
, &dstRgn
))
1820 static PyObject
*Qd_BitMapToRegion(PyObject
*_self
, PyObject
*_args
)
1822 PyObject
*_res
= NULL
;
1826 #ifndef BitMapToRegion
1827 PyMac_PRECHECK(BitMapToRegion
);
1829 if (!PyArg_ParseTuple(_args
, "O&O&",
1830 ResObj_Convert
, ®ion
,
1831 BMObj_Convert
, &bMap
))
1833 _err
= BitMapToRegion(region
,
1835 if (_err
!= noErr
) return PyMac_Error(_err
);
1841 #if TARGET_API_MAC_CARBON
1843 static PyObject
*Qd_RgnToHandle(PyObject
*_self
, PyObject
*_args
)
1845 PyObject
*_res
= NULL
;
1847 Handle flattenedRgnDataHdl
;
1849 PyMac_PRECHECK(RgnToHandle
);
1851 if (!PyArg_ParseTuple(_args
, "O&O&",
1852 ResObj_Convert
, ®ion
,
1853 ResObj_Convert
, &flattenedRgnDataHdl
))
1856 flattenedRgnDataHdl
);
1863 static PyObject
*Qd_DisposeRgn(PyObject
*_self
, PyObject
*_args
)
1865 PyObject
*_res
= NULL
;
1868 PyMac_PRECHECK(DisposeRgn
);
1870 if (!PyArg_ParseTuple(_args
, "O&",
1871 ResObj_Convert
, &rgn
))
1879 static PyObject
*Qd_MacCopyRgn(PyObject
*_self
, PyObject
*_args
)
1881 PyObject
*_res
= NULL
;
1885 PyMac_PRECHECK(MacCopyRgn
);
1887 if (!PyArg_ParseTuple(_args
, "O&O&",
1888 ResObj_Convert
, &srcRgn
,
1889 ResObj_Convert
, &dstRgn
))
1898 static PyObject
*Qd_SetEmptyRgn(PyObject
*_self
, PyObject
*_args
)
1900 PyObject
*_res
= NULL
;
1903 PyMac_PRECHECK(SetEmptyRgn
);
1905 if (!PyArg_ParseTuple(_args
, "O&",
1906 ResObj_Convert
, &rgn
))
1914 static PyObject
*Qd_MacSetRectRgn(PyObject
*_self
, PyObject
*_args
)
1916 PyObject
*_res
= NULL
;
1922 #ifndef MacSetRectRgn
1923 PyMac_PRECHECK(MacSetRectRgn
);
1925 if (!PyArg_ParseTuple(_args
, "O&hhhh",
1926 ResObj_Convert
, &rgn
,
1942 static PyObject
*Qd_RectRgn(PyObject
*_self
, PyObject
*_args
)
1944 PyObject
*_res
= NULL
;
1948 PyMac_PRECHECK(RectRgn
);
1950 if (!PyArg_ParseTuple(_args
, "O&O&",
1951 ResObj_Convert
, &rgn
,
1961 static PyObject
*Qd_MacOffsetRgn(PyObject
*_self
, PyObject
*_args
)
1963 PyObject
*_res
= NULL
;
1967 #ifndef MacOffsetRgn
1968 PyMac_PRECHECK(MacOffsetRgn
);
1970 if (!PyArg_ParseTuple(_args
, "O&hh",
1971 ResObj_Convert
, &rgn
,
1983 static PyObject
*Qd_InsetRgn(PyObject
*_self
, PyObject
*_args
)
1985 PyObject
*_res
= NULL
;
1990 PyMac_PRECHECK(InsetRgn
);
1992 if (!PyArg_ParseTuple(_args
, "O&hh",
1993 ResObj_Convert
, &rgn
,
2005 static PyObject
*Qd_SectRgn(PyObject
*_self
, PyObject
*_args
)
2007 PyObject
*_res
= NULL
;
2012 PyMac_PRECHECK(SectRgn
);
2014 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2015 ResObj_Convert
, &srcRgnA
,
2016 ResObj_Convert
, &srcRgnB
,
2017 ResObj_Convert
, &dstRgn
))
2027 static PyObject
*Qd_MacUnionRgn(PyObject
*_self
, PyObject
*_args
)
2029 PyObject
*_res
= NULL
;
2034 PyMac_PRECHECK(MacUnionRgn
);
2036 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2037 ResObj_Convert
, &srcRgnA
,
2038 ResObj_Convert
, &srcRgnB
,
2039 ResObj_Convert
, &dstRgn
))
2041 MacUnionRgn(srcRgnA
,
2049 static PyObject
*Qd_DiffRgn(PyObject
*_self
, PyObject
*_args
)
2051 PyObject
*_res
= NULL
;
2056 PyMac_PRECHECK(DiffRgn
);
2058 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2059 ResObj_Convert
, &srcRgnA
,
2060 ResObj_Convert
, &srcRgnB
,
2061 ResObj_Convert
, &dstRgn
))
2071 static PyObject
*Qd_MacXorRgn(PyObject
*_self
, PyObject
*_args
)
2073 PyObject
*_res
= NULL
;
2078 PyMac_PRECHECK(MacXorRgn
);
2080 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2081 ResObj_Convert
, &srcRgnA
,
2082 ResObj_Convert
, &srcRgnB
,
2083 ResObj_Convert
, &dstRgn
))
2093 static PyObject
*Qd_RectInRgn(PyObject
*_self
, PyObject
*_args
)
2095 PyObject
*_res
= NULL
;
2100 PyMac_PRECHECK(RectInRgn
);
2102 if (!PyArg_ParseTuple(_args
, "O&O&",
2104 ResObj_Convert
, &rgn
))
2108 _res
= Py_BuildValue("b",
2113 static PyObject
*Qd_MacEqualRgn(PyObject
*_self
, PyObject
*_args
)
2115 PyObject
*_res
= NULL
;
2120 PyMac_PRECHECK(MacEqualRgn
);
2122 if (!PyArg_ParseTuple(_args
, "O&O&",
2123 ResObj_Convert
, &rgnA
,
2124 ResObj_Convert
, &rgnB
))
2126 _rv
= MacEqualRgn(rgnA
,
2128 _res
= Py_BuildValue("b",
2133 static PyObject
*Qd_EmptyRgn(PyObject
*_self
, PyObject
*_args
)
2135 PyObject
*_res
= NULL
;
2139 PyMac_PRECHECK(EmptyRgn
);
2141 if (!PyArg_ParseTuple(_args
, "O&",
2142 ResObj_Convert
, &rgn
))
2144 _rv
= EmptyRgn(rgn
);
2145 _res
= Py_BuildValue("b",
2150 static PyObject
*Qd_MacFrameRgn(PyObject
*_self
, PyObject
*_args
)
2152 PyObject
*_res
= NULL
;
2155 PyMac_PRECHECK(MacFrameRgn
);
2157 if (!PyArg_ParseTuple(_args
, "O&",
2158 ResObj_Convert
, &rgn
))
2166 static PyObject
*Qd_MacPaintRgn(PyObject
*_self
, PyObject
*_args
)
2168 PyObject
*_res
= NULL
;
2171 PyMac_PRECHECK(MacPaintRgn
);
2173 if (!PyArg_ParseTuple(_args
, "O&",
2174 ResObj_Convert
, &rgn
))
2182 static PyObject
*Qd_EraseRgn(PyObject
*_self
, PyObject
*_args
)
2184 PyObject
*_res
= NULL
;
2187 PyMac_PRECHECK(EraseRgn
);
2189 if (!PyArg_ParseTuple(_args
, "O&",
2190 ResObj_Convert
, &rgn
))
2198 static PyObject
*Qd_MacInvertRgn(PyObject
*_self
, PyObject
*_args
)
2200 PyObject
*_res
= NULL
;
2202 #ifndef MacInvertRgn
2203 PyMac_PRECHECK(MacInvertRgn
);
2205 if (!PyArg_ParseTuple(_args
, "O&",
2206 ResObj_Convert
, &rgn
))
2214 static PyObject
*Qd_MacFillRgn(PyObject
*_self
, PyObject
*_args
)
2216 PyObject
*_res
= NULL
;
2221 PyMac_PRECHECK(MacFillRgn
);
2223 if (!PyArg_ParseTuple(_args
, "O&s#",
2224 ResObj_Convert
, &rgn
,
2225 (char **)&pat__in__
, &pat__in_len__
))
2227 if (pat__in_len__
!= sizeof(Pattern
))
2229 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2240 static PyObject
*Qd_ScrollRect(PyObject
*_self
, PyObject
*_args
)
2242 PyObject
*_res
= NULL
;
2246 RgnHandle updateRgn
;
2248 PyMac_PRECHECK(ScrollRect
);
2250 if (!PyArg_ParseTuple(_args
, "O&hhO&",
2254 ResObj_Convert
, &updateRgn
))
2265 static PyObject
*Qd_CopyBits(PyObject
*_self
, PyObject
*_args
)
2267 PyObject
*_res
= NULL
;
2275 PyMac_PRECHECK(CopyBits
);
2277 if (!PyArg_ParseTuple(_args
, "O&O&O&O&hO&",
2278 BMObj_Convert
, &srcBits
,
2279 BMObj_Convert
, &dstBits
,
2280 PyMac_GetRect
, &srcRect
,
2281 PyMac_GetRect
, &dstRect
,
2283 OptResObj_Convert
, &maskRgn
))
2296 static PyObject
*Qd_CopyMask(PyObject
*_self
, PyObject
*_args
)
2298 PyObject
*_res
= NULL
;
2306 PyMac_PRECHECK(CopyMask
);
2308 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&",
2309 BMObj_Convert
, &srcBits
,
2310 BMObj_Convert
, &maskBits
,
2311 BMObj_Convert
, &dstBits
,
2312 PyMac_GetRect
, &srcRect
,
2313 PyMac_GetRect
, &maskRect
,
2314 PyMac_GetRect
, &dstRect
))
2327 static PyObject
*Qd_OpenPicture(PyObject
*_self
, PyObject
*_args
)
2329 PyObject
*_res
= NULL
;
2333 PyMac_PRECHECK(OpenPicture
);
2335 if (!PyArg_ParseTuple(_args
, "O&",
2336 PyMac_GetRect
, &picFrame
))
2338 _rv
= OpenPicture(&picFrame
);
2339 _res
= Py_BuildValue("O&",
2344 static PyObject
*Qd_PicComment(PyObject
*_self
, PyObject
*_args
)
2346 PyObject
*_res
= NULL
;
2351 PyMac_PRECHECK(PicComment
);
2353 if (!PyArg_ParseTuple(_args
, "hhO&",
2356 ResObj_Convert
, &dataHandle
))
2366 static PyObject
*Qd_ClosePicture(PyObject
*_self
, PyObject
*_args
)
2368 PyObject
*_res
= NULL
;
2369 #ifndef ClosePicture
2370 PyMac_PRECHECK(ClosePicture
);
2372 if (!PyArg_ParseTuple(_args
, ""))
2380 static PyObject
*Qd_DrawPicture(PyObject
*_self
, PyObject
*_args
)
2382 PyObject
*_res
= NULL
;
2383 PicHandle myPicture
;
2386 PyMac_PRECHECK(DrawPicture
);
2388 if (!PyArg_ParseTuple(_args
, "O&O&",
2389 ResObj_Convert
, &myPicture
,
2390 PyMac_GetRect
, &dstRect
))
2392 DrawPicture(myPicture
,
2399 static PyObject
*Qd_KillPicture(PyObject
*_self
, PyObject
*_args
)
2401 PyObject
*_res
= NULL
;
2402 PicHandle myPicture
;
2404 PyMac_PRECHECK(KillPicture
);
2406 if (!PyArg_ParseTuple(_args
, "O&",
2407 ResObj_Convert
, &myPicture
))
2409 KillPicture(myPicture
);
2415 static PyObject
*Qd_OpenPoly(PyObject
*_self
, PyObject
*_args
)
2417 PyObject
*_res
= NULL
;
2420 PyMac_PRECHECK(OpenPoly
);
2422 if (!PyArg_ParseTuple(_args
, ""))
2425 _res
= Py_BuildValue("O&",
2430 static PyObject
*Qd_ClosePoly(PyObject
*_self
, PyObject
*_args
)
2432 PyObject
*_res
= NULL
;
2434 PyMac_PRECHECK(ClosePoly
);
2436 if (!PyArg_ParseTuple(_args
, ""))
2444 static PyObject
*Qd_KillPoly(PyObject
*_self
, PyObject
*_args
)
2446 PyObject
*_res
= NULL
;
2449 PyMac_PRECHECK(KillPoly
);
2451 if (!PyArg_ParseTuple(_args
, "O&",
2452 ResObj_Convert
, &poly
))
2460 static PyObject
*Qd_OffsetPoly(PyObject
*_self
, PyObject
*_args
)
2462 PyObject
*_res
= NULL
;
2467 PyMac_PRECHECK(OffsetPoly
);
2469 if (!PyArg_ParseTuple(_args
, "O&hh",
2470 ResObj_Convert
, &poly
,
2482 static PyObject
*Qd_FramePoly(PyObject
*_self
, PyObject
*_args
)
2484 PyObject
*_res
= NULL
;
2487 PyMac_PRECHECK(FramePoly
);
2489 if (!PyArg_ParseTuple(_args
, "O&",
2490 ResObj_Convert
, &poly
))
2498 static PyObject
*Qd_PaintPoly(PyObject
*_self
, PyObject
*_args
)
2500 PyObject
*_res
= NULL
;
2503 PyMac_PRECHECK(PaintPoly
);
2505 if (!PyArg_ParseTuple(_args
, "O&",
2506 ResObj_Convert
, &poly
))
2514 static PyObject
*Qd_ErasePoly(PyObject
*_self
, PyObject
*_args
)
2516 PyObject
*_res
= NULL
;
2519 PyMac_PRECHECK(ErasePoly
);
2521 if (!PyArg_ParseTuple(_args
, "O&",
2522 ResObj_Convert
, &poly
))
2530 static PyObject
*Qd_InvertPoly(PyObject
*_self
, PyObject
*_args
)
2532 PyObject
*_res
= NULL
;
2535 PyMac_PRECHECK(InvertPoly
);
2537 if (!PyArg_ParseTuple(_args
, "O&",
2538 ResObj_Convert
, &poly
))
2546 static PyObject
*Qd_FillPoly(PyObject
*_self
, PyObject
*_args
)
2548 PyObject
*_res
= NULL
;
2553 PyMac_PRECHECK(FillPoly
);
2555 if (!PyArg_ParseTuple(_args
, "O&s#",
2556 ResObj_Convert
, &poly
,
2557 (char **)&pat__in__
, &pat__in_len__
))
2559 if (pat__in_len__
!= sizeof(Pattern
))
2561 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
2572 static PyObject
*Qd_SetPt(PyObject
*_self
, PyObject
*_args
)
2574 PyObject
*_res
= NULL
;
2579 PyMac_PRECHECK(SetPt
);
2581 if (!PyArg_ParseTuple(_args
, "hh",
2588 _res
= Py_BuildValue("O&",
2589 PyMac_BuildPoint
, pt
);
2593 static PyObject
*Qd_LocalToGlobal(PyObject
*_self
, PyObject
*_args
)
2595 PyObject
*_res
= NULL
;
2597 #ifndef LocalToGlobal
2598 PyMac_PRECHECK(LocalToGlobal
);
2600 if (!PyArg_ParseTuple(_args
, "O&",
2601 PyMac_GetPoint
, &pt
))
2604 _res
= Py_BuildValue("O&",
2605 PyMac_BuildPoint
, pt
);
2609 static PyObject
*Qd_GlobalToLocal(PyObject
*_self
, PyObject
*_args
)
2611 PyObject
*_res
= NULL
;
2613 #ifndef GlobalToLocal
2614 PyMac_PRECHECK(GlobalToLocal
);
2616 if (!PyArg_ParseTuple(_args
, "O&",
2617 PyMac_GetPoint
, &pt
))
2620 _res
= Py_BuildValue("O&",
2621 PyMac_BuildPoint
, pt
);
2625 static PyObject
*Qd_Random(PyObject
*_self
, PyObject
*_args
)
2627 PyObject
*_res
= NULL
;
2630 PyMac_PRECHECK(Random
);
2632 if (!PyArg_ParseTuple(_args
, ""))
2635 _res
= Py_BuildValue("h",
2640 static PyObject
*Qd_MacGetPixel(PyObject
*_self
, PyObject
*_args
)
2642 PyObject
*_res
= NULL
;
2647 PyMac_PRECHECK(MacGetPixel
);
2649 if (!PyArg_ParseTuple(_args
, "hh",
2653 _rv
= MacGetPixel(h
,
2655 _res
= Py_BuildValue("b",
2660 static PyObject
*Qd_ScalePt(PyObject
*_self
, PyObject
*_args
)
2662 PyObject
*_res
= NULL
;
2667 PyMac_PRECHECK(ScalePt
);
2669 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2670 PyMac_GetPoint
, &pt
,
2671 PyMac_GetRect
, &srcRect
,
2672 PyMac_GetRect
, &dstRect
))
2677 _res
= Py_BuildValue("O&",
2678 PyMac_BuildPoint
, pt
);
2682 static PyObject
*Qd_MapPt(PyObject
*_self
, PyObject
*_args
)
2684 PyObject
*_res
= NULL
;
2689 PyMac_PRECHECK(MapPt
);
2691 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2692 PyMac_GetPoint
, &pt
,
2693 PyMac_GetRect
, &srcRect
,
2694 PyMac_GetRect
, &dstRect
))
2699 _res
= Py_BuildValue("O&",
2700 PyMac_BuildPoint
, pt
);
2704 static PyObject
*Qd_MapRect(PyObject
*_self
, PyObject
*_args
)
2706 PyObject
*_res
= NULL
;
2711 PyMac_PRECHECK(MapRect
);
2713 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2715 PyMac_GetRect
, &srcRect
,
2716 PyMac_GetRect
, &dstRect
))
2721 _res
= Py_BuildValue("O&",
2722 PyMac_BuildRect
, &r
);
2726 static PyObject
*Qd_MapRgn(PyObject
*_self
, PyObject
*_args
)
2728 PyObject
*_res
= NULL
;
2733 PyMac_PRECHECK(MapRgn
);
2735 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2736 ResObj_Convert
, &rgn
,
2737 PyMac_GetRect
, &srcRect
,
2738 PyMac_GetRect
, &dstRect
))
2748 static PyObject
*Qd_MapPoly(PyObject
*_self
, PyObject
*_args
)
2750 PyObject
*_res
= NULL
;
2755 PyMac_PRECHECK(MapPoly
);
2757 if (!PyArg_ParseTuple(_args
, "O&O&O&",
2758 ResObj_Convert
, &poly
,
2759 PyMac_GetRect
, &srcRect
,
2760 PyMac_GetRect
, &dstRect
))
2770 static PyObject
*Qd_StdBits(PyObject
*_self
, PyObject
*_args
)
2772 PyObject
*_res
= NULL
;
2779 PyMac_PRECHECK(StdBits
);
2781 if (!PyArg_ParseTuple(_args
, "O&O&O&hO&",
2782 BMObj_Convert
, &srcBits
,
2783 PyMac_GetRect
, &srcRect
,
2784 PyMac_GetRect
, &dstRect
,
2786 OptResObj_Convert
, &maskRgn
))
2798 static PyObject
*Qd_AddPt(PyObject
*_self
, PyObject
*_args
)
2800 PyObject
*_res
= NULL
;
2804 PyMac_PRECHECK(AddPt
);
2806 if (!PyArg_ParseTuple(_args
, "O&O&",
2807 PyMac_GetPoint
, &src
,
2808 PyMac_GetPoint
, &dst
))
2812 _res
= Py_BuildValue("O&",
2813 PyMac_BuildPoint
, dst
);
2817 static PyObject
*Qd_EqualPt(PyObject
*_self
, PyObject
*_args
)
2819 PyObject
*_res
= NULL
;
2824 PyMac_PRECHECK(EqualPt
);
2826 if (!PyArg_ParseTuple(_args
, "O&O&",
2827 PyMac_GetPoint
, &pt1
,
2828 PyMac_GetPoint
, &pt2
))
2832 _res
= Py_BuildValue("b",
2837 static PyObject
*Qd_MacPtInRect(PyObject
*_self
, PyObject
*_args
)
2839 PyObject
*_res
= NULL
;
2844 PyMac_PRECHECK(MacPtInRect
);
2846 if (!PyArg_ParseTuple(_args
, "O&O&",
2847 PyMac_GetPoint
, &pt
,
2850 _rv
= MacPtInRect(pt
,
2852 _res
= Py_BuildValue("b",
2857 static PyObject
*Qd_Pt2Rect(PyObject
*_self
, PyObject
*_args
)
2859 PyObject
*_res
= NULL
;
2864 PyMac_PRECHECK(Pt2Rect
);
2866 if (!PyArg_ParseTuple(_args
, "O&O&",
2867 PyMac_GetPoint
, &pt1
,
2868 PyMac_GetPoint
, &pt2
))
2873 _res
= Py_BuildValue("O&",
2874 PyMac_BuildRect
, &dstRect
);
2878 static PyObject
*Qd_PtToAngle(PyObject
*_self
, PyObject
*_args
)
2880 PyObject
*_res
= NULL
;
2885 PyMac_PRECHECK(PtToAngle
);
2887 if (!PyArg_ParseTuple(_args
, "O&O&",
2889 PyMac_GetPoint
, &pt
))
2894 _res
= Py_BuildValue("h",
2899 static PyObject
*Qd_SubPt(PyObject
*_self
, PyObject
*_args
)
2901 PyObject
*_res
= NULL
;
2905 PyMac_PRECHECK(SubPt
);
2907 if (!PyArg_ParseTuple(_args
, "O&O&",
2908 PyMac_GetPoint
, &src
,
2909 PyMac_GetPoint
, &dst
))
2913 _res
= Py_BuildValue("O&",
2914 PyMac_BuildPoint
, dst
);
2918 static PyObject
*Qd_PtInRgn(PyObject
*_self
, PyObject
*_args
)
2920 PyObject
*_res
= NULL
;
2925 PyMac_PRECHECK(PtInRgn
);
2927 if (!PyArg_ParseTuple(_args
, "O&O&",
2928 PyMac_GetPoint
, &pt
,
2929 ResObj_Convert
, &rgn
))
2933 _res
= Py_BuildValue("b",
2938 static PyObject
*Qd_NewPixMap(PyObject
*_self
, PyObject
*_args
)
2940 PyObject
*_res
= NULL
;
2943 PyMac_PRECHECK(NewPixMap
);
2945 if (!PyArg_ParseTuple(_args
, ""))
2948 _res
= Py_BuildValue("O&",
2953 static PyObject
*Qd_DisposePixMap(PyObject
*_self
, PyObject
*_args
)
2955 PyObject
*_res
= NULL
;
2957 #ifndef DisposePixMap
2958 PyMac_PRECHECK(DisposePixMap
);
2960 if (!PyArg_ParseTuple(_args
, "O&",
2961 ResObj_Convert
, &pm
))
2969 static PyObject
*Qd_CopyPixMap(PyObject
*_self
, PyObject
*_args
)
2971 PyObject
*_res
= NULL
;
2975 PyMac_PRECHECK(CopyPixMap
);
2977 if (!PyArg_ParseTuple(_args
, "O&O&",
2978 ResObj_Convert
, &srcPM
,
2979 ResObj_Convert
, &dstPM
))
2988 static PyObject
*Qd_NewPixPat(PyObject
*_self
, PyObject
*_args
)
2990 PyObject
*_res
= NULL
;
2993 PyMac_PRECHECK(NewPixPat
);
2995 if (!PyArg_ParseTuple(_args
, ""))
2998 _res
= Py_BuildValue("O&",
3003 static PyObject
*Qd_DisposePixPat(PyObject
*_self
, PyObject
*_args
)
3005 PyObject
*_res
= NULL
;
3007 #ifndef DisposePixPat
3008 PyMac_PRECHECK(DisposePixPat
);
3010 if (!PyArg_ParseTuple(_args
, "O&",
3011 ResObj_Convert
, &pp
))
3019 static PyObject
*Qd_CopyPixPat(PyObject
*_self
, PyObject
*_args
)
3021 PyObject
*_res
= NULL
;
3025 PyMac_PRECHECK(CopyPixPat
);
3027 if (!PyArg_ParseTuple(_args
, "O&O&",
3028 ResObj_Convert
, &srcPP
,
3029 ResObj_Convert
, &dstPP
))
3038 static PyObject
*Qd_PenPixPat(PyObject
*_self
, PyObject
*_args
)
3040 PyObject
*_res
= NULL
;
3043 PyMac_PRECHECK(PenPixPat
);
3045 if (!PyArg_ParseTuple(_args
, "O&",
3046 ResObj_Convert
, &pp
))
3054 static PyObject
*Qd_BackPixPat(PyObject
*_self
, PyObject
*_args
)
3056 PyObject
*_res
= NULL
;
3059 PyMac_PRECHECK(BackPixPat
);
3061 if (!PyArg_ParseTuple(_args
, "O&",
3062 ResObj_Convert
, &pp
))
3070 static PyObject
*Qd_GetPixPat(PyObject
*_self
, PyObject
*_args
)
3072 PyObject
*_res
= NULL
;
3076 PyMac_PRECHECK(GetPixPat
);
3078 if (!PyArg_ParseTuple(_args
, "h",
3081 _rv
= GetPixPat(patID
);
3082 _res
= Py_BuildValue("O&",
3087 static PyObject
*Qd_MakeRGBPat(PyObject
*_self
, PyObject
*_args
)
3089 PyObject
*_res
= NULL
;
3093 PyMac_PRECHECK(MakeRGBPat
);
3095 if (!PyArg_ParseTuple(_args
, "O&O&",
3096 ResObj_Convert
, &pp
,
3097 QdRGB_Convert
, &myColor
))
3106 static PyObject
*Qd_FillCRect(PyObject
*_self
, PyObject
*_args
)
3108 PyObject
*_res
= NULL
;
3112 PyMac_PRECHECK(FillCRect
);
3114 if (!PyArg_ParseTuple(_args
, "O&O&",
3116 ResObj_Convert
, &pp
))
3125 static PyObject
*Qd_FillCOval(PyObject
*_self
, PyObject
*_args
)
3127 PyObject
*_res
= NULL
;
3131 PyMac_PRECHECK(FillCOval
);
3133 if (!PyArg_ParseTuple(_args
, "O&O&",
3135 ResObj_Convert
, &pp
))
3144 static PyObject
*Qd_FillCRoundRect(PyObject
*_self
, PyObject
*_args
)
3146 PyObject
*_res
= NULL
;
3151 #ifndef FillCRoundRect
3152 PyMac_PRECHECK(FillCRoundRect
);
3154 if (!PyArg_ParseTuple(_args
, "O&hhO&",
3158 ResObj_Convert
, &pp
))
3169 static PyObject
*Qd_FillCArc(PyObject
*_self
, PyObject
*_args
)
3171 PyObject
*_res
= NULL
;
3177 PyMac_PRECHECK(FillCArc
);
3179 if (!PyArg_ParseTuple(_args
, "O&hhO&",
3183 ResObj_Convert
, &pp
))
3194 static PyObject
*Qd_FillCRgn(PyObject
*_self
, PyObject
*_args
)
3196 PyObject
*_res
= NULL
;
3200 PyMac_PRECHECK(FillCRgn
);
3202 if (!PyArg_ParseTuple(_args
, "O&O&",
3203 ResObj_Convert
, &rgn
,
3204 ResObj_Convert
, &pp
))
3213 static PyObject
*Qd_FillCPoly(PyObject
*_self
, PyObject
*_args
)
3215 PyObject
*_res
= NULL
;
3219 PyMac_PRECHECK(FillCPoly
);
3221 if (!PyArg_ParseTuple(_args
, "O&O&",
3222 ResObj_Convert
, &poly
,
3223 ResObj_Convert
, &pp
))
3232 static PyObject
*Qd_RGBForeColor(PyObject
*_self
, PyObject
*_args
)
3234 PyObject
*_res
= NULL
;
3236 #ifndef RGBForeColor
3237 PyMac_PRECHECK(RGBForeColor
);
3239 if (!PyArg_ParseTuple(_args
, "O&",
3240 QdRGB_Convert
, &color
))
3242 RGBForeColor(&color
);
3248 static PyObject
*Qd_RGBBackColor(PyObject
*_self
, PyObject
*_args
)
3250 PyObject
*_res
= NULL
;
3252 #ifndef RGBBackColor
3253 PyMac_PRECHECK(RGBBackColor
);
3255 if (!PyArg_ParseTuple(_args
, "O&",
3256 QdRGB_Convert
, &color
))
3258 RGBBackColor(&color
);
3264 static PyObject
*Qd_SetCPixel(PyObject
*_self
, PyObject
*_args
)
3266 PyObject
*_res
= NULL
;
3271 PyMac_PRECHECK(SetCPixel
);
3273 if (!PyArg_ParseTuple(_args
, "hhO&",
3276 QdRGB_Convert
, &cPix
))
3286 static PyObject
*Qd_SetPortPix(PyObject
*_self
, PyObject
*_args
)
3288 PyObject
*_res
= NULL
;
3291 PyMac_PRECHECK(SetPortPix
);
3293 if (!PyArg_ParseTuple(_args
, "O&",
3294 ResObj_Convert
, &pm
))
3302 static PyObject
*Qd_GetCPixel(PyObject
*_self
, PyObject
*_args
)
3304 PyObject
*_res
= NULL
;
3309 PyMac_PRECHECK(GetCPixel
);
3311 if (!PyArg_ParseTuple(_args
, "hh",
3318 _res
= Py_BuildValue("O&",
3323 static PyObject
*Qd_GetForeColor(PyObject
*_self
, PyObject
*_args
)
3325 PyObject
*_res
= NULL
;
3327 #ifndef GetForeColor
3328 PyMac_PRECHECK(GetForeColor
);
3330 if (!PyArg_ParseTuple(_args
, ""))
3332 GetForeColor(&color
);
3333 _res
= Py_BuildValue("O&",
3338 static PyObject
*Qd_GetBackColor(PyObject
*_self
, PyObject
*_args
)
3340 PyObject
*_res
= NULL
;
3342 #ifndef GetBackColor
3343 PyMac_PRECHECK(GetBackColor
);
3345 if (!PyArg_ParseTuple(_args
, ""))
3347 GetBackColor(&color
);
3348 _res
= Py_BuildValue("O&",
3353 static PyObject
*Qd_OpColor(PyObject
*_self
, PyObject
*_args
)
3355 PyObject
*_res
= NULL
;
3358 PyMac_PRECHECK(OpColor
);
3360 if (!PyArg_ParseTuple(_args
, "O&",
3361 QdRGB_Convert
, &color
))
3369 static PyObject
*Qd_HiliteColor(PyObject
*_self
, PyObject
*_args
)
3371 PyObject
*_res
= NULL
;
3374 PyMac_PRECHECK(HiliteColor
);
3376 if (!PyArg_ParseTuple(_args
, "O&",
3377 QdRGB_Convert
, &color
))
3379 HiliteColor(&color
);
3385 static PyObject
*Qd_DisposeCTable(PyObject
*_self
, PyObject
*_args
)
3387 PyObject
*_res
= NULL
;
3389 #ifndef DisposeCTable
3390 PyMac_PRECHECK(DisposeCTable
);
3392 if (!PyArg_ParseTuple(_args
, "O&",
3393 ResObj_Convert
, &cTable
))
3395 DisposeCTable(cTable
);
3401 static PyObject
*Qd_GetCTable(PyObject
*_self
, PyObject
*_args
)
3403 PyObject
*_res
= NULL
;
3407 PyMac_PRECHECK(GetCTable
);
3409 if (!PyArg_ParseTuple(_args
, "h",
3412 _rv
= GetCTable(ctID
);
3413 _res
= Py_BuildValue("O&",
3418 static PyObject
*Qd_GetCCursor(PyObject
*_self
, PyObject
*_args
)
3420 PyObject
*_res
= NULL
;
3424 PyMac_PRECHECK(GetCCursor
);
3426 if (!PyArg_ParseTuple(_args
, "h",
3429 _rv
= GetCCursor(crsrID
);
3430 _res
= Py_BuildValue("O&",
3435 static PyObject
*Qd_SetCCursor(PyObject
*_self
, PyObject
*_args
)
3437 PyObject
*_res
= NULL
;
3440 PyMac_PRECHECK(SetCCursor
);
3442 if (!PyArg_ParseTuple(_args
, "O&",
3443 ResObj_Convert
, &cCrsr
))
3451 static PyObject
*Qd_AllocCursor(PyObject
*_self
, PyObject
*_args
)
3453 PyObject
*_res
= NULL
;
3455 PyMac_PRECHECK(AllocCursor
);
3457 if (!PyArg_ParseTuple(_args
, ""))
3465 static PyObject
*Qd_DisposeCCursor(PyObject
*_self
, PyObject
*_args
)
3467 PyObject
*_res
= NULL
;
3469 #ifndef DisposeCCursor
3470 PyMac_PRECHECK(DisposeCCursor
);
3472 if (!PyArg_ParseTuple(_args
, "O&",
3473 ResObj_Convert
, &cCrsr
))
3475 DisposeCCursor(cCrsr
);
3481 static PyObject
*Qd_GetMaxDevice(PyObject
*_self
, PyObject
*_args
)
3483 PyObject
*_res
= NULL
;
3486 #ifndef GetMaxDevice
3487 PyMac_PRECHECK(GetMaxDevice
);
3489 if (!PyArg_ParseTuple(_args
, "O&",
3490 PyMac_GetRect
, &globalRect
))
3492 _rv
= GetMaxDevice(&globalRect
);
3493 _res
= Py_BuildValue("O&",
3498 static PyObject
*Qd_GetCTSeed(PyObject
*_self
, PyObject
*_args
)
3500 PyObject
*_res
= NULL
;
3503 PyMac_PRECHECK(GetCTSeed
);
3505 if (!PyArg_ParseTuple(_args
, ""))
3508 _res
= Py_BuildValue("l",
3513 static PyObject
*Qd_GetDeviceList(PyObject
*_self
, PyObject
*_args
)
3515 PyObject
*_res
= NULL
;
3517 #ifndef GetDeviceList
3518 PyMac_PRECHECK(GetDeviceList
);
3520 if (!PyArg_ParseTuple(_args
, ""))
3522 _rv
= GetDeviceList();
3523 _res
= Py_BuildValue("O&",
3528 static PyObject
*Qd_GetMainDevice(PyObject
*_self
, PyObject
*_args
)
3530 PyObject
*_res
= NULL
;
3532 #ifndef GetMainDevice
3533 PyMac_PRECHECK(GetMainDevice
);
3535 if (!PyArg_ParseTuple(_args
, ""))
3537 _rv
= GetMainDevice();
3538 _res
= Py_BuildValue("O&",
3543 static PyObject
*Qd_GetNextDevice(PyObject
*_self
, PyObject
*_args
)
3545 PyObject
*_res
= NULL
;
3548 #ifndef GetNextDevice
3549 PyMac_PRECHECK(GetNextDevice
);
3551 if (!PyArg_ParseTuple(_args
, "O&",
3552 ResObj_Convert
, &curDevice
))
3554 _rv
= GetNextDevice(curDevice
);
3555 _res
= Py_BuildValue("O&",
3560 static PyObject
*Qd_TestDeviceAttribute(PyObject
*_self
, PyObject
*_args
)
3562 PyObject
*_res
= NULL
;
3566 #ifndef TestDeviceAttribute
3567 PyMac_PRECHECK(TestDeviceAttribute
);
3569 if (!PyArg_ParseTuple(_args
, "O&h",
3570 ResObj_Convert
, &gdh
,
3573 _rv
= TestDeviceAttribute(gdh
,
3575 _res
= Py_BuildValue("b",
3580 static PyObject
*Qd_SetDeviceAttribute(PyObject
*_self
, PyObject
*_args
)
3582 PyObject
*_res
= NULL
;
3586 #ifndef SetDeviceAttribute
3587 PyMac_PRECHECK(SetDeviceAttribute
);
3589 if (!PyArg_ParseTuple(_args
, "O&hb",
3590 ResObj_Convert
, &gdh
,
3594 SetDeviceAttribute(gdh
,
3602 static PyObject
*Qd_InitGDevice(PyObject
*_self
, PyObject
*_args
)
3604 PyObject
*_res
= NULL
;
3609 PyMac_PRECHECK(InitGDevice
);
3611 if (!PyArg_ParseTuple(_args
, "hlO&",
3614 ResObj_Convert
, &gdh
))
3616 InitGDevice(qdRefNum
,
3624 static PyObject
*Qd_NewGDevice(PyObject
*_self
, PyObject
*_args
)
3626 PyObject
*_res
= NULL
;
3631 PyMac_PRECHECK(NewGDevice
);
3633 if (!PyArg_ParseTuple(_args
, "hl",
3637 _rv
= NewGDevice(refNum
,
3639 _res
= Py_BuildValue("O&",
3644 static PyObject
*Qd_DisposeGDevice(PyObject
*_self
, PyObject
*_args
)
3646 PyObject
*_res
= NULL
;
3648 #ifndef DisposeGDevice
3649 PyMac_PRECHECK(DisposeGDevice
);
3651 if (!PyArg_ParseTuple(_args
, "O&",
3652 ResObj_Convert
, &gdh
))
3654 DisposeGDevice(gdh
);
3660 static PyObject
*Qd_SetGDevice(PyObject
*_self
, PyObject
*_args
)
3662 PyObject
*_res
= NULL
;
3665 PyMac_PRECHECK(SetGDevice
);
3667 if (!PyArg_ParseTuple(_args
, "O&",
3668 ResObj_Convert
, &gd
))
3676 static PyObject
*Qd_GetGDevice(PyObject
*_self
, PyObject
*_args
)
3678 PyObject
*_res
= NULL
;
3681 PyMac_PRECHECK(GetGDevice
);
3683 if (!PyArg_ParseTuple(_args
, ""))
3686 _res
= Py_BuildValue("O&",
3691 static PyObject
*Qd_Color2Index(PyObject
*_self
, PyObject
*_args
)
3693 PyObject
*_res
= NULL
;
3697 PyMac_PRECHECK(Color2Index
);
3699 if (!PyArg_ParseTuple(_args
, "O&",
3700 QdRGB_Convert
, &myColor
))
3702 _rv
= Color2Index(&myColor
);
3703 _res
= Py_BuildValue("l",
3708 static PyObject
*Qd_Index2Color(PyObject
*_self
, PyObject
*_args
)
3710 PyObject
*_res
= NULL
;
3714 PyMac_PRECHECK(Index2Color
);
3716 if (!PyArg_ParseTuple(_args
, "l",
3721 _res
= Py_BuildValue("O&",
3722 QdRGB_New
, &aColor
);
3726 static PyObject
*Qd_InvertColor(PyObject
*_self
, PyObject
*_args
)
3728 PyObject
*_res
= NULL
;
3731 PyMac_PRECHECK(InvertColor
);
3733 if (!PyArg_ParseTuple(_args
, ""))
3735 InvertColor(&myColor
);
3736 _res
= Py_BuildValue("O&",
3737 QdRGB_New
, &myColor
);
3741 static PyObject
*Qd_RealColor(PyObject
*_self
, PyObject
*_args
)
3743 PyObject
*_res
= NULL
;
3747 PyMac_PRECHECK(RealColor
);
3749 if (!PyArg_ParseTuple(_args
, "O&",
3750 QdRGB_Convert
, &color
))
3752 _rv
= RealColor(&color
);
3753 _res
= Py_BuildValue("b",
3758 static PyObject
*Qd_GetSubTable(PyObject
*_self
, PyObject
*_args
)
3760 PyObject
*_res
= NULL
;
3761 CTabHandle myColors
;
3763 CTabHandle targetTbl
;
3765 PyMac_PRECHECK(GetSubTable
);
3767 if (!PyArg_ParseTuple(_args
, "O&hO&",
3768 ResObj_Convert
, &myColors
,
3770 ResObj_Convert
, &targetTbl
))
3772 GetSubTable(myColors
,
3780 static PyObject
*Qd_MakeITable(PyObject
*_self
, PyObject
*_args
)
3782 PyObject
*_res
= NULL
;
3787 PyMac_PRECHECK(MakeITable
);
3789 if (!PyArg_ParseTuple(_args
, "O&O&h",
3790 ResObj_Convert
, &cTabH
,
3791 ResObj_Convert
, &iTabH
,
3802 static PyObject
*Qd_SetClientID(PyObject
*_self
, PyObject
*_args
)
3804 PyObject
*_res
= NULL
;
3807 PyMac_PRECHECK(SetClientID
);
3809 if (!PyArg_ParseTuple(_args
, "h",
3818 static PyObject
*Qd_ProtectEntry(PyObject
*_self
, PyObject
*_args
)
3820 PyObject
*_res
= NULL
;
3823 #ifndef ProtectEntry
3824 PyMac_PRECHECK(ProtectEntry
);
3826 if (!PyArg_ParseTuple(_args
, "hb",
3837 static PyObject
*Qd_ReserveEntry(PyObject
*_self
, PyObject
*_args
)
3839 PyObject
*_res
= NULL
;
3842 #ifndef ReserveEntry
3843 PyMac_PRECHECK(ReserveEntry
);
3845 if (!PyArg_ParseTuple(_args
, "hb",
3856 static PyObject
*Qd_QDError(PyObject
*_self
, PyObject
*_args
)
3858 PyObject
*_res
= NULL
;
3861 PyMac_PRECHECK(QDError
);
3863 if (!PyArg_ParseTuple(_args
, ""))
3866 _res
= Py_BuildValue("h",
3871 static PyObject
*Qd_CopyDeepMask(PyObject
*_self
, PyObject
*_args
)
3873 PyObject
*_res
= NULL
;
3882 #ifndef CopyDeepMask
3883 PyMac_PRECHECK(CopyDeepMask
);
3885 if (!PyArg_ParseTuple(_args
, "O&O&O&O&O&O&hO&",
3886 BMObj_Convert
, &srcBits
,
3887 BMObj_Convert
, &maskBits
,
3888 BMObj_Convert
, &dstBits
,
3889 PyMac_GetRect
, &srcRect
,
3890 PyMac_GetRect
, &maskRect
,
3891 PyMac_GetRect
, &dstRect
,
3893 OptResObj_Convert
, &maskRgn
))
3895 CopyDeepMask(srcBits
,
3908 static PyObject
*Qd_GetPattern(PyObject
*_self
, PyObject
*_args
)
3910 PyObject
*_res
= NULL
;
3914 PyMac_PRECHECK(GetPattern
);
3916 if (!PyArg_ParseTuple(_args
, "h",
3919 _rv
= GetPattern(patternID
);
3920 _res
= Py_BuildValue("O&",
3925 static PyObject
*Qd_MacGetCursor(PyObject
*_self
, PyObject
*_args
)
3927 PyObject
*_res
= NULL
;
3930 #ifndef MacGetCursor
3931 PyMac_PRECHECK(MacGetCursor
);
3933 if (!PyArg_ParseTuple(_args
, "h",
3936 _rv
= MacGetCursor(cursorID
);
3937 _res
= Py_BuildValue("O&",
3942 static PyObject
*Qd_GetPicture(PyObject
*_self
, PyObject
*_args
)
3944 PyObject
*_res
= NULL
;
3948 PyMac_PRECHECK(GetPicture
);
3950 if (!PyArg_ParseTuple(_args
, "h",
3953 _rv
= GetPicture(pictureID
);
3954 _res
= Py_BuildValue("O&",
3959 static PyObject
*Qd_DeltaPoint(PyObject
*_self
, PyObject
*_args
)
3961 PyObject
*_res
= NULL
;
3966 PyMac_PRECHECK(DeltaPoint
);
3968 if (!PyArg_ParseTuple(_args
, "O&O&",
3969 PyMac_GetPoint
, &ptA
,
3970 PyMac_GetPoint
, &ptB
))
3972 _rv
= DeltaPoint(ptA
,
3974 _res
= Py_BuildValue("l",
3979 static PyObject
*Qd_ShieldCursor(PyObject
*_self
, PyObject
*_args
)
3981 PyObject
*_res
= NULL
;
3984 #ifndef ShieldCursor
3985 PyMac_PRECHECK(ShieldCursor
);
3987 if (!PyArg_ParseTuple(_args
, "O&O&",
3988 PyMac_GetRect
, &shieldRect
,
3989 PyMac_GetPoint
, &offsetPt
))
3991 ShieldCursor(&shieldRect
,
3998 static PyObject
*Qd_ScreenRes(PyObject
*_self
, PyObject
*_args
)
4000 PyObject
*_res
= NULL
;
4004 PyMac_PRECHECK(ScreenRes
);
4006 if (!PyArg_ParseTuple(_args
, ""))
4008 ScreenRes(&scrnHRes
,
4010 _res
= Py_BuildValue("hh",
4016 static PyObject
*Qd_GetIndPattern(PyObject
*_self
, PyObject
*_args
)
4018 PyObject
*_res
= NULL
;
4019 Pattern thePat__out__
;
4020 short patternListID
;
4022 #ifndef GetIndPattern
4023 PyMac_PRECHECK(GetIndPattern
);
4025 if (!PyArg_ParseTuple(_args
, "hh",
4029 GetIndPattern(&thePat__out__
,
4032 _res
= Py_BuildValue("s#",
4033 (char *)&thePat__out__
, (int)sizeof(Pattern
));
4037 static PyObject
*Qd_SlopeFromAngle(PyObject
*_self
, PyObject
*_args
)
4039 PyObject
*_res
= NULL
;
4042 #ifndef SlopeFromAngle
4043 PyMac_PRECHECK(SlopeFromAngle
);
4045 if (!PyArg_ParseTuple(_args
, "h",
4048 _rv
= SlopeFromAngle(angle
);
4049 _res
= Py_BuildValue("O&",
4050 PyMac_BuildFixed
, _rv
);
4054 static PyObject
*Qd_AngleFromSlope(PyObject
*_self
, PyObject
*_args
)
4056 PyObject
*_res
= NULL
;
4059 #ifndef AngleFromSlope
4060 PyMac_PRECHECK(AngleFromSlope
);
4062 if (!PyArg_ParseTuple(_args
, "O&",
4063 PyMac_GetFixed
, &slope
))
4065 _rv
= AngleFromSlope(slope
);
4066 _res
= Py_BuildValue("h",
4071 #if TARGET_API_MAC_CARBON
4073 static PyObject
*Qd_IsValidPort(PyObject
*_self
, PyObject
*_args
)
4075 PyObject
*_res
= NULL
;
4079 PyMac_PRECHECK(IsValidPort
);
4081 if (!PyArg_ParseTuple(_args
, "O&",
4082 GrafObj_Convert
, &port
))
4084 _rv
= IsValidPort(port
);
4085 _res
= Py_BuildValue("b",
4091 static PyObject
*Qd_GetPortPixMap(PyObject
*_self
, PyObject
*_args
)
4093 PyObject
*_res
= NULL
;
4096 #ifndef GetPortPixMap
4097 PyMac_PRECHECK(GetPortPixMap
);
4099 if (!PyArg_ParseTuple(_args
, "O&",
4100 GrafObj_Convert
, &port
))
4102 _rv
= GetPortPixMap(port
);
4103 _res
= Py_BuildValue("O&",
4108 static PyObject
*Qd_GetPortBitMapForCopyBits(PyObject
*_self
, PyObject
*_args
)
4110 PyObject
*_res
= NULL
;
4113 #ifndef GetPortBitMapForCopyBits
4114 PyMac_PRECHECK(GetPortBitMapForCopyBits
);
4116 if (!PyArg_ParseTuple(_args
, "O&",
4117 GrafObj_Convert
, &port
))
4119 _rv
= GetPortBitMapForCopyBits(port
);
4120 _res
= Py_BuildValue("O&",
4125 static PyObject
*Qd_GetPortBounds(PyObject
*_self
, PyObject
*_args
)
4127 PyObject
*_res
= NULL
;
4130 #ifndef GetPortBounds
4131 PyMac_PRECHECK(GetPortBounds
);
4133 if (!PyArg_ParseTuple(_args
, "O&",
4134 GrafObj_Convert
, &port
))
4138 _res
= Py_BuildValue("O&",
4139 PyMac_BuildRect
, &rect
);
4143 static PyObject
*Qd_GetPortForeColor(PyObject
*_self
, PyObject
*_args
)
4145 PyObject
*_res
= NULL
;
4148 #ifndef GetPortForeColor
4149 PyMac_PRECHECK(GetPortForeColor
);
4151 if (!PyArg_ParseTuple(_args
, "O&",
4152 GrafObj_Convert
, &port
))
4154 GetPortForeColor(port
,
4156 _res
= Py_BuildValue("O&",
4157 QdRGB_New
, &foreColor
);
4161 static PyObject
*Qd_GetPortBackColor(PyObject
*_self
, PyObject
*_args
)
4163 PyObject
*_res
= NULL
;
4166 #ifndef GetPortBackColor
4167 PyMac_PRECHECK(GetPortBackColor
);
4169 if (!PyArg_ParseTuple(_args
, "O&",
4170 GrafObj_Convert
, &port
))
4172 GetPortBackColor(port
,
4174 _res
= Py_BuildValue("O&",
4175 QdRGB_New
, &backColor
);
4179 static PyObject
*Qd_GetPortOpColor(PyObject
*_self
, PyObject
*_args
)
4181 PyObject
*_res
= NULL
;
4184 #ifndef GetPortOpColor
4185 PyMac_PRECHECK(GetPortOpColor
);
4187 if (!PyArg_ParseTuple(_args
, "O&",
4188 GrafObj_Convert
, &port
))
4190 GetPortOpColor(port
,
4192 _res
= Py_BuildValue("O&",
4193 QdRGB_New
, &opColor
);
4197 static PyObject
*Qd_GetPortHiliteColor(PyObject
*_self
, PyObject
*_args
)
4199 PyObject
*_res
= NULL
;
4201 RGBColor hiliteColor
;
4202 #ifndef GetPortHiliteColor
4203 PyMac_PRECHECK(GetPortHiliteColor
);
4205 if (!PyArg_ParseTuple(_args
, "O&",
4206 GrafObj_Convert
, &port
))
4208 GetPortHiliteColor(port
,
4210 _res
= Py_BuildValue("O&",
4211 QdRGB_New
, &hiliteColor
);
4215 static PyObject
*Qd_GetPortTextFont(PyObject
*_self
, PyObject
*_args
)
4217 PyObject
*_res
= NULL
;
4220 #ifndef GetPortTextFont
4221 PyMac_PRECHECK(GetPortTextFont
);
4223 if (!PyArg_ParseTuple(_args
, "O&",
4224 GrafObj_Convert
, &port
))
4226 _rv
= GetPortTextFont(port
);
4227 _res
= Py_BuildValue("h",
4232 static PyObject
*Qd_GetPortTextFace(PyObject
*_self
, PyObject
*_args
)
4234 PyObject
*_res
= NULL
;
4237 #ifndef GetPortTextFace
4238 PyMac_PRECHECK(GetPortTextFace
);
4240 if (!PyArg_ParseTuple(_args
, "O&",
4241 GrafObj_Convert
, &port
))
4243 _rv
= GetPortTextFace(port
);
4244 _res
= Py_BuildValue("b",
4249 static PyObject
*Qd_GetPortTextMode(PyObject
*_self
, PyObject
*_args
)
4251 PyObject
*_res
= NULL
;
4254 #ifndef GetPortTextMode
4255 PyMac_PRECHECK(GetPortTextMode
);
4257 if (!PyArg_ParseTuple(_args
, "O&",
4258 GrafObj_Convert
, &port
))
4260 _rv
= GetPortTextMode(port
);
4261 _res
= Py_BuildValue("h",
4266 static PyObject
*Qd_GetPortTextSize(PyObject
*_self
, PyObject
*_args
)
4268 PyObject
*_res
= NULL
;
4271 #ifndef GetPortTextSize
4272 PyMac_PRECHECK(GetPortTextSize
);
4274 if (!PyArg_ParseTuple(_args
, "O&",
4275 GrafObj_Convert
, &port
))
4277 _rv
= GetPortTextSize(port
);
4278 _res
= Py_BuildValue("h",
4283 static PyObject
*Qd_GetPortChExtra(PyObject
*_self
, PyObject
*_args
)
4285 PyObject
*_res
= NULL
;
4288 #ifndef GetPortChExtra
4289 PyMac_PRECHECK(GetPortChExtra
);
4291 if (!PyArg_ParseTuple(_args
, "O&",
4292 GrafObj_Convert
, &port
))
4294 _rv
= GetPortChExtra(port
);
4295 _res
= Py_BuildValue("h",
4300 static PyObject
*Qd_GetPortFracHPenLocation(PyObject
*_self
, PyObject
*_args
)
4302 PyObject
*_res
= NULL
;
4305 #ifndef GetPortFracHPenLocation
4306 PyMac_PRECHECK(GetPortFracHPenLocation
);
4308 if (!PyArg_ParseTuple(_args
, "O&",
4309 GrafObj_Convert
, &port
))
4311 _rv
= GetPortFracHPenLocation(port
);
4312 _res
= Py_BuildValue("h",
4317 static PyObject
*Qd_GetPortSpExtra(PyObject
*_self
, PyObject
*_args
)
4319 PyObject
*_res
= NULL
;
4322 #ifndef GetPortSpExtra
4323 PyMac_PRECHECK(GetPortSpExtra
);
4325 if (!PyArg_ParseTuple(_args
, "O&",
4326 GrafObj_Convert
, &port
))
4328 _rv
= GetPortSpExtra(port
);
4329 _res
= Py_BuildValue("O&",
4330 PyMac_BuildFixed
, _rv
);
4334 static PyObject
*Qd_GetPortPenVisibility(PyObject
*_self
, PyObject
*_args
)
4336 PyObject
*_res
= NULL
;
4339 #ifndef GetPortPenVisibility
4340 PyMac_PRECHECK(GetPortPenVisibility
);
4342 if (!PyArg_ParseTuple(_args
, "O&",
4343 GrafObj_Convert
, &port
))
4345 _rv
= GetPortPenVisibility(port
);
4346 _res
= Py_BuildValue("h",
4351 static PyObject
*Qd_GetPortVisibleRegion(PyObject
*_self
, PyObject
*_args
)
4353 PyObject
*_res
= NULL
;
4357 #ifndef GetPortVisibleRegion
4358 PyMac_PRECHECK(GetPortVisibleRegion
);
4360 if (!PyArg_ParseTuple(_args
, "O&O&",
4361 GrafObj_Convert
, &port
,
4362 ResObj_Convert
, &visRgn
))
4364 _rv
= GetPortVisibleRegion(port
,
4366 _res
= Py_BuildValue("O&",
4371 static PyObject
*Qd_GetPortClipRegion(PyObject
*_self
, PyObject
*_args
)
4373 PyObject
*_res
= NULL
;
4377 #ifndef GetPortClipRegion
4378 PyMac_PRECHECK(GetPortClipRegion
);
4380 if (!PyArg_ParseTuple(_args
, "O&O&",
4381 GrafObj_Convert
, &port
,
4382 ResObj_Convert
, &clipRgn
))
4384 _rv
= GetPortClipRegion(port
,
4386 _res
= Py_BuildValue("O&",
4391 static PyObject
*Qd_GetPortBackPixPat(PyObject
*_self
, PyObject
*_args
)
4393 PyObject
*_res
= NULL
;
4396 PixPatHandle backPattern
;
4397 #ifndef GetPortBackPixPat
4398 PyMac_PRECHECK(GetPortBackPixPat
);
4400 if (!PyArg_ParseTuple(_args
, "O&O&",
4401 GrafObj_Convert
, &port
,
4402 ResObj_Convert
, &backPattern
))
4404 _rv
= GetPortBackPixPat(port
,
4406 _res
= Py_BuildValue("O&",
4411 static PyObject
*Qd_GetPortPenPixPat(PyObject
*_self
, PyObject
*_args
)
4413 PyObject
*_res
= NULL
;
4416 PixPatHandle penPattern
;
4417 #ifndef GetPortPenPixPat
4418 PyMac_PRECHECK(GetPortPenPixPat
);
4420 if (!PyArg_ParseTuple(_args
, "O&O&",
4421 GrafObj_Convert
, &port
,
4422 ResObj_Convert
, &penPattern
))
4424 _rv
= GetPortPenPixPat(port
,
4426 _res
= Py_BuildValue("O&",
4431 static PyObject
*Qd_GetPortFillPixPat(PyObject
*_self
, PyObject
*_args
)
4433 PyObject
*_res
= NULL
;
4436 PixPatHandle fillPattern
;
4437 #ifndef GetPortFillPixPat
4438 PyMac_PRECHECK(GetPortFillPixPat
);
4440 if (!PyArg_ParseTuple(_args
, "O&O&",
4441 GrafObj_Convert
, &port
,
4442 ResObj_Convert
, &fillPattern
))
4444 _rv
= GetPortFillPixPat(port
,
4446 _res
= Py_BuildValue("O&",
4451 static PyObject
*Qd_GetPortPenSize(PyObject
*_self
, PyObject
*_args
)
4453 PyObject
*_res
= NULL
;
4456 #ifndef GetPortPenSize
4457 PyMac_PRECHECK(GetPortPenSize
);
4459 if (!PyArg_ParseTuple(_args
, "O&O&",
4460 GrafObj_Convert
, &port
,
4461 PyMac_GetPoint
, &penSize
))
4463 GetPortPenSize(port
,
4465 _res
= Py_BuildValue("O&",
4466 PyMac_BuildPoint
, penSize
);
4470 static PyObject
*Qd_GetPortPenMode(PyObject
*_self
, PyObject
*_args
)
4472 PyObject
*_res
= NULL
;
4475 #ifndef GetPortPenMode
4476 PyMac_PRECHECK(GetPortPenMode
);
4478 if (!PyArg_ParseTuple(_args
, "O&",
4479 GrafObj_Convert
, &port
))
4481 _rv
= GetPortPenMode(port
);
4482 _res
= Py_BuildValue("l",
4487 static PyObject
*Qd_GetPortPenLocation(PyObject
*_self
, PyObject
*_args
)
4489 PyObject
*_res
= NULL
;
4492 #ifndef GetPortPenLocation
4493 PyMac_PRECHECK(GetPortPenLocation
);
4495 if (!PyArg_ParseTuple(_args
, "O&O&",
4496 GrafObj_Convert
, &port
,
4497 PyMac_GetPoint
, &penLocation
))
4499 GetPortPenLocation(port
,
4501 _res
= Py_BuildValue("O&",
4502 PyMac_BuildPoint
, penLocation
);
4506 static PyObject
*Qd_IsPortRegionBeingDefined(PyObject
*_self
, PyObject
*_args
)
4508 PyObject
*_res
= NULL
;
4511 #ifndef IsPortRegionBeingDefined
4512 PyMac_PRECHECK(IsPortRegionBeingDefined
);
4514 if (!PyArg_ParseTuple(_args
, "O&",
4515 GrafObj_Convert
, &port
))
4517 _rv
= IsPortRegionBeingDefined(port
);
4518 _res
= Py_BuildValue("b",
4523 static PyObject
*Qd_IsPortPictureBeingDefined(PyObject
*_self
, PyObject
*_args
)
4525 PyObject
*_res
= NULL
;
4528 #ifndef IsPortPictureBeingDefined
4529 PyMac_PRECHECK(IsPortPictureBeingDefined
);
4531 if (!PyArg_ParseTuple(_args
, "O&",
4532 GrafObj_Convert
, &port
))
4534 _rv
= IsPortPictureBeingDefined(port
);
4535 _res
= Py_BuildValue("b",
4540 #if TARGET_API_MAC_CARBON
4542 static PyObject
*Qd_IsPortPolyBeingDefined(PyObject
*_self
, PyObject
*_args
)
4544 PyObject
*_res
= NULL
;
4547 #ifndef IsPortPolyBeingDefined
4548 PyMac_PRECHECK(IsPortPolyBeingDefined
);
4550 if (!PyArg_ParseTuple(_args
, "O&",
4551 GrafObj_Convert
, &port
))
4553 _rv
= IsPortPolyBeingDefined(port
);
4554 _res
= Py_BuildValue("b",
4560 #if TARGET_API_MAC_CARBON
4562 static PyObject
*Qd_IsPortOffscreen(PyObject
*_self
, PyObject
*_args
)
4564 PyObject
*_res
= NULL
;
4567 #ifndef IsPortOffscreen
4568 PyMac_PRECHECK(IsPortOffscreen
);
4570 if (!PyArg_ParseTuple(_args
, "O&",
4571 GrafObj_Convert
, &port
))
4573 _rv
= IsPortOffscreen(port
);
4574 _res
= Py_BuildValue("b",
4580 #if TARGET_API_MAC_CARBON
4582 static PyObject
*Qd_IsPortColor(PyObject
*_self
, PyObject
*_args
)
4584 PyObject
*_res
= NULL
;
4588 PyMac_PRECHECK(IsPortColor
);
4590 if (!PyArg_ParseTuple(_args
, "O&",
4591 GrafObj_Convert
, &port
))
4593 _rv
= IsPortColor(port
);
4594 _res
= Py_BuildValue("b",
4600 static PyObject
*Qd_SetPortBounds(PyObject
*_self
, PyObject
*_args
)
4602 PyObject
*_res
= NULL
;
4605 #ifndef SetPortBounds
4606 PyMac_PRECHECK(SetPortBounds
);
4608 if (!PyArg_ParseTuple(_args
, "O&O&",
4609 GrafObj_Convert
, &port
,
4610 PyMac_GetRect
, &rect
))
4619 static PyObject
*Qd_SetPortOpColor(PyObject
*_self
, PyObject
*_args
)
4621 PyObject
*_res
= NULL
;
4624 #ifndef SetPortOpColor
4625 PyMac_PRECHECK(SetPortOpColor
);
4627 if (!PyArg_ParseTuple(_args
, "O&O&",
4628 GrafObj_Convert
, &port
,
4629 QdRGB_Convert
, &opColor
))
4631 SetPortOpColor(port
,
4638 static PyObject
*Qd_SetPortVisibleRegion(PyObject
*_self
, PyObject
*_args
)
4640 PyObject
*_res
= NULL
;
4643 #ifndef SetPortVisibleRegion
4644 PyMac_PRECHECK(SetPortVisibleRegion
);
4646 if (!PyArg_ParseTuple(_args
, "O&O&",
4647 GrafObj_Convert
, &port
,
4648 ResObj_Convert
, &visRgn
))
4650 SetPortVisibleRegion(port
,
4657 static PyObject
*Qd_SetPortClipRegion(PyObject
*_self
, PyObject
*_args
)
4659 PyObject
*_res
= NULL
;
4662 #ifndef SetPortClipRegion
4663 PyMac_PRECHECK(SetPortClipRegion
);
4665 if (!PyArg_ParseTuple(_args
, "O&O&",
4666 GrafObj_Convert
, &port
,
4667 ResObj_Convert
, &clipRgn
))
4669 SetPortClipRegion(port
,
4676 static PyObject
*Qd_SetPortPenPixPat(PyObject
*_self
, PyObject
*_args
)
4678 PyObject
*_res
= NULL
;
4680 PixPatHandle penPattern
;
4681 #ifndef SetPortPenPixPat
4682 PyMac_PRECHECK(SetPortPenPixPat
);
4684 if (!PyArg_ParseTuple(_args
, "O&O&",
4685 GrafObj_Convert
, &port
,
4686 ResObj_Convert
, &penPattern
))
4688 SetPortPenPixPat(port
,
4695 static PyObject
*Qd_SetPortFillPixPat(PyObject
*_self
, PyObject
*_args
)
4697 PyObject
*_res
= NULL
;
4699 PixPatHandle penPattern
;
4700 #ifndef SetPortFillPixPat
4701 PyMac_PRECHECK(SetPortFillPixPat
);
4703 if (!PyArg_ParseTuple(_args
, "O&O&",
4704 GrafObj_Convert
, &port
,
4705 ResObj_Convert
, &penPattern
))
4707 SetPortFillPixPat(port
,
4714 static PyObject
*Qd_SetPortBackPixPat(PyObject
*_self
, PyObject
*_args
)
4716 PyObject
*_res
= NULL
;
4718 PixPatHandle backPattern
;
4719 #ifndef SetPortBackPixPat
4720 PyMac_PRECHECK(SetPortBackPixPat
);
4722 if (!PyArg_ParseTuple(_args
, "O&O&",
4723 GrafObj_Convert
, &port
,
4724 ResObj_Convert
, &backPattern
))
4726 SetPortBackPixPat(port
,
4733 static PyObject
*Qd_SetPortPenSize(PyObject
*_self
, PyObject
*_args
)
4735 PyObject
*_res
= NULL
;
4738 #ifndef SetPortPenSize
4739 PyMac_PRECHECK(SetPortPenSize
);
4741 if (!PyArg_ParseTuple(_args
, "O&O&",
4742 GrafObj_Convert
, &port
,
4743 PyMac_GetPoint
, &penSize
))
4745 SetPortPenSize(port
,
4752 static PyObject
*Qd_SetPortPenMode(PyObject
*_self
, PyObject
*_args
)
4754 PyObject
*_res
= NULL
;
4757 #ifndef SetPortPenMode
4758 PyMac_PRECHECK(SetPortPenMode
);
4760 if (!PyArg_ParseTuple(_args
, "O&l",
4761 GrafObj_Convert
, &port
,
4764 SetPortPenMode(port
,
4771 static PyObject
*Qd_SetPortFracHPenLocation(PyObject
*_self
, PyObject
*_args
)
4773 PyObject
*_res
= NULL
;
4776 #ifndef SetPortFracHPenLocation
4777 PyMac_PRECHECK(SetPortFracHPenLocation
);
4779 if (!PyArg_ParseTuple(_args
, "O&h",
4780 GrafObj_Convert
, &port
,
4783 SetPortFracHPenLocation(port
,
4790 static PyObject
*Qd_GetPixBounds(PyObject
*_self
, PyObject
*_args
)
4792 PyObject
*_res
= NULL
;
4793 PixMapHandle pixMap
;
4795 #ifndef GetPixBounds
4796 PyMac_PRECHECK(GetPixBounds
);
4798 if (!PyArg_ParseTuple(_args
, "O&",
4799 ResObj_Convert
, &pixMap
))
4801 GetPixBounds(pixMap
,
4803 _res
= Py_BuildValue("O&",
4804 PyMac_BuildRect
, &bounds
);
4808 static PyObject
*Qd_GetPixDepth(PyObject
*_self
, PyObject
*_args
)
4810 PyObject
*_res
= NULL
;
4812 PixMapHandle pixMap
;
4814 PyMac_PRECHECK(GetPixDepth
);
4816 if (!PyArg_ParseTuple(_args
, "O&",
4817 ResObj_Convert
, &pixMap
))
4819 _rv
= GetPixDepth(pixMap
);
4820 _res
= Py_BuildValue("h",
4825 static PyObject
*Qd_GetQDGlobalsRandomSeed(PyObject
*_self
, PyObject
*_args
)
4827 PyObject
*_res
= NULL
;
4829 #ifndef GetQDGlobalsRandomSeed
4830 PyMac_PRECHECK(GetQDGlobalsRandomSeed
);
4832 if (!PyArg_ParseTuple(_args
, ""))
4834 _rv
= GetQDGlobalsRandomSeed();
4835 _res
= Py_BuildValue("l",
4840 static PyObject
*Qd_GetQDGlobalsScreenBits(PyObject
*_self
, PyObject
*_args
)
4842 PyObject
*_res
= NULL
;
4844 #ifndef GetQDGlobalsScreenBits
4845 PyMac_PRECHECK(GetQDGlobalsScreenBits
);
4847 if (!PyArg_ParseTuple(_args
, ""))
4849 GetQDGlobalsScreenBits(&screenBits
);
4850 _res
= Py_BuildValue("O&",
4851 BMObj_NewCopied
, &screenBits
);
4855 static PyObject
*Qd_GetQDGlobalsArrow(PyObject
*_self
, PyObject
*_args
)
4857 PyObject
*_res
= NULL
;
4858 Cursor arrow__out__
;
4859 #ifndef GetQDGlobalsArrow
4860 PyMac_PRECHECK(GetQDGlobalsArrow
);
4862 if (!PyArg_ParseTuple(_args
, ""))
4864 GetQDGlobalsArrow(&arrow__out__
);
4865 _res
= Py_BuildValue("s#",
4866 (char *)&arrow__out__
, (int)sizeof(Cursor
));
4870 static PyObject
*Qd_GetQDGlobalsDarkGray(PyObject
*_self
, PyObject
*_args
)
4872 PyObject
*_res
= NULL
;
4873 Pattern dkGray__out__
;
4874 #ifndef GetQDGlobalsDarkGray
4875 PyMac_PRECHECK(GetQDGlobalsDarkGray
);
4877 if (!PyArg_ParseTuple(_args
, ""))
4879 GetQDGlobalsDarkGray(&dkGray__out__
);
4880 _res
= Py_BuildValue("s#",
4881 (char *)&dkGray__out__
, (int)sizeof(Pattern
));
4885 static PyObject
*Qd_GetQDGlobalsLightGray(PyObject
*_self
, PyObject
*_args
)
4887 PyObject
*_res
= NULL
;
4888 Pattern ltGray__out__
;
4889 #ifndef GetQDGlobalsLightGray
4890 PyMac_PRECHECK(GetQDGlobalsLightGray
);
4892 if (!PyArg_ParseTuple(_args
, ""))
4894 GetQDGlobalsLightGray(<Gray__out__
);
4895 _res
= Py_BuildValue("s#",
4896 (char *)<Gray__out__
, (int)sizeof(Pattern
));
4900 static PyObject
*Qd_GetQDGlobalsGray(PyObject
*_self
, PyObject
*_args
)
4902 PyObject
*_res
= NULL
;
4903 Pattern gray__out__
;
4904 #ifndef GetQDGlobalsGray
4905 PyMac_PRECHECK(GetQDGlobalsGray
);
4907 if (!PyArg_ParseTuple(_args
, ""))
4909 GetQDGlobalsGray(&gray__out__
);
4910 _res
= Py_BuildValue("s#",
4911 (char *)&gray__out__
, (int)sizeof(Pattern
));
4915 static PyObject
*Qd_GetQDGlobalsBlack(PyObject
*_self
, PyObject
*_args
)
4917 PyObject
*_res
= NULL
;
4918 Pattern black__out__
;
4919 #ifndef GetQDGlobalsBlack
4920 PyMac_PRECHECK(GetQDGlobalsBlack
);
4922 if (!PyArg_ParseTuple(_args
, ""))
4924 GetQDGlobalsBlack(&black__out__
);
4925 _res
= Py_BuildValue("s#",
4926 (char *)&black__out__
, (int)sizeof(Pattern
));
4930 static PyObject
*Qd_GetQDGlobalsWhite(PyObject
*_self
, PyObject
*_args
)
4932 PyObject
*_res
= NULL
;
4933 Pattern white__out__
;
4934 #ifndef GetQDGlobalsWhite
4935 PyMac_PRECHECK(GetQDGlobalsWhite
);
4937 if (!PyArg_ParseTuple(_args
, ""))
4939 GetQDGlobalsWhite(&white__out__
);
4940 _res
= Py_BuildValue("s#",
4941 (char *)&white__out__
, (int)sizeof(Pattern
));
4945 static PyObject
*Qd_GetQDGlobalsThePort(PyObject
*_self
, PyObject
*_args
)
4947 PyObject
*_res
= NULL
;
4949 #ifndef GetQDGlobalsThePort
4950 PyMac_PRECHECK(GetQDGlobalsThePort
);
4952 if (!PyArg_ParseTuple(_args
, ""))
4954 _rv
= GetQDGlobalsThePort();
4955 _res
= Py_BuildValue("O&",
4960 static PyObject
*Qd_SetQDGlobalsRandomSeed(PyObject
*_self
, PyObject
*_args
)
4962 PyObject
*_res
= NULL
;
4964 #ifndef SetQDGlobalsRandomSeed
4965 PyMac_PRECHECK(SetQDGlobalsRandomSeed
);
4967 if (!PyArg_ParseTuple(_args
, "l",
4970 SetQDGlobalsRandomSeed(randomSeed
);
4976 static PyObject
*Qd_SetQDGlobalsArrow(PyObject
*_self
, PyObject
*_args
)
4978 PyObject
*_res
= NULL
;
4979 Cursor
*arrow__in__
;
4980 int arrow__in_len__
;
4981 #ifndef SetQDGlobalsArrow
4982 PyMac_PRECHECK(SetQDGlobalsArrow
);
4984 if (!PyArg_ParseTuple(_args
, "s#",
4985 (char **)&arrow__in__
, &arrow__in_len__
))
4987 if (arrow__in_len__
!= sizeof(Cursor
))
4989 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
4990 goto arrow__error__
;
4992 SetQDGlobalsArrow(arrow__in__
);
4999 static PyObject
*Qd_GetRegionBounds(PyObject
*_self
, PyObject
*_args
)
5001 PyObject
*_res
= NULL
;
5004 #ifndef GetRegionBounds
5005 PyMac_PRECHECK(GetRegionBounds
);
5007 if (!PyArg_ParseTuple(_args
, "O&",
5008 ResObj_Convert
, ®ion
))
5010 GetRegionBounds(region
,
5012 _res
= Py_BuildValue("O&",
5013 PyMac_BuildRect
, &bounds
);
5017 #if TARGET_API_MAC_CARBON
5019 static PyObject
*Qd_IsRegionRectangular(PyObject
*_self
, PyObject
*_args
)
5021 PyObject
*_res
= NULL
;
5024 #ifndef IsRegionRectangular
5025 PyMac_PRECHECK(IsRegionRectangular
);
5027 if (!PyArg_ParseTuple(_args
, "O&",
5028 ResObj_Convert
, ®ion
))
5030 _rv
= IsRegionRectangular(region
);
5031 _res
= Py_BuildValue("b",
5037 #if TARGET_API_MAC_CARBON
5039 static PyObject
*Qd_CreateNewPort(PyObject
*_self
, PyObject
*_args
)
5041 PyObject
*_res
= NULL
;
5043 #ifndef CreateNewPort
5044 PyMac_PRECHECK(CreateNewPort
);
5046 if (!PyArg_ParseTuple(_args
, ""))
5048 _rv
= CreateNewPort();
5049 _res
= Py_BuildValue("O&",
5055 #if TARGET_API_MAC_CARBON
5057 static PyObject
*Qd_DisposePort(PyObject
*_self
, PyObject
*_args
)
5059 PyObject
*_res
= NULL
;
5062 PyMac_PRECHECK(DisposePort
);
5064 if (!PyArg_ParseTuple(_args
, "O&",
5065 GrafObj_Convert
, &port
))
5074 #if TARGET_API_MAC_CARBON
5076 static PyObject
*Qd_SetQDError(PyObject
*_self
, PyObject
*_args
)
5078 PyObject
*_res
= NULL
;
5081 PyMac_PRECHECK(SetQDError
);
5083 if (!PyArg_ParseTuple(_args
, "h",
5093 static PyObject
*Qd_QDIsPortBuffered(PyObject
*_self
, PyObject
*_args
)
5095 PyObject
*_res
= NULL
;
5098 #ifndef QDIsPortBuffered
5099 PyMac_PRECHECK(QDIsPortBuffered
);
5101 if (!PyArg_ParseTuple(_args
, "O&",
5102 GrafObj_Convert
, &port
))
5104 _rv
= QDIsPortBuffered(port
);
5105 _res
= Py_BuildValue("b",
5110 static PyObject
*Qd_QDIsPortBufferDirty(PyObject
*_self
, PyObject
*_args
)
5112 PyObject
*_res
= NULL
;
5115 #ifndef QDIsPortBufferDirty
5116 PyMac_PRECHECK(QDIsPortBufferDirty
);
5118 if (!PyArg_ParseTuple(_args
, "O&",
5119 GrafObj_Convert
, &port
))
5121 _rv
= QDIsPortBufferDirty(port
);
5122 _res
= Py_BuildValue("b",
5127 static PyObject
*Qd_QDFlushPortBuffer(PyObject
*_self
, PyObject
*_args
)
5129 PyObject
*_res
= NULL
;
5132 #ifndef QDFlushPortBuffer
5133 PyMac_PRECHECK(QDFlushPortBuffer
);
5135 if (!PyArg_ParseTuple(_args
, "O&O&",
5136 GrafObj_Convert
, &port
,
5137 OptResObj_Convert
, ®ion
))
5139 QDFlushPortBuffer(port
,
5146 #if TARGET_API_MAC_CARBON
5148 static PyObject
*Qd_QDGetDirtyRegion(PyObject
*_self
, PyObject
*_args
)
5150 PyObject
*_res
= NULL
;
5154 #ifndef QDGetDirtyRegion
5155 PyMac_PRECHECK(QDGetDirtyRegion
);
5157 if (!PyArg_ParseTuple(_args
, "O&O&",
5158 GrafObj_Convert
, &port
,
5159 ResObj_Convert
, &rgn
))
5161 _err
= QDGetDirtyRegion(port
,
5163 if (_err
!= noErr
) return PyMac_Error(_err
);
5170 #if TARGET_API_MAC_CARBON
5172 static PyObject
*Qd_QDSetDirtyRegion(PyObject
*_self
, PyObject
*_args
)
5174 PyObject
*_res
= NULL
;
5178 #ifndef QDSetDirtyRegion
5179 PyMac_PRECHECK(QDSetDirtyRegion
);
5181 if (!PyArg_ParseTuple(_args
, "O&O&",
5182 GrafObj_Convert
, &port
,
5183 ResObj_Convert
, &rgn
))
5185 _err
= QDSetDirtyRegion(port
,
5187 if (_err
!= noErr
) return PyMac_Error(_err
);
5194 static PyObject
*Qd_LMGetScrVRes(PyObject
*_self
, PyObject
*_args
)
5196 PyObject
*_res
= NULL
;
5198 #ifndef LMGetScrVRes
5199 PyMac_PRECHECK(LMGetScrVRes
);
5201 if (!PyArg_ParseTuple(_args
, ""))
5203 _rv
= LMGetScrVRes();
5204 _res
= Py_BuildValue("h",
5209 static PyObject
*Qd_LMSetScrVRes(PyObject
*_self
, PyObject
*_args
)
5211 PyObject
*_res
= NULL
;
5213 #ifndef LMSetScrVRes
5214 PyMac_PRECHECK(LMSetScrVRes
);
5216 if (!PyArg_ParseTuple(_args
, "h",
5219 LMSetScrVRes(value
);
5225 static PyObject
*Qd_LMGetScrHRes(PyObject
*_self
, PyObject
*_args
)
5227 PyObject
*_res
= NULL
;
5229 #ifndef LMGetScrHRes
5230 PyMac_PRECHECK(LMGetScrHRes
);
5232 if (!PyArg_ParseTuple(_args
, ""))
5234 _rv
= LMGetScrHRes();
5235 _res
= Py_BuildValue("h",
5240 static PyObject
*Qd_LMSetScrHRes(PyObject
*_self
, PyObject
*_args
)
5242 PyObject
*_res
= NULL
;
5244 #ifndef LMSetScrHRes
5245 PyMac_PRECHECK(LMSetScrHRes
);
5247 if (!PyArg_ParseTuple(_args
, "h",
5250 LMSetScrHRes(value
);
5256 static PyObject
*Qd_LMGetMainDevice(PyObject
*_self
, PyObject
*_args
)
5258 PyObject
*_res
= NULL
;
5260 #ifndef LMGetMainDevice
5261 PyMac_PRECHECK(LMGetMainDevice
);
5263 if (!PyArg_ParseTuple(_args
, ""))
5265 _rv
= LMGetMainDevice();
5266 _res
= Py_BuildValue("O&",
5271 static PyObject
*Qd_LMSetMainDevice(PyObject
*_self
, PyObject
*_args
)
5273 PyObject
*_res
= NULL
;
5275 #ifndef LMSetMainDevice
5276 PyMac_PRECHECK(LMSetMainDevice
);
5278 if (!PyArg_ParseTuple(_args
, "O&",
5279 ResObj_Convert
, &value
))
5281 LMSetMainDevice(value
);
5287 static PyObject
*Qd_LMGetDeviceList(PyObject
*_self
, PyObject
*_args
)
5289 PyObject
*_res
= NULL
;
5291 #ifndef LMGetDeviceList
5292 PyMac_PRECHECK(LMGetDeviceList
);
5294 if (!PyArg_ParseTuple(_args
, ""))
5296 _rv
= LMGetDeviceList();
5297 _res
= Py_BuildValue("O&",
5302 static PyObject
*Qd_LMSetDeviceList(PyObject
*_self
, PyObject
*_args
)
5304 PyObject
*_res
= NULL
;
5306 #ifndef LMSetDeviceList
5307 PyMac_PRECHECK(LMSetDeviceList
);
5309 if (!PyArg_ParseTuple(_args
, "O&",
5310 ResObj_Convert
, &value
))
5312 LMSetDeviceList(value
);
5318 static PyObject
*Qd_LMGetQDColors(PyObject
*_self
, PyObject
*_args
)
5320 PyObject
*_res
= NULL
;
5322 #ifndef LMGetQDColors
5323 PyMac_PRECHECK(LMGetQDColors
);
5325 if (!PyArg_ParseTuple(_args
, ""))
5327 _rv
= LMGetQDColors();
5328 _res
= Py_BuildValue("O&",
5333 static PyObject
*Qd_LMSetQDColors(PyObject
*_self
, PyObject
*_args
)
5335 PyObject
*_res
= NULL
;
5337 #ifndef LMSetQDColors
5338 PyMac_PRECHECK(LMSetQDColors
);
5340 if (!PyArg_ParseTuple(_args
, "O&",
5341 ResObj_Convert
, &value
))
5343 LMSetQDColors(value
);
5349 static PyObject
*Qd_LMGetWidthListHand(PyObject
*_self
, PyObject
*_args
)
5351 PyObject
*_res
= NULL
;
5353 #ifndef LMGetWidthListHand
5354 PyMac_PRECHECK(LMGetWidthListHand
);
5356 if (!PyArg_ParseTuple(_args
, ""))
5358 _rv
= LMGetWidthListHand();
5359 _res
= Py_BuildValue("O&",
5364 static PyObject
*Qd_LMSetWidthListHand(PyObject
*_self
, PyObject
*_args
)
5366 PyObject
*_res
= NULL
;
5368 #ifndef LMSetWidthListHand
5369 PyMac_PRECHECK(LMSetWidthListHand
);
5371 if (!PyArg_ParseTuple(_args
, "O&",
5372 ResObj_Convert
, &value
))
5374 LMSetWidthListHand(value
);
5380 static PyObject
*Qd_LMGetHiliteMode(PyObject
*_self
, PyObject
*_args
)
5382 PyObject
*_res
= NULL
;
5384 #ifndef LMGetHiliteMode
5385 PyMac_PRECHECK(LMGetHiliteMode
);
5387 if (!PyArg_ParseTuple(_args
, ""))
5389 _rv
= LMGetHiliteMode();
5390 _res
= Py_BuildValue("b",
5395 static PyObject
*Qd_LMSetHiliteMode(PyObject
*_self
, PyObject
*_args
)
5397 PyObject
*_res
= NULL
;
5399 #ifndef LMSetHiliteMode
5400 PyMac_PRECHECK(LMSetHiliteMode
);
5402 if (!PyArg_ParseTuple(_args
, "b",
5405 LMSetHiliteMode(value
);
5411 static PyObject
*Qd_LMGetWidthTabHandle(PyObject
*_self
, PyObject
*_args
)
5413 PyObject
*_res
= NULL
;
5415 #ifndef LMGetWidthTabHandle
5416 PyMac_PRECHECK(LMGetWidthTabHandle
);
5418 if (!PyArg_ParseTuple(_args
, ""))
5420 _rv
= LMGetWidthTabHandle();
5421 _res
= Py_BuildValue("O&",
5426 static PyObject
*Qd_LMSetWidthTabHandle(PyObject
*_self
, PyObject
*_args
)
5428 PyObject
*_res
= NULL
;
5430 #ifndef LMSetWidthTabHandle
5431 PyMac_PRECHECK(LMSetWidthTabHandle
);
5433 if (!PyArg_ParseTuple(_args
, "O&",
5434 ResObj_Convert
, &value
))
5436 LMSetWidthTabHandle(value
);
5442 static PyObject
*Qd_LMGetLastSPExtra(PyObject
*_self
, PyObject
*_args
)
5444 PyObject
*_res
= NULL
;
5446 #ifndef LMGetLastSPExtra
5447 PyMac_PRECHECK(LMGetLastSPExtra
);
5449 if (!PyArg_ParseTuple(_args
, ""))
5451 _rv
= LMGetLastSPExtra();
5452 _res
= Py_BuildValue("l",
5457 static PyObject
*Qd_LMSetLastSPExtra(PyObject
*_self
, PyObject
*_args
)
5459 PyObject
*_res
= NULL
;
5461 #ifndef LMSetLastSPExtra
5462 PyMac_PRECHECK(LMSetLastSPExtra
);
5464 if (!PyArg_ParseTuple(_args
, "l",
5467 LMSetLastSPExtra(value
);
5473 static PyObject
*Qd_LMGetLastFOND(PyObject
*_self
, PyObject
*_args
)
5475 PyObject
*_res
= NULL
;
5477 #ifndef LMGetLastFOND
5478 PyMac_PRECHECK(LMGetLastFOND
);
5480 if (!PyArg_ParseTuple(_args
, ""))
5482 _rv
= LMGetLastFOND();
5483 _res
= Py_BuildValue("O&",
5488 static PyObject
*Qd_LMSetLastFOND(PyObject
*_self
, PyObject
*_args
)
5490 PyObject
*_res
= NULL
;
5492 #ifndef LMSetLastFOND
5493 PyMac_PRECHECK(LMSetLastFOND
);
5495 if (!PyArg_ParseTuple(_args
, "O&",
5496 ResObj_Convert
, &value
))
5498 LMSetLastFOND(value
);
5504 static PyObject
*Qd_LMGetFractEnable(PyObject
*_self
, PyObject
*_args
)
5506 PyObject
*_res
= NULL
;
5508 #ifndef LMGetFractEnable
5509 PyMac_PRECHECK(LMGetFractEnable
);
5511 if (!PyArg_ParseTuple(_args
, ""))
5513 _rv
= LMGetFractEnable();
5514 _res
= Py_BuildValue("b",
5519 static PyObject
*Qd_LMSetFractEnable(PyObject
*_self
, PyObject
*_args
)
5521 PyObject
*_res
= NULL
;
5523 #ifndef LMSetFractEnable
5524 PyMac_PRECHECK(LMSetFractEnable
);
5526 if (!PyArg_ParseTuple(_args
, "b",
5529 LMSetFractEnable(value
);
5535 static PyObject
*Qd_LMGetTheGDevice(PyObject
*_self
, PyObject
*_args
)
5537 PyObject
*_res
= NULL
;
5539 #ifndef LMGetTheGDevice
5540 PyMac_PRECHECK(LMGetTheGDevice
);
5542 if (!PyArg_ParseTuple(_args
, ""))
5544 _rv
= LMGetTheGDevice();
5545 _res
= Py_BuildValue("O&",
5550 static PyObject
*Qd_LMSetTheGDevice(PyObject
*_self
, PyObject
*_args
)
5552 PyObject
*_res
= NULL
;
5554 #ifndef LMSetTheGDevice
5555 PyMac_PRECHECK(LMSetTheGDevice
);
5557 if (!PyArg_ParseTuple(_args
, "O&",
5558 ResObj_Convert
, &value
))
5560 LMSetTheGDevice(value
);
5566 static PyObject
*Qd_LMGetHiliteRGB(PyObject
*_self
, PyObject
*_args
)
5568 PyObject
*_res
= NULL
;
5569 RGBColor hiliteRGBValue
;
5570 #ifndef LMGetHiliteRGB
5571 PyMac_PRECHECK(LMGetHiliteRGB
);
5573 if (!PyArg_ParseTuple(_args
, ""))
5575 LMGetHiliteRGB(&hiliteRGBValue
);
5576 _res
= Py_BuildValue("O&",
5577 QdRGB_New
, &hiliteRGBValue
);
5581 static PyObject
*Qd_LMSetHiliteRGB(PyObject
*_self
, PyObject
*_args
)
5583 PyObject
*_res
= NULL
;
5584 RGBColor hiliteRGBValue
;
5585 #ifndef LMSetHiliteRGB
5586 PyMac_PRECHECK(LMSetHiliteRGB
);
5588 if (!PyArg_ParseTuple(_args
, "O&",
5589 QdRGB_Convert
, &hiliteRGBValue
))
5591 LMSetHiliteRGB(&hiliteRGBValue
);
5597 static PyObject
*Qd_LMGetCursorNew(PyObject
*_self
, PyObject
*_args
)
5599 PyObject
*_res
= NULL
;
5601 #ifndef LMGetCursorNew
5602 PyMac_PRECHECK(LMGetCursorNew
);
5604 if (!PyArg_ParseTuple(_args
, ""))
5606 _rv
= LMGetCursorNew();
5607 _res
= Py_BuildValue("b",
5612 static PyObject
*Qd_LMSetCursorNew(PyObject
*_self
, PyObject
*_args
)
5614 PyObject
*_res
= NULL
;
5616 #ifndef LMSetCursorNew
5617 PyMac_PRECHECK(LMSetCursorNew
);
5619 if (!PyArg_ParseTuple(_args
, "b",
5622 LMSetCursorNew(value
);
5628 static PyObject
*Qd_TextFont(PyObject
*_self
, PyObject
*_args
)
5630 PyObject
*_res
= NULL
;
5633 PyMac_PRECHECK(TextFont
);
5635 if (!PyArg_ParseTuple(_args
, "h",
5644 static PyObject
*Qd_TextFace(PyObject
*_self
, PyObject
*_args
)
5646 PyObject
*_res
= NULL
;
5647 StyleParameter face
;
5649 PyMac_PRECHECK(TextFace
);
5651 if (!PyArg_ParseTuple(_args
, "h",
5660 static PyObject
*Qd_TextMode(PyObject
*_self
, PyObject
*_args
)
5662 PyObject
*_res
= NULL
;
5665 PyMac_PRECHECK(TextMode
);
5667 if (!PyArg_ParseTuple(_args
, "h",
5676 static PyObject
*Qd_TextSize(PyObject
*_self
, PyObject
*_args
)
5678 PyObject
*_res
= NULL
;
5681 PyMac_PRECHECK(TextSize
);
5683 if (!PyArg_ParseTuple(_args
, "h",
5692 static PyObject
*Qd_SpaceExtra(PyObject
*_self
, PyObject
*_args
)
5694 PyObject
*_res
= NULL
;
5697 PyMac_PRECHECK(SpaceExtra
);
5699 if (!PyArg_ParseTuple(_args
, "O&",
5700 PyMac_GetFixed
, &extra
))
5708 static PyObject
*Qd_DrawChar(PyObject
*_self
, PyObject
*_args
)
5710 PyObject
*_res
= NULL
;
5713 PyMac_PRECHECK(DrawChar
);
5715 if (!PyArg_ParseTuple(_args
, "h",
5724 static PyObject
*Qd_DrawString(PyObject
*_self
, PyObject
*_args
)
5726 PyObject
*_res
= NULL
;
5729 PyMac_PRECHECK(DrawString
);
5731 if (!PyArg_ParseTuple(_args
, "O&",
5732 PyMac_GetStr255
, s
))
5740 static PyObject
*Qd_MacDrawText(PyObject
*_self
, PyObject
*_args
)
5742 PyObject
*_res
= NULL
;
5743 char *textBuf__in__
;
5744 int textBuf__in_len__
;
5748 PyMac_PRECHECK(MacDrawText
);
5750 if (!PyArg_ParseTuple(_args
, "s#hh",
5751 &textBuf__in__
, &textBuf__in_len__
,
5755 /* Fool compiler warnings */
5756 textBuf__in_len__
= textBuf__in_len__
;
5757 MacDrawText(textBuf__in__
,
5765 static PyObject
*Qd_CharWidth(PyObject
*_self
, PyObject
*_args
)
5767 PyObject
*_res
= NULL
;
5771 PyMac_PRECHECK(CharWidth
);
5773 if (!PyArg_ParseTuple(_args
, "h",
5776 _rv
= CharWidth(ch
);
5777 _res
= Py_BuildValue("h",
5782 static PyObject
*Qd_StringWidth(PyObject
*_self
, PyObject
*_args
)
5784 PyObject
*_res
= NULL
;
5788 PyMac_PRECHECK(StringWidth
);
5790 if (!PyArg_ParseTuple(_args
, "O&",
5791 PyMac_GetStr255
, s
))
5793 _rv
= StringWidth(s
);
5794 _res
= Py_BuildValue("h",
5799 static PyObject
*Qd_TextWidth(PyObject
*_self
, PyObject
*_args
)
5801 PyObject
*_res
= NULL
;
5803 char *textBuf__in__
;
5804 int textBuf__in_len__
;
5808 PyMac_PRECHECK(TextWidth
);
5810 if (!PyArg_ParseTuple(_args
, "s#hh",
5811 &textBuf__in__
, &textBuf__in_len__
,
5815 /* Fool compiler warnings */
5816 textBuf__in_len__
= textBuf__in_len__
;
5817 _rv
= TextWidth(textBuf__in__
,
5820 _res
= Py_BuildValue("h",
5825 static PyObject
*Qd_GetFontInfo(PyObject
*_self
, PyObject
*_args
)
5827 PyObject
*_res
= NULL
;
5830 PyMac_PRECHECK(GetFontInfo
);
5832 if (!PyArg_ParseTuple(_args
, ""))
5835 _res
= Py_BuildValue("O&",
5840 static PyObject
*Qd_CharExtra(PyObject
*_self
, PyObject
*_args
)
5842 PyObject
*_res
= NULL
;
5845 PyMac_PRECHECK(CharExtra
);
5847 if (!PyArg_ParseTuple(_args
, "O&",
5848 PyMac_GetFixed
, &extra
))
5856 static PyObject
*Qd_TruncString(PyObject
*_self
, PyObject
*_args
)
5858 PyObject
*_res
= NULL
;
5862 TruncCode truncWhere
;
5864 PyMac_PRECHECK(TruncString
);
5866 if (!PyArg_ParseTuple(_args
, "hO&h",
5868 PyMac_GetStr255
, theString
,
5871 _rv
= TruncString(width
,
5874 _res
= Py_BuildValue("h",
5879 static PyObject
*Qd_SetPort(PyObject
*_self
, PyObject
*_args
)
5881 PyObject
*_res
= NULL
;
5884 PyMac_PRECHECK(SetPort
);
5886 if (!PyArg_ParseTuple(_args
, "O&",
5887 GrafObj_Convert
, &thePort
))
5895 static PyObject
*Qd_GetCursor(PyObject
*_self
, PyObject
*_args
)
5897 PyObject
*_res
= NULL
;
5901 PyMac_PRECHECK(GetCursor
);
5903 if (!PyArg_ParseTuple(_args
, "h",
5906 _rv
= GetCursor(cursorID
);
5907 _res
= Py_BuildValue("O&",
5912 static PyObject
*Qd_SetCursor(PyObject
*_self
, PyObject
*_args
)
5914 PyObject
*_res
= NULL
;
5918 PyMac_PRECHECK(SetCursor
);
5920 if (!PyArg_ParseTuple(_args
, "s#",
5921 (char **)&crsr__in__
, &crsr__in_len__
))
5923 if (crsr__in_len__
!= sizeof(Cursor
))
5925 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Cursor)");
5928 SetCursor(crsr__in__
);
5935 static PyObject
*Qd_ShowCursor(PyObject
*_self
, PyObject
*_args
)
5937 PyObject
*_res
= NULL
;
5939 PyMac_PRECHECK(ShowCursor
);
5941 if (!PyArg_ParseTuple(_args
, ""))
5949 static PyObject
*Qd_LineTo(PyObject
*_self
, PyObject
*_args
)
5951 PyObject
*_res
= NULL
;
5955 PyMac_PRECHECK(LineTo
);
5957 if (!PyArg_ParseTuple(_args
, "hh",
5968 static PyObject
*Qd_SetRect(PyObject
*_self
, PyObject
*_args
)
5970 PyObject
*_res
= NULL
;
5977 PyMac_PRECHECK(SetRect
);
5979 if (!PyArg_ParseTuple(_args
, "hhhh",
5990 _res
= Py_BuildValue("O&",
5991 PyMac_BuildRect
, &r
);
5995 static PyObject
*Qd_OffsetRect(PyObject
*_self
, PyObject
*_args
)
5997 PyObject
*_res
= NULL
;
6002 PyMac_PRECHECK(OffsetRect
);
6004 if (!PyArg_ParseTuple(_args
, "O&hh",
6012 _res
= Py_BuildValue("O&",
6013 PyMac_BuildRect
, &r
);
6017 static PyObject
*Qd_InsetRect(PyObject
*_self
, PyObject
*_args
)
6019 PyObject
*_res
= NULL
;
6024 PyMac_PRECHECK(InsetRect
);
6026 if (!PyArg_ParseTuple(_args
, "O&hh",
6034 _res
= Py_BuildValue("O&",
6035 PyMac_BuildRect
, &r
);
6039 static PyObject
*Qd_UnionRect(PyObject
*_self
, PyObject
*_args
)
6041 PyObject
*_res
= NULL
;
6046 PyMac_PRECHECK(UnionRect
);
6048 if (!PyArg_ParseTuple(_args
, "O&O&",
6049 PyMac_GetRect
, &src1
,
6050 PyMac_GetRect
, &src2
))
6055 _res
= Py_BuildValue("O&",
6056 PyMac_BuildRect
, &dstRect
);
6060 static PyObject
*Qd_EqualRect(PyObject
*_self
, PyObject
*_args
)
6062 PyObject
*_res
= NULL
;
6067 PyMac_PRECHECK(EqualRect
);
6069 if (!PyArg_ParseTuple(_args
, "O&O&",
6070 PyMac_GetRect
, &rect1
,
6071 PyMac_GetRect
, &rect2
))
6073 _rv
= EqualRect(&rect1
,
6075 _res
= Py_BuildValue("b",
6080 static PyObject
*Qd_FrameRect(PyObject
*_self
, PyObject
*_args
)
6082 PyObject
*_res
= NULL
;
6085 PyMac_PRECHECK(FrameRect
);
6087 if (!PyArg_ParseTuple(_args
, "O&",
6096 static PyObject
*Qd_InvertRect(PyObject
*_self
, PyObject
*_args
)
6098 PyObject
*_res
= NULL
;
6101 PyMac_PRECHECK(InvertRect
);
6103 if (!PyArg_ParseTuple(_args
, "O&",
6112 static PyObject
*Qd_FillRect(PyObject
*_self
, PyObject
*_args
)
6114 PyObject
*_res
= NULL
;
6119 PyMac_PRECHECK(FillRect
);
6121 if (!PyArg_ParseTuple(_args
, "O&s#",
6123 (char **)&pat__in__
, &pat__in_len__
))
6125 if (pat__in_len__
!= sizeof(Pattern
))
6127 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
6138 static PyObject
*Qd_CopyRgn(PyObject
*_self
, PyObject
*_args
)
6140 PyObject
*_res
= NULL
;
6144 PyMac_PRECHECK(CopyRgn
);
6146 if (!PyArg_ParseTuple(_args
, "O&O&",
6147 ResObj_Convert
, &srcRgn
,
6148 ResObj_Convert
, &dstRgn
))
6157 static PyObject
*Qd_SetRectRgn(PyObject
*_self
, PyObject
*_args
)
6159 PyObject
*_res
= NULL
;
6166 PyMac_PRECHECK(SetRectRgn
);
6168 if (!PyArg_ParseTuple(_args
, "O&hhhh",
6169 ResObj_Convert
, &rgn
,
6185 static PyObject
*Qd_OffsetRgn(PyObject
*_self
, PyObject
*_args
)
6187 PyObject
*_res
= NULL
;
6192 PyMac_PRECHECK(OffsetRgn
);
6194 if (!PyArg_ParseTuple(_args
, "O&hh",
6195 ResObj_Convert
, &rgn
,
6207 static PyObject
*Qd_UnionRgn(PyObject
*_self
, PyObject
*_args
)
6209 PyObject
*_res
= NULL
;
6214 PyMac_PRECHECK(UnionRgn
);
6216 if (!PyArg_ParseTuple(_args
, "O&O&O&",
6217 ResObj_Convert
, &srcRgnA
,
6218 ResObj_Convert
, &srcRgnB
,
6219 ResObj_Convert
, &dstRgn
))
6229 static PyObject
*Qd_XorRgn(PyObject
*_self
, PyObject
*_args
)
6231 PyObject
*_res
= NULL
;
6236 PyMac_PRECHECK(XorRgn
);
6238 if (!PyArg_ParseTuple(_args
, "O&O&O&",
6239 ResObj_Convert
, &srcRgnA
,
6240 ResObj_Convert
, &srcRgnB
,
6241 ResObj_Convert
, &dstRgn
))
6251 static PyObject
*Qd_EqualRgn(PyObject
*_self
, PyObject
*_args
)
6253 PyObject
*_res
= NULL
;
6258 PyMac_PRECHECK(EqualRgn
);
6260 if (!PyArg_ParseTuple(_args
, "O&O&",
6261 ResObj_Convert
, &rgnA
,
6262 ResObj_Convert
, &rgnB
))
6264 _rv
= EqualRgn(rgnA
,
6266 _res
= Py_BuildValue("b",
6271 static PyObject
*Qd_FrameRgn(PyObject
*_self
, PyObject
*_args
)
6273 PyObject
*_res
= NULL
;
6276 PyMac_PRECHECK(FrameRgn
);
6278 if (!PyArg_ParseTuple(_args
, "O&",
6279 ResObj_Convert
, &rgn
))
6287 static PyObject
*Qd_PaintRgn(PyObject
*_self
, PyObject
*_args
)
6289 PyObject
*_res
= NULL
;
6292 PyMac_PRECHECK(PaintRgn
);
6294 if (!PyArg_ParseTuple(_args
, "O&",
6295 ResObj_Convert
, &rgn
))
6303 static PyObject
*Qd_InvertRgn(PyObject
*_self
, PyObject
*_args
)
6305 PyObject
*_res
= NULL
;
6308 PyMac_PRECHECK(InvertRgn
);
6310 if (!PyArg_ParseTuple(_args
, "O&",
6311 ResObj_Convert
, &rgn
))
6319 static PyObject
*Qd_FillRgn(PyObject
*_self
, PyObject
*_args
)
6321 PyObject
*_res
= NULL
;
6326 PyMac_PRECHECK(FillRgn
);
6328 if (!PyArg_ParseTuple(_args
, "O&s#",
6329 ResObj_Convert
, &rgn
,
6330 (char **)&pat__in__
, &pat__in_len__
))
6332 if (pat__in_len__
!= sizeof(Pattern
))
6334 PyErr_SetString(PyExc_TypeError
, "buffer length should be sizeof(Pattern)");
6345 static PyObject
*Qd_GetPixel(PyObject
*_self
, PyObject
*_args
)
6347 PyObject
*_res
= NULL
;
6352 PyMac_PRECHECK(GetPixel
);
6354 if (!PyArg_ParseTuple(_args
, "hh",
6360 _res
= Py_BuildValue("b",
6365 static PyObject
*Qd_PtInRect(PyObject
*_self
, PyObject
*_args
)
6367 PyObject
*_res
= NULL
;
6372 PyMac_PRECHECK(PtInRect
);
6374 if (!PyArg_ParseTuple(_args
, "O&O&",
6375 PyMac_GetPoint
, &pt
,
6380 _res
= Py_BuildValue("b",
6385 static PyObject
*Qd_DrawText(PyObject
*_self
, PyObject
*_args
)
6387 PyObject
*_res
= NULL
;
6388 char *textBuf__in__
;
6389 int textBuf__in_len__
;
6393 PyMac_PRECHECK(DrawText
);
6395 if (!PyArg_ParseTuple(_args
, "s#hh",
6396 &textBuf__in__
, &textBuf__in_len__
,
6400 /* Fool compiler warnings */
6401 textBuf__in_len__
= textBuf__in_len__
;
6402 DrawText(textBuf__in__
,
6410 static PyObject
*Qd_BitMap(PyObject
*_self
, PyObject
*_args
)
6412 PyObject
*_res
= NULL
;
6420 if ( !PyArg_ParseTuple(_args
, "O!iO&", &PyString_Type
, &source
, &rowbytes
, PyMac_GetRect
,
6423 data
= PyString_AsString(source
);
6424 if ((ptr
=(BitMap
*)malloc(sizeof(BitMap
))) == NULL
)
6425 return PyErr_NoMemory();
6426 ptr
->baseAddr
= (Ptr
)data
;
6427 ptr
->rowBytes
= rowbytes
;
6428 ptr
->bounds
= bounds
;
6429 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
6433 ((BitMapObject
*)_res
)->referred_object
= source
;
6435 ((BitMapObject
*)_res
)->referred_bitmap
= ptr
;
6440 static PyObject
*Qd_RawBitMap(PyObject
*_self
, PyObject
*_args
)
6442 PyObject
*_res
= NULL
;
6447 if ( !PyArg_ParseTuple(_args
, "O!", &PyString_Type
, &source
) )
6449 if ( PyString_Size(source
) != sizeof(BitMap
) && PyString_Size(source
) != sizeof(PixMap
) ) {
6450 PyErr_BadArgument();
6453 ptr
= (BitMapPtr
)PyString_AsString(source
);
6454 if ( (_res
= BMObj_New(ptr
)) == NULL
) {
6457 ((BitMapObject
*)_res
)->referred_object
= source
;
6463 static PyMethodDef Qd_methods
[] = {
6464 {"MacSetPort", (PyCFunction
)Qd_MacSetPort
, 1,
6465 PyDoc_STR("(GrafPtr port) -> None")},
6466 {"GetPort", (PyCFunction
)Qd_GetPort
, 1,
6467 PyDoc_STR("() -> (GrafPtr port)")},
6468 {"GrafDevice", (PyCFunction
)Qd_GrafDevice
, 1,
6469 PyDoc_STR("(short device) -> None")},
6470 {"SetPortBits", (PyCFunction
)Qd_SetPortBits
, 1,
6471 PyDoc_STR("(BitMapPtr bm) -> None")},
6472 {"PortSize", (PyCFunction
)Qd_PortSize
, 1,
6473 PyDoc_STR("(short width, short height) -> None")},
6474 {"MovePortTo", (PyCFunction
)Qd_MovePortTo
, 1,
6475 PyDoc_STR("(short leftGlobal, short topGlobal) -> None")},
6476 {"SetOrigin", (PyCFunction
)Qd_SetOrigin
, 1,
6477 PyDoc_STR("(short h, short v) -> None")},
6478 {"SetClip", (PyCFunction
)Qd_SetClip
, 1,
6479 PyDoc_STR("(RgnHandle rgn) -> None")},
6480 {"GetClip", (PyCFunction
)Qd_GetClip
, 1,
6481 PyDoc_STR("(RgnHandle rgn) -> None")},
6482 {"ClipRect", (PyCFunction
)Qd_ClipRect
, 1,
6483 PyDoc_STR("(Rect r) -> None")},
6484 {"BackPat", (PyCFunction
)Qd_BackPat
, 1,
6485 PyDoc_STR("(Pattern pat) -> None")},
6486 {"InitCursor", (PyCFunction
)Qd_InitCursor
, 1,
6487 PyDoc_STR("() -> None")},
6488 {"MacSetCursor", (PyCFunction
)Qd_MacSetCursor
, 1,
6489 PyDoc_STR("(Cursor crsr) -> None")},
6490 {"HideCursor", (PyCFunction
)Qd_HideCursor
, 1,
6491 PyDoc_STR("() -> None")},
6492 {"MacShowCursor", (PyCFunction
)Qd_MacShowCursor
, 1,
6493 PyDoc_STR("() -> None")},
6494 {"ObscureCursor", (PyCFunction
)Qd_ObscureCursor
, 1,
6495 PyDoc_STR("() -> None")},
6496 {"HidePen", (PyCFunction
)Qd_HidePen
, 1,
6497 PyDoc_STR("() -> None")},
6498 {"ShowPen", (PyCFunction
)Qd_ShowPen
, 1,
6499 PyDoc_STR("() -> None")},
6500 {"GetPen", (PyCFunction
)Qd_GetPen
, 1,
6501 PyDoc_STR("() -> (Point pt)")},
6502 {"GetPenState", (PyCFunction
)Qd_GetPenState
, 1,
6503 PyDoc_STR("() -> (PenState pnState)")},
6504 {"SetPenState", (PyCFunction
)Qd_SetPenState
, 1,
6505 PyDoc_STR("(PenState pnState) -> None")},
6506 {"PenSize", (PyCFunction
)Qd_PenSize
, 1,
6507 PyDoc_STR("(short width, short height) -> None")},
6508 {"PenMode", (PyCFunction
)Qd_PenMode
, 1,
6509 PyDoc_STR("(short mode) -> None")},
6510 {"PenPat", (PyCFunction
)Qd_PenPat
, 1,
6511 PyDoc_STR("(Pattern pat) -> None")},
6512 {"PenNormal", (PyCFunction
)Qd_PenNormal
, 1,
6513 PyDoc_STR("() -> None")},
6514 {"MoveTo", (PyCFunction
)Qd_MoveTo
, 1,
6515 PyDoc_STR("(short h, short v) -> None")},
6516 {"Move", (PyCFunction
)Qd_Move
, 1,
6517 PyDoc_STR("(short dh, short dv) -> None")},
6518 {"MacLineTo", (PyCFunction
)Qd_MacLineTo
, 1,
6519 PyDoc_STR("(short h, short v) -> None")},
6520 {"Line", (PyCFunction
)Qd_Line
, 1,
6521 PyDoc_STR("(short dh, short dv) -> None")},
6522 {"ForeColor", (PyCFunction
)Qd_ForeColor
, 1,
6523 PyDoc_STR("(long color) -> None")},
6524 {"BackColor", (PyCFunction
)Qd_BackColor
, 1,
6525 PyDoc_STR("(long color) -> None")},
6526 {"ColorBit", (PyCFunction
)Qd_ColorBit
, 1,
6527 PyDoc_STR("(short whichBit) -> None")},
6528 {"MacSetRect", (PyCFunction
)Qd_MacSetRect
, 1,
6529 PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")},
6530 {"MacOffsetRect", (PyCFunction
)Qd_MacOffsetRect
, 1,
6531 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
6532 {"MacInsetRect", (PyCFunction
)Qd_MacInsetRect
, 1,
6533 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
6534 {"SectRect", (PyCFunction
)Qd_SectRect
, 1,
6535 PyDoc_STR("(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)")},
6536 {"MacUnionRect", (PyCFunction
)Qd_MacUnionRect
, 1,
6537 PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")},
6538 {"MacEqualRect", (PyCFunction
)Qd_MacEqualRect
, 1,
6539 PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")},
6540 {"EmptyRect", (PyCFunction
)Qd_EmptyRect
, 1,
6541 PyDoc_STR("(Rect r) -> (Boolean _rv)")},
6542 {"MacFrameRect", (PyCFunction
)Qd_MacFrameRect
, 1,
6543 PyDoc_STR("(Rect r) -> None")},
6544 {"PaintRect", (PyCFunction
)Qd_PaintRect
, 1,
6545 PyDoc_STR("(Rect r) -> None")},
6546 {"EraseRect", (PyCFunction
)Qd_EraseRect
, 1,
6547 PyDoc_STR("(Rect r) -> None")},
6548 {"MacInvertRect", (PyCFunction
)Qd_MacInvertRect
, 1,
6549 PyDoc_STR("(Rect r) -> None")},
6550 {"MacFillRect", (PyCFunction
)Qd_MacFillRect
, 1,
6551 PyDoc_STR("(Rect r, Pattern pat) -> None")},
6552 {"FrameOval", (PyCFunction
)Qd_FrameOval
, 1,
6553 PyDoc_STR("(Rect r) -> None")},
6554 {"PaintOval", (PyCFunction
)Qd_PaintOval
, 1,
6555 PyDoc_STR("(Rect r) -> None")},
6556 {"EraseOval", (PyCFunction
)Qd_EraseOval
, 1,
6557 PyDoc_STR("(Rect r) -> None")},
6558 {"InvertOval", (PyCFunction
)Qd_InvertOval
, 1,
6559 PyDoc_STR("(Rect r) -> None")},
6560 {"FillOval", (PyCFunction
)Qd_FillOval
, 1,
6561 PyDoc_STR("(Rect r, Pattern pat) -> None")},
6562 {"FrameRoundRect", (PyCFunction
)Qd_FrameRoundRect
, 1,
6563 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6564 {"PaintRoundRect", (PyCFunction
)Qd_PaintRoundRect
, 1,
6565 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6566 {"EraseRoundRect", (PyCFunction
)Qd_EraseRoundRect
, 1,
6567 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6568 {"InvertRoundRect", (PyCFunction
)Qd_InvertRoundRect
, 1,
6569 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")},
6570 {"FillRoundRect", (PyCFunction
)Qd_FillRoundRect
, 1,
6571 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None")},
6572 {"FrameArc", (PyCFunction
)Qd_FrameArc
, 1,
6573 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6574 {"PaintArc", (PyCFunction
)Qd_PaintArc
, 1,
6575 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6576 {"EraseArc", (PyCFunction
)Qd_EraseArc
, 1,
6577 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6578 {"InvertArc", (PyCFunction
)Qd_InvertArc
, 1,
6579 PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")},
6580 {"FillArc", (PyCFunction
)Qd_FillArc
, 1,
6581 PyDoc_STR("(Rect r, short startAngle, short arcAngle, Pattern pat) -> None")},
6582 {"NewRgn", (PyCFunction
)Qd_NewRgn
, 1,
6583 PyDoc_STR("() -> (RgnHandle _rv)")},
6584 {"OpenRgn", (PyCFunction
)Qd_OpenRgn
, 1,
6585 PyDoc_STR("() -> None")},
6586 {"CloseRgn", (PyCFunction
)Qd_CloseRgn
, 1,
6587 PyDoc_STR("(RgnHandle dstRgn) -> None")},
6588 {"BitMapToRegion", (PyCFunction
)Qd_BitMapToRegion
, 1,
6589 PyDoc_STR("(RgnHandle region, BitMapPtr bMap) -> None")},
6591 #if TARGET_API_MAC_CARBON
6592 {"RgnToHandle", (PyCFunction
)Qd_RgnToHandle
, 1,
6593 PyDoc_STR("(RgnHandle region, Handle flattenedRgnDataHdl) -> None")},
6595 {"DisposeRgn", (PyCFunction
)Qd_DisposeRgn
, 1,
6596 PyDoc_STR("(RgnHandle rgn) -> None")},
6597 {"MacCopyRgn", (PyCFunction
)Qd_MacCopyRgn
, 1,
6598 PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")},
6599 {"SetEmptyRgn", (PyCFunction
)Qd_SetEmptyRgn
, 1,
6600 PyDoc_STR("(RgnHandle rgn) -> None")},
6601 {"MacSetRectRgn", (PyCFunction
)Qd_MacSetRectRgn
, 1,
6602 PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")},
6603 {"RectRgn", (PyCFunction
)Qd_RectRgn
, 1,
6604 PyDoc_STR("(RgnHandle rgn, Rect r) -> None")},
6605 {"MacOffsetRgn", (PyCFunction
)Qd_MacOffsetRgn
, 1,
6606 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
6607 {"InsetRgn", (PyCFunction
)Qd_InsetRgn
, 1,
6608 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
6609 {"SectRgn", (PyCFunction
)Qd_SectRgn
, 1,
6610 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6611 {"MacUnionRgn", (PyCFunction
)Qd_MacUnionRgn
, 1,
6612 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6613 {"DiffRgn", (PyCFunction
)Qd_DiffRgn
, 1,
6614 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6615 {"MacXorRgn", (PyCFunction
)Qd_MacXorRgn
, 1,
6616 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
6617 {"RectInRgn", (PyCFunction
)Qd_RectInRgn
, 1,
6618 PyDoc_STR("(Rect r, RgnHandle rgn) -> (Boolean _rv)")},
6619 {"MacEqualRgn", (PyCFunction
)Qd_MacEqualRgn
, 1,
6620 PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")},
6621 {"EmptyRgn", (PyCFunction
)Qd_EmptyRgn
, 1,
6622 PyDoc_STR("(RgnHandle rgn) -> (Boolean _rv)")},
6623 {"MacFrameRgn", (PyCFunction
)Qd_MacFrameRgn
, 1,
6624 PyDoc_STR("(RgnHandle rgn) -> None")},
6625 {"MacPaintRgn", (PyCFunction
)Qd_MacPaintRgn
, 1,
6626 PyDoc_STR("(RgnHandle rgn) -> None")},
6627 {"EraseRgn", (PyCFunction
)Qd_EraseRgn
, 1,
6628 PyDoc_STR("(RgnHandle rgn) -> None")},
6629 {"MacInvertRgn", (PyCFunction
)Qd_MacInvertRgn
, 1,
6630 PyDoc_STR("(RgnHandle rgn) -> None")},
6631 {"MacFillRgn", (PyCFunction
)Qd_MacFillRgn
, 1,
6632 PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")},
6633 {"ScrollRect", (PyCFunction
)Qd_ScrollRect
, 1,
6634 PyDoc_STR("(Rect r, short dh, short dv, RgnHandle updateRgn) -> None")},
6635 {"CopyBits", (PyCFunction
)Qd_CopyBits
, 1,
6636 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6637 {"CopyMask", (PyCFunction
)Qd_CopyMask
, 1,
6638 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None")},
6639 {"OpenPicture", (PyCFunction
)Qd_OpenPicture
, 1,
6640 PyDoc_STR("(Rect picFrame) -> (PicHandle _rv)")},
6641 {"PicComment", (PyCFunction
)Qd_PicComment
, 1,
6642 PyDoc_STR("(short kind, short dataSize, Handle dataHandle) -> None")},
6643 {"ClosePicture", (PyCFunction
)Qd_ClosePicture
, 1,
6644 PyDoc_STR("() -> None")},
6645 {"DrawPicture", (PyCFunction
)Qd_DrawPicture
, 1,
6646 PyDoc_STR("(PicHandle myPicture, Rect dstRect) -> None")},
6647 {"KillPicture", (PyCFunction
)Qd_KillPicture
, 1,
6648 PyDoc_STR("(PicHandle myPicture) -> None")},
6649 {"OpenPoly", (PyCFunction
)Qd_OpenPoly
, 1,
6650 PyDoc_STR("() -> (PolyHandle _rv)")},
6651 {"ClosePoly", (PyCFunction
)Qd_ClosePoly
, 1,
6652 PyDoc_STR("() -> None")},
6653 {"KillPoly", (PyCFunction
)Qd_KillPoly
, 1,
6654 PyDoc_STR("(PolyHandle poly) -> None")},
6655 {"OffsetPoly", (PyCFunction
)Qd_OffsetPoly
, 1,
6656 PyDoc_STR("(PolyHandle poly, short dh, short dv) -> None")},
6657 {"FramePoly", (PyCFunction
)Qd_FramePoly
, 1,
6658 PyDoc_STR("(PolyHandle poly) -> None")},
6659 {"PaintPoly", (PyCFunction
)Qd_PaintPoly
, 1,
6660 PyDoc_STR("(PolyHandle poly) -> None")},
6661 {"ErasePoly", (PyCFunction
)Qd_ErasePoly
, 1,
6662 PyDoc_STR("(PolyHandle poly) -> None")},
6663 {"InvertPoly", (PyCFunction
)Qd_InvertPoly
, 1,
6664 PyDoc_STR("(PolyHandle poly) -> None")},
6665 {"FillPoly", (PyCFunction
)Qd_FillPoly
, 1,
6666 PyDoc_STR("(PolyHandle poly, Pattern pat) -> None")},
6667 {"SetPt", (PyCFunction
)Qd_SetPt
, 1,
6668 PyDoc_STR("(short h, short v) -> (Point pt)")},
6669 {"LocalToGlobal", (PyCFunction
)Qd_LocalToGlobal
, 1,
6670 PyDoc_STR("(Point pt) -> (Point pt)")},
6671 {"GlobalToLocal", (PyCFunction
)Qd_GlobalToLocal
, 1,
6672 PyDoc_STR("(Point pt) -> (Point pt)")},
6673 {"Random", (PyCFunction
)Qd_Random
, 1,
6674 PyDoc_STR("() -> (short _rv)")},
6675 {"MacGetPixel", (PyCFunction
)Qd_MacGetPixel
, 1,
6676 PyDoc_STR("(short h, short v) -> (Boolean _rv)")},
6677 {"ScalePt", (PyCFunction
)Qd_ScalePt
, 1,
6678 PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")},
6679 {"MapPt", (PyCFunction
)Qd_MapPt
, 1,
6680 PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")},
6681 {"MapRect", (PyCFunction
)Qd_MapRect
, 1,
6682 PyDoc_STR("(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)")},
6683 {"MapRgn", (PyCFunction
)Qd_MapRgn
, 1,
6684 PyDoc_STR("(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None")},
6685 {"MapPoly", (PyCFunction
)Qd_MapPoly
, 1,
6686 PyDoc_STR("(PolyHandle poly, Rect srcRect, Rect dstRect) -> None")},
6687 {"StdBits", (PyCFunction
)Qd_StdBits
, 1,
6688 PyDoc_STR("(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6689 {"AddPt", (PyCFunction
)Qd_AddPt
, 1,
6690 PyDoc_STR("(Point src, Point dst) -> (Point dst)")},
6691 {"EqualPt", (PyCFunction
)Qd_EqualPt
, 1,
6692 PyDoc_STR("(Point pt1, Point pt2) -> (Boolean _rv)")},
6693 {"MacPtInRect", (PyCFunction
)Qd_MacPtInRect
, 1,
6694 PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")},
6695 {"Pt2Rect", (PyCFunction
)Qd_Pt2Rect
, 1,
6696 PyDoc_STR("(Point pt1, Point pt2) -> (Rect dstRect)")},
6697 {"PtToAngle", (PyCFunction
)Qd_PtToAngle
, 1,
6698 PyDoc_STR("(Rect r, Point pt) -> (short angle)")},
6699 {"SubPt", (PyCFunction
)Qd_SubPt
, 1,
6700 PyDoc_STR("(Point src, Point dst) -> (Point dst)")},
6701 {"PtInRgn", (PyCFunction
)Qd_PtInRgn
, 1,
6702 PyDoc_STR("(Point pt, RgnHandle rgn) -> (Boolean _rv)")},
6703 {"NewPixMap", (PyCFunction
)Qd_NewPixMap
, 1,
6704 PyDoc_STR("() -> (PixMapHandle _rv)")},
6705 {"DisposePixMap", (PyCFunction
)Qd_DisposePixMap
, 1,
6706 PyDoc_STR("(PixMapHandle pm) -> None")},
6707 {"CopyPixMap", (PyCFunction
)Qd_CopyPixMap
, 1,
6708 PyDoc_STR("(PixMapHandle srcPM, PixMapHandle dstPM) -> None")},
6709 {"NewPixPat", (PyCFunction
)Qd_NewPixPat
, 1,
6710 PyDoc_STR("() -> (PixPatHandle _rv)")},
6711 {"DisposePixPat", (PyCFunction
)Qd_DisposePixPat
, 1,
6712 PyDoc_STR("(PixPatHandle pp) -> None")},
6713 {"CopyPixPat", (PyCFunction
)Qd_CopyPixPat
, 1,
6714 PyDoc_STR("(PixPatHandle srcPP, PixPatHandle dstPP) -> None")},
6715 {"PenPixPat", (PyCFunction
)Qd_PenPixPat
, 1,
6716 PyDoc_STR("(PixPatHandle pp) -> None")},
6717 {"BackPixPat", (PyCFunction
)Qd_BackPixPat
, 1,
6718 PyDoc_STR("(PixPatHandle pp) -> None")},
6719 {"GetPixPat", (PyCFunction
)Qd_GetPixPat
, 1,
6720 PyDoc_STR("(short patID) -> (PixPatHandle _rv)")},
6721 {"MakeRGBPat", (PyCFunction
)Qd_MakeRGBPat
, 1,
6722 PyDoc_STR("(PixPatHandle pp, RGBColor myColor) -> None")},
6723 {"FillCRect", (PyCFunction
)Qd_FillCRect
, 1,
6724 PyDoc_STR("(Rect r, PixPatHandle pp) -> None")},
6725 {"FillCOval", (PyCFunction
)Qd_FillCOval
, 1,
6726 PyDoc_STR("(Rect r, PixPatHandle pp) -> None")},
6727 {"FillCRoundRect", (PyCFunction
)Qd_FillCRoundRect
, 1,
6728 PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None")},
6729 {"FillCArc", (PyCFunction
)Qd_FillCArc
, 1,
6730 PyDoc_STR("(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None")},
6731 {"FillCRgn", (PyCFunction
)Qd_FillCRgn
, 1,
6732 PyDoc_STR("(RgnHandle rgn, PixPatHandle pp) -> None")},
6733 {"FillCPoly", (PyCFunction
)Qd_FillCPoly
, 1,
6734 PyDoc_STR("(PolyHandle poly, PixPatHandle pp) -> None")},
6735 {"RGBForeColor", (PyCFunction
)Qd_RGBForeColor
, 1,
6736 PyDoc_STR("(RGBColor color) -> None")},
6737 {"RGBBackColor", (PyCFunction
)Qd_RGBBackColor
, 1,
6738 PyDoc_STR("(RGBColor color) -> None")},
6739 {"SetCPixel", (PyCFunction
)Qd_SetCPixel
, 1,
6740 PyDoc_STR("(short h, short v, RGBColor cPix) -> None")},
6741 {"SetPortPix", (PyCFunction
)Qd_SetPortPix
, 1,
6742 PyDoc_STR("(PixMapHandle pm) -> None")},
6743 {"GetCPixel", (PyCFunction
)Qd_GetCPixel
, 1,
6744 PyDoc_STR("(short h, short v) -> (RGBColor cPix)")},
6745 {"GetForeColor", (PyCFunction
)Qd_GetForeColor
, 1,
6746 PyDoc_STR("() -> (RGBColor color)")},
6747 {"GetBackColor", (PyCFunction
)Qd_GetBackColor
, 1,
6748 PyDoc_STR("() -> (RGBColor color)")},
6749 {"OpColor", (PyCFunction
)Qd_OpColor
, 1,
6750 PyDoc_STR("(RGBColor color) -> None")},
6751 {"HiliteColor", (PyCFunction
)Qd_HiliteColor
, 1,
6752 PyDoc_STR("(RGBColor color) -> None")},
6753 {"DisposeCTable", (PyCFunction
)Qd_DisposeCTable
, 1,
6754 PyDoc_STR("(CTabHandle cTable) -> None")},
6755 {"GetCTable", (PyCFunction
)Qd_GetCTable
, 1,
6756 PyDoc_STR("(short ctID) -> (CTabHandle _rv)")},
6757 {"GetCCursor", (PyCFunction
)Qd_GetCCursor
, 1,
6758 PyDoc_STR("(short crsrID) -> (CCrsrHandle _rv)")},
6759 {"SetCCursor", (PyCFunction
)Qd_SetCCursor
, 1,
6760 PyDoc_STR("(CCrsrHandle cCrsr) -> None")},
6761 {"AllocCursor", (PyCFunction
)Qd_AllocCursor
, 1,
6762 PyDoc_STR("() -> None")},
6763 {"DisposeCCursor", (PyCFunction
)Qd_DisposeCCursor
, 1,
6764 PyDoc_STR("(CCrsrHandle cCrsr) -> None")},
6765 {"GetMaxDevice", (PyCFunction
)Qd_GetMaxDevice
, 1,
6766 PyDoc_STR("(Rect globalRect) -> (GDHandle _rv)")},
6767 {"GetCTSeed", (PyCFunction
)Qd_GetCTSeed
, 1,
6768 PyDoc_STR("() -> (long _rv)")},
6769 {"GetDeviceList", (PyCFunction
)Qd_GetDeviceList
, 1,
6770 PyDoc_STR("() -> (GDHandle _rv)")},
6771 {"GetMainDevice", (PyCFunction
)Qd_GetMainDevice
, 1,
6772 PyDoc_STR("() -> (GDHandle _rv)")},
6773 {"GetNextDevice", (PyCFunction
)Qd_GetNextDevice
, 1,
6774 PyDoc_STR("(GDHandle curDevice) -> (GDHandle _rv)")},
6775 {"TestDeviceAttribute", (PyCFunction
)Qd_TestDeviceAttribute
, 1,
6776 PyDoc_STR("(GDHandle gdh, short attribute) -> (Boolean _rv)")},
6777 {"SetDeviceAttribute", (PyCFunction
)Qd_SetDeviceAttribute
, 1,
6778 PyDoc_STR("(GDHandle gdh, short attribute, Boolean value) -> None")},
6779 {"InitGDevice", (PyCFunction
)Qd_InitGDevice
, 1,
6780 PyDoc_STR("(short qdRefNum, long mode, GDHandle gdh) -> None")},
6781 {"NewGDevice", (PyCFunction
)Qd_NewGDevice
, 1,
6782 PyDoc_STR("(short refNum, long mode) -> (GDHandle _rv)")},
6783 {"DisposeGDevice", (PyCFunction
)Qd_DisposeGDevice
, 1,
6784 PyDoc_STR("(GDHandle gdh) -> None")},
6785 {"SetGDevice", (PyCFunction
)Qd_SetGDevice
, 1,
6786 PyDoc_STR("(GDHandle gd) -> None")},
6787 {"GetGDevice", (PyCFunction
)Qd_GetGDevice
, 1,
6788 PyDoc_STR("() -> (GDHandle _rv)")},
6789 {"Color2Index", (PyCFunction
)Qd_Color2Index
, 1,
6790 PyDoc_STR("(RGBColor myColor) -> (long _rv)")},
6791 {"Index2Color", (PyCFunction
)Qd_Index2Color
, 1,
6792 PyDoc_STR("(long index) -> (RGBColor aColor)")},
6793 {"InvertColor", (PyCFunction
)Qd_InvertColor
, 1,
6794 PyDoc_STR("() -> (RGBColor myColor)")},
6795 {"RealColor", (PyCFunction
)Qd_RealColor
, 1,
6796 PyDoc_STR("(RGBColor color) -> (Boolean _rv)")},
6797 {"GetSubTable", (PyCFunction
)Qd_GetSubTable
, 1,
6798 PyDoc_STR("(CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None")},
6799 {"MakeITable", (PyCFunction
)Qd_MakeITable
, 1,
6800 PyDoc_STR("(CTabHandle cTabH, ITabHandle iTabH, short res) -> None")},
6801 {"SetClientID", (PyCFunction
)Qd_SetClientID
, 1,
6802 PyDoc_STR("(short id) -> None")},
6803 {"ProtectEntry", (PyCFunction
)Qd_ProtectEntry
, 1,
6804 PyDoc_STR("(short index, Boolean protect) -> None")},
6805 {"ReserveEntry", (PyCFunction
)Qd_ReserveEntry
, 1,
6806 PyDoc_STR("(short index, Boolean reserve) -> None")},
6807 {"QDError", (PyCFunction
)Qd_QDError
, 1,
6808 PyDoc_STR("() -> (short _rv)")},
6809 {"CopyDeepMask", (PyCFunction
)Qd_CopyDeepMask
, 1,
6810 PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")},
6811 {"GetPattern", (PyCFunction
)Qd_GetPattern
, 1,
6812 PyDoc_STR("(short patternID) -> (PatHandle _rv)")},
6813 {"MacGetCursor", (PyCFunction
)Qd_MacGetCursor
, 1,
6814 PyDoc_STR("(short cursorID) -> (CursHandle _rv)")},
6815 {"GetPicture", (PyCFunction
)Qd_GetPicture
, 1,
6816 PyDoc_STR("(short pictureID) -> (PicHandle _rv)")},
6817 {"DeltaPoint", (PyCFunction
)Qd_DeltaPoint
, 1,
6818 PyDoc_STR("(Point ptA, Point ptB) -> (long _rv)")},
6819 {"ShieldCursor", (PyCFunction
)Qd_ShieldCursor
, 1,
6820 PyDoc_STR("(Rect shieldRect, Point offsetPt) -> None")},
6821 {"ScreenRes", (PyCFunction
)Qd_ScreenRes
, 1,
6822 PyDoc_STR("() -> (short scrnHRes, short scrnVRes)")},
6823 {"GetIndPattern", (PyCFunction
)Qd_GetIndPattern
, 1,
6824 PyDoc_STR("(short patternListID, short index) -> (Pattern thePat)")},
6825 {"SlopeFromAngle", (PyCFunction
)Qd_SlopeFromAngle
, 1,
6826 PyDoc_STR("(short angle) -> (Fixed _rv)")},
6827 {"AngleFromSlope", (PyCFunction
)Qd_AngleFromSlope
, 1,
6828 PyDoc_STR("(Fixed slope) -> (short _rv)")},
6830 #if TARGET_API_MAC_CARBON
6831 {"IsValidPort", (PyCFunction
)Qd_IsValidPort
, 1,
6832 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6834 {"GetPortPixMap", (PyCFunction
)Qd_GetPortPixMap
, 1,
6835 PyDoc_STR("(CGrafPtr port) -> (PixMapHandle _rv)")},
6836 {"GetPortBitMapForCopyBits", (PyCFunction
)Qd_GetPortBitMapForCopyBits
, 1,
6837 PyDoc_STR("(CGrafPtr port) -> (const BitMap * _rv)")},
6838 {"GetPortBounds", (PyCFunction
)Qd_GetPortBounds
, 1,
6839 PyDoc_STR("(CGrafPtr port) -> (Rect rect)")},
6840 {"GetPortForeColor", (PyCFunction
)Qd_GetPortForeColor
, 1,
6841 PyDoc_STR("(CGrafPtr port) -> (RGBColor foreColor)")},
6842 {"GetPortBackColor", (PyCFunction
)Qd_GetPortBackColor
, 1,
6843 PyDoc_STR("(CGrafPtr port) -> (RGBColor backColor)")},
6844 {"GetPortOpColor", (PyCFunction
)Qd_GetPortOpColor
, 1,
6845 PyDoc_STR("(CGrafPtr port) -> (RGBColor opColor)")},
6846 {"GetPortHiliteColor", (PyCFunction
)Qd_GetPortHiliteColor
, 1,
6847 PyDoc_STR("(CGrafPtr port) -> (RGBColor hiliteColor)")},
6848 {"GetPortTextFont", (PyCFunction
)Qd_GetPortTextFont
, 1,
6849 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6850 {"GetPortTextFace", (PyCFunction
)Qd_GetPortTextFace
, 1,
6851 PyDoc_STR("(CGrafPtr port) -> (Style _rv)")},
6852 {"GetPortTextMode", (PyCFunction
)Qd_GetPortTextMode
, 1,
6853 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6854 {"GetPortTextSize", (PyCFunction
)Qd_GetPortTextSize
, 1,
6855 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6856 {"GetPortChExtra", (PyCFunction
)Qd_GetPortChExtra
, 1,
6857 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6858 {"GetPortFracHPenLocation", (PyCFunction
)Qd_GetPortFracHPenLocation
, 1,
6859 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6860 {"GetPortSpExtra", (PyCFunction
)Qd_GetPortSpExtra
, 1,
6861 PyDoc_STR("(CGrafPtr port) -> (Fixed _rv)")},
6862 {"GetPortPenVisibility", (PyCFunction
)Qd_GetPortPenVisibility
, 1,
6863 PyDoc_STR("(CGrafPtr port) -> (short _rv)")},
6864 {"GetPortVisibleRegion", (PyCFunction
)Qd_GetPortVisibleRegion
, 1,
6865 PyDoc_STR("(CGrafPtr port, RgnHandle visRgn) -> (RgnHandle _rv)")},
6866 {"GetPortClipRegion", (PyCFunction
)Qd_GetPortClipRegion
, 1,
6867 PyDoc_STR("(CGrafPtr port, RgnHandle clipRgn) -> (RgnHandle _rv)")},
6868 {"GetPortBackPixPat", (PyCFunction
)Qd_GetPortBackPixPat
, 1,
6869 PyDoc_STR("(CGrafPtr port, PixPatHandle backPattern) -> (PixPatHandle _rv)")},
6870 {"GetPortPenPixPat", (PyCFunction
)Qd_GetPortPenPixPat
, 1,
6871 PyDoc_STR("(CGrafPtr port, PixPatHandle penPattern) -> (PixPatHandle _rv)")},
6872 {"GetPortFillPixPat", (PyCFunction
)Qd_GetPortFillPixPat
, 1,
6873 PyDoc_STR("(CGrafPtr port, PixPatHandle fillPattern) -> (PixPatHandle _rv)")},
6874 {"GetPortPenSize", (PyCFunction
)Qd_GetPortPenSize
, 1,
6875 PyDoc_STR("(CGrafPtr port, Point penSize) -> (Point penSize)")},
6876 {"GetPortPenMode", (PyCFunction
)Qd_GetPortPenMode
, 1,
6877 PyDoc_STR("(CGrafPtr port) -> (SInt32 _rv)")},
6878 {"GetPortPenLocation", (PyCFunction
)Qd_GetPortPenLocation
, 1,
6879 PyDoc_STR("(CGrafPtr port, Point penLocation) -> (Point penLocation)")},
6880 {"IsPortRegionBeingDefined", (PyCFunction
)Qd_IsPortRegionBeingDefined
, 1,
6881 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6882 {"IsPortPictureBeingDefined", (PyCFunction
)Qd_IsPortPictureBeingDefined
, 1,
6883 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6885 #if TARGET_API_MAC_CARBON
6886 {"IsPortPolyBeingDefined", (PyCFunction
)Qd_IsPortPolyBeingDefined
, 1,
6887 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6890 #if TARGET_API_MAC_CARBON
6891 {"IsPortOffscreen", (PyCFunction
)Qd_IsPortOffscreen
, 1,
6892 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6895 #if TARGET_API_MAC_CARBON
6896 {"IsPortColor", (PyCFunction
)Qd_IsPortColor
, 1,
6897 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6899 {"SetPortBounds", (PyCFunction
)Qd_SetPortBounds
, 1,
6900 PyDoc_STR("(CGrafPtr port, Rect rect) -> None")},
6901 {"SetPortOpColor", (PyCFunction
)Qd_SetPortOpColor
, 1,
6902 PyDoc_STR("(CGrafPtr port, RGBColor opColor) -> None")},
6903 {"SetPortVisibleRegion", (PyCFunction
)Qd_SetPortVisibleRegion
, 1,
6904 PyDoc_STR("(CGrafPtr port, RgnHandle visRgn) -> None")},
6905 {"SetPortClipRegion", (PyCFunction
)Qd_SetPortClipRegion
, 1,
6906 PyDoc_STR("(CGrafPtr port, RgnHandle clipRgn) -> None")},
6907 {"SetPortPenPixPat", (PyCFunction
)Qd_SetPortPenPixPat
, 1,
6908 PyDoc_STR("(CGrafPtr port, PixPatHandle penPattern) -> None")},
6909 {"SetPortFillPixPat", (PyCFunction
)Qd_SetPortFillPixPat
, 1,
6910 PyDoc_STR("(CGrafPtr port, PixPatHandle penPattern) -> None")},
6911 {"SetPortBackPixPat", (PyCFunction
)Qd_SetPortBackPixPat
, 1,
6912 PyDoc_STR("(CGrafPtr port, PixPatHandle backPattern) -> None")},
6913 {"SetPortPenSize", (PyCFunction
)Qd_SetPortPenSize
, 1,
6914 PyDoc_STR("(CGrafPtr port, Point penSize) -> None")},
6915 {"SetPortPenMode", (PyCFunction
)Qd_SetPortPenMode
, 1,
6916 PyDoc_STR("(CGrafPtr port, SInt32 penMode) -> None")},
6917 {"SetPortFracHPenLocation", (PyCFunction
)Qd_SetPortFracHPenLocation
, 1,
6918 PyDoc_STR("(CGrafPtr port, short pnLocHFrac) -> None")},
6919 {"GetPixBounds", (PyCFunction
)Qd_GetPixBounds
, 1,
6920 PyDoc_STR("(PixMapHandle pixMap) -> (Rect bounds)")},
6921 {"GetPixDepth", (PyCFunction
)Qd_GetPixDepth
, 1,
6922 PyDoc_STR("(PixMapHandle pixMap) -> (short _rv)")},
6923 {"GetQDGlobalsRandomSeed", (PyCFunction
)Qd_GetQDGlobalsRandomSeed
, 1,
6924 PyDoc_STR("() -> (long _rv)")},
6925 {"GetQDGlobalsScreenBits", (PyCFunction
)Qd_GetQDGlobalsScreenBits
, 1,
6926 PyDoc_STR("() -> (BitMap screenBits)")},
6927 {"GetQDGlobalsArrow", (PyCFunction
)Qd_GetQDGlobalsArrow
, 1,
6928 PyDoc_STR("() -> (Cursor arrow)")},
6929 {"GetQDGlobalsDarkGray", (PyCFunction
)Qd_GetQDGlobalsDarkGray
, 1,
6930 PyDoc_STR("() -> (Pattern dkGray)")},
6931 {"GetQDGlobalsLightGray", (PyCFunction
)Qd_GetQDGlobalsLightGray
, 1,
6932 PyDoc_STR("() -> (Pattern ltGray)")},
6933 {"GetQDGlobalsGray", (PyCFunction
)Qd_GetQDGlobalsGray
, 1,
6934 PyDoc_STR("() -> (Pattern gray)")},
6935 {"GetQDGlobalsBlack", (PyCFunction
)Qd_GetQDGlobalsBlack
, 1,
6936 PyDoc_STR("() -> (Pattern black)")},
6937 {"GetQDGlobalsWhite", (PyCFunction
)Qd_GetQDGlobalsWhite
, 1,
6938 PyDoc_STR("() -> (Pattern white)")},
6939 {"GetQDGlobalsThePort", (PyCFunction
)Qd_GetQDGlobalsThePort
, 1,
6940 PyDoc_STR("() -> (CGrafPtr _rv)")},
6941 {"SetQDGlobalsRandomSeed", (PyCFunction
)Qd_SetQDGlobalsRandomSeed
, 1,
6942 PyDoc_STR("(long randomSeed) -> None")},
6943 {"SetQDGlobalsArrow", (PyCFunction
)Qd_SetQDGlobalsArrow
, 1,
6944 PyDoc_STR("(Cursor arrow) -> None")},
6945 {"GetRegionBounds", (PyCFunction
)Qd_GetRegionBounds
, 1,
6946 PyDoc_STR("(RgnHandle region) -> (Rect bounds)")},
6948 #if TARGET_API_MAC_CARBON
6949 {"IsRegionRectangular", (PyCFunction
)Qd_IsRegionRectangular
, 1,
6950 PyDoc_STR("(RgnHandle region) -> (Boolean _rv)")},
6953 #if TARGET_API_MAC_CARBON
6954 {"CreateNewPort", (PyCFunction
)Qd_CreateNewPort
, 1,
6955 PyDoc_STR("() -> (CGrafPtr _rv)")},
6958 #if TARGET_API_MAC_CARBON
6959 {"DisposePort", (PyCFunction
)Qd_DisposePort
, 1,
6960 PyDoc_STR("(CGrafPtr port) -> None")},
6963 #if TARGET_API_MAC_CARBON
6964 {"SetQDError", (PyCFunction
)Qd_SetQDError
, 1,
6965 PyDoc_STR("(OSErr err) -> None")},
6967 {"QDIsPortBuffered", (PyCFunction
)Qd_QDIsPortBuffered
, 1,
6968 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6969 {"QDIsPortBufferDirty", (PyCFunction
)Qd_QDIsPortBufferDirty
, 1,
6970 PyDoc_STR("(CGrafPtr port) -> (Boolean _rv)")},
6971 {"QDFlushPortBuffer", (PyCFunction
)Qd_QDFlushPortBuffer
, 1,
6972 PyDoc_STR("(CGrafPtr port, RgnHandle region) -> None")},
6974 #if TARGET_API_MAC_CARBON
6975 {"QDGetDirtyRegion", (PyCFunction
)Qd_QDGetDirtyRegion
, 1,
6976 PyDoc_STR("(CGrafPtr port, RgnHandle rgn) -> None")},
6979 #if TARGET_API_MAC_CARBON
6980 {"QDSetDirtyRegion", (PyCFunction
)Qd_QDSetDirtyRegion
, 1,
6981 PyDoc_STR("(CGrafPtr port, RgnHandle rgn) -> None")},
6983 {"LMGetScrVRes", (PyCFunction
)Qd_LMGetScrVRes
, 1,
6984 PyDoc_STR("() -> (SInt16 _rv)")},
6985 {"LMSetScrVRes", (PyCFunction
)Qd_LMSetScrVRes
, 1,
6986 PyDoc_STR("(SInt16 value) -> None")},
6987 {"LMGetScrHRes", (PyCFunction
)Qd_LMGetScrHRes
, 1,
6988 PyDoc_STR("() -> (SInt16 _rv)")},
6989 {"LMSetScrHRes", (PyCFunction
)Qd_LMSetScrHRes
, 1,
6990 PyDoc_STR("(SInt16 value) -> None")},
6991 {"LMGetMainDevice", (PyCFunction
)Qd_LMGetMainDevice
, 1,
6992 PyDoc_STR("() -> (GDHandle _rv)")},
6993 {"LMSetMainDevice", (PyCFunction
)Qd_LMSetMainDevice
, 1,
6994 PyDoc_STR("(GDHandle value) -> None")},
6995 {"LMGetDeviceList", (PyCFunction
)Qd_LMGetDeviceList
, 1,
6996 PyDoc_STR("() -> (GDHandle _rv)")},
6997 {"LMSetDeviceList", (PyCFunction
)Qd_LMSetDeviceList
, 1,
6998 PyDoc_STR("(GDHandle value) -> None")},
6999 {"LMGetQDColors", (PyCFunction
)Qd_LMGetQDColors
, 1,
7000 PyDoc_STR("() -> (Handle _rv)")},
7001 {"LMSetQDColors", (PyCFunction
)Qd_LMSetQDColors
, 1,
7002 PyDoc_STR("(Handle value) -> None")},
7003 {"LMGetWidthListHand", (PyCFunction
)Qd_LMGetWidthListHand
, 1,
7004 PyDoc_STR("() -> (Handle _rv)")},
7005 {"LMSetWidthListHand", (PyCFunction
)Qd_LMSetWidthListHand
, 1,
7006 PyDoc_STR("(Handle value) -> None")},
7007 {"LMGetHiliteMode", (PyCFunction
)Qd_LMGetHiliteMode
, 1,
7008 PyDoc_STR("() -> (UInt8 _rv)")},
7009 {"LMSetHiliteMode", (PyCFunction
)Qd_LMSetHiliteMode
, 1,
7010 PyDoc_STR("(UInt8 value) -> None")},
7011 {"LMGetWidthTabHandle", (PyCFunction
)Qd_LMGetWidthTabHandle
, 1,
7012 PyDoc_STR("() -> (Handle _rv)")},
7013 {"LMSetWidthTabHandle", (PyCFunction
)Qd_LMSetWidthTabHandle
, 1,
7014 PyDoc_STR("(Handle value) -> None")},
7015 {"LMGetLastSPExtra", (PyCFunction
)Qd_LMGetLastSPExtra
, 1,
7016 PyDoc_STR("() -> (SInt32 _rv)")},
7017 {"LMSetLastSPExtra", (PyCFunction
)Qd_LMSetLastSPExtra
, 1,
7018 PyDoc_STR("(SInt32 value) -> None")},
7019 {"LMGetLastFOND", (PyCFunction
)Qd_LMGetLastFOND
, 1,
7020 PyDoc_STR("() -> (Handle _rv)")},
7021 {"LMSetLastFOND", (PyCFunction
)Qd_LMSetLastFOND
, 1,
7022 PyDoc_STR("(Handle value) -> None")},
7023 {"LMGetFractEnable", (PyCFunction
)Qd_LMGetFractEnable
, 1,
7024 PyDoc_STR("() -> (UInt8 _rv)")},
7025 {"LMSetFractEnable", (PyCFunction
)Qd_LMSetFractEnable
, 1,
7026 PyDoc_STR("(UInt8 value) -> None")},
7027 {"LMGetTheGDevice", (PyCFunction
)Qd_LMGetTheGDevice
, 1,
7028 PyDoc_STR("() -> (GDHandle _rv)")},
7029 {"LMSetTheGDevice", (PyCFunction
)Qd_LMSetTheGDevice
, 1,
7030 PyDoc_STR("(GDHandle value) -> None")},
7031 {"LMGetHiliteRGB", (PyCFunction
)Qd_LMGetHiliteRGB
, 1,
7032 PyDoc_STR("() -> (RGBColor hiliteRGBValue)")},
7033 {"LMSetHiliteRGB", (PyCFunction
)Qd_LMSetHiliteRGB
, 1,
7034 PyDoc_STR("(RGBColor hiliteRGBValue) -> None")},
7035 {"LMGetCursorNew", (PyCFunction
)Qd_LMGetCursorNew
, 1,
7036 PyDoc_STR("() -> (Boolean _rv)")},
7037 {"LMSetCursorNew", (PyCFunction
)Qd_LMSetCursorNew
, 1,
7038 PyDoc_STR("(Boolean value) -> None")},
7039 {"TextFont", (PyCFunction
)Qd_TextFont
, 1,
7040 PyDoc_STR("(short font) -> None")},
7041 {"TextFace", (PyCFunction
)Qd_TextFace
, 1,
7042 PyDoc_STR("(StyleParameter face) -> None")},
7043 {"TextMode", (PyCFunction
)Qd_TextMode
, 1,
7044 PyDoc_STR("(short mode) -> None")},
7045 {"TextSize", (PyCFunction
)Qd_TextSize
, 1,
7046 PyDoc_STR("(short size) -> None")},
7047 {"SpaceExtra", (PyCFunction
)Qd_SpaceExtra
, 1,
7048 PyDoc_STR("(Fixed extra) -> None")},
7049 {"DrawChar", (PyCFunction
)Qd_DrawChar
, 1,
7050 PyDoc_STR("(CharParameter ch) -> None")},
7051 {"DrawString", (PyCFunction
)Qd_DrawString
, 1,
7052 PyDoc_STR("(Str255 s) -> None")},
7053 {"MacDrawText", (PyCFunction
)Qd_MacDrawText
, 1,
7054 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")},
7055 {"CharWidth", (PyCFunction
)Qd_CharWidth
, 1,
7056 PyDoc_STR("(CharParameter ch) -> (short _rv)")},
7057 {"StringWidth", (PyCFunction
)Qd_StringWidth
, 1,
7058 PyDoc_STR("(Str255 s) -> (short _rv)")},
7059 {"TextWidth", (PyCFunction
)Qd_TextWidth
, 1,
7060 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)")},
7061 {"GetFontInfo", (PyCFunction
)Qd_GetFontInfo
, 1,
7062 PyDoc_STR("() -> (FontInfo info)")},
7063 {"CharExtra", (PyCFunction
)Qd_CharExtra
, 1,
7064 PyDoc_STR("(Fixed extra) -> None")},
7065 {"TruncString", (PyCFunction
)Qd_TruncString
, 1,
7066 PyDoc_STR("(short width, Str255 theString, TruncCode truncWhere) -> (short _rv)")},
7067 {"SetPort", (PyCFunction
)Qd_SetPort
, 1,
7068 PyDoc_STR("(GrafPtr thePort) -> None")},
7069 {"GetCursor", (PyCFunction
)Qd_GetCursor
, 1,
7070 PyDoc_STR("(short cursorID) -> (CursHandle _rv)")},
7071 {"SetCursor", (PyCFunction
)Qd_SetCursor
, 1,
7072 PyDoc_STR("(Cursor crsr) -> None")},
7073 {"ShowCursor", (PyCFunction
)Qd_ShowCursor
, 1,
7074 PyDoc_STR("() -> None")},
7075 {"LineTo", (PyCFunction
)Qd_LineTo
, 1,
7076 PyDoc_STR("(short h, short v) -> None")},
7077 {"SetRect", (PyCFunction
)Qd_SetRect
, 1,
7078 PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")},
7079 {"OffsetRect", (PyCFunction
)Qd_OffsetRect
, 1,
7080 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
7081 {"InsetRect", (PyCFunction
)Qd_InsetRect
, 1,
7082 PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")},
7083 {"UnionRect", (PyCFunction
)Qd_UnionRect
, 1,
7084 PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")},
7085 {"EqualRect", (PyCFunction
)Qd_EqualRect
, 1,
7086 PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")},
7087 {"FrameRect", (PyCFunction
)Qd_FrameRect
, 1,
7088 PyDoc_STR("(Rect r) -> None")},
7089 {"InvertRect", (PyCFunction
)Qd_InvertRect
, 1,
7090 PyDoc_STR("(Rect r) -> None")},
7091 {"FillRect", (PyCFunction
)Qd_FillRect
, 1,
7092 PyDoc_STR("(Rect r, Pattern pat) -> None")},
7093 {"CopyRgn", (PyCFunction
)Qd_CopyRgn
, 1,
7094 PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")},
7095 {"SetRectRgn", (PyCFunction
)Qd_SetRectRgn
, 1,
7096 PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")},
7097 {"OffsetRgn", (PyCFunction
)Qd_OffsetRgn
, 1,
7098 PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")},
7099 {"UnionRgn", (PyCFunction
)Qd_UnionRgn
, 1,
7100 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
7101 {"XorRgn", (PyCFunction
)Qd_XorRgn
, 1,
7102 PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")},
7103 {"EqualRgn", (PyCFunction
)Qd_EqualRgn
, 1,
7104 PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")},
7105 {"FrameRgn", (PyCFunction
)Qd_FrameRgn
, 1,
7106 PyDoc_STR("(RgnHandle rgn) -> None")},
7107 {"PaintRgn", (PyCFunction
)Qd_PaintRgn
, 1,
7108 PyDoc_STR("(RgnHandle rgn) -> None")},
7109 {"InvertRgn", (PyCFunction
)Qd_InvertRgn
, 1,
7110 PyDoc_STR("(RgnHandle rgn) -> None")},
7111 {"FillRgn", (PyCFunction
)Qd_FillRgn
, 1,
7112 PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")},
7113 {"GetPixel", (PyCFunction
)Qd_GetPixel
, 1,
7114 PyDoc_STR("(short h, short v) -> (Boolean _rv)")},
7115 {"PtInRect", (PyCFunction
)Qd_PtInRect
, 1,
7116 PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")},
7117 {"DrawText", (PyCFunction
)Qd_DrawText
, 1,
7118 PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")},
7119 {"BitMap", (PyCFunction
)Qd_BitMap
, 1,
7120 PyDoc_STR("Take (string, int, Rect) argument and create BitMap")},
7121 {"RawBitMap", (PyCFunction
)Qd_RawBitMap
, 1,
7122 PyDoc_STR("Take string BitMap and turn into BitMap object")},
7128 /* Like BMObj_New, but the original bitmap data structure is copied (and
7129 ** released when the object is released)
7131 PyObject
*BMObj_NewCopied(BitMapPtr itself
)
7134 BitMapPtr itself_copy
;
7136 if ((itself_copy
=(BitMapPtr
)malloc(sizeof(BitMap
))) == NULL
)
7137 return PyErr_NoMemory();
7138 *itself_copy
= *itself
;
7139 it
= (BitMapObject
*)BMObj_New(itself_copy
);
7140 it
->referred_bitmap
= itself_copy
;
7141 return (PyObject
*)it
;
7153 PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr
, BMObj_New
);
7154 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(BitMapPtr
, BMObj_Convert
);
7155 PyMac_INIT_TOOLBOX_OBJECT_NEW(GrafPtr
, GrafObj_New
);
7156 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GrafPtr
, GrafObj_Convert
);
7157 PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr
, QdRGB_New
);
7158 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor
, QdRGB_Convert
);
7161 m
= Py_InitModule("_Qd", Qd_methods
);
7162 d
= PyModule_GetDict(m
);
7163 Qd_Error
= PyMac_GetOSErrException();
7164 if (Qd_Error
== NULL
||
7165 PyDict_SetItemString(d
, "Error", Qd_Error
) != 0)
7167 GrafPort_Type
.ob_type
= &PyType_Type
;
7168 Py_INCREF(&GrafPort_Type
);
7169 if (PyDict_SetItemString(d
, "GrafPortType", (PyObject
*)&GrafPort_Type
) != 0)
7170 Py_FatalError("can't initialize GrafPortType");
7171 BitMap_Type
.ob_type
= &PyType_Type
;
7172 Py_INCREF(&BitMap_Type
);
7173 if (PyDict_SetItemString(d
, "BitMapType", (PyObject
*)&BitMap_Type
) != 0)
7174 Py_FatalError("can't initialize BitMapType");
7175 QDGlobalsAccess_Type
.ob_type
= &PyType_Type
;
7176 Py_INCREF(&QDGlobalsAccess_Type
);
7177 if (PyDict_SetItemString(d
, "QDGlobalsAccessType", (PyObject
*)&QDGlobalsAccess_Type
) != 0)
7178 Py_FatalError("can't initialize QDGlobalsAccessType");
7184 if (o
== NULL
|| PyDict_SetItemString(d
, "qd", o
) != 0)
7191 /* ========================= End module _Qd ========================= */