| 1 | n/a | |
|---|
| 2 | n/a | /* =========================== Module _Qd =========================== */ |
|---|
| 3 | n/a | |
|---|
| 4 | n/a | #include "Python.h" |
|---|
| 5 | n/a | |
|---|
| 6 | n/a | |
|---|
| 7 | n/a | #ifndef __LP64__ |
|---|
| 8 | n/a | |
|---|
| 9 | n/a | #include "pymactoolbox.h" |
|---|
| 10 | n/a | |
|---|
| 11 | n/a | /* Macro to test whether a weak-loaded CFM function exists */ |
|---|
| 12 | n/a | #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ |
|---|
| 13 | n/a | PyErr_SetString(PyExc_NotImplementedError, \ |
|---|
| 14 | n/a | "Not available in this shared library/OS version"); \ |
|---|
| 15 | n/a | return NULL; \ |
|---|
| 16 | n/a | }} while(0) |
|---|
| 17 | n/a | |
|---|
| 18 | n/a | |
|---|
| 19 | n/a | #include <Carbon/Carbon.h> |
|---|
| 20 | n/a | |
|---|
| 21 | n/a | #ifdef USE_TOOLBOX_OBJECT_GLUE |
|---|
| 22 | n/a | extern PyObject *_GrafObj_New(GrafPtr); |
|---|
| 23 | n/a | extern int _GrafObj_Convert(PyObject *, GrafPtr *); |
|---|
| 24 | n/a | extern PyObject *_BMObj_New(BitMapPtr); |
|---|
| 25 | n/a | extern int _BMObj_Convert(PyObject *, BitMapPtr *); |
|---|
| 26 | n/a | extern PyObject *_QdRGB_New(RGBColorPtr); |
|---|
| 27 | n/a | extern int _QdRGB_Convert(PyObject *, RGBColorPtr); |
|---|
| 28 | n/a | |
|---|
| 29 | n/a | #define GrafObj_New _GrafObj_New |
|---|
| 30 | n/a | #define GrafObj_Convert _GrafObj_Convert |
|---|
| 31 | n/a | #define BMObj_New _BMObj_New |
|---|
| 32 | n/a | #define BMObj_Convert _BMObj_Convert |
|---|
| 33 | n/a | #define QdRGB_New _QdRGB_New |
|---|
| 34 | n/a | #define QdRGB_Convert _QdRGB_Convert |
|---|
| 35 | n/a | #endif |
|---|
| 36 | n/a | |
|---|
| 37 | n/a | static PyObject *BMObj_NewCopied(BitMapPtr); |
|---|
| 38 | n/a | |
|---|
| 39 | n/a | /* |
|---|
| 40 | n/a | ** Parse/generate RGB records |
|---|
| 41 | n/a | */ |
|---|
| 42 | n/a | PyObject *QdRGB_New(RGBColorPtr itself) |
|---|
| 43 | n/a | { |
|---|
| 44 | n/a | |
|---|
| 45 | n/a | return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue); |
|---|
| 46 | n/a | } |
|---|
| 47 | n/a | |
|---|
| 48 | n/a | int QdRGB_Convert(PyObject *v, RGBColorPtr p_itself) |
|---|
| 49 | n/a | { |
|---|
| 50 | n/a | long red, green, blue; |
|---|
| 51 | n/a | |
|---|
| 52 | n/a | if( !PyArg_ParseTuple(v, "lll", &red, &green, &blue) ) |
|---|
| 53 | n/a | return 0; |
|---|
| 54 | n/a | p_itself->red = (unsigned short)red; |
|---|
| 55 | n/a | p_itself->green = (unsigned short)green; |
|---|
| 56 | n/a | p_itself->blue = (unsigned short)blue; |
|---|
| 57 | n/a | return 1; |
|---|
| 58 | n/a | } |
|---|
| 59 | n/a | |
|---|
| 60 | n/a | /* |
|---|
| 61 | n/a | ** Generate FontInfo records |
|---|
| 62 | n/a | */ |
|---|
| 63 | n/a | static |
|---|
| 64 | n/a | PyObject *QdFI_New(FontInfo *itself) |
|---|
| 65 | n/a | { |
|---|
| 66 | n/a | |
|---|
| 67 | n/a | return Py_BuildValue("hhhh", itself->ascent, itself->descent, |
|---|
| 68 | n/a | itself->widMax, itself->leading); |
|---|
| 69 | n/a | } |
|---|
| 70 | n/a | |
|---|
| 71 | n/a | static PyObject *Qd_Error; |
|---|
| 72 | n/a | |
|---|
| 73 | n/a | /* ---------------------- Object type GrafPort ---------------------- */ |
|---|
| 74 | n/a | |
|---|
| 75 | n/a | PyTypeObject GrafPort_Type; |
|---|
| 76 | n/a | |
|---|
| 77 | n/a | #define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type)) |
|---|
| 78 | n/a | |
|---|
| 79 | n/a | typedef struct GrafPortObject { |
|---|
| 80 | n/a | PyObject_HEAD |
|---|
| 81 | n/a | GrafPtr ob_itself; |
|---|
| 82 | n/a | } GrafPortObject; |
|---|
| 83 | n/a | |
|---|
| 84 | n/a | PyObject *GrafObj_New(GrafPtr itself) |
|---|
| 85 | n/a | { |
|---|
| 86 | n/a | GrafPortObject *it; |
|---|
| 87 | n/a | if (itself == NULL) return PyMac_Error(resNotFound); |
|---|
| 88 | n/a | it = PyObject_NEW(GrafPortObject, &GrafPort_Type); |
|---|
| 89 | n/a | if (it == NULL) return NULL; |
|---|
| 90 | n/a | it->ob_itself = itself; |
|---|
| 91 | n/a | return (PyObject *)it; |
|---|
| 92 | n/a | } |
|---|
| 93 | n/a | |
|---|
| 94 | n/a | int GrafObj_Convert(PyObject *v, GrafPtr *p_itself) |
|---|
| 95 | n/a | { |
|---|
| 96 | n/a | #if 1 |
|---|
| 97 | n/a | { |
|---|
| 98 | n/a | WindowRef win; |
|---|
| 99 | n/a | if (WinObj_Convert(v, &win) && v) { |
|---|
| 100 | n/a | *p_itself = (GrafPtr)GetWindowPort(win); |
|---|
| 101 | n/a | return 1; |
|---|
| 102 | n/a | } |
|---|
| 103 | n/a | PyErr_Clear(); |
|---|
| 104 | n/a | } |
|---|
| 105 | n/a | #else |
|---|
| 106 | n/a | if (DlgObj_Check(v)) { |
|---|
| 107 | n/a | DialogRef dlg = (DialogRef)((GrafPortObject *)v)->ob_itself; |
|---|
| 108 | n/a | *p_itself = (GrafPtr)GetWindowPort(GetDialogWindow(dlg)); |
|---|
| 109 | n/a | return 1; |
|---|
| 110 | n/a | } |
|---|
| 111 | n/a | if (WinObj_Check(v)) { |
|---|
| 112 | n/a | WindowRef win = (WindowRef)((GrafPortObject *)v)->ob_itself; |
|---|
| 113 | n/a | *p_itself = (GrafPtr)GetWindowPort(win); |
|---|
| 114 | n/a | return 1; |
|---|
| 115 | n/a | } |
|---|
| 116 | n/a | #endif |
|---|
| 117 | n/a | if (!GrafObj_Check(v)) |
|---|
| 118 | n/a | { |
|---|
| 119 | n/a | PyErr_SetString(PyExc_TypeError, "GrafPort required"); |
|---|
| 120 | n/a | return 0; |
|---|
| 121 | n/a | } |
|---|
| 122 | n/a | *p_itself = ((GrafPortObject *)v)->ob_itself; |
|---|
| 123 | n/a | return 1; |
|---|
| 124 | n/a | } |
|---|
| 125 | n/a | |
|---|
| 126 | n/a | static void GrafObj_dealloc(GrafPortObject *self) |
|---|
| 127 | n/a | { |
|---|
| 128 | n/a | /* Cleanup of self->ob_itself goes here */ |
|---|
| 129 | n/a | self->ob_type->tp_free((PyObject *)self); |
|---|
| 130 | n/a | } |
|---|
| 131 | n/a | |
|---|
| 132 | n/a | static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args) |
|---|
| 133 | n/a | { |
|---|
| 134 | n/a | PyObject *_res = NULL; |
|---|
| 135 | n/a | #ifndef MacSetPort |
|---|
| 136 | n/a | PyMac_PRECHECK(MacSetPort); |
|---|
| 137 | n/a | #endif |
|---|
| 138 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 139 | n/a | return NULL; |
|---|
| 140 | n/a | MacSetPort(_self->ob_itself); |
|---|
| 141 | n/a | Py_INCREF(Py_None); |
|---|
| 142 | n/a | _res = Py_None; |
|---|
| 143 | n/a | return _res; |
|---|
| 144 | n/a | } |
|---|
| 145 | n/a | |
|---|
| 146 | n/a | static PyObject *GrafObj_QDSwapPort(GrafPortObject *_self, PyObject *_args) |
|---|
| 147 | n/a | { |
|---|
| 148 | n/a | PyObject *_res = NULL; |
|---|
| 149 | n/a | Boolean _rv; |
|---|
| 150 | n/a | CGrafPtr outOldPort; |
|---|
| 151 | n/a | #ifndef QDSwapPort |
|---|
| 152 | n/a | PyMac_PRECHECK(QDSwapPort); |
|---|
| 153 | n/a | #endif |
|---|
| 154 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 155 | n/a | return NULL; |
|---|
| 156 | n/a | _rv = QDSwapPort(_self->ob_itself, |
|---|
| 157 | n/a | &outOldPort); |
|---|
| 158 | n/a | _res = Py_BuildValue("bO&", |
|---|
| 159 | n/a | _rv, |
|---|
| 160 | n/a | GrafObj_New, outOldPort); |
|---|
| 161 | n/a | return _res; |
|---|
| 162 | n/a | } |
|---|
| 163 | n/a | |
|---|
| 164 | n/a | static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args) |
|---|
| 165 | n/a | { |
|---|
| 166 | n/a | PyObject *_res = NULL; |
|---|
| 167 | n/a | Boolean _rv; |
|---|
| 168 | n/a | #ifndef IsValidPort |
|---|
| 169 | n/a | PyMac_PRECHECK(IsValidPort); |
|---|
| 170 | n/a | #endif |
|---|
| 171 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 172 | n/a | return NULL; |
|---|
| 173 | n/a | _rv = IsValidPort(_self->ob_itself); |
|---|
| 174 | n/a | _res = Py_BuildValue("b", |
|---|
| 175 | n/a | _rv); |
|---|
| 176 | n/a | return _res; |
|---|
| 177 | n/a | } |
|---|
| 178 | n/a | |
|---|
| 179 | n/a | static PyObject *GrafObj_GetPortPixMap(GrafPortObject *_self, PyObject *_args) |
|---|
| 180 | n/a | { |
|---|
| 181 | n/a | PyObject *_res = NULL; |
|---|
| 182 | n/a | PixMapHandle _rv; |
|---|
| 183 | n/a | #ifndef GetPortPixMap |
|---|
| 184 | n/a | PyMac_PRECHECK(GetPortPixMap); |
|---|
| 185 | n/a | #endif |
|---|
| 186 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 187 | n/a | return NULL; |
|---|
| 188 | n/a | _rv = GetPortPixMap(_self->ob_itself); |
|---|
| 189 | n/a | _res = Py_BuildValue("O&", |
|---|
| 190 | n/a | ResObj_New, _rv); |
|---|
| 191 | n/a | return _res; |
|---|
| 192 | n/a | } |
|---|
| 193 | n/a | |
|---|
| 194 | n/a | static PyObject *GrafObj_GetPortBitMapForCopyBits(GrafPortObject *_self, PyObject *_args) |
|---|
| 195 | n/a | { |
|---|
| 196 | n/a | PyObject *_res = NULL; |
|---|
| 197 | n/a | const BitMap * _rv; |
|---|
| 198 | n/a | #ifndef GetPortBitMapForCopyBits |
|---|
| 199 | n/a | PyMac_PRECHECK(GetPortBitMapForCopyBits); |
|---|
| 200 | n/a | #endif |
|---|
| 201 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 202 | n/a | return NULL; |
|---|
| 203 | n/a | _rv = GetPortBitMapForCopyBits(_self->ob_itself); |
|---|
| 204 | n/a | _res = Py_BuildValue("O&", |
|---|
| 205 | n/a | BMObj_New, _rv); |
|---|
| 206 | n/a | return _res; |
|---|
| 207 | n/a | } |
|---|
| 208 | n/a | |
|---|
| 209 | n/a | static PyObject *GrafObj_GetPortBounds(GrafPortObject *_self, PyObject *_args) |
|---|
| 210 | n/a | { |
|---|
| 211 | n/a | PyObject *_res = NULL; |
|---|
| 212 | n/a | Rect rect; |
|---|
| 213 | n/a | #ifndef GetPortBounds |
|---|
| 214 | n/a | PyMac_PRECHECK(GetPortBounds); |
|---|
| 215 | n/a | #endif |
|---|
| 216 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 217 | n/a | return NULL; |
|---|
| 218 | n/a | GetPortBounds(_self->ob_itself, |
|---|
| 219 | n/a | &rect); |
|---|
| 220 | n/a | _res = Py_BuildValue("O&", |
|---|
| 221 | n/a | PyMac_BuildRect, &rect); |
|---|
| 222 | n/a | return _res; |
|---|
| 223 | n/a | } |
|---|
| 224 | n/a | |
|---|
| 225 | n/a | static PyObject *GrafObj_GetPortForeColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 226 | n/a | { |
|---|
| 227 | n/a | PyObject *_res = NULL; |
|---|
| 228 | n/a | RGBColor foreColor; |
|---|
| 229 | n/a | #ifndef GetPortForeColor |
|---|
| 230 | n/a | PyMac_PRECHECK(GetPortForeColor); |
|---|
| 231 | n/a | #endif |
|---|
| 232 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 233 | n/a | return NULL; |
|---|
| 234 | n/a | GetPortForeColor(_self->ob_itself, |
|---|
| 235 | n/a | &foreColor); |
|---|
| 236 | n/a | _res = Py_BuildValue("O&", |
|---|
| 237 | n/a | QdRGB_New, &foreColor); |
|---|
| 238 | n/a | return _res; |
|---|
| 239 | n/a | } |
|---|
| 240 | n/a | |
|---|
| 241 | n/a | static PyObject *GrafObj_GetPortBackColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 242 | n/a | { |
|---|
| 243 | n/a | PyObject *_res = NULL; |
|---|
| 244 | n/a | RGBColor backColor; |
|---|
| 245 | n/a | #ifndef GetPortBackColor |
|---|
| 246 | n/a | PyMac_PRECHECK(GetPortBackColor); |
|---|
| 247 | n/a | #endif |
|---|
| 248 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 249 | n/a | return NULL; |
|---|
| 250 | n/a | GetPortBackColor(_self->ob_itself, |
|---|
| 251 | n/a | &backColor); |
|---|
| 252 | n/a | _res = Py_BuildValue("O&", |
|---|
| 253 | n/a | QdRGB_New, &backColor); |
|---|
| 254 | n/a | return _res; |
|---|
| 255 | n/a | } |
|---|
| 256 | n/a | |
|---|
| 257 | n/a | static PyObject *GrafObj_GetPortOpColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 258 | n/a | { |
|---|
| 259 | n/a | PyObject *_res = NULL; |
|---|
| 260 | n/a | RGBColor opColor; |
|---|
| 261 | n/a | #ifndef GetPortOpColor |
|---|
| 262 | n/a | PyMac_PRECHECK(GetPortOpColor); |
|---|
| 263 | n/a | #endif |
|---|
| 264 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 265 | n/a | return NULL; |
|---|
| 266 | n/a | GetPortOpColor(_self->ob_itself, |
|---|
| 267 | n/a | &opColor); |
|---|
| 268 | n/a | _res = Py_BuildValue("O&", |
|---|
| 269 | n/a | QdRGB_New, &opColor); |
|---|
| 270 | n/a | return _res; |
|---|
| 271 | n/a | } |
|---|
| 272 | n/a | |
|---|
| 273 | n/a | static PyObject *GrafObj_GetPortHiliteColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 274 | n/a | { |
|---|
| 275 | n/a | PyObject *_res = NULL; |
|---|
| 276 | n/a | RGBColor hiliteColor; |
|---|
| 277 | n/a | #ifndef GetPortHiliteColor |
|---|
| 278 | n/a | PyMac_PRECHECK(GetPortHiliteColor); |
|---|
| 279 | n/a | #endif |
|---|
| 280 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 281 | n/a | return NULL; |
|---|
| 282 | n/a | GetPortHiliteColor(_self->ob_itself, |
|---|
| 283 | n/a | &hiliteColor); |
|---|
| 284 | n/a | _res = Py_BuildValue("O&", |
|---|
| 285 | n/a | QdRGB_New, &hiliteColor); |
|---|
| 286 | n/a | return _res; |
|---|
| 287 | n/a | } |
|---|
| 288 | n/a | |
|---|
| 289 | n/a | static PyObject *GrafObj_GetPortTextFont(GrafPortObject *_self, PyObject *_args) |
|---|
| 290 | n/a | { |
|---|
| 291 | n/a | PyObject *_res = NULL; |
|---|
| 292 | n/a | short _rv; |
|---|
| 293 | n/a | #ifndef GetPortTextFont |
|---|
| 294 | n/a | PyMac_PRECHECK(GetPortTextFont); |
|---|
| 295 | n/a | #endif |
|---|
| 296 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 297 | n/a | return NULL; |
|---|
| 298 | n/a | _rv = GetPortTextFont(_self->ob_itself); |
|---|
| 299 | n/a | _res = Py_BuildValue("h", |
|---|
| 300 | n/a | _rv); |
|---|
| 301 | n/a | return _res; |
|---|
| 302 | n/a | } |
|---|
| 303 | n/a | |
|---|
| 304 | n/a | static PyObject *GrafObj_GetPortTextFace(GrafPortObject *_self, PyObject *_args) |
|---|
| 305 | n/a | { |
|---|
| 306 | n/a | PyObject *_res = NULL; |
|---|
| 307 | n/a | Style _rv; |
|---|
| 308 | n/a | #ifndef GetPortTextFace |
|---|
| 309 | n/a | PyMac_PRECHECK(GetPortTextFace); |
|---|
| 310 | n/a | #endif |
|---|
| 311 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 312 | n/a | return NULL; |
|---|
| 313 | n/a | _rv = GetPortTextFace(_self->ob_itself); |
|---|
| 314 | n/a | _res = Py_BuildValue("b", |
|---|
| 315 | n/a | _rv); |
|---|
| 316 | n/a | return _res; |
|---|
| 317 | n/a | } |
|---|
| 318 | n/a | |
|---|
| 319 | n/a | static PyObject *GrafObj_GetPortTextMode(GrafPortObject *_self, PyObject *_args) |
|---|
| 320 | n/a | { |
|---|
| 321 | n/a | PyObject *_res = NULL; |
|---|
| 322 | n/a | short _rv; |
|---|
| 323 | n/a | #ifndef GetPortTextMode |
|---|
| 324 | n/a | PyMac_PRECHECK(GetPortTextMode); |
|---|
| 325 | n/a | #endif |
|---|
| 326 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 327 | n/a | return NULL; |
|---|
| 328 | n/a | _rv = GetPortTextMode(_self->ob_itself); |
|---|
| 329 | n/a | _res = Py_BuildValue("h", |
|---|
| 330 | n/a | _rv); |
|---|
| 331 | n/a | return _res; |
|---|
| 332 | n/a | } |
|---|
| 333 | n/a | |
|---|
| 334 | n/a | static PyObject *GrafObj_GetPortTextSize(GrafPortObject *_self, PyObject *_args) |
|---|
| 335 | n/a | { |
|---|
| 336 | n/a | PyObject *_res = NULL; |
|---|
| 337 | n/a | short _rv; |
|---|
| 338 | n/a | #ifndef GetPortTextSize |
|---|
| 339 | n/a | PyMac_PRECHECK(GetPortTextSize); |
|---|
| 340 | n/a | #endif |
|---|
| 341 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 342 | n/a | return NULL; |
|---|
| 343 | n/a | _rv = GetPortTextSize(_self->ob_itself); |
|---|
| 344 | n/a | _res = Py_BuildValue("h", |
|---|
| 345 | n/a | _rv); |
|---|
| 346 | n/a | return _res; |
|---|
| 347 | n/a | } |
|---|
| 348 | n/a | |
|---|
| 349 | n/a | static PyObject *GrafObj_GetPortChExtra(GrafPortObject *_self, PyObject *_args) |
|---|
| 350 | n/a | { |
|---|
| 351 | n/a | PyObject *_res = NULL; |
|---|
| 352 | n/a | short _rv; |
|---|
| 353 | n/a | #ifndef GetPortChExtra |
|---|
| 354 | n/a | PyMac_PRECHECK(GetPortChExtra); |
|---|
| 355 | n/a | #endif |
|---|
| 356 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 357 | n/a | return NULL; |
|---|
| 358 | n/a | _rv = GetPortChExtra(_self->ob_itself); |
|---|
| 359 | n/a | _res = Py_BuildValue("h", |
|---|
| 360 | n/a | _rv); |
|---|
| 361 | n/a | return _res; |
|---|
| 362 | n/a | } |
|---|
| 363 | n/a | |
|---|
| 364 | n/a | static PyObject *GrafObj_GetPortFracHPenLocation(GrafPortObject *_self, PyObject *_args) |
|---|
| 365 | n/a | { |
|---|
| 366 | n/a | PyObject *_res = NULL; |
|---|
| 367 | n/a | short _rv; |
|---|
| 368 | n/a | #ifndef GetPortFracHPenLocation |
|---|
| 369 | n/a | PyMac_PRECHECK(GetPortFracHPenLocation); |
|---|
| 370 | n/a | #endif |
|---|
| 371 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 372 | n/a | return NULL; |
|---|
| 373 | n/a | _rv = GetPortFracHPenLocation(_self->ob_itself); |
|---|
| 374 | n/a | _res = Py_BuildValue("h", |
|---|
| 375 | n/a | _rv); |
|---|
| 376 | n/a | return _res; |
|---|
| 377 | n/a | } |
|---|
| 378 | n/a | |
|---|
| 379 | n/a | static PyObject *GrafObj_GetPortSpExtra(GrafPortObject *_self, PyObject *_args) |
|---|
| 380 | n/a | { |
|---|
| 381 | n/a | PyObject *_res = NULL; |
|---|
| 382 | n/a | Fixed _rv; |
|---|
| 383 | n/a | #ifndef GetPortSpExtra |
|---|
| 384 | n/a | PyMac_PRECHECK(GetPortSpExtra); |
|---|
| 385 | n/a | #endif |
|---|
| 386 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 387 | n/a | return NULL; |
|---|
| 388 | n/a | _rv = GetPortSpExtra(_self->ob_itself); |
|---|
| 389 | n/a | _res = Py_BuildValue("O&", |
|---|
| 390 | n/a | PyMac_BuildFixed, _rv); |
|---|
| 391 | n/a | return _res; |
|---|
| 392 | n/a | } |
|---|
| 393 | n/a | |
|---|
| 394 | n/a | static PyObject *GrafObj_GetPortPenVisibility(GrafPortObject *_self, PyObject *_args) |
|---|
| 395 | n/a | { |
|---|
| 396 | n/a | PyObject *_res = NULL; |
|---|
| 397 | n/a | short _rv; |
|---|
| 398 | n/a | #ifndef GetPortPenVisibility |
|---|
| 399 | n/a | PyMac_PRECHECK(GetPortPenVisibility); |
|---|
| 400 | n/a | #endif |
|---|
| 401 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 402 | n/a | return NULL; |
|---|
| 403 | n/a | _rv = GetPortPenVisibility(_self->ob_itself); |
|---|
| 404 | n/a | _res = Py_BuildValue("h", |
|---|
| 405 | n/a | _rv); |
|---|
| 406 | n/a | return _res; |
|---|
| 407 | n/a | } |
|---|
| 408 | n/a | |
|---|
| 409 | n/a | static PyObject *GrafObj_GetPortVisibleRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 410 | n/a | { |
|---|
| 411 | n/a | PyObject *_res = NULL; |
|---|
| 412 | n/a | RgnHandle _rv; |
|---|
| 413 | n/a | RgnHandle visRgn; |
|---|
| 414 | n/a | #ifndef GetPortVisibleRegion |
|---|
| 415 | n/a | PyMac_PRECHECK(GetPortVisibleRegion); |
|---|
| 416 | n/a | #endif |
|---|
| 417 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 418 | n/a | ResObj_Convert, &visRgn)) |
|---|
| 419 | n/a | return NULL; |
|---|
| 420 | n/a | _rv = GetPortVisibleRegion(_self->ob_itself, |
|---|
| 421 | n/a | visRgn); |
|---|
| 422 | n/a | _res = Py_BuildValue("O&", |
|---|
| 423 | n/a | ResObj_New, _rv); |
|---|
| 424 | n/a | return _res; |
|---|
| 425 | n/a | } |
|---|
| 426 | n/a | |
|---|
| 427 | n/a | static PyObject *GrafObj_GetPortClipRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 428 | n/a | { |
|---|
| 429 | n/a | PyObject *_res = NULL; |
|---|
| 430 | n/a | RgnHandle _rv; |
|---|
| 431 | n/a | RgnHandle clipRgn; |
|---|
| 432 | n/a | #ifndef GetPortClipRegion |
|---|
| 433 | n/a | PyMac_PRECHECK(GetPortClipRegion); |
|---|
| 434 | n/a | #endif |
|---|
| 435 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 436 | n/a | ResObj_Convert, &clipRgn)) |
|---|
| 437 | n/a | return NULL; |
|---|
| 438 | n/a | _rv = GetPortClipRegion(_self->ob_itself, |
|---|
| 439 | n/a | clipRgn); |
|---|
| 440 | n/a | _res = Py_BuildValue("O&", |
|---|
| 441 | n/a | ResObj_New, _rv); |
|---|
| 442 | n/a | return _res; |
|---|
| 443 | n/a | } |
|---|
| 444 | n/a | |
|---|
| 445 | n/a | static PyObject *GrafObj_GetPortBackPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 446 | n/a | { |
|---|
| 447 | n/a | PyObject *_res = NULL; |
|---|
| 448 | n/a | PixPatHandle _rv; |
|---|
| 449 | n/a | PixPatHandle backPattern; |
|---|
| 450 | n/a | #ifndef GetPortBackPixPat |
|---|
| 451 | n/a | PyMac_PRECHECK(GetPortBackPixPat); |
|---|
| 452 | n/a | #endif |
|---|
| 453 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 454 | n/a | ResObj_Convert, &backPattern)) |
|---|
| 455 | n/a | return NULL; |
|---|
| 456 | n/a | _rv = GetPortBackPixPat(_self->ob_itself, |
|---|
| 457 | n/a | backPattern); |
|---|
| 458 | n/a | _res = Py_BuildValue("O&", |
|---|
| 459 | n/a | ResObj_New, _rv); |
|---|
| 460 | n/a | return _res; |
|---|
| 461 | n/a | } |
|---|
| 462 | n/a | |
|---|
| 463 | n/a | static PyObject *GrafObj_GetPortPenPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 464 | n/a | { |
|---|
| 465 | n/a | PyObject *_res = NULL; |
|---|
| 466 | n/a | PixPatHandle _rv; |
|---|
| 467 | n/a | PixPatHandle penPattern; |
|---|
| 468 | n/a | #ifndef GetPortPenPixPat |
|---|
| 469 | n/a | PyMac_PRECHECK(GetPortPenPixPat); |
|---|
| 470 | n/a | #endif |
|---|
| 471 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 472 | n/a | ResObj_Convert, &penPattern)) |
|---|
| 473 | n/a | return NULL; |
|---|
| 474 | n/a | _rv = GetPortPenPixPat(_self->ob_itself, |
|---|
| 475 | n/a | penPattern); |
|---|
| 476 | n/a | _res = Py_BuildValue("O&", |
|---|
| 477 | n/a | ResObj_New, _rv); |
|---|
| 478 | n/a | return _res; |
|---|
| 479 | n/a | } |
|---|
| 480 | n/a | |
|---|
| 481 | n/a | static PyObject *GrafObj_GetPortFillPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 482 | n/a | { |
|---|
| 483 | n/a | PyObject *_res = NULL; |
|---|
| 484 | n/a | PixPatHandle _rv; |
|---|
| 485 | n/a | PixPatHandle fillPattern; |
|---|
| 486 | n/a | #ifndef GetPortFillPixPat |
|---|
| 487 | n/a | PyMac_PRECHECK(GetPortFillPixPat); |
|---|
| 488 | n/a | #endif |
|---|
| 489 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 490 | n/a | ResObj_Convert, &fillPattern)) |
|---|
| 491 | n/a | return NULL; |
|---|
| 492 | n/a | _rv = GetPortFillPixPat(_self->ob_itself, |
|---|
| 493 | n/a | fillPattern); |
|---|
| 494 | n/a | _res = Py_BuildValue("O&", |
|---|
| 495 | n/a | ResObj_New, _rv); |
|---|
| 496 | n/a | return _res; |
|---|
| 497 | n/a | } |
|---|
| 498 | n/a | |
|---|
| 499 | n/a | static PyObject *GrafObj_GetPortPenSize(GrafPortObject *_self, PyObject *_args) |
|---|
| 500 | n/a | { |
|---|
| 501 | n/a | PyObject *_res = NULL; |
|---|
| 502 | n/a | Point penSize; |
|---|
| 503 | n/a | #ifndef GetPortPenSize |
|---|
| 504 | n/a | PyMac_PRECHECK(GetPortPenSize); |
|---|
| 505 | n/a | #endif |
|---|
| 506 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 507 | n/a | PyMac_GetPoint, &penSize)) |
|---|
| 508 | n/a | return NULL; |
|---|
| 509 | n/a | GetPortPenSize(_self->ob_itself, |
|---|
| 510 | n/a | &penSize); |
|---|
| 511 | n/a | _res = Py_BuildValue("O&", |
|---|
| 512 | n/a | PyMac_BuildPoint, penSize); |
|---|
| 513 | n/a | return _res; |
|---|
| 514 | n/a | } |
|---|
| 515 | n/a | |
|---|
| 516 | n/a | static PyObject *GrafObj_GetPortPenMode(GrafPortObject *_self, PyObject *_args) |
|---|
| 517 | n/a | { |
|---|
| 518 | n/a | PyObject *_res = NULL; |
|---|
| 519 | n/a | SInt32 _rv; |
|---|
| 520 | n/a | #ifndef GetPortPenMode |
|---|
| 521 | n/a | PyMac_PRECHECK(GetPortPenMode); |
|---|
| 522 | n/a | #endif |
|---|
| 523 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 524 | n/a | return NULL; |
|---|
| 525 | n/a | _rv = GetPortPenMode(_self->ob_itself); |
|---|
| 526 | n/a | _res = Py_BuildValue("l", |
|---|
| 527 | n/a | _rv); |
|---|
| 528 | n/a | return _res; |
|---|
| 529 | n/a | } |
|---|
| 530 | n/a | |
|---|
| 531 | n/a | static PyObject *GrafObj_GetPortPenLocation(GrafPortObject *_self, PyObject *_args) |
|---|
| 532 | n/a | { |
|---|
| 533 | n/a | PyObject *_res = NULL; |
|---|
| 534 | n/a | Point penLocation; |
|---|
| 535 | n/a | #ifndef GetPortPenLocation |
|---|
| 536 | n/a | PyMac_PRECHECK(GetPortPenLocation); |
|---|
| 537 | n/a | #endif |
|---|
| 538 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 539 | n/a | PyMac_GetPoint, &penLocation)) |
|---|
| 540 | n/a | return NULL; |
|---|
| 541 | n/a | GetPortPenLocation(_self->ob_itself, |
|---|
| 542 | n/a | &penLocation); |
|---|
| 543 | n/a | _res = Py_BuildValue("O&", |
|---|
| 544 | n/a | PyMac_BuildPoint, penLocation); |
|---|
| 545 | n/a | return _res; |
|---|
| 546 | n/a | } |
|---|
| 547 | n/a | |
|---|
| 548 | n/a | static PyObject *GrafObj_IsPortRegionBeingDefined(GrafPortObject *_self, PyObject *_args) |
|---|
| 549 | n/a | { |
|---|
| 550 | n/a | PyObject *_res = NULL; |
|---|
| 551 | n/a | Boolean _rv; |
|---|
| 552 | n/a | #ifndef IsPortRegionBeingDefined |
|---|
| 553 | n/a | PyMac_PRECHECK(IsPortRegionBeingDefined); |
|---|
| 554 | n/a | #endif |
|---|
| 555 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 556 | n/a | return NULL; |
|---|
| 557 | n/a | _rv = IsPortRegionBeingDefined(_self->ob_itself); |
|---|
| 558 | n/a | _res = Py_BuildValue("b", |
|---|
| 559 | n/a | _rv); |
|---|
| 560 | n/a | return _res; |
|---|
| 561 | n/a | } |
|---|
| 562 | n/a | |
|---|
| 563 | n/a | static PyObject *GrafObj_IsPortPictureBeingDefined(GrafPortObject *_self, PyObject *_args) |
|---|
| 564 | n/a | { |
|---|
| 565 | n/a | PyObject *_res = NULL; |
|---|
| 566 | n/a | Boolean _rv; |
|---|
| 567 | n/a | #ifndef IsPortPictureBeingDefined |
|---|
| 568 | n/a | PyMac_PRECHECK(IsPortPictureBeingDefined); |
|---|
| 569 | n/a | #endif |
|---|
| 570 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 571 | n/a | return NULL; |
|---|
| 572 | n/a | _rv = IsPortPictureBeingDefined(_self->ob_itself); |
|---|
| 573 | n/a | _res = Py_BuildValue("b", |
|---|
| 574 | n/a | _rv); |
|---|
| 575 | n/a | return _res; |
|---|
| 576 | n/a | } |
|---|
| 577 | n/a | |
|---|
| 578 | n/a | static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject *_args) |
|---|
| 579 | n/a | { |
|---|
| 580 | n/a | PyObject *_res = NULL; |
|---|
| 581 | n/a | Boolean _rv; |
|---|
| 582 | n/a | #ifndef IsPortPolyBeingDefined |
|---|
| 583 | n/a | PyMac_PRECHECK(IsPortPolyBeingDefined); |
|---|
| 584 | n/a | #endif |
|---|
| 585 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 586 | n/a | return NULL; |
|---|
| 587 | n/a | _rv = IsPortPolyBeingDefined(_self->ob_itself); |
|---|
| 588 | n/a | _res = Py_BuildValue("b", |
|---|
| 589 | n/a | _rv); |
|---|
| 590 | n/a | return _res; |
|---|
| 591 | n/a | } |
|---|
| 592 | n/a | |
|---|
| 593 | n/a | static PyObject *GrafObj_IsPortOffscreen(GrafPortObject *_self, PyObject *_args) |
|---|
| 594 | n/a | { |
|---|
| 595 | n/a | PyObject *_res = NULL; |
|---|
| 596 | n/a | Boolean _rv; |
|---|
| 597 | n/a | #ifndef IsPortOffscreen |
|---|
| 598 | n/a | PyMac_PRECHECK(IsPortOffscreen); |
|---|
| 599 | n/a | #endif |
|---|
| 600 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 601 | n/a | return NULL; |
|---|
| 602 | n/a | _rv = IsPortOffscreen(_self->ob_itself); |
|---|
| 603 | n/a | _res = Py_BuildValue("b", |
|---|
| 604 | n/a | _rv); |
|---|
| 605 | n/a | return _res; |
|---|
| 606 | n/a | } |
|---|
| 607 | n/a | |
|---|
| 608 | n/a | static PyObject *GrafObj_IsPortColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 609 | n/a | { |
|---|
| 610 | n/a | PyObject *_res = NULL; |
|---|
| 611 | n/a | Boolean _rv; |
|---|
| 612 | n/a | #ifndef IsPortColor |
|---|
| 613 | n/a | PyMac_PRECHECK(IsPortColor); |
|---|
| 614 | n/a | #endif |
|---|
| 615 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 616 | n/a | return NULL; |
|---|
| 617 | n/a | _rv = IsPortColor(_self->ob_itself); |
|---|
| 618 | n/a | _res = Py_BuildValue("b", |
|---|
| 619 | n/a | _rv); |
|---|
| 620 | n/a | return _res; |
|---|
| 621 | n/a | } |
|---|
| 622 | n/a | |
|---|
| 623 | n/a | static PyObject *GrafObj_IsPortVisibleRegionEmpty(GrafPortObject *_self, PyObject *_args) |
|---|
| 624 | n/a | { |
|---|
| 625 | n/a | PyObject *_res = NULL; |
|---|
| 626 | n/a | Boolean _rv; |
|---|
| 627 | n/a | #ifndef IsPortVisibleRegionEmpty |
|---|
| 628 | n/a | PyMac_PRECHECK(IsPortVisibleRegionEmpty); |
|---|
| 629 | n/a | #endif |
|---|
| 630 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 631 | n/a | return NULL; |
|---|
| 632 | n/a | _rv = IsPortVisibleRegionEmpty(_self->ob_itself); |
|---|
| 633 | n/a | _res = Py_BuildValue("b", |
|---|
| 634 | n/a | _rv); |
|---|
| 635 | n/a | return _res; |
|---|
| 636 | n/a | } |
|---|
| 637 | n/a | |
|---|
| 638 | n/a | static PyObject *GrafObj_IsPortClipRegionEmpty(GrafPortObject *_self, PyObject *_args) |
|---|
| 639 | n/a | { |
|---|
| 640 | n/a | PyObject *_res = NULL; |
|---|
| 641 | n/a | Boolean _rv; |
|---|
| 642 | n/a | #ifndef IsPortClipRegionEmpty |
|---|
| 643 | n/a | PyMac_PRECHECK(IsPortClipRegionEmpty); |
|---|
| 644 | n/a | #endif |
|---|
| 645 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 646 | n/a | return NULL; |
|---|
| 647 | n/a | _rv = IsPortClipRegionEmpty(_self->ob_itself); |
|---|
| 648 | n/a | _res = Py_BuildValue("b", |
|---|
| 649 | n/a | _rv); |
|---|
| 650 | n/a | return _res; |
|---|
| 651 | n/a | } |
|---|
| 652 | n/a | |
|---|
| 653 | n/a | static PyObject *GrafObj_SectRegionWithPortClipRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 654 | n/a | { |
|---|
| 655 | n/a | PyObject *_res = NULL; |
|---|
| 656 | n/a | RgnHandle ioRegion; |
|---|
| 657 | n/a | #ifndef SectRegionWithPortClipRegion |
|---|
| 658 | n/a | PyMac_PRECHECK(SectRegionWithPortClipRegion); |
|---|
| 659 | n/a | #endif |
|---|
| 660 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 661 | n/a | ResObj_Convert, &ioRegion)) |
|---|
| 662 | n/a | return NULL; |
|---|
| 663 | n/a | SectRegionWithPortClipRegion(_self->ob_itself, |
|---|
| 664 | n/a | ioRegion); |
|---|
| 665 | n/a | Py_INCREF(Py_None); |
|---|
| 666 | n/a | _res = Py_None; |
|---|
| 667 | n/a | return _res; |
|---|
| 668 | n/a | } |
|---|
| 669 | n/a | |
|---|
| 670 | n/a | static PyObject *GrafObj_SectRegionWithPortVisibleRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 671 | n/a | { |
|---|
| 672 | n/a | PyObject *_res = NULL; |
|---|
| 673 | n/a | RgnHandle ioRegion; |
|---|
| 674 | n/a | #ifndef SectRegionWithPortVisibleRegion |
|---|
| 675 | n/a | PyMac_PRECHECK(SectRegionWithPortVisibleRegion); |
|---|
| 676 | n/a | #endif |
|---|
| 677 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 678 | n/a | ResObj_Convert, &ioRegion)) |
|---|
| 679 | n/a | return NULL; |
|---|
| 680 | n/a | SectRegionWithPortVisibleRegion(_self->ob_itself, |
|---|
| 681 | n/a | ioRegion); |
|---|
| 682 | n/a | Py_INCREF(Py_None); |
|---|
| 683 | n/a | _res = Py_None; |
|---|
| 684 | n/a | return _res; |
|---|
| 685 | n/a | } |
|---|
| 686 | n/a | |
|---|
| 687 | n/a | static PyObject *GrafObj_SwapPortPicSaveHandle(GrafPortObject *_self, PyObject *_args) |
|---|
| 688 | n/a | { |
|---|
| 689 | n/a | PyObject *_res = NULL; |
|---|
| 690 | n/a | Handle _rv; |
|---|
| 691 | n/a | Handle inPicSaveHdl; |
|---|
| 692 | n/a | #ifndef SwapPortPicSaveHandle |
|---|
| 693 | n/a | PyMac_PRECHECK(SwapPortPicSaveHandle); |
|---|
| 694 | n/a | #endif |
|---|
| 695 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 696 | n/a | ResObj_Convert, &inPicSaveHdl)) |
|---|
| 697 | n/a | return NULL; |
|---|
| 698 | n/a | _rv = SwapPortPicSaveHandle(_self->ob_itself, |
|---|
| 699 | n/a | inPicSaveHdl); |
|---|
| 700 | n/a | _res = Py_BuildValue("O&", |
|---|
| 701 | n/a | ResObj_New, _rv); |
|---|
| 702 | n/a | return _res; |
|---|
| 703 | n/a | } |
|---|
| 704 | n/a | |
|---|
| 705 | n/a | static PyObject *GrafObj_SwapPortPolySaveHandle(GrafPortObject *_self, PyObject *_args) |
|---|
| 706 | n/a | { |
|---|
| 707 | n/a | PyObject *_res = NULL; |
|---|
| 708 | n/a | Handle _rv; |
|---|
| 709 | n/a | Handle inPolySaveHdl; |
|---|
| 710 | n/a | #ifndef SwapPortPolySaveHandle |
|---|
| 711 | n/a | PyMac_PRECHECK(SwapPortPolySaveHandle); |
|---|
| 712 | n/a | #endif |
|---|
| 713 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 714 | n/a | ResObj_Convert, &inPolySaveHdl)) |
|---|
| 715 | n/a | return NULL; |
|---|
| 716 | n/a | _rv = SwapPortPolySaveHandle(_self->ob_itself, |
|---|
| 717 | n/a | inPolySaveHdl); |
|---|
| 718 | n/a | _res = Py_BuildValue("O&", |
|---|
| 719 | n/a | ResObj_New, _rv); |
|---|
| 720 | n/a | return _res; |
|---|
| 721 | n/a | } |
|---|
| 722 | n/a | |
|---|
| 723 | n/a | static PyObject *GrafObj_SwapPortRegionSaveHandle(GrafPortObject *_self, PyObject *_args) |
|---|
| 724 | n/a | { |
|---|
| 725 | n/a | PyObject *_res = NULL; |
|---|
| 726 | n/a | Handle _rv; |
|---|
| 727 | n/a | Handle inRegionSaveHdl; |
|---|
| 728 | n/a | #ifndef SwapPortRegionSaveHandle |
|---|
| 729 | n/a | PyMac_PRECHECK(SwapPortRegionSaveHandle); |
|---|
| 730 | n/a | #endif |
|---|
| 731 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 732 | n/a | ResObj_Convert, &inRegionSaveHdl)) |
|---|
| 733 | n/a | return NULL; |
|---|
| 734 | n/a | _rv = SwapPortRegionSaveHandle(_self->ob_itself, |
|---|
| 735 | n/a | inRegionSaveHdl); |
|---|
| 736 | n/a | _res = Py_BuildValue("O&", |
|---|
| 737 | n/a | ResObj_New, _rv); |
|---|
| 738 | n/a | return _res; |
|---|
| 739 | n/a | } |
|---|
| 740 | n/a | |
|---|
| 741 | n/a | static PyObject *GrafObj_SetPortBounds(GrafPortObject *_self, PyObject *_args) |
|---|
| 742 | n/a | { |
|---|
| 743 | n/a | PyObject *_res = NULL; |
|---|
| 744 | n/a | Rect rect; |
|---|
| 745 | n/a | #ifndef SetPortBounds |
|---|
| 746 | n/a | PyMac_PRECHECK(SetPortBounds); |
|---|
| 747 | n/a | #endif |
|---|
| 748 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 749 | n/a | PyMac_GetRect, &rect)) |
|---|
| 750 | n/a | return NULL; |
|---|
| 751 | n/a | SetPortBounds(_self->ob_itself, |
|---|
| 752 | n/a | &rect); |
|---|
| 753 | n/a | Py_INCREF(Py_None); |
|---|
| 754 | n/a | _res = Py_None; |
|---|
| 755 | n/a | return _res; |
|---|
| 756 | n/a | } |
|---|
| 757 | n/a | |
|---|
| 758 | n/a | static PyObject *GrafObj_SetPortOpColor(GrafPortObject *_self, PyObject *_args) |
|---|
| 759 | n/a | { |
|---|
| 760 | n/a | PyObject *_res = NULL; |
|---|
| 761 | n/a | RGBColor opColor; |
|---|
| 762 | n/a | #ifndef SetPortOpColor |
|---|
| 763 | n/a | PyMac_PRECHECK(SetPortOpColor); |
|---|
| 764 | n/a | #endif |
|---|
| 765 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 766 | n/a | QdRGB_Convert, &opColor)) |
|---|
| 767 | n/a | return NULL; |
|---|
| 768 | n/a | SetPortOpColor(_self->ob_itself, |
|---|
| 769 | n/a | &opColor); |
|---|
| 770 | n/a | Py_INCREF(Py_None); |
|---|
| 771 | n/a | _res = Py_None; |
|---|
| 772 | n/a | return _res; |
|---|
| 773 | n/a | } |
|---|
| 774 | n/a | |
|---|
| 775 | n/a | static PyObject *GrafObj_SetPortTextFont(GrafPortObject *_self, PyObject *_args) |
|---|
| 776 | n/a | { |
|---|
| 777 | n/a | PyObject *_res = NULL; |
|---|
| 778 | n/a | short txFont; |
|---|
| 779 | n/a | #ifndef SetPortTextFont |
|---|
| 780 | n/a | PyMac_PRECHECK(SetPortTextFont); |
|---|
| 781 | n/a | #endif |
|---|
| 782 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 783 | n/a | &txFont)) |
|---|
| 784 | n/a | return NULL; |
|---|
| 785 | n/a | SetPortTextFont(_self->ob_itself, |
|---|
| 786 | n/a | txFont); |
|---|
| 787 | n/a | Py_INCREF(Py_None); |
|---|
| 788 | n/a | _res = Py_None; |
|---|
| 789 | n/a | return _res; |
|---|
| 790 | n/a | } |
|---|
| 791 | n/a | |
|---|
| 792 | n/a | static PyObject *GrafObj_SetPortTextSize(GrafPortObject *_self, PyObject *_args) |
|---|
| 793 | n/a | { |
|---|
| 794 | n/a | PyObject *_res = NULL; |
|---|
| 795 | n/a | short txSize; |
|---|
| 796 | n/a | #ifndef SetPortTextSize |
|---|
| 797 | n/a | PyMac_PRECHECK(SetPortTextSize); |
|---|
| 798 | n/a | #endif |
|---|
| 799 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 800 | n/a | &txSize)) |
|---|
| 801 | n/a | return NULL; |
|---|
| 802 | n/a | SetPortTextSize(_self->ob_itself, |
|---|
| 803 | n/a | txSize); |
|---|
| 804 | n/a | Py_INCREF(Py_None); |
|---|
| 805 | n/a | _res = Py_None; |
|---|
| 806 | n/a | return _res; |
|---|
| 807 | n/a | } |
|---|
| 808 | n/a | |
|---|
| 809 | n/a | static PyObject *GrafObj_SetPortTextFace(GrafPortObject *_self, PyObject *_args) |
|---|
| 810 | n/a | { |
|---|
| 811 | n/a | PyObject *_res = NULL; |
|---|
| 812 | n/a | StyleParameter face; |
|---|
| 813 | n/a | #ifndef SetPortTextFace |
|---|
| 814 | n/a | PyMac_PRECHECK(SetPortTextFace); |
|---|
| 815 | n/a | #endif |
|---|
| 816 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 817 | n/a | &face)) |
|---|
| 818 | n/a | return NULL; |
|---|
| 819 | n/a | SetPortTextFace(_self->ob_itself, |
|---|
| 820 | n/a | face); |
|---|
| 821 | n/a | Py_INCREF(Py_None); |
|---|
| 822 | n/a | _res = Py_None; |
|---|
| 823 | n/a | return _res; |
|---|
| 824 | n/a | } |
|---|
| 825 | n/a | |
|---|
| 826 | n/a | static PyObject *GrafObj_SetPortTextMode(GrafPortObject *_self, PyObject *_args) |
|---|
| 827 | n/a | { |
|---|
| 828 | n/a | PyObject *_res = NULL; |
|---|
| 829 | n/a | short mode; |
|---|
| 830 | n/a | #ifndef SetPortTextMode |
|---|
| 831 | n/a | PyMac_PRECHECK(SetPortTextMode); |
|---|
| 832 | n/a | #endif |
|---|
| 833 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 834 | n/a | &mode)) |
|---|
| 835 | n/a | return NULL; |
|---|
| 836 | n/a | SetPortTextMode(_self->ob_itself, |
|---|
| 837 | n/a | mode); |
|---|
| 838 | n/a | Py_INCREF(Py_None); |
|---|
| 839 | n/a | _res = Py_None; |
|---|
| 840 | n/a | return _res; |
|---|
| 841 | n/a | } |
|---|
| 842 | n/a | |
|---|
| 843 | n/a | static PyObject *GrafObj_SetPortVisibleRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 844 | n/a | { |
|---|
| 845 | n/a | PyObject *_res = NULL; |
|---|
| 846 | n/a | RgnHandle visRgn; |
|---|
| 847 | n/a | #ifndef SetPortVisibleRegion |
|---|
| 848 | n/a | PyMac_PRECHECK(SetPortVisibleRegion); |
|---|
| 849 | n/a | #endif |
|---|
| 850 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 851 | n/a | ResObj_Convert, &visRgn)) |
|---|
| 852 | n/a | return NULL; |
|---|
| 853 | n/a | SetPortVisibleRegion(_self->ob_itself, |
|---|
| 854 | n/a | visRgn); |
|---|
| 855 | n/a | Py_INCREF(Py_None); |
|---|
| 856 | n/a | _res = Py_None; |
|---|
| 857 | n/a | return _res; |
|---|
| 858 | n/a | } |
|---|
| 859 | n/a | |
|---|
| 860 | n/a | static PyObject *GrafObj_SetPortClipRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 861 | n/a | { |
|---|
| 862 | n/a | PyObject *_res = NULL; |
|---|
| 863 | n/a | RgnHandle clipRgn; |
|---|
| 864 | n/a | #ifndef SetPortClipRegion |
|---|
| 865 | n/a | PyMac_PRECHECK(SetPortClipRegion); |
|---|
| 866 | n/a | #endif |
|---|
| 867 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 868 | n/a | ResObj_Convert, &clipRgn)) |
|---|
| 869 | n/a | return NULL; |
|---|
| 870 | n/a | SetPortClipRegion(_self->ob_itself, |
|---|
| 871 | n/a | clipRgn); |
|---|
| 872 | n/a | Py_INCREF(Py_None); |
|---|
| 873 | n/a | _res = Py_None; |
|---|
| 874 | n/a | return _res; |
|---|
| 875 | n/a | } |
|---|
| 876 | n/a | |
|---|
| 877 | n/a | static PyObject *GrafObj_SetPortPenPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 878 | n/a | { |
|---|
| 879 | n/a | PyObject *_res = NULL; |
|---|
| 880 | n/a | PixPatHandle penPattern; |
|---|
| 881 | n/a | #ifndef SetPortPenPixPat |
|---|
| 882 | n/a | PyMac_PRECHECK(SetPortPenPixPat); |
|---|
| 883 | n/a | #endif |
|---|
| 884 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 885 | n/a | ResObj_Convert, &penPattern)) |
|---|
| 886 | n/a | return NULL; |
|---|
| 887 | n/a | SetPortPenPixPat(_self->ob_itself, |
|---|
| 888 | n/a | penPattern); |
|---|
| 889 | n/a | Py_INCREF(Py_None); |
|---|
| 890 | n/a | _res = Py_None; |
|---|
| 891 | n/a | return _res; |
|---|
| 892 | n/a | } |
|---|
| 893 | n/a | |
|---|
| 894 | n/a | static PyObject *GrafObj_SetPortFillPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 895 | n/a | { |
|---|
| 896 | n/a | PyObject *_res = NULL; |
|---|
| 897 | n/a | PixPatHandle penPattern; |
|---|
| 898 | n/a | #ifndef SetPortFillPixPat |
|---|
| 899 | n/a | PyMac_PRECHECK(SetPortFillPixPat); |
|---|
| 900 | n/a | #endif |
|---|
| 901 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 902 | n/a | ResObj_Convert, &penPattern)) |
|---|
| 903 | n/a | return NULL; |
|---|
| 904 | n/a | SetPortFillPixPat(_self->ob_itself, |
|---|
| 905 | n/a | penPattern); |
|---|
| 906 | n/a | Py_INCREF(Py_None); |
|---|
| 907 | n/a | _res = Py_None; |
|---|
| 908 | n/a | return _res; |
|---|
| 909 | n/a | } |
|---|
| 910 | n/a | |
|---|
| 911 | n/a | static PyObject *GrafObj_SetPortBackPixPat(GrafPortObject *_self, PyObject *_args) |
|---|
| 912 | n/a | { |
|---|
| 913 | n/a | PyObject *_res = NULL; |
|---|
| 914 | n/a | PixPatHandle backPattern; |
|---|
| 915 | n/a | #ifndef SetPortBackPixPat |
|---|
| 916 | n/a | PyMac_PRECHECK(SetPortBackPixPat); |
|---|
| 917 | n/a | #endif |
|---|
| 918 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 919 | n/a | ResObj_Convert, &backPattern)) |
|---|
| 920 | n/a | return NULL; |
|---|
| 921 | n/a | SetPortBackPixPat(_self->ob_itself, |
|---|
| 922 | n/a | backPattern); |
|---|
| 923 | n/a | Py_INCREF(Py_None); |
|---|
| 924 | n/a | _res = Py_None; |
|---|
| 925 | n/a | return _res; |
|---|
| 926 | n/a | } |
|---|
| 927 | n/a | |
|---|
| 928 | n/a | static PyObject *GrafObj_SetPortPenSize(GrafPortObject *_self, PyObject *_args) |
|---|
| 929 | n/a | { |
|---|
| 930 | n/a | PyObject *_res = NULL; |
|---|
| 931 | n/a | Point penSize; |
|---|
| 932 | n/a | #ifndef SetPortPenSize |
|---|
| 933 | n/a | PyMac_PRECHECK(SetPortPenSize); |
|---|
| 934 | n/a | #endif |
|---|
| 935 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 936 | n/a | PyMac_GetPoint, &penSize)) |
|---|
| 937 | n/a | return NULL; |
|---|
| 938 | n/a | SetPortPenSize(_self->ob_itself, |
|---|
| 939 | n/a | penSize); |
|---|
| 940 | n/a | Py_INCREF(Py_None); |
|---|
| 941 | n/a | _res = Py_None; |
|---|
| 942 | n/a | return _res; |
|---|
| 943 | n/a | } |
|---|
| 944 | n/a | |
|---|
| 945 | n/a | static PyObject *GrafObj_SetPortPenMode(GrafPortObject *_self, PyObject *_args) |
|---|
| 946 | n/a | { |
|---|
| 947 | n/a | PyObject *_res = NULL; |
|---|
| 948 | n/a | SInt32 penMode; |
|---|
| 949 | n/a | #ifndef SetPortPenMode |
|---|
| 950 | n/a | PyMac_PRECHECK(SetPortPenMode); |
|---|
| 951 | n/a | #endif |
|---|
| 952 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 953 | n/a | &penMode)) |
|---|
| 954 | n/a | return NULL; |
|---|
| 955 | n/a | SetPortPenMode(_self->ob_itself, |
|---|
| 956 | n/a | penMode); |
|---|
| 957 | n/a | Py_INCREF(Py_None); |
|---|
| 958 | n/a | _res = Py_None; |
|---|
| 959 | n/a | return _res; |
|---|
| 960 | n/a | } |
|---|
| 961 | n/a | |
|---|
| 962 | n/a | static PyObject *GrafObj_SetPortFracHPenLocation(GrafPortObject *_self, PyObject *_args) |
|---|
| 963 | n/a | { |
|---|
| 964 | n/a | PyObject *_res = NULL; |
|---|
| 965 | n/a | short pnLocHFrac; |
|---|
| 966 | n/a | #ifndef SetPortFracHPenLocation |
|---|
| 967 | n/a | PyMac_PRECHECK(SetPortFracHPenLocation); |
|---|
| 968 | n/a | #endif |
|---|
| 969 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 970 | n/a | &pnLocHFrac)) |
|---|
| 971 | n/a | return NULL; |
|---|
| 972 | n/a | SetPortFracHPenLocation(_self->ob_itself, |
|---|
| 973 | n/a | pnLocHFrac); |
|---|
| 974 | n/a | Py_INCREF(Py_None); |
|---|
| 975 | n/a | _res = Py_None; |
|---|
| 976 | n/a | return _res; |
|---|
| 977 | n/a | } |
|---|
| 978 | n/a | |
|---|
| 979 | n/a | static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args) |
|---|
| 980 | n/a | { |
|---|
| 981 | n/a | PyObject *_res = NULL; |
|---|
| 982 | n/a | #ifndef DisposePort |
|---|
| 983 | n/a | PyMac_PRECHECK(DisposePort); |
|---|
| 984 | n/a | #endif |
|---|
| 985 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 986 | n/a | return NULL; |
|---|
| 987 | n/a | DisposePort(_self->ob_itself); |
|---|
| 988 | n/a | Py_INCREF(Py_None); |
|---|
| 989 | n/a | _res = Py_None; |
|---|
| 990 | n/a | return _res; |
|---|
| 991 | n/a | } |
|---|
| 992 | n/a | |
|---|
| 993 | n/a | static PyObject *GrafObj_QDLocalToGlobalPoint(GrafPortObject *_self, PyObject *_args) |
|---|
| 994 | n/a | { |
|---|
| 995 | n/a | PyObject *_res = NULL; |
|---|
| 996 | n/a | Point point; |
|---|
| 997 | n/a | #ifndef QDLocalToGlobalPoint |
|---|
| 998 | n/a | PyMac_PRECHECK(QDLocalToGlobalPoint); |
|---|
| 999 | n/a | #endif |
|---|
| 1000 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1001 | n/a | PyMac_GetPoint, &point)) |
|---|
| 1002 | n/a | return NULL; |
|---|
| 1003 | n/a | QDLocalToGlobalPoint(_self->ob_itself, |
|---|
| 1004 | n/a | &point); |
|---|
| 1005 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1006 | n/a | PyMac_BuildPoint, point); |
|---|
| 1007 | n/a | return _res; |
|---|
| 1008 | n/a | } |
|---|
| 1009 | n/a | |
|---|
| 1010 | n/a | static PyObject *GrafObj_QDGlobalToLocalPoint(GrafPortObject *_self, PyObject *_args) |
|---|
| 1011 | n/a | { |
|---|
| 1012 | n/a | PyObject *_res = NULL; |
|---|
| 1013 | n/a | Point point; |
|---|
| 1014 | n/a | #ifndef QDGlobalToLocalPoint |
|---|
| 1015 | n/a | PyMac_PRECHECK(QDGlobalToLocalPoint); |
|---|
| 1016 | n/a | #endif |
|---|
| 1017 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1018 | n/a | PyMac_GetPoint, &point)) |
|---|
| 1019 | n/a | return NULL; |
|---|
| 1020 | n/a | QDGlobalToLocalPoint(_self->ob_itself, |
|---|
| 1021 | n/a | &point); |
|---|
| 1022 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1023 | n/a | PyMac_BuildPoint, point); |
|---|
| 1024 | n/a | return _res; |
|---|
| 1025 | n/a | } |
|---|
| 1026 | n/a | |
|---|
| 1027 | n/a | static PyObject *GrafObj_QDLocalToGlobalRect(GrafPortObject *_self, PyObject *_args) |
|---|
| 1028 | n/a | { |
|---|
| 1029 | n/a | PyObject *_res = NULL; |
|---|
| 1030 | n/a | Rect bounds; |
|---|
| 1031 | n/a | #ifndef QDLocalToGlobalRect |
|---|
| 1032 | n/a | PyMac_PRECHECK(QDLocalToGlobalRect); |
|---|
| 1033 | n/a | #endif |
|---|
| 1034 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1035 | n/a | return NULL; |
|---|
| 1036 | n/a | QDLocalToGlobalRect(_self->ob_itself, |
|---|
| 1037 | n/a | &bounds); |
|---|
| 1038 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1039 | n/a | PyMac_BuildRect, &bounds); |
|---|
| 1040 | n/a | return _res; |
|---|
| 1041 | n/a | } |
|---|
| 1042 | n/a | |
|---|
| 1043 | n/a | static PyObject *GrafObj_QDGlobalToLocalRect(GrafPortObject *_self, PyObject *_args) |
|---|
| 1044 | n/a | { |
|---|
| 1045 | n/a | PyObject *_res = NULL; |
|---|
| 1046 | n/a | Rect bounds; |
|---|
| 1047 | n/a | #ifndef QDGlobalToLocalRect |
|---|
| 1048 | n/a | PyMac_PRECHECK(QDGlobalToLocalRect); |
|---|
| 1049 | n/a | #endif |
|---|
| 1050 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1051 | n/a | return NULL; |
|---|
| 1052 | n/a | QDGlobalToLocalRect(_self->ob_itself, |
|---|
| 1053 | n/a | &bounds); |
|---|
| 1054 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1055 | n/a | PyMac_BuildRect, &bounds); |
|---|
| 1056 | n/a | return _res; |
|---|
| 1057 | n/a | } |
|---|
| 1058 | n/a | |
|---|
| 1059 | n/a | static PyObject *GrafObj_QDLocalToGlobalRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 1060 | n/a | { |
|---|
| 1061 | n/a | PyObject *_res = NULL; |
|---|
| 1062 | n/a | RgnHandle _rv; |
|---|
| 1063 | n/a | RgnHandle region; |
|---|
| 1064 | n/a | #ifndef QDLocalToGlobalRegion |
|---|
| 1065 | n/a | PyMac_PRECHECK(QDLocalToGlobalRegion); |
|---|
| 1066 | n/a | #endif |
|---|
| 1067 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1068 | n/a | ResObj_Convert, ®ion)) |
|---|
| 1069 | n/a | return NULL; |
|---|
| 1070 | n/a | _rv = QDLocalToGlobalRegion(_self->ob_itself, |
|---|
| 1071 | n/a | region); |
|---|
| 1072 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1073 | n/a | ResObj_New, _rv); |
|---|
| 1074 | n/a | return _res; |
|---|
| 1075 | n/a | } |
|---|
| 1076 | n/a | |
|---|
| 1077 | n/a | static PyObject *GrafObj_QDGlobalToLocalRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 1078 | n/a | { |
|---|
| 1079 | n/a | PyObject *_res = NULL; |
|---|
| 1080 | n/a | RgnHandle _rv; |
|---|
| 1081 | n/a | RgnHandle region; |
|---|
| 1082 | n/a | #ifndef QDGlobalToLocalRegion |
|---|
| 1083 | n/a | PyMac_PRECHECK(QDGlobalToLocalRegion); |
|---|
| 1084 | n/a | #endif |
|---|
| 1085 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1086 | n/a | ResObj_Convert, ®ion)) |
|---|
| 1087 | n/a | return NULL; |
|---|
| 1088 | n/a | _rv = QDGlobalToLocalRegion(_self->ob_itself, |
|---|
| 1089 | n/a | region); |
|---|
| 1090 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1091 | n/a | ResObj_New, _rv); |
|---|
| 1092 | n/a | return _res; |
|---|
| 1093 | n/a | } |
|---|
| 1094 | n/a | |
|---|
| 1095 | n/a | static PyObject *GrafObj_QDIsPortBuffered(GrafPortObject *_self, PyObject *_args) |
|---|
| 1096 | n/a | { |
|---|
| 1097 | n/a | PyObject *_res = NULL; |
|---|
| 1098 | n/a | Boolean _rv; |
|---|
| 1099 | n/a | #ifndef QDIsPortBuffered |
|---|
| 1100 | n/a | PyMac_PRECHECK(QDIsPortBuffered); |
|---|
| 1101 | n/a | #endif |
|---|
| 1102 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1103 | n/a | return NULL; |
|---|
| 1104 | n/a | _rv = QDIsPortBuffered(_self->ob_itself); |
|---|
| 1105 | n/a | _res = Py_BuildValue("b", |
|---|
| 1106 | n/a | _rv); |
|---|
| 1107 | n/a | return _res; |
|---|
| 1108 | n/a | } |
|---|
| 1109 | n/a | |
|---|
| 1110 | n/a | static PyObject *GrafObj_QDIsPortBufferDirty(GrafPortObject *_self, PyObject *_args) |
|---|
| 1111 | n/a | { |
|---|
| 1112 | n/a | PyObject *_res = NULL; |
|---|
| 1113 | n/a | Boolean _rv; |
|---|
| 1114 | n/a | #ifndef QDIsPortBufferDirty |
|---|
| 1115 | n/a | PyMac_PRECHECK(QDIsPortBufferDirty); |
|---|
| 1116 | n/a | #endif |
|---|
| 1117 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1118 | n/a | return NULL; |
|---|
| 1119 | n/a | _rv = QDIsPortBufferDirty(_self->ob_itself); |
|---|
| 1120 | n/a | _res = Py_BuildValue("b", |
|---|
| 1121 | n/a | _rv); |
|---|
| 1122 | n/a | return _res; |
|---|
| 1123 | n/a | } |
|---|
| 1124 | n/a | |
|---|
| 1125 | n/a | static PyObject *GrafObj_QDFlushPortBuffer(GrafPortObject *_self, PyObject *_args) |
|---|
| 1126 | n/a | { |
|---|
| 1127 | n/a | PyObject *_res = NULL; |
|---|
| 1128 | n/a | RgnHandle region; |
|---|
| 1129 | n/a | #ifndef QDFlushPortBuffer |
|---|
| 1130 | n/a | PyMac_PRECHECK(QDFlushPortBuffer); |
|---|
| 1131 | n/a | #endif |
|---|
| 1132 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1133 | n/a | OptResObj_Convert, ®ion)) |
|---|
| 1134 | n/a | return NULL; |
|---|
| 1135 | n/a | QDFlushPortBuffer(_self->ob_itself, |
|---|
| 1136 | n/a | region); |
|---|
| 1137 | n/a | Py_INCREF(Py_None); |
|---|
| 1138 | n/a | _res = Py_None; |
|---|
| 1139 | n/a | return _res; |
|---|
| 1140 | n/a | } |
|---|
| 1141 | n/a | |
|---|
| 1142 | n/a | static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 1143 | n/a | { |
|---|
| 1144 | n/a | PyObject *_res = NULL; |
|---|
| 1145 | n/a | OSStatus _err; |
|---|
| 1146 | n/a | RgnHandle rgn; |
|---|
| 1147 | n/a | #ifndef QDGetDirtyRegion |
|---|
| 1148 | n/a | PyMac_PRECHECK(QDGetDirtyRegion); |
|---|
| 1149 | n/a | #endif |
|---|
| 1150 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1151 | n/a | ResObj_Convert, &rgn)) |
|---|
| 1152 | n/a | return NULL; |
|---|
| 1153 | n/a | _err = QDGetDirtyRegion(_self->ob_itself, |
|---|
| 1154 | n/a | rgn); |
|---|
| 1155 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1156 | n/a | Py_INCREF(Py_None); |
|---|
| 1157 | n/a | _res = Py_None; |
|---|
| 1158 | n/a | return _res; |
|---|
| 1159 | n/a | } |
|---|
| 1160 | n/a | |
|---|
| 1161 | n/a | static PyObject *GrafObj_QDSetDirtyRegion(GrafPortObject *_self, PyObject *_args) |
|---|
| 1162 | n/a | { |
|---|
| 1163 | n/a | PyObject *_res = NULL; |
|---|
| 1164 | n/a | OSStatus _err; |
|---|
| 1165 | n/a | RgnHandle rgn; |
|---|
| 1166 | n/a | #ifndef QDSetDirtyRegion |
|---|
| 1167 | n/a | PyMac_PRECHECK(QDSetDirtyRegion); |
|---|
| 1168 | n/a | #endif |
|---|
| 1169 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1170 | n/a | ResObj_Convert, &rgn)) |
|---|
| 1171 | n/a | return NULL; |
|---|
| 1172 | n/a | _err = QDSetDirtyRegion(_self->ob_itself, |
|---|
| 1173 | n/a | rgn); |
|---|
| 1174 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 1175 | n/a | Py_INCREF(Py_None); |
|---|
| 1176 | n/a | _res = Py_None; |
|---|
| 1177 | n/a | return _res; |
|---|
| 1178 | n/a | } |
|---|
| 1179 | n/a | |
|---|
| 1180 | n/a | static PyMethodDef GrafObj_methods[] = { |
|---|
| 1181 | n/a | {"MacSetPort", (PyCFunction)GrafObj_MacSetPort, 1, |
|---|
| 1182 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 1183 | n/a | {"QDSwapPort", (PyCFunction)GrafObj_QDSwapPort, 1, |
|---|
| 1184 | n/a | PyDoc_STR("() -> (Boolean _rv, CGrafPtr outOldPort)")}, |
|---|
| 1185 | n/a | {"IsValidPort", (PyCFunction)GrafObj_IsValidPort, 1, |
|---|
| 1186 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1187 | n/a | {"GetPortPixMap", (PyCFunction)GrafObj_GetPortPixMap, 1, |
|---|
| 1188 | n/a | PyDoc_STR("() -> (PixMapHandle _rv)")}, |
|---|
| 1189 | n/a | {"GetPortBitMapForCopyBits", (PyCFunction)GrafObj_GetPortBitMapForCopyBits, 1, |
|---|
| 1190 | n/a | PyDoc_STR("() -> (const BitMap * _rv)")}, |
|---|
| 1191 | n/a | {"GetPortBounds", (PyCFunction)GrafObj_GetPortBounds, 1, |
|---|
| 1192 | n/a | PyDoc_STR("() -> (Rect rect)")}, |
|---|
| 1193 | n/a | {"GetPortForeColor", (PyCFunction)GrafObj_GetPortForeColor, 1, |
|---|
| 1194 | n/a | PyDoc_STR("() -> (RGBColor foreColor)")}, |
|---|
| 1195 | n/a | {"GetPortBackColor", (PyCFunction)GrafObj_GetPortBackColor, 1, |
|---|
| 1196 | n/a | PyDoc_STR("() -> (RGBColor backColor)")}, |
|---|
| 1197 | n/a | {"GetPortOpColor", (PyCFunction)GrafObj_GetPortOpColor, 1, |
|---|
| 1198 | n/a | PyDoc_STR("() -> (RGBColor opColor)")}, |
|---|
| 1199 | n/a | {"GetPortHiliteColor", (PyCFunction)GrafObj_GetPortHiliteColor, 1, |
|---|
| 1200 | n/a | PyDoc_STR("() -> (RGBColor hiliteColor)")}, |
|---|
| 1201 | n/a | {"GetPortTextFont", (PyCFunction)GrafObj_GetPortTextFont, 1, |
|---|
| 1202 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1203 | n/a | {"GetPortTextFace", (PyCFunction)GrafObj_GetPortTextFace, 1, |
|---|
| 1204 | n/a | PyDoc_STR("() -> (Style _rv)")}, |
|---|
| 1205 | n/a | {"GetPortTextMode", (PyCFunction)GrafObj_GetPortTextMode, 1, |
|---|
| 1206 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1207 | n/a | {"GetPortTextSize", (PyCFunction)GrafObj_GetPortTextSize, 1, |
|---|
| 1208 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1209 | n/a | {"GetPortChExtra", (PyCFunction)GrafObj_GetPortChExtra, 1, |
|---|
| 1210 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1211 | n/a | {"GetPortFracHPenLocation", (PyCFunction)GrafObj_GetPortFracHPenLocation, 1, |
|---|
| 1212 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1213 | n/a | {"GetPortSpExtra", (PyCFunction)GrafObj_GetPortSpExtra, 1, |
|---|
| 1214 | n/a | PyDoc_STR("() -> (Fixed _rv)")}, |
|---|
| 1215 | n/a | {"GetPortPenVisibility", (PyCFunction)GrafObj_GetPortPenVisibility, 1, |
|---|
| 1216 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 1217 | n/a | {"GetPortVisibleRegion", (PyCFunction)GrafObj_GetPortVisibleRegion, 1, |
|---|
| 1218 | n/a | PyDoc_STR("(RgnHandle visRgn) -> (RgnHandle _rv)")}, |
|---|
| 1219 | n/a | {"GetPortClipRegion", (PyCFunction)GrafObj_GetPortClipRegion, 1, |
|---|
| 1220 | n/a | PyDoc_STR("(RgnHandle clipRgn) -> (RgnHandle _rv)")}, |
|---|
| 1221 | n/a | {"GetPortBackPixPat", (PyCFunction)GrafObj_GetPortBackPixPat, 1, |
|---|
| 1222 | n/a | PyDoc_STR("(PixPatHandle backPattern) -> (PixPatHandle _rv)")}, |
|---|
| 1223 | n/a | {"GetPortPenPixPat", (PyCFunction)GrafObj_GetPortPenPixPat, 1, |
|---|
| 1224 | n/a | PyDoc_STR("(PixPatHandle penPattern) -> (PixPatHandle _rv)")}, |
|---|
| 1225 | n/a | {"GetPortFillPixPat", (PyCFunction)GrafObj_GetPortFillPixPat, 1, |
|---|
| 1226 | n/a | PyDoc_STR("(PixPatHandle fillPattern) -> (PixPatHandle _rv)")}, |
|---|
| 1227 | n/a | {"GetPortPenSize", (PyCFunction)GrafObj_GetPortPenSize, 1, |
|---|
| 1228 | n/a | PyDoc_STR("(Point penSize) -> (Point penSize)")}, |
|---|
| 1229 | n/a | {"GetPortPenMode", (PyCFunction)GrafObj_GetPortPenMode, 1, |
|---|
| 1230 | n/a | PyDoc_STR("() -> (SInt32 _rv)")}, |
|---|
| 1231 | n/a | {"GetPortPenLocation", (PyCFunction)GrafObj_GetPortPenLocation, 1, |
|---|
| 1232 | n/a | PyDoc_STR("(Point penLocation) -> (Point penLocation)")}, |
|---|
| 1233 | n/a | {"IsPortRegionBeingDefined", (PyCFunction)GrafObj_IsPortRegionBeingDefined, 1, |
|---|
| 1234 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1235 | n/a | {"IsPortPictureBeingDefined", (PyCFunction)GrafObj_IsPortPictureBeingDefined, 1, |
|---|
| 1236 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1237 | n/a | {"IsPortPolyBeingDefined", (PyCFunction)GrafObj_IsPortPolyBeingDefined, 1, |
|---|
| 1238 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1239 | n/a | {"IsPortOffscreen", (PyCFunction)GrafObj_IsPortOffscreen, 1, |
|---|
| 1240 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1241 | n/a | {"IsPortColor", (PyCFunction)GrafObj_IsPortColor, 1, |
|---|
| 1242 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1243 | n/a | {"IsPortVisibleRegionEmpty", (PyCFunction)GrafObj_IsPortVisibleRegionEmpty, 1, |
|---|
| 1244 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1245 | n/a | {"IsPortClipRegionEmpty", (PyCFunction)GrafObj_IsPortClipRegionEmpty, 1, |
|---|
| 1246 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1247 | n/a | {"SectRegionWithPortClipRegion", (PyCFunction)GrafObj_SectRegionWithPortClipRegion, 1, |
|---|
| 1248 | n/a | PyDoc_STR("(RgnHandle ioRegion) -> None")}, |
|---|
| 1249 | n/a | {"SectRegionWithPortVisibleRegion", (PyCFunction)GrafObj_SectRegionWithPortVisibleRegion, 1, |
|---|
| 1250 | n/a | PyDoc_STR("(RgnHandle ioRegion) -> None")}, |
|---|
| 1251 | n/a | {"SwapPortPicSaveHandle", (PyCFunction)GrafObj_SwapPortPicSaveHandle, 1, |
|---|
| 1252 | n/a | PyDoc_STR("(Handle inPicSaveHdl) -> (Handle _rv)")}, |
|---|
| 1253 | n/a | {"SwapPortPolySaveHandle", (PyCFunction)GrafObj_SwapPortPolySaveHandle, 1, |
|---|
| 1254 | n/a | PyDoc_STR("(Handle inPolySaveHdl) -> (Handle _rv)")}, |
|---|
| 1255 | n/a | {"SwapPortRegionSaveHandle", (PyCFunction)GrafObj_SwapPortRegionSaveHandle, 1, |
|---|
| 1256 | n/a | PyDoc_STR("(Handle inRegionSaveHdl) -> (Handle _rv)")}, |
|---|
| 1257 | n/a | {"SetPortBounds", (PyCFunction)GrafObj_SetPortBounds, 1, |
|---|
| 1258 | n/a | PyDoc_STR("(Rect rect) -> None")}, |
|---|
| 1259 | n/a | {"SetPortOpColor", (PyCFunction)GrafObj_SetPortOpColor, 1, |
|---|
| 1260 | n/a | PyDoc_STR("(RGBColor opColor) -> None")}, |
|---|
| 1261 | n/a | {"SetPortTextFont", (PyCFunction)GrafObj_SetPortTextFont, 1, |
|---|
| 1262 | n/a | PyDoc_STR("(short txFont) -> None")}, |
|---|
| 1263 | n/a | {"SetPortTextSize", (PyCFunction)GrafObj_SetPortTextSize, 1, |
|---|
| 1264 | n/a | PyDoc_STR("(short txSize) -> None")}, |
|---|
| 1265 | n/a | {"SetPortTextFace", (PyCFunction)GrafObj_SetPortTextFace, 1, |
|---|
| 1266 | n/a | PyDoc_STR("(StyleParameter face) -> None")}, |
|---|
| 1267 | n/a | {"SetPortTextMode", (PyCFunction)GrafObj_SetPortTextMode, 1, |
|---|
| 1268 | n/a | PyDoc_STR("(short mode) -> None")}, |
|---|
| 1269 | n/a | {"SetPortVisibleRegion", (PyCFunction)GrafObj_SetPortVisibleRegion, 1, |
|---|
| 1270 | n/a | PyDoc_STR("(RgnHandle visRgn) -> None")}, |
|---|
| 1271 | n/a | {"SetPortClipRegion", (PyCFunction)GrafObj_SetPortClipRegion, 1, |
|---|
| 1272 | n/a | PyDoc_STR("(RgnHandle clipRgn) -> None")}, |
|---|
| 1273 | n/a | {"SetPortPenPixPat", (PyCFunction)GrafObj_SetPortPenPixPat, 1, |
|---|
| 1274 | n/a | PyDoc_STR("(PixPatHandle penPattern) -> None")}, |
|---|
| 1275 | n/a | {"SetPortFillPixPat", (PyCFunction)GrafObj_SetPortFillPixPat, 1, |
|---|
| 1276 | n/a | PyDoc_STR("(PixPatHandle penPattern) -> None")}, |
|---|
| 1277 | n/a | {"SetPortBackPixPat", (PyCFunction)GrafObj_SetPortBackPixPat, 1, |
|---|
| 1278 | n/a | PyDoc_STR("(PixPatHandle backPattern) -> None")}, |
|---|
| 1279 | n/a | {"SetPortPenSize", (PyCFunction)GrafObj_SetPortPenSize, 1, |
|---|
| 1280 | n/a | PyDoc_STR("(Point penSize) -> None")}, |
|---|
| 1281 | n/a | {"SetPortPenMode", (PyCFunction)GrafObj_SetPortPenMode, 1, |
|---|
| 1282 | n/a | PyDoc_STR("(SInt32 penMode) -> None")}, |
|---|
| 1283 | n/a | {"SetPortFracHPenLocation", (PyCFunction)GrafObj_SetPortFracHPenLocation, 1, |
|---|
| 1284 | n/a | PyDoc_STR("(short pnLocHFrac) -> None")}, |
|---|
| 1285 | n/a | {"DisposePort", (PyCFunction)GrafObj_DisposePort, 1, |
|---|
| 1286 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 1287 | n/a | {"QDLocalToGlobalPoint", (PyCFunction)GrafObj_QDLocalToGlobalPoint, 1, |
|---|
| 1288 | n/a | PyDoc_STR("(Point point) -> (Point point)")}, |
|---|
| 1289 | n/a | {"QDGlobalToLocalPoint", (PyCFunction)GrafObj_QDGlobalToLocalPoint, 1, |
|---|
| 1290 | n/a | PyDoc_STR("(Point point) -> (Point point)")}, |
|---|
| 1291 | n/a | {"QDLocalToGlobalRect", (PyCFunction)GrafObj_QDLocalToGlobalRect, 1, |
|---|
| 1292 | n/a | PyDoc_STR("() -> (Rect bounds)")}, |
|---|
| 1293 | n/a | {"QDGlobalToLocalRect", (PyCFunction)GrafObj_QDGlobalToLocalRect, 1, |
|---|
| 1294 | n/a | PyDoc_STR("() -> (Rect bounds)")}, |
|---|
| 1295 | n/a | {"QDLocalToGlobalRegion", (PyCFunction)GrafObj_QDLocalToGlobalRegion, 1, |
|---|
| 1296 | n/a | PyDoc_STR("(RgnHandle region) -> (RgnHandle _rv)")}, |
|---|
| 1297 | n/a | {"QDGlobalToLocalRegion", (PyCFunction)GrafObj_QDGlobalToLocalRegion, 1, |
|---|
| 1298 | n/a | PyDoc_STR("(RgnHandle region) -> (RgnHandle _rv)")}, |
|---|
| 1299 | n/a | {"QDIsPortBuffered", (PyCFunction)GrafObj_QDIsPortBuffered, 1, |
|---|
| 1300 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1301 | n/a | {"QDIsPortBufferDirty", (PyCFunction)GrafObj_QDIsPortBufferDirty, 1, |
|---|
| 1302 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 1303 | n/a | {"QDFlushPortBuffer", (PyCFunction)GrafObj_QDFlushPortBuffer, 1, |
|---|
| 1304 | n/a | PyDoc_STR("(RgnHandle region) -> None")}, |
|---|
| 1305 | n/a | {"QDGetDirtyRegion", (PyCFunction)GrafObj_QDGetDirtyRegion, 1, |
|---|
| 1306 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 1307 | n/a | {"QDSetDirtyRegion", (PyCFunction)GrafObj_QDSetDirtyRegion, 1, |
|---|
| 1308 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 1309 | n/a | {NULL, NULL, 0} |
|---|
| 1310 | n/a | }; |
|---|
| 1311 | n/a | |
|---|
| 1312 | n/a | static PyObject *GrafObj_get_visRgn(GrafPortObject *self, void *closure) |
|---|
| 1313 | n/a | { |
|---|
| 1314 | n/a | RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */ |
|---|
| 1315 | n/a | return Py_BuildValue("O&", ResObj_New, (Handle)GetPortVisibleRegion(self->ob_itself, h)); |
|---|
| 1316 | n/a | |
|---|
| 1317 | n/a | } |
|---|
| 1318 | n/a | |
|---|
| 1319 | n/a | #define GrafObj_set_visRgn NULL |
|---|
| 1320 | n/a | |
|---|
| 1321 | n/a | static PyObject *GrafObj_get_clipRgn(GrafPortObject *self, void *closure) |
|---|
| 1322 | n/a | { |
|---|
| 1323 | n/a | RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */ |
|---|
| 1324 | n/a | return Py_BuildValue("O&", ResObj_New, (Handle)GetPortClipRegion(self->ob_itself, h)); |
|---|
| 1325 | n/a | |
|---|
| 1326 | n/a | } |
|---|
| 1327 | n/a | |
|---|
| 1328 | n/a | #define GrafObj_set_clipRgn NULL |
|---|
| 1329 | n/a | |
|---|
| 1330 | n/a | static PyGetSetDef GrafObj_getsetlist[] = { |
|---|
| 1331 | n/a | {"visRgn", (getter)GrafObj_get_visRgn, (setter)GrafObj_set_visRgn, "Convenience attribute: return a copy of the visible region"}, |
|---|
| 1332 | n/a | {"clipRgn", (getter)GrafObj_get_clipRgn, (setter)GrafObj_set_clipRgn, "Convenience attribute: return a copy of the clipping region"}, |
|---|
| 1333 | n/a | {NULL, NULL, NULL, NULL}, |
|---|
| 1334 | n/a | }; |
|---|
| 1335 | n/a | |
|---|
| 1336 | n/a | |
|---|
| 1337 | n/a | #define GrafObj_compare NULL |
|---|
| 1338 | n/a | |
|---|
| 1339 | n/a | #define GrafObj_repr NULL |
|---|
| 1340 | n/a | |
|---|
| 1341 | n/a | #define GrafObj_hash NULL |
|---|
| 1342 | n/a | #define GrafObj_tp_init 0 |
|---|
| 1343 | n/a | |
|---|
| 1344 | n/a | #define GrafObj_tp_alloc PyType_GenericAlloc |
|---|
| 1345 | n/a | |
|---|
| 1346 | n/a | static PyObject *GrafObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds) |
|---|
| 1347 | n/a | { |
|---|
| 1348 | n/a | PyObject *_self; |
|---|
| 1349 | n/a | GrafPtr itself; |
|---|
| 1350 | n/a | char *kw[] = {"itself", 0}; |
|---|
| 1351 | n/a | |
|---|
| 1352 | n/a | if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, GrafObj_Convert, &itself)) return NULL; |
|---|
| 1353 | n/a | if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL; |
|---|
| 1354 | n/a | ((GrafPortObject *)_self)->ob_itself = itself; |
|---|
| 1355 | n/a | return _self; |
|---|
| 1356 | n/a | } |
|---|
| 1357 | n/a | |
|---|
| 1358 | n/a | #define GrafObj_tp_free PyObject_Del |
|---|
| 1359 | n/a | |
|---|
| 1360 | n/a | |
|---|
| 1361 | n/a | PyTypeObject GrafPort_Type = { |
|---|
| 1362 | n/a | PyObject_HEAD_INIT(NULL) |
|---|
| 1363 | n/a | 0, /*ob_size*/ |
|---|
| 1364 | n/a | "_Qd.GrafPort", /*tp_name*/ |
|---|
| 1365 | n/a | sizeof(GrafPortObject), /*tp_basicsize*/ |
|---|
| 1366 | n/a | 0, /*tp_itemsize*/ |
|---|
| 1367 | n/a | /* methods */ |
|---|
| 1368 | n/a | (destructor) GrafObj_dealloc, /*tp_dealloc*/ |
|---|
| 1369 | n/a | 0, /*tp_print*/ |
|---|
| 1370 | n/a | (getattrfunc)0, /*tp_getattr*/ |
|---|
| 1371 | n/a | (setattrfunc)0, /*tp_setattr*/ |
|---|
| 1372 | n/a | (cmpfunc) GrafObj_compare, /*tp_compare*/ |
|---|
| 1373 | n/a | (reprfunc) GrafObj_repr, /*tp_repr*/ |
|---|
| 1374 | n/a | (PyNumberMethods *)0, /* tp_as_number */ |
|---|
| 1375 | n/a | (PySequenceMethods *)0, /* tp_as_sequence */ |
|---|
| 1376 | n/a | (PyMappingMethods *)0, /* tp_as_mapping */ |
|---|
| 1377 | n/a | (hashfunc) GrafObj_hash, /*tp_hash*/ |
|---|
| 1378 | n/a | 0, /*tp_call*/ |
|---|
| 1379 | n/a | 0, /*tp_str*/ |
|---|
| 1380 | n/a | PyObject_GenericGetAttr, /*tp_getattro*/ |
|---|
| 1381 | n/a | PyObject_GenericSetAttr, /*tp_setattro */ |
|---|
| 1382 | n/a | 0, /*tp_as_buffer*/ |
|---|
| 1383 | n/a | Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|---|
| 1384 | n/a | 0, /*tp_doc*/ |
|---|
| 1385 | n/a | 0, /*tp_traverse*/ |
|---|
| 1386 | n/a | 0, /*tp_clear*/ |
|---|
| 1387 | n/a | 0, /*tp_richcompare*/ |
|---|
| 1388 | n/a | 0, /*tp_weaklistoffset*/ |
|---|
| 1389 | n/a | 0, /*tp_iter*/ |
|---|
| 1390 | n/a | 0, /*tp_iternext*/ |
|---|
| 1391 | n/a | GrafObj_methods, /* tp_methods */ |
|---|
| 1392 | n/a | 0, /*tp_members*/ |
|---|
| 1393 | n/a | GrafObj_getsetlist, /*tp_getset*/ |
|---|
| 1394 | n/a | 0, /*tp_base*/ |
|---|
| 1395 | n/a | 0, /*tp_dict*/ |
|---|
| 1396 | n/a | 0, /*tp_descr_get*/ |
|---|
| 1397 | n/a | 0, /*tp_descr_set*/ |
|---|
| 1398 | n/a | 0, /*tp_dictoffset*/ |
|---|
| 1399 | n/a | GrafObj_tp_init, /* tp_init */ |
|---|
| 1400 | n/a | GrafObj_tp_alloc, /* tp_alloc */ |
|---|
| 1401 | n/a | GrafObj_tp_new, /* tp_new */ |
|---|
| 1402 | n/a | GrafObj_tp_free, /* tp_free */ |
|---|
| 1403 | n/a | }; |
|---|
| 1404 | n/a | |
|---|
| 1405 | n/a | /* -------------------- End object type GrafPort -------------------- */ |
|---|
| 1406 | n/a | |
|---|
| 1407 | n/a | |
|---|
| 1408 | n/a | /* ----------------------- Object type BitMap ----------------------- */ |
|---|
| 1409 | n/a | |
|---|
| 1410 | n/a | PyTypeObject BitMap_Type; |
|---|
| 1411 | n/a | |
|---|
| 1412 | n/a | #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type)) |
|---|
| 1413 | n/a | |
|---|
| 1414 | n/a | typedef struct BitMapObject { |
|---|
| 1415 | n/a | PyObject_HEAD |
|---|
| 1416 | n/a | BitMapPtr ob_itself; |
|---|
| 1417 | n/a | PyObject *referred_object; |
|---|
| 1418 | n/a | BitMap *referred_bitmap; |
|---|
| 1419 | n/a | } BitMapObject; |
|---|
| 1420 | n/a | |
|---|
| 1421 | n/a | PyObject *BMObj_New(BitMapPtr itself) |
|---|
| 1422 | n/a | { |
|---|
| 1423 | n/a | BitMapObject *it; |
|---|
| 1424 | n/a | if (itself == NULL) return PyMac_Error(resNotFound); |
|---|
| 1425 | n/a | it = PyObject_NEW(BitMapObject, &BitMap_Type); |
|---|
| 1426 | n/a | if (it == NULL) return NULL; |
|---|
| 1427 | n/a | it->ob_itself = itself; |
|---|
| 1428 | n/a | it->referred_object = NULL; |
|---|
| 1429 | n/a | it->referred_bitmap = NULL; |
|---|
| 1430 | n/a | return (PyObject *)it; |
|---|
| 1431 | n/a | } |
|---|
| 1432 | n/a | |
|---|
| 1433 | n/a | int BMObj_Convert(PyObject *v, BitMapPtr *p_itself) |
|---|
| 1434 | n/a | { |
|---|
| 1435 | n/a | if (!BMObj_Check(v)) |
|---|
| 1436 | n/a | { |
|---|
| 1437 | n/a | PyErr_SetString(PyExc_TypeError, "BitMap required"); |
|---|
| 1438 | n/a | return 0; |
|---|
| 1439 | n/a | } |
|---|
| 1440 | n/a | *p_itself = ((BitMapObject *)v)->ob_itself; |
|---|
| 1441 | n/a | return 1; |
|---|
| 1442 | n/a | } |
|---|
| 1443 | n/a | |
|---|
| 1444 | n/a | static void BMObj_dealloc(BitMapObject *self) |
|---|
| 1445 | n/a | { |
|---|
| 1446 | n/a | Py_XDECREF(self->referred_object); |
|---|
| 1447 | n/a | if (self->referred_bitmap) free(self->referred_bitmap); |
|---|
| 1448 | n/a | self->ob_type->tp_free((PyObject *)self); |
|---|
| 1449 | n/a | } |
|---|
| 1450 | n/a | |
|---|
| 1451 | n/a | static PyObject *BMObj_getdata(BitMapObject *_self, PyObject *_args) |
|---|
| 1452 | n/a | { |
|---|
| 1453 | n/a | PyObject *_res = NULL; |
|---|
| 1454 | n/a | |
|---|
| 1455 | n/a | int from, length; |
|---|
| 1456 | n/a | char *cp; |
|---|
| 1457 | n/a | |
|---|
| 1458 | n/a | if ( !PyArg_ParseTuple(_args, "ii", &from, &length) ) |
|---|
| 1459 | n/a | return NULL; |
|---|
| 1460 | n/a | cp = _self->ob_itself->baseAddr+from; |
|---|
| 1461 | n/a | _res = PyString_FromStringAndSize(cp, length); |
|---|
| 1462 | n/a | return _res; |
|---|
| 1463 | n/a | |
|---|
| 1464 | n/a | } |
|---|
| 1465 | n/a | |
|---|
| 1466 | n/a | static PyObject *BMObj_putdata(BitMapObject *_self, PyObject *_args) |
|---|
| 1467 | n/a | { |
|---|
| 1468 | n/a | PyObject *_res = NULL; |
|---|
| 1469 | n/a | |
|---|
| 1470 | n/a | int from, length; |
|---|
| 1471 | n/a | char *cp, *icp; |
|---|
| 1472 | n/a | |
|---|
| 1473 | n/a | if ( !PyArg_ParseTuple(_args, "is#", &from, &icp, &length) ) |
|---|
| 1474 | n/a | return NULL; |
|---|
| 1475 | n/a | cp = _self->ob_itself->baseAddr+from; |
|---|
| 1476 | n/a | memcpy(cp, icp, length); |
|---|
| 1477 | n/a | Py_INCREF(Py_None); |
|---|
| 1478 | n/a | _res = Py_None; |
|---|
| 1479 | n/a | return _res; |
|---|
| 1480 | n/a | |
|---|
| 1481 | n/a | } |
|---|
| 1482 | n/a | |
|---|
| 1483 | n/a | static PyMethodDef BMObj_methods[] = { |
|---|
| 1484 | n/a | {"getdata", (PyCFunction)BMObj_getdata, 1, |
|---|
| 1485 | n/a | PyDoc_STR("(int start, int size) -> string. Return bytes from the bitmap")}, |
|---|
| 1486 | n/a | {"putdata", (PyCFunction)BMObj_putdata, 1, |
|---|
| 1487 | n/a | PyDoc_STR("(int start, string data). Store bytes into the bitmap")}, |
|---|
| 1488 | n/a | {NULL, NULL, 0} |
|---|
| 1489 | n/a | }; |
|---|
| 1490 | n/a | |
|---|
| 1491 | n/a | static PyObject *BMObj_get_baseAddr(BitMapObject *self, void *closure) |
|---|
| 1492 | n/a | { |
|---|
| 1493 | n/a | return PyInt_FromLong((long)self->ob_itself->baseAddr); |
|---|
| 1494 | n/a | } |
|---|
| 1495 | n/a | |
|---|
| 1496 | n/a | #define BMObj_set_baseAddr NULL |
|---|
| 1497 | n/a | |
|---|
| 1498 | n/a | static PyObject *BMObj_get_rowBytes(BitMapObject *self, void *closure) |
|---|
| 1499 | n/a | { |
|---|
| 1500 | n/a | return PyInt_FromLong((long)self->ob_itself->rowBytes); |
|---|
| 1501 | n/a | } |
|---|
| 1502 | n/a | |
|---|
| 1503 | n/a | #define BMObj_set_rowBytes NULL |
|---|
| 1504 | n/a | |
|---|
| 1505 | n/a | static PyObject *BMObj_get_bounds(BitMapObject *self, void *closure) |
|---|
| 1506 | n/a | { |
|---|
| 1507 | n/a | return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->bounds); |
|---|
| 1508 | n/a | } |
|---|
| 1509 | n/a | |
|---|
| 1510 | n/a | #define BMObj_set_bounds NULL |
|---|
| 1511 | n/a | |
|---|
| 1512 | n/a | static PyObject *BMObj_get_bitmap_data(BitMapObject *self, void *closure) |
|---|
| 1513 | n/a | { |
|---|
| 1514 | n/a | return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(BitMap)); |
|---|
| 1515 | n/a | } |
|---|
| 1516 | n/a | |
|---|
| 1517 | n/a | #define BMObj_set_bitmap_data NULL |
|---|
| 1518 | n/a | |
|---|
| 1519 | n/a | static PyObject *BMObj_get_pixmap_data(BitMapObject *self, void *closure) |
|---|
| 1520 | n/a | { |
|---|
| 1521 | n/a | return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(PixMap)); |
|---|
| 1522 | n/a | } |
|---|
| 1523 | n/a | |
|---|
| 1524 | n/a | #define BMObj_set_pixmap_data NULL |
|---|
| 1525 | n/a | |
|---|
| 1526 | n/a | static PyGetSetDef BMObj_getsetlist[] = { |
|---|
| 1527 | n/a | {"baseAddr", (getter)BMObj_get_baseAddr, (setter)BMObj_set_baseAddr, NULL}, |
|---|
| 1528 | n/a | {"rowBytes", (getter)BMObj_get_rowBytes, (setter)BMObj_set_rowBytes, NULL}, |
|---|
| 1529 | n/a | {"bounds", (getter)BMObj_get_bounds, (setter)BMObj_set_bounds, NULL}, |
|---|
| 1530 | n/a | {"bitmap_data", (getter)BMObj_get_bitmap_data, (setter)BMObj_set_bitmap_data, NULL}, |
|---|
| 1531 | n/a | {"pixmap_data", (getter)BMObj_get_pixmap_data, (setter)BMObj_set_pixmap_data, NULL}, |
|---|
| 1532 | n/a | {NULL, NULL, NULL, NULL}, |
|---|
| 1533 | n/a | }; |
|---|
| 1534 | n/a | |
|---|
| 1535 | n/a | |
|---|
| 1536 | n/a | #define BMObj_compare NULL |
|---|
| 1537 | n/a | |
|---|
| 1538 | n/a | #define BMObj_repr NULL |
|---|
| 1539 | n/a | |
|---|
| 1540 | n/a | #define BMObj_hash NULL |
|---|
| 1541 | n/a | #define BMObj_tp_init 0 |
|---|
| 1542 | n/a | |
|---|
| 1543 | n/a | #define BMObj_tp_alloc PyType_GenericAlloc |
|---|
| 1544 | n/a | |
|---|
| 1545 | n/a | static PyObject *BMObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds) |
|---|
| 1546 | n/a | { |
|---|
| 1547 | n/a | PyObject *_self; |
|---|
| 1548 | n/a | BitMapPtr itself; |
|---|
| 1549 | n/a | char *kw[] = {"itself", 0}; |
|---|
| 1550 | n/a | |
|---|
| 1551 | n/a | if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, BMObj_Convert, &itself)) return NULL; |
|---|
| 1552 | n/a | if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL; |
|---|
| 1553 | n/a | ((BitMapObject *)_self)->ob_itself = itself; |
|---|
| 1554 | n/a | return _self; |
|---|
| 1555 | n/a | } |
|---|
| 1556 | n/a | |
|---|
| 1557 | n/a | #define BMObj_tp_free PyObject_Del |
|---|
| 1558 | n/a | |
|---|
| 1559 | n/a | |
|---|
| 1560 | n/a | PyTypeObject BitMap_Type = { |
|---|
| 1561 | n/a | PyObject_HEAD_INIT(NULL) |
|---|
| 1562 | n/a | 0, /*ob_size*/ |
|---|
| 1563 | n/a | "_Qd.BitMap", /*tp_name*/ |
|---|
| 1564 | n/a | sizeof(BitMapObject), /*tp_basicsize*/ |
|---|
| 1565 | n/a | 0, /*tp_itemsize*/ |
|---|
| 1566 | n/a | /* methods */ |
|---|
| 1567 | n/a | (destructor) BMObj_dealloc, /*tp_dealloc*/ |
|---|
| 1568 | n/a | 0, /*tp_print*/ |
|---|
| 1569 | n/a | (getattrfunc)0, /*tp_getattr*/ |
|---|
| 1570 | n/a | (setattrfunc)0, /*tp_setattr*/ |
|---|
| 1571 | n/a | (cmpfunc) BMObj_compare, /*tp_compare*/ |
|---|
| 1572 | n/a | (reprfunc) BMObj_repr, /*tp_repr*/ |
|---|
| 1573 | n/a | (PyNumberMethods *)0, /* tp_as_number */ |
|---|
| 1574 | n/a | (PySequenceMethods *)0, /* tp_as_sequence */ |
|---|
| 1575 | n/a | (PyMappingMethods *)0, /* tp_as_mapping */ |
|---|
| 1576 | n/a | (hashfunc) BMObj_hash, /*tp_hash*/ |
|---|
| 1577 | n/a | 0, /*tp_call*/ |
|---|
| 1578 | n/a | 0, /*tp_str*/ |
|---|
| 1579 | n/a | PyObject_GenericGetAttr, /*tp_getattro*/ |
|---|
| 1580 | n/a | PyObject_GenericSetAttr, /*tp_setattro */ |
|---|
| 1581 | n/a | 0, /*tp_as_buffer*/ |
|---|
| 1582 | n/a | Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ |
|---|
| 1583 | n/a | 0, /*tp_doc*/ |
|---|
| 1584 | n/a | 0, /*tp_traverse*/ |
|---|
| 1585 | n/a | 0, /*tp_clear*/ |
|---|
| 1586 | n/a | 0, /*tp_richcompare*/ |
|---|
| 1587 | n/a | 0, /*tp_weaklistoffset*/ |
|---|
| 1588 | n/a | 0, /*tp_iter*/ |
|---|
| 1589 | n/a | 0, /*tp_iternext*/ |
|---|
| 1590 | n/a | BMObj_methods, /* tp_methods */ |
|---|
| 1591 | n/a | 0, /*tp_members*/ |
|---|
| 1592 | n/a | BMObj_getsetlist, /*tp_getset*/ |
|---|
| 1593 | n/a | 0, /*tp_base*/ |
|---|
| 1594 | n/a | 0, /*tp_dict*/ |
|---|
| 1595 | n/a | 0, /*tp_descr_get*/ |
|---|
| 1596 | n/a | 0, /*tp_descr_set*/ |
|---|
| 1597 | n/a | 0, /*tp_dictoffset*/ |
|---|
| 1598 | n/a | BMObj_tp_init, /* tp_init */ |
|---|
| 1599 | n/a | BMObj_tp_alloc, /* tp_alloc */ |
|---|
| 1600 | n/a | BMObj_tp_new, /* tp_new */ |
|---|
| 1601 | n/a | BMObj_tp_free, /* tp_free */ |
|---|
| 1602 | n/a | }; |
|---|
| 1603 | n/a | |
|---|
| 1604 | n/a | /* --------------------- End object type BitMap --------------------- */ |
|---|
| 1605 | n/a | |
|---|
| 1606 | n/a | |
|---|
| 1607 | n/a | static PyObject *Qd_GetPort(PyObject *_self, PyObject *_args) |
|---|
| 1608 | n/a | { |
|---|
| 1609 | n/a | PyObject *_res = NULL; |
|---|
| 1610 | n/a | GrafPtr port; |
|---|
| 1611 | n/a | #ifndef GetPort |
|---|
| 1612 | n/a | PyMac_PRECHECK(GetPort); |
|---|
| 1613 | n/a | #endif |
|---|
| 1614 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1615 | n/a | return NULL; |
|---|
| 1616 | n/a | GetPort(&port); |
|---|
| 1617 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1618 | n/a | GrafObj_New, port); |
|---|
| 1619 | n/a | return _res; |
|---|
| 1620 | n/a | } |
|---|
| 1621 | n/a | |
|---|
| 1622 | n/a | static PyObject *Qd_GrafDevice(PyObject *_self, PyObject *_args) |
|---|
| 1623 | n/a | { |
|---|
| 1624 | n/a | PyObject *_res = NULL; |
|---|
| 1625 | n/a | short device; |
|---|
| 1626 | n/a | #ifndef GrafDevice |
|---|
| 1627 | n/a | PyMac_PRECHECK(GrafDevice); |
|---|
| 1628 | n/a | #endif |
|---|
| 1629 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 1630 | n/a | &device)) |
|---|
| 1631 | n/a | return NULL; |
|---|
| 1632 | n/a | GrafDevice(device); |
|---|
| 1633 | n/a | Py_INCREF(Py_None); |
|---|
| 1634 | n/a | _res = Py_None; |
|---|
| 1635 | n/a | return _res; |
|---|
| 1636 | n/a | } |
|---|
| 1637 | n/a | |
|---|
| 1638 | n/a | static PyObject *Qd_SetPortBits(PyObject *_self, PyObject *_args) |
|---|
| 1639 | n/a | { |
|---|
| 1640 | n/a | PyObject *_res = NULL; |
|---|
| 1641 | n/a | BitMapPtr bm; |
|---|
| 1642 | n/a | #ifndef SetPortBits |
|---|
| 1643 | n/a | PyMac_PRECHECK(SetPortBits); |
|---|
| 1644 | n/a | #endif |
|---|
| 1645 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1646 | n/a | BMObj_Convert, &bm)) |
|---|
| 1647 | n/a | return NULL; |
|---|
| 1648 | n/a | SetPortBits(bm); |
|---|
| 1649 | n/a | Py_INCREF(Py_None); |
|---|
| 1650 | n/a | _res = Py_None; |
|---|
| 1651 | n/a | return _res; |
|---|
| 1652 | n/a | } |
|---|
| 1653 | n/a | |
|---|
| 1654 | n/a | static PyObject *Qd_PortSize(PyObject *_self, PyObject *_args) |
|---|
| 1655 | n/a | { |
|---|
| 1656 | n/a | PyObject *_res = NULL; |
|---|
| 1657 | n/a | short width; |
|---|
| 1658 | n/a | short height; |
|---|
| 1659 | n/a | #ifndef PortSize |
|---|
| 1660 | n/a | PyMac_PRECHECK(PortSize); |
|---|
| 1661 | n/a | #endif |
|---|
| 1662 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 1663 | n/a | &width, |
|---|
| 1664 | n/a | &height)) |
|---|
| 1665 | n/a | return NULL; |
|---|
| 1666 | n/a | PortSize(width, |
|---|
| 1667 | n/a | height); |
|---|
| 1668 | n/a | Py_INCREF(Py_None); |
|---|
| 1669 | n/a | _res = Py_None; |
|---|
| 1670 | n/a | return _res; |
|---|
| 1671 | n/a | } |
|---|
| 1672 | n/a | |
|---|
| 1673 | n/a | static PyObject *Qd_MovePortTo(PyObject *_self, PyObject *_args) |
|---|
| 1674 | n/a | { |
|---|
| 1675 | n/a | PyObject *_res = NULL; |
|---|
| 1676 | n/a | short leftGlobal; |
|---|
| 1677 | n/a | short topGlobal; |
|---|
| 1678 | n/a | #ifndef MovePortTo |
|---|
| 1679 | n/a | PyMac_PRECHECK(MovePortTo); |
|---|
| 1680 | n/a | #endif |
|---|
| 1681 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 1682 | n/a | &leftGlobal, |
|---|
| 1683 | n/a | &topGlobal)) |
|---|
| 1684 | n/a | return NULL; |
|---|
| 1685 | n/a | MovePortTo(leftGlobal, |
|---|
| 1686 | n/a | topGlobal); |
|---|
| 1687 | n/a | Py_INCREF(Py_None); |
|---|
| 1688 | n/a | _res = Py_None; |
|---|
| 1689 | n/a | return _res; |
|---|
| 1690 | n/a | } |
|---|
| 1691 | n/a | |
|---|
| 1692 | n/a | static PyObject *Qd_SetOrigin(PyObject *_self, PyObject *_args) |
|---|
| 1693 | n/a | { |
|---|
| 1694 | n/a | PyObject *_res = NULL; |
|---|
| 1695 | n/a | short h; |
|---|
| 1696 | n/a | short v; |
|---|
| 1697 | n/a | #ifndef SetOrigin |
|---|
| 1698 | n/a | PyMac_PRECHECK(SetOrigin); |
|---|
| 1699 | n/a | #endif |
|---|
| 1700 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 1701 | n/a | &h, |
|---|
| 1702 | n/a | &v)) |
|---|
| 1703 | n/a | return NULL; |
|---|
| 1704 | n/a | SetOrigin(h, |
|---|
| 1705 | n/a | v); |
|---|
| 1706 | n/a | Py_INCREF(Py_None); |
|---|
| 1707 | n/a | _res = Py_None; |
|---|
| 1708 | n/a | return _res; |
|---|
| 1709 | n/a | } |
|---|
| 1710 | n/a | |
|---|
| 1711 | n/a | static PyObject *Qd_SetClip(PyObject *_self, PyObject *_args) |
|---|
| 1712 | n/a | { |
|---|
| 1713 | n/a | PyObject *_res = NULL; |
|---|
| 1714 | n/a | RgnHandle rgn; |
|---|
| 1715 | n/a | #ifndef SetClip |
|---|
| 1716 | n/a | PyMac_PRECHECK(SetClip); |
|---|
| 1717 | n/a | #endif |
|---|
| 1718 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1719 | n/a | ResObj_Convert, &rgn)) |
|---|
| 1720 | n/a | return NULL; |
|---|
| 1721 | n/a | SetClip(rgn); |
|---|
| 1722 | n/a | Py_INCREF(Py_None); |
|---|
| 1723 | n/a | _res = Py_None; |
|---|
| 1724 | n/a | return _res; |
|---|
| 1725 | n/a | } |
|---|
| 1726 | n/a | |
|---|
| 1727 | n/a | static PyObject *Qd_GetClip(PyObject *_self, PyObject *_args) |
|---|
| 1728 | n/a | { |
|---|
| 1729 | n/a | PyObject *_res = NULL; |
|---|
| 1730 | n/a | RgnHandle rgn; |
|---|
| 1731 | n/a | #ifndef GetClip |
|---|
| 1732 | n/a | PyMac_PRECHECK(GetClip); |
|---|
| 1733 | n/a | #endif |
|---|
| 1734 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1735 | n/a | ResObj_Convert, &rgn)) |
|---|
| 1736 | n/a | return NULL; |
|---|
| 1737 | n/a | GetClip(rgn); |
|---|
| 1738 | n/a | Py_INCREF(Py_None); |
|---|
| 1739 | n/a | _res = Py_None; |
|---|
| 1740 | n/a | return _res; |
|---|
| 1741 | n/a | } |
|---|
| 1742 | n/a | |
|---|
| 1743 | n/a | static PyObject *Qd_ClipRect(PyObject *_self, PyObject *_args) |
|---|
| 1744 | n/a | { |
|---|
| 1745 | n/a | PyObject *_res = NULL; |
|---|
| 1746 | n/a | Rect r; |
|---|
| 1747 | n/a | #ifndef ClipRect |
|---|
| 1748 | n/a | PyMac_PRECHECK(ClipRect); |
|---|
| 1749 | n/a | #endif |
|---|
| 1750 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 1751 | n/a | PyMac_GetRect, &r)) |
|---|
| 1752 | n/a | return NULL; |
|---|
| 1753 | n/a | ClipRect(&r); |
|---|
| 1754 | n/a | Py_INCREF(Py_None); |
|---|
| 1755 | n/a | _res = Py_None; |
|---|
| 1756 | n/a | return _res; |
|---|
| 1757 | n/a | } |
|---|
| 1758 | n/a | |
|---|
| 1759 | n/a | static PyObject *Qd_BackPat(PyObject *_self, PyObject *_args) |
|---|
| 1760 | n/a | { |
|---|
| 1761 | n/a | PyObject *_res = NULL; |
|---|
| 1762 | n/a | Pattern *pat__in__; |
|---|
| 1763 | n/a | int pat__in_len__; |
|---|
| 1764 | n/a | #ifndef BackPat |
|---|
| 1765 | n/a | PyMac_PRECHECK(BackPat); |
|---|
| 1766 | n/a | #endif |
|---|
| 1767 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 1768 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 1769 | n/a | return NULL; |
|---|
| 1770 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 1771 | n/a | { |
|---|
| 1772 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 1773 | n/a | goto pat__error__; |
|---|
| 1774 | n/a | } |
|---|
| 1775 | n/a | BackPat(pat__in__); |
|---|
| 1776 | n/a | Py_INCREF(Py_None); |
|---|
| 1777 | n/a | _res = Py_None; |
|---|
| 1778 | n/a | pat__error__: ; |
|---|
| 1779 | n/a | return _res; |
|---|
| 1780 | n/a | } |
|---|
| 1781 | n/a | |
|---|
| 1782 | n/a | static PyObject *Qd_InitCursor(PyObject *_self, PyObject *_args) |
|---|
| 1783 | n/a | { |
|---|
| 1784 | n/a | PyObject *_res = NULL; |
|---|
| 1785 | n/a | #ifndef InitCursor |
|---|
| 1786 | n/a | PyMac_PRECHECK(InitCursor); |
|---|
| 1787 | n/a | #endif |
|---|
| 1788 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1789 | n/a | return NULL; |
|---|
| 1790 | n/a | InitCursor(); |
|---|
| 1791 | n/a | Py_INCREF(Py_None); |
|---|
| 1792 | n/a | _res = Py_None; |
|---|
| 1793 | n/a | return _res; |
|---|
| 1794 | n/a | } |
|---|
| 1795 | n/a | |
|---|
| 1796 | n/a | static PyObject *Qd_MacSetCursor(PyObject *_self, PyObject *_args) |
|---|
| 1797 | n/a | { |
|---|
| 1798 | n/a | PyObject *_res = NULL; |
|---|
| 1799 | n/a | Cursor *crsr__in__; |
|---|
| 1800 | n/a | int crsr__in_len__; |
|---|
| 1801 | n/a | #ifndef MacSetCursor |
|---|
| 1802 | n/a | PyMac_PRECHECK(MacSetCursor); |
|---|
| 1803 | n/a | #endif |
|---|
| 1804 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 1805 | n/a | (char **)&crsr__in__, &crsr__in_len__)) |
|---|
| 1806 | n/a | return NULL; |
|---|
| 1807 | n/a | if (crsr__in_len__ != sizeof(Cursor)) |
|---|
| 1808 | n/a | { |
|---|
| 1809 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Cursor)"); |
|---|
| 1810 | n/a | goto crsr__error__; |
|---|
| 1811 | n/a | } |
|---|
| 1812 | n/a | MacSetCursor(crsr__in__); |
|---|
| 1813 | n/a | Py_INCREF(Py_None); |
|---|
| 1814 | n/a | _res = Py_None; |
|---|
| 1815 | n/a | crsr__error__: ; |
|---|
| 1816 | n/a | return _res; |
|---|
| 1817 | n/a | } |
|---|
| 1818 | n/a | |
|---|
| 1819 | n/a | static PyObject *Qd_HideCursor(PyObject *_self, PyObject *_args) |
|---|
| 1820 | n/a | { |
|---|
| 1821 | n/a | PyObject *_res = NULL; |
|---|
| 1822 | n/a | #ifndef HideCursor |
|---|
| 1823 | n/a | PyMac_PRECHECK(HideCursor); |
|---|
| 1824 | n/a | #endif |
|---|
| 1825 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1826 | n/a | return NULL; |
|---|
| 1827 | n/a | HideCursor(); |
|---|
| 1828 | n/a | Py_INCREF(Py_None); |
|---|
| 1829 | n/a | _res = Py_None; |
|---|
| 1830 | n/a | return _res; |
|---|
| 1831 | n/a | } |
|---|
| 1832 | n/a | |
|---|
| 1833 | n/a | static PyObject *Qd_MacShowCursor(PyObject *_self, PyObject *_args) |
|---|
| 1834 | n/a | { |
|---|
| 1835 | n/a | PyObject *_res = NULL; |
|---|
| 1836 | n/a | #ifndef MacShowCursor |
|---|
| 1837 | n/a | PyMac_PRECHECK(MacShowCursor); |
|---|
| 1838 | n/a | #endif |
|---|
| 1839 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1840 | n/a | return NULL; |
|---|
| 1841 | n/a | MacShowCursor(); |
|---|
| 1842 | n/a | Py_INCREF(Py_None); |
|---|
| 1843 | n/a | _res = Py_None; |
|---|
| 1844 | n/a | return _res; |
|---|
| 1845 | n/a | } |
|---|
| 1846 | n/a | |
|---|
| 1847 | n/a | static PyObject *Qd_ObscureCursor(PyObject *_self, PyObject *_args) |
|---|
| 1848 | n/a | { |
|---|
| 1849 | n/a | PyObject *_res = NULL; |
|---|
| 1850 | n/a | #ifndef ObscureCursor |
|---|
| 1851 | n/a | PyMac_PRECHECK(ObscureCursor); |
|---|
| 1852 | n/a | #endif |
|---|
| 1853 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1854 | n/a | return NULL; |
|---|
| 1855 | n/a | ObscureCursor(); |
|---|
| 1856 | n/a | Py_INCREF(Py_None); |
|---|
| 1857 | n/a | _res = Py_None; |
|---|
| 1858 | n/a | return _res; |
|---|
| 1859 | n/a | } |
|---|
| 1860 | n/a | |
|---|
| 1861 | n/a | static PyObject *Qd_HidePen(PyObject *_self, PyObject *_args) |
|---|
| 1862 | n/a | { |
|---|
| 1863 | n/a | PyObject *_res = NULL; |
|---|
| 1864 | n/a | #ifndef HidePen |
|---|
| 1865 | n/a | PyMac_PRECHECK(HidePen); |
|---|
| 1866 | n/a | #endif |
|---|
| 1867 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1868 | n/a | return NULL; |
|---|
| 1869 | n/a | HidePen(); |
|---|
| 1870 | n/a | Py_INCREF(Py_None); |
|---|
| 1871 | n/a | _res = Py_None; |
|---|
| 1872 | n/a | return _res; |
|---|
| 1873 | n/a | } |
|---|
| 1874 | n/a | |
|---|
| 1875 | n/a | static PyObject *Qd_ShowPen(PyObject *_self, PyObject *_args) |
|---|
| 1876 | n/a | { |
|---|
| 1877 | n/a | PyObject *_res = NULL; |
|---|
| 1878 | n/a | #ifndef ShowPen |
|---|
| 1879 | n/a | PyMac_PRECHECK(ShowPen); |
|---|
| 1880 | n/a | #endif |
|---|
| 1881 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1882 | n/a | return NULL; |
|---|
| 1883 | n/a | ShowPen(); |
|---|
| 1884 | n/a | Py_INCREF(Py_None); |
|---|
| 1885 | n/a | _res = Py_None; |
|---|
| 1886 | n/a | return _res; |
|---|
| 1887 | n/a | } |
|---|
| 1888 | n/a | |
|---|
| 1889 | n/a | static PyObject *Qd_GetPen(PyObject *_self, PyObject *_args) |
|---|
| 1890 | n/a | { |
|---|
| 1891 | n/a | PyObject *_res = NULL; |
|---|
| 1892 | n/a | Point pt; |
|---|
| 1893 | n/a | #ifndef GetPen |
|---|
| 1894 | n/a | PyMac_PRECHECK(GetPen); |
|---|
| 1895 | n/a | #endif |
|---|
| 1896 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1897 | n/a | return NULL; |
|---|
| 1898 | n/a | GetPen(&pt); |
|---|
| 1899 | n/a | _res = Py_BuildValue("O&", |
|---|
| 1900 | n/a | PyMac_BuildPoint, pt); |
|---|
| 1901 | n/a | return _res; |
|---|
| 1902 | n/a | } |
|---|
| 1903 | n/a | |
|---|
| 1904 | n/a | static PyObject *Qd_GetPenState(PyObject *_self, PyObject *_args) |
|---|
| 1905 | n/a | { |
|---|
| 1906 | n/a | PyObject *_res = NULL; |
|---|
| 1907 | n/a | PenState pnState__out__; |
|---|
| 1908 | n/a | #ifndef GetPenState |
|---|
| 1909 | n/a | PyMac_PRECHECK(GetPenState); |
|---|
| 1910 | n/a | #endif |
|---|
| 1911 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 1912 | n/a | return NULL; |
|---|
| 1913 | n/a | GetPenState(&pnState__out__); |
|---|
| 1914 | n/a | _res = Py_BuildValue("s#", |
|---|
| 1915 | n/a | (char *)&pnState__out__, (int)sizeof(PenState)); |
|---|
| 1916 | n/a | return _res; |
|---|
| 1917 | n/a | } |
|---|
| 1918 | n/a | |
|---|
| 1919 | n/a | static PyObject *Qd_SetPenState(PyObject *_self, PyObject *_args) |
|---|
| 1920 | n/a | { |
|---|
| 1921 | n/a | PyObject *_res = NULL; |
|---|
| 1922 | n/a | PenState *pnState__in__; |
|---|
| 1923 | n/a | int pnState__in_len__; |
|---|
| 1924 | n/a | #ifndef SetPenState |
|---|
| 1925 | n/a | PyMac_PRECHECK(SetPenState); |
|---|
| 1926 | n/a | #endif |
|---|
| 1927 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 1928 | n/a | (char **)&pnState__in__, &pnState__in_len__)) |
|---|
| 1929 | n/a | return NULL; |
|---|
| 1930 | n/a | if (pnState__in_len__ != sizeof(PenState)) |
|---|
| 1931 | n/a | { |
|---|
| 1932 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(PenState)"); |
|---|
| 1933 | n/a | goto pnState__error__; |
|---|
| 1934 | n/a | } |
|---|
| 1935 | n/a | SetPenState(pnState__in__); |
|---|
| 1936 | n/a | Py_INCREF(Py_None); |
|---|
| 1937 | n/a | _res = Py_None; |
|---|
| 1938 | n/a | pnState__error__: ; |
|---|
| 1939 | n/a | return _res; |
|---|
| 1940 | n/a | } |
|---|
| 1941 | n/a | |
|---|
| 1942 | n/a | static PyObject *Qd_PenSize(PyObject *_self, PyObject *_args) |
|---|
| 1943 | n/a | { |
|---|
| 1944 | n/a | PyObject *_res = NULL; |
|---|
| 1945 | n/a | short width; |
|---|
| 1946 | n/a | short height; |
|---|
| 1947 | n/a | #ifndef PenSize |
|---|
| 1948 | n/a | PyMac_PRECHECK(PenSize); |
|---|
| 1949 | n/a | #endif |
|---|
| 1950 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 1951 | n/a | &width, |
|---|
| 1952 | n/a | &height)) |
|---|
| 1953 | n/a | return NULL; |
|---|
| 1954 | n/a | PenSize(width, |
|---|
| 1955 | n/a | height); |
|---|
| 1956 | n/a | Py_INCREF(Py_None); |
|---|
| 1957 | n/a | _res = Py_None; |
|---|
| 1958 | n/a | return _res; |
|---|
| 1959 | n/a | } |
|---|
| 1960 | n/a | |
|---|
| 1961 | n/a | static PyObject *Qd_PenMode(PyObject *_self, PyObject *_args) |
|---|
| 1962 | n/a | { |
|---|
| 1963 | n/a | PyObject *_res = NULL; |
|---|
| 1964 | n/a | short mode; |
|---|
| 1965 | n/a | #ifndef PenMode |
|---|
| 1966 | n/a | PyMac_PRECHECK(PenMode); |
|---|
| 1967 | n/a | #endif |
|---|
| 1968 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 1969 | n/a | &mode)) |
|---|
| 1970 | n/a | return NULL; |
|---|
| 1971 | n/a | PenMode(mode); |
|---|
| 1972 | n/a | Py_INCREF(Py_None); |
|---|
| 1973 | n/a | _res = Py_None; |
|---|
| 1974 | n/a | return _res; |
|---|
| 1975 | n/a | } |
|---|
| 1976 | n/a | |
|---|
| 1977 | n/a | static PyObject *Qd_PenPat(PyObject *_self, PyObject *_args) |
|---|
| 1978 | n/a | { |
|---|
| 1979 | n/a | PyObject *_res = NULL; |
|---|
| 1980 | n/a | Pattern *pat__in__; |
|---|
| 1981 | n/a | int pat__in_len__; |
|---|
| 1982 | n/a | #ifndef PenPat |
|---|
| 1983 | n/a | PyMac_PRECHECK(PenPat); |
|---|
| 1984 | n/a | #endif |
|---|
| 1985 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 1986 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 1987 | n/a | return NULL; |
|---|
| 1988 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 1989 | n/a | { |
|---|
| 1990 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 1991 | n/a | goto pat__error__; |
|---|
| 1992 | n/a | } |
|---|
| 1993 | n/a | PenPat(pat__in__); |
|---|
| 1994 | n/a | Py_INCREF(Py_None); |
|---|
| 1995 | n/a | _res = Py_None; |
|---|
| 1996 | n/a | pat__error__: ; |
|---|
| 1997 | n/a | return _res; |
|---|
| 1998 | n/a | } |
|---|
| 1999 | n/a | |
|---|
| 2000 | n/a | static PyObject *Qd_PenNormal(PyObject *_self, PyObject *_args) |
|---|
| 2001 | n/a | { |
|---|
| 2002 | n/a | PyObject *_res = NULL; |
|---|
| 2003 | n/a | #ifndef PenNormal |
|---|
| 2004 | n/a | PyMac_PRECHECK(PenNormal); |
|---|
| 2005 | n/a | #endif |
|---|
| 2006 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2007 | n/a | return NULL; |
|---|
| 2008 | n/a | PenNormal(); |
|---|
| 2009 | n/a | Py_INCREF(Py_None); |
|---|
| 2010 | n/a | _res = Py_None; |
|---|
| 2011 | n/a | return _res; |
|---|
| 2012 | n/a | } |
|---|
| 2013 | n/a | |
|---|
| 2014 | n/a | static PyObject *Qd_MoveTo(PyObject *_self, PyObject *_args) |
|---|
| 2015 | n/a | { |
|---|
| 2016 | n/a | PyObject *_res = NULL; |
|---|
| 2017 | n/a | short h; |
|---|
| 2018 | n/a | short v; |
|---|
| 2019 | n/a | #ifndef MoveTo |
|---|
| 2020 | n/a | PyMac_PRECHECK(MoveTo); |
|---|
| 2021 | n/a | #endif |
|---|
| 2022 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 2023 | n/a | &h, |
|---|
| 2024 | n/a | &v)) |
|---|
| 2025 | n/a | return NULL; |
|---|
| 2026 | n/a | MoveTo(h, |
|---|
| 2027 | n/a | v); |
|---|
| 2028 | n/a | Py_INCREF(Py_None); |
|---|
| 2029 | n/a | _res = Py_None; |
|---|
| 2030 | n/a | return _res; |
|---|
| 2031 | n/a | } |
|---|
| 2032 | n/a | |
|---|
| 2033 | n/a | static PyObject *Qd_Move(PyObject *_self, PyObject *_args) |
|---|
| 2034 | n/a | { |
|---|
| 2035 | n/a | PyObject *_res = NULL; |
|---|
| 2036 | n/a | short dh; |
|---|
| 2037 | n/a | short dv; |
|---|
| 2038 | n/a | #ifndef Move |
|---|
| 2039 | n/a | PyMac_PRECHECK(Move); |
|---|
| 2040 | n/a | #endif |
|---|
| 2041 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 2042 | n/a | &dh, |
|---|
| 2043 | n/a | &dv)) |
|---|
| 2044 | n/a | return NULL; |
|---|
| 2045 | n/a | Move(dh, |
|---|
| 2046 | n/a | dv); |
|---|
| 2047 | n/a | Py_INCREF(Py_None); |
|---|
| 2048 | n/a | _res = Py_None; |
|---|
| 2049 | n/a | return _res; |
|---|
| 2050 | n/a | } |
|---|
| 2051 | n/a | |
|---|
| 2052 | n/a | static PyObject *Qd_MacLineTo(PyObject *_self, PyObject *_args) |
|---|
| 2053 | n/a | { |
|---|
| 2054 | n/a | PyObject *_res = NULL; |
|---|
| 2055 | n/a | short h; |
|---|
| 2056 | n/a | short v; |
|---|
| 2057 | n/a | #ifndef MacLineTo |
|---|
| 2058 | n/a | PyMac_PRECHECK(MacLineTo); |
|---|
| 2059 | n/a | #endif |
|---|
| 2060 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 2061 | n/a | &h, |
|---|
| 2062 | n/a | &v)) |
|---|
| 2063 | n/a | return NULL; |
|---|
| 2064 | n/a | MacLineTo(h, |
|---|
| 2065 | n/a | v); |
|---|
| 2066 | n/a | Py_INCREF(Py_None); |
|---|
| 2067 | n/a | _res = Py_None; |
|---|
| 2068 | n/a | return _res; |
|---|
| 2069 | n/a | } |
|---|
| 2070 | n/a | |
|---|
| 2071 | n/a | static PyObject *Qd_Line(PyObject *_self, PyObject *_args) |
|---|
| 2072 | n/a | { |
|---|
| 2073 | n/a | PyObject *_res = NULL; |
|---|
| 2074 | n/a | short dh; |
|---|
| 2075 | n/a | short dv; |
|---|
| 2076 | n/a | #ifndef Line |
|---|
| 2077 | n/a | PyMac_PRECHECK(Line); |
|---|
| 2078 | n/a | #endif |
|---|
| 2079 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 2080 | n/a | &dh, |
|---|
| 2081 | n/a | &dv)) |
|---|
| 2082 | n/a | return NULL; |
|---|
| 2083 | n/a | Line(dh, |
|---|
| 2084 | n/a | dv); |
|---|
| 2085 | n/a | Py_INCREF(Py_None); |
|---|
| 2086 | n/a | _res = Py_None; |
|---|
| 2087 | n/a | return _res; |
|---|
| 2088 | n/a | } |
|---|
| 2089 | n/a | |
|---|
| 2090 | n/a | static PyObject *Qd_ForeColor(PyObject *_self, PyObject *_args) |
|---|
| 2091 | n/a | { |
|---|
| 2092 | n/a | PyObject *_res = NULL; |
|---|
| 2093 | n/a | long color; |
|---|
| 2094 | n/a | #ifndef ForeColor |
|---|
| 2095 | n/a | PyMac_PRECHECK(ForeColor); |
|---|
| 2096 | n/a | #endif |
|---|
| 2097 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 2098 | n/a | &color)) |
|---|
| 2099 | n/a | return NULL; |
|---|
| 2100 | n/a | ForeColor(color); |
|---|
| 2101 | n/a | Py_INCREF(Py_None); |
|---|
| 2102 | n/a | _res = Py_None; |
|---|
| 2103 | n/a | return _res; |
|---|
| 2104 | n/a | } |
|---|
| 2105 | n/a | |
|---|
| 2106 | n/a | static PyObject *Qd_BackColor(PyObject *_self, PyObject *_args) |
|---|
| 2107 | n/a | { |
|---|
| 2108 | n/a | PyObject *_res = NULL; |
|---|
| 2109 | n/a | long color; |
|---|
| 2110 | n/a | #ifndef BackColor |
|---|
| 2111 | n/a | PyMac_PRECHECK(BackColor); |
|---|
| 2112 | n/a | #endif |
|---|
| 2113 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 2114 | n/a | &color)) |
|---|
| 2115 | n/a | return NULL; |
|---|
| 2116 | n/a | BackColor(color); |
|---|
| 2117 | n/a | Py_INCREF(Py_None); |
|---|
| 2118 | n/a | _res = Py_None; |
|---|
| 2119 | n/a | return _res; |
|---|
| 2120 | n/a | } |
|---|
| 2121 | n/a | |
|---|
| 2122 | n/a | static PyObject *Qd_ColorBit(PyObject *_self, PyObject *_args) |
|---|
| 2123 | n/a | { |
|---|
| 2124 | n/a | PyObject *_res = NULL; |
|---|
| 2125 | n/a | short whichBit; |
|---|
| 2126 | n/a | #ifndef ColorBit |
|---|
| 2127 | n/a | PyMac_PRECHECK(ColorBit); |
|---|
| 2128 | n/a | #endif |
|---|
| 2129 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 2130 | n/a | &whichBit)) |
|---|
| 2131 | n/a | return NULL; |
|---|
| 2132 | n/a | ColorBit(whichBit); |
|---|
| 2133 | n/a | Py_INCREF(Py_None); |
|---|
| 2134 | n/a | _res = Py_None; |
|---|
| 2135 | n/a | return _res; |
|---|
| 2136 | n/a | } |
|---|
| 2137 | n/a | |
|---|
| 2138 | n/a | static PyObject *Qd_MacSetRect(PyObject *_self, PyObject *_args) |
|---|
| 2139 | n/a | { |
|---|
| 2140 | n/a | PyObject *_res = NULL; |
|---|
| 2141 | n/a | Rect r; |
|---|
| 2142 | n/a | short left; |
|---|
| 2143 | n/a | short top; |
|---|
| 2144 | n/a | short right; |
|---|
| 2145 | n/a | short bottom; |
|---|
| 2146 | n/a | #ifndef MacSetRect |
|---|
| 2147 | n/a | PyMac_PRECHECK(MacSetRect); |
|---|
| 2148 | n/a | #endif |
|---|
| 2149 | n/a | if (!PyArg_ParseTuple(_args, "hhhh", |
|---|
| 2150 | n/a | &left, |
|---|
| 2151 | n/a | &top, |
|---|
| 2152 | n/a | &right, |
|---|
| 2153 | n/a | &bottom)) |
|---|
| 2154 | n/a | return NULL; |
|---|
| 2155 | n/a | MacSetRect(&r, |
|---|
| 2156 | n/a | left, |
|---|
| 2157 | n/a | top, |
|---|
| 2158 | n/a | right, |
|---|
| 2159 | n/a | bottom); |
|---|
| 2160 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2161 | n/a | PyMac_BuildRect, &r); |
|---|
| 2162 | n/a | return _res; |
|---|
| 2163 | n/a | } |
|---|
| 2164 | n/a | |
|---|
| 2165 | n/a | static PyObject *Qd_MacOffsetRect(PyObject *_self, PyObject *_args) |
|---|
| 2166 | n/a | { |
|---|
| 2167 | n/a | PyObject *_res = NULL; |
|---|
| 2168 | n/a | Rect r; |
|---|
| 2169 | n/a | short dh; |
|---|
| 2170 | n/a | short dv; |
|---|
| 2171 | n/a | #ifndef MacOffsetRect |
|---|
| 2172 | n/a | PyMac_PRECHECK(MacOffsetRect); |
|---|
| 2173 | n/a | #endif |
|---|
| 2174 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2175 | n/a | PyMac_GetRect, &r, |
|---|
| 2176 | n/a | &dh, |
|---|
| 2177 | n/a | &dv)) |
|---|
| 2178 | n/a | return NULL; |
|---|
| 2179 | n/a | MacOffsetRect(&r, |
|---|
| 2180 | n/a | dh, |
|---|
| 2181 | n/a | dv); |
|---|
| 2182 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2183 | n/a | PyMac_BuildRect, &r); |
|---|
| 2184 | n/a | return _res; |
|---|
| 2185 | n/a | } |
|---|
| 2186 | n/a | |
|---|
| 2187 | n/a | static PyObject *Qd_MacInsetRect(PyObject *_self, PyObject *_args) |
|---|
| 2188 | n/a | { |
|---|
| 2189 | n/a | PyObject *_res = NULL; |
|---|
| 2190 | n/a | Rect r; |
|---|
| 2191 | n/a | short dh; |
|---|
| 2192 | n/a | short dv; |
|---|
| 2193 | n/a | #ifndef MacInsetRect |
|---|
| 2194 | n/a | PyMac_PRECHECK(MacInsetRect); |
|---|
| 2195 | n/a | #endif |
|---|
| 2196 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2197 | n/a | PyMac_GetRect, &r, |
|---|
| 2198 | n/a | &dh, |
|---|
| 2199 | n/a | &dv)) |
|---|
| 2200 | n/a | return NULL; |
|---|
| 2201 | n/a | MacInsetRect(&r, |
|---|
| 2202 | n/a | dh, |
|---|
| 2203 | n/a | dv); |
|---|
| 2204 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2205 | n/a | PyMac_BuildRect, &r); |
|---|
| 2206 | n/a | return _res; |
|---|
| 2207 | n/a | } |
|---|
| 2208 | n/a | |
|---|
| 2209 | n/a | static PyObject *Qd_SectRect(PyObject *_self, PyObject *_args) |
|---|
| 2210 | n/a | { |
|---|
| 2211 | n/a | PyObject *_res = NULL; |
|---|
| 2212 | n/a | Boolean _rv; |
|---|
| 2213 | n/a | Rect src1; |
|---|
| 2214 | n/a | Rect src2; |
|---|
| 2215 | n/a | Rect dstRect; |
|---|
| 2216 | n/a | #ifndef SectRect |
|---|
| 2217 | n/a | PyMac_PRECHECK(SectRect); |
|---|
| 2218 | n/a | #endif |
|---|
| 2219 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2220 | n/a | PyMac_GetRect, &src1, |
|---|
| 2221 | n/a | PyMac_GetRect, &src2)) |
|---|
| 2222 | n/a | return NULL; |
|---|
| 2223 | n/a | _rv = SectRect(&src1, |
|---|
| 2224 | n/a | &src2, |
|---|
| 2225 | n/a | &dstRect); |
|---|
| 2226 | n/a | _res = Py_BuildValue("bO&", |
|---|
| 2227 | n/a | _rv, |
|---|
| 2228 | n/a | PyMac_BuildRect, &dstRect); |
|---|
| 2229 | n/a | return _res; |
|---|
| 2230 | n/a | } |
|---|
| 2231 | n/a | |
|---|
| 2232 | n/a | static PyObject *Qd_MacUnionRect(PyObject *_self, PyObject *_args) |
|---|
| 2233 | n/a | { |
|---|
| 2234 | n/a | PyObject *_res = NULL; |
|---|
| 2235 | n/a | Rect src1; |
|---|
| 2236 | n/a | Rect src2; |
|---|
| 2237 | n/a | Rect dstRect; |
|---|
| 2238 | n/a | #ifndef MacUnionRect |
|---|
| 2239 | n/a | PyMac_PRECHECK(MacUnionRect); |
|---|
| 2240 | n/a | #endif |
|---|
| 2241 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2242 | n/a | PyMac_GetRect, &src1, |
|---|
| 2243 | n/a | PyMac_GetRect, &src2)) |
|---|
| 2244 | n/a | return NULL; |
|---|
| 2245 | n/a | MacUnionRect(&src1, |
|---|
| 2246 | n/a | &src2, |
|---|
| 2247 | n/a | &dstRect); |
|---|
| 2248 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2249 | n/a | PyMac_BuildRect, &dstRect); |
|---|
| 2250 | n/a | return _res; |
|---|
| 2251 | n/a | } |
|---|
| 2252 | n/a | |
|---|
| 2253 | n/a | static PyObject *Qd_MacEqualRect(PyObject *_self, PyObject *_args) |
|---|
| 2254 | n/a | { |
|---|
| 2255 | n/a | PyObject *_res = NULL; |
|---|
| 2256 | n/a | Boolean _rv; |
|---|
| 2257 | n/a | Rect rect1; |
|---|
| 2258 | n/a | Rect rect2; |
|---|
| 2259 | n/a | #ifndef MacEqualRect |
|---|
| 2260 | n/a | PyMac_PRECHECK(MacEqualRect); |
|---|
| 2261 | n/a | #endif |
|---|
| 2262 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2263 | n/a | PyMac_GetRect, &rect1, |
|---|
| 2264 | n/a | PyMac_GetRect, &rect2)) |
|---|
| 2265 | n/a | return NULL; |
|---|
| 2266 | n/a | _rv = MacEqualRect(&rect1, |
|---|
| 2267 | n/a | &rect2); |
|---|
| 2268 | n/a | _res = Py_BuildValue("b", |
|---|
| 2269 | n/a | _rv); |
|---|
| 2270 | n/a | return _res; |
|---|
| 2271 | n/a | } |
|---|
| 2272 | n/a | |
|---|
| 2273 | n/a | static PyObject *Qd_EmptyRect(PyObject *_self, PyObject *_args) |
|---|
| 2274 | n/a | { |
|---|
| 2275 | n/a | PyObject *_res = NULL; |
|---|
| 2276 | n/a | Boolean _rv; |
|---|
| 2277 | n/a | Rect r; |
|---|
| 2278 | n/a | #ifndef EmptyRect |
|---|
| 2279 | n/a | PyMac_PRECHECK(EmptyRect); |
|---|
| 2280 | n/a | #endif |
|---|
| 2281 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2282 | n/a | PyMac_GetRect, &r)) |
|---|
| 2283 | n/a | return NULL; |
|---|
| 2284 | n/a | _rv = EmptyRect(&r); |
|---|
| 2285 | n/a | _res = Py_BuildValue("b", |
|---|
| 2286 | n/a | _rv); |
|---|
| 2287 | n/a | return _res; |
|---|
| 2288 | n/a | } |
|---|
| 2289 | n/a | |
|---|
| 2290 | n/a | static PyObject *Qd_MacFrameRect(PyObject *_self, PyObject *_args) |
|---|
| 2291 | n/a | { |
|---|
| 2292 | n/a | PyObject *_res = NULL; |
|---|
| 2293 | n/a | Rect r; |
|---|
| 2294 | n/a | #ifndef MacFrameRect |
|---|
| 2295 | n/a | PyMac_PRECHECK(MacFrameRect); |
|---|
| 2296 | n/a | #endif |
|---|
| 2297 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2298 | n/a | PyMac_GetRect, &r)) |
|---|
| 2299 | n/a | return NULL; |
|---|
| 2300 | n/a | MacFrameRect(&r); |
|---|
| 2301 | n/a | Py_INCREF(Py_None); |
|---|
| 2302 | n/a | _res = Py_None; |
|---|
| 2303 | n/a | return _res; |
|---|
| 2304 | n/a | } |
|---|
| 2305 | n/a | |
|---|
| 2306 | n/a | static PyObject *Qd_PaintRect(PyObject *_self, PyObject *_args) |
|---|
| 2307 | n/a | { |
|---|
| 2308 | n/a | PyObject *_res = NULL; |
|---|
| 2309 | n/a | Rect r; |
|---|
| 2310 | n/a | #ifndef PaintRect |
|---|
| 2311 | n/a | PyMac_PRECHECK(PaintRect); |
|---|
| 2312 | n/a | #endif |
|---|
| 2313 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2314 | n/a | PyMac_GetRect, &r)) |
|---|
| 2315 | n/a | return NULL; |
|---|
| 2316 | n/a | PaintRect(&r); |
|---|
| 2317 | n/a | Py_INCREF(Py_None); |
|---|
| 2318 | n/a | _res = Py_None; |
|---|
| 2319 | n/a | return _res; |
|---|
| 2320 | n/a | } |
|---|
| 2321 | n/a | |
|---|
| 2322 | n/a | static PyObject *Qd_EraseRect(PyObject *_self, PyObject *_args) |
|---|
| 2323 | n/a | { |
|---|
| 2324 | n/a | PyObject *_res = NULL; |
|---|
| 2325 | n/a | Rect r; |
|---|
| 2326 | n/a | #ifndef EraseRect |
|---|
| 2327 | n/a | PyMac_PRECHECK(EraseRect); |
|---|
| 2328 | n/a | #endif |
|---|
| 2329 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2330 | n/a | PyMac_GetRect, &r)) |
|---|
| 2331 | n/a | return NULL; |
|---|
| 2332 | n/a | EraseRect(&r); |
|---|
| 2333 | n/a | Py_INCREF(Py_None); |
|---|
| 2334 | n/a | _res = Py_None; |
|---|
| 2335 | n/a | return _res; |
|---|
| 2336 | n/a | } |
|---|
| 2337 | n/a | |
|---|
| 2338 | n/a | static PyObject *Qd_MacInvertRect(PyObject *_self, PyObject *_args) |
|---|
| 2339 | n/a | { |
|---|
| 2340 | n/a | PyObject *_res = NULL; |
|---|
| 2341 | n/a | Rect r; |
|---|
| 2342 | n/a | #ifndef MacInvertRect |
|---|
| 2343 | n/a | PyMac_PRECHECK(MacInvertRect); |
|---|
| 2344 | n/a | #endif |
|---|
| 2345 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2346 | n/a | PyMac_GetRect, &r)) |
|---|
| 2347 | n/a | return NULL; |
|---|
| 2348 | n/a | MacInvertRect(&r); |
|---|
| 2349 | n/a | Py_INCREF(Py_None); |
|---|
| 2350 | n/a | _res = Py_None; |
|---|
| 2351 | n/a | return _res; |
|---|
| 2352 | n/a | } |
|---|
| 2353 | n/a | |
|---|
| 2354 | n/a | static PyObject *Qd_MacFillRect(PyObject *_self, PyObject *_args) |
|---|
| 2355 | n/a | { |
|---|
| 2356 | n/a | PyObject *_res = NULL; |
|---|
| 2357 | n/a | Rect r; |
|---|
| 2358 | n/a | Pattern *pat__in__; |
|---|
| 2359 | n/a | int pat__in_len__; |
|---|
| 2360 | n/a | #ifndef MacFillRect |
|---|
| 2361 | n/a | PyMac_PRECHECK(MacFillRect); |
|---|
| 2362 | n/a | #endif |
|---|
| 2363 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 2364 | n/a | PyMac_GetRect, &r, |
|---|
| 2365 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 2366 | n/a | return NULL; |
|---|
| 2367 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 2368 | n/a | { |
|---|
| 2369 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 2370 | n/a | goto pat__error__; |
|---|
| 2371 | n/a | } |
|---|
| 2372 | n/a | MacFillRect(&r, |
|---|
| 2373 | n/a | pat__in__); |
|---|
| 2374 | n/a | Py_INCREF(Py_None); |
|---|
| 2375 | n/a | _res = Py_None; |
|---|
| 2376 | n/a | pat__error__: ; |
|---|
| 2377 | n/a | return _res; |
|---|
| 2378 | n/a | } |
|---|
| 2379 | n/a | |
|---|
| 2380 | n/a | static PyObject *Qd_FrameOval(PyObject *_self, PyObject *_args) |
|---|
| 2381 | n/a | { |
|---|
| 2382 | n/a | PyObject *_res = NULL; |
|---|
| 2383 | n/a | Rect r; |
|---|
| 2384 | n/a | #ifndef FrameOval |
|---|
| 2385 | n/a | PyMac_PRECHECK(FrameOval); |
|---|
| 2386 | n/a | #endif |
|---|
| 2387 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2388 | n/a | PyMac_GetRect, &r)) |
|---|
| 2389 | n/a | return NULL; |
|---|
| 2390 | n/a | FrameOval(&r); |
|---|
| 2391 | n/a | Py_INCREF(Py_None); |
|---|
| 2392 | n/a | _res = Py_None; |
|---|
| 2393 | n/a | return _res; |
|---|
| 2394 | n/a | } |
|---|
| 2395 | n/a | |
|---|
| 2396 | n/a | static PyObject *Qd_PaintOval(PyObject *_self, PyObject *_args) |
|---|
| 2397 | n/a | { |
|---|
| 2398 | n/a | PyObject *_res = NULL; |
|---|
| 2399 | n/a | Rect r; |
|---|
| 2400 | n/a | #ifndef PaintOval |
|---|
| 2401 | n/a | PyMac_PRECHECK(PaintOval); |
|---|
| 2402 | n/a | #endif |
|---|
| 2403 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2404 | n/a | PyMac_GetRect, &r)) |
|---|
| 2405 | n/a | return NULL; |
|---|
| 2406 | n/a | PaintOval(&r); |
|---|
| 2407 | n/a | Py_INCREF(Py_None); |
|---|
| 2408 | n/a | _res = Py_None; |
|---|
| 2409 | n/a | return _res; |
|---|
| 2410 | n/a | } |
|---|
| 2411 | n/a | |
|---|
| 2412 | n/a | static PyObject *Qd_EraseOval(PyObject *_self, PyObject *_args) |
|---|
| 2413 | n/a | { |
|---|
| 2414 | n/a | PyObject *_res = NULL; |
|---|
| 2415 | n/a | Rect r; |
|---|
| 2416 | n/a | #ifndef EraseOval |
|---|
| 2417 | n/a | PyMac_PRECHECK(EraseOval); |
|---|
| 2418 | n/a | #endif |
|---|
| 2419 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2420 | n/a | PyMac_GetRect, &r)) |
|---|
| 2421 | n/a | return NULL; |
|---|
| 2422 | n/a | EraseOval(&r); |
|---|
| 2423 | n/a | Py_INCREF(Py_None); |
|---|
| 2424 | n/a | _res = Py_None; |
|---|
| 2425 | n/a | return _res; |
|---|
| 2426 | n/a | } |
|---|
| 2427 | n/a | |
|---|
| 2428 | n/a | static PyObject *Qd_InvertOval(PyObject *_self, PyObject *_args) |
|---|
| 2429 | n/a | { |
|---|
| 2430 | n/a | PyObject *_res = NULL; |
|---|
| 2431 | n/a | Rect r; |
|---|
| 2432 | n/a | #ifndef InvertOval |
|---|
| 2433 | n/a | PyMac_PRECHECK(InvertOval); |
|---|
| 2434 | n/a | #endif |
|---|
| 2435 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2436 | n/a | PyMac_GetRect, &r)) |
|---|
| 2437 | n/a | return NULL; |
|---|
| 2438 | n/a | InvertOval(&r); |
|---|
| 2439 | n/a | Py_INCREF(Py_None); |
|---|
| 2440 | n/a | _res = Py_None; |
|---|
| 2441 | n/a | return _res; |
|---|
| 2442 | n/a | } |
|---|
| 2443 | n/a | |
|---|
| 2444 | n/a | static PyObject *Qd_FillOval(PyObject *_self, PyObject *_args) |
|---|
| 2445 | n/a | { |
|---|
| 2446 | n/a | PyObject *_res = NULL; |
|---|
| 2447 | n/a | Rect r; |
|---|
| 2448 | n/a | Pattern *pat__in__; |
|---|
| 2449 | n/a | int pat__in_len__; |
|---|
| 2450 | n/a | #ifndef FillOval |
|---|
| 2451 | n/a | PyMac_PRECHECK(FillOval); |
|---|
| 2452 | n/a | #endif |
|---|
| 2453 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 2454 | n/a | PyMac_GetRect, &r, |
|---|
| 2455 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 2456 | n/a | return NULL; |
|---|
| 2457 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 2458 | n/a | { |
|---|
| 2459 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 2460 | n/a | goto pat__error__; |
|---|
| 2461 | n/a | } |
|---|
| 2462 | n/a | FillOval(&r, |
|---|
| 2463 | n/a | pat__in__); |
|---|
| 2464 | n/a | Py_INCREF(Py_None); |
|---|
| 2465 | n/a | _res = Py_None; |
|---|
| 2466 | n/a | pat__error__: ; |
|---|
| 2467 | n/a | return _res; |
|---|
| 2468 | n/a | } |
|---|
| 2469 | n/a | |
|---|
| 2470 | n/a | static PyObject *Qd_FrameRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 2471 | n/a | { |
|---|
| 2472 | n/a | PyObject *_res = NULL; |
|---|
| 2473 | n/a | Rect r; |
|---|
| 2474 | n/a | short ovalWidth; |
|---|
| 2475 | n/a | short ovalHeight; |
|---|
| 2476 | n/a | #ifndef FrameRoundRect |
|---|
| 2477 | n/a | PyMac_PRECHECK(FrameRoundRect); |
|---|
| 2478 | n/a | #endif |
|---|
| 2479 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2480 | n/a | PyMac_GetRect, &r, |
|---|
| 2481 | n/a | &ovalWidth, |
|---|
| 2482 | n/a | &ovalHeight)) |
|---|
| 2483 | n/a | return NULL; |
|---|
| 2484 | n/a | FrameRoundRect(&r, |
|---|
| 2485 | n/a | ovalWidth, |
|---|
| 2486 | n/a | ovalHeight); |
|---|
| 2487 | n/a | Py_INCREF(Py_None); |
|---|
| 2488 | n/a | _res = Py_None; |
|---|
| 2489 | n/a | return _res; |
|---|
| 2490 | n/a | } |
|---|
| 2491 | n/a | |
|---|
| 2492 | n/a | static PyObject *Qd_PaintRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 2493 | n/a | { |
|---|
| 2494 | n/a | PyObject *_res = NULL; |
|---|
| 2495 | n/a | Rect r; |
|---|
| 2496 | n/a | short ovalWidth; |
|---|
| 2497 | n/a | short ovalHeight; |
|---|
| 2498 | n/a | #ifndef PaintRoundRect |
|---|
| 2499 | n/a | PyMac_PRECHECK(PaintRoundRect); |
|---|
| 2500 | n/a | #endif |
|---|
| 2501 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2502 | n/a | PyMac_GetRect, &r, |
|---|
| 2503 | n/a | &ovalWidth, |
|---|
| 2504 | n/a | &ovalHeight)) |
|---|
| 2505 | n/a | return NULL; |
|---|
| 2506 | n/a | PaintRoundRect(&r, |
|---|
| 2507 | n/a | ovalWidth, |
|---|
| 2508 | n/a | ovalHeight); |
|---|
| 2509 | n/a | Py_INCREF(Py_None); |
|---|
| 2510 | n/a | _res = Py_None; |
|---|
| 2511 | n/a | return _res; |
|---|
| 2512 | n/a | } |
|---|
| 2513 | n/a | |
|---|
| 2514 | n/a | static PyObject *Qd_EraseRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 2515 | n/a | { |
|---|
| 2516 | n/a | PyObject *_res = NULL; |
|---|
| 2517 | n/a | Rect r; |
|---|
| 2518 | n/a | short ovalWidth; |
|---|
| 2519 | n/a | short ovalHeight; |
|---|
| 2520 | n/a | #ifndef EraseRoundRect |
|---|
| 2521 | n/a | PyMac_PRECHECK(EraseRoundRect); |
|---|
| 2522 | n/a | #endif |
|---|
| 2523 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2524 | n/a | PyMac_GetRect, &r, |
|---|
| 2525 | n/a | &ovalWidth, |
|---|
| 2526 | n/a | &ovalHeight)) |
|---|
| 2527 | n/a | return NULL; |
|---|
| 2528 | n/a | EraseRoundRect(&r, |
|---|
| 2529 | n/a | ovalWidth, |
|---|
| 2530 | n/a | ovalHeight); |
|---|
| 2531 | n/a | Py_INCREF(Py_None); |
|---|
| 2532 | n/a | _res = Py_None; |
|---|
| 2533 | n/a | return _res; |
|---|
| 2534 | n/a | } |
|---|
| 2535 | n/a | |
|---|
| 2536 | n/a | static PyObject *Qd_InvertRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 2537 | n/a | { |
|---|
| 2538 | n/a | PyObject *_res = NULL; |
|---|
| 2539 | n/a | Rect r; |
|---|
| 2540 | n/a | short ovalWidth; |
|---|
| 2541 | n/a | short ovalHeight; |
|---|
| 2542 | n/a | #ifndef InvertRoundRect |
|---|
| 2543 | n/a | PyMac_PRECHECK(InvertRoundRect); |
|---|
| 2544 | n/a | #endif |
|---|
| 2545 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2546 | n/a | PyMac_GetRect, &r, |
|---|
| 2547 | n/a | &ovalWidth, |
|---|
| 2548 | n/a | &ovalHeight)) |
|---|
| 2549 | n/a | return NULL; |
|---|
| 2550 | n/a | InvertRoundRect(&r, |
|---|
| 2551 | n/a | ovalWidth, |
|---|
| 2552 | n/a | ovalHeight); |
|---|
| 2553 | n/a | Py_INCREF(Py_None); |
|---|
| 2554 | n/a | _res = Py_None; |
|---|
| 2555 | n/a | return _res; |
|---|
| 2556 | n/a | } |
|---|
| 2557 | n/a | |
|---|
| 2558 | n/a | static PyObject *Qd_FillRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 2559 | n/a | { |
|---|
| 2560 | n/a | PyObject *_res = NULL; |
|---|
| 2561 | n/a | Rect r; |
|---|
| 2562 | n/a | short ovalWidth; |
|---|
| 2563 | n/a | short ovalHeight; |
|---|
| 2564 | n/a | Pattern *pat__in__; |
|---|
| 2565 | n/a | int pat__in_len__; |
|---|
| 2566 | n/a | #ifndef FillRoundRect |
|---|
| 2567 | n/a | PyMac_PRECHECK(FillRoundRect); |
|---|
| 2568 | n/a | #endif |
|---|
| 2569 | n/a | if (!PyArg_ParseTuple(_args, "O&hhs#", |
|---|
| 2570 | n/a | PyMac_GetRect, &r, |
|---|
| 2571 | n/a | &ovalWidth, |
|---|
| 2572 | n/a | &ovalHeight, |
|---|
| 2573 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 2574 | n/a | return NULL; |
|---|
| 2575 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 2576 | n/a | { |
|---|
| 2577 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 2578 | n/a | goto pat__error__; |
|---|
| 2579 | n/a | } |
|---|
| 2580 | n/a | FillRoundRect(&r, |
|---|
| 2581 | n/a | ovalWidth, |
|---|
| 2582 | n/a | ovalHeight, |
|---|
| 2583 | n/a | pat__in__); |
|---|
| 2584 | n/a | Py_INCREF(Py_None); |
|---|
| 2585 | n/a | _res = Py_None; |
|---|
| 2586 | n/a | pat__error__: ; |
|---|
| 2587 | n/a | return _res; |
|---|
| 2588 | n/a | } |
|---|
| 2589 | n/a | |
|---|
| 2590 | n/a | static PyObject *Qd_FrameArc(PyObject *_self, PyObject *_args) |
|---|
| 2591 | n/a | { |
|---|
| 2592 | n/a | PyObject *_res = NULL; |
|---|
| 2593 | n/a | Rect r; |
|---|
| 2594 | n/a | short startAngle; |
|---|
| 2595 | n/a | short arcAngle; |
|---|
| 2596 | n/a | #ifndef FrameArc |
|---|
| 2597 | n/a | PyMac_PRECHECK(FrameArc); |
|---|
| 2598 | n/a | #endif |
|---|
| 2599 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2600 | n/a | PyMac_GetRect, &r, |
|---|
| 2601 | n/a | &startAngle, |
|---|
| 2602 | n/a | &arcAngle)) |
|---|
| 2603 | n/a | return NULL; |
|---|
| 2604 | n/a | FrameArc(&r, |
|---|
| 2605 | n/a | startAngle, |
|---|
| 2606 | n/a | arcAngle); |
|---|
| 2607 | n/a | Py_INCREF(Py_None); |
|---|
| 2608 | n/a | _res = Py_None; |
|---|
| 2609 | n/a | return _res; |
|---|
| 2610 | n/a | } |
|---|
| 2611 | n/a | |
|---|
| 2612 | n/a | static PyObject *Qd_PaintArc(PyObject *_self, PyObject *_args) |
|---|
| 2613 | n/a | { |
|---|
| 2614 | n/a | PyObject *_res = NULL; |
|---|
| 2615 | n/a | Rect r; |
|---|
| 2616 | n/a | short startAngle; |
|---|
| 2617 | n/a | short arcAngle; |
|---|
| 2618 | n/a | #ifndef PaintArc |
|---|
| 2619 | n/a | PyMac_PRECHECK(PaintArc); |
|---|
| 2620 | n/a | #endif |
|---|
| 2621 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2622 | n/a | PyMac_GetRect, &r, |
|---|
| 2623 | n/a | &startAngle, |
|---|
| 2624 | n/a | &arcAngle)) |
|---|
| 2625 | n/a | return NULL; |
|---|
| 2626 | n/a | PaintArc(&r, |
|---|
| 2627 | n/a | startAngle, |
|---|
| 2628 | n/a | arcAngle); |
|---|
| 2629 | n/a | Py_INCREF(Py_None); |
|---|
| 2630 | n/a | _res = Py_None; |
|---|
| 2631 | n/a | return _res; |
|---|
| 2632 | n/a | } |
|---|
| 2633 | n/a | |
|---|
| 2634 | n/a | static PyObject *Qd_EraseArc(PyObject *_self, PyObject *_args) |
|---|
| 2635 | n/a | { |
|---|
| 2636 | n/a | PyObject *_res = NULL; |
|---|
| 2637 | n/a | Rect r; |
|---|
| 2638 | n/a | short startAngle; |
|---|
| 2639 | n/a | short arcAngle; |
|---|
| 2640 | n/a | #ifndef EraseArc |
|---|
| 2641 | n/a | PyMac_PRECHECK(EraseArc); |
|---|
| 2642 | n/a | #endif |
|---|
| 2643 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2644 | n/a | PyMac_GetRect, &r, |
|---|
| 2645 | n/a | &startAngle, |
|---|
| 2646 | n/a | &arcAngle)) |
|---|
| 2647 | n/a | return NULL; |
|---|
| 2648 | n/a | EraseArc(&r, |
|---|
| 2649 | n/a | startAngle, |
|---|
| 2650 | n/a | arcAngle); |
|---|
| 2651 | n/a | Py_INCREF(Py_None); |
|---|
| 2652 | n/a | _res = Py_None; |
|---|
| 2653 | n/a | return _res; |
|---|
| 2654 | n/a | } |
|---|
| 2655 | n/a | |
|---|
| 2656 | n/a | static PyObject *Qd_InvertArc(PyObject *_self, PyObject *_args) |
|---|
| 2657 | n/a | { |
|---|
| 2658 | n/a | PyObject *_res = NULL; |
|---|
| 2659 | n/a | Rect r; |
|---|
| 2660 | n/a | short startAngle; |
|---|
| 2661 | n/a | short arcAngle; |
|---|
| 2662 | n/a | #ifndef InvertArc |
|---|
| 2663 | n/a | PyMac_PRECHECK(InvertArc); |
|---|
| 2664 | n/a | #endif |
|---|
| 2665 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2666 | n/a | PyMac_GetRect, &r, |
|---|
| 2667 | n/a | &startAngle, |
|---|
| 2668 | n/a | &arcAngle)) |
|---|
| 2669 | n/a | return NULL; |
|---|
| 2670 | n/a | InvertArc(&r, |
|---|
| 2671 | n/a | startAngle, |
|---|
| 2672 | n/a | arcAngle); |
|---|
| 2673 | n/a | Py_INCREF(Py_None); |
|---|
| 2674 | n/a | _res = Py_None; |
|---|
| 2675 | n/a | return _res; |
|---|
| 2676 | n/a | } |
|---|
| 2677 | n/a | |
|---|
| 2678 | n/a | static PyObject *Qd_FillArc(PyObject *_self, PyObject *_args) |
|---|
| 2679 | n/a | { |
|---|
| 2680 | n/a | PyObject *_res = NULL; |
|---|
| 2681 | n/a | Rect r; |
|---|
| 2682 | n/a | short startAngle; |
|---|
| 2683 | n/a | short arcAngle; |
|---|
| 2684 | n/a | Pattern *pat__in__; |
|---|
| 2685 | n/a | int pat__in_len__; |
|---|
| 2686 | n/a | #ifndef FillArc |
|---|
| 2687 | n/a | PyMac_PRECHECK(FillArc); |
|---|
| 2688 | n/a | #endif |
|---|
| 2689 | n/a | if (!PyArg_ParseTuple(_args, "O&hhs#", |
|---|
| 2690 | n/a | PyMac_GetRect, &r, |
|---|
| 2691 | n/a | &startAngle, |
|---|
| 2692 | n/a | &arcAngle, |
|---|
| 2693 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 2694 | n/a | return NULL; |
|---|
| 2695 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 2696 | n/a | { |
|---|
| 2697 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 2698 | n/a | goto pat__error__; |
|---|
| 2699 | n/a | } |
|---|
| 2700 | n/a | FillArc(&r, |
|---|
| 2701 | n/a | startAngle, |
|---|
| 2702 | n/a | arcAngle, |
|---|
| 2703 | n/a | pat__in__); |
|---|
| 2704 | n/a | Py_INCREF(Py_None); |
|---|
| 2705 | n/a | _res = Py_None; |
|---|
| 2706 | n/a | pat__error__: ; |
|---|
| 2707 | n/a | return _res; |
|---|
| 2708 | n/a | } |
|---|
| 2709 | n/a | |
|---|
| 2710 | n/a | static PyObject *Qd_NewRgn(PyObject *_self, PyObject *_args) |
|---|
| 2711 | n/a | { |
|---|
| 2712 | n/a | PyObject *_res = NULL; |
|---|
| 2713 | n/a | RgnHandle _rv; |
|---|
| 2714 | n/a | #ifndef NewRgn |
|---|
| 2715 | n/a | PyMac_PRECHECK(NewRgn); |
|---|
| 2716 | n/a | #endif |
|---|
| 2717 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2718 | n/a | return NULL; |
|---|
| 2719 | n/a | _rv = NewRgn(); |
|---|
| 2720 | n/a | _res = Py_BuildValue("O&", |
|---|
| 2721 | n/a | ResObj_New, _rv); |
|---|
| 2722 | n/a | return _res; |
|---|
| 2723 | n/a | } |
|---|
| 2724 | n/a | |
|---|
| 2725 | n/a | static PyObject *Qd_OpenRgn(PyObject *_self, PyObject *_args) |
|---|
| 2726 | n/a | { |
|---|
| 2727 | n/a | PyObject *_res = NULL; |
|---|
| 2728 | n/a | #ifndef OpenRgn |
|---|
| 2729 | n/a | PyMac_PRECHECK(OpenRgn); |
|---|
| 2730 | n/a | #endif |
|---|
| 2731 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 2732 | n/a | return NULL; |
|---|
| 2733 | n/a | OpenRgn(); |
|---|
| 2734 | n/a | Py_INCREF(Py_None); |
|---|
| 2735 | n/a | _res = Py_None; |
|---|
| 2736 | n/a | return _res; |
|---|
| 2737 | n/a | } |
|---|
| 2738 | n/a | |
|---|
| 2739 | n/a | static PyObject *Qd_CloseRgn(PyObject *_self, PyObject *_args) |
|---|
| 2740 | n/a | { |
|---|
| 2741 | n/a | PyObject *_res = NULL; |
|---|
| 2742 | n/a | RgnHandle dstRgn; |
|---|
| 2743 | n/a | #ifndef CloseRgn |
|---|
| 2744 | n/a | PyMac_PRECHECK(CloseRgn); |
|---|
| 2745 | n/a | #endif |
|---|
| 2746 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2747 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 2748 | n/a | return NULL; |
|---|
| 2749 | n/a | CloseRgn(dstRgn); |
|---|
| 2750 | n/a | Py_INCREF(Py_None); |
|---|
| 2751 | n/a | _res = Py_None; |
|---|
| 2752 | n/a | return _res; |
|---|
| 2753 | n/a | } |
|---|
| 2754 | n/a | |
|---|
| 2755 | n/a | static PyObject *Qd_BitMapToRegion(PyObject *_self, PyObject *_args) |
|---|
| 2756 | n/a | { |
|---|
| 2757 | n/a | PyObject *_res = NULL; |
|---|
| 2758 | n/a | OSErr _err; |
|---|
| 2759 | n/a | RgnHandle region; |
|---|
| 2760 | n/a | BitMapPtr bMap; |
|---|
| 2761 | n/a | #ifndef BitMapToRegion |
|---|
| 2762 | n/a | PyMac_PRECHECK(BitMapToRegion); |
|---|
| 2763 | n/a | #endif |
|---|
| 2764 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2765 | n/a | ResObj_Convert, ®ion, |
|---|
| 2766 | n/a | BMObj_Convert, &bMap)) |
|---|
| 2767 | n/a | return NULL; |
|---|
| 2768 | n/a | _err = BitMapToRegion(region, |
|---|
| 2769 | n/a | bMap); |
|---|
| 2770 | n/a | if (_err != noErr) return PyMac_Error(_err); |
|---|
| 2771 | n/a | Py_INCREF(Py_None); |
|---|
| 2772 | n/a | _res = Py_None; |
|---|
| 2773 | n/a | return _res; |
|---|
| 2774 | n/a | } |
|---|
| 2775 | n/a | |
|---|
| 2776 | n/a | static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args) |
|---|
| 2777 | n/a | { |
|---|
| 2778 | n/a | PyObject *_res = NULL; |
|---|
| 2779 | n/a | RgnHandle region; |
|---|
| 2780 | n/a | Handle flattenedRgnDataHdl; |
|---|
| 2781 | n/a | #ifndef RgnToHandle |
|---|
| 2782 | n/a | PyMac_PRECHECK(RgnToHandle); |
|---|
| 2783 | n/a | #endif |
|---|
| 2784 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2785 | n/a | ResObj_Convert, ®ion, |
|---|
| 2786 | n/a | ResObj_Convert, &flattenedRgnDataHdl)) |
|---|
| 2787 | n/a | return NULL; |
|---|
| 2788 | n/a | RgnToHandle(region, |
|---|
| 2789 | n/a | flattenedRgnDataHdl); |
|---|
| 2790 | n/a | Py_INCREF(Py_None); |
|---|
| 2791 | n/a | _res = Py_None; |
|---|
| 2792 | n/a | return _res; |
|---|
| 2793 | n/a | } |
|---|
| 2794 | n/a | |
|---|
| 2795 | n/a | static PyObject *Qd_DisposeRgn(PyObject *_self, PyObject *_args) |
|---|
| 2796 | n/a | { |
|---|
| 2797 | n/a | PyObject *_res = NULL; |
|---|
| 2798 | n/a | RgnHandle rgn; |
|---|
| 2799 | n/a | #ifndef DisposeRgn |
|---|
| 2800 | n/a | PyMac_PRECHECK(DisposeRgn); |
|---|
| 2801 | n/a | #endif |
|---|
| 2802 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2803 | n/a | ResObj_Convert, &rgn)) |
|---|
| 2804 | n/a | return NULL; |
|---|
| 2805 | n/a | DisposeRgn(rgn); |
|---|
| 2806 | n/a | Py_INCREF(Py_None); |
|---|
| 2807 | n/a | _res = Py_None; |
|---|
| 2808 | n/a | return _res; |
|---|
| 2809 | n/a | } |
|---|
| 2810 | n/a | |
|---|
| 2811 | n/a | static PyObject *Qd_MacCopyRgn(PyObject *_self, PyObject *_args) |
|---|
| 2812 | n/a | { |
|---|
| 2813 | n/a | PyObject *_res = NULL; |
|---|
| 2814 | n/a | RgnHandle srcRgn; |
|---|
| 2815 | n/a | RgnHandle dstRgn; |
|---|
| 2816 | n/a | #ifndef MacCopyRgn |
|---|
| 2817 | n/a | PyMac_PRECHECK(MacCopyRgn); |
|---|
| 2818 | n/a | #endif |
|---|
| 2819 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2820 | n/a | ResObj_Convert, &srcRgn, |
|---|
| 2821 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 2822 | n/a | return NULL; |
|---|
| 2823 | n/a | MacCopyRgn(srcRgn, |
|---|
| 2824 | n/a | dstRgn); |
|---|
| 2825 | n/a | Py_INCREF(Py_None); |
|---|
| 2826 | n/a | _res = Py_None; |
|---|
| 2827 | n/a | return _res; |
|---|
| 2828 | n/a | } |
|---|
| 2829 | n/a | |
|---|
| 2830 | n/a | static PyObject *Qd_SetEmptyRgn(PyObject *_self, PyObject *_args) |
|---|
| 2831 | n/a | { |
|---|
| 2832 | n/a | PyObject *_res = NULL; |
|---|
| 2833 | n/a | RgnHandle rgn; |
|---|
| 2834 | n/a | #ifndef SetEmptyRgn |
|---|
| 2835 | n/a | PyMac_PRECHECK(SetEmptyRgn); |
|---|
| 2836 | n/a | #endif |
|---|
| 2837 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 2838 | n/a | ResObj_Convert, &rgn)) |
|---|
| 2839 | n/a | return NULL; |
|---|
| 2840 | n/a | SetEmptyRgn(rgn); |
|---|
| 2841 | n/a | Py_INCREF(Py_None); |
|---|
| 2842 | n/a | _res = Py_None; |
|---|
| 2843 | n/a | return _res; |
|---|
| 2844 | n/a | } |
|---|
| 2845 | n/a | |
|---|
| 2846 | n/a | static PyObject *Qd_MacSetRectRgn(PyObject *_self, PyObject *_args) |
|---|
| 2847 | n/a | { |
|---|
| 2848 | n/a | PyObject *_res = NULL; |
|---|
| 2849 | n/a | RgnHandle rgn; |
|---|
| 2850 | n/a | short left; |
|---|
| 2851 | n/a | short top; |
|---|
| 2852 | n/a | short right; |
|---|
| 2853 | n/a | short bottom; |
|---|
| 2854 | n/a | #ifndef MacSetRectRgn |
|---|
| 2855 | n/a | PyMac_PRECHECK(MacSetRectRgn); |
|---|
| 2856 | n/a | #endif |
|---|
| 2857 | n/a | if (!PyArg_ParseTuple(_args, "O&hhhh", |
|---|
| 2858 | n/a | ResObj_Convert, &rgn, |
|---|
| 2859 | n/a | &left, |
|---|
| 2860 | n/a | &top, |
|---|
| 2861 | n/a | &right, |
|---|
| 2862 | n/a | &bottom)) |
|---|
| 2863 | n/a | return NULL; |
|---|
| 2864 | n/a | MacSetRectRgn(rgn, |
|---|
| 2865 | n/a | left, |
|---|
| 2866 | n/a | top, |
|---|
| 2867 | n/a | right, |
|---|
| 2868 | n/a | bottom); |
|---|
| 2869 | n/a | Py_INCREF(Py_None); |
|---|
| 2870 | n/a | _res = Py_None; |
|---|
| 2871 | n/a | return _res; |
|---|
| 2872 | n/a | } |
|---|
| 2873 | n/a | |
|---|
| 2874 | n/a | static PyObject *Qd_RectRgn(PyObject *_self, PyObject *_args) |
|---|
| 2875 | n/a | { |
|---|
| 2876 | n/a | PyObject *_res = NULL; |
|---|
| 2877 | n/a | RgnHandle rgn; |
|---|
| 2878 | n/a | Rect r; |
|---|
| 2879 | n/a | #ifndef RectRgn |
|---|
| 2880 | n/a | PyMac_PRECHECK(RectRgn); |
|---|
| 2881 | n/a | #endif |
|---|
| 2882 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 2883 | n/a | ResObj_Convert, &rgn, |
|---|
| 2884 | n/a | PyMac_GetRect, &r)) |
|---|
| 2885 | n/a | return NULL; |
|---|
| 2886 | n/a | RectRgn(rgn, |
|---|
| 2887 | n/a | &r); |
|---|
| 2888 | n/a | Py_INCREF(Py_None); |
|---|
| 2889 | n/a | _res = Py_None; |
|---|
| 2890 | n/a | return _res; |
|---|
| 2891 | n/a | } |
|---|
| 2892 | n/a | |
|---|
| 2893 | n/a | static PyObject *Qd_MacOffsetRgn(PyObject *_self, PyObject *_args) |
|---|
| 2894 | n/a | { |
|---|
| 2895 | n/a | PyObject *_res = NULL; |
|---|
| 2896 | n/a | RgnHandle rgn; |
|---|
| 2897 | n/a | short dh; |
|---|
| 2898 | n/a | short dv; |
|---|
| 2899 | n/a | #ifndef MacOffsetRgn |
|---|
| 2900 | n/a | PyMac_PRECHECK(MacOffsetRgn); |
|---|
| 2901 | n/a | #endif |
|---|
| 2902 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2903 | n/a | ResObj_Convert, &rgn, |
|---|
| 2904 | n/a | &dh, |
|---|
| 2905 | n/a | &dv)) |
|---|
| 2906 | n/a | return NULL; |
|---|
| 2907 | n/a | MacOffsetRgn(rgn, |
|---|
| 2908 | n/a | dh, |
|---|
| 2909 | n/a | dv); |
|---|
| 2910 | n/a | Py_INCREF(Py_None); |
|---|
| 2911 | n/a | _res = Py_None; |
|---|
| 2912 | n/a | return _res; |
|---|
| 2913 | n/a | } |
|---|
| 2914 | n/a | |
|---|
| 2915 | n/a | static PyObject *Qd_InsetRgn(PyObject *_self, PyObject *_args) |
|---|
| 2916 | n/a | { |
|---|
| 2917 | n/a | PyObject *_res = NULL; |
|---|
| 2918 | n/a | RgnHandle rgn; |
|---|
| 2919 | n/a | short dh; |
|---|
| 2920 | n/a | short dv; |
|---|
| 2921 | n/a | #ifndef InsetRgn |
|---|
| 2922 | n/a | PyMac_PRECHECK(InsetRgn); |
|---|
| 2923 | n/a | #endif |
|---|
| 2924 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 2925 | n/a | ResObj_Convert, &rgn, |
|---|
| 2926 | n/a | &dh, |
|---|
| 2927 | n/a | &dv)) |
|---|
| 2928 | n/a | return NULL; |
|---|
| 2929 | n/a | InsetRgn(rgn, |
|---|
| 2930 | n/a | dh, |
|---|
| 2931 | n/a | dv); |
|---|
| 2932 | n/a | Py_INCREF(Py_None); |
|---|
| 2933 | n/a | _res = Py_None; |
|---|
| 2934 | n/a | return _res; |
|---|
| 2935 | n/a | } |
|---|
| 2936 | n/a | |
|---|
| 2937 | n/a | static PyObject *Qd_SectRgn(PyObject *_self, PyObject *_args) |
|---|
| 2938 | n/a | { |
|---|
| 2939 | n/a | PyObject *_res = NULL; |
|---|
| 2940 | n/a | RgnHandle srcRgnA; |
|---|
| 2941 | n/a | RgnHandle srcRgnB; |
|---|
| 2942 | n/a | RgnHandle dstRgn; |
|---|
| 2943 | n/a | #ifndef SectRgn |
|---|
| 2944 | n/a | PyMac_PRECHECK(SectRgn); |
|---|
| 2945 | n/a | #endif |
|---|
| 2946 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 2947 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 2948 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 2949 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 2950 | n/a | return NULL; |
|---|
| 2951 | n/a | SectRgn(srcRgnA, |
|---|
| 2952 | n/a | srcRgnB, |
|---|
| 2953 | n/a | dstRgn); |
|---|
| 2954 | n/a | Py_INCREF(Py_None); |
|---|
| 2955 | n/a | _res = Py_None; |
|---|
| 2956 | n/a | return _res; |
|---|
| 2957 | n/a | } |
|---|
| 2958 | n/a | |
|---|
| 2959 | n/a | static PyObject *Qd_MacUnionRgn(PyObject *_self, PyObject *_args) |
|---|
| 2960 | n/a | { |
|---|
| 2961 | n/a | PyObject *_res = NULL; |
|---|
| 2962 | n/a | RgnHandle srcRgnA; |
|---|
| 2963 | n/a | RgnHandle srcRgnB; |
|---|
| 2964 | n/a | RgnHandle dstRgn; |
|---|
| 2965 | n/a | #ifndef MacUnionRgn |
|---|
| 2966 | n/a | PyMac_PRECHECK(MacUnionRgn); |
|---|
| 2967 | n/a | #endif |
|---|
| 2968 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 2969 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 2970 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 2971 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 2972 | n/a | return NULL; |
|---|
| 2973 | n/a | MacUnionRgn(srcRgnA, |
|---|
| 2974 | n/a | srcRgnB, |
|---|
| 2975 | n/a | dstRgn); |
|---|
| 2976 | n/a | Py_INCREF(Py_None); |
|---|
| 2977 | n/a | _res = Py_None; |
|---|
| 2978 | n/a | return _res; |
|---|
| 2979 | n/a | } |
|---|
| 2980 | n/a | |
|---|
| 2981 | n/a | static PyObject *Qd_DiffRgn(PyObject *_self, PyObject *_args) |
|---|
| 2982 | n/a | { |
|---|
| 2983 | n/a | PyObject *_res = NULL; |
|---|
| 2984 | n/a | RgnHandle srcRgnA; |
|---|
| 2985 | n/a | RgnHandle srcRgnB; |
|---|
| 2986 | n/a | RgnHandle dstRgn; |
|---|
| 2987 | n/a | #ifndef DiffRgn |
|---|
| 2988 | n/a | PyMac_PRECHECK(DiffRgn); |
|---|
| 2989 | n/a | #endif |
|---|
| 2990 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 2991 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 2992 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 2993 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 2994 | n/a | return NULL; |
|---|
| 2995 | n/a | DiffRgn(srcRgnA, |
|---|
| 2996 | n/a | srcRgnB, |
|---|
| 2997 | n/a | dstRgn); |
|---|
| 2998 | n/a | Py_INCREF(Py_None); |
|---|
| 2999 | n/a | _res = Py_None; |
|---|
| 3000 | n/a | return _res; |
|---|
| 3001 | n/a | } |
|---|
| 3002 | n/a | |
|---|
| 3003 | n/a | static PyObject *Qd_MacXorRgn(PyObject *_self, PyObject *_args) |
|---|
| 3004 | n/a | { |
|---|
| 3005 | n/a | PyObject *_res = NULL; |
|---|
| 3006 | n/a | RgnHandle srcRgnA; |
|---|
| 3007 | n/a | RgnHandle srcRgnB; |
|---|
| 3008 | n/a | RgnHandle dstRgn; |
|---|
| 3009 | n/a | #ifndef MacXorRgn |
|---|
| 3010 | n/a | PyMac_PRECHECK(MacXorRgn); |
|---|
| 3011 | n/a | #endif |
|---|
| 3012 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3013 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 3014 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 3015 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 3016 | n/a | return NULL; |
|---|
| 3017 | n/a | MacXorRgn(srcRgnA, |
|---|
| 3018 | n/a | srcRgnB, |
|---|
| 3019 | n/a | dstRgn); |
|---|
| 3020 | n/a | Py_INCREF(Py_None); |
|---|
| 3021 | n/a | _res = Py_None; |
|---|
| 3022 | n/a | return _res; |
|---|
| 3023 | n/a | } |
|---|
| 3024 | n/a | |
|---|
| 3025 | n/a | static PyObject *Qd_RectInRgn(PyObject *_self, PyObject *_args) |
|---|
| 3026 | n/a | { |
|---|
| 3027 | n/a | PyObject *_res = NULL; |
|---|
| 3028 | n/a | Boolean _rv; |
|---|
| 3029 | n/a | Rect r; |
|---|
| 3030 | n/a | RgnHandle rgn; |
|---|
| 3031 | n/a | #ifndef RectInRgn |
|---|
| 3032 | n/a | PyMac_PRECHECK(RectInRgn); |
|---|
| 3033 | n/a | #endif |
|---|
| 3034 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3035 | n/a | PyMac_GetRect, &r, |
|---|
| 3036 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3037 | n/a | return NULL; |
|---|
| 3038 | n/a | _rv = RectInRgn(&r, |
|---|
| 3039 | n/a | rgn); |
|---|
| 3040 | n/a | _res = Py_BuildValue("b", |
|---|
| 3041 | n/a | _rv); |
|---|
| 3042 | n/a | return _res; |
|---|
| 3043 | n/a | } |
|---|
| 3044 | n/a | |
|---|
| 3045 | n/a | static PyObject *Qd_MacEqualRgn(PyObject *_self, PyObject *_args) |
|---|
| 3046 | n/a | { |
|---|
| 3047 | n/a | PyObject *_res = NULL; |
|---|
| 3048 | n/a | Boolean _rv; |
|---|
| 3049 | n/a | RgnHandle rgnA; |
|---|
| 3050 | n/a | RgnHandle rgnB; |
|---|
| 3051 | n/a | #ifndef MacEqualRgn |
|---|
| 3052 | n/a | PyMac_PRECHECK(MacEqualRgn); |
|---|
| 3053 | n/a | #endif |
|---|
| 3054 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3055 | n/a | ResObj_Convert, &rgnA, |
|---|
| 3056 | n/a | ResObj_Convert, &rgnB)) |
|---|
| 3057 | n/a | return NULL; |
|---|
| 3058 | n/a | _rv = MacEqualRgn(rgnA, |
|---|
| 3059 | n/a | rgnB); |
|---|
| 3060 | n/a | _res = Py_BuildValue("b", |
|---|
| 3061 | n/a | _rv); |
|---|
| 3062 | n/a | return _res; |
|---|
| 3063 | n/a | } |
|---|
| 3064 | n/a | |
|---|
| 3065 | n/a | static PyObject *Qd_EmptyRgn(PyObject *_self, PyObject *_args) |
|---|
| 3066 | n/a | { |
|---|
| 3067 | n/a | PyObject *_res = NULL; |
|---|
| 3068 | n/a | Boolean _rv; |
|---|
| 3069 | n/a | RgnHandle rgn; |
|---|
| 3070 | n/a | #ifndef EmptyRgn |
|---|
| 3071 | n/a | PyMac_PRECHECK(EmptyRgn); |
|---|
| 3072 | n/a | #endif |
|---|
| 3073 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3074 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3075 | n/a | return NULL; |
|---|
| 3076 | n/a | _rv = EmptyRgn(rgn); |
|---|
| 3077 | n/a | _res = Py_BuildValue("b", |
|---|
| 3078 | n/a | _rv); |
|---|
| 3079 | n/a | return _res; |
|---|
| 3080 | n/a | } |
|---|
| 3081 | n/a | |
|---|
| 3082 | n/a | static PyObject *Qd_MacFrameRgn(PyObject *_self, PyObject *_args) |
|---|
| 3083 | n/a | { |
|---|
| 3084 | n/a | PyObject *_res = NULL; |
|---|
| 3085 | n/a | RgnHandle rgn; |
|---|
| 3086 | n/a | #ifndef MacFrameRgn |
|---|
| 3087 | n/a | PyMac_PRECHECK(MacFrameRgn); |
|---|
| 3088 | n/a | #endif |
|---|
| 3089 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3090 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3091 | n/a | return NULL; |
|---|
| 3092 | n/a | MacFrameRgn(rgn); |
|---|
| 3093 | n/a | Py_INCREF(Py_None); |
|---|
| 3094 | n/a | _res = Py_None; |
|---|
| 3095 | n/a | return _res; |
|---|
| 3096 | n/a | } |
|---|
| 3097 | n/a | |
|---|
| 3098 | n/a | static PyObject *Qd_MacPaintRgn(PyObject *_self, PyObject *_args) |
|---|
| 3099 | n/a | { |
|---|
| 3100 | n/a | PyObject *_res = NULL; |
|---|
| 3101 | n/a | RgnHandle rgn; |
|---|
| 3102 | n/a | #ifndef MacPaintRgn |
|---|
| 3103 | n/a | PyMac_PRECHECK(MacPaintRgn); |
|---|
| 3104 | n/a | #endif |
|---|
| 3105 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3106 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3107 | n/a | return NULL; |
|---|
| 3108 | n/a | MacPaintRgn(rgn); |
|---|
| 3109 | n/a | Py_INCREF(Py_None); |
|---|
| 3110 | n/a | _res = Py_None; |
|---|
| 3111 | n/a | return _res; |
|---|
| 3112 | n/a | } |
|---|
| 3113 | n/a | |
|---|
| 3114 | n/a | static PyObject *Qd_EraseRgn(PyObject *_self, PyObject *_args) |
|---|
| 3115 | n/a | { |
|---|
| 3116 | n/a | PyObject *_res = NULL; |
|---|
| 3117 | n/a | RgnHandle rgn; |
|---|
| 3118 | n/a | #ifndef EraseRgn |
|---|
| 3119 | n/a | PyMac_PRECHECK(EraseRgn); |
|---|
| 3120 | n/a | #endif |
|---|
| 3121 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3122 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3123 | n/a | return NULL; |
|---|
| 3124 | n/a | EraseRgn(rgn); |
|---|
| 3125 | n/a | Py_INCREF(Py_None); |
|---|
| 3126 | n/a | _res = Py_None; |
|---|
| 3127 | n/a | return _res; |
|---|
| 3128 | n/a | } |
|---|
| 3129 | n/a | |
|---|
| 3130 | n/a | static PyObject *Qd_MacInvertRgn(PyObject *_self, PyObject *_args) |
|---|
| 3131 | n/a | { |
|---|
| 3132 | n/a | PyObject *_res = NULL; |
|---|
| 3133 | n/a | RgnHandle rgn; |
|---|
| 3134 | n/a | #ifndef MacInvertRgn |
|---|
| 3135 | n/a | PyMac_PRECHECK(MacInvertRgn); |
|---|
| 3136 | n/a | #endif |
|---|
| 3137 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3138 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3139 | n/a | return NULL; |
|---|
| 3140 | n/a | MacInvertRgn(rgn); |
|---|
| 3141 | n/a | Py_INCREF(Py_None); |
|---|
| 3142 | n/a | _res = Py_None; |
|---|
| 3143 | n/a | return _res; |
|---|
| 3144 | n/a | } |
|---|
| 3145 | n/a | |
|---|
| 3146 | n/a | static PyObject *Qd_MacFillRgn(PyObject *_self, PyObject *_args) |
|---|
| 3147 | n/a | { |
|---|
| 3148 | n/a | PyObject *_res = NULL; |
|---|
| 3149 | n/a | RgnHandle rgn; |
|---|
| 3150 | n/a | Pattern *pat__in__; |
|---|
| 3151 | n/a | int pat__in_len__; |
|---|
| 3152 | n/a | #ifndef MacFillRgn |
|---|
| 3153 | n/a | PyMac_PRECHECK(MacFillRgn); |
|---|
| 3154 | n/a | #endif |
|---|
| 3155 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 3156 | n/a | ResObj_Convert, &rgn, |
|---|
| 3157 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 3158 | n/a | return NULL; |
|---|
| 3159 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 3160 | n/a | { |
|---|
| 3161 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 3162 | n/a | goto pat__error__; |
|---|
| 3163 | n/a | } |
|---|
| 3164 | n/a | MacFillRgn(rgn, |
|---|
| 3165 | n/a | pat__in__); |
|---|
| 3166 | n/a | Py_INCREF(Py_None); |
|---|
| 3167 | n/a | _res = Py_None; |
|---|
| 3168 | n/a | pat__error__: ; |
|---|
| 3169 | n/a | return _res; |
|---|
| 3170 | n/a | } |
|---|
| 3171 | n/a | |
|---|
| 3172 | n/a | static PyObject *Qd_ScrollRect(PyObject *_self, PyObject *_args) |
|---|
| 3173 | n/a | { |
|---|
| 3174 | n/a | PyObject *_res = NULL; |
|---|
| 3175 | n/a | Rect r; |
|---|
| 3176 | n/a | short dh; |
|---|
| 3177 | n/a | short dv; |
|---|
| 3178 | n/a | RgnHandle updateRgn; |
|---|
| 3179 | n/a | #ifndef ScrollRect |
|---|
| 3180 | n/a | PyMac_PRECHECK(ScrollRect); |
|---|
| 3181 | n/a | #endif |
|---|
| 3182 | n/a | if (!PyArg_ParseTuple(_args, "O&hhO&", |
|---|
| 3183 | n/a | PyMac_GetRect, &r, |
|---|
| 3184 | n/a | &dh, |
|---|
| 3185 | n/a | &dv, |
|---|
| 3186 | n/a | ResObj_Convert, &updateRgn)) |
|---|
| 3187 | n/a | return NULL; |
|---|
| 3188 | n/a | ScrollRect(&r, |
|---|
| 3189 | n/a | dh, |
|---|
| 3190 | n/a | dv, |
|---|
| 3191 | n/a | updateRgn); |
|---|
| 3192 | n/a | Py_INCREF(Py_None); |
|---|
| 3193 | n/a | _res = Py_None; |
|---|
| 3194 | n/a | return _res; |
|---|
| 3195 | n/a | } |
|---|
| 3196 | n/a | |
|---|
| 3197 | n/a | static PyObject *Qd_CopyBits(PyObject *_self, PyObject *_args) |
|---|
| 3198 | n/a | { |
|---|
| 3199 | n/a | PyObject *_res = NULL; |
|---|
| 3200 | n/a | BitMapPtr srcBits; |
|---|
| 3201 | n/a | BitMapPtr dstBits; |
|---|
| 3202 | n/a | Rect srcRect; |
|---|
| 3203 | n/a | Rect dstRect; |
|---|
| 3204 | n/a | short mode; |
|---|
| 3205 | n/a | RgnHandle maskRgn; |
|---|
| 3206 | n/a | #ifndef CopyBits |
|---|
| 3207 | n/a | PyMac_PRECHECK(CopyBits); |
|---|
| 3208 | n/a | #endif |
|---|
| 3209 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&O&hO&", |
|---|
| 3210 | n/a | BMObj_Convert, &srcBits, |
|---|
| 3211 | n/a | BMObj_Convert, &dstBits, |
|---|
| 3212 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3213 | n/a | PyMac_GetRect, &dstRect, |
|---|
| 3214 | n/a | &mode, |
|---|
| 3215 | n/a | OptResObj_Convert, &maskRgn)) |
|---|
| 3216 | n/a | return NULL; |
|---|
| 3217 | n/a | CopyBits(srcBits, |
|---|
| 3218 | n/a | dstBits, |
|---|
| 3219 | n/a | &srcRect, |
|---|
| 3220 | n/a | &dstRect, |
|---|
| 3221 | n/a | mode, |
|---|
| 3222 | n/a | maskRgn); |
|---|
| 3223 | n/a | Py_INCREF(Py_None); |
|---|
| 3224 | n/a | _res = Py_None; |
|---|
| 3225 | n/a | return _res; |
|---|
| 3226 | n/a | } |
|---|
| 3227 | n/a | |
|---|
| 3228 | n/a | static PyObject *Qd_CopyMask(PyObject *_self, PyObject *_args) |
|---|
| 3229 | n/a | { |
|---|
| 3230 | n/a | PyObject *_res = NULL; |
|---|
| 3231 | n/a | BitMapPtr srcBits; |
|---|
| 3232 | n/a | BitMapPtr maskBits; |
|---|
| 3233 | n/a | BitMapPtr dstBits; |
|---|
| 3234 | n/a | Rect srcRect; |
|---|
| 3235 | n/a | Rect maskRect; |
|---|
| 3236 | n/a | Rect dstRect; |
|---|
| 3237 | n/a | #ifndef CopyMask |
|---|
| 3238 | n/a | PyMac_PRECHECK(CopyMask); |
|---|
| 3239 | n/a | #endif |
|---|
| 3240 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&", |
|---|
| 3241 | n/a | BMObj_Convert, &srcBits, |
|---|
| 3242 | n/a | BMObj_Convert, &maskBits, |
|---|
| 3243 | n/a | BMObj_Convert, &dstBits, |
|---|
| 3244 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3245 | n/a | PyMac_GetRect, &maskRect, |
|---|
| 3246 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3247 | n/a | return NULL; |
|---|
| 3248 | n/a | CopyMask(srcBits, |
|---|
| 3249 | n/a | maskBits, |
|---|
| 3250 | n/a | dstBits, |
|---|
| 3251 | n/a | &srcRect, |
|---|
| 3252 | n/a | &maskRect, |
|---|
| 3253 | n/a | &dstRect); |
|---|
| 3254 | n/a | Py_INCREF(Py_None); |
|---|
| 3255 | n/a | _res = Py_None; |
|---|
| 3256 | n/a | return _res; |
|---|
| 3257 | n/a | } |
|---|
| 3258 | n/a | |
|---|
| 3259 | n/a | static PyObject *Qd_OpenPicture(PyObject *_self, PyObject *_args) |
|---|
| 3260 | n/a | { |
|---|
| 3261 | n/a | PyObject *_res = NULL; |
|---|
| 3262 | n/a | PicHandle _rv; |
|---|
| 3263 | n/a | Rect picFrame; |
|---|
| 3264 | n/a | #ifndef OpenPicture |
|---|
| 3265 | n/a | PyMac_PRECHECK(OpenPicture); |
|---|
| 3266 | n/a | #endif |
|---|
| 3267 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3268 | n/a | PyMac_GetRect, &picFrame)) |
|---|
| 3269 | n/a | return NULL; |
|---|
| 3270 | n/a | _rv = OpenPicture(&picFrame); |
|---|
| 3271 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3272 | n/a | ResObj_New, _rv); |
|---|
| 3273 | n/a | return _res; |
|---|
| 3274 | n/a | } |
|---|
| 3275 | n/a | |
|---|
| 3276 | n/a | static PyObject *Qd_PicComment(PyObject *_self, PyObject *_args) |
|---|
| 3277 | n/a | { |
|---|
| 3278 | n/a | PyObject *_res = NULL; |
|---|
| 3279 | n/a | short kind; |
|---|
| 3280 | n/a | short dataSize; |
|---|
| 3281 | n/a | Handle dataHandle; |
|---|
| 3282 | n/a | #ifndef PicComment |
|---|
| 3283 | n/a | PyMac_PRECHECK(PicComment); |
|---|
| 3284 | n/a | #endif |
|---|
| 3285 | n/a | if (!PyArg_ParseTuple(_args, "hhO&", |
|---|
| 3286 | n/a | &kind, |
|---|
| 3287 | n/a | &dataSize, |
|---|
| 3288 | n/a | ResObj_Convert, &dataHandle)) |
|---|
| 3289 | n/a | return NULL; |
|---|
| 3290 | n/a | PicComment(kind, |
|---|
| 3291 | n/a | dataSize, |
|---|
| 3292 | n/a | dataHandle); |
|---|
| 3293 | n/a | Py_INCREF(Py_None); |
|---|
| 3294 | n/a | _res = Py_None; |
|---|
| 3295 | n/a | return _res; |
|---|
| 3296 | n/a | } |
|---|
| 3297 | n/a | |
|---|
| 3298 | n/a | static PyObject *Qd_ClosePicture(PyObject *_self, PyObject *_args) |
|---|
| 3299 | n/a | { |
|---|
| 3300 | n/a | PyObject *_res = NULL; |
|---|
| 3301 | n/a | #ifndef ClosePicture |
|---|
| 3302 | n/a | PyMac_PRECHECK(ClosePicture); |
|---|
| 3303 | n/a | #endif |
|---|
| 3304 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3305 | n/a | return NULL; |
|---|
| 3306 | n/a | ClosePicture(); |
|---|
| 3307 | n/a | Py_INCREF(Py_None); |
|---|
| 3308 | n/a | _res = Py_None; |
|---|
| 3309 | n/a | return _res; |
|---|
| 3310 | n/a | } |
|---|
| 3311 | n/a | |
|---|
| 3312 | n/a | static PyObject *Qd_DrawPicture(PyObject *_self, PyObject *_args) |
|---|
| 3313 | n/a | { |
|---|
| 3314 | n/a | PyObject *_res = NULL; |
|---|
| 3315 | n/a | PicHandle myPicture; |
|---|
| 3316 | n/a | Rect dstRect; |
|---|
| 3317 | n/a | #ifndef DrawPicture |
|---|
| 3318 | n/a | PyMac_PRECHECK(DrawPicture); |
|---|
| 3319 | n/a | #endif |
|---|
| 3320 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3321 | n/a | ResObj_Convert, &myPicture, |
|---|
| 3322 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3323 | n/a | return NULL; |
|---|
| 3324 | n/a | DrawPicture(myPicture, |
|---|
| 3325 | n/a | &dstRect); |
|---|
| 3326 | n/a | Py_INCREF(Py_None); |
|---|
| 3327 | n/a | _res = Py_None; |
|---|
| 3328 | n/a | return _res; |
|---|
| 3329 | n/a | } |
|---|
| 3330 | n/a | |
|---|
| 3331 | n/a | static PyObject *Qd_KillPicture(PyObject *_self, PyObject *_args) |
|---|
| 3332 | n/a | { |
|---|
| 3333 | n/a | PyObject *_res = NULL; |
|---|
| 3334 | n/a | PicHandle myPicture; |
|---|
| 3335 | n/a | #ifndef KillPicture |
|---|
| 3336 | n/a | PyMac_PRECHECK(KillPicture); |
|---|
| 3337 | n/a | #endif |
|---|
| 3338 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3339 | n/a | ResObj_Convert, &myPicture)) |
|---|
| 3340 | n/a | return NULL; |
|---|
| 3341 | n/a | KillPicture(myPicture); |
|---|
| 3342 | n/a | Py_INCREF(Py_None); |
|---|
| 3343 | n/a | _res = Py_None; |
|---|
| 3344 | n/a | return _res; |
|---|
| 3345 | n/a | } |
|---|
| 3346 | n/a | |
|---|
| 3347 | n/a | static PyObject *Qd_OpenPoly(PyObject *_self, PyObject *_args) |
|---|
| 3348 | n/a | { |
|---|
| 3349 | n/a | PyObject *_res = NULL; |
|---|
| 3350 | n/a | PolyHandle _rv; |
|---|
| 3351 | n/a | #ifndef OpenPoly |
|---|
| 3352 | n/a | PyMac_PRECHECK(OpenPoly); |
|---|
| 3353 | n/a | #endif |
|---|
| 3354 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3355 | n/a | return NULL; |
|---|
| 3356 | n/a | _rv = OpenPoly(); |
|---|
| 3357 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3358 | n/a | ResObj_New, _rv); |
|---|
| 3359 | n/a | return _res; |
|---|
| 3360 | n/a | } |
|---|
| 3361 | n/a | |
|---|
| 3362 | n/a | static PyObject *Qd_ClosePoly(PyObject *_self, PyObject *_args) |
|---|
| 3363 | n/a | { |
|---|
| 3364 | n/a | PyObject *_res = NULL; |
|---|
| 3365 | n/a | #ifndef ClosePoly |
|---|
| 3366 | n/a | PyMac_PRECHECK(ClosePoly); |
|---|
| 3367 | n/a | #endif |
|---|
| 3368 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3369 | n/a | return NULL; |
|---|
| 3370 | n/a | ClosePoly(); |
|---|
| 3371 | n/a | Py_INCREF(Py_None); |
|---|
| 3372 | n/a | _res = Py_None; |
|---|
| 3373 | n/a | return _res; |
|---|
| 3374 | n/a | } |
|---|
| 3375 | n/a | |
|---|
| 3376 | n/a | static PyObject *Qd_KillPoly(PyObject *_self, PyObject *_args) |
|---|
| 3377 | n/a | { |
|---|
| 3378 | n/a | PyObject *_res = NULL; |
|---|
| 3379 | n/a | PolyHandle poly; |
|---|
| 3380 | n/a | #ifndef KillPoly |
|---|
| 3381 | n/a | PyMac_PRECHECK(KillPoly); |
|---|
| 3382 | n/a | #endif |
|---|
| 3383 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3384 | n/a | ResObj_Convert, &poly)) |
|---|
| 3385 | n/a | return NULL; |
|---|
| 3386 | n/a | KillPoly(poly); |
|---|
| 3387 | n/a | Py_INCREF(Py_None); |
|---|
| 3388 | n/a | _res = Py_None; |
|---|
| 3389 | n/a | return _res; |
|---|
| 3390 | n/a | } |
|---|
| 3391 | n/a | |
|---|
| 3392 | n/a | static PyObject *Qd_OffsetPoly(PyObject *_self, PyObject *_args) |
|---|
| 3393 | n/a | { |
|---|
| 3394 | n/a | PyObject *_res = NULL; |
|---|
| 3395 | n/a | PolyHandle poly; |
|---|
| 3396 | n/a | short dh; |
|---|
| 3397 | n/a | short dv; |
|---|
| 3398 | n/a | #ifndef OffsetPoly |
|---|
| 3399 | n/a | PyMac_PRECHECK(OffsetPoly); |
|---|
| 3400 | n/a | #endif |
|---|
| 3401 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 3402 | n/a | ResObj_Convert, &poly, |
|---|
| 3403 | n/a | &dh, |
|---|
| 3404 | n/a | &dv)) |
|---|
| 3405 | n/a | return NULL; |
|---|
| 3406 | n/a | OffsetPoly(poly, |
|---|
| 3407 | n/a | dh, |
|---|
| 3408 | n/a | dv); |
|---|
| 3409 | n/a | Py_INCREF(Py_None); |
|---|
| 3410 | n/a | _res = Py_None; |
|---|
| 3411 | n/a | return _res; |
|---|
| 3412 | n/a | } |
|---|
| 3413 | n/a | |
|---|
| 3414 | n/a | static PyObject *Qd_FramePoly(PyObject *_self, PyObject *_args) |
|---|
| 3415 | n/a | { |
|---|
| 3416 | n/a | PyObject *_res = NULL; |
|---|
| 3417 | n/a | PolyHandle poly; |
|---|
| 3418 | n/a | #ifndef FramePoly |
|---|
| 3419 | n/a | PyMac_PRECHECK(FramePoly); |
|---|
| 3420 | n/a | #endif |
|---|
| 3421 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3422 | n/a | ResObj_Convert, &poly)) |
|---|
| 3423 | n/a | return NULL; |
|---|
| 3424 | n/a | FramePoly(poly); |
|---|
| 3425 | n/a | Py_INCREF(Py_None); |
|---|
| 3426 | n/a | _res = Py_None; |
|---|
| 3427 | n/a | return _res; |
|---|
| 3428 | n/a | } |
|---|
| 3429 | n/a | |
|---|
| 3430 | n/a | static PyObject *Qd_PaintPoly(PyObject *_self, PyObject *_args) |
|---|
| 3431 | n/a | { |
|---|
| 3432 | n/a | PyObject *_res = NULL; |
|---|
| 3433 | n/a | PolyHandle poly; |
|---|
| 3434 | n/a | #ifndef PaintPoly |
|---|
| 3435 | n/a | PyMac_PRECHECK(PaintPoly); |
|---|
| 3436 | n/a | #endif |
|---|
| 3437 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3438 | n/a | ResObj_Convert, &poly)) |
|---|
| 3439 | n/a | return NULL; |
|---|
| 3440 | n/a | PaintPoly(poly); |
|---|
| 3441 | n/a | Py_INCREF(Py_None); |
|---|
| 3442 | n/a | _res = Py_None; |
|---|
| 3443 | n/a | return _res; |
|---|
| 3444 | n/a | } |
|---|
| 3445 | n/a | |
|---|
| 3446 | n/a | static PyObject *Qd_ErasePoly(PyObject *_self, PyObject *_args) |
|---|
| 3447 | n/a | { |
|---|
| 3448 | n/a | PyObject *_res = NULL; |
|---|
| 3449 | n/a | PolyHandle poly; |
|---|
| 3450 | n/a | #ifndef ErasePoly |
|---|
| 3451 | n/a | PyMac_PRECHECK(ErasePoly); |
|---|
| 3452 | n/a | #endif |
|---|
| 3453 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3454 | n/a | ResObj_Convert, &poly)) |
|---|
| 3455 | n/a | return NULL; |
|---|
| 3456 | n/a | ErasePoly(poly); |
|---|
| 3457 | n/a | Py_INCREF(Py_None); |
|---|
| 3458 | n/a | _res = Py_None; |
|---|
| 3459 | n/a | return _res; |
|---|
| 3460 | n/a | } |
|---|
| 3461 | n/a | |
|---|
| 3462 | n/a | static PyObject *Qd_InvertPoly(PyObject *_self, PyObject *_args) |
|---|
| 3463 | n/a | { |
|---|
| 3464 | n/a | PyObject *_res = NULL; |
|---|
| 3465 | n/a | PolyHandle poly; |
|---|
| 3466 | n/a | #ifndef InvertPoly |
|---|
| 3467 | n/a | PyMac_PRECHECK(InvertPoly); |
|---|
| 3468 | n/a | #endif |
|---|
| 3469 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3470 | n/a | ResObj_Convert, &poly)) |
|---|
| 3471 | n/a | return NULL; |
|---|
| 3472 | n/a | InvertPoly(poly); |
|---|
| 3473 | n/a | Py_INCREF(Py_None); |
|---|
| 3474 | n/a | _res = Py_None; |
|---|
| 3475 | n/a | return _res; |
|---|
| 3476 | n/a | } |
|---|
| 3477 | n/a | |
|---|
| 3478 | n/a | static PyObject *Qd_FillPoly(PyObject *_self, PyObject *_args) |
|---|
| 3479 | n/a | { |
|---|
| 3480 | n/a | PyObject *_res = NULL; |
|---|
| 3481 | n/a | PolyHandle poly; |
|---|
| 3482 | n/a | Pattern *pat__in__; |
|---|
| 3483 | n/a | int pat__in_len__; |
|---|
| 3484 | n/a | #ifndef FillPoly |
|---|
| 3485 | n/a | PyMac_PRECHECK(FillPoly); |
|---|
| 3486 | n/a | #endif |
|---|
| 3487 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 3488 | n/a | ResObj_Convert, &poly, |
|---|
| 3489 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 3490 | n/a | return NULL; |
|---|
| 3491 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 3492 | n/a | { |
|---|
| 3493 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 3494 | n/a | goto pat__error__; |
|---|
| 3495 | n/a | } |
|---|
| 3496 | n/a | FillPoly(poly, |
|---|
| 3497 | n/a | pat__in__); |
|---|
| 3498 | n/a | Py_INCREF(Py_None); |
|---|
| 3499 | n/a | _res = Py_None; |
|---|
| 3500 | n/a | pat__error__: ; |
|---|
| 3501 | n/a | return _res; |
|---|
| 3502 | n/a | } |
|---|
| 3503 | n/a | |
|---|
| 3504 | n/a | static PyObject *Qd_SetPt(PyObject *_self, PyObject *_args) |
|---|
| 3505 | n/a | { |
|---|
| 3506 | n/a | PyObject *_res = NULL; |
|---|
| 3507 | n/a | Point pt; |
|---|
| 3508 | n/a | short h; |
|---|
| 3509 | n/a | short v; |
|---|
| 3510 | n/a | #ifndef SetPt |
|---|
| 3511 | n/a | PyMac_PRECHECK(SetPt); |
|---|
| 3512 | n/a | #endif |
|---|
| 3513 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 3514 | n/a | &h, |
|---|
| 3515 | n/a | &v)) |
|---|
| 3516 | n/a | return NULL; |
|---|
| 3517 | n/a | SetPt(&pt, |
|---|
| 3518 | n/a | h, |
|---|
| 3519 | n/a | v); |
|---|
| 3520 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3521 | n/a | PyMac_BuildPoint, pt); |
|---|
| 3522 | n/a | return _res; |
|---|
| 3523 | n/a | } |
|---|
| 3524 | n/a | |
|---|
| 3525 | n/a | static PyObject *Qd_LocalToGlobal(PyObject *_self, PyObject *_args) |
|---|
| 3526 | n/a | { |
|---|
| 3527 | n/a | PyObject *_res = NULL; |
|---|
| 3528 | n/a | Point pt; |
|---|
| 3529 | n/a | #ifndef LocalToGlobal |
|---|
| 3530 | n/a | PyMac_PRECHECK(LocalToGlobal); |
|---|
| 3531 | n/a | #endif |
|---|
| 3532 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3533 | n/a | PyMac_GetPoint, &pt)) |
|---|
| 3534 | n/a | return NULL; |
|---|
| 3535 | n/a | LocalToGlobal(&pt); |
|---|
| 3536 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3537 | n/a | PyMac_BuildPoint, pt); |
|---|
| 3538 | n/a | return _res; |
|---|
| 3539 | n/a | } |
|---|
| 3540 | n/a | |
|---|
| 3541 | n/a | static PyObject *Qd_GlobalToLocal(PyObject *_self, PyObject *_args) |
|---|
| 3542 | n/a | { |
|---|
| 3543 | n/a | PyObject *_res = NULL; |
|---|
| 3544 | n/a | Point pt; |
|---|
| 3545 | n/a | #ifndef GlobalToLocal |
|---|
| 3546 | n/a | PyMac_PRECHECK(GlobalToLocal); |
|---|
| 3547 | n/a | #endif |
|---|
| 3548 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3549 | n/a | PyMac_GetPoint, &pt)) |
|---|
| 3550 | n/a | return NULL; |
|---|
| 3551 | n/a | GlobalToLocal(&pt); |
|---|
| 3552 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3553 | n/a | PyMac_BuildPoint, pt); |
|---|
| 3554 | n/a | return _res; |
|---|
| 3555 | n/a | } |
|---|
| 3556 | n/a | |
|---|
| 3557 | n/a | static PyObject *Qd_Random(PyObject *_self, PyObject *_args) |
|---|
| 3558 | n/a | { |
|---|
| 3559 | n/a | PyObject *_res = NULL; |
|---|
| 3560 | n/a | short _rv; |
|---|
| 3561 | n/a | #ifndef Random |
|---|
| 3562 | n/a | PyMac_PRECHECK(Random); |
|---|
| 3563 | n/a | #endif |
|---|
| 3564 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3565 | n/a | return NULL; |
|---|
| 3566 | n/a | _rv = Random(); |
|---|
| 3567 | n/a | _res = Py_BuildValue("h", |
|---|
| 3568 | n/a | _rv); |
|---|
| 3569 | n/a | return _res; |
|---|
| 3570 | n/a | } |
|---|
| 3571 | n/a | |
|---|
| 3572 | n/a | static PyObject *Qd_MacGetPixel(PyObject *_self, PyObject *_args) |
|---|
| 3573 | n/a | { |
|---|
| 3574 | n/a | PyObject *_res = NULL; |
|---|
| 3575 | n/a | Boolean _rv; |
|---|
| 3576 | n/a | short h; |
|---|
| 3577 | n/a | short v; |
|---|
| 3578 | n/a | #ifndef MacGetPixel |
|---|
| 3579 | n/a | PyMac_PRECHECK(MacGetPixel); |
|---|
| 3580 | n/a | #endif |
|---|
| 3581 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 3582 | n/a | &h, |
|---|
| 3583 | n/a | &v)) |
|---|
| 3584 | n/a | return NULL; |
|---|
| 3585 | n/a | _rv = MacGetPixel(h, |
|---|
| 3586 | n/a | v); |
|---|
| 3587 | n/a | _res = Py_BuildValue("b", |
|---|
| 3588 | n/a | _rv); |
|---|
| 3589 | n/a | return _res; |
|---|
| 3590 | n/a | } |
|---|
| 3591 | n/a | |
|---|
| 3592 | n/a | static PyObject *Qd_ScalePt(PyObject *_self, PyObject *_args) |
|---|
| 3593 | n/a | { |
|---|
| 3594 | n/a | PyObject *_res = NULL; |
|---|
| 3595 | n/a | Point pt; |
|---|
| 3596 | n/a | Rect srcRect; |
|---|
| 3597 | n/a | Rect dstRect; |
|---|
| 3598 | n/a | #ifndef ScalePt |
|---|
| 3599 | n/a | PyMac_PRECHECK(ScalePt); |
|---|
| 3600 | n/a | #endif |
|---|
| 3601 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3602 | n/a | PyMac_GetPoint, &pt, |
|---|
| 3603 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3604 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3605 | n/a | return NULL; |
|---|
| 3606 | n/a | ScalePt(&pt, |
|---|
| 3607 | n/a | &srcRect, |
|---|
| 3608 | n/a | &dstRect); |
|---|
| 3609 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3610 | n/a | PyMac_BuildPoint, pt); |
|---|
| 3611 | n/a | return _res; |
|---|
| 3612 | n/a | } |
|---|
| 3613 | n/a | |
|---|
| 3614 | n/a | static PyObject *Qd_MapPt(PyObject *_self, PyObject *_args) |
|---|
| 3615 | n/a | { |
|---|
| 3616 | n/a | PyObject *_res = NULL; |
|---|
| 3617 | n/a | Point pt; |
|---|
| 3618 | n/a | Rect srcRect; |
|---|
| 3619 | n/a | Rect dstRect; |
|---|
| 3620 | n/a | #ifndef MapPt |
|---|
| 3621 | n/a | PyMac_PRECHECK(MapPt); |
|---|
| 3622 | n/a | #endif |
|---|
| 3623 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3624 | n/a | PyMac_GetPoint, &pt, |
|---|
| 3625 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3626 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3627 | n/a | return NULL; |
|---|
| 3628 | n/a | MapPt(&pt, |
|---|
| 3629 | n/a | &srcRect, |
|---|
| 3630 | n/a | &dstRect); |
|---|
| 3631 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3632 | n/a | PyMac_BuildPoint, pt); |
|---|
| 3633 | n/a | return _res; |
|---|
| 3634 | n/a | } |
|---|
| 3635 | n/a | |
|---|
| 3636 | n/a | static PyObject *Qd_MapRect(PyObject *_self, PyObject *_args) |
|---|
| 3637 | n/a | { |
|---|
| 3638 | n/a | PyObject *_res = NULL; |
|---|
| 3639 | n/a | Rect r; |
|---|
| 3640 | n/a | Rect srcRect; |
|---|
| 3641 | n/a | Rect dstRect; |
|---|
| 3642 | n/a | #ifndef MapRect |
|---|
| 3643 | n/a | PyMac_PRECHECK(MapRect); |
|---|
| 3644 | n/a | #endif |
|---|
| 3645 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3646 | n/a | PyMac_GetRect, &r, |
|---|
| 3647 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3648 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3649 | n/a | return NULL; |
|---|
| 3650 | n/a | MapRect(&r, |
|---|
| 3651 | n/a | &srcRect, |
|---|
| 3652 | n/a | &dstRect); |
|---|
| 3653 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3654 | n/a | PyMac_BuildRect, &r); |
|---|
| 3655 | n/a | return _res; |
|---|
| 3656 | n/a | } |
|---|
| 3657 | n/a | |
|---|
| 3658 | n/a | static PyObject *Qd_MapRgn(PyObject *_self, PyObject *_args) |
|---|
| 3659 | n/a | { |
|---|
| 3660 | n/a | PyObject *_res = NULL; |
|---|
| 3661 | n/a | RgnHandle rgn; |
|---|
| 3662 | n/a | Rect srcRect; |
|---|
| 3663 | n/a | Rect dstRect; |
|---|
| 3664 | n/a | #ifndef MapRgn |
|---|
| 3665 | n/a | PyMac_PRECHECK(MapRgn); |
|---|
| 3666 | n/a | #endif |
|---|
| 3667 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3668 | n/a | ResObj_Convert, &rgn, |
|---|
| 3669 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3670 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3671 | n/a | return NULL; |
|---|
| 3672 | n/a | MapRgn(rgn, |
|---|
| 3673 | n/a | &srcRect, |
|---|
| 3674 | n/a | &dstRect); |
|---|
| 3675 | n/a | Py_INCREF(Py_None); |
|---|
| 3676 | n/a | _res = Py_None; |
|---|
| 3677 | n/a | return _res; |
|---|
| 3678 | n/a | } |
|---|
| 3679 | n/a | |
|---|
| 3680 | n/a | static PyObject *Qd_MapPoly(PyObject *_self, PyObject *_args) |
|---|
| 3681 | n/a | { |
|---|
| 3682 | n/a | PyObject *_res = NULL; |
|---|
| 3683 | n/a | PolyHandle poly; |
|---|
| 3684 | n/a | Rect srcRect; |
|---|
| 3685 | n/a | Rect dstRect; |
|---|
| 3686 | n/a | #ifndef MapPoly |
|---|
| 3687 | n/a | PyMac_PRECHECK(MapPoly); |
|---|
| 3688 | n/a | #endif |
|---|
| 3689 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 3690 | n/a | ResObj_Convert, &poly, |
|---|
| 3691 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3692 | n/a | PyMac_GetRect, &dstRect)) |
|---|
| 3693 | n/a | return NULL; |
|---|
| 3694 | n/a | MapPoly(poly, |
|---|
| 3695 | n/a | &srcRect, |
|---|
| 3696 | n/a | &dstRect); |
|---|
| 3697 | n/a | Py_INCREF(Py_None); |
|---|
| 3698 | n/a | _res = Py_None; |
|---|
| 3699 | n/a | return _res; |
|---|
| 3700 | n/a | } |
|---|
| 3701 | n/a | |
|---|
| 3702 | n/a | static PyObject *Qd_StdBits(PyObject *_self, PyObject *_args) |
|---|
| 3703 | n/a | { |
|---|
| 3704 | n/a | PyObject *_res = NULL; |
|---|
| 3705 | n/a | BitMapPtr srcBits; |
|---|
| 3706 | n/a | Rect srcRect; |
|---|
| 3707 | n/a | Rect dstRect; |
|---|
| 3708 | n/a | short mode; |
|---|
| 3709 | n/a | RgnHandle maskRgn; |
|---|
| 3710 | n/a | #ifndef StdBits |
|---|
| 3711 | n/a | PyMac_PRECHECK(StdBits); |
|---|
| 3712 | n/a | #endif |
|---|
| 3713 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&hO&", |
|---|
| 3714 | n/a | BMObj_Convert, &srcBits, |
|---|
| 3715 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 3716 | n/a | PyMac_GetRect, &dstRect, |
|---|
| 3717 | n/a | &mode, |
|---|
| 3718 | n/a | OptResObj_Convert, &maskRgn)) |
|---|
| 3719 | n/a | return NULL; |
|---|
| 3720 | n/a | StdBits(srcBits, |
|---|
| 3721 | n/a | &srcRect, |
|---|
| 3722 | n/a | &dstRect, |
|---|
| 3723 | n/a | mode, |
|---|
| 3724 | n/a | maskRgn); |
|---|
| 3725 | n/a | Py_INCREF(Py_None); |
|---|
| 3726 | n/a | _res = Py_None; |
|---|
| 3727 | n/a | return _res; |
|---|
| 3728 | n/a | } |
|---|
| 3729 | n/a | |
|---|
| 3730 | n/a | static PyObject *Qd_AddPt(PyObject *_self, PyObject *_args) |
|---|
| 3731 | n/a | { |
|---|
| 3732 | n/a | PyObject *_res = NULL; |
|---|
| 3733 | n/a | Point src; |
|---|
| 3734 | n/a | Point dst; |
|---|
| 3735 | n/a | #ifndef AddPt |
|---|
| 3736 | n/a | PyMac_PRECHECK(AddPt); |
|---|
| 3737 | n/a | #endif |
|---|
| 3738 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3739 | n/a | PyMac_GetPoint, &src, |
|---|
| 3740 | n/a | PyMac_GetPoint, &dst)) |
|---|
| 3741 | n/a | return NULL; |
|---|
| 3742 | n/a | AddPt(src, |
|---|
| 3743 | n/a | &dst); |
|---|
| 3744 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3745 | n/a | PyMac_BuildPoint, dst); |
|---|
| 3746 | n/a | return _res; |
|---|
| 3747 | n/a | } |
|---|
| 3748 | n/a | |
|---|
| 3749 | n/a | static PyObject *Qd_EqualPt(PyObject *_self, PyObject *_args) |
|---|
| 3750 | n/a | { |
|---|
| 3751 | n/a | PyObject *_res = NULL; |
|---|
| 3752 | n/a | Boolean _rv; |
|---|
| 3753 | n/a | Point pt1; |
|---|
| 3754 | n/a | Point pt2; |
|---|
| 3755 | n/a | #ifndef EqualPt |
|---|
| 3756 | n/a | PyMac_PRECHECK(EqualPt); |
|---|
| 3757 | n/a | #endif |
|---|
| 3758 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3759 | n/a | PyMac_GetPoint, &pt1, |
|---|
| 3760 | n/a | PyMac_GetPoint, &pt2)) |
|---|
| 3761 | n/a | return NULL; |
|---|
| 3762 | n/a | _rv = EqualPt(pt1, |
|---|
| 3763 | n/a | pt2); |
|---|
| 3764 | n/a | _res = Py_BuildValue("b", |
|---|
| 3765 | n/a | _rv); |
|---|
| 3766 | n/a | return _res; |
|---|
| 3767 | n/a | } |
|---|
| 3768 | n/a | |
|---|
| 3769 | n/a | static PyObject *Qd_MacPtInRect(PyObject *_self, PyObject *_args) |
|---|
| 3770 | n/a | { |
|---|
| 3771 | n/a | PyObject *_res = NULL; |
|---|
| 3772 | n/a | Boolean _rv; |
|---|
| 3773 | n/a | Point pt; |
|---|
| 3774 | n/a | Rect r; |
|---|
| 3775 | n/a | #ifndef MacPtInRect |
|---|
| 3776 | n/a | PyMac_PRECHECK(MacPtInRect); |
|---|
| 3777 | n/a | #endif |
|---|
| 3778 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3779 | n/a | PyMac_GetPoint, &pt, |
|---|
| 3780 | n/a | PyMac_GetRect, &r)) |
|---|
| 3781 | n/a | return NULL; |
|---|
| 3782 | n/a | _rv = MacPtInRect(pt, |
|---|
| 3783 | n/a | &r); |
|---|
| 3784 | n/a | _res = Py_BuildValue("b", |
|---|
| 3785 | n/a | _rv); |
|---|
| 3786 | n/a | return _res; |
|---|
| 3787 | n/a | } |
|---|
| 3788 | n/a | |
|---|
| 3789 | n/a | static PyObject *Qd_Pt2Rect(PyObject *_self, PyObject *_args) |
|---|
| 3790 | n/a | { |
|---|
| 3791 | n/a | PyObject *_res = NULL; |
|---|
| 3792 | n/a | Point pt1; |
|---|
| 3793 | n/a | Point pt2; |
|---|
| 3794 | n/a | Rect dstRect; |
|---|
| 3795 | n/a | #ifndef Pt2Rect |
|---|
| 3796 | n/a | PyMac_PRECHECK(Pt2Rect); |
|---|
| 3797 | n/a | #endif |
|---|
| 3798 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3799 | n/a | PyMac_GetPoint, &pt1, |
|---|
| 3800 | n/a | PyMac_GetPoint, &pt2)) |
|---|
| 3801 | n/a | return NULL; |
|---|
| 3802 | n/a | Pt2Rect(pt1, |
|---|
| 3803 | n/a | pt2, |
|---|
| 3804 | n/a | &dstRect); |
|---|
| 3805 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3806 | n/a | PyMac_BuildRect, &dstRect); |
|---|
| 3807 | n/a | return _res; |
|---|
| 3808 | n/a | } |
|---|
| 3809 | n/a | |
|---|
| 3810 | n/a | static PyObject *Qd_PtToAngle(PyObject *_self, PyObject *_args) |
|---|
| 3811 | n/a | { |
|---|
| 3812 | n/a | PyObject *_res = NULL; |
|---|
| 3813 | n/a | Rect r; |
|---|
| 3814 | n/a | Point pt; |
|---|
| 3815 | n/a | short angle; |
|---|
| 3816 | n/a | #ifndef PtToAngle |
|---|
| 3817 | n/a | PyMac_PRECHECK(PtToAngle); |
|---|
| 3818 | n/a | #endif |
|---|
| 3819 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3820 | n/a | PyMac_GetRect, &r, |
|---|
| 3821 | n/a | PyMac_GetPoint, &pt)) |
|---|
| 3822 | n/a | return NULL; |
|---|
| 3823 | n/a | PtToAngle(&r, |
|---|
| 3824 | n/a | pt, |
|---|
| 3825 | n/a | &angle); |
|---|
| 3826 | n/a | _res = Py_BuildValue("h", |
|---|
| 3827 | n/a | angle); |
|---|
| 3828 | n/a | return _res; |
|---|
| 3829 | n/a | } |
|---|
| 3830 | n/a | |
|---|
| 3831 | n/a | static PyObject *Qd_SubPt(PyObject *_self, PyObject *_args) |
|---|
| 3832 | n/a | { |
|---|
| 3833 | n/a | PyObject *_res = NULL; |
|---|
| 3834 | n/a | Point src; |
|---|
| 3835 | n/a | Point dst; |
|---|
| 3836 | n/a | #ifndef SubPt |
|---|
| 3837 | n/a | PyMac_PRECHECK(SubPt); |
|---|
| 3838 | n/a | #endif |
|---|
| 3839 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3840 | n/a | PyMac_GetPoint, &src, |
|---|
| 3841 | n/a | PyMac_GetPoint, &dst)) |
|---|
| 3842 | n/a | return NULL; |
|---|
| 3843 | n/a | SubPt(src, |
|---|
| 3844 | n/a | &dst); |
|---|
| 3845 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3846 | n/a | PyMac_BuildPoint, dst); |
|---|
| 3847 | n/a | return _res; |
|---|
| 3848 | n/a | } |
|---|
| 3849 | n/a | |
|---|
| 3850 | n/a | static PyObject *Qd_PtInRgn(PyObject *_self, PyObject *_args) |
|---|
| 3851 | n/a | { |
|---|
| 3852 | n/a | PyObject *_res = NULL; |
|---|
| 3853 | n/a | Boolean _rv; |
|---|
| 3854 | n/a | Point pt; |
|---|
| 3855 | n/a | RgnHandle rgn; |
|---|
| 3856 | n/a | #ifndef PtInRgn |
|---|
| 3857 | n/a | PyMac_PRECHECK(PtInRgn); |
|---|
| 3858 | n/a | #endif |
|---|
| 3859 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3860 | n/a | PyMac_GetPoint, &pt, |
|---|
| 3861 | n/a | ResObj_Convert, &rgn)) |
|---|
| 3862 | n/a | return NULL; |
|---|
| 3863 | n/a | _rv = PtInRgn(pt, |
|---|
| 3864 | n/a | rgn); |
|---|
| 3865 | n/a | _res = Py_BuildValue("b", |
|---|
| 3866 | n/a | _rv); |
|---|
| 3867 | n/a | return _res; |
|---|
| 3868 | n/a | } |
|---|
| 3869 | n/a | |
|---|
| 3870 | n/a | static PyObject *Qd_NewPixMap(PyObject *_self, PyObject *_args) |
|---|
| 3871 | n/a | { |
|---|
| 3872 | n/a | PyObject *_res = NULL; |
|---|
| 3873 | n/a | PixMapHandle _rv; |
|---|
| 3874 | n/a | #ifndef NewPixMap |
|---|
| 3875 | n/a | PyMac_PRECHECK(NewPixMap); |
|---|
| 3876 | n/a | #endif |
|---|
| 3877 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3878 | n/a | return NULL; |
|---|
| 3879 | n/a | _rv = NewPixMap(); |
|---|
| 3880 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3881 | n/a | ResObj_New, _rv); |
|---|
| 3882 | n/a | return _res; |
|---|
| 3883 | n/a | } |
|---|
| 3884 | n/a | |
|---|
| 3885 | n/a | static PyObject *Qd_DisposePixMap(PyObject *_self, PyObject *_args) |
|---|
| 3886 | n/a | { |
|---|
| 3887 | n/a | PyObject *_res = NULL; |
|---|
| 3888 | n/a | PixMapHandle pm; |
|---|
| 3889 | n/a | #ifndef DisposePixMap |
|---|
| 3890 | n/a | PyMac_PRECHECK(DisposePixMap); |
|---|
| 3891 | n/a | #endif |
|---|
| 3892 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3893 | n/a | ResObj_Convert, &pm)) |
|---|
| 3894 | n/a | return NULL; |
|---|
| 3895 | n/a | DisposePixMap(pm); |
|---|
| 3896 | n/a | Py_INCREF(Py_None); |
|---|
| 3897 | n/a | _res = Py_None; |
|---|
| 3898 | n/a | return _res; |
|---|
| 3899 | n/a | } |
|---|
| 3900 | n/a | |
|---|
| 3901 | n/a | static PyObject *Qd_CopyPixMap(PyObject *_self, PyObject *_args) |
|---|
| 3902 | n/a | { |
|---|
| 3903 | n/a | PyObject *_res = NULL; |
|---|
| 3904 | n/a | PixMapHandle srcPM; |
|---|
| 3905 | n/a | PixMapHandle dstPM; |
|---|
| 3906 | n/a | #ifndef CopyPixMap |
|---|
| 3907 | n/a | PyMac_PRECHECK(CopyPixMap); |
|---|
| 3908 | n/a | #endif |
|---|
| 3909 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3910 | n/a | ResObj_Convert, &srcPM, |
|---|
| 3911 | n/a | ResObj_Convert, &dstPM)) |
|---|
| 3912 | n/a | return NULL; |
|---|
| 3913 | n/a | CopyPixMap(srcPM, |
|---|
| 3914 | n/a | dstPM); |
|---|
| 3915 | n/a | Py_INCREF(Py_None); |
|---|
| 3916 | n/a | _res = Py_None; |
|---|
| 3917 | n/a | return _res; |
|---|
| 3918 | n/a | } |
|---|
| 3919 | n/a | |
|---|
| 3920 | n/a | static PyObject *Qd_NewPixPat(PyObject *_self, PyObject *_args) |
|---|
| 3921 | n/a | { |
|---|
| 3922 | n/a | PyObject *_res = NULL; |
|---|
| 3923 | n/a | PixPatHandle _rv; |
|---|
| 3924 | n/a | #ifndef NewPixPat |
|---|
| 3925 | n/a | PyMac_PRECHECK(NewPixPat); |
|---|
| 3926 | n/a | #endif |
|---|
| 3927 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 3928 | n/a | return NULL; |
|---|
| 3929 | n/a | _rv = NewPixPat(); |
|---|
| 3930 | n/a | _res = Py_BuildValue("O&", |
|---|
| 3931 | n/a | ResObj_New, _rv); |
|---|
| 3932 | n/a | return _res; |
|---|
| 3933 | n/a | } |
|---|
| 3934 | n/a | |
|---|
| 3935 | n/a | static PyObject *Qd_DisposePixPat(PyObject *_self, PyObject *_args) |
|---|
| 3936 | n/a | { |
|---|
| 3937 | n/a | PyObject *_res = NULL; |
|---|
| 3938 | n/a | PixPatHandle pp; |
|---|
| 3939 | n/a | #ifndef DisposePixPat |
|---|
| 3940 | n/a | PyMac_PRECHECK(DisposePixPat); |
|---|
| 3941 | n/a | #endif |
|---|
| 3942 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3943 | n/a | ResObj_Convert, &pp)) |
|---|
| 3944 | n/a | return NULL; |
|---|
| 3945 | n/a | DisposePixPat(pp); |
|---|
| 3946 | n/a | Py_INCREF(Py_None); |
|---|
| 3947 | n/a | _res = Py_None; |
|---|
| 3948 | n/a | return _res; |
|---|
| 3949 | n/a | } |
|---|
| 3950 | n/a | |
|---|
| 3951 | n/a | static PyObject *Qd_CopyPixPat(PyObject *_self, PyObject *_args) |
|---|
| 3952 | n/a | { |
|---|
| 3953 | n/a | PyObject *_res = NULL; |
|---|
| 3954 | n/a | PixPatHandle srcPP; |
|---|
| 3955 | n/a | PixPatHandle dstPP; |
|---|
| 3956 | n/a | #ifndef CopyPixPat |
|---|
| 3957 | n/a | PyMac_PRECHECK(CopyPixPat); |
|---|
| 3958 | n/a | #endif |
|---|
| 3959 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 3960 | n/a | ResObj_Convert, &srcPP, |
|---|
| 3961 | n/a | ResObj_Convert, &dstPP)) |
|---|
| 3962 | n/a | return NULL; |
|---|
| 3963 | n/a | CopyPixPat(srcPP, |
|---|
| 3964 | n/a | dstPP); |
|---|
| 3965 | n/a | Py_INCREF(Py_None); |
|---|
| 3966 | n/a | _res = Py_None; |
|---|
| 3967 | n/a | return _res; |
|---|
| 3968 | n/a | } |
|---|
| 3969 | n/a | |
|---|
| 3970 | n/a | static PyObject *Qd_PenPixPat(PyObject *_self, PyObject *_args) |
|---|
| 3971 | n/a | { |
|---|
| 3972 | n/a | PyObject *_res = NULL; |
|---|
| 3973 | n/a | PixPatHandle pp; |
|---|
| 3974 | n/a | #ifndef PenPixPat |
|---|
| 3975 | n/a | PyMac_PRECHECK(PenPixPat); |
|---|
| 3976 | n/a | #endif |
|---|
| 3977 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3978 | n/a | ResObj_Convert, &pp)) |
|---|
| 3979 | n/a | return NULL; |
|---|
| 3980 | n/a | PenPixPat(pp); |
|---|
| 3981 | n/a | Py_INCREF(Py_None); |
|---|
| 3982 | n/a | _res = Py_None; |
|---|
| 3983 | n/a | return _res; |
|---|
| 3984 | n/a | } |
|---|
| 3985 | n/a | |
|---|
| 3986 | n/a | static PyObject *Qd_BackPixPat(PyObject *_self, PyObject *_args) |
|---|
| 3987 | n/a | { |
|---|
| 3988 | n/a | PyObject *_res = NULL; |
|---|
| 3989 | n/a | PixPatHandle pp; |
|---|
| 3990 | n/a | #ifndef BackPixPat |
|---|
| 3991 | n/a | PyMac_PRECHECK(BackPixPat); |
|---|
| 3992 | n/a | #endif |
|---|
| 3993 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 3994 | n/a | ResObj_Convert, &pp)) |
|---|
| 3995 | n/a | return NULL; |
|---|
| 3996 | n/a | BackPixPat(pp); |
|---|
| 3997 | n/a | Py_INCREF(Py_None); |
|---|
| 3998 | n/a | _res = Py_None; |
|---|
| 3999 | n/a | return _res; |
|---|
| 4000 | n/a | } |
|---|
| 4001 | n/a | |
|---|
| 4002 | n/a | static PyObject *Qd_GetPixPat(PyObject *_self, PyObject *_args) |
|---|
| 4003 | n/a | { |
|---|
| 4004 | n/a | PyObject *_res = NULL; |
|---|
| 4005 | n/a | PixPatHandle _rv; |
|---|
| 4006 | n/a | short patID; |
|---|
| 4007 | n/a | #ifndef GetPixPat |
|---|
| 4008 | n/a | PyMac_PRECHECK(GetPixPat); |
|---|
| 4009 | n/a | #endif |
|---|
| 4010 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4011 | n/a | &patID)) |
|---|
| 4012 | n/a | return NULL; |
|---|
| 4013 | n/a | _rv = GetPixPat(patID); |
|---|
| 4014 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4015 | n/a | ResObj_New, _rv); |
|---|
| 4016 | n/a | return _res; |
|---|
| 4017 | n/a | } |
|---|
| 4018 | n/a | |
|---|
| 4019 | n/a | static PyObject *Qd_MakeRGBPat(PyObject *_self, PyObject *_args) |
|---|
| 4020 | n/a | { |
|---|
| 4021 | n/a | PyObject *_res = NULL; |
|---|
| 4022 | n/a | PixPatHandle pp; |
|---|
| 4023 | n/a | RGBColor myColor; |
|---|
| 4024 | n/a | #ifndef MakeRGBPat |
|---|
| 4025 | n/a | PyMac_PRECHECK(MakeRGBPat); |
|---|
| 4026 | n/a | #endif |
|---|
| 4027 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4028 | n/a | ResObj_Convert, &pp, |
|---|
| 4029 | n/a | QdRGB_Convert, &myColor)) |
|---|
| 4030 | n/a | return NULL; |
|---|
| 4031 | n/a | MakeRGBPat(pp, |
|---|
| 4032 | n/a | &myColor); |
|---|
| 4033 | n/a | Py_INCREF(Py_None); |
|---|
| 4034 | n/a | _res = Py_None; |
|---|
| 4035 | n/a | return _res; |
|---|
| 4036 | n/a | } |
|---|
| 4037 | n/a | |
|---|
| 4038 | n/a | static PyObject *Qd_FillCRect(PyObject *_self, PyObject *_args) |
|---|
| 4039 | n/a | { |
|---|
| 4040 | n/a | PyObject *_res = NULL; |
|---|
| 4041 | n/a | Rect r; |
|---|
| 4042 | n/a | PixPatHandle pp; |
|---|
| 4043 | n/a | #ifndef FillCRect |
|---|
| 4044 | n/a | PyMac_PRECHECK(FillCRect); |
|---|
| 4045 | n/a | #endif |
|---|
| 4046 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4047 | n/a | PyMac_GetRect, &r, |
|---|
| 4048 | n/a | ResObj_Convert, &pp)) |
|---|
| 4049 | n/a | return NULL; |
|---|
| 4050 | n/a | FillCRect(&r, |
|---|
| 4051 | n/a | pp); |
|---|
| 4052 | n/a | Py_INCREF(Py_None); |
|---|
| 4053 | n/a | _res = Py_None; |
|---|
| 4054 | n/a | return _res; |
|---|
| 4055 | n/a | } |
|---|
| 4056 | n/a | |
|---|
| 4057 | n/a | static PyObject *Qd_FillCOval(PyObject *_self, PyObject *_args) |
|---|
| 4058 | n/a | { |
|---|
| 4059 | n/a | PyObject *_res = NULL; |
|---|
| 4060 | n/a | Rect r; |
|---|
| 4061 | n/a | PixPatHandle pp; |
|---|
| 4062 | n/a | #ifndef FillCOval |
|---|
| 4063 | n/a | PyMac_PRECHECK(FillCOval); |
|---|
| 4064 | n/a | #endif |
|---|
| 4065 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4066 | n/a | PyMac_GetRect, &r, |
|---|
| 4067 | n/a | ResObj_Convert, &pp)) |
|---|
| 4068 | n/a | return NULL; |
|---|
| 4069 | n/a | FillCOval(&r, |
|---|
| 4070 | n/a | pp); |
|---|
| 4071 | n/a | Py_INCREF(Py_None); |
|---|
| 4072 | n/a | _res = Py_None; |
|---|
| 4073 | n/a | return _res; |
|---|
| 4074 | n/a | } |
|---|
| 4075 | n/a | |
|---|
| 4076 | n/a | static PyObject *Qd_FillCRoundRect(PyObject *_self, PyObject *_args) |
|---|
| 4077 | n/a | { |
|---|
| 4078 | n/a | PyObject *_res = NULL; |
|---|
| 4079 | n/a | Rect r; |
|---|
| 4080 | n/a | short ovalWidth; |
|---|
| 4081 | n/a | short ovalHeight; |
|---|
| 4082 | n/a | PixPatHandle pp; |
|---|
| 4083 | n/a | #ifndef FillCRoundRect |
|---|
| 4084 | n/a | PyMac_PRECHECK(FillCRoundRect); |
|---|
| 4085 | n/a | #endif |
|---|
| 4086 | n/a | if (!PyArg_ParseTuple(_args, "O&hhO&", |
|---|
| 4087 | n/a | PyMac_GetRect, &r, |
|---|
| 4088 | n/a | &ovalWidth, |
|---|
| 4089 | n/a | &ovalHeight, |
|---|
| 4090 | n/a | ResObj_Convert, &pp)) |
|---|
| 4091 | n/a | return NULL; |
|---|
| 4092 | n/a | FillCRoundRect(&r, |
|---|
| 4093 | n/a | ovalWidth, |
|---|
| 4094 | n/a | ovalHeight, |
|---|
| 4095 | n/a | pp); |
|---|
| 4096 | n/a | Py_INCREF(Py_None); |
|---|
| 4097 | n/a | _res = Py_None; |
|---|
| 4098 | n/a | return _res; |
|---|
| 4099 | n/a | } |
|---|
| 4100 | n/a | |
|---|
| 4101 | n/a | static PyObject *Qd_FillCArc(PyObject *_self, PyObject *_args) |
|---|
| 4102 | n/a | { |
|---|
| 4103 | n/a | PyObject *_res = NULL; |
|---|
| 4104 | n/a | Rect r; |
|---|
| 4105 | n/a | short startAngle; |
|---|
| 4106 | n/a | short arcAngle; |
|---|
| 4107 | n/a | PixPatHandle pp; |
|---|
| 4108 | n/a | #ifndef FillCArc |
|---|
| 4109 | n/a | PyMac_PRECHECK(FillCArc); |
|---|
| 4110 | n/a | #endif |
|---|
| 4111 | n/a | if (!PyArg_ParseTuple(_args, "O&hhO&", |
|---|
| 4112 | n/a | PyMac_GetRect, &r, |
|---|
| 4113 | n/a | &startAngle, |
|---|
| 4114 | n/a | &arcAngle, |
|---|
| 4115 | n/a | ResObj_Convert, &pp)) |
|---|
| 4116 | n/a | return NULL; |
|---|
| 4117 | n/a | FillCArc(&r, |
|---|
| 4118 | n/a | startAngle, |
|---|
| 4119 | n/a | arcAngle, |
|---|
| 4120 | n/a | pp); |
|---|
| 4121 | n/a | Py_INCREF(Py_None); |
|---|
| 4122 | n/a | _res = Py_None; |
|---|
| 4123 | n/a | return _res; |
|---|
| 4124 | n/a | } |
|---|
| 4125 | n/a | |
|---|
| 4126 | n/a | static PyObject *Qd_FillCRgn(PyObject *_self, PyObject *_args) |
|---|
| 4127 | n/a | { |
|---|
| 4128 | n/a | PyObject *_res = NULL; |
|---|
| 4129 | n/a | RgnHandle rgn; |
|---|
| 4130 | n/a | PixPatHandle pp; |
|---|
| 4131 | n/a | #ifndef FillCRgn |
|---|
| 4132 | n/a | PyMac_PRECHECK(FillCRgn); |
|---|
| 4133 | n/a | #endif |
|---|
| 4134 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4135 | n/a | ResObj_Convert, &rgn, |
|---|
| 4136 | n/a | ResObj_Convert, &pp)) |
|---|
| 4137 | n/a | return NULL; |
|---|
| 4138 | n/a | FillCRgn(rgn, |
|---|
| 4139 | n/a | pp); |
|---|
| 4140 | n/a | Py_INCREF(Py_None); |
|---|
| 4141 | n/a | _res = Py_None; |
|---|
| 4142 | n/a | return _res; |
|---|
| 4143 | n/a | } |
|---|
| 4144 | n/a | |
|---|
| 4145 | n/a | static PyObject *Qd_FillCPoly(PyObject *_self, PyObject *_args) |
|---|
| 4146 | n/a | { |
|---|
| 4147 | n/a | PyObject *_res = NULL; |
|---|
| 4148 | n/a | PolyHandle poly; |
|---|
| 4149 | n/a | PixPatHandle pp; |
|---|
| 4150 | n/a | #ifndef FillCPoly |
|---|
| 4151 | n/a | PyMac_PRECHECK(FillCPoly); |
|---|
| 4152 | n/a | #endif |
|---|
| 4153 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4154 | n/a | ResObj_Convert, &poly, |
|---|
| 4155 | n/a | ResObj_Convert, &pp)) |
|---|
| 4156 | n/a | return NULL; |
|---|
| 4157 | n/a | FillCPoly(poly, |
|---|
| 4158 | n/a | pp); |
|---|
| 4159 | n/a | Py_INCREF(Py_None); |
|---|
| 4160 | n/a | _res = Py_None; |
|---|
| 4161 | n/a | return _res; |
|---|
| 4162 | n/a | } |
|---|
| 4163 | n/a | |
|---|
| 4164 | n/a | static PyObject *Qd_RGBForeColor(PyObject *_self, PyObject *_args) |
|---|
| 4165 | n/a | { |
|---|
| 4166 | n/a | PyObject *_res = NULL; |
|---|
| 4167 | n/a | RGBColor color; |
|---|
| 4168 | n/a | #ifndef RGBForeColor |
|---|
| 4169 | n/a | PyMac_PRECHECK(RGBForeColor); |
|---|
| 4170 | n/a | #endif |
|---|
| 4171 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4172 | n/a | QdRGB_Convert, &color)) |
|---|
| 4173 | n/a | return NULL; |
|---|
| 4174 | n/a | RGBForeColor(&color); |
|---|
| 4175 | n/a | Py_INCREF(Py_None); |
|---|
| 4176 | n/a | _res = Py_None; |
|---|
| 4177 | n/a | return _res; |
|---|
| 4178 | n/a | } |
|---|
| 4179 | n/a | |
|---|
| 4180 | n/a | static PyObject *Qd_RGBBackColor(PyObject *_self, PyObject *_args) |
|---|
| 4181 | n/a | { |
|---|
| 4182 | n/a | PyObject *_res = NULL; |
|---|
| 4183 | n/a | RGBColor color; |
|---|
| 4184 | n/a | #ifndef RGBBackColor |
|---|
| 4185 | n/a | PyMac_PRECHECK(RGBBackColor); |
|---|
| 4186 | n/a | #endif |
|---|
| 4187 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4188 | n/a | QdRGB_Convert, &color)) |
|---|
| 4189 | n/a | return NULL; |
|---|
| 4190 | n/a | RGBBackColor(&color); |
|---|
| 4191 | n/a | Py_INCREF(Py_None); |
|---|
| 4192 | n/a | _res = Py_None; |
|---|
| 4193 | n/a | return _res; |
|---|
| 4194 | n/a | } |
|---|
| 4195 | n/a | |
|---|
| 4196 | n/a | static PyObject *Qd_SetCPixel(PyObject *_self, PyObject *_args) |
|---|
| 4197 | n/a | { |
|---|
| 4198 | n/a | PyObject *_res = NULL; |
|---|
| 4199 | n/a | short h; |
|---|
| 4200 | n/a | short v; |
|---|
| 4201 | n/a | RGBColor cPix; |
|---|
| 4202 | n/a | #ifndef SetCPixel |
|---|
| 4203 | n/a | PyMac_PRECHECK(SetCPixel); |
|---|
| 4204 | n/a | #endif |
|---|
| 4205 | n/a | if (!PyArg_ParseTuple(_args, "hhO&", |
|---|
| 4206 | n/a | &h, |
|---|
| 4207 | n/a | &v, |
|---|
| 4208 | n/a | QdRGB_Convert, &cPix)) |
|---|
| 4209 | n/a | return NULL; |
|---|
| 4210 | n/a | SetCPixel(h, |
|---|
| 4211 | n/a | v, |
|---|
| 4212 | n/a | &cPix); |
|---|
| 4213 | n/a | Py_INCREF(Py_None); |
|---|
| 4214 | n/a | _res = Py_None; |
|---|
| 4215 | n/a | return _res; |
|---|
| 4216 | n/a | } |
|---|
| 4217 | n/a | |
|---|
| 4218 | n/a | static PyObject *Qd_SetPortPix(PyObject *_self, PyObject *_args) |
|---|
| 4219 | n/a | { |
|---|
| 4220 | n/a | PyObject *_res = NULL; |
|---|
| 4221 | n/a | PixMapHandle pm; |
|---|
| 4222 | n/a | #ifndef SetPortPix |
|---|
| 4223 | n/a | PyMac_PRECHECK(SetPortPix); |
|---|
| 4224 | n/a | #endif |
|---|
| 4225 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4226 | n/a | ResObj_Convert, &pm)) |
|---|
| 4227 | n/a | return NULL; |
|---|
| 4228 | n/a | SetPortPix(pm); |
|---|
| 4229 | n/a | Py_INCREF(Py_None); |
|---|
| 4230 | n/a | _res = Py_None; |
|---|
| 4231 | n/a | return _res; |
|---|
| 4232 | n/a | } |
|---|
| 4233 | n/a | |
|---|
| 4234 | n/a | static PyObject *Qd_GetCPixel(PyObject *_self, PyObject *_args) |
|---|
| 4235 | n/a | { |
|---|
| 4236 | n/a | PyObject *_res = NULL; |
|---|
| 4237 | n/a | short h; |
|---|
| 4238 | n/a | short v; |
|---|
| 4239 | n/a | RGBColor cPix; |
|---|
| 4240 | n/a | #ifndef GetCPixel |
|---|
| 4241 | n/a | PyMac_PRECHECK(GetCPixel); |
|---|
| 4242 | n/a | #endif |
|---|
| 4243 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 4244 | n/a | &h, |
|---|
| 4245 | n/a | &v)) |
|---|
| 4246 | n/a | return NULL; |
|---|
| 4247 | n/a | GetCPixel(h, |
|---|
| 4248 | n/a | v, |
|---|
| 4249 | n/a | &cPix); |
|---|
| 4250 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4251 | n/a | QdRGB_New, &cPix); |
|---|
| 4252 | n/a | return _res; |
|---|
| 4253 | n/a | } |
|---|
| 4254 | n/a | |
|---|
| 4255 | n/a | static PyObject *Qd_GetForeColor(PyObject *_self, PyObject *_args) |
|---|
| 4256 | n/a | { |
|---|
| 4257 | n/a | PyObject *_res = NULL; |
|---|
| 4258 | n/a | RGBColor color; |
|---|
| 4259 | n/a | #ifndef GetForeColor |
|---|
| 4260 | n/a | PyMac_PRECHECK(GetForeColor); |
|---|
| 4261 | n/a | #endif |
|---|
| 4262 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4263 | n/a | return NULL; |
|---|
| 4264 | n/a | GetForeColor(&color); |
|---|
| 4265 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4266 | n/a | QdRGB_New, &color); |
|---|
| 4267 | n/a | return _res; |
|---|
| 4268 | n/a | } |
|---|
| 4269 | n/a | |
|---|
| 4270 | n/a | static PyObject *Qd_GetBackColor(PyObject *_self, PyObject *_args) |
|---|
| 4271 | n/a | { |
|---|
| 4272 | n/a | PyObject *_res = NULL; |
|---|
| 4273 | n/a | RGBColor color; |
|---|
| 4274 | n/a | #ifndef GetBackColor |
|---|
| 4275 | n/a | PyMac_PRECHECK(GetBackColor); |
|---|
| 4276 | n/a | #endif |
|---|
| 4277 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4278 | n/a | return NULL; |
|---|
| 4279 | n/a | GetBackColor(&color); |
|---|
| 4280 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4281 | n/a | QdRGB_New, &color); |
|---|
| 4282 | n/a | return _res; |
|---|
| 4283 | n/a | } |
|---|
| 4284 | n/a | |
|---|
| 4285 | n/a | static PyObject *Qd_OpColor(PyObject *_self, PyObject *_args) |
|---|
| 4286 | n/a | { |
|---|
| 4287 | n/a | PyObject *_res = NULL; |
|---|
| 4288 | n/a | RGBColor color; |
|---|
| 4289 | n/a | #ifndef OpColor |
|---|
| 4290 | n/a | PyMac_PRECHECK(OpColor); |
|---|
| 4291 | n/a | #endif |
|---|
| 4292 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4293 | n/a | QdRGB_Convert, &color)) |
|---|
| 4294 | n/a | return NULL; |
|---|
| 4295 | n/a | OpColor(&color); |
|---|
| 4296 | n/a | Py_INCREF(Py_None); |
|---|
| 4297 | n/a | _res = Py_None; |
|---|
| 4298 | n/a | return _res; |
|---|
| 4299 | n/a | } |
|---|
| 4300 | n/a | |
|---|
| 4301 | n/a | static PyObject *Qd_HiliteColor(PyObject *_self, PyObject *_args) |
|---|
| 4302 | n/a | { |
|---|
| 4303 | n/a | PyObject *_res = NULL; |
|---|
| 4304 | n/a | RGBColor color; |
|---|
| 4305 | n/a | #ifndef HiliteColor |
|---|
| 4306 | n/a | PyMac_PRECHECK(HiliteColor); |
|---|
| 4307 | n/a | #endif |
|---|
| 4308 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4309 | n/a | QdRGB_Convert, &color)) |
|---|
| 4310 | n/a | return NULL; |
|---|
| 4311 | n/a | HiliteColor(&color); |
|---|
| 4312 | n/a | Py_INCREF(Py_None); |
|---|
| 4313 | n/a | _res = Py_None; |
|---|
| 4314 | n/a | return _res; |
|---|
| 4315 | n/a | } |
|---|
| 4316 | n/a | |
|---|
| 4317 | n/a | static PyObject *Qd_DisposeCTable(PyObject *_self, PyObject *_args) |
|---|
| 4318 | n/a | { |
|---|
| 4319 | n/a | PyObject *_res = NULL; |
|---|
| 4320 | n/a | CTabHandle cTable; |
|---|
| 4321 | n/a | #ifndef DisposeCTable |
|---|
| 4322 | n/a | PyMac_PRECHECK(DisposeCTable); |
|---|
| 4323 | n/a | #endif |
|---|
| 4324 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4325 | n/a | ResObj_Convert, &cTable)) |
|---|
| 4326 | n/a | return NULL; |
|---|
| 4327 | n/a | DisposeCTable(cTable); |
|---|
| 4328 | n/a | Py_INCREF(Py_None); |
|---|
| 4329 | n/a | _res = Py_None; |
|---|
| 4330 | n/a | return _res; |
|---|
| 4331 | n/a | } |
|---|
| 4332 | n/a | |
|---|
| 4333 | n/a | static PyObject *Qd_GetCTable(PyObject *_self, PyObject *_args) |
|---|
| 4334 | n/a | { |
|---|
| 4335 | n/a | PyObject *_res = NULL; |
|---|
| 4336 | n/a | CTabHandle _rv; |
|---|
| 4337 | n/a | short ctID; |
|---|
| 4338 | n/a | #ifndef GetCTable |
|---|
| 4339 | n/a | PyMac_PRECHECK(GetCTable); |
|---|
| 4340 | n/a | #endif |
|---|
| 4341 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4342 | n/a | &ctID)) |
|---|
| 4343 | n/a | return NULL; |
|---|
| 4344 | n/a | _rv = GetCTable(ctID); |
|---|
| 4345 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4346 | n/a | ResObj_New, _rv); |
|---|
| 4347 | n/a | return _res; |
|---|
| 4348 | n/a | } |
|---|
| 4349 | n/a | |
|---|
| 4350 | n/a | static PyObject *Qd_GetCCursor(PyObject *_self, PyObject *_args) |
|---|
| 4351 | n/a | { |
|---|
| 4352 | n/a | PyObject *_res = NULL; |
|---|
| 4353 | n/a | CCrsrHandle _rv; |
|---|
| 4354 | n/a | short crsrID; |
|---|
| 4355 | n/a | #ifndef GetCCursor |
|---|
| 4356 | n/a | PyMac_PRECHECK(GetCCursor); |
|---|
| 4357 | n/a | #endif |
|---|
| 4358 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4359 | n/a | &crsrID)) |
|---|
| 4360 | n/a | return NULL; |
|---|
| 4361 | n/a | _rv = GetCCursor(crsrID); |
|---|
| 4362 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4363 | n/a | ResObj_New, _rv); |
|---|
| 4364 | n/a | return _res; |
|---|
| 4365 | n/a | } |
|---|
| 4366 | n/a | |
|---|
| 4367 | n/a | static PyObject *Qd_SetCCursor(PyObject *_self, PyObject *_args) |
|---|
| 4368 | n/a | { |
|---|
| 4369 | n/a | PyObject *_res = NULL; |
|---|
| 4370 | n/a | CCrsrHandle cCrsr; |
|---|
| 4371 | n/a | #ifndef SetCCursor |
|---|
| 4372 | n/a | PyMac_PRECHECK(SetCCursor); |
|---|
| 4373 | n/a | #endif |
|---|
| 4374 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4375 | n/a | ResObj_Convert, &cCrsr)) |
|---|
| 4376 | n/a | return NULL; |
|---|
| 4377 | n/a | SetCCursor(cCrsr); |
|---|
| 4378 | n/a | Py_INCREF(Py_None); |
|---|
| 4379 | n/a | _res = Py_None; |
|---|
| 4380 | n/a | return _res; |
|---|
| 4381 | n/a | } |
|---|
| 4382 | n/a | |
|---|
| 4383 | n/a | static PyObject *Qd_AllocCursor(PyObject *_self, PyObject *_args) |
|---|
| 4384 | n/a | { |
|---|
| 4385 | n/a | PyObject *_res = NULL; |
|---|
| 4386 | n/a | #ifndef AllocCursor |
|---|
| 4387 | n/a | PyMac_PRECHECK(AllocCursor); |
|---|
| 4388 | n/a | #endif |
|---|
| 4389 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4390 | n/a | return NULL; |
|---|
| 4391 | n/a | AllocCursor(); |
|---|
| 4392 | n/a | Py_INCREF(Py_None); |
|---|
| 4393 | n/a | _res = Py_None; |
|---|
| 4394 | n/a | return _res; |
|---|
| 4395 | n/a | } |
|---|
| 4396 | n/a | |
|---|
| 4397 | n/a | static PyObject *Qd_DisposeCCursor(PyObject *_self, PyObject *_args) |
|---|
| 4398 | n/a | { |
|---|
| 4399 | n/a | PyObject *_res = NULL; |
|---|
| 4400 | n/a | CCrsrHandle cCrsr; |
|---|
| 4401 | n/a | #ifndef DisposeCCursor |
|---|
| 4402 | n/a | PyMac_PRECHECK(DisposeCCursor); |
|---|
| 4403 | n/a | #endif |
|---|
| 4404 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4405 | n/a | ResObj_Convert, &cCrsr)) |
|---|
| 4406 | n/a | return NULL; |
|---|
| 4407 | n/a | DisposeCCursor(cCrsr); |
|---|
| 4408 | n/a | Py_INCREF(Py_None); |
|---|
| 4409 | n/a | _res = Py_None; |
|---|
| 4410 | n/a | return _res; |
|---|
| 4411 | n/a | } |
|---|
| 4412 | n/a | |
|---|
| 4413 | n/a | static PyObject *Qd_GetMaxDevice(PyObject *_self, PyObject *_args) |
|---|
| 4414 | n/a | { |
|---|
| 4415 | n/a | PyObject *_res = NULL; |
|---|
| 4416 | n/a | GDHandle _rv; |
|---|
| 4417 | n/a | Rect globalRect; |
|---|
| 4418 | n/a | #ifndef GetMaxDevice |
|---|
| 4419 | n/a | PyMac_PRECHECK(GetMaxDevice); |
|---|
| 4420 | n/a | #endif |
|---|
| 4421 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4422 | n/a | PyMac_GetRect, &globalRect)) |
|---|
| 4423 | n/a | return NULL; |
|---|
| 4424 | n/a | _rv = GetMaxDevice(&globalRect); |
|---|
| 4425 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4426 | n/a | ResObj_New, _rv); |
|---|
| 4427 | n/a | return _res; |
|---|
| 4428 | n/a | } |
|---|
| 4429 | n/a | |
|---|
| 4430 | n/a | static PyObject *Qd_GetCTSeed(PyObject *_self, PyObject *_args) |
|---|
| 4431 | n/a | { |
|---|
| 4432 | n/a | PyObject *_res = NULL; |
|---|
| 4433 | n/a | long _rv; |
|---|
| 4434 | n/a | #ifndef GetCTSeed |
|---|
| 4435 | n/a | PyMac_PRECHECK(GetCTSeed); |
|---|
| 4436 | n/a | #endif |
|---|
| 4437 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4438 | n/a | return NULL; |
|---|
| 4439 | n/a | _rv = GetCTSeed(); |
|---|
| 4440 | n/a | _res = Py_BuildValue("l", |
|---|
| 4441 | n/a | _rv); |
|---|
| 4442 | n/a | return _res; |
|---|
| 4443 | n/a | } |
|---|
| 4444 | n/a | |
|---|
| 4445 | n/a | static PyObject *Qd_GetDeviceList(PyObject *_self, PyObject *_args) |
|---|
| 4446 | n/a | { |
|---|
| 4447 | n/a | PyObject *_res = NULL; |
|---|
| 4448 | n/a | GDHandle _rv; |
|---|
| 4449 | n/a | #ifndef GetDeviceList |
|---|
| 4450 | n/a | PyMac_PRECHECK(GetDeviceList); |
|---|
| 4451 | n/a | #endif |
|---|
| 4452 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4453 | n/a | return NULL; |
|---|
| 4454 | n/a | _rv = GetDeviceList(); |
|---|
| 4455 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4456 | n/a | ResObj_New, _rv); |
|---|
| 4457 | n/a | return _res; |
|---|
| 4458 | n/a | } |
|---|
| 4459 | n/a | |
|---|
| 4460 | n/a | static PyObject *Qd_GetMainDevice(PyObject *_self, PyObject *_args) |
|---|
| 4461 | n/a | { |
|---|
| 4462 | n/a | PyObject *_res = NULL; |
|---|
| 4463 | n/a | GDHandle _rv; |
|---|
| 4464 | n/a | #ifndef GetMainDevice |
|---|
| 4465 | n/a | PyMac_PRECHECK(GetMainDevice); |
|---|
| 4466 | n/a | #endif |
|---|
| 4467 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4468 | n/a | return NULL; |
|---|
| 4469 | n/a | _rv = GetMainDevice(); |
|---|
| 4470 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4471 | n/a | ResObj_New, _rv); |
|---|
| 4472 | n/a | return _res; |
|---|
| 4473 | n/a | } |
|---|
| 4474 | n/a | |
|---|
| 4475 | n/a | static PyObject *Qd_GetNextDevice(PyObject *_self, PyObject *_args) |
|---|
| 4476 | n/a | { |
|---|
| 4477 | n/a | PyObject *_res = NULL; |
|---|
| 4478 | n/a | GDHandle _rv; |
|---|
| 4479 | n/a | GDHandle curDevice; |
|---|
| 4480 | n/a | #ifndef GetNextDevice |
|---|
| 4481 | n/a | PyMac_PRECHECK(GetNextDevice); |
|---|
| 4482 | n/a | #endif |
|---|
| 4483 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4484 | n/a | ResObj_Convert, &curDevice)) |
|---|
| 4485 | n/a | return NULL; |
|---|
| 4486 | n/a | _rv = GetNextDevice(curDevice); |
|---|
| 4487 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4488 | n/a | ResObj_New, _rv); |
|---|
| 4489 | n/a | return _res; |
|---|
| 4490 | n/a | } |
|---|
| 4491 | n/a | |
|---|
| 4492 | n/a | static PyObject *Qd_TestDeviceAttribute(PyObject *_self, PyObject *_args) |
|---|
| 4493 | n/a | { |
|---|
| 4494 | n/a | PyObject *_res = NULL; |
|---|
| 4495 | n/a | Boolean _rv; |
|---|
| 4496 | n/a | GDHandle gdh; |
|---|
| 4497 | n/a | short attribute; |
|---|
| 4498 | n/a | #ifndef TestDeviceAttribute |
|---|
| 4499 | n/a | PyMac_PRECHECK(TestDeviceAttribute); |
|---|
| 4500 | n/a | #endif |
|---|
| 4501 | n/a | if (!PyArg_ParseTuple(_args, "O&h", |
|---|
| 4502 | n/a | ResObj_Convert, &gdh, |
|---|
| 4503 | n/a | &attribute)) |
|---|
| 4504 | n/a | return NULL; |
|---|
| 4505 | n/a | _rv = TestDeviceAttribute(gdh, |
|---|
| 4506 | n/a | attribute); |
|---|
| 4507 | n/a | _res = Py_BuildValue("b", |
|---|
| 4508 | n/a | _rv); |
|---|
| 4509 | n/a | return _res; |
|---|
| 4510 | n/a | } |
|---|
| 4511 | n/a | |
|---|
| 4512 | n/a | static PyObject *Qd_SetDeviceAttribute(PyObject *_self, PyObject *_args) |
|---|
| 4513 | n/a | { |
|---|
| 4514 | n/a | PyObject *_res = NULL; |
|---|
| 4515 | n/a | GDHandle gdh; |
|---|
| 4516 | n/a | short attribute; |
|---|
| 4517 | n/a | Boolean value; |
|---|
| 4518 | n/a | #ifndef SetDeviceAttribute |
|---|
| 4519 | n/a | PyMac_PRECHECK(SetDeviceAttribute); |
|---|
| 4520 | n/a | #endif |
|---|
| 4521 | n/a | if (!PyArg_ParseTuple(_args, "O&hb", |
|---|
| 4522 | n/a | ResObj_Convert, &gdh, |
|---|
| 4523 | n/a | &attribute, |
|---|
| 4524 | n/a | &value)) |
|---|
| 4525 | n/a | return NULL; |
|---|
| 4526 | n/a | SetDeviceAttribute(gdh, |
|---|
| 4527 | n/a | attribute, |
|---|
| 4528 | n/a | value); |
|---|
| 4529 | n/a | Py_INCREF(Py_None); |
|---|
| 4530 | n/a | _res = Py_None; |
|---|
| 4531 | n/a | return _res; |
|---|
| 4532 | n/a | } |
|---|
| 4533 | n/a | |
|---|
| 4534 | n/a | static PyObject *Qd_InitGDevice(PyObject *_self, PyObject *_args) |
|---|
| 4535 | n/a | { |
|---|
| 4536 | n/a | PyObject *_res = NULL; |
|---|
| 4537 | n/a | short qdRefNum; |
|---|
| 4538 | n/a | long mode; |
|---|
| 4539 | n/a | GDHandle gdh; |
|---|
| 4540 | n/a | #ifndef InitGDevice |
|---|
| 4541 | n/a | PyMac_PRECHECK(InitGDevice); |
|---|
| 4542 | n/a | #endif |
|---|
| 4543 | n/a | if (!PyArg_ParseTuple(_args, "hlO&", |
|---|
| 4544 | n/a | &qdRefNum, |
|---|
| 4545 | n/a | &mode, |
|---|
| 4546 | n/a | ResObj_Convert, &gdh)) |
|---|
| 4547 | n/a | return NULL; |
|---|
| 4548 | n/a | InitGDevice(qdRefNum, |
|---|
| 4549 | n/a | mode, |
|---|
| 4550 | n/a | gdh); |
|---|
| 4551 | n/a | Py_INCREF(Py_None); |
|---|
| 4552 | n/a | _res = Py_None; |
|---|
| 4553 | n/a | return _res; |
|---|
| 4554 | n/a | } |
|---|
| 4555 | n/a | |
|---|
| 4556 | n/a | static PyObject *Qd_NewGDevice(PyObject *_self, PyObject *_args) |
|---|
| 4557 | n/a | { |
|---|
| 4558 | n/a | PyObject *_res = NULL; |
|---|
| 4559 | n/a | GDHandle _rv; |
|---|
| 4560 | n/a | short refNum; |
|---|
| 4561 | n/a | long mode; |
|---|
| 4562 | n/a | #ifndef NewGDevice |
|---|
| 4563 | n/a | PyMac_PRECHECK(NewGDevice); |
|---|
| 4564 | n/a | #endif |
|---|
| 4565 | n/a | if (!PyArg_ParseTuple(_args, "hl", |
|---|
| 4566 | n/a | &refNum, |
|---|
| 4567 | n/a | &mode)) |
|---|
| 4568 | n/a | return NULL; |
|---|
| 4569 | n/a | _rv = NewGDevice(refNum, |
|---|
| 4570 | n/a | mode); |
|---|
| 4571 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4572 | n/a | ResObj_New, _rv); |
|---|
| 4573 | n/a | return _res; |
|---|
| 4574 | n/a | } |
|---|
| 4575 | n/a | |
|---|
| 4576 | n/a | static PyObject *Qd_DisposeGDevice(PyObject *_self, PyObject *_args) |
|---|
| 4577 | n/a | { |
|---|
| 4578 | n/a | PyObject *_res = NULL; |
|---|
| 4579 | n/a | GDHandle gdh; |
|---|
| 4580 | n/a | #ifndef DisposeGDevice |
|---|
| 4581 | n/a | PyMac_PRECHECK(DisposeGDevice); |
|---|
| 4582 | n/a | #endif |
|---|
| 4583 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4584 | n/a | ResObj_Convert, &gdh)) |
|---|
| 4585 | n/a | return NULL; |
|---|
| 4586 | n/a | DisposeGDevice(gdh); |
|---|
| 4587 | n/a | Py_INCREF(Py_None); |
|---|
| 4588 | n/a | _res = Py_None; |
|---|
| 4589 | n/a | return _res; |
|---|
| 4590 | n/a | } |
|---|
| 4591 | n/a | |
|---|
| 4592 | n/a | static PyObject *Qd_SetGDevice(PyObject *_self, PyObject *_args) |
|---|
| 4593 | n/a | { |
|---|
| 4594 | n/a | PyObject *_res = NULL; |
|---|
| 4595 | n/a | GDHandle gd; |
|---|
| 4596 | n/a | #ifndef SetGDevice |
|---|
| 4597 | n/a | PyMac_PRECHECK(SetGDevice); |
|---|
| 4598 | n/a | #endif |
|---|
| 4599 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4600 | n/a | ResObj_Convert, &gd)) |
|---|
| 4601 | n/a | return NULL; |
|---|
| 4602 | n/a | SetGDevice(gd); |
|---|
| 4603 | n/a | Py_INCREF(Py_None); |
|---|
| 4604 | n/a | _res = Py_None; |
|---|
| 4605 | n/a | return _res; |
|---|
| 4606 | n/a | } |
|---|
| 4607 | n/a | |
|---|
| 4608 | n/a | static PyObject *Qd_GetGDevice(PyObject *_self, PyObject *_args) |
|---|
| 4609 | n/a | { |
|---|
| 4610 | n/a | PyObject *_res = NULL; |
|---|
| 4611 | n/a | GDHandle _rv; |
|---|
| 4612 | n/a | #ifndef GetGDevice |
|---|
| 4613 | n/a | PyMac_PRECHECK(GetGDevice); |
|---|
| 4614 | n/a | #endif |
|---|
| 4615 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4616 | n/a | return NULL; |
|---|
| 4617 | n/a | _rv = GetGDevice(); |
|---|
| 4618 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4619 | n/a | ResObj_New, _rv); |
|---|
| 4620 | n/a | return _res; |
|---|
| 4621 | n/a | } |
|---|
| 4622 | n/a | |
|---|
| 4623 | n/a | static PyObject *Qd_Color2Index(PyObject *_self, PyObject *_args) |
|---|
| 4624 | n/a | { |
|---|
| 4625 | n/a | PyObject *_res = NULL; |
|---|
| 4626 | n/a | long _rv; |
|---|
| 4627 | n/a | RGBColor myColor; |
|---|
| 4628 | n/a | #ifndef Color2Index |
|---|
| 4629 | n/a | PyMac_PRECHECK(Color2Index); |
|---|
| 4630 | n/a | #endif |
|---|
| 4631 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4632 | n/a | QdRGB_Convert, &myColor)) |
|---|
| 4633 | n/a | return NULL; |
|---|
| 4634 | n/a | _rv = Color2Index(&myColor); |
|---|
| 4635 | n/a | _res = Py_BuildValue("l", |
|---|
| 4636 | n/a | _rv); |
|---|
| 4637 | n/a | return _res; |
|---|
| 4638 | n/a | } |
|---|
| 4639 | n/a | |
|---|
| 4640 | n/a | static PyObject *Qd_Index2Color(PyObject *_self, PyObject *_args) |
|---|
| 4641 | n/a | { |
|---|
| 4642 | n/a | PyObject *_res = NULL; |
|---|
| 4643 | n/a | long index; |
|---|
| 4644 | n/a | RGBColor aColor; |
|---|
| 4645 | n/a | #ifndef Index2Color |
|---|
| 4646 | n/a | PyMac_PRECHECK(Index2Color); |
|---|
| 4647 | n/a | #endif |
|---|
| 4648 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 4649 | n/a | &index)) |
|---|
| 4650 | n/a | return NULL; |
|---|
| 4651 | n/a | Index2Color(index, |
|---|
| 4652 | n/a | &aColor); |
|---|
| 4653 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4654 | n/a | QdRGB_New, &aColor); |
|---|
| 4655 | n/a | return _res; |
|---|
| 4656 | n/a | } |
|---|
| 4657 | n/a | |
|---|
| 4658 | n/a | static PyObject *Qd_InvertColor(PyObject *_self, PyObject *_args) |
|---|
| 4659 | n/a | { |
|---|
| 4660 | n/a | PyObject *_res = NULL; |
|---|
| 4661 | n/a | RGBColor myColor; |
|---|
| 4662 | n/a | #ifndef InvertColor |
|---|
| 4663 | n/a | PyMac_PRECHECK(InvertColor); |
|---|
| 4664 | n/a | #endif |
|---|
| 4665 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4666 | n/a | return NULL; |
|---|
| 4667 | n/a | InvertColor(&myColor); |
|---|
| 4668 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4669 | n/a | QdRGB_New, &myColor); |
|---|
| 4670 | n/a | return _res; |
|---|
| 4671 | n/a | } |
|---|
| 4672 | n/a | |
|---|
| 4673 | n/a | static PyObject *Qd_RealColor(PyObject *_self, PyObject *_args) |
|---|
| 4674 | n/a | { |
|---|
| 4675 | n/a | PyObject *_res = NULL; |
|---|
| 4676 | n/a | Boolean _rv; |
|---|
| 4677 | n/a | RGBColor color; |
|---|
| 4678 | n/a | #ifndef RealColor |
|---|
| 4679 | n/a | PyMac_PRECHECK(RealColor); |
|---|
| 4680 | n/a | #endif |
|---|
| 4681 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4682 | n/a | QdRGB_Convert, &color)) |
|---|
| 4683 | n/a | return NULL; |
|---|
| 4684 | n/a | _rv = RealColor(&color); |
|---|
| 4685 | n/a | _res = Py_BuildValue("b", |
|---|
| 4686 | n/a | _rv); |
|---|
| 4687 | n/a | return _res; |
|---|
| 4688 | n/a | } |
|---|
| 4689 | n/a | |
|---|
| 4690 | n/a | static PyObject *Qd_GetSubTable(PyObject *_self, PyObject *_args) |
|---|
| 4691 | n/a | { |
|---|
| 4692 | n/a | PyObject *_res = NULL; |
|---|
| 4693 | n/a | CTabHandle myColors; |
|---|
| 4694 | n/a | short iTabRes; |
|---|
| 4695 | n/a | CTabHandle targetTbl; |
|---|
| 4696 | n/a | #ifndef GetSubTable |
|---|
| 4697 | n/a | PyMac_PRECHECK(GetSubTable); |
|---|
| 4698 | n/a | #endif |
|---|
| 4699 | n/a | if (!PyArg_ParseTuple(_args, "O&hO&", |
|---|
| 4700 | n/a | ResObj_Convert, &myColors, |
|---|
| 4701 | n/a | &iTabRes, |
|---|
| 4702 | n/a | ResObj_Convert, &targetTbl)) |
|---|
| 4703 | n/a | return NULL; |
|---|
| 4704 | n/a | GetSubTable(myColors, |
|---|
| 4705 | n/a | iTabRes, |
|---|
| 4706 | n/a | targetTbl); |
|---|
| 4707 | n/a | Py_INCREF(Py_None); |
|---|
| 4708 | n/a | _res = Py_None; |
|---|
| 4709 | n/a | return _res; |
|---|
| 4710 | n/a | } |
|---|
| 4711 | n/a | |
|---|
| 4712 | n/a | static PyObject *Qd_MakeITable(PyObject *_self, PyObject *_args) |
|---|
| 4713 | n/a | { |
|---|
| 4714 | n/a | PyObject *_res = NULL; |
|---|
| 4715 | n/a | CTabHandle cTabH; |
|---|
| 4716 | n/a | ITabHandle iTabH; |
|---|
| 4717 | n/a | short res; |
|---|
| 4718 | n/a | #ifndef MakeITable |
|---|
| 4719 | n/a | PyMac_PRECHECK(MakeITable); |
|---|
| 4720 | n/a | #endif |
|---|
| 4721 | n/a | if (!PyArg_ParseTuple(_args, "O&O&h", |
|---|
| 4722 | n/a | ResObj_Convert, &cTabH, |
|---|
| 4723 | n/a | ResObj_Convert, &iTabH, |
|---|
| 4724 | n/a | &res)) |
|---|
| 4725 | n/a | return NULL; |
|---|
| 4726 | n/a | MakeITable(cTabH, |
|---|
| 4727 | n/a | iTabH, |
|---|
| 4728 | n/a | res); |
|---|
| 4729 | n/a | Py_INCREF(Py_None); |
|---|
| 4730 | n/a | _res = Py_None; |
|---|
| 4731 | n/a | return _res; |
|---|
| 4732 | n/a | } |
|---|
| 4733 | n/a | |
|---|
| 4734 | n/a | static PyObject *Qd_SetClientID(PyObject *_self, PyObject *_args) |
|---|
| 4735 | n/a | { |
|---|
| 4736 | n/a | PyObject *_res = NULL; |
|---|
| 4737 | n/a | short id; |
|---|
| 4738 | n/a | #ifndef SetClientID |
|---|
| 4739 | n/a | PyMac_PRECHECK(SetClientID); |
|---|
| 4740 | n/a | #endif |
|---|
| 4741 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4742 | n/a | &id)) |
|---|
| 4743 | n/a | return NULL; |
|---|
| 4744 | n/a | SetClientID(id); |
|---|
| 4745 | n/a | Py_INCREF(Py_None); |
|---|
| 4746 | n/a | _res = Py_None; |
|---|
| 4747 | n/a | return _res; |
|---|
| 4748 | n/a | } |
|---|
| 4749 | n/a | |
|---|
| 4750 | n/a | static PyObject *Qd_ProtectEntry(PyObject *_self, PyObject *_args) |
|---|
| 4751 | n/a | { |
|---|
| 4752 | n/a | PyObject *_res = NULL; |
|---|
| 4753 | n/a | short index; |
|---|
| 4754 | n/a | Boolean protect; |
|---|
| 4755 | n/a | #ifndef ProtectEntry |
|---|
| 4756 | n/a | PyMac_PRECHECK(ProtectEntry); |
|---|
| 4757 | n/a | #endif |
|---|
| 4758 | n/a | if (!PyArg_ParseTuple(_args, "hb", |
|---|
| 4759 | n/a | &index, |
|---|
| 4760 | n/a | &protect)) |
|---|
| 4761 | n/a | return NULL; |
|---|
| 4762 | n/a | ProtectEntry(index, |
|---|
| 4763 | n/a | protect); |
|---|
| 4764 | n/a | Py_INCREF(Py_None); |
|---|
| 4765 | n/a | _res = Py_None; |
|---|
| 4766 | n/a | return _res; |
|---|
| 4767 | n/a | } |
|---|
| 4768 | n/a | |
|---|
| 4769 | n/a | static PyObject *Qd_ReserveEntry(PyObject *_self, PyObject *_args) |
|---|
| 4770 | n/a | { |
|---|
| 4771 | n/a | PyObject *_res = NULL; |
|---|
| 4772 | n/a | short index; |
|---|
| 4773 | n/a | Boolean reserve; |
|---|
| 4774 | n/a | #ifndef ReserveEntry |
|---|
| 4775 | n/a | PyMac_PRECHECK(ReserveEntry); |
|---|
| 4776 | n/a | #endif |
|---|
| 4777 | n/a | if (!PyArg_ParseTuple(_args, "hb", |
|---|
| 4778 | n/a | &index, |
|---|
| 4779 | n/a | &reserve)) |
|---|
| 4780 | n/a | return NULL; |
|---|
| 4781 | n/a | ReserveEntry(index, |
|---|
| 4782 | n/a | reserve); |
|---|
| 4783 | n/a | Py_INCREF(Py_None); |
|---|
| 4784 | n/a | _res = Py_None; |
|---|
| 4785 | n/a | return _res; |
|---|
| 4786 | n/a | } |
|---|
| 4787 | n/a | |
|---|
| 4788 | n/a | static PyObject *Qd_QDError(PyObject *_self, PyObject *_args) |
|---|
| 4789 | n/a | { |
|---|
| 4790 | n/a | PyObject *_res = NULL; |
|---|
| 4791 | n/a | short _rv; |
|---|
| 4792 | n/a | #ifndef QDError |
|---|
| 4793 | n/a | PyMac_PRECHECK(QDError); |
|---|
| 4794 | n/a | #endif |
|---|
| 4795 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4796 | n/a | return NULL; |
|---|
| 4797 | n/a | _rv = QDError(); |
|---|
| 4798 | n/a | _res = Py_BuildValue("h", |
|---|
| 4799 | n/a | _rv); |
|---|
| 4800 | n/a | return _res; |
|---|
| 4801 | n/a | } |
|---|
| 4802 | n/a | |
|---|
| 4803 | n/a | static PyObject *Qd_CopyDeepMask(PyObject *_self, PyObject *_args) |
|---|
| 4804 | n/a | { |
|---|
| 4805 | n/a | PyObject *_res = NULL; |
|---|
| 4806 | n/a | BitMapPtr srcBits; |
|---|
| 4807 | n/a | BitMapPtr maskBits; |
|---|
| 4808 | n/a | BitMapPtr dstBits; |
|---|
| 4809 | n/a | Rect srcRect; |
|---|
| 4810 | n/a | Rect maskRect; |
|---|
| 4811 | n/a | Rect dstRect; |
|---|
| 4812 | n/a | short mode; |
|---|
| 4813 | n/a | RgnHandle maskRgn; |
|---|
| 4814 | n/a | #ifndef CopyDeepMask |
|---|
| 4815 | n/a | PyMac_PRECHECK(CopyDeepMask); |
|---|
| 4816 | n/a | #endif |
|---|
| 4817 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&hO&", |
|---|
| 4818 | n/a | BMObj_Convert, &srcBits, |
|---|
| 4819 | n/a | BMObj_Convert, &maskBits, |
|---|
| 4820 | n/a | BMObj_Convert, &dstBits, |
|---|
| 4821 | n/a | PyMac_GetRect, &srcRect, |
|---|
| 4822 | n/a | PyMac_GetRect, &maskRect, |
|---|
| 4823 | n/a | PyMac_GetRect, &dstRect, |
|---|
| 4824 | n/a | &mode, |
|---|
| 4825 | n/a | OptResObj_Convert, &maskRgn)) |
|---|
| 4826 | n/a | return NULL; |
|---|
| 4827 | n/a | CopyDeepMask(srcBits, |
|---|
| 4828 | n/a | maskBits, |
|---|
| 4829 | n/a | dstBits, |
|---|
| 4830 | n/a | &srcRect, |
|---|
| 4831 | n/a | &maskRect, |
|---|
| 4832 | n/a | &dstRect, |
|---|
| 4833 | n/a | mode, |
|---|
| 4834 | n/a | maskRgn); |
|---|
| 4835 | n/a | Py_INCREF(Py_None); |
|---|
| 4836 | n/a | _res = Py_None; |
|---|
| 4837 | n/a | return _res; |
|---|
| 4838 | n/a | } |
|---|
| 4839 | n/a | |
|---|
| 4840 | n/a | static PyObject *Qd_GetPattern(PyObject *_self, PyObject *_args) |
|---|
| 4841 | n/a | { |
|---|
| 4842 | n/a | PyObject *_res = NULL; |
|---|
| 4843 | n/a | PatHandle _rv; |
|---|
| 4844 | n/a | short patternID; |
|---|
| 4845 | n/a | #ifndef GetPattern |
|---|
| 4846 | n/a | PyMac_PRECHECK(GetPattern); |
|---|
| 4847 | n/a | #endif |
|---|
| 4848 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4849 | n/a | &patternID)) |
|---|
| 4850 | n/a | return NULL; |
|---|
| 4851 | n/a | _rv = GetPattern(patternID); |
|---|
| 4852 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4853 | n/a | ResObj_New, _rv); |
|---|
| 4854 | n/a | return _res; |
|---|
| 4855 | n/a | } |
|---|
| 4856 | n/a | |
|---|
| 4857 | n/a | static PyObject *Qd_MacGetCursor(PyObject *_self, PyObject *_args) |
|---|
| 4858 | n/a | { |
|---|
| 4859 | n/a | PyObject *_res = NULL; |
|---|
| 4860 | n/a | CursHandle _rv; |
|---|
| 4861 | n/a | short cursorID; |
|---|
| 4862 | n/a | #ifndef MacGetCursor |
|---|
| 4863 | n/a | PyMac_PRECHECK(MacGetCursor); |
|---|
| 4864 | n/a | #endif |
|---|
| 4865 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4866 | n/a | &cursorID)) |
|---|
| 4867 | n/a | return NULL; |
|---|
| 4868 | n/a | _rv = MacGetCursor(cursorID); |
|---|
| 4869 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4870 | n/a | ResObj_New, _rv); |
|---|
| 4871 | n/a | return _res; |
|---|
| 4872 | n/a | } |
|---|
| 4873 | n/a | |
|---|
| 4874 | n/a | static PyObject *Qd_GetPicture(PyObject *_self, PyObject *_args) |
|---|
| 4875 | n/a | { |
|---|
| 4876 | n/a | PyObject *_res = NULL; |
|---|
| 4877 | n/a | PicHandle _rv; |
|---|
| 4878 | n/a | short pictureID; |
|---|
| 4879 | n/a | #ifndef GetPicture |
|---|
| 4880 | n/a | PyMac_PRECHECK(GetPicture); |
|---|
| 4881 | n/a | #endif |
|---|
| 4882 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4883 | n/a | &pictureID)) |
|---|
| 4884 | n/a | return NULL; |
|---|
| 4885 | n/a | _rv = GetPicture(pictureID); |
|---|
| 4886 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4887 | n/a | ResObj_New, _rv); |
|---|
| 4888 | n/a | return _res; |
|---|
| 4889 | n/a | } |
|---|
| 4890 | n/a | |
|---|
| 4891 | n/a | static PyObject *Qd_DeltaPoint(PyObject *_self, PyObject *_args) |
|---|
| 4892 | n/a | { |
|---|
| 4893 | n/a | PyObject *_res = NULL; |
|---|
| 4894 | n/a | long _rv; |
|---|
| 4895 | n/a | Point ptA; |
|---|
| 4896 | n/a | Point ptB; |
|---|
| 4897 | n/a | #ifndef DeltaPoint |
|---|
| 4898 | n/a | PyMac_PRECHECK(DeltaPoint); |
|---|
| 4899 | n/a | #endif |
|---|
| 4900 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4901 | n/a | PyMac_GetPoint, &ptA, |
|---|
| 4902 | n/a | PyMac_GetPoint, &ptB)) |
|---|
| 4903 | n/a | return NULL; |
|---|
| 4904 | n/a | _rv = DeltaPoint(ptA, |
|---|
| 4905 | n/a | ptB); |
|---|
| 4906 | n/a | _res = Py_BuildValue("l", |
|---|
| 4907 | n/a | _rv); |
|---|
| 4908 | n/a | return _res; |
|---|
| 4909 | n/a | } |
|---|
| 4910 | n/a | |
|---|
| 4911 | n/a | static PyObject *Qd_ShieldCursor(PyObject *_self, PyObject *_args) |
|---|
| 4912 | n/a | { |
|---|
| 4913 | n/a | PyObject *_res = NULL; |
|---|
| 4914 | n/a | Rect shieldRect; |
|---|
| 4915 | n/a | Point offsetPt; |
|---|
| 4916 | n/a | #ifndef ShieldCursor |
|---|
| 4917 | n/a | PyMac_PRECHECK(ShieldCursor); |
|---|
| 4918 | n/a | #endif |
|---|
| 4919 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 4920 | n/a | PyMac_GetRect, &shieldRect, |
|---|
| 4921 | n/a | PyMac_GetPoint, &offsetPt)) |
|---|
| 4922 | n/a | return NULL; |
|---|
| 4923 | n/a | ShieldCursor(&shieldRect, |
|---|
| 4924 | n/a | offsetPt); |
|---|
| 4925 | n/a | Py_INCREF(Py_None); |
|---|
| 4926 | n/a | _res = Py_None; |
|---|
| 4927 | n/a | return _res; |
|---|
| 4928 | n/a | } |
|---|
| 4929 | n/a | |
|---|
| 4930 | n/a | static PyObject *Qd_ScreenRes(PyObject *_self, PyObject *_args) |
|---|
| 4931 | n/a | { |
|---|
| 4932 | n/a | PyObject *_res = NULL; |
|---|
| 4933 | n/a | short scrnHRes; |
|---|
| 4934 | n/a | short scrnVRes; |
|---|
| 4935 | n/a | #ifndef ScreenRes |
|---|
| 4936 | n/a | PyMac_PRECHECK(ScreenRes); |
|---|
| 4937 | n/a | #endif |
|---|
| 4938 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 4939 | n/a | return NULL; |
|---|
| 4940 | n/a | ScreenRes(&scrnHRes, |
|---|
| 4941 | n/a | &scrnVRes); |
|---|
| 4942 | n/a | _res = Py_BuildValue("hh", |
|---|
| 4943 | n/a | scrnHRes, |
|---|
| 4944 | n/a | scrnVRes); |
|---|
| 4945 | n/a | return _res; |
|---|
| 4946 | n/a | } |
|---|
| 4947 | n/a | |
|---|
| 4948 | n/a | static PyObject *Qd_GetIndPattern(PyObject *_self, PyObject *_args) |
|---|
| 4949 | n/a | { |
|---|
| 4950 | n/a | PyObject *_res = NULL; |
|---|
| 4951 | n/a | Pattern thePat__out__; |
|---|
| 4952 | n/a | short patternListID; |
|---|
| 4953 | n/a | short index; |
|---|
| 4954 | n/a | #ifndef GetIndPattern |
|---|
| 4955 | n/a | PyMac_PRECHECK(GetIndPattern); |
|---|
| 4956 | n/a | #endif |
|---|
| 4957 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 4958 | n/a | &patternListID, |
|---|
| 4959 | n/a | &index)) |
|---|
| 4960 | n/a | return NULL; |
|---|
| 4961 | n/a | GetIndPattern(&thePat__out__, |
|---|
| 4962 | n/a | patternListID, |
|---|
| 4963 | n/a | index); |
|---|
| 4964 | n/a | _res = Py_BuildValue("s#", |
|---|
| 4965 | n/a | (char *)&thePat__out__, (int)sizeof(Pattern)); |
|---|
| 4966 | n/a | return _res; |
|---|
| 4967 | n/a | } |
|---|
| 4968 | n/a | |
|---|
| 4969 | n/a | static PyObject *Qd_SlopeFromAngle(PyObject *_self, PyObject *_args) |
|---|
| 4970 | n/a | { |
|---|
| 4971 | n/a | PyObject *_res = NULL; |
|---|
| 4972 | n/a | Fixed _rv; |
|---|
| 4973 | n/a | short angle; |
|---|
| 4974 | n/a | #ifndef SlopeFromAngle |
|---|
| 4975 | n/a | PyMac_PRECHECK(SlopeFromAngle); |
|---|
| 4976 | n/a | #endif |
|---|
| 4977 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 4978 | n/a | &angle)) |
|---|
| 4979 | n/a | return NULL; |
|---|
| 4980 | n/a | _rv = SlopeFromAngle(angle); |
|---|
| 4981 | n/a | _res = Py_BuildValue("O&", |
|---|
| 4982 | n/a | PyMac_BuildFixed, _rv); |
|---|
| 4983 | n/a | return _res; |
|---|
| 4984 | n/a | } |
|---|
| 4985 | n/a | |
|---|
| 4986 | n/a | static PyObject *Qd_AngleFromSlope(PyObject *_self, PyObject *_args) |
|---|
| 4987 | n/a | { |
|---|
| 4988 | n/a | PyObject *_res = NULL; |
|---|
| 4989 | n/a | short _rv; |
|---|
| 4990 | n/a | Fixed slope; |
|---|
| 4991 | n/a | #ifndef AngleFromSlope |
|---|
| 4992 | n/a | PyMac_PRECHECK(AngleFromSlope); |
|---|
| 4993 | n/a | #endif |
|---|
| 4994 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 4995 | n/a | PyMac_GetFixed, &slope)) |
|---|
| 4996 | n/a | return NULL; |
|---|
| 4997 | n/a | _rv = AngleFromSlope(slope); |
|---|
| 4998 | n/a | _res = Py_BuildValue("h", |
|---|
| 4999 | n/a | _rv); |
|---|
| 5000 | n/a | return _res; |
|---|
| 5001 | n/a | } |
|---|
| 5002 | n/a | |
|---|
| 5003 | n/a | static PyObject *Qd_GetPixBounds(PyObject *_self, PyObject *_args) |
|---|
| 5004 | n/a | { |
|---|
| 5005 | n/a | PyObject *_res = NULL; |
|---|
| 5006 | n/a | PixMapHandle pixMap; |
|---|
| 5007 | n/a | Rect bounds; |
|---|
| 5008 | n/a | #ifndef GetPixBounds |
|---|
| 5009 | n/a | PyMac_PRECHECK(GetPixBounds); |
|---|
| 5010 | n/a | #endif |
|---|
| 5011 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5012 | n/a | ResObj_Convert, &pixMap)) |
|---|
| 5013 | n/a | return NULL; |
|---|
| 5014 | n/a | GetPixBounds(pixMap, |
|---|
| 5015 | n/a | &bounds); |
|---|
| 5016 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5017 | n/a | PyMac_BuildRect, &bounds); |
|---|
| 5018 | n/a | return _res; |
|---|
| 5019 | n/a | } |
|---|
| 5020 | n/a | |
|---|
| 5021 | n/a | static PyObject *Qd_GetPixDepth(PyObject *_self, PyObject *_args) |
|---|
| 5022 | n/a | { |
|---|
| 5023 | n/a | PyObject *_res = NULL; |
|---|
| 5024 | n/a | short _rv; |
|---|
| 5025 | n/a | PixMapHandle pixMap; |
|---|
| 5026 | n/a | #ifndef GetPixDepth |
|---|
| 5027 | n/a | PyMac_PRECHECK(GetPixDepth); |
|---|
| 5028 | n/a | #endif |
|---|
| 5029 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5030 | n/a | ResObj_Convert, &pixMap)) |
|---|
| 5031 | n/a | return NULL; |
|---|
| 5032 | n/a | _rv = GetPixDepth(pixMap); |
|---|
| 5033 | n/a | _res = Py_BuildValue("h", |
|---|
| 5034 | n/a | _rv); |
|---|
| 5035 | n/a | return _res; |
|---|
| 5036 | n/a | } |
|---|
| 5037 | n/a | |
|---|
| 5038 | n/a | static PyObject *Qd_GetQDGlobalsRandomSeed(PyObject *_self, PyObject *_args) |
|---|
| 5039 | n/a | { |
|---|
| 5040 | n/a | PyObject *_res = NULL; |
|---|
| 5041 | n/a | long _rv; |
|---|
| 5042 | n/a | #ifndef GetQDGlobalsRandomSeed |
|---|
| 5043 | n/a | PyMac_PRECHECK(GetQDGlobalsRandomSeed); |
|---|
| 5044 | n/a | #endif |
|---|
| 5045 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5046 | n/a | return NULL; |
|---|
| 5047 | n/a | _rv = GetQDGlobalsRandomSeed(); |
|---|
| 5048 | n/a | _res = Py_BuildValue("l", |
|---|
| 5049 | n/a | _rv); |
|---|
| 5050 | n/a | return _res; |
|---|
| 5051 | n/a | } |
|---|
| 5052 | n/a | |
|---|
| 5053 | n/a | static PyObject *Qd_GetQDGlobalsScreenBits(PyObject *_self, PyObject *_args) |
|---|
| 5054 | n/a | { |
|---|
| 5055 | n/a | PyObject *_res = NULL; |
|---|
| 5056 | n/a | BitMap screenBits; |
|---|
| 5057 | n/a | #ifndef GetQDGlobalsScreenBits |
|---|
| 5058 | n/a | PyMac_PRECHECK(GetQDGlobalsScreenBits); |
|---|
| 5059 | n/a | #endif |
|---|
| 5060 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5061 | n/a | return NULL; |
|---|
| 5062 | n/a | GetQDGlobalsScreenBits(&screenBits); |
|---|
| 5063 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5064 | n/a | BMObj_NewCopied, &screenBits); |
|---|
| 5065 | n/a | return _res; |
|---|
| 5066 | n/a | } |
|---|
| 5067 | n/a | |
|---|
| 5068 | n/a | static PyObject *Qd_GetQDGlobalsArrow(PyObject *_self, PyObject *_args) |
|---|
| 5069 | n/a | { |
|---|
| 5070 | n/a | PyObject *_res = NULL; |
|---|
| 5071 | n/a | Cursor arrow__out__; |
|---|
| 5072 | n/a | #ifndef GetQDGlobalsArrow |
|---|
| 5073 | n/a | PyMac_PRECHECK(GetQDGlobalsArrow); |
|---|
| 5074 | n/a | #endif |
|---|
| 5075 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5076 | n/a | return NULL; |
|---|
| 5077 | n/a | GetQDGlobalsArrow(&arrow__out__); |
|---|
| 5078 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5079 | n/a | (char *)&arrow__out__, (int)sizeof(Cursor)); |
|---|
| 5080 | n/a | return _res; |
|---|
| 5081 | n/a | } |
|---|
| 5082 | n/a | |
|---|
| 5083 | n/a | static PyObject *Qd_GetQDGlobalsDarkGray(PyObject *_self, PyObject *_args) |
|---|
| 5084 | n/a | { |
|---|
| 5085 | n/a | PyObject *_res = NULL; |
|---|
| 5086 | n/a | Pattern dkGray__out__; |
|---|
| 5087 | n/a | #ifndef GetQDGlobalsDarkGray |
|---|
| 5088 | n/a | PyMac_PRECHECK(GetQDGlobalsDarkGray); |
|---|
| 5089 | n/a | #endif |
|---|
| 5090 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5091 | n/a | return NULL; |
|---|
| 5092 | n/a | GetQDGlobalsDarkGray(&dkGray__out__); |
|---|
| 5093 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5094 | n/a | (char *)&dkGray__out__, (int)sizeof(Pattern)); |
|---|
| 5095 | n/a | return _res; |
|---|
| 5096 | n/a | } |
|---|
| 5097 | n/a | |
|---|
| 5098 | n/a | static PyObject *Qd_GetQDGlobalsLightGray(PyObject *_self, PyObject *_args) |
|---|
| 5099 | n/a | { |
|---|
| 5100 | n/a | PyObject *_res = NULL; |
|---|
| 5101 | n/a | Pattern ltGray__out__; |
|---|
| 5102 | n/a | #ifndef GetQDGlobalsLightGray |
|---|
| 5103 | n/a | PyMac_PRECHECK(GetQDGlobalsLightGray); |
|---|
| 5104 | n/a | #endif |
|---|
| 5105 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5106 | n/a | return NULL; |
|---|
| 5107 | n/a | GetQDGlobalsLightGray(<Gray__out__); |
|---|
| 5108 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5109 | n/a | (char *)<Gray__out__, (int)sizeof(Pattern)); |
|---|
| 5110 | n/a | return _res; |
|---|
| 5111 | n/a | } |
|---|
| 5112 | n/a | |
|---|
| 5113 | n/a | static PyObject *Qd_GetQDGlobalsGray(PyObject *_self, PyObject *_args) |
|---|
| 5114 | n/a | { |
|---|
| 5115 | n/a | PyObject *_res = NULL; |
|---|
| 5116 | n/a | Pattern gray__out__; |
|---|
| 5117 | n/a | #ifndef GetQDGlobalsGray |
|---|
| 5118 | n/a | PyMac_PRECHECK(GetQDGlobalsGray); |
|---|
| 5119 | n/a | #endif |
|---|
| 5120 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5121 | n/a | return NULL; |
|---|
| 5122 | n/a | GetQDGlobalsGray(&gray__out__); |
|---|
| 5123 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5124 | n/a | (char *)&gray__out__, (int)sizeof(Pattern)); |
|---|
| 5125 | n/a | return _res; |
|---|
| 5126 | n/a | } |
|---|
| 5127 | n/a | |
|---|
| 5128 | n/a | static PyObject *Qd_GetQDGlobalsBlack(PyObject *_self, PyObject *_args) |
|---|
| 5129 | n/a | { |
|---|
| 5130 | n/a | PyObject *_res = NULL; |
|---|
| 5131 | n/a | Pattern black__out__; |
|---|
| 5132 | n/a | #ifndef GetQDGlobalsBlack |
|---|
| 5133 | n/a | PyMac_PRECHECK(GetQDGlobalsBlack); |
|---|
| 5134 | n/a | #endif |
|---|
| 5135 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5136 | n/a | return NULL; |
|---|
| 5137 | n/a | GetQDGlobalsBlack(&black__out__); |
|---|
| 5138 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5139 | n/a | (char *)&black__out__, (int)sizeof(Pattern)); |
|---|
| 5140 | n/a | return _res; |
|---|
| 5141 | n/a | } |
|---|
| 5142 | n/a | |
|---|
| 5143 | n/a | static PyObject *Qd_GetQDGlobalsWhite(PyObject *_self, PyObject *_args) |
|---|
| 5144 | n/a | { |
|---|
| 5145 | n/a | PyObject *_res = NULL; |
|---|
| 5146 | n/a | Pattern white__out__; |
|---|
| 5147 | n/a | #ifndef GetQDGlobalsWhite |
|---|
| 5148 | n/a | PyMac_PRECHECK(GetQDGlobalsWhite); |
|---|
| 5149 | n/a | #endif |
|---|
| 5150 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5151 | n/a | return NULL; |
|---|
| 5152 | n/a | GetQDGlobalsWhite(&white__out__); |
|---|
| 5153 | n/a | _res = Py_BuildValue("s#", |
|---|
| 5154 | n/a | (char *)&white__out__, (int)sizeof(Pattern)); |
|---|
| 5155 | n/a | return _res; |
|---|
| 5156 | n/a | } |
|---|
| 5157 | n/a | |
|---|
| 5158 | n/a | static PyObject *Qd_GetQDGlobalsThePort(PyObject *_self, PyObject *_args) |
|---|
| 5159 | n/a | { |
|---|
| 5160 | n/a | PyObject *_res = NULL; |
|---|
| 5161 | n/a | CGrafPtr _rv; |
|---|
| 5162 | n/a | #ifndef GetQDGlobalsThePort |
|---|
| 5163 | n/a | PyMac_PRECHECK(GetQDGlobalsThePort); |
|---|
| 5164 | n/a | #endif |
|---|
| 5165 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5166 | n/a | return NULL; |
|---|
| 5167 | n/a | _rv = GetQDGlobalsThePort(); |
|---|
| 5168 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5169 | n/a | GrafObj_New, _rv); |
|---|
| 5170 | n/a | return _res; |
|---|
| 5171 | n/a | } |
|---|
| 5172 | n/a | |
|---|
| 5173 | n/a | static PyObject *Qd_SetQDGlobalsRandomSeed(PyObject *_self, PyObject *_args) |
|---|
| 5174 | n/a | { |
|---|
| 5175 | n/a | PyObject *_res = NULL; |
|---|
| 5176 | n/a | long randomSeed; |
|---|
| 5177 | n/a | #ifndef SetQDGlobalsRandomSeed |
|---|
| 5178 | n/a | PyMac_PRECHECK(SetQDGlobalsRandomSeed); |
|---|
| 5179 | n/a | #endif |
|---|
| 5180 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 5181 | n/a | &randomSeed)) |
|---|
| 5182 | n/a | return NULL; |
|---|
| 5183 | n/a | SetQDGlobalsRandomSeed(randomSeed); |
|---|
| 5184 | n/a | Py_INCREF(Py_None); |
|---|
| 5185 | n/a | _res = Py_None; |
|---|
| 5186 | n/a | return _res; |
|---|
| 5187 | n/a | } |
|---|
| 5188 | n/a | |
|---|
| 5189 | n/a | static PyObject *Qd_SetQDGlobalsArrow(PyObject *_self, PyObject *_args) |
|---|
| 5190 | n/a | { |
|---|
| 5191 | n/a | PyObject *_res = NULL; |
|---|
| 5192 | n/a | Cursor *arrow__in__; |
|---|
| 5193 | n/a | int arrow__in_len__; |
|---|
| 5194 | n/a | #ifndef SetQDGlobalsArrow |
|---|
| 5195 | n/a | PyMac_PRECHECK(SetQDGlobalsArrow); |
|---|
| 5196 | n/a | #endif |
|---|
| 5197 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 5198 | n/a | (char **)&arrow__in__, &arrow__in_len__)) |
|---|
| 5199 | n/a | return NULL; |
|---|
| 5200 | n/a | if (arrow__in_len__ != sizeof(Cursor)) |
|---|
| 5201 | n/a | { |
|---|
| 5202 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Cursor)"); |
|---|
| 5203 | n/a | goto arrow__error__; |
|---|
| 5204 | n/a | } |
|---|
| 5205 | n/a | SetQDGlobalsArrow(arrow__in__); |
|---|
| 5206 | n/a | Py_INCREF(Py_None); |
|---|
| 5207 | n/a | _res = Py_None; |
|---|
| 5208 | n/a | arrow__error__: ; |
|---|
| 5209 | n/a | return _res; |
|---|
| 5210 | n/a | } |
|---|
| 5211 | n/a | |
|---|
| 5212 | n/a | static PyObject *Qd_GetRegionBounds(PyObject *_self, PyObject *_args) |
|---|
| 5213 | n/a | { |
|---|
| 5214 | n/a | PyObject *_res = NULL; |
|---|
| 5215 | n/a | RgnHandle region; |
|---|
| 5216 | n/a | Rect bounds; |
|---|
| 5217 | n/a | #ifndef GetRegionBounds |
|---|
| 5218 | n/a | PyMac_PRECHECK(GetRegionBounds); |
|---|
| 5219 | n/a | #endif |
|---|
| 5220 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5221 | n/a | ResObj_Convert, ®ion)) |
|---|
| 5222 | n/a | return NULL; |
|---|
| 5223 | n/a | GetRegionBounds(region, |
|---|
| 5224 | n/a | &bounds); |
|---|
| 5225 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5226 | n/a | PyMac_BuildRect, &bounds); |
|---|
| 5227 | n/a | return _res; |
|---|
| 5228 | n/a | } |
|---|
| 5229 | n/a | |
|---|
| 5230 | n/a | static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args) |
|---|
| 5231 | n/a | { |
|---|
| 5232 | n/a | PyObject *_res = NULL; |
|---|
| 5233 | n/a | Boolean _rv; |
|---|
| 5234 | n/a | RgnHandle region; |
|---|
| 5235 | n/a | #ifndef IsRegionRectangular |
|---|
| 5236 | n/a | PyMac_PRECHECK(IsRegionRectangular); |
|---|
| 5237 | n/a | #endif |
|---|
| 5238 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5239 | n/a | ResObj_Convert, ®ion)) |
|---|
| 5240 | n/a | return NULL; |
|---|
| 5241 | n/a | _rv = IsRegionRectangular(region); |
|---|
| 5242 | n/a | _res = Py_BuildValue("b", |
|---|
| 5243 | n/a | _rv); |
|---|
| 5244 | n/a | return _res; |
|---|
| 5245 | n/a | } |
|---|
| 5246 | n/a | |
|---|
| 5247 | n/a | static PyObject *Qd_CreateNewPort(PyObject *_self, PyObject *_args) |
|---|
| 5248 | n/a | { |
|---|
| 5249 | n/a | PyObject *_res = NULL; |
|---|
| 5250 | n/a | CGrafPtr _rv; |
|---|
| 5251 | n/a | #ifndef CreateNewPort |
|---|
| 5252 | n/a | PyMac_PRECHECK(CreateNewPort); |
|---|
| 5253 | n/a | #endif |
|---|
| 5254 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5255 | n/a | return NULL; |
|---|
| 5256 | n/a | _rv = CreateNewPort(); |
|---|
| 5257 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5258 | n/a | GrafObj_New, _rv); |
|---|
| 5259 | n/a | return _res; |
|---|
| 5260 | n/a | } |
|---|
| 5261 | n/a | |
|---|
| 5262 | n/a | static PyObject *Qd_SetQDError(PyObject *_self, PyObject *_args) |
|---|
| 5263 | n/a | { |
|---|
| 5264 | n/a | PyObject *_res = NULL; |
|---|
| 5265 | n/a | OSErr err; |
|---|
| 5266 | n/a | #ifndef SetQDError |
|---|
| 5267 | n/a | PyMac_PRECHECK(SetQDError); |
|---|
| 5268 | n/a | #endif |
|---|
| 5269 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5270 | n/a | &err)) |
|---|
| 5271 | n/a | return NULL; |
|---|
| 5272 | n/a | SetQDError(err); |
|---|
| 5273 | n/a | Py_INCREF(Py_None); |
|---|
| 5274 | n/a | _res = Py_None; |
|---|
| 5275 | n/a | return _res; |
|---|
| 5276 | n/a | } |
|---|
| 5277 | n/a | |
|---|
| 5278 | n/a | static PyObject *Qd_LMGetScrVRes(PyObject *_self, PyObject *_args) |
|---|
| 5279 | n/a | { |
|---|
| 5280 | n/a | PyObject *_res = NULL; |
|---|
| 5281 | n/a | SInt16 _rv; |
|---|
| 5282 | n/a | #ifndef LMGetScrVRes |
|---|
| 5283 | n/a | PyMac_PRECHECK(LMGetScrVRes); |
|---|
| 5284 | n/a | #endif |
|---|
| 5285 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5286 | n/a | return NULL; |
|---|
| 5287 | n/a | _rv = LMGetScrVRes(); |
|---|
| 5288 | n/a | _res = Py_BuildValue("h", |
|---|
| 5289 | n/a | _rv); |
|---|
| 5290 | n/a | return _res; |
|---|
| 5291 | n/a | } |
|---|
| 5292 | n/a | |
|---|
| 5293 | n/a | static PyObject *Qd_LMSetScrVRes(PyObject *_self, PyObject *_args) |
|---|
| 5294 | n/a | { |
|---|
| 5295 | n/a | PyObject *_res = NULL; |
|---|
| 5296 | n/a | SInt16 value; |
|---|
| 5297 | n/a | #ifndef LMSetScrVRes |
|---|
| 5298 | n/a | PyMac_PRECHECK(LMSetScrVRes); |
|---|
| 5299 | n/a | #endif |
|---|
| 5300 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5301 | n/a | &value)) |
|---|
| 5302 | n/a | return NULL; |
|---|
| 5303 | n/a | LMSetScrVRes(value); |
|---|
| 5304 | n/a | Py_INCREF(Py_None); |
|---|
| 5305 | n/a | _res = Py_None; |
|---|
| 5306 | n/a | return _res; |
|---|
| 5307 | n/a | } |
|---|
| 5308 | n/a | |
|---|
| 5309 | n/a | static PyObject *Qd_LMGetScrHRes(PyObject *_self, PyObject *_args) |
|---|
| 5310 | n/a | { |
|---|
| 5311 | n/a | PyObject *_res = NULL; |
|---|
| 5312 | n/a | SInt16 _rv; |
|---|
| 5313 | n/a | #ifndef LMGetScrHRes |
|---|
| 5314 | n/a | PyMac_PRECHECK(LMGetScrHRes); |
|---|
| 5315 | n/a | #endif |
|---|
| 5316 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5317 | n/a | return NULL; |
|---|
| 5318 | n/a | _rv = LMGetScrHRes(); |
|---|
| 5319 | n/a | _res = Py_BuildValue("h", |
|---|
| 5320 | n/a | _rv); |
|---|
| 5321 | n/a | return _res; |
|---|
| 5322 | n/a | } |
|---|
| 5323 | n/a | |
|---|
| 5324 | n/a | static PyObject *Qd_LMSetScrHRes(PyObject *_self, PyObject *_args) |
|---|
| 5325 | n/a | { |
|---|
| 5326 | n/a | PyObject *_res = NULL; |
|---|
| 5327 | n/a | SInt16 value; |
|---|
| 5328 | n/a | #ifndef LMSetScrHRes |
|---|
| 5329 | n/a | PyMac_PRECHECK(LMSetScrHRes); |
|---|
| 5330 | n/a | #endif |
|---|
| 5331 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5332 | n/a | &value)) |
|---|
| 5333 | n/a | return NULL; |
|---|
| 5334 | n/a | LMSetScrHRes(value); |
|---|
| 5335 | n/a | Py_INCREF(Py_None); |
|---|
| 5336 | n/a | _res = Py_None; |
|---|
| 5337 | n/a | return _res; |
|---|
| 5338 | n/a | } |
|---|
| 5339 | n/a | |
|---|
| 5340 | n/a | static PyObject *Qd_LMGetMainDevice(PyObject *_self, PyObject *_args) |
|---|
| 5341 | n/a | { |
|---|
| 5342 | n/a | PyObject *_res = NULL; |
|---|
| 5343 | n/a | GDHandle _rv; |
|---|
| 5344 | n/a | #ifndef LMGetMainDevice |
|---|
| 5345 | n/a | PyMac_PRECHECK(LMGetMainDevice); |
|---|
| 5346 | n/a | #endif |
|---|
| 5347 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5348 | n/a | return NULL; |
|---|
| 5349 | n/a | _rv = LMGetMainDevice(); |
|---|
| 5350 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5351 | n/a | ResObj_New, _rv); |
|---|
| 5352 | n/a | return _res; |
|---|
| 5353 | n/a | } |
|---|
| 5354 | n/a | |
|---|
| 5355 | n/a | static PyObject *Qd_LMSetMainDevice(PyObject *_self, PyObject *_args) |
|---|
| 5356 | n/a | { |
|---|
| 5357 | n/a | PyObject *_res = NULL; |
|---|
| 5358 | n/a | GDHandle value; |
|---|
| 5359 | n/a | #ifndef LMSetMainDevice |
|---|
| 5360 | n/a | PyMac_PRECHECK(LMSetMainDevice); |
|---|
| 5361 | n/a | #endif |
|---|
| 5362 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5363 | n/a | ResObj_Convert, &value)) |
|---|
| 5364 | n/a | return NULL; |
|---|
| 5365 | n/a | LMSetMainDevice(value); |
|---|
| 5366 | n/a | Py_INCREF(Py_None); |
|---|
| 5367 | n/a | _res = Py_None; |
|---|
| 5368 | n/a | return _res; |
|---|
| 5369 | n/a | } |
|---|
| 5370 | n/a | |
|---|
| 5371 | n/a | static PyObject *Qd_LMGetDeviceList(PyObject *_self, PyObject *_args) |
|---|
| 5372 | n/a | { |
|---|
| 5373 | n/a | PyObject *_res = NULL; |
|---|
| 5374 | n/a | GDHandle _rv; |
|---|
| 5375 | n/a | #ifndef LMGetDeviceList |
|---|
| 5376 | n/a | PyMac_PRECHECK(LMGetDeviceList); |
|---|
| 5377 | n/a | #endif |
|---|
| 5378 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5379 | n/a | return NULL; |
|---|
| 5380 | n/a | _rv = LMGetDeviceList(); |
|---|
| 5381 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5382 | n/a | ResObj_New, _rv); |
|---|
| 5383 | n/a | return _res; |
|---|
| 5384 | n/a | } |
|---|
| 5385 | n/a | |
|---|
| 5386 | n/a | static PyObject *Qd_LMSetDeviceList(PyObject *_self, PyObject *_args) |
|---|
| 5387 | n/a | { |
|---|
| 5388 | n/a | PyObject *_res = NULL; |
|---|
| 5389 | n/a | GDHandle value; |
|---|
| 5390 | n/a | #ifndef LMSetDeviceList |
|---|
| 5391 | n/a | PyMac_PRECHECK(LMSetDeviceList); |
|---|
| 5392 | n/a | #endif |
|---|
| 5393 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5394 | n/a | ResObj_Convert, &value)) |
|---|
| 5395 | n/a | return NULL; |
|---|
| 5396 | n/a | LMSetDeviceList(value); |
|---|
| 5397 | n/a | Py_INCREF(Py_None); |
|---|
| 5398 | n/a | _res = Py_None; |
|---|
| 5399 | n/a | return _res; |
|---|
| 5400 | n/a | } |
|---|
| 5401 | n/a | |
|---|
| 5402 | n/a | static PyObject *Qd_LMGetQDColors(PyObject *_self, PyObject *_args) |
|---|
| 5403 | n/a | { |
|---|
| 5404 | n/a | PyObject *_res = NULL; |
|---|
| 5405 | n/a | Handle _rv; |
|---|
| 5406 | n/a | #ifndef LMGetQDColors |
|---|
| 5407 | n/a | PyMac_PRECHECK(LMGetQDColors); |
|---|
| 5408 | n/a | #endif |
|---|
| 5409 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5410 | n/a | return NULL; |
|---|
| 5411 | n/a | _rv = LMGetQDColors(); |
|---|
| 5412 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5413 | n/a | ResObj_New, _rv); |
|---|
| 5414 | n/a | return _res; |
|---|
| 5415 | n/a | } |
|---|
| 5416 | n/a | |
|---|
| 5417 | n/a | static PyObject *Qd_LMSetQDColors(PyObject *_self, PyObject *_args) |
|---|
| 5418 | n/a | { |
|---|
| 5419 | n/a | PyObject *_res = NULL; |
|---|
| 5420 | n/a | Handle value; |
|---|
| 5421 | n/a | #ifndef LMSetQDColors |
|---|
| 5422 | n/a | PyMac_PRECHECK(LMSetQDColors); |
|---|
| 5423 | n/a | #endif |
|---|
| 5424 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5425 | n/a | ResObj_Convert, &value)) |
|---|
| 5426 | n/a | return NULL; |
|---|
| 5427 | n/a | LMSetQDColors(value); |
|---|
| 5428 | n/a | Py_INCREF(Py_None); |
|---|
| 5429 | n/a | _res = Py_None; |
|---|
| 5430 | n/a | return _res; |
|---|
| 5431 | n/a | } |
|---|
| 5432 | n/a | |
|---|
| 5433 | n/a | static PyObject *Qd_LMGetWidthListHand(PyObject *_self, PyObject *_args) |
|---|
| 5434 | n/a | { |
|---|
| 5435 | n/a | PyObject *_res = NULL; |
|---|
| 5436 | n/a | Handle _rv; |
|---|
| 5437 | n/a | #ifndef LMGetWidthListHand |
|---|
| 5438 | n/a | PyMac_PRECHECK(LMGetWidthListHand); |
|---|
| 5439 | n/a | #endif |
|---|
| 5440 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5441 | n/a | return NULL; |
|---|
| 5442 | n/a | _rv = LMGetWidthListHand(); |
|---|
| 5443 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5444 | n/a | ResObj_New, _rv); |
|---|
| 5445 | n/a | return _res; |
|---|
| 5446 | n/a | } |
|---|
| 5447 | n/a | |
|---|
| 5448 | n/a | static PyObject *Qd_LMSetWidthListHand(PyObject *_self, PyObject *_args) |
|---|
| 5449 | n/a | { |
|---|
| 5450 | n/a | PyObject *_res = NULL; |
|---|
| 5451 | n/a | Handle value; |
|---|
| 5452 | n/a | #ifndef LMSetWidthListHand |
|---|
| 5453 | n/a | PyMac_PRECHECK(LMSetWidthListHand); |
|---|
| 5454 | n/a | #endif |
|---|
| 5455 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5456 | n/a | ResObj_Convert, &value)) |
|---|
| 5457 | n/a | return NULL; |
|---|
| 5458 | n/a | LMSetWidthListHand(value); |
|---|
| 5459 | n/a | Py_INCREF(Py_None); |
|---|
| 5460 | n/a | _res = Py_None; |
|---|
| 5461 | n/a | return _res; |
|---|
| 5462 | n/a | } |
|---|
| 5463 | n/a | |
|---|
| 5464 | n/a | static PyObject *Qd_LMGetHiliteMode(PyObject *_self, PyObject *_args) |
|---|
| 5465 | n/a | { |
|---|
| 5466 | n/a | PyObject *_res = NULL; |
|---|
| 5467 | n/a | UInt8 _rv; |
|---|
| 5468 | n/a | #ifndef LMGetHiliteMode |
|---|
| 5469 | n/a | PyMac_PRECHECK(LMGetHiliteMode); |
|---|
| 5470 | n/a | #endif |
|---|
| 5471 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5472 | n/a | return NULL; |
|---|
| 5473 | n/a | _rv = LMGetHiliteMode(); |
|---|
| 5474 | n/a | _res = Py_BuildValue("b", |
|---|
| 5475 | n/a | _rv); |
|---|
| 5476 | n/a | return _res; |
|---|
| 5477 | n/a | } |
|---|
| 5478 | n/a | |
|---|
| 5479 | n/a | static PyObject *Qd_LMSetHiliteMode(PyObject *_self, PyObject *_args) |
|---|
| 5480 | n/a | { |
|---|
| 5481 | n/a | PyObject *_res = NULL; |
|---|
| 5482 | n/a | UInt8 value; |
|---|
| 5483 | n/a | #ifndef LMSetHiliteMode |
|---|
| 5484 | n/a | PyMac_PRECHECK(LMSetHiliteMode); |
|---|
| 5485 | n/a | #endif |
|---|
| 5486 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 5487 | n/a | &value)) |
|---|
| 5488 | n/a | return NULL; |
|---|
| 5489 | n/a | LMSetHiliteMode(value); |
|---|
| 5490 | n/a | Py_INCREF(Py_None); |
|---|
| 5491 | n/a | _res = Py_None; |
|---|
| 5492 | n/a | return _res; |
|---|
| 5493 | n/a | } |
|---|
| 5494 | n/a | |
|---|
| 5495 | n/a | static PyObject *Qd_LMGetWidthTabHandle(PyObject *_self, PyObject *_args) |
|---|
| 5496 | n/a | { |
|---|
| 5497 | n/a | PyObject *_res = NULL; |
|---|
| 5498 | n/a | Handle _rv; |
|---|
| 5499 | n/a | #ifndef LMGetWidthTabHandle |
|---|
| 5500 | n/a | PyMac_PRECHECK(LMGetWidthTabHandle); |
|---|
| 5501 | n/a | #endif |
|---|
| 5502 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5503 | n/a | return NULL; |
|---|
| 5504 | n/a | _rv = LMGetWidthTabHandle(); |
|---|
| 5505 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5506 | n/a | ResObj_New, _rv); |
|---|
| 5507 | n/a | return _res; |
|---|
| 5508 | n/a | } |
|---|
| 5509 | n/a | |
|---|
| 5510 | n/a | static PyObject *Qd_LMSetWidthTabHandle(PyObject *_self, PyObject *_args) |
|---|
| 5511 | n/a | { |
|---|
| 5512 | n/a | PyObject *_res = NULL; |
|---|
| 5513 | n/a | Handle value; |
|---|
| 5514 | n/a | #ifndef LMSetWidthTabHandle |
|---|
| 5515 | n/a | PyMac_PRECHECK(LMSetWidthTabHandle); |
|---|
| 5516 | n/a | #endif |
|---|
| 5517 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5518 | n/a | ResObj_Convert, &value)) |
|---|
| 5519 | n/a | return NULL; |
|---|
| 5520 | n/a | LMSetWidthTabHandle(value); |
|---|
| 5521 | n/a | Py_INCREF(Py_None); |
|---|
| 5522 | n/a | _res = Py_None; |
|---|
| 5523 | n/a | return _res; |
|---|
| 5524 | n/a | } |
|---|
| 5525 | n/a | |
|---|
| 5526 | n/a | static PyObject *Qd_LMGetLastSPExtra(PyObject *_self, PyObject *_args) |
|---|
| 5527 | n/a | { |
|---|
| 5528 | n/a | PyObject *_res = NULL; |
|---|
| 5529 | n/a | SInt32 _rv; |
|---|
| 5530 | n/a | #ifndef LMGetLastSPExtra |
|---|
| 5531 | n/a | PyMac_PRECHECK(LMGetLastSPExtra); |
|---|
| 5532 | n/a | #endif |
|---|
| 5533 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5534 | n/a | return NULL; |
|---|
| 5535 | n/a | _rv = LMGetLastSPExtra(); |
|---|
| 5536 | n/a | _res = Py_BuildValue("l", |
|---|
| 5537 | n/a | _rv); |
|---|
| 5538 | n/a | return _res; |
|---|
| 5539 | n/a | } |
|---|
| 5540 | n/a | |
|---|
| 5541 | n/a | static PyObject *Qd_LMSetLastSPExtra(PyObject *_self, PyObject *_args) |
|---|
| 5542 | n/a | { |
|---|
| 5543 | n/a | PyObject *_res = NULL; |
|---|
| 5544 | n/a | SInt32 value; |
|---|
| 5545 | n/a | #ifndef LMSetLastSPExtra |
|---|
| 5546 | n/a | PyMac_PRECHECK(LMSetLastSPExtra); |
|---|
| 5547 | n/a | #endif |
|---|
| 5548 | n/a | if (!PyArg_ParseTuple(_args, "l", |
|---|
| 5549 | n/a | &value)) |
|---|
| 5550 | n/a | return NULL; |
|---|
| 5551 | n/a | LMSetLastSPExtra(value); |
|---|
| 5552 | n/a | Py_INCREF(Py_None); |
|---|
| 5553 | n/a | _res = Py_None; |
|---|
| 5554 | n/a | return _res; |
|---|
| 5555 | n/a | } |
|---|
| 5556 | n/a | |
|---|
| 5557 | n/a | static PyObject *Qd_LMGetLastFOND(PyObject *_self, PyObject *_args) |
|---|
| 5558 | n/a | { |
|---|
| 5559 | n/a | PyObject *_res = NULL; |
|---|
| 5560 | n/a | Handle _rv; |
|---|
| 5561 | n/a | #ifndef LMGetLastFOND |
|---|
| 5562 | n/a | PyMac_PRECHECK(LMGetLastFOND); |
|---|
| 5563 | n/a | #endif |
|---|
| 5564 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5565 | n/a | return NULL; |
|---|
| 5566 | n/a | _rv = LMGetLastFOND(); |
|---|
| 5567 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5568 | n/a | ResObj_New, _rv); |
|---|
| 5569 | n/a | return _res; |
|---|
| 5570 | n/a | } |
|---|
| 5571 | n/a | |
|---|
| 5572 | n/a | static PyObject *Qd_LMSetLastFOND(PyObject *_self, PyObject *_args) |
|---|
| 5573 | n/a | { |
|---|
| 5574 | n/a | PyObject *_res = NULL; |
|---|
| 5575 | n/a | Handle value; |
|---|
| 5576 | n/a | #ifndef LMSetLastFOND |
|---|
| 5577 | n/a | PyMac_PRECHECK(LMSetLastFOND); |
|---|
| 5578 | n/a | #endif |
|---|
| 5579 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5580 | n/a | ResObj_Convert, &value)) |
|---|
| 5581 | n/a | return NULL; |
|---|
| 5582 | n/a | LMSetLastFOND(value); |
|---|
| 5583 | n/a | Py_INCREF(Py_None); |
|---|
| 5584 | n/a | _res = Py_None; |
|---|
| 5585 | n/a | return _res; |
|---|
| 5586 | n/a | } |
|---|
| 5587 | n/a | |
|---|
| 5588 | n/a | static PyObject *Qd_LMGetFractEnable(PyObject *_self, PyObject *_args) |
|---|
| 5589 | n/a | { |
|---|
| 5590 | n/a | PyObject *_res = NULL; |
|---|
| 5591 | n/a | UInt8 _rv; |
|---|
| 5592 | n/a | #ifndef LMGetFractEnable |
|---|
| 5593 | n/a | PyMac_PRECHECK(LMGetFractEnable); |
|---|
| 5594 | n/a | #endif |
|---|
| 5595 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5596 | n/a | return NULL; |
|---|
| 5597 | n/a | _rv = LMGetFractEnable(); |
|---|
| 5598 | n/a | _res = Py_BuildValue("b", |
|---|
| 5599 | n/a | _rv); |
|---|
| 5600 | n/a | return _res; |
|---|
| 5601 | n/a | } |
|---|
| 5602 | n/a | |
|---|
| 5603 | n/a | static PyObject *Qd_LMSetFractEnable(PyObject *_self, PyObject *_args) |
|---|
| 5604 | n/a | { |
|---|
| 5605 | n/a | PyObject *_res = NULL; |
|---|
| 5606 | n/a | UInt8 value; |
|---|
| 5607 | n/a | #ifndef LMSetFractEnable |
|---|
| 5608 | n/a | PyMac_PRECHECK(LMSetFractEnable); |
|---|
| 5609 | n/a | #endif |
|---|
| 5610 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 5611 | n/a | &value)) |
|---|
| 5612 | n/a | return NULL; |
|---|
| 5613 | n/a | LMSetFractEnable(value); |
|---|
| 5614 | n/a | Py_INCREF(Py_None); |
|---|
| 5615 | n/a | _res = Py_None; |
|---|
| 5616 | n/a | return _res; |
|---|
| 5617 | n/a | } |
|---|
| 5618 | n/a | |
|---|
| 5619 | n/a | static PyObject *Qd_LMGetTheGDevice(PyObject *_self, PyObject *_args) |
|---|
| 5620 | n/a | { |
|---|
| 5621 | n/a | PyObject *_res = NULL; |
|---|
| 5622 | n/a | GDHandle _rv; |
|---|
| 5623 | n/a | #ifndef LMGetTheGDevice |
|---|
| 5624 | n/a | PyMac_PRECHECK(LMGetTheGDevice); |
|---|
| 5625 | n/a | #endif |
|---|
| 5626 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5627 | n/a | return NULL; |
|---|
| 5628 | n/a | _rv = LMGetTheGDevice(); |
|---|
| 5629 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5630 | n/a | ResObj_New, _rv); |
|---|
| 5631 | n/a | return _res; |
|---|
| 5632 | n/a | } |
|---|
| 5633 | n/a | |
|---|
| 5634 | n/a | static PyObject *Qd_LMSetTheGDevice(PyObject *_self, PyObject *_args) |
|---|
| 5635 | n/a | { |
|---|
| 5636 | n/a | PyObject *_res = NULL; |
|---|
| 5637 | n/a | GDHandle value; |
|---|
| 5638 | n/a | #ifndef LMSetTheGDevice |
|---|
| 5639 | n/a | PyMac_PRECHECK(LMSetTheGDevice); |
|---|
| 5640 | n/a | #endif |
|---|
| 5641 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5642 | n/a | ResObj_Convert, &value)) |
|---|
| 5643 | n/a | return NULL; |
|---|
| 5644 | n/a | LMSetTheGDevice(value); |
|---|
| 5645 | n/a | Py_INCREF(Py_None); |
|---|
| 5646 | n/a | _res = Py_None; |
|---|
| 5647 | n/a | return _res; |
|---|
| 5648 | n/a | } |
|---|
| 5649 | n/a | |
|---|
| 5650 | n/a | static PyObject *Qd_LMGetHiliteRGB(PyObject *_self, PyObject *_args) |
|---|
| 5651 | n/a | { |
|---|
| 5652 | n/a | PyObject *_res = NULL; |
|---|
| 5653 | n/a | RGBColor hiliteRGBValue; |
|---|
| 5654 | n/a | #ifndef LMGetHiliteRGB |
|---|
| 5655 | n/a | PyMac_PRECHECK(LMGetHiliteRGB); |
|---|
| 5656 | n/a | #endif |
|---|
| 5657 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5658 | n/a | return NULL; |
|---|
| 5659 | n/a | LMGetHiliteRGB(&hiliteRGBValue); |
|---|
| 5660 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5661 | n/a | QdRGB_New, &hiliteRGBValue); |
|---|
| 5662 | n/a | return _res; |
|---|
| 5663 | n/a | } |
|---|
| 5664 | n/a | |
|---|
| 5665 | n/a | static PyObject *Qd_LMSetHiliteRGB(PyObject *_self, PyObject *_args) |
|---|
| 5666 | n/a | { |
|---|
| 5667 | n/a | PyObject *_res = NULL; |
|---|
| 5668 | n/a | RGBColor hiliteRGBValue; |
|---|
| 5669 | n/a | #ifndef LMSetHiliteRGB |
|---|
| 5670 | n/a | PyMac_PRECHECK(LMSetHiliteRGB); |
|---|
| 5671 | n/a | #endif |
|---|
| 5672 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5673 | n/a | QdRGB_Convert, &hiliteRGBValue)) |
|---|
| 5674 | n/a | return NULL; |
|---|
| 5675 | n/a | LMSetHiliteRGB(&hiliteRGBValue); |
|---|
| 5676 | n/a | Py_INCREF(Py_None); |
|---|
| 5677 | n/a | _res = Py_None; |
|---|
| 5678 | n/a | return _res; |
|---|
| 5679 | n/a | } |
|---|
| 5680 | n/a | |
|---|
| 5681 | n/a | static PyObject *Qd_LMGetCursorNew(PyObject *_self, PyObject *_args) |
|---|
| 5682 | n/a | { |
|---|
| 5683 | n/a | PyObject *_res = NULL; |
|---|
| 5684 | n/a | Boolean _rv; |
|---|
| 5685 | n/a | #ifndef LMGetCursorNew |
|---|
| 5686 | n/a | PyMac_PRECHECK(LMGetCursorNew); |
|---|
| 5687 | n/a | #endif |
|---|
| 5688 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5689 | n/a | return NULL; |
|---|
| 5690 | n/a | _rv = LMGetCursorNew(); |
|---|
| 5691 | n/a | _res = Py_BuildValue("b", |
|---|
| 5692 | n/a | _rv); |
|---|
| 5693 | n/a | return _res; |
|---|
| 5694 | n/a | } |
|---|
| 5695 | n/a | |
|---|
| 5696 | n/a | static PyObject *Qd_LMSetCursorNew(PyObject *_self, PyObject *_args) |
|---|
| 5697 | n/a | { |
|---|
| 5698 | n/a | PyObject *_res = NULL; |
|---|
| 5699 | n/a | Boolean value; |
|---|
| 5700 | n/a | #ifndef LMSetCursorNew |
|---|
| 5701 | n/a | PyMac_PRECHECK(LMSetCursorNew); |
|---|
| 5702 | n/a | #endif |
|---|
| 5703 | n/a | if (!PyArg_ParseTuple(_args, "b", |
|---|
| 5704 | n/a | &value)) |
|---|
| 5705 | n/a | return NULL; |
|---|
| 5706 | n/a | LMSetCursorNew(value); |
|---|
| 5707 | n/a | Py_INCREF(Py_None); |
|---|
| 5708 | n/a | _res = Py_None; |
|---|
| 5709 | n/a | return _res; |
|---|
| 5710 | n/a | } |
|---|
| 5711 | n/a | |
|---|
| 5712 | n/a | static PyObject *Qd_TextFont(PyObject *_self, PyObject *_args) |
|---|
| 5713 | n/a | { |
|---|
| 5714 | n/a | PyObject *_res = NULL; |
|---|
| 5715 | n/a | short font; |
|---|
| 5716 | n/a | #ifndef TextFont |
|---|
| 5717 | n/a | PyMac_PRECHECK(TextFont); |
|---|
| 5718 | n/a | #endif |
|---|
| 5719 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5720 | n/a | &font)) |
|---|
| 5721 | n/a | return NULL; |
|---|
| 5722 | n/a | TextFont(font); |
|---|
| 5723 | n/a | Py_INCREF(Py_None); |
|---|
| 5724 | n/a | _res = Py_None; |
|---|
| 5725 | n/a | return _res; |
|---|
| 5726 | n/a | } |
|---|
| 5727 | n/a | |
|---|
| 5728 | n/a | static PyObject *Qd_TextFace(PyObject *_self, PyObject *_args) |
|---|
| 5729 | n/a | { |
|---|
| 5730 | n/a | PyObject *_res = NULL; |
|---|
| 5731 | n/a | StyleParameter face; |
|---|
| 5732 | n/a | #ifndef TextFace |
|---|
| 5733 | n/a | PyMac_PRECHECK(TextFace); |
|---|
| 5734 | n/a | #endif |
|---|
| 5735 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5736 | n/a | &face)) |
|---|
| 5737 | n/a | return NULL; |
|---|
| 5738 | n/a | TextFace(face); |
|---|
| 5739 | n/a | Py_INCREF(Py_None); |
|---|
| 5740 | n/a | _res = Py_None; |
|---|
| 5741 | n/a | return _res; |
|---|
| 5742 | n/a | } |
|---|
| 5743 | n/a | |
|---|
| 5744 | n/a | static PyObject *Qd_TextMode(PyObject *_self, PyObject *_args) |
|---|
| 5745 | n/a | { |
|---|
| 5746 | n/a | PyObject *_res = NULL; |
|---|
| 5747 | n/a | short mode; |
|---|
| 5748 | n/a | #ifndef TextMode |
|---|
| 5749 | n/a | PyMac_PRECHECK(TextMode); |
|---|
| 5750 | n/a | #endif |
|---|
| 5751 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5752 | n/a | &mode)) |
|---|
| 5753 | n/a | return NULL; |
|---|
| 5754 | n/a | TextMode(mode); |
|---|
| 5755 | n/a | Py_INCREF(Py_None); |
|---|
| 5756 | n/a | _res = Py_None; |
|---|
| 5757 | n/a | return _res; |
|---|
| 5758 | n/a | } |
|---|
| 5759 | n/a | |
|---|
| 5760 | n/a | static PyObject *Qd_TextSize(PyObject *_self, PyObject *_args) |
|---|
| 5761 | n/a | { |
|---|
| 5762 | n/a | PyObject *_res = NULL; |
|---|
| 5763 | n/a | short size; |
|---|
| 5764 | n/a | #ifndef TextSize |
|---|
| 5765 | n/a | PyMac_PRECHECK(TextSize); |
|---|
| 5766 | n/a | #endif |
|---|
| 5767 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5768 | n/a | &size)) |
|---|
| 5769 | n/a | return NULL; |
|---|
| 5770 | n/a | TextSize(size); |
|---|
| 5771 | n/a | Py_INCREF(Py_None); |
|---|
| 5772 | n/a | _res = Py_None; |
|---|
| 5773 | n/a | return _res; |
|---|
| 5774 | n/a | } |
|---|
| 5775 | n/a | |
|---|
| 5776 | n/a | static PyObject *Qd_SpaceExtra(PyObject *_self, PyObject *_args) |
|---|
| 5777 | n/a | { |
|---|
| 5778 | n/a | PyObject *_res = NULL; |
|---|
| 5779 | n/a | Fixed extra; |
|---|
| 5780 | n/a | #ifndef SpaceExtra |
|---|
| 5781 | n/a | PyMac_PRECHECK(SpaceExtra); |
|---|
| 5782 | n/a | #endif |
|---|
| 5783 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5784 | n/a | PyMac_GetFixed, &extra)) |
|---|
| 5785 | n/a | return NULL; |
|---|
| 5786 | n/a | SpaceExtra(extra); |
|---|
| 5787 | n/a | Py_INCREF(Py_None); |
|---|
| 5788 | n/a | _res = Py_None; |
|---|
| 5789 | n/a | return _res; |
|---|
| 5790 | n/a | } |
|---|
| 5791 | n/a | |
|---|
| 5792 | n/a | static PyObject *Qd_DrawChar(PyObject *_self, PyObject *_args) |
|---|
| 5793 | n/a | { |
|---|
| 5794 | n/a | PyObject *_res = NULL; |
|---|
| 5795 | n/a | CharParameter ch; |
|---|
| 5796 | n/a | #ifndef DrawChar |
|---|
| 5797 | n/a | PyMac_PRECHECK(DrawChar); |
|---|
| 5798 | n/a | #endif |
|---|
| 5799 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5800 | n/a | &ch)) |
|---|
| 5801 | n/a | return NULL; |
|---|
| 5802 | n/a | DrawChar(ch); |
|---|
| 5803 | n/a | Py_INCREF(Py_None); |
|---|
| 5804 | n/a | _res = Py_None; |
|---|
| 5805 | n/a | return _res; |
|---|
| 5806 | n/a | } |
|---|
| 5807 | n/a | |
|---|
| 5808 | n/a | static PyObject *Qd_DrawString(PyObject *_self, PyObject *_args) |
|---|
| 5809 | n/a | { |
|---|
| 5810 | n/a | PyObject *_res = NULL; |
|---|
| 5811 | n/a | Str255 s; |
|---|
| 5812 | n/a | #ifndef DrawString |
|---|
| 5813 | n/a | PyMac_PRECHECK(DrawString); |
|---|
| 5814 | n/a | #endif |
|---|
| 5815 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5816 | n/a | PyMac_GetStr255, s)) |
|---|
| 5817 | n/a | return NULL; |
|---|
| 5818 | n/a | DrawString(s); |
|---|
| 5819 | n/a | Py_INCREF(Py_None); |
|---|
| 5820 | n/a | _res = Py_None; |
|---|
| 5821 | n/a | return _res; |
|---|
| 5822 | n/a | } |
|---|
| 5823 | n/a | |
|---|
| 5824 | n/a | static PyObject *Qd_MacDrawText(PyObject *_self, PyObject *_args) |
|---|
| 5825 | n/a | { |
|---|
| 5826 | n/a | PyObject *_res = NULL; |
|---|
| 5827 | n/a | char *textBuf__in__; |
|---|
| 5828 | n/a | int textBuf__in_len__; |
|---|
| 5829 | n/a | short firstByte; |
|---|
| 5830 | n/a | short byteCount; |
|---|
| 5831 | n/a | #ifndef MacDrawText |
|---|
| 5832 | n/a | PyMac_PRECHECK(MacDrawText); |
|---|
| 5833 | n/a | #endif |
|---|
| 5834 | n/a | if (!PyArg_ParseTuple(_args, "s#hh", |
|---|
| 5835 | n/a | &textBuf__in__, &textBuf__in_len__, |
|---|
| 5836 | n/a | &firstByte, |
|---|
| 5837 | n/a | &byteCount)) |
|---|
| 5838 | n/a | return NULL; |
|---|
| 5839 | n/a | /* Fool compiler warnings */ |
|---|
| 5840 | n/a | textBuf__in_len__ = textBuf__in_len__; |
|---|
| 5841 | n/a | MacDrawText(textBuf__in__, |
|---|
| 5842 | n/a | firstByte, |
|---|
| 5843 | n/a | byteCount); |
|---|
| 5844 | n/a | Py_INCREF(Py_None); |
|---|
| 5845 | n/a | _res = Py_None; |
|---|
| 5846 | n/a | return _res; |
|---|
| 5847 | n/a | } |
|---|
| 5848 | n/a | |
|---|
| 5849 | n/a | static PyObject *Qd_CharWidth(PyObject *_self, PyObject *_args) |
|---|
| 5850 | n/a | { |
|---|
| 5851 | n/a | PyObject *_res = NULL; |
|---|
| 5852 | n/a | short _rv; |
|---|
| 5853 | n/a | CharParameter ch; |
|---|
| 5854 | n/a | #ifndef CharWidth |
|---|
| 5855 | n/a | PyMac_PRECHECK(CharWidth); |
|---|
| 5856 | n/a | #endif |
|---|
| 5857 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5858 | n/a | &ch)) |
|---|
| 5859 | n/a | return NULL; |
|---|
| 5860 | n/a | _rv = CharWidth(ch); |
|---|
| 5861 | n/a | _res = Py_BuildValue("h", |
|---|
| 5862 | n/a | _rv); |
|---|
| 5863 | n/a | return _res; |
|---|
| 5864 | n/a | } |
|---|
| 5865 | n/a | |
|---|
| 5866 | n/a | static PyObject *Qd_StringWidth(PyObject *_self, PyObject *_args) |
|---|
| 5867 | n/a | { |
|---|
| 5868 | n/a | PyObject *_res = NULL; |
|---|
| 5869 | n/a | short _rv; |
|---|
| 5870 | n/a | Str255 s; |
|---|
| 5871 | n/a | #ifndef StringWidth |
|---|
| 5872 | n/a | PyMac_PRECHECK(StringWidth); |
|---|
| 5873 | n/a | #endif |
|---|
| 5874 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5875 | n/a | PyMac_GetStr255, s)) |
|---|
| 5876 | n/a | return NULL; |
|---|
| 5877 | n/a | _rv = StringWidth(s); |
|---|
| 5878 | n/a | _res = Py_BuildValue("h", |
|---|
| 5879 | n/a | _rv); |
|---|
| 5880 | n/a | return _res; |
|---|
| 5881 | n/a | } |
|---|
| 5882 | n/a | |
|---|
| 5883 | n/a | static PyObject *Qd_TextWidth(PyObject *_self, PyObject *_args) |
|---|
| 5884 | n/a | { |
|---|
| 5885 | n/a | PyObject *_res = NULL; |
|---|
| 5886 | n/a | short _rv; |
|---|
| 5887 | n/a | char *textBuf__in__; |
|---|
| 5888 | n/a | int textBuf__in_len__; |
|---|
| 5889 | n/a | short firstByte; |
|---|
| 5890 | n/a | short byteCount; |
|---|
| 5891 | n/a | #ifndef TextWidth |
|---|
| 5892 | n/a | PyMac_PRECHECK(TextWidth); |
|---|
| 5893 | n/a | #endif |
|---|
| 5894 | n/a | if (!PyArg_ParseTuple(_args, "s#hh", |
|---|
| 5895 | n/a | &textBuf__in__, &textBuf__in_len__, |
|---|
| 5896 | n/a | &firstByte, |
|---|
| 5897 | n/a | &byteCount)) |
|---|
| 5898 | n/a | return NULL; |
|---|
| 5899 | n/a | /* Fool compiler warnings */ |
|---|
| 5900 | n/a | textBuf__in_len__ = textBuf__in_len__; |
|---|
| 5901 | n/a | _rv = TextWidth(textBuf__in__, |
|---|
| 5902 | n/a | firstByte, |
|---|
| 5903 | n/a | byteCount); |
|---|
| 5904 | n/a | _res = Py_BuildValue("h", |
|---|
| 5905 | n/a | _rv); |
|---|
| 5906 | n/a | return _res; |
|---|
| 5907 | n/a | } |
|---|
| 5908 | n/a | |
|---|
| 5909 | n/a | static PyObject *Qd_GetFontInfo(PyObject *_self, PyObject *_args) |
|---|
| 5910 | n/a | { |
|---|
| 5911 | n/a | PyObject *_res = NULL; |
|---|
| 5912 | n/a | FontInfo info; |
|---|
| 5913 | n/a | #ifndef GetFontInfo |
|---|
| 5914 | n/a | PyMac_PRECHECK(GetFontInfo); |
|---|
| 5915 | n/a | #endif |
|---|
| 5916 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 5917 | n/a | return NULL; |
|---|
| 5918 | n/a | GetFontInfo(&info); |
|---|
| 5919 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5920 | n/a | QdFI_New, &info); |
|---|
| 5921 | n/a | return _res; |
|---|
| 5922 | n/a | } |
|---|
| 5923 | n/a | |
|---|
| 5924 | n/a | static PyObject *Qd_CharExtra(PyObject *_self, PyObject *_args) |
|---|
| 5925 | n/a | { |
|---|
| 5926 | n/a | PyObject *_res = NULL; |
|---|
| 5927 | n/a | Fixed extra; |
|---|
| 5928 | n/a | #ifndef CharExtra |
|---|
| 5929 | n/a | PyMac_PRECHECK(CharExtra); |
|---|
| 5930 | n/a | #endif |
|---|
| 5931 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5932 | n/a | PyMac_GetFixed, &extra)) |
|---|
| 5933 | n/a | return NULL; |
|---|
| 5934 | n/a | CharExtra(extra); |
|---|
| 5935 | n/a | Py_INCREF(Py_None); |
|---|
| 5936 | n/a | _res = Py_None; |
|---|
| 5937 | n/a | return _res; |
|---|
| 5938 | n/a | } |
|---|
| 5939 | n/a | |
|---|
| 5940 | n/a | static PyObject *Qd_TruncString(PyObject *_self, PyObject *_args) |
|---|
| 5941 | n/a | { |
|---|
| 5942 | n/a | PyObject *_res = NULL; |
|---|
| 5943 | n/a | short _rv; |
|---|
| 5944 | n/a | short width; |
|---|
| 5945 | n/a | Str255 theString; |
|---|
| 5946 | n/a | TruncCode truncWhere; |
|---|
| 5947 | n/a | #ifndef TruncString |
|---|
| 5948 | n/a | PyMac_PRECHECK(TruncString); |
|---|
| 5949 | n/a | #endif |
|---|
| 5950 | n/a | if (!PyArg_ParseTuple(_args, "hO&h", |
|---|
| 5951 | n/a | &width, |
|---|
| 5952 | n/a | PyMac_GetStr255, theString, |
|---|
| 5953 | n/a | &truncWhere)) |
|---|
| 5954 | n/a | return NULL; |
|---|
| 5955 | n/a | _rv = TruncString(width, |
|---|
| 5956 | n/a | theString, |
|---|
| 5957 | n/a | truncWhere); |
|---|
| 5958 | n/a | _res = Py_BuildValue("h", |
|---|
| 5959 | n/a | _rv); |
|---|
| 5960 | n/a | return _res; |
|---|
| 5961 | n/a | } |
|---|
| 5962 | n/a | |
|---|
| 5963 | n/a | static PyObject *Qd_SetPort(PyObject *_self, PyObject *_args) |
|---|
| 5964 | n/a | { |
|---|
| 5965 | n/a | PyObject *_res = NULL; |
|---|
| 5966 | n/a | GrafPtr thePort; |
|---|
| 5967 | n/a | #ifndef SetPort |
|---|
| 5968 | n/a | PyMac_PRECHECK(SetPort); |
|---|
| 5969 | n/a | #endif |
|---|
| 5970 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 5971 | n/a | GrafObj_Convert, &thePort)) |
|---|
| 5972 | n/a | return NULL; |
|---|
| 5973 | n/a | SetPort(thePort); |
|---|
| 5974 | n/a | Py_INCREF(Py_None); |
|---|
| 5975 | n/a | _res = Py_None; |
|---|
| 5976 | n/a | return _res; |
|---|
| 5977 | n/a | } |
|---|
| 5978 | n/a | |
|---|
| 5979 | n/a | static PyObject *Qd_GetCursor(PyObject *_self, PyObject *_args) |
|---|
| 5980 | n/a | { |
|---|
| 5981 | n/a | PyObject *_res = NULL; |
|---|
| 5982 | n/a | CursHandle _rv; |
|---|
| 5983 | n/a | short cursorID; |
|---|
| 5984 | n/a | #ifndef GetCursor |
|---|
| 5985 | n/a | PyMac_PRECHECK(GetCursor); |
|---|
| 5986 | n/a | #endif |
|---|
| 5987 | n/a | if (!PyArg_ParseTuple(_args, "h", |
|---|
| 5988 | n/a | &cursorID)) |
|---|
| 5989 | n/a | return NULL; |
|---|
| 5990 | n/a | _rv = GetCursor(cursorID); |
|---|
| 5991 | n/a | _res = Py_BuildValue("O&", |
|---|
| 5992 | n/a | ResObj_New, _rv); |
|---|
| 5993 | n/a | return _res; |
|---|
| 5994 | n/a | } |
|---|
| 5995 | n/a | |
|---|
| 5996 | n/a | static PyObject *Qd_SetCursor(PyObject *_self, PyObject *_args) |
|---|
| 5997 | n/a | { |
|---|
| 5998 | n/a | PyObject *_res = NULL; |
|---|
| 5999 | n/a | Cursor *crsr__in__; |
|---|
| 6000 | n/a | int crsr__in_len__; |
|---|
| 6001 | n/a | #ifndef SetCursor |
|---|
| 6002 | n/a | PyMac_PRECHECK(SetCursor); |
|---|
| 6003 | n/a | #endif |
|---|
| 6004 | n/a | if (!PyArg_ParseTuple(_args, "s#", |
|---|
| 6005 | n/a | (char **)&crsr__in__, &crsr__in_len__)) |
|---|
| 6006 | n/a | return NULL; |
|---|
| 6007 | n/a | if (crsr__in_len__ != sizeof(Cursor)) |
|---|
| 6008 | n/a | { |
|---|
| 6009 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Cursor)"); |
|---|
| 6010 | n/a | goto crsr__error__; |
|---|
| 6011 | n/a | } |
|---|
| 6012 | n/a | SetCursor(crsr__in__); |
|---|
| 6013 | n/a | Py_INCREF(Py_None); |
|---|
| 6014 | n/a | _res = Py_None; |
|---|
| 6015 | n/a | crsr__error__: ; |
|---|
| 6016 | n/a | return _res; |
|---|
| 6017 | n/a | } |
|---|
| 6018 | n/a | |
|---|
| 6019 | n/a | static PyObject *Qd_ShowCursor(PyObject *_self, PyObject *_args) |
|---|
| 6020 | n/a | { |
|---|
| 6021 | n/a | PyObject *_res = NULL; |
|---|
| 6022 | n/a | #ifndef ShowCursor |
|---|
| 6023 | n/a | PyMac_PRECHECK(ShowCursor); |
|---|
| 6024 | n/a | #endif |
|---|
| 6025 | n/a | if (!PyArg_ParseTuple(_args, "")) |
|---|
| 6026 | n/a | return NULL; |
|---|
| 6027 | n/a | ShowCursor(); |
|---|
| 6028 | n/a | Py_INCREF(Py_None); |
|---|
| 6029 | n/a | _res = Py_None; |
|---|
| 6030 | n/a | return _res; |
|---|
| 6031 | n/a | } |
|---|
| 6032 | n/a | |
|---|
| 6033 | n/a | static PyObject *Qd_LineTo(PyObject *_self, PyObject *_args) |
|---|
| 6034 | n/a | { |
|---|
| 6035 | n/a | PyObject *_res = NULL; |
|---|
| 6036 | n/a | short h; |
|---|
| 6037 | n/a | short v; |
|---|
| 6038 | n/a | #ifndef LineTo |
|---|
| 6039 | n/a | PyMac_PRECHECK(LineTo); |
|---|
| 6040 | n/a | #endif |
|---|
| 6041 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 6042 | n/a | &h, |
|---|
| 6043 | n/a | &v)) |
|---|
| 6044 | n/a | return NULL; |
|---|
| 6045 | n/a | LineTo(h, |
|---|
| 6046 | n/a | v); |
|---|
| 6047 | n/a | Py_INCREF(Py_None); |
|---|
| 6048 | n/a | _res = Py_None; |
|---|
| 6049 | n/a | return _res; |
|---|
| 6050 | n/a | } |
|---|
| 6051 | n/a | |
|---|
| 6052 | n/a | static PyObject *Qd_SetRect(PyObject *_self, PyObject *_args) |
|---|
| 6053 | n/a | { |
|---|
| 6054 | n/a | PyObject *_res = NULL; |
|---|
| 6055 | n/a | Rect r; |
|---|
| 6056 | n/a | short left; |
|---|
| 6057 | n/a | short top; |
|---|
| 6058 | n/a | short right; |
|---|
| 6059 | n/a | short bottom; |
|---|
| 6060 | n/a | #ifndef SetRect |
|---|
| 6061 | n/a | PyMac_PRECHECK(SetRect); |
|---|
| 6062 | n/a | #endif |
|---|
| 6063 | n/a | if (!PyArg_ParseTuple(_args, "hhhh", |
|---|
| 6064 | n/a | &left, |
|---|
| 6065 | n/a | &top, |
|---|
| 6066 | n/a | &right, |
|---|
| 6067 | n/a | &bottom)) |
|---|
| 6068 | n/a | return NULL; |
|---|
| 6069 | n/a | SetRect(&r, |
|---|
| 6070 | n/a | left, |
|---|
| 6071 | n/a | top, |
|---|
| 6072 | n/a | right, |
|---|
| 6073 | n/a | bottom); |
|---|
| 6074 | n/a | _res = Py_BuildValue("O&", |
|---|
| 6075 | n/a | PyMac_BuildRect, &r); |
|---|
| 6076 | n/a | return _res; |
|---|
| 6077 | n/a | } |
|---|
| 6078 | n/a | |
|---|
| 6079 | n/a | static PyObject *Qd_OffsetRect(PyObject *_self, PyObject *_args) |
|---|
| 6080 | n/a | { |
|---|
| 6081 | n/a | PyObject *_res = NULL; |
|---|
| 6082 | n/a | Rect r; |
|---|
| 6083 | n/a | short dh; |
|---|
| 6084 | n/a | short dv; |
|---|
| 6085 | n/a | #ifndef OffsetRect |
|---|
| 6086 | n/a | PyMac_PRECHECK(OffsetRect); |
|---|
| 6087 | n/a | #endif |
|---|
| 6088 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 6089 | n/a | PyMac_GetRect, &r, |
|---|
| 6090 | n/a | &dh, |
|---|
| 6091 | n/a | &dv)) |
|---|
| 6092 | n/a | return NULL; |
|---|
| 6093 | n/a | OffsetRect(&r, |
|---|
| 6094 | n/a | dh, |
|---|
| 6095 | n/a | dv); |
|---|
| 6096 | n/a | _res = Py_BuildValue("O&", |
|---|
| 6097 | n/a | PyMac_BuildRect, &r); |
|---|
| 6098 | n/a | return _res; |
|---|
| 6099 | n/a | } |
|---|
| 6100 | n/a | |
|---|
| 6101 | n/a | static PyObject *Qd_InsetRect(PyObject *_self, PyObject *_args) |
|---|
| 6102 | n/a | { |
|---|
| 6103 | n/a | PyObject *_res = NULL; |
|---|
| 6104 | n/a | Rect r; |
|---|
| 6105 | n/a | short dh; |
|---|
| 6106 | n/a | short dv; |
|---|
| 6107 | n/a | #ifndef InsetRect |
|---|
| 6108 | n/a | PyMac_PRECHECK(InsetRect); |
|---|
| 6109 | n/a | #endif |
|---|
| 6110 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 6111 | n/a | PyMac_GetRect, &r, |
|---|
| 6112 | n/a | &dh, |
|---|
| 6113 | n/a | &dv)) |
|---|
| 6114 | n/a | return NULL; |
|---|
| 6115 | n/a | InsetRect(&r, |
|---|
| 6116 | n/a | dh, |
|---|
| 6117 | n/a | dv); |
|---|
| 6118 | n/a | _res = Py_BuildValue("O&", |
|---|
| 6119 | n/a | PyMac_BuildRect, &r); |
|---|
| 6120 | n/a | return _res; |
|---|
| 6121 | n/a | } |
|---|
| 6122 | n/a | |
|---|
| 6123 | n/a | static PyObject *Qd_UnionRect(PyObject *_self, PyObject *_args) |
|---|
| 6124 | n/a | { |
|---|
| 6125 | n/a | PyObject *_res = NULL; |
|---|
| 6126 | n/a | Rect src1; |
|---|
| 6127 | n/a | Rect src2; |
|---|
| 6128 | n/a | Rect dstRect; |
|---|
| 6129 | n/a | #ifndef UnionRect |
|---|
| 6130 | n/a | PyMac_PRECHECK(UnionRect); |
|---|
| 6131 | n/a | #endif |
|---|
| 6132 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 6133 | n/a | PyMac_GetRect, &src1, |
|---|
| 6134 | n/a | PyMac_GetRect, &src2)) |
|---|
| 6135 | n/a | return NULL; |
|---|
| 6136 | n/a | UnionRect(&src1, |
|---|
| 6137 | n/a | &src2, |
|---|
| 6138 | n/a | &dstRect); |
|---|
| 6139 | n/a | _res = Py_BuildValue("O&", |
|---|
| 6140 | n/a | PyMac_BuildRect, &dstRect); |
|---|
| 6141 | n/a | return _res; |
|---|
| 6142 | n/a | } |
|---|
| 6143 | n/a | |
|---|
| 6144 | n/a | static PyObject *Qd_EqualRect(PyObject *_self, PyObject *_args) |
|---|
| 6145 | n/a | { |
|---|
| 6146 | n/a | PyObject *_res = NULL; |
|---|
| 6147 | n/a | Boolean _rv; |
|---|
| 6148 | n/a | Rect rect1; |
|---|
| 6149 | n/a | Rect rect2; |
|---|
| 6150 | n/a | #ifndef EqualRect |
|---|
| 6151 | n/a | PyMac_PRECHECK(EqualRect); |
|---|
| 6152 | n/a | #endif |
|---|
| 6153 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 6154 | n/a | PyMac_GetRect, &rect1, |
|---|
| 6155 | n/a | PyMac_GetRect, &rect2)) |
|---|
| 6156 | n/a | return NULL; |
|---|
| 6157 | n/a | _rv = EqualRect(&rect1, |
|---|
| 6158 | n/a | &rect2); |
|---|
| 6159 | n/a | _res = Py_BuildValue("b", |
|---|
| 6160 | n/a | _rv); |
|---|
| 6161 | n/a | return _res; |
|---|
| 6162 | n/a | } |
|---|
| 6163 | n/a | |
|---|
| 6164 | n/a | static PyObject *Qd_FrameRect(PyObject *_self, PyObject *_args) |
|---|
| 6165 | n/a | { |
|---|
| 6166 | n/a | PyObject *_res = NULL; |
|---|
| 6167 | n/a | Rect r; |
|---|
| 6168 | n/a | #ifndef FrameRect |
|---|
| 6169 | n/a | PyMac_PRECHECK(FrameRect); |
|---|
| 6170 | n/a | #endif |
|---|
| 6171 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 6172 | n/a | PyMac_GetRect, &r)) |
|---|
| 6173 | n/a | return NULL; |
|---|
| 6174 | n/a | FrameRect(&r); |
|---|
| 6175 | n/a | Py_INCREF(Py_None); |
|---|
| 6176 | n/a | _res = Py_None; |
|---|
| 6177 | n/a | return _res; |
|---|
| 6178 | n/a | } |
|---|
| 6179 | n/a | |
|---|
| 6180 | n/a | static PyObject *Qd_InvertRect(PyObject *_self, PyObject *_args) |
|---|
| 6181 | n/a | { |
|---|
| 6182 | n/a | PyObject *_res = NULL; |
|---|
| 6183 | n/a | Rect r; |
|---|
| 6184 | n/a | #ifndef InvertRect |
|---|
| 6185 | n/a | PyMac_PRECHECK(InvertRect); |
|---|
| 6186 | n/a | #endif |
|---|
| 6187 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 6188 | n/a | PyMac_GetRect, &r)) |
|---|
| 6189 | n/a | return NULL; |
|---|
| 6190 | n/a | InvertRect(&r); |
|---|
| 6191 | n/a | Py_INCREF(Py_None); |
|---|
| 6192 | n/a | _res = Py_None; |
|---|
| 6193 | n/a | return _res; |
|---|
| 6194 | n/a | } |
|---|
| 6195 | n/a | |
|---|
| 6196 | n/a | static PyObject *Qd_FillRect(PyObject *_self, PyObject *_args) |
|---|
| 6197 | n/a | { |
|---|
| 6198 | n/a | PyObject *_res = NULL; |
|---|
| 6199 | n/a | Rect r; |
|---|
| 6200 | n/a | Pattern *pat__in__; |
|---|
| 6201 | n/a | int pat__in_len__; |
|---|
| 6202 | n/a | #ifndef FillRect |
|---|
| 6203 | n/a | PyMac_PRECHECK(FillRect); |
|---|
| 6204 | n/a | #endif |
|---|
| 6205 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 6206 | n/a | PyMac_GetRect, &r, |
|---|
| 6207 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 6208 | n/a | return NULL; |
|---|
| 6209 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 6210 | n/a | { |
|---|
| 6211 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 6212 | n/a | goto pat__error__; |
|---|
| 6213 | n/a | } |
|---|
| 6214 | n/a | FillRect(&r, |
|---|
| 6215 | n/a | pat__in__); |
|---|
| 6216 | n/a | Py_INCREF(Py_None); |
|---|
| 6217 | n/a | _res = Py_None; |
|---|
| 6218 | n/a | pat__error__: ; |
|---|
| 6219 | n/a | return _res; |
|---|
| 6220 | n/a | } |
|---|
| 6221 | n/a | |
|---|
| 6222 | n/a | static PyObject *Qd_CopyRgn(PyObject *_self, PyObject *_args) |
|---|
| 6223 | n/a | { |
|---|
| 6224 | n/a | PyObject *_res = NULL; |
|---|
| 6225 | n/a | RgnHandle srcRgn; |
|---|
| 6226 | n/a | RgnHandle dstRgn; |
|---|
| 6227 | n/a | #ifndef CopyRgn |
|---|
| 6228 | n/a | PyMac_PRECHECK(CopyRgn); |
|---|
| 6229 | n/a | #endif |
|---|
| 6230 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 6231 | n/a | ResObj_Convert, &srcRgn, |
|---|
| 6232 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 6233 | n/a | return NULL; |
|---|
| 6234 | n/a | CopyRgn(srcRgn, |
|---|
| 6235 | n/a | dstRgn); |
|---|
| 6236 | n/a | Py_INCREF(Py_None); |
|---|
| 6237 | n/a | _res = Py_None; |
|---|
| 6238 | n/a | return _res; |
|---|
| 6239 | n/a | } |
|---|
| 6240 | n/a | |
|---|
| 6241 | n/a | static PyObject *Qd_SetRectRgn(PyObject *_self, PyObject *_args) |
|---|
| 6242 | n/a | { |
|---|
| 6243 | n/a | PyObject *_res = NULL; |
|---|
| 6244 | n/a | RgnHandle rgn; |
|---|
| 6245 | n/a | short left; |
|---|
| 6246 | n/a | short top; |
|---|
| 6247 | n/a | short right; |
|---|
| 6248 | n/a | short bottom; |
|---|
| 6249 | n/a | #ifndef SetRectRgn |
|---|
| 6250 | n/a | PyMac_PRECHECK(SetRectRgn); |
|---|
| 6251 | n/a | #endif |
|---|
| 6252 | n/a | if (!PyArg_ParseTuple(_args, "O&hhhh", |
|---|
| 6253 | n/a | ResObj_Convert, &rgn, |
|---|
| 6254 | n/a | &left, |
|---|
| 6255 | n/a | &top, |
|---|
| 6256 | n/a | &right, |
|---|
| 6257 | n/a | &bottom)) |
|---|
| 6258 | n/a | return NULL; |
|---|
| 6259 | n/a | SetRectRgn(rgn, |
|---|
| 6260 | n/a | left, |
|---|
| 6261 | n/a | top, |
|---|
| 6262 | n/a | right, |
|---|
| 6263 | n/a | bottom); |
|---|
| 6264 | n/a | Py_INCREF(Py_None); |
|---|
| 6265 | n/a | _res = Py_None; |
|---|
| 6266 | n/a | return _res; |
|---|
| 6267 | n/a | } |
|---|
| 6268 | n/a | |
|---|
| 6269 | n/a | static PyObject *Qd_OffsetRgn(PyObject *_self, PyObject *_args) |
|---|
| 6270 | n/a | { |
|---|
| 6271 | n/a | PyObject *_res = NULL; |
|---|
| 6272 | n/a | RgnHandle rgn; |
|---|
| 6273 | n/a | short dh; |
|---|
| 6274 | n/a | short dv; |
|---|
| 6275 | n/a | #ifndef OffsetRgn |
|---|
| 6276 | n/a | PyMac_PRECHECK(OffsetRgn); |
|---|
| 6277 | n/a | #endif |
|---|
| 6278 | n/a | if (!PyArg_ParseTuple(_args, "O&hh", |
|---|
| 6279 | n/a | ResObj_Convert, &rgn, |
|---|
| 6280 | n/a | &dh, |
|---|
| 6281 | n/a | &dv)) |
|---|
| 6282 | n/a | return NULL; |
|---|
| 6283 | n/a | OffsetRgn(rgn, |
|---|
| 6284 | n/a | dh, |
|---|
| 6285 | n/a | dv); |
|---|
| 6286 | n/a | Py_INCREF(Py_None); |
|---|
| 6287 | n/a | _res = Py_None; |
|---|
| 6288 | n/a | return _res; |
|---|
| 6289 | n/a | } |
|---|
| 6290 | n/a | |
|---|
| 6291 | n/a | static PyObject *Qd_UnionRgn(PyObject *_self, PyObject *_args) |
|---|
| 6292 | n/a | { |
|---|
| 6293 | n/a | PyObject *_res = NULL; |
|---|
| 6294 | n/a | RgnHandle srcRgnA; |
|---|
| 6295 | n/a | RgnHandle srcRgnB; |
|---|
| 6296 | n/a | RgnHandle dstRgn; |
|---|
| 6297 | n/a | #ifndef UnionRgn |
|---|
| 6298 | n/a | PyMac_PRECHECK(UnionRgn); |
|---|
| 6299 | n/a | #endif |
|---|
| 6300 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 6301 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 6302 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 6303 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 6304 | n/a | return NULL; |
|---|
| 6305 | n/a | UnionRgn(srcRgnA, |
|---|
| 6306 | n/a | srcRgnB, |
|---|
| 6307 | n/a | dstRgn); |
|---|
| 6308 | n/a | Py_INCREF(Py_None); |
|---|
| 6309 | n/a | _res = Py_None; |
|---|
| 6310 | n/a | return _res; |
|---|
| 6311 | n/a | } |
|---|
| 6312 | n/a | |
|---|
| 6313 | n/a | static PyObject *Qd_XorRgn(PyObject *_self, PyObject *_args) |
|---|
| 6314 | n/a | { |
|---|
| 6315 | n/a | PyObject *_res = NULL; |
|---|
| 6316 | n/a | RgnHandle srcRgnA; |
|---|
| 6317 | n/a | RgnHandle srcRgnB; |
|---|
| 6318 | n/a | RgnHandle dstRgn; |
|---|
| 6319 | n/a | #ifndef XorRgn |
|---|
| 6320 | n/a | PyMac_PRECHECK(XorRgn); |
|---|
| 6321 | n/a | #endif |
|---|
| 6322 | n/a | if (!PyArg_ParseTuple(_args, "O&O&O&", |
|---|
| 6323 | n/a | ResObj_Convert, &srcRgnA, |
|---|
| 6324 | n/a | ResObj_Convert, &srcRgnB, |
|---|
| 6325 | n/a | ResObj_Convert, &dstRgn)) |
|---|
| 6326 | n/a | return NULL; |
|---|
| 6327 | n/a | XorRgn(srcRgnA, |
|---|
| 6328 | n/a | srcRgnB, |
|---|
| 6329 | n/a | dstRgn); |
|---|
| 6330 | n/a | Py_INCREF(Py_None); |
|---|
| 6331 | n/a | _res = Py_None; |
|---|
| 6332 | n/a | return _res; |
|---|
| 6333 | n/a | } |
|---|
| 6334 | n/a | |
|---|
| 6335 | n/a | static PyObject *Qd_EqualRgn(PyObject *_self, PyObject *_args) |
|---|
| 6336 | n/a | { |
|---|
| 6337 | n/a | PyObject *_res = NULL; |
|---|
| 6338 | n/a | Boolean _rv; |
|---|
| 6339 | n/a | RgnHandle rgnA; |
|---|
| 6340 | n/a | RgnHandle rgnB; |
|---|
| 6341 | n/a | #ifndef EqualRgn |
|---|
| 6342 | n/a | PyMac_PRECHECK(EqualRgn); |
|---|
| 6343 | n/a | #endif |
|---|
| 6344 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 6345 | n/a | ResObj_Convert, &rgnA, |
|---|
| 6346 | n/a | ResObj_Convert, &rgnB)) |
|---|
| 6347 | n/a | return NULL; |
|---|
| 6348 | n/a | _rv = EqualRgn(rgnA, |
|---|
| 6349 | n/a | rgnB); |
|---|
| 6350 | n/a | _res = Py_BuildValue("b", |
|---|
| 6351 | n/a | _rv); |
|---|
| 6352 | n/a | return _res; |
|---|
| 6353 | n/a | } |
|---|
| 6354 | n/a | |
|---|
| 6355 | n/a | static PyObject *Qd_FrameRgn(PyObject *_self, PyObject *_args) |
|---|
| 6356 | n/a | { |
|---|
| 6357 | n/a | PyObject *_res = NULL; |
|---|
| 6358 | n/a | RgnHandle rgn; |
|---|
| 6359 | n/a | #ifndef FrameRgn |
|---|
| 6360 | n/a | PyMac_PRECHECK(FrameRgn); |
|---|
| 6361 | n/a | #endif |
|---|
| 6362 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 6363 | n/a | ResObj_Convert, &rgn)) |
|---|
| 6364 | n/a | return NULL; |
|---|
| 6365 | n/a | FrameRgn(rgn); |
|---|
| 6366 | n/a | Py_INCREF(Py_None); |
|---|
| 6367 | n/a | _res = Py_None; |
|---|
| 6368 | n/a | return _res; |
|---|
| 6369 | n/a | } |
|---|
| 6370 | n/a | |
|---|
| 6371 | n/a | static PyObject *Qd_PaintRgn(PyObject *_self, PyObject *_args) |
|---|
| 6372 | n/a | { |
|---|
| 6373 | n/a | PyObject *_res = NULL; |
|---|
| 6374 | n/a | RgnHandle rgn; |
|---|
| 6375 | n/a | #ifndef PaintRgn |
|---|
| 6376 | n/a | PyMac_PRECHECK(PaintRgn); |
|---|
| 6377 | n/a | #endif |
|---|
| 6378 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 6379 | n/a | ResObj_Convert, &rgn)) |
|---|
| 6380 | n/a | return NULL; |
|---|
| 6381 | n/a | PaintRgn(rgn); |
|---|
| 6382 | n/a | Py_INCREF(Py_None); |
|---|
| 6383 | n/a | _res = Py_None; |
|---|
| 6384 | n/a | return _res; |
|---|
| 6385 | n/a | } |
|---|
| 6386 | n/a | |
|---|
| 6387 | n/a | static PyObject *Qd_InvertRgn(PyObject *_self, PyObject *_args) |
|---|
| 6388 | n/a | { |
|---|
| 6389 | n/a | PyObject *_res = NULL; |
|---|
| 6390 | n/a | RgnHandle rgn; |
|---|
| 6391 | n/a | #ifndef InvertRgn |
|---|
| 6392 | n/a | PyMac_PRECHECK(InvertRgn); |
|---|
| 6393 | n/a | #endif |
|---|
| 6394 | n/a | if (!PyArg_ParseTuple(_args, "O&", |
|---|
| 6395 | n/a | ResObj_Convert, &rgn)) |
|---|
| 6396 | n/a | return NULL; |
|---|
| 6397 | n/a | InvertRgn(rgn); |
|---|
| 6398 | n/a | Py_INCREF(Py_None); |
|---|
| 6399 | n/a | _res = Py_None; |
|---|
| 6400 | n/a | return _res; |
|---|
| 6401 | n/a | } |
|---|
| 6402 | n/a | |
|---|
| 6403 | n/a | static PyObject *Qd_FillRgn(PyObject *_self, PyObject *_args) |
|---|
| 6404 | n/a | { |
|---|
| 6405 | n/a | PyObject *_res = NULL; |
|---|
| 6406 | n/a | RgnHandle rgn; |
|---|
| 6407 | n/a | Pattern *pat__in__; |
|---|
| 6408 | n/a | int pat__in_len__; |
|---|
| 6409 | n/a | #ifndef FillRgn |
|---|
| 6410 | n/a | PyMac_PRECHECK(FillRgn); |
|---|
| 6411 | n/a | #endif |
|---|
| 6412 | n/a | if (!PyArg_ParseTuple(_args, "O&s#", |
|---|
| 6413 | n/a | ResObj_Convert, &rgn, |
|---|
| 6414 | n/a | (char **)&pat__in__, &pat__in_len__)) |
|---|
| 6415 | n/a | return NULL; |
|---|
| 6416 | n/a | if (pat__in_len__ != sizeof(Pattern)) |
|---|
| 6417 | n/a | { |
|---|
| 6418 | n/a | PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)"); |
|---|
| 6419 | n/a | goto pat__error__; |
|---|
| 6420 | n/a | } |
|---|
| 6421 | n/a | FillRgn(rgn, |
|---|
| 6422 | n/a | pat__in__); |
|---|
| 6423 | n/a | Py_INCREF(Py_None); |
|---|
| 6424 | n/a | _res = Py_None; |
|---|
| 6425 | n/a | pat__error__: ; |
|---|
| 6426 | n/a | return _res; |
|---|
| 6427 | n/a | } |
|---|
| 6428 | n/a | |
|---|
| 6429 | n/a | static PyObject *Qd_GetPixel(PyObject *_self, PyObject *_args) |
|---|
| 6430 | n/a | { |
|---|
| 6431 | n/a | PyObject *_res = NULL; |
|---|
| 6432 | n/a | Boolean _rv; |
|---|
| 6433 | n/a | short h; |
|---|
| 6434 | n/a | short v; |
|---|
| 6435 | n/a | #ifndef GetPixel |
|---|
| 6436 | n/a | PyMac_PRECHECK(GetPixel); |
|---|
| 6437 | n/a | #endif |
|---|
| 6438 | n/a | if (!PyArg_ParseTuple(_args, "hh", |
|---|
| 6439 | n/a | &h, |
|---|
| 6440 | n/a | &v)) |
|---|
| 6441 | n/a | return NULL; |
|---|
| 6442 | n/a | _rv = GetPixel(h, |
|---|
| 6443 | n/a | v); |
|---|
| 6444 | n/a | _res = Py_BuildValue("b", |
|---|
| 6445 | n/a | _rv); |
|---|
| 6446 | n/a | return _res; |
|---|
| 6447 | n/a | } |
|---|
| 6448 | n/a | |
|---|
| 6449 | n/a | static PyObject *Qd_PtInRect(PyObject *_self, PyObject *_args) |
|---|
| 6450 | n/a | { |
|---|
| 6451 | n/a | PyObject *_res = NULL; |
|---|
| 6452 | n/a | Boolean _rv; |
|---|
| 6453 | n/a | Point pt; |
|---|
| 6454 | n/a | Rect r; |
|---|
| 6455 | n/a | #ifndef PtInRect |
|---|
| 6456 | n/a | PyMac_PRECHECK(PtInRect); |
|---|
| 6457 | n/a | #endif |
|---|
| 6458 | n/a | if (!PyArg_ParseTuple(_args, "O&O&", |
|---|
| 6459 | n/a | PyMac_GetPoint, &pt, |
|---|
| 6460 | n/a | PyMac_GetRect, &r)) |
|---|
| 6461 | n/a | return NULL; |
|---|
| 6462 | n/a | _rv = PtInRect(pt, |
|---|
| 6463 | n/a | &r); |
|---|
| 6464 | n/a | _res = Py_BuildValue("b", |
|---|
| 6465 | n/a | _rv); |
|---|
| 6466 | n/a | return _res; |
|---|
| 6467 | n/a | } |
|---|
| 6468 | n/a | |
|---|
| 6469 | n/a | static PyObject *Qd_DrawText(PyObject *_self, PyObject *_args) |
|---|
| 6470 | n/a | { |
|---|
| 6471 | n/a | PyObject *_res = NULL; |
|---|
| 6472 | n/a | char *textBuf__in__; |
|---|
| 6473 | n/a | int textBuf__in_len__; |
|---|
| 6474 | n/a | short firstByte; |
|---|
| 6475 | n/a | short byteCount; |
|---|
| 6476 | n/a | #ifndef DrawText |
|---|
| 6477 | n/a | PyMac_PRECHECK(DrawText); |
|---|
| 6478 | n/a | #endif |
|---|
| 6479 | n/a | if (!PyArg_ParseTuple(_args, "s#hh", |
|---|
| 6480 | n/a | &textBuf__in__, &textBuf__in_len__, |
|---|
| 6481 | n/a | &firstByte, |
|---|
| 6482 | n/a | &byteCount)) |
|---|
| 6483 | n/a | return NULL; |
|---|
| 6484 | n/a | /* Fool compiler warnings */ |
|---|
| 6485 | n/a | textBuf__in_len__ = textBuf__in_len__; |
|---|
| 6486 | n/a | DrawText(textBuf__in__, |
|---|
| 6487 | n/a | firstByte, |
|---|
| 6488 | n/a | byteCount); |
|---|
| 6489 | n/a | Py_INCREF(Py_None); |
|---|
| 6490 | n/a | _res = Py_None; |
|---|
| 6491 | n/a | return _res; |
|---|
| 6492 | n/a | } |
|---|
| 6493 | n/a | |
|---|
| 6494 | n/a | static PyObject *Qd_BitMap(PyObject *_self, PyObject *_args) |
|---|
| 6495 | n/a | { |
|---|
| 6496 | n/a | PyObject *_res = NULL; |
|---|
| 6497 | n/a | |
|---|
| 6498 | n/a | BitMap *ptr; |
|---|
| 6499 | n/a | PyObject *source; |
|---|
| 6500 | n/a | Rect bounds; |
|---|
| 6501 | n/a | int rowbytes; |
|---|
| 6502 | n/a | char *data; |
|---|
| 6503 | n/a | |
|---|
| 6504 | n/a | if ( !PyArg_ParseTuple(_args, "O!iO&", &PyString_Type, &source, &rowbytes, PyMac_GetRect, |
|---|
| 6505 | n/a | &bounds) ) |
|---|
| 6506 | n/a | return NULL; |
|---|
| 6507 | n/a | data = PyString_AsString(source); |
|---|
| 6508 | n/a | if ((ptr=(BitMap *)malloc(sizeof(BitMap))) == NULL ) |
|---|
| 6509 | n/a | return PyErr_NoMemory(); |
|---|
| 6510 | n/a | ptr->baseAddr = (Ptr)data; |
|---|
| 6511 | n/a | ptr->rowBytes = rowbytes; |
|---|
| 6512 | n/a | ptr->bounds = bounds; |
|---|
| 6513 | n/a | if ( (_res = BMObj_New(ptr)) == NULL ) { |
|---|
| 6514 | n/a | free(ptr); |
|---|
| 6515 | n/a | return NULL; |
|---|
| 6516 | n/a | } |
|---|
| 6517 | n/a | ((BitMapObject *)_res)->referred_object = source; |
|---|
| 6518 | n/a | Py_INCREF(source); |
|---|
| 6519 | n/a | ((BitMapObject *)_res)->referred_bitmap = ptr; |
|---|
| 6520 | n/a | return _res; |
|---|
| 6521 | n/a | |
|---|
| 6522 | n/a | } |
|---|
| 6523 | n/a | |
|---|
| 6524 | n/a | static PyObject *Qd_RawBitMap(PyObject *_self, PyObject *_args) |
|---|
| 6525 | n/a | { |
|---|
| 6526 | n/a | PyObject *_res = NULL; |
|---|
| 6527 | n/a | |
|---|
| 6528 | n/a | BitMap *ptr; |
|---|
| 6529 | n/a | PyObject *source; |
|---|
| 6530 | n/a | |
|---|
| 6531 | n/a | if ( !PyArg_ParseTuple(_args, "O!", &PyString_Type, &source) ) |
|---|
| 6532 | n/a | return NULL; |
|---|
| 6533 | n/a | if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) { |
|---|
| 6534 | n/a | PyErr_Format(PyExc_TypeError, |
|---|
| 6535 | n/a | "Argument size was %ld, should be %lu (sizeof BitMap) or %lu (sizeof PixMap)", |
|---|
| 6536 | n/a | PyString_Size(source), sizeof(BitMap), sizeof(PixMap)); |
|---|
| 6537 | n/a | return NULL; |
|---|
| 6538 | n/a | } |
|---|
| 6539 | n/a | ptr = (BitMapPtr)PyString_AsString(source); |
|---|
| 6540 | n/a | if ( (_res = BMObj_New(ptr)) == NULL ) { |
|---|
| 6541 | n/a | return NULL; |
|---|
| 6542 | n/a | } |
|---|
| 6543 | n/a | ((BitMapObject *)_res)->referred_object = source; |
|---|
| 6544 | n/a | Py_INCREF(source); |
|---|
| 6545 | n/a | return _res; |
|---|
| 6546 | n/a | |
|---|
| 6547 | n/a | } |
|---|
| 6548 | n/a | #endif /* __LP64__ */ |
|---|
| 6549 | n/a | |
|---|
| 6550 | n/a | static PyMethodDef Qd_methods[] = { |
|---|
| 6551 | n/a | #ifndef __LP64__ |
|---|
| 6552 | n/a | {"GetPort", (PyCFunction)Qd_GetPort, 1, |
|---|
| 6553 | n/a | PyDoc_STR("() -> (GrafPtr port)")}, |
|---|
| 6554 | n/a | {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1, |
|---|
| 6555 | n/a | PyDoc_STR("(short device) -> None")}, |
|---|
| 6556 | n/a | {"SetPortBits", (PyCFunction)Qd_SetPortBits, 1, |
|---|
| 6557 | n/a | PyDoc_STR("(BitMapPtr bm) -> None")}, |
|---|
| 6558 | n/a | {"PortSize", (PyCFunction)Qd_PortSize, 1, |
|---|
| 6559 | n/a | PyDoc_STR("(short width, short height) -> None")}, |
|---|
| 6560 | n/a | {"MovePortTo", (PyCFunction)Qd_MovePortTo, 1, |
|---|
| 6561 | n/a | PyDoc_STR("(short leftGlobal, short topGlobal) -> None")}, |
|---|
| 6562 | n/a | {"SetOrigin", (PyCFunction)Qd_SetOrigin, 1, |
|---|
| 6563 | n/a | PyDoc_STR("(short h, short v) -> None")}, |
|---|
| 6564 | n/a | {"SetClip", (PyCFunction)Qd_SetClip, 1, |
|---|
| 6565 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6566 | n/a | {"GetClip", (PyCFunction)Qd_GetClip, 1, |
|---|
| 6567 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6568 | n/a | {"ClipRect", (PyCFunction)Qd_ClipRect, 1, |
|---|
| 6569 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6570 | n/a | {"BackPat", (PyCFunction)Qd_BackPat, 1, |
|---|
| 6571 | n/a | PyDoc_STR("(Pattern pat) -> None")}, |
|---|
| 6572 | n/a | {"InitCursor", (PyCFunction)Qd_InitCursor, 1, |
|---|
| 6573 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6574 | n/a | {"MacSetCursor", (PyCFunction)Qd_MacSetCursor, 1, |
|---|
| 6575 | n/a | PyDoc_STR("(Cursor crsr) -> None")}, |
|---|
| 6576 | n/a | {"HideCursor", (PyCFunction)Qd_HideCursor, 1, |
|---|
| 6577 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6578 | n/a | {"MacShowCursor", (PyCFunction)Qd_MacShowCursor, 1, |
|---|
| 6579 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6580 | n/a | {"ObscureCursor", (PyCFunction)Qd_ObscureCursor, 1, |
|---|
| 6581 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6582 | n/a | {"HidePen", (PyCFunction)Qd_HidePen, 1, |
|---|
| 6583 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6584 | n/a | {"ShowPen", (PyCFunction)Qd_ShowPen, 1, |
|---|
| 6585 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6586 | n/a | {"GetPen", (PyCFunction)Qd_GetPen, 1, |
|---|
| 6587 | n/a | PyDoc_STR("() -> (Point pt)")}, |
|---|
| 6588 | n/a | {"GetPenState", (PyCFunction)Qd_GetPenState, 1, |
|---|
| 6589 | n/a | PyDoc_STR("() -> (PenState pnState)")}, |
|---|
| 6590 | n/a | {"SetPenState", (PyCFunction)Qd_SetPenState, 1, |
|---|
| 6591 | n/a | PyDoc_STR("(PenState pnState) -> None")}, |
|---|
| 6592 | n/a | {"PenSize", (PyCFunction)Qd_PenSize, 1, |
|---|
| 6593 | n/a | PyDoc_STR("(short width, short height) -> None")}, |
|---|
| 6594 | n/a | {"PenMode", (PyCFunction)Qd_PenMode, 1, |
|---|
| 6595 | n/a | PyDoc_STR("(short mode) -> None")}, |
|---|
| 6596 | n/a | {"PenPat", (PyCFunction)Qd_PenPat, 1, |
|---|
| 6597 | n/a | PyDoc_STR("(Pattern pat) -> None")}, |
|---|
| 6598 | n/a | {"PenNormal", (PyCFunction)Qd_PenNormal, 1, |
|---|
| 6599 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6600 | n/a | {"MoveTo", (PyCFunction)Qd_MoveTo, 1, |
|---|
| 6601 | n/a | PyDoc_STR("(short h, short v) -> None")}, |
|---|
| 6602 | n/a | {"Move", (PyCFunction)Qd_Move, 1, |
|---|
| 6603 | n/a | PyDoc_STR("(short dh, short dv) -> None")}, |
|---|
| 6604 | n/a | {"MacLineTo", (PyCFunction)Qd_MacLineTo, 1, |
|---|
| 6605 | n/a | PyDoc_STR("(short h, short v) -> None")}, |
|---|
| 6606 | n/a | {"Line", (PyCFunction)Qd_Line, 1, |
|---|
| 6607 | n/a | PyDoc_STR("(short dh, short dv) -> None")}, |
|---|
| 6608 | n/a | {"ForeColor", (PyCFunction)Qd_ForeColor, 1, |
|---|
| 6609 | n/a | PyDoc_STR("(long color) -> None")}, |
|---|
| 6610 | n/a | {"BackColor", (PyCFunction)Qd_BackColor, 1, |
|---|
| 6611 | n/a | PyDoc_STR("(long color) -> None")}, |
|---|
| 6612 | n/a | {"ColorBit", (PyCFunction)Qd_ColorBit, 1, |
|---|
| 6613 | n/a | PyDoc_STR("(short whichBit) -> None")}, |
|---|
| 6614 | n/a | {"MacSetRect", (PyCFunction)Qd_MacSetRect, 1, |
|---|
| 6615 | n/a | PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")}, |
|---|
| 6616 | n/a | {"MacOffsetRect", (PyCFunction)Qd_MacOffsetRect, 1, |
|---|
| 6617 | n/a | PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")}, |
|---|
| 6618 | n/a | {"MacInsetRect", (PyCFunction)Qd_MacInsetRect, 1, |
|---|
| 6619 | n/a | PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")}, |
|---|
| 6620 | n/a | {"SectRect", (PyCFunction)Qd_SectRect, 1, |
|---|
| 6621 | n/a | PyDoc_STR("(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)")}, |
|---|
| 6622 | n/a | {"MacUnionRect", (PyCFunction)Qd_MacUnionRect, 1, |
|---|
| 6623 | n/a | PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")}, |
|---|
| 6624 | n/a | {"MacEqualRect", (PyCFunction)Qd_MacEqualRect, 1, |
|---|
| 6625 | n/a | PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")}, |
|---|
| 6626 | n/a | {"EmptyRect", (PyCFunction)Qd_EmptyRect, 1, |
|---|
| 6627 | n/a | PyDoc_STR("(Rect r) -> (Boolean _rv)")}, |
|---|
| 6628 | n/a | {"MacFrameRect", (PyCFunction)Qd_MacFrameRect, 1, |
|---|
| 6629 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6630 | n/a | {"PaintRect", (PyCFunction)Qd_PaintRect, 1, |
|---|
| 6631 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6632 | n/a | {"EraseRect", (PyCFunction)Qd_EraseRect, 1, |
|---|
| 6633 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6634 | n/a | {"MacInvertRect", (PyCFunction)Qd_MacInvertRect, 1, |
|---|
| 6635 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6636 | n/a | {"MacFillRect", (PyCFunction)Qd_MacFillRect, 1, |
|---|
| 6637 | n/a | PyDoc_STR("(Rect r, Pattern pat) -> None")}, |
|---|
| 6638 | n/a | {"FrameOval", (PyCFunction)Qd_FrameOval, 1, |
|---|
| 6639 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6640 | n/a | {"PaintOval", (PyCFunction)Qd_PaintOval, 1, |
|---|
| 6641 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6642 | n/a | {"EraseOval", (PyCFunction)Qd_EraseOval, 1, |
|---|
| 6643 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6644 | n/a | {"InvertOval", (PyCFunction)Qd_InvertOval, 1, |
|---|
| 6645 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 6646 | n/a | {"FillOval", (PyCFunction)Qd_FillOval, 1, |
|---|
| 6647 | n/a | PyDoc_STR("(Rect r, Pattern pat) -> None")}, |
|---|
| 6648 | n/a | {"FrameRoundRect", (PyCFunction)Qd_FrameRoundRect, 1, |
|---|
| 6649 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")}, |
|---|
| 6650 | n/a | {"PaintRoundRect", (PyCFunction)Qd_PaintRoundRect, 1, |
|---|
| 6651 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")}, |
|---|
| 6652 | n/a | {"EraseRoundRect", (PyCFunction)Qd_EraseRoundRect, 1, |
|---|
| 6653 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")}, |
|---|
| 6654 | n/a | {"InvertRoundRect", (PyCFunction)Qd_InvertRoundRect, 1, |
|---|
| 6655 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight) -> None")}, |
|---|
| 6656 | n/a | {"FillRoundRect", (PyCFunction)Qd_FillRoundRect, 1, |
|---|
| 6657 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None")}, |
|---|
| 6658 | n/a | {"FrameArc", (PyCFunction)Qd_FrameArc, 1, |
|---|
| 6659 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")}, |
|---|
| 6660 | n/a | {"PaintArc", (PyCFunction)Qd_PaintArc, 1, |
|---|
| 6661 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")}, |
|---|
| 6662 | n/a | {"EraseArc", (PyCFunction)Qd_EraseArc, 1, |
|---|
| 6663 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")}, |
|---|
| 6664 | n/a | {"InvertArc", (PyCFunction)Qd_InvertArc, 1, |
|---|
| 6665 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle) -> None")}, |
|---|
| 6666 | n/a | {"FillArc", (PyCFunction)Qd_FillArc, 1, |
|---|
| 6667 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle, Pattern pat) -> None")}, |
|---|
| 6668 | n/a | {"NewRgn", (PyCFunction)Qd_NewRgn, 1, |
|---|
| 6669 | n/a | PyDoc_STR("() -> (RgnHandle _rv)")}, |
|---|
| 6670 | n/a | {"OpenRgn", (PyCFunction)Qd_OpenRgn, 1, |
|---|
| 6671 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6672 | n/a | {"CloseRgn", (PyCFunction)Qd_CloseRgn, 1, |
|---|
| 6673 | n/a | PyDoc_STR("(RgnHandle dstRgn) -> None")}, |
|---|
| 6674 | n/a | {"BitMapToRegion", (PyCFunction)Qd_BitMapToRegion, 1, |
|---|
| 6675 | n/a | PyDoc_STR("(RgnHandle region, BitMapPtr bMap) -> None")}, |
|---|
| 6676 | n/a | {"RgnToHandle", (PyCFunction)Qd_RgnToHandle, 1, |
|---|
| 6677 | n/a | PyDoc_STR("(RgnHandle region, Handle flattenedRgnDataHdl) -> None")}, |
|---|
| 6678 | n/a | {"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1, |
|---|
| 6679 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6680 | n/a | {"MacCopyRgn", (PyCFunction)Qd_MacCopyRgn, 1, |
|---|
| 6681 | n/a | PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")}, |
|---|
| 6682 | n/a | {"SetEmptyRgn", (PyCFunction)Qd_SetEmptyRgn, 1, |
|---|
| 6683 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6684 | n/a | {"MacSetRectRgn", (PyCFunction)Qd_MacSetRectRgn, 1, |
|---|
| 6685 | n/a | PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")}, |
|---|
| 6686 | n/a | {"RectRgn", (PyCFunction)Qd_RectRgn, 1, |
|---|
| 6687 | n/a | PyDoc_STR("(RgnHandle rgn, Rect r) -> None")}, |
|---|
| 6688 | n/a | {"MacOffsetRgn", (PyCFunction)Qd_MacOffsetRgn, 1, |
|---|
| 6689 | n/a | PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")}, |
|---|
| 6690 | n/a | {"InsetRgn", (PyCFunction)Qd_InsetRgn, 1, |
|---|
| 6691 | n/a | PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")}, |
|---|
| 6692 | n/a | {"SectRgn", (PyCFunction)Qd_SectRgn, 1, |
|---|
| 6693 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 6694 | n/a | {"MacUnionRgn", (PyCFunction)Qd_MacUnionRgn, 1, |
|---|
| 6695 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 6696 | n/a | {"DiffRgn", (PyCFunction)Qd_DiffRgn, 1, |
|---|
| 6697 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 6698 | n/a | {"MacXorRgn", (PyCFunction)Qd_MacXorRgn, 1, |
|---|
| 6699 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 6700 | n/a | {"RectInRgn", (PyCFunction)Qd_RectInRgn, 1, |
|---|
| 6701 | n/a | PyDoc_STR("(Rect r, RgnHandle rgn) -> (Boolean _rv)")}, |
|---|
| 6702 | n/a | {"MacEqualRgn", (PyCFunction)Qd_MacEqualRgn, 1, |
|---|
| 6703 | n/a | PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")}, |
|---|
| 6704 | n/a | {"EmptyRgn", (PyCFunction)Qd_EmptyRgn, 1, |
|---|
| 6705 | n/a | PyDoc_STR("(RgnHandle rgn) -> (Boolean _rv)")}, |
|---|
| 6706 | n/a | {"MacFrameRgn", (PyCFunction)Qd_MacFrameRgn, 1, |
|---|
| 6707 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6708 | n/a | {"MacPaintRgn", (PyCFunction)Qd_MacPaintRgn, 1, |
|---|
| 6709 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6710 | n/a | {"EraseRgn", (PyCFunction)Qd_EraseRgn, 1, |
|---|
| 6711 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6712 | n/a | {"MacInvertRgn", (PyCFunction)Qd_MacInvertRgn, 1, |
|---|
| 6713 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 6714 | n/a | {"MacFillRgn", (PyCFunction)Qd_MacFillRgn, 1, |
|---|
| 6715 | n/a | PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")}, |
|---|
| 6716 | n/a | {"ScrollRect", (PyCFunction)Qd_ScrollRect, 1, |
|---|
| 6717 | n/a | PyDoc_STR("(Rect r, short dh, short dv, RgnHandle updateRgn) -> None")}, |
|---|
| 6718 | n/a | {"CopyBits", (PyCFunction)Qd_CopyBits, 1, |
|---|
| 6719 | n/a | PyDoc_STR("(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")}, |
|---|
| 6720 | n/a | {"CopyMask", (PyCFunction)Qd_CopyMask, 1, |
|---|
| 6721 | n/a | PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None")}, |
|---|
| 6722 | n/a | {"OpenPicture", (PyCFunction)Qd_OpenPicture, 1, |
|---|
| 6723 | n/a | PyDoc_STR("(Rect picFrame) -> (PicHandle _rv)")}, |
|---|
| 6724 | n/a | {"PicComment", (PyCFunction)Qd_PicComment, 1, |
|---|
| 6725 | n/a | PyDoc_STR("(short kind, short dataSize, Handle dataHandle) -> None")}, |
|---|
| 6726 | n/a | {"ClosePicture", (PyCFunction)Qd_ClosePicture, 1, |
|---|
| 6727 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6728 | n/a | {"DrawPicture", (PyCFunction)Qd_DrawPicture, 1, |
|---|
| 6729 | n/a | PyDoc_STR("(PicHandle myPicture, Rect dstRect) -> None")}, |
|---|
| 6730 | n/a | {"KillPicture", (PyCFunction)Qd_KillPicture, 1, |
|---|
| 6731 | n/a | PyDoc_STR("(PicHandle myPicture) -> None")}, |
|---|
| 6732 | n/a | {"OpenPoly", (PyCFunction)Qd_OpenPoly, 1, |
|---|
| 6733 | n/a | PyDoc_STR("() -> (PolyHandle _rv)")}, |
|---|
| 6734 | n/a | {"ClosePoly", (PyCFunction)Qd_ClosePoly, 1, |
|---|
| 6735 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6736 | n/a | {"KillPoly", (PyCFunction)Qd_KillPoly, 1, |
|---|
| 6737 | n/a | PyDoc_STR("(PolyHandle poly) -> None")}, |
|---|
| 6738 | n/a | {"OffsetPoly", (PyCFunction)Qd_OffsetPoly, 1, |
|---|
| 6739 | n/a | PyDoc_STR("(PolyHandle poly, short dh, short dv) -> None")}, |
|---|
| 6740 | n/a | {"FramePoly", (PyCFunction)Qd_FramePoly, 1, |
|---|
| 6741 | n/a | PyDoc_STR("(PolyHandle poly) -> None")}, |
|---|
| 6742 | n/a | {"PaintPoly", (PyCFunction)Qd_PaintPoly, 1, |
|---|
| 6743 | n/a | PyDoc_STR("(PolyHandle poly) -> None")}, |
|---|
| 6744 | n/a | {"ErasePoly", (PyCFunction)Qd_ErasePoly, 1, |
|---|
| 6745 | n/a | PyDoc_STR("(PolyHandle poly) -> None")}, |
|---|
| 6746 | n/a | {"InvertPoly", (PyCFunction)Qd_InvertPoly, 1, |
|---|
| 6747 | n/a | PyDoc_STR("(PolyHandle poly) -> None")}, |
|---|
| 6748 | n/a | {"FillPoly", (PyCFunction)Qd_FillPoly, 1, |
|---|
| 6749 | n/a | PyDoc_STR("(PolyHandle poly, Pattern pat) -> None")}, |
|---|
| 6750 | n/a | {"SetPt", (PyCFunction)Qd_SetPt, 1, |
|---|
| 6751 | n/a | PyDoc_STR("(short h, short v) -> (Point pt)")}, |
|---|
| 6752 | n/a | {"LocalToGlobal", (PyCFunction)Qd_LocalToGlobal, 1, |
|---|
| 6753 | n/a | PyDoc_STR("(Point pt) -> (Point pt)")}, |
|---|
| 6754 | n/a | {"GlobalToLocal", (PyCFunction)Qd_GlobalToLocal, 1, |
|---|
| 6755 | n/a | PyDoc_STR("(Point pt) -> (Point pt)")}, |
|---|
| 6756 | n/a | {"Random", (PyCFunction)Qd_Random, 1, |
|---|
| 6757 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 6758 | n/a | {"MacGetPixel", (PyCFunction)Qd_MacGetPixel, 1, |
|---|
| 6759 | n/a | PyDoc_STR("(short h, short v) -> (Boolean _rv)")}, |
|---|
| 6760 | n/a | {"ScalePt", (PyCFunction)Qd_ScalePt, 1, |
|---|
| 6761 | n/a | PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")}, |
|---|
| 6762 | n/a | {"MapPt", (PyCFunction)Qd_MapPt, 1, |
|---|
| 6763 | n/a | PyDoc_STR("(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)")}, |
|---|
| 6764 | n/a | {"MapRect", (PyCFunction)Qd_MapRect, 1, |
|---|
| 6765 | n/a | PyDoc_STR("(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)")}, |
|---|
| 6766 | n/a | {"MapRgn", (PyCFunction)Qd_MapRgn, 1, |
|---|
| 6767 | n/a | PyDoc_STR("(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None")}, |
|---|
| 6768 | n/a | {"MapPoly", (PyCFunction)Qd_MapPoly, 1, |
|---|
| 6769 | n/a | PyDoc_STR("(PolyHandle poly, Rect srcRect, Rect dstRect) -> None")}, |
|---|
| 6770 | n/a | {"StdBits", (PyCFunction)Qd_StdBits, 1, |
|---|
| 6771 | n/a | PyDoc_STR("(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")}, |
|---|
| 6772 | n/a | {"AddPt", (PyCFunction)Qd_AddPt, 1, |
|---|
| 6773 | n/a | PyDoc_STR("(Point src, Point dst) -> (Point dst)")}, |
|---|
| 6774 | n/a | {"EqualPt", (PyCFunction)Qd_EqualPt, 1, |
|---|
| 6775 | n/a | PyDoc_STR("(Point pt1, Point pt2) -> (Boolean _rv)")}, |
|---|
| 6776 | n/a | {"MacPtInRect", (PyCFunction)Qd_MacPtInRect, 1, |
|---|
| 6777 | n/a | PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")}, |
|---|
| 6778 | n/a | {"Pt2Rect", (PyCFunction)Qd_Pt2Rect, 1, |
|---|
| 6779 | n/a | PyDoc_STR("(Point pt1, Point pt2) -> (Rect dstRect)")}, |
|---|
| 6780 | n/a | {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1, |
|---|
| 6781 | n/a | PyDoc_STR("(Rect r, Point pt) -> (short angle)")}, |
|---|
| 6782 | n/a | {"SubPt", (PyCFunction)Qd_SubPt, 1, |
|---|
| 6783 | n/a | PyDoc_STR("(Point src, Point dst) -> (Point dst)")}, |
|---|
| 6784 | n/a | {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1, |
|---|
| 6785 | n/a | PyDoc_STR("(Point pt, RgnHandle rgn) -> (Boolean _rv)")}, |
|---|
| 6786 | n/a | {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1, |
|---|
| 6787 | n/a | PyDoc_STR("() -> (PixMapHandle _rv)")}, |
|---|
| 6788 | n/a | {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1, |
|---|
| 6789 | n/a | PyDoc_STR("(PixMapHandle pm) -> None")}, |
|---|
| 6790 | n/a | {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1, |
|---|
| 6791 | n/a | PyDoc_STR("(PixMapHandle srcPM, PixMapHandle dstPM) -> None")}, |
|---|
| 6792 | n/a | {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1, |
|---|
| 6793 | n/a | PyDoc_STR("() -> (PixPatHandle _rv)")}, |
|---|
| 6794 | n/a | {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1, |
|---|
| 6795 | n/a | PyDoc_STR("(PixPatHandle pp) -> None")}, |
|---|
| 6796 | n/a | {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1, |
|---|
| 6797 | n/a | PyDoc_STR("(PixPatHandle srcPP, PixPatHandle dstPP) -> None")}, |
|---|
| 6798 | n/a | {"PenPixPat", (PyCFunction)Qd_PenPixPat, 1, |
|---|
| 6799 | n/a | PyDoc_STR("(PixPatHandle pp) -> None")}, |
|---|
| 6800 | n/a | {"BackPixPat", (PyCFunction)Qd_BackPixPat, 1, |
|---|
| 6801 | n/a | PyDoc_STR("(PixPatHandle pp) -> None")}, |
|---|
| 6802 | n/a | {"GetPixPat", (PyCFunction)Qd_GetPixPat, 1, |
|---|
| 6803 | n/a | PyDoc_STR("(short patID) -> (PixPatHandle _rv)")}, |
|---|
| 6804 | n/a | {"MakeRGBPat", (PyCFunction)Qd_MakeRGBPat, 1, |
|---|
| 6805 | n/a | PyDoc_STR("(PixPatHandle pp, RGBColor myColor) -> None")}, |
|---|
| 6806 | n/a | {"FillCRect", (PyCFunction)Qd_FillCRect, 1, |
|---|
| 6807 | n/a | PyDoc_STR("(Rect r, PixPatHandle pp) -> None")}, |
|---|
| 6808 | n/a | {"FillCOval", (PyCFunction)Qd_FillCOval, 1, |
|---|
| 6809 | n/a | PyDoc_STR("(Rect r, PixPatHandle pp) -> None")}, |
|---|
| 6810 | n/a | {"FillCRoundRect", (PyCFunction)Qd_FillCRoundRect, 1, |
|---|
| 6811 | n/a | PyDoc_STR("(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None")}, |
|---|
| 6812 | n/a | {"FillCArc", (PyCFunction)Qd_FillCArc, 1, |
|---|
| 6813 | n/a | PyDoc_STR("(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None")}, |
|---|
| 6814 | n/a | {"FillCRgn", (PyCFunction)Qd_FillCRgn, 1, |
|---|
| 6815 | n/a | PyDoc_STR("(RgnHandle rgn, PixPatHandle pp) -> None")}, |
|---|
| 6816 | n/a | {"FillCPoly", (PyCFunction)Qd_FillCPoly, 1, |
|---|
| 6817 | n/a | PyDoc_STR("(PolyHandle poly, PixPatHandle pp) -> None")}, |
|---|
| 6818 | n/a | {"RGBForeColor", (PyCFunction)Qd_RGBForeColor, 1, |
|---|
| 6819 | n/a | PyDoc_STR("(RGBColor color) -> None")}, |
|---|
| 6820 | n/a | {"RGBBackColor", (PyCFunction)Qd_RGBBackColor, 1, |
|---|
| 6821 | n/a | PyDoc_STR("(RGBColor color) -> None")}, |
|---|
| 6822 | n/a | {"SetCPixel", (PyCFunction)Qd_SetCPixel, 1, |
|---|
| 6823 | n/a | PyDoc_STR("(short h, short v, RGBColor cPix) -> None")}, |
|---|
| 6824 | n/a | {"SetPortPix", (PyCFunction)Qd_SetPortPix, 1, |
|---|
| 6825 | n/a | PyDoc_STR("(PixMapHandle pm) -> None")}, |
|---|
| 6826 | n/a | {"GetCPixel", (PyCFunction)Qd_GetCPixel, 1, |
|---|
| 6827 | n/a | PyDoc_STR("(short h, short v) -> (RGBColor cPix)")}, |
|---|
| 6828 | n/a | {"GetForeColor", (PyCFunction)Qd_GetForeColor, 1, |
|---|
| 6829 | n/a | PyDoc_STR("() -> (RGBColor color)")}, |
|---|
| 6830 | n/a | {"GetBackColor", (PyCFunction)Qd_GetBackColor, 1, |
|---|
| 6831 | n/a | PyDoc_STR("() -> (RGBColor color)")}, |
|---|
| 6832 | n/a | {"OpColor", (PyCFunction)Qd_OpColor, 1, |
|---|
| 6833 | n/a | PyDoc_STR("(RGBColor color) -> None")}, |
|---|
| 6834 | n/a | {"HiliteColor", (PyCFunction)Qd_HiliteColor, 1, |
|---|
| 6835 | n/a | PyDoc_STR("(RGBColor color) -> None")}, |
|---|
| 6836 | n/a | {"DisposeCTable", (PyCFunction)Qd_DisposeCTable, 1, |
|---|
| 6837 | n/a | PyDoc_STR("(CTabHandle cTable) -> None")}, |
|---|
| 6838 | n/a | {"GetCTable", (PyCFunction)Qd_GetCTable, 1, |
|---|
| 6839 | n/a | PyDoc_STR("(short ctID) -> (CTabHandle _rv)")}, |
|---|
| 6840 | n/a | {"GetCCursor", (PyCFunction)Qd_GetCCursor, 1, |
|---|
| 6841 | n/a | PyDoc_STR("(short crsrID) -> (CCrsrHandle _rv)")}, |
|---|
| 6842 | n/a | {"SetCCursor", (PyCFunction)Qd_SetCCursor, 1, |
|---|
| 6843 | n/a | PyDoc_STR("(CCrsrHandle cCrsr) -> None")}, |
|---|
| 6844 | n/a | {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1, |
|---|
| 6845 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 6846 | n/a | {"DisposeCCursor", (PyCFunction)Qd_DisposeCCursor, 1, |
|---|
| 6847 | n/a | PyDoc_STR("(CCrsrHandle cCrsr) -> None")}, |
|---|
| 6848 | n/a | {"GetMaxDevice", (PyCFunction)Qd_GetMaxDevice, 1, |
|---|
| 6849 | n/a | PyDoc_STR("(Rect globalRect) -> (GDHandle _rv)")}, |
|---|
| 6850 | n/a | {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1, |
|---|
| 6851 | n/a | PyDoc_STR("() -> (long _rv)")}, |
|---|
| 6852 | n/a | {"GetDeviceList", (PyCFunction)Qd_GetDeviceList, 1, |
|---|
| 6853 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6854 | n/a | {"GetMainDevice", (PyCFunction)Qd_GetMainDevice, 1, |
|---|
| 6855 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6856 | n/a | {"GetNextDevice", (PyCFunction)Qd_GetNextDevice, 1, |
|---|
| 6857 | n/a | PyDoc_STR("(GDHandle curDevice) -> (GDHandle _rv)")}, |
|---|
| 6858 | n/a | {"TestDeviceAttribute", (PyCFunction)Qd_TestDeviceAttribute, 1, |
|---|
| 6859 | n/a | PyDoc_STR("(GDHandle gdh, short attribute) -> (Boolean _rv)")}, |
|---|
| 6860 | n/a | {"SetDeviceAttribute", (PyCFunction)Qd_SetDeviceAttribute, 1, |
|---|
| 6861 | n/a | PyDoc_STR("(GDHandle gdh, short attribute, Boolean value) -> None")}, |
|---|
| 6862 | n/a | {"InitGDevice", (PyCFunction)Qd_InitGDevice, 1, |
|---|
| 6863 | n/a | PyDoc_STR("(short qdRefNum, long mode, GDHandle gdh) -> None")}, |
|---|
| 6864 | n/a | {"NewGDevice", (PyCFunction)Qd_NewGDevice, 1, |
|---|
| 6865 | n/a | PyDoc_STR("(short refNum, long mode) -> (GDHandle _rv)")}, |
|---|
| 6866 | n/a | {"DisposeGDevice", (PyCFunction)Qd_DisposeGDevice, 1, |
|---|
| 6867 | n/a | PyDoc_STR("(GDHandle gdh) -> None")}, |
|---|
| 6868 | n/a | {"SetGDevice", (PyCFunction)Qd_SetGDevice, 1, |
|---|
| 6869 | n/a | PyDoc_STR("(GDHandle gd) -> None")}, |
|---|
| 6870 | n/a | {"GetGDevice", (PyCFunction)Qd_GetGDevice, 1, |
|---|
| 6871 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6872 | n/a | {"Color2Index", (PyCFunction)Qd_Color2Index, 1, |
|---|
| 6873 | n/a | PyDoc_STR("(RGBColor myColor) -> (long _rv)")}, |
|---|
| 6874 | n/a | {"Index2Color", (PyCFunction)Qd_Index2Color, 1, |
|---|
| 6875 | n/a | PyDoc_STR("(long index) -> (RGBColor aColor)")}, |
|---|
| 6876 | n/a | {"InvertColor", (PyCFunction)Qd_InvertColor, 1, |
|---|
| 6877 | n/a | PyDoc_STR("() -> (RGBColor myColor)")}, |
|---|
| 6878 | n/a | {"RealColor", (PyCFunction)Qd_RealColor, 1, |
|---|
| 6879 | n/a | PyDoc_STR("(RGBColor color) -> (Boolean _rv)")}, |
|---|
| 6880 | n/a | {"GetSubTable", (PyCFunction)Qd_GetSubTable, 1, |
|---|
| 6881 | n/a | PyDoc_STR("(CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None")}, |
|---|
| 6882 | n/a | {"MakeITable", (PyCFunction)Qd_MakeITable, 1, |
|---|
| 6883 | n/a | PyDoc_STR("(CTabHandle cTabH, ITabHandle iTabH, short res) -> None")}, |
|---|
| 6884 | n/a | {"SetClientID", (PyCFunction)Qd_SetClientID, 1, |
|---|
| 6885 | n/a | PyDoc_STR("(short id) -> None")}, |
|---|
| 6886 | n/a | {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1, |
|---|
| 6887 | n/a | PyDoc_STR("(short index, Boolean protect) -> None")}, |
|---|
| 6888 | n/a | {"ReserveEntry", (PyCFunction)Qd_ReserveEntry, 1, |
|---|
| 6889 | n/a | PyDoc_STR("(short index, Boolean reserve) -> None")}, |
|---|
| 6890 | n/a | {"QDError", (PyCFunction)Qd_QDError, 1, |
|---|
| 6891 | n/a | PyDoc_STR("() -> (short _rv)")}, |
|---|
| 6892 | n/a | {"CopyDeepMask", (PyCFunction)Qd_CopyDeepMask, 1, |
|---|
| 6893 | n/a | PyDoc_STR("(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None")}, |
|---|
| 6894 | n/a | {"GetPattern", (PyCFunction)Qd_GetPattern, 1, |
|---|
| 6895 | n/a | PyDoc_STR("(short patternID) -> (PatHandle _rv)")}, |
|---|
| 6896 | n/a | {"MacGetCursor", (PyCFunction)Qd_MacGetCursor, 1, |
|---|
| 6897 | n/a | PyDoc_STR("(short cursorID) -> (CursHandle _rv)")}, |
|---|
| 6898 | n/a | {"GetPicture", (PyCFunction)Qd_GetPicture, 1, |
|---|
| 6899 | n/a | PyDoc_STR("(short pictureID) -> (PicHandle _rv)")}, |
|---|
| 6900 | n/a | {"DeltaPoint", (PyCFunction)Qd_DeltaPoint, 1, |
|---|
| 6901 | n/a | PyDoc_STR("(Point ptA, Point ptB) -> (long _rv)")}, |
|---|
| 6902 | n/a | {"ShieldCursor", (PyCFunction)Qd_ShieldCursor, 1, |
|---|
| 6903 | n/a | PyDoc_STR("(Rect shieldRect, Point offsetPt) -> None")}, |
|---|
| 6904 | n/a | {"ScreenRes", (PyCFunction)Qd_ScreenRes, 1, |
|---|
| 6905 | n/a | PyDoc_STR("() -> (short scrnHRes, short scrnVRes)")}, |
|---|
| 6906 | n/a | {"GetIndPattern", (PyCFunction)Qd_GetIndPattern, 1, |
|---|
| 6907 | n/a | PyDoc_STR("(short patternListID, short index) -> (Pattern thePat)")}, |
|---|
| 6908 | n/a | {"SlopeFromAngle", (PyCFunction)Qd_SlopeFromAngle, 1, |
|---|
| 6909 | n/a | PyDoc_STR("(short angle) -> (Fixed _rv)")}, |
|---|
| 6910 | n/a | {"AngleFromSlope", (PyCFunction)Qd_AngleFromSlope, 1, |
|---|
| 6911 | n/a | PyDoc_STR("(Fixed slope) -> (short _rv)")}, |
|---|
| 6912 | n/a | {"GetPixBounds", (PyCFunction)Qd_GetPixBounds, 1, |
|---|
| 6913 | n/a | PyDoc_STR("(PixMapHandle pixMap) -> (Rect bounds)")}, |
|---|
| 6914 | n/a | {"GetPixDepth", (PyCFunction)Qd_GetPixDepth, 1, |
|---|
| 6915 | n/a | PyDoc_STR("(PixMapHandle pixMap) -> (short _rv)")}, |
|---|
| 6916 | n/a | {"GetQDGlobalsRandomSeed", (PyCFunction)Qd_GetQDGlobalsRandomSeed, 1, |
|---|
| 6917 | n/a | PyDoc_STR("() -> (long _rv)")}, |
|---|
| 6918 | n/a | {"GetQDGlobalsScreenBits", (PyCFunction)Qd_GetQDGlobalsScreenBits, 1, |
|---|
| 6919 | n/a | PyDoc_STR("() -> (BitMap screenBits)")}, |
|---|
| 6920 | n/a | {"GetQDGlobalsArrow", (PyCFunction)Qd_GetQDGlobalsArrow, 1, |
|---|
| 6921 | n/a | PyDoc_STR("() -> (Cursor arrow)")}, |
|---|
| 6922 | n/a | {"GetQDGlobalsDarkGray", (PyCFunction)Qd_GetQDGlobalsDarkGray, 1, |
|---|
| 6923 | n/a | PyDoc_STR("() -> (Pattern dkGray)")}, |
|---|
| 6924 | n/a | {"GetQDGlobalsLightGray", (PyCFunction)Qd_GetQDGlobalsLightGray, 1, |
|---|
| 6925 | n/a | PyDoc_STR("() -> (Pattern ltGray)")}, |
|---|
| 6926 | n/a | {"GetQDGlobalsGray", (PyCFunction)Qd_GetQDGlobalsGray, 1, |
|---|
| 6927 | n/a | PyDoc_STR("() -> (Pattern gray)")}, |
|---|
| 6928 | n/a | {"GetQDGlobalsBlack", (PyCFunction)Qd_GetQDGlobalsBlack, 1, |
|---|
| 6929 | n/a | PyDoc_STR("() -> (Pattern black)")}, |
|---|
| 6930 | n/a | {"GetQDGlobalsWhite", (PyCFunction)Qd_GetQDGlobalsWhite, 1, |
|---|
| 6931 | n/a | PyDoc_STR("() -> (Pattern white)")}, |
|---|
| 6932 | n/a | {"GetQDGlobalsThePort", (PyCFunction)Qd_GetQDGlobalsThePort, 1, |
|---|
| 6933 | n/a | PyDoc_STR("() -> (CGrafPtr _rv)")}, |
|---|
| 6934 | n/a | {"SetQDGlobalsRandomSeed", (PyCFunction)Qd_SetQDGlobalsRandomSeed, 1, |
|---|
| 6935 | n/a | PyDoc_STR("(long randomSeed) -> None")}, |
|---|
| 6936 | n/a | {"SetQDGlobalsArrow", (PyCFunction)Qd_SetQDGlobalsArrow, 1, |
|---|
| 6937 | n/a | PyDoc_STR("(Cursor arrow) -> None")}, |
|---|
| 6938 | n/a | {"GetRegionBounds", (PyCFunction)Qd_GetRegionBounds, 1, |
|---|
| 6939 | n/a | PyDoc_STR("(RgnHandle region) -> (Rect bounds)")}, |
|---|
| 6940 | n/a | {"IsRegionRectangular", (PyCFunction)Qd_IsRegionRectangular, 1, |
|---|
| 6941 | n/a | PyDoc_STR("(RgnHandle region) -> (Boolean _rv)")}, |
|---|
| 6942 | n/a | {"CreateNewPort", (PyCFunction)Qd_CreateNewPort, 1, |
|---|
| 6943 | n/a | PyDoc_STR("() -> (CGrafPtr _rv)")}, |
|---|
| 6944 | n/a | {"SetQDError", (PyCFunction)Qd_SetQDError, 1, |
|---|
| 6945 | n/a | PyDoc_STR("(OSErr err) -> None")}, |
|---|
| 6946 | n/a | {"LMGetScrVRes", (PyCFunction)Qd_LMGetScrVRes, 1, |
|---|
| 6947 | n/a | PyDoc_STR("() -> (SInt16 _rv)")}, |
|---|
| 6948 | n/a | {"LMSetScrVRes", (PyCFunction)Qd_LMSetScrVRes, 1, |
|---|
| 6949 | n/a | PyDoc_STR("(SInt16 value) -> None")}, |
|---|
| 6950 | n/a | {"LMGetScrHRes", (PyCFunction)Qd_LMGetScrHRes, 1, |
|---|
| 6951 | n/a | PyDoc_STR("() -> (SInt16 _rv)")}, |
|---|
| 6952 | n/a | {"LMSetScrHRes", (PyCFunction)Qd_LMSetScrHRes, 1, |
|---|
| 6953 | n/a | PyDoc_STR("(SInt16 value) -> None")}, |
|---|
| 6954 | n/a | {"LMGetMainDevice", (PyCFunction)Qd_LMGetMainDevice, 1, |
|---|
| 6955 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6956 | n/a | {"LMSetMainDevice", (PyCFunction)Qd_LMSetMainDevice, 1, |
|---|
| 6957 | n/a | PyDoc_STR("(GDHandle value) -> None")}, |
|---|
| 6958 | n/a | {"LMGetDeviceList", (PyCFunction)Qd_LMGetDeviceList, 1, |
|---|
| 6959 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6960 | n/a | {"LMSetDeviceList", (PyCFunction)Qd_LMSetDeviceList, 1, |
|---|
| 6961 | n/a | PyDoc_STR("(GDHandle value) -> None")}, |
|---|
| 6962 | n/a | {"LMGetQDColors", (PyCFunction)Qd_LMGetQDColors, 1, |
|---|
| 6963 | n/a | PyDoc_STR("() -> (Handle _rv)")}, |
|---|
| 6964 | n/a | {"LMSetQDColors", (PyCFunction)Qd_LMSetQDColors, 1, |
|---|
| 6965 | n/a | PyDoc_STR("(Handle value) -> None")}, |
|---|
| 6966 | n/a | {"LMGetWidthListHand", (PyCFunction)Qd_LMGetWidthListHand, 1, |
|---|
| 6967 | n/a | PyDoc_STR("() -> (Handle _rv)")}, |
|---|
| 6968 | n/a | {"LMSetWidthListHand", (PyCFunction)Qd_LMSetWidthListHand, 1, |
|---|
| 6969 | n/a | PyDoc_STR("(Handle value) -> None")}, |
|---|
| 6970 | n/a | {"LMGetHiliteMode", (PyCFunction)Qd_LMGetHiliteMode, 1, |
|---|
| 6971 | n/a | PyDoc_STR("() -> (UInt8 _rv)")}, |
|---|
| 6972 | n/a | {"LMSetHiliteMode", (PyCFunction)Qd_LMSetHiliteMode, 1, |
|---|
| 6973 | n/a | PyDoc_STR("(UInt8 value) -> None")}, |
|---|
| 6974 | n/a | {"LMGetWidthTabHandle", (PyCFunction)Qd_LMGetWidthTabHandle, 1, |
|---|
| 6975 | n/a | PyDoc_STR("() -> (Handle _rv)")}, |
|---|
| 6976 | n/a | {"LMSetWidthTabHandle", (PyCFunction)Qd_LMSetWidthTabHandle, 1, |
|---|
| 6977 | n/a | PyDoc_STR("(Handle value) -> None")}, |
|---|
| 6978 | n/a | {"LMGetLastSPExtra", (PyCFunction)Qd_LMGetLastSPExtra, 1, |
|---|
| 6979 | n/a | PyDoc_STR("() -> (SInt32 _rv)")}, |
|---|
| 6980 | n/a | {"LMSetLastSPExtra", (PyCFunction)Qd_LMSetLastSPExtra, 1, |
|---|
| 6981 | n/a | PyDoc_STR("(SInt32 value) -> None")}, |
|---|
| 6982 | n/a | {"LMGetLastFOND", (PyCFunction)Qd_LMGetLastFOND, 1, |
|---|
| 6983 | n/a | PyDoc_STR("() -> (Handle _rv)")}, |
|---|
| 6984 | n/a | {"LMSetLastFOND", (PyCFunction)Qd_LMSetLastFOND, 1, |
|---|
| 6985 | n/a | PyDoc_STR("(Handle value) -> None")}, |
|---|
| 6986 | n/a | {"LMGetFractEnable", (PyCFunction)Qd_LMGetFractEnable, 1, |
|---|
| 6987 | n/a | PyDoc_STR("() -> (UInt8 _rv)")}, |
|---|
| 6988 | n/a | {"LMSetFractEnable", (PyCFunction)Qd_LMSetFractEnable, 1, |
|---|
| 6989 | n/a | PyDoc_STR("(UInt8 value) -> None")}, |
|---|
| 6990 | n/a | {"LMGetTheGDevice", (PyCFunction)Qd_LMGetTheGDevice, 1, |
|---|
| 6991 | n/a | PyDoc_STR("() -> (GDHandle _rv)")}, |
|---|
| 6992 | n/a | {"LMSetTheGDevice", (PyCFunction)Qd_LMSetTheGDevice, 1, |
|---|
| 6993 | n/a | PyDoc_STR("(GDHandle value) -> None")}, |
|---|
| 6994 | n/a | {"LMGetHiliteRGB", (PyCFunction)Qd_LMGetHiliteRGB, 1, |
|---|
| 6995 | n/a | PyDoc_STR("() -> (RGBColor hiliteRGBValue)")}, |
|---|
| 6996 | n/a | {"LMSetHiliteRGB", (PyCFunction)Qd_LMSetHiliteRGB, 1, |
|---|
| 6997 | n/a | PyDoc_STR("(RGBColor hiliteRGBValue) -> None")}, |
|---|
| 6998 | n/a | {"LMGetCursorNew", (PyCFunction)Qd_LMGetCursorNew, 1, |
|---|
| 6999 | n/a | PyDoc_STR("() -> (Boolean _rv)")}, |
|---|
| 7000 | n/a | {"LMSetCursorNew", (PyCFunction)Qd_LMSetCursorNew, 1, |
|---|
| 7001 | n/a | PyDoc_STR("(Boolean value) -> None")}, |
|---|
| 7002 | n/a | {"TextFont", (PyCFunction)Qd_TextFont, 1, |
|---|
| 7003 | n/a | PyDoc_STR("(short font) -> None")}, |
|---|
| 7004 | n/a | {"TextFace", (PyCFunction)Qd_TextFace, 1, |
|---|
| 7005 | n/a | PyDoc_STR("(StyleParameter face) -> None")}, |
|---|
| 7006 | n/a | {"TextMode", (PyCFunction)Qd_TextMode, 1, |
|---|
| 7007 | n/a | PyDoc_STR("(short mode) -> None")}, |
|---|
| 7008 | n/a | {"TextSize", (PyCFunction)Qd_TextSize, 1, |
|---|
| 7009 | n/a | PyDoc_STR("(short size) -> None")}, |
|---|
| 7010 | n/a | {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1, |
|---|
| 7011 | n/a | PyDoc_STR("(Fixed extra) -> None")}, |
|---|
| 7012 | n/a | {"DrawChar", (PyCFunction)Qd_DrawChar, 1, |
|---|
| 7013 | n/a | PyDoc_STR("(CharParameter ch) -> None")}, |
|---|
| 7014 | n/a | {"DrawString", (PyCFunction)Qd_DrawString, 1, |
|---|
| 7015 | n/a | PyDoc_STR("(Str255 s) -> None")}, |
|---|
| 7016 | n/a | {"MacDrawText", (PyCFunction)Qd_MacDrawText, 1, |
|---|
| 7017 | n/a | PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")}, |
|---|
| 7018 | n/a | {"CharWidth", (PyCFunction)Qd_CharWidth, 1, |
|---|
| 7019 | n/a | PyDoc_STR("(CharParameter ch) -> (short _rv)")}, |
|---|
| 7020 | n/a | {"StringWidth", (PyCFunction)Qd_StringWidth, 1, |
|---|
| 7021 | n/a | PyDoc_STR("(Str255 s) -> (short _rv)")}, |
|---|
| 7022 | n/a | {"TextWidth", (PyCFunction)Qd_TextWidth, 1, |
|---|
| 7023 | n/a | PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)")}, |
|---|
| 7024 | n/a | {"GetFontInfo", (PyCFunction)Qd_GetFontInfo, 1, |
|---|
| 7025 | n/a | PyDoc_STR("() -> (FontInfo info)")}, |
|---|
| 7026 | n/a | {"CharExtra", (PyCFunction)Qd_CharExtra, 1, |
|---|
| 7027 | n/a | PyDoc_STR("(Fixed extra) -> None")}, |
|---|
| 7028 | n/a | {"TruncString", (PyCFunction)Qd_TruncString, 1, |
|---|
| 7029 | n/a | PyDoc_STR("(short width, Str255 theString, TruncCode truncWhere) -> (short _rv)")}, |
|---|
| 7030 | n/a | {"SetPort", (PyCFunction)Qd_SetPort, 1, |
|---|
| 7031 | n/a | PyDoc_STR("(GrafPtr thePort) -> None")}, |
|---|
| 7032 | n/a | {"GetCursor", (PyCFunction)Qd_GetCursor, 1, |
|---|
| 7033 | n/a | PyDoc_STR("(short cursorID) -> (CursHandle _rv)")}, |
|---|
| 7034 | n/a | {"SetCursor", (PyCFunction)Qd_SetCursor, 1, |
|---|
| 7035 | n/a | PyDoc_STR("(Cursor crsr) -> None")}, |
|---|
| 7036 | n/a | {"ShowCursor", (PyCFunction)Qd_ShowCursor, 1, |
|---|
| 7037 | n/a | PyDoc_STR("() -> None")}, |
|---|
| 7038 | n/a | {"LineTo", (PyCFunction)Qd_LineTo, 1, |
|---|
| 7039 | n/a | PyDoc_STR("(short h, short v) -> None")}, |
|---|
| 7040 | n/a | {"SetRect", (PyCFunction)Qd_SetRect, 1, |
|---|
| 7041 | n/a | PyDoc_STR("(short left, short top, short right, short bottom) -> (Rect r)")}, |
|---|
| 7042 | n/a | {"OffsetRect", (PyCFunction)Qd_OffsetRect, 1, |
|---|
| 7043 | n/a | PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")}, |
|---|
| 7044 | n/a | {"InsetRect", (PyCFunction)Qd_InsetRect, 1, |
|---|
| 7045 | n/a | PyDoc_STR("(Rect r, short dh, short dv) -> (Rect r)")}, |
|---|
| 7046 | n/a | {"UnionRect", (PyCFunction)Qd_UnionRect, 1, |
|---|
| 7047 | n/a | PyDoc_STR("(Rect src1, Rect src2) -> (Rect dstRect)")}, |
|---|
| 7048 | n/a | {"EqualRect", (PyCFunction)Qd_EqualRect, 1, |
|---|
| 7049 | n/a | PyDoc_STR("(Rect rect1, Rect rect2) -> (Boolean _rv)")}, |
|---|
| 7050 | n/a | {"FrameRect", (PyCFunction)Qd_FrameRect, 1, |
|---|
| 7051 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 7052 | n/a | {"InvertRect", (PyCFunction)Qd_InvertRect, 1, |
|---|
| 7053 | n/a | PyDoc_STR("(Rect r) -> None")}, |
|---|
| 7054 | n/a | {"FillRect", (PyCFunction)Qd_FillRect, 1, |
|---|
| 7055 | n/a | PyDoc_STR("(Rect r, Pattern pat) -> None")}, |
|---|
| 7056 | n/a | {"CopyRgn", (PyCFunction)Qd_CopyRgn, 1, |
|---|
| 7057 | n/a | PyDoc_STR("(RgnHandle srcRgn, RgnHandle dstRgn) -> None")}, |
|---|
| 7058 | n/a | {"SetRectRgn", (PyCFunction)Qd_SetRectRgn, 1, |
|---|
| 7059 | n/a | PyDoc_STR("(RgnHandle rgn, short left, short top, short right, short bottom) -> None")}, |
|---|
| 7060 | n/a | {"OffsetRgn", (PyCFunction)Qd_OffsetRgn, 1, |
|---|
| 7061 | n/a | PyDoc_STR("(RgnHandle rgn, short dh, short dv) -> None")}, |
|---|
| 7062 | n/a | {"UnionRgn", (PyCFunction)Qd_UnionRgn, 1, |
|---|
| 7063 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 7064 | n/a | {"XorRgn", (PyCFunction)Qd_XorRgn, 1, |
|---|
| 7065 | n/a | PyDoc_STR("(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None")}, |
|---|
| 7066 | n/a | {"EqualRgn", (PyCFunction)Qd_EqualRgn, 1, |
|---|
| 7067 | n/a | PyDoc_STR("(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)")}, |
|---|
| 7068 | n/a | {"FrameRgn", (PyCFunction)Qd_FrameRgn, 1, |
|---|
| 7069 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 7070 | n/a | {"PaintRgn", (PyCFunction)Qd_PaintRgn, 1, |
|---|
| 7071 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 7072 | n/a | {"InvertRgn", (PyCFunction)Qd_InvertRgn, 1, |
|---|
| 7073 | n/a | PyDoc_STR("(RgnHandle rgn) -> None")}, |
|---|
| 7074 | n/a | {"FillRgn", (PyCFunction)Qd_FillRgn, 1, |
|---|
| 7075 | n/a | PyDoc_STR("(RgnHandle rgn, Pattern pat) -> None")}, |
|---|
| 7076 | n/a | {"GetPixel", (PyCFunction)Qd_GetPixel, 1, |
|---|
| 7077 | n/a | PyDoc_STR("(short h, short v) -> (Boolean _rv)")}, |
|---|
| 7078 | n/a | {"PtInRect", (PyCFunction)Qd_PtInRect, 1, |
|---|
| 7079 | n/a | PyDoc_STR("(Point pt, Rect r) -> (Boolean _rv)")}, |
|---|
| 7080 | n/a | {"DrawText", (PyCFunction)Qd_DrawText, 1, |
|---|
| 7081 | n/a | PyDoc_STR("(Buffer textBuf, short firstByte, short byteCount) -> None")}, |
|---|
| 7082 | n/a | {"BitMap", (PyCFunction)Qd_BitMap, 1, |
|---|
| 7083 | n/a | PyDoc_STR("Take (string, int, Rect) argument and create BitMap")}, |
|---|
| 7084 | n/a | {"RawBitMap", (PyCFunction)Qd_RawBitMap, 1, |
|---|
| 7085 | n/a | PyDoc_STR("Take string BitMap and turn into BitMap object")}, |
|---|
| 7086 | n/a | #endif /* __LP64__ */ |
|---|
| 7087 | n/a | {NULL, NULL, 0} |
|---|
| 7088 | n/a | }; |
|---|
| 7089 | n/a | |
|---|
| 7090 | n/a | |
|---|
| 7091 | n/a | #ifndef __LP64__ |
|---|
| 7092 | n/a | |
|---|
| 7093 | n/a | /* Like BMObj_New, but the original bitmap data structure is copied (and |
|---|
| 7094 | n/a | ** released when the object is released) |
|---|
| 7095 | n/a | */ |
|---|
| 7096 | n/a | PyObject *BMObj_NewCopied(BitMapPtr itself) |
|---|
| 7097 | n/a | { |
|---|
| 7098 | n/a | BitMapObject *it; |
|---|
| 7099 | n/a | BitMapPtr itself_copy; |
|---|
| 7100 | n/a | |
|---|
| 7101 | n/a | if ((itself_copy=(BitMapPtr)malloc(sizeof(BitMap))) == NULL) |
|---|
| 7102 | n/a | return PyErr_NoMemory(); |
|---|
| 7103 | n/a | *itself_copy = *itself; |
|---|
| 7104 | n/a | it = (BitMapObject *)BMObj_New(itself_copy); |
|---|
| 7105 | n/a | it->referred_bitmap = itself_copy; |
|---|
| 7106 | n/a | return (PyObject *)it; |
|---|
| 7107 | n/a | } |
|---|
| 7108 | n/a | |
|---|
| 7109 | n/a | #endif /* __LP64__ */ |
|---|
| 7110 | n/a | |
|---|
| 7111 | n/a | |
|---|
| 7112 | n/a | void init_Qd(void) |
|---|
| 7113 | n/a | { |
|---|
| 7114 | n/a | PyObject *m; |
|---|
| 7115 | n/a | #ifndef __LP64__ |
|---|
| 7116 | n/a | PyObject *d; |
|---|
| 7117 | n/a | |
|---|
| 7118 | n/a | |
|---|
| 7119 | n/a | |
|---|
| 7120 | n/a | PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr, BMObj_New); |
|---|
| 7121 | n/a | PyMac_INIT_TOOLBOX_OBJECT_CONVERT(BitMapPtr, BMObj_Convert); |
|---|
| 7122 | n/a | PyMac_INIT_TOOLBOX_OBJECT_NEW(GrafPtr, GrafObj_New); |
|---|
| 7123 | n/a | PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GrafPtr, GrafObj_Convert); |
|---|
| 7124 | n/a | PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr, QdRGB_New); |
|---|
| 7125 | n/a | PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor, QdRGB_Convert); |
|---|
| 7126 | n/a | |
|---|
| 7127 | n/a | #endif /* __LP64__ */ |
|---|
| 7128 | n/a | |
|---|
| 7129 | n/a | m = Py_InitModule("_Qd", Qd_methods); |
|---|
| 7130 | n/a | #ifndef __LP64__ |
|---|
| 7131 | n/a | d = PyModule_GetDict(m); |
|---|
| 7132 | n/a | Qd_Error = PyMac_GetOSErrException(); |
|---|
| 7133 | n/a | if (Qd_Error == NULL || |
|---|
| 7134 | n/a | PyDict_SetItemString(d, "Error", Qd_Error) != 0) |
|---|
| 7135 | n/a | return; |
|---|
| 7136 | n/a | GrafPort_Type.ob_type = &PyType_Type; |
|---|
| 7137 | n/a | if (PyType_Ready(&GrafPort_Type) < 0) return; |
|---|
| 7138 | n/a | Py_INCREF(&GrafPort_Type); |
|---|
| 7139 | n/a | PyModule_AddObject(m, "GrafPort", (PyObject *)&GrafPort_Type); |
|---|
| 7140 | n/a | /* Backward-compatible name */ |
|---|
| 7141 | n/a | Py_INCREF(&GrafPort_Type); |
|---|
| 7142 | n/a | PyModule_AddObject(m, "GrafPortType", (PyObject *)&GrafPort_Type); |
|---|
| 7143 | n/a | BitMap_Type.ob_type = &PyType_Type; |
|---|
| 7144 | n/a | if (PyType_Ready(&BitMap_Type) < 0) return; |
|---|
| 7145 | n/a | Py_INCREF(&BitMap_Type); |
|---|
| 7146 | n/a | PyModule_AddObject(m, "BitMap", (PyObject *)&BitMap_Type); |
|---|
| 7147 | n/a | /* Backward-compatible name */ |
|---|
| 7148 | n/a | Py_INCREF(&BitMap_Type); |
|---|
| 7149 | n/a | PyModule_AddObject(m, "BitMapType", (PyObject *)&BitMap_Type); |
|---|
| 7150 | n/a | #endif /* __LP64__ */ |
|---|
| 7151 | n/a | } |
|---|
| 7152 | n/a | |
|---|
| 7153 | n/a | /* ========================= End module _Qd ========================= */ |
|---|
| 7154 | n/a | |
|---|