Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1 | |
| 2 | /* ========================== Module waste ========================== */ |
| 3 | |
| 4 | #include "Python.h" |
| 5 | |
| 6 | |
| 7 | |
Jack Jansen | 620a766 | 2001-12-18 15:39:38 +0000 | [diff] [blame] | 8 | #ifdef _WIN32 |
| 9 | #include "pywintoolbox.h" |
| 10 | #else |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 11 | #include "macglue.h" |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 12 | #include "pymactoolbox.h" |
Jack Jansen | 620a766 | 2001-12-18 15:39:38 +0000 | [diff] [blame] | 13 | #endif |
Jack Jansen | 044d95e | 2001-09-05 15:44:37 +0000 | [diff] [blame] | 14 | |
| 15 | /* Macro to test whether a weak-loaded CFM function exists */ |
| 16 | #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ |
| 17 | PyErr_SetString(PyExc_NotImplementedError, \ |
| 18 | "Not available in this shared library/OS version"); \ |
| 19 | return NULL; \ |
| 20 | }} while(0) |
| 21 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 22 | |
| 23 | #include <WASTE.h> |
Jack Jansen | 8505ef8 | 1997-08-27 14:09:25 +0000 | [diff] [blame] | 24 | #include <WEObjectHandlers.h> |
Jack Jansen | a755e68 | 1997-09-20 17:40:22 +0000 | [diff] [blame] | 25 | #include <WETabs.h> |
Jack Jansen | 9725735 | 2002-11-18 15:26:43 +0000 | [diff] [blame] | 26 | #ifndef PyDoc_STR |
| 27 | #define PyDoc_STR(x) (x) |
| 28 | #endif |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 29 | |
| 30 | /* Exported by Qdmodule.c: */ |
| 31 | extern PyObject *QdRGB_New(RGBColor *); |
| 32 | extern int QdRGB_Convert(PyObject *, RGBColor *); |
| 33 | |
Jack Jansen | 8505ef8 | 1997-08-27 14:09:25 +0000 | [diff] [blame] | 34 | /* Exported by AEModule.c: */ |
| 35 | extern PyObject *AEDesc_New(AppleEvent *); |
| 36 | extern int AEDesc_Convert(PyObject *, AppleEvent *); |
| 37 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 38 | /* Forward declaration */ |
Jeremy Hylton | 938ace6 | 2002-07-17 16:30:39 +0000 | [diff] [blame] | 39 | static PyObject *WEOObj_New(WEObjectReference); |
| 40 | static PyObject *ExistingwasteObj_New(WEReference); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | ** Parse/generate TextStyle records |
| 44 | */ |
| 45 | static |
| 46 | PyObject *TextStyle_New(itself) |
| 47 | TextStylePtr itself; |
| 48 | { |
| 49 | |
| 50 | return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New, |
| 51 | &itself->tsColor); |
| 52 | } |
| 53 | |
| 54 | static |
| 55 | TextStyle_Convert(v, p_itself) |
| 56 | PyObject *v; |
| 57 | TextStylePtr p_itself; |
| 58 | { |
| 59 | long font, face, size; |
| 60 | |
| 61 | if( !PyArg_ParseTuple(v, "lllO&", &font, &face, &size, QdRGB_Convert, &p_itself->tsColor) ) |
| 62 | return 0; |
| 63 | p_itself->tsFont = (short)font; |
| 64 | p_itself->tsFace = (Style)face; |
| 65 | p_itself->tsSize = (short)size; |
| 66 | return 1; |
| 67 | } |
| 68 | |
| 69 | /* |
| 70 | ** Parse/generate RunInfo records |
| 71 | */ |
| 72 | static |
| 73 | PyObject *RunInfo_New(itself) |
| 74 | WERunInfo *itself; |
| 75 | { |
| 76 | |
| 77 | return Py_BuildValue("llhhO&O&", itself->runStart, itself->runEnd, itself->runHeight, |
| 78 | itself->runAscent, TextStyle_New, &itself->runStyle, WEOObj_New, itself->runObject); |
| 79 | } |
| 80 | |
| 81 | /* Conversion of long points and rects */ |
| 82 | int |
| 83 | LongRect_Convert(PyObject *v, LongRect *r) |
| 84 | { |
| 85 | return PyArg_Parse(v, "(llll)", &r->left, &r->top, &r->right, &r->bottom); |
| 86 | } |
| 87 | |
| 88 | PyObject * |
| 89 | LongRect_New(LongRect *r) |
| 90 | { |
| 91 | return Py_BuildValue("(llll)", r->left, r->top, r->right, r->bottom); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | LongPt_Convert(PyObject *v, LongPt *p) |
| 96 | { |
| 97 | return PyArg_Parse(v, "(ll)", &p->h, &p->v); |
| 98 | } |
| 99 | |
| 100 | PyObject * |
| 101 | LongPt_New(LongPt *p) |
| 102 | { |
| 103 | return Py_BuildValue("(ll)", p->h, p->v); |
| 104 | } |
| 105 | |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 106 | /* Stuff for the callbacks: */ |
| 107 | static PyObject *callbackdict; |
Jack Jansen | 25241d9 | 1996-05-20 11:30:45 +0000 | [diff] [blame] | 108 | WENewObjectUPP upp_new_handler; |
| 109 | WEDisposeObjectUPP upp_dispose_handler; |
| 110 | WEDrawObjectUPP upp_draw_handler; |
| 111 | WEClickObjectUPP upp_click_handler; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 112 | |
| 113 | static OSErr |
| 114 | any_handler(WESelector what, WEObjectReference who, PyObject *args, PyObject **rv) |
| 115 | { |
| 116 | FlavorType tp; |
| 117 | PyObject *key, *func; |
| 118 | |
| 119 | if ( args == NULL ) return errAECorruptData; |
| 120 | |
| 121 | tp = WEGetObjectType(who); |
| 122 | |
| 123 | if( (key=Py_BuildValue("O&O&", PyMac_BuildOSType, tp, PyMac_BuildOSType, what)) == NULL) |
| 124 | return errAECorruptData; |
| 125 | if( (func = PyDict_GetItem(callbackdict, key)) == NULL ) { |
| 126 | Py_DECREF(key); |
| 127 | return errAEHandlerNotFound; |
| 128 | } |
| 129 | Py_INCREF(func); |
| 130 | *rv = PyEval_CallObject(func, args); |
| 131 | Py_DECREF(func); |
| 132 | Py_DECREF(key); |
| 133 | if ( *rv == NULL ) { |
Jack Jansen | deff89c | 1998-10-12 20:53:15 +0000 | [diff] [blame] | 134 | PySys_WriteStderr("--Exception in callback: "); |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 135 | PyErr_Print(); |
| 136 | return errAEReplyNotArrived; |
| 137 | } |
| 138 | return 0; |
| 139 | } |
| 140 | |
| 141 | static pascal OSErr |
| 142 | my_new_handler(Point *objectSize, WEObjectReference objref) |
| 143 | { |
| 144 | PyObject *args=NULL, *rv=NULL; |
| 145 | OSErr err; |
| 146 | |
| 147 | args=Py_BuildValue("(O&)", WEOObj_New, objref); |
| 148 | err = any_handler(weNewHandler, objref, args, &rv); |
| 149 | if (!err) { |
| 150 | if (!PyMac_GetPoint(rv, objectSize) ) |
| 151 | err = errAECoercionFail; |
| 152 | } |
| 153 | if ( args ) Py_DECREF(args); |
| 154 | if ( rv ) Py_DECREF(rv); |
| 155 | return err; |
| 156 | } |
| 157 | |
| 158 | static pascal OSErr |
| 159 | my_dispose_handler(WEObjectReference objref) |
| 160 | { |
| 161 | PyObject *args=NULL, *rv=NULL; |
| 162 | OSErr err; |
| 163 | |
| 164 | args=Py_BuildValue("(O&)", WEOObj_New, objref); |
| 165 | err = any_handler(weDisposeHandler, objref, args, &rv); |
| 166 | if ( args ) Py_DECREF(args); |
| 167 | if ( rv ) Py_DECREF(rv); |
| 168 | return err; |
| 169 | } |
| 170 | |
| 171 | static pascal OSErr |
Jack Jansen | 6b9289f | 2001-06-20 21:21:07 +0000 | [diff] [blame] | 172 | my_draw_handler(const Rect *destRect, WEObjectReference objref) |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 173 | { |
| 174 | PyObject *args=NULL, *rv=NULL; |
| 175 | OSErr err; |
| 176 | |
| 177 | args=Py_BuildValue("O&O&", PyMac_BuildRect, destRect, WEOObj_New, objref); |
| 178 | err = any_handler(weDrawHandler, objref, args, &rv); |
| 179 | if ( args ) Py_DECREF(args); |
| 180 | if ( rv ) Py_DECREF(rv); |
| 181 | return err; |
| 182 | } |
| 183 | |
| 184 | static pascal Boolean |
| 185 | my_click_handler(Point hitPt, EventModifiers modifiers, |
| 186 | unsigned long clickTime, WEObjectReference objref) |
| 187 | { |
| 188 | PyObject *args=NULL, *rv=NULL; |
| 189 | int retvalue; |
| 190 | OSErr err; |
| 191 | |
| 192 | args=Py_BuildValue("O&llO&", PyMac_BuildPoint, hitPt, |
| 193 | (long)modifiers, (long)clickTime, WEOObj_New, objref); |
| 194 | err = any_handler(weClickHandler, objref, args, &rv); |
| 195 | if (!err) |
| 196 | retvalue = PyInt_AsLong(rv); |
| 197 | else |
| 198 | retvalue = 0; |
| 199 | if ( args ) Py_DECREF(args); |
| 200 | if ( rv ) Py_DECREF(rv); |
| 201 | return retvalue; |
| 202 | } |
| 203 | |
| 204 | |
| 205 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 206 | static PyObject *waste_Error; |
| 207 | |
| 208 | /* ------------------------ Object type WEO ------------------------- */ |
| 209 | |
| 210 | PyTypeObject WEO_Type; |
| 211 | |
| 212 | #define WEOObj_Check(x) ((x)->ob_type == &WEO_Type) |
| 213 | |
| 214 | typedef struct WEOObject { |
| 215 | PyObject_HEAD |
| 216 | WEObjectReference ob_itself; |
| 217 | } WEOObject; |
| 218 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 219 | PyObject *WEOObj_New(WEObjectReference itself) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 220 | { |
| 221 | WEOObject *it; |
| 222 | if (itself == NULL) { |
| 223 | Py_INCREF(Py_None); |
| 224 | return Py_None; |
| 225 | } |
| 226 | it = PyObject_NEW(WEOObject, &WEO_Type); |
| 227 | if (it == NULL) return NULL; |
| 228 | it->ob_itself = itself; |
| 229 | return (PyObject *)it; |
| 230 | } |
Jack Jansen | 044d95e | 2001-09-05 15:44:37 +0000 | [diff] [blame] | 231 | int WEOObj_Convert(PyObject *v, WEObjectReference *p_itself) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 232 | { |
| 233 | if (!WEOObj_Check(v)) |
| 234 | { |
| 235 | PyErr_SetString(PyExc_TypeError, "WEO required"); |
| 236 | return 0; |
| 237 | } |
| 238 | *p_itself = ((WEOObject *)v)->ob_itself; |
| 239 | return 1; |
| 240 | } |
| 241 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 242 | static void WEOObj_dealloc(WEOObject *self) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 243 | { |
| 244 | /* Cleanup of self->ob_itself goes here */ |
Jack Jansen | 033b79c | 2002-04-23 22:46:01 +0000 | [diff] [blame] | 245 | PyObject_Del(self); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 248 | static PyObject *WEOObj_WEGetObjectType(WEOObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 249 | { |
| 250 | PyObject *_res = NULL; |
| 251 | FlavorType _rv; |
| 252 | if (!PyArg_ParseTuple(_args, "")) |
| 253 | return NULL; |
| 254 | _rv = WEGetObjectType(_self->ob_itself); |
| 255 | _res = Py_BuildValue("O&", |
| 256 | PyMac_BuildOSType, _rv); |
| 257 | return _res; |
| 258 | } |
| 259 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 260 | static PyObject *WEOObj_WEGetObjectDataHandle(WEOObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 261 | { |
| 262 | PyObject *_res = NULL; |
| 263 | Handle _rv; |
| 264 | if (!PyArg_ParseTuple(_args, "")) |
| 265 | return NULL; |
| 266 | _rv = WEGetObjectDataHandle(_self->ob_itself); |
| 267 | _res = Py_BuildValue("O&", |
| 268 | ResObj_New, _rv); |
| 269 | return _res; |
| 270 | } |
| 271 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 272 | static PyObject *WEOObj_WEGetObjectOwner(WEOObject *_self, PyObject *_args) |
| 273 | { |
| 274 | PyObject *_res = NULL; |
| 275 | WEReference _rv; |
| 276 | if (!PyArg_ParseTuple(_args, "")) |
| 277 | return NULL; |
| 278 | _rv = WEGetObjectOwner(_self->ob_itself); |
| 279 | _res = Py_BuildValue("O&", |
| 280 | ExistingwasteObj_New, _rv); |
| 281 | return _res; |
| 282 | } |
| 283 | |
| 284 | static PyObject *WEOObj_WEGetObjectOffset(WEOObject *_self, PyObject *_args) |
| 285 | { |
| 286 | PyObject *_res = NULL; |
| 287 | SInt32 _rv; |
| 288 | if (!PyArg_ParseTuple(_args, "")) |
| 289 | return NULL; |
| 290 | _rv = WEGetObjectOffset(_self->ob_itself); |
| 291 | _res = Py_BuildValue("l", |
| 292 | _rv); |
| 293 | return _res; |
| 294 | } |
| 295 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 296 | static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 297 | { |
| 298 | PyObject *_res = NULL; |
| 299 | Point _rv; |
| 300 | if (!PyArg_ParseTuple(_args, "")) |
| 301 | return NULL; |
| 302 | _rv = WEGetObjectSize(_self->ob_itself); |
| 303 | _res = Py_BuildValue("O&", |
| 304 | PyMac_BuildPoint, _rv); |
| 305 | return _res; |
| 306 | } |
| 307 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 308 | static PyObject *WEOObj_WESetObjectSize(WEOObject *_self, PyObject *_args) |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 309 | { |
| 310 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 311 | OSErr _err; |
| 312 | Point inObjectSize; |
| 313 | if (!PyArg_ParseTuple(_args, "O&", |
| 314 | PyMac_GetPoint, &inObjectSize)) |
| 315 | return NULL; |
| 316 | _err = WESetObjectSize(_self->ob_itself, |
| 317 | inObjectSize); |
| 318 | if (_err != noErr) return PyMac_Error(_err); |
| 319 | Py_INCREF(Py_None); |
| 320 | _res = Py_None; |
| 321 | return _res; |
| 322 | } |
| 323 | |
| 324 | static PyObject *WEOObj_WEGetObjectFrame(WEOObject *_self, PyObject *_args) |
| 325 | { |
| 326 | PyObject *_res = NULL; |
| 327 | OSErr _err; |
| 328 | LongRect outObjectFrame; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 329 | if (!PyArg_ParseTuple(_args, "")) |
| 330 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 331 | _err = WEGetObjectFrame(_self->ob_itself, |
| 332 | &outObjectFrame); |
| 333 | if (_err != noErr) return PyMac_Error(_err); |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 334 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 335 | LongRect_New, &outObjectFrame); |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 336 | return _res; |
| 337 | } |
| 338 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 339 | static PyObject *WEOObj_WEGetObjectRefCon(WEOObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 340 | { |
| 341 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 342 | SInt32 _rv; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 343 | if (!PyArg_ParseTuple(_args, "")) |
| 344 | return NULL; |
| 345 | _rv = WEGetObjectRefCon(_self->ob_itself); |
| 346 | _res = Py_BuildValue("l", |
| 347 | _rv); |
| 348 | return _res; |
| 349 | } |
| 350 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 351 | static PyObject *WEOObj_WESetObjectRefCon(WEOObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 352 | { |
| 353 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 354 | SInt32 inRefCon; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 355 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 356 | &inRefCon)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 357 | return NULL; |
| 358 | WESetObjectRefCon(_self->ob_itself, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 359 | inRefCon); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 360 | Py_INCREF(Py_None); |
| 361 | _res = Py_None; |
| 362 | return _res; |
| 363 | } |
| 364 | |
| 365 | static PyMethodDef WEOObj_methods[] = { |
| 366 | {"WEGetObjectType", (PyCFunction)WEOObj_WEGetObjectType, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 367 | PyDoc_STR("() -> (FlavorType _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 368 | {"WEGetObjectDataHandle", (PyCFunction)WEOObj_WEGetObjectDataHandle, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 369 | PyDoc_STR("() -> (Handle _rv)")}, |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 370 | {"WEGetObjectOwner", (PyCFunction)WEOObj_WEGetObjectOwner, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 371 | PyDoc_STR("() -> (WEReference _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 372 | {"WEGetObjectOffset", (PyCFunction)WEOObj_WEGetObjectOffset, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 373 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 374 | {"WEGetObjectSize", (PyCFunction)WEOObj_WEGetObjectSize, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 375 | PyDoc_STR("() -> (Point _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 376 | {"WESetObjectSize", (PyCFunction)WEOObj_WESetObjectSize, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 377 | PyDoc_STR("(Point inObjectSize) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 378 | {"WEGetObjectFrame", (PyCFunction)WEOObj_WEGetObjectFrame, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 379 | PyDoc_STR("() -> (LongRect outObjectFrame)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 380 | {"WEGetObjectRefCon", (PyCFunction)WEOObj_WEGetObjectRefCon, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 381 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 382 | {"WESetObjectRefCon", (PyCFunction)WEOObj_WESetObjectRefCon, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 383 | PyDoc_STR("(SInt32 inRefCon) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 384 | {NULL, NULL, 0} |
| 385 | }; |
| 386 | |
| 387 | PyMethodChain WEOObj_chain = { WEOObj_methods, NULL }; |
| 388 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 389 | static PyObject *WEOObj_getattr(WEOObject *self, char *name) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 390 | { |
| 391 | return Py_FindMethodInChain(&WEOObj_chain, (PyObject *)self, name); |
| 392 | } |
| 393 | |
| 394 | #define WEOObj_setattr NULL |
| 395 | |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 396 | #define WEOObj_compare NULL |
| 397 | |
| 398 | #define WEOObj_repr NULL |
| 399 | |
| 400 | #define WEOObj_hash NULL |
| 401 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 402 | PyTypeObject WEO_Type = { |
Jack Jansen | b3be216 | 2001-11-30 14:16:36 +0000 | [diff] [blame] | 403 | PyObject_HEAD_INIT(NULL) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 404 | 0, /*ob_size*/ |
Guido van Rossum | 1464839 | 2001-12-08 18:02:58 +0000 | [diff] [blame] | 405 | "waste.WEO", /*tp_name*/ |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 406 | sizeof(WEOObject), /*tp_basicsize*/ |
| 407 | 0, /*tp_itemsize*/ |
| 408 | /* methods */ |
| 409 | (destructor) WEOObj_dealloc, /*tp_dealloc*/ |
| 410 | 0, /*tp_print*/ |
| 411 | (getattrfunc) WEOObj_getattr, /*tp_getattr*/ |
| 412 | (setattrfunc) WEOObj_setattr, /*tp_setattr*/ |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 413 | (cmpfunc) WEOObj_compare, /*tp_compare*/ |
| 414 | (reprfunc) WEOObj_repr, /*tp_repr*/ |
| 415 | (PyNumberMethods *)0, /* tp_as_number */ |
| 416 | (PySequenceMethods *)0, /* tp_as_sequence */ |
| 417 | (PyMappingMethods *)0, /* tp_as_mapping */ |
| 418 | (hashfunc) WEOObj_hash, /*tp_hash*/ |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 419 | }; |
| 420 | |
| 421 | /* ---------------------- End object type WEO ----------------------- */ |
| 422 | |
| 423 | |
| 424 | /* ----------------------- Object type waste ------------------------ */ |
| 425 | |
| 426 | PyTypeObject waste_Type; |
| 427 | |
| 428 | #define wasteObj_Check(x) ((x)->ob_type == &waste_Type) |
| 429 | |
| 430 | typedef struct wasteObject { |
| 431 | PyObject_HEAD |
| 432 | WEReference ob_itself; |
| 433 | } wasteObject; |
| 434 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 435 | PyObject *wasteObj_New(WEReference itself) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 436 | { |
| 437 | wasteObject *it; |
| 438 | if (itself == NULL) { |
| 439 | PyErr_SetString(waste_Error,"Cannot create null WE"); |
| 440 | return NULL; |
| 441 | } |
| 442 | it = PyObject_NEW(wasteObject, &waste_Type); |
| 443 | if (it == NULL) return NULL; |
| 444 | it->ob_itself = itself; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 445 | WESetInfo(weRefCon, (void *)&it, itself); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 446 | return (PyObject *)it; |
| 447 | } |
Jack Jansen | 044d95e | 2001-09-05 15:44:37 +0000 | [diff] [blame] | 448 | int wasteObj_Convert(PyObject *v, WEReference *p_itself) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 449 | { |
| 450 | if (!wasteObj_Check(v)) |
| 451 | { |
| 452 | PyErr_SetString(PyExc_TypeError, "waste required"); |
| 453 | return 0; |
| 454 | } |
| 455 | *p_itself = ((wasteObject *)v)->ob_itself; |
| 456 | return 1; |
| 457 | } |
| 458 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 459 | static void wasteObj_dealloc(wasteObject *self) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 460 | { |
| 461 | WEDispose(self->ob_itself); |
Jack Jansen | 033b79c | 2002-04-23 22:46:01 +0000 | [diff] [blame] | 462 | PyObject_Del(self); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 463 | } |
| 464 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 465 | static PyObject *wasteObj_WEGetText(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 466 | { |
| 467 | PyObject *_res = NULL; |
| 468 | Handle _rv; |
| 469 | if (!PyArg_ParseTuple(_args, "")) |
| 470 | return NULL; |
| 471 | _rv = WEGetText(_self->ob_itself); |
| 472 | _res = Py_BuildValue("O&", |
| 473 | ResObj_New, _rv); |
| 474 | return _res; |
| 475 | } |
| 476 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 477 | static PyObject *wasteObj_WEGetChar(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 478 | { |
| 479 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 480 | SInt16 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 481 | SInt32 inOffset; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 482 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 483 | &inOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 484 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 485 | _rv = WEGetChar(inOffset, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 486 | _self->ob_itself); |
| 487 | _res = Py_BuildValue("h", |
| 488 | _rv); |
| 489 | return _res; |
| 490 | } |
| 491 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 492 | static PyObject *wasteObj_WEGetTextLength(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 493 | { |
| 494 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 495 | SInt32 _rv; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 496 | if (!PyArg_ParseTuple(_args, "")) |
| 497 | return NULL; |
| 498 | _rv = WEGetTextLength(_self->ob_itself); |
| 499 | _res = Py_BuildValue("l", |
| 500 | _rv); |
| 501 | return _res; |
| 502 | } |
| 503 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 504 | static PyObject *wasteObj_WEGetSelection(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 505 | { |
| 506 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 507 | SInt32 outSelStart; |
| 508 | SInt32 outSelEnd; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 509 | if (!PyArg_ParseTuple(_args, "")) |
| 510 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 511 | WEGetSelection(&outSelStart, |
| 512 | &outSelEnd, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 513 | _self->ob_itself); |
| 514 | _res = Py_BuildValue("ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 515 | outSelStart, |
| 516 | outSelEnd); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 517 | return _res; |
| 518 | } |
| 519 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 520 | static PyObject *wasteObj_WEGetDestRect(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 521 | { |
| 522 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 523 | LongRect outDestRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 524 | if (!PyArg_ParseTuple(_args, "")) |
| 525 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 526 | WEGetDestRect(&outDestRect, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 527 | _self->ob_itself); |
| 528 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 529 | LongRect_New, &outDestRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 530 | return _res; |
| 531 | } |
| 532 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 533 | static PyObject *wasteObj_WEGetViewRect(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 534 | { |
| 535 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 536 | LongRect outViewRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 537 | if (!PyArg_ParseTuple(_args, "")) |
| 538 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 539 | WEGetViewRect(&outViewRect, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 540 | _self->ob_itself); |
| 541 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 542 | LongRect_New, &outViewRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 543 | return _res; |
| 544 | } |
| 545 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 546 | static PyObject *wasteObj_WEIsActive(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 547 | { |
| 548 | PyObject *_res = NULL; |
| 549 | Boolean _rv; |
| 550 | if (!PyArg_ParseTuple(_args, "")) |
| 551 | return NULL; |
| 552 | _rv = WEIsActive(_self->ob_itself); |
| 553 | _res = Py_BuildValue("b", |
| 554 | _rv); |
| 555 | return _res; |
| 556 | } |
| 557 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 558 | static PyObject *wasteObj_WEGetClickCount(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 559 | { |
| 560 | PyObject *_res = NULL; |
| 561 | UInt16 _rv; |
| 562 | if (!PyArg_ParseTuple(_args, "")) |
| 563 | return NULL; |
| 564 | _rv = WEGetClickCount(_self->ob_itself); |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 565 | _res = Py_BuildValue("H", |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 566 | _rv); |
| 567 | return _res; |
| 568 | } |
| 569 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 570 | static PyObject *wasteObj_WESetSelection(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 571 | { |
| 572 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 573 | SInt32 inSelStart; |
| 574 | SInt32 inSelEnd; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 575 | if (!PyArg_ParseTuple(_args, "ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 576 | &inSelStart, |
| 577 | &inSelEnd)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 578 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 579 | WESetSelection(inSelStart, |
| 580 | inSelEnd, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 581 | _self->ob_itself); |
| 582 | Py_INCREF(Py_None); |
| 583 | _res = Py_None; |
| 584 | return _res; |
| 585 | } |
| 586 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 587 | static PyObject *wasteObj_WESetDestRect(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 588 | { |
| 589 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 590 | LongRect inDestRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 591 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 592 | LongRect_Convert, &inDestRect)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 593 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 594 | WESetDestRect(&inDestRect, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 595 | _self->ob_itself); |
| 596 | Py_INCREF(Py_None); |
| 597 | _res = Py_None; |
| 598 | return _res; |
| 599 | } |
| 600 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 601 | static PyObject *wasteObj_WESetViewRect(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 602 | { |
| 603 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 604 | LongRect inViewRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 605 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 606 | LongRect_Convert, &inViewRect)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 607 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 608 | WESetViewRect(&inViewRect, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 609 | _self->ob_itself); |
| 610 | Py_INCREF(Py_None); |
| 611 | _res = Py_None; |
| 612 | return _res; |
| 613 | } |
| 614 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 615 | static PyObject *wasteObj_WEContinuousStyle(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 616 | { |
| 617 | PyObject *_res = NULL; |
| 618 | Boolean _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 619 | WEStyleMode ioMode; |
| 620 | TextStyle outTextStyle; |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 621 | if (!PyArg_ParseTuple(_args, "H", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 622 | &ioMode)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 623 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 624 | _rv = WEContinuousStyle(&ioMode, |
| 625 | &outTextStyle, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 626 | _self->ob_itself); |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 627 | _res = Py_BuildValue("bHO&", |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 628 | _rv, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 629 | ioMode, |
| 630 | TextStyle_New, &outTextStyle); |
| 631 | return _res; |
| 632 | } |
| 633 | |
| 634 | static PyObject *wasteObj_WECountRuns(wasteObject *_self, PyObject *_args) |
| 635 | { |
| 636 | PyObject *_res = NULL; |
| 637 | SInt32 _rv; |
| 638 | if (!PyArg_ParseTuple(_args, "")) |
| 639 | return NULL; |
| 640 | _rv = WECountRuns(_self->ob_itself); |
| 641 | _res = Py_BuildValue("l", |
| 642 | _rv); |
| 643 | return _res; |
| 644 | } |
| 645 | |
| 646 | static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args) |
| 647 | { |
| 648 | PyObject *_res = NULL; |
| 649 | SInt32 _rv; |
| 650 | SInt32 inOffset; |
| 651 | if (!PyArg_ParseTuple(_args, "l", |
| 652 | &inOffset)) |
| 653 | return NULL; |
| 654 | _rv = WEOffsetToRun(inOffset, |
| 655 | _self->ob_itself); |
| 656 | _res = Py_BuildValue("l", |
| 657 | _rv); |
| 658 | return _res; |
| 659 | } |
| 660 | |
| 661 | static PyObject *wasteObj_WEGetRunRange(wasteObject *_self, PyObject *_args) |
| 662 | { |
| 663 | PyObject *_res = NULL; |
| 664 | SInt32 inStyleRunIndex; |
| 665 | SInt32 outStyleRunStart; |
| 666 | SInt32 outStyleRunEnd; |
| 667 | if (!PyArg_ParseTuple(_args, "l", |
| 668 | &inStyleRunIndex)) |
| 669 | return NULL; |
| 670 | WEGetRunRange(inStyleRunIndex, |
| 671 | &outStyleRunStart, |
| 672 | &outStyleRunEnd, |
| 673 | _self->ob_itself); |
| 674 | _res = Py_BuildValue("ll", |
| 675 | outStyleRunStart, |
| 676 | outStyleRunEnd); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 677 | return _res; |
| 678 | } |
| 679 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 680 | static PyObject *wasteObj_WEGetRunInfo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 681 | { |
| 682 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 683 | SInt32 inOffset; |
| 684 | WERunInfo outStyleRunInfo; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 685 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 686 | &inOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 687 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 688 | WEGetRunInfo(inOffset, |
| 689 | &outStyleRunInfo, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 690 | _self->ob_itself); |
| 691 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 692 | RunInfo_New, &outStyleRunInfo); |
| 693 | return _res; |
| 694 | } |
| 695 | |
| 696 | static PyObject *wasteObj_WEGetIndRunInfo(wasteObject *_self, PyObject *_args) |
| 697 | { |
| 698 | PyObject *_res = NULL; |
| 699 | SInt32 inStyleRunIndex; |
| 700 | WERunInfo outStyleRunInfo; |
| 701 | if (!PyArg_ParseTuple(_args, "l", |
| 702 | &inStyleRunIndex)) |
| 703 | return NULL; |
| 704 | WEGetIndRunInfo(inStyleRunIndex, |
| 705 | &outStyleRunInfo, |
| 706 | _self->ob_itself); |
| 707 | _res = Py_BuildValue("O&", |
| 708 | RunInfo_New, &outStyleRunInfo); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 709 | return _res; |
| 710 | } |
| 711 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 712 | static PyObject *wasteObj_WEGetRunDirection(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 713 | { |
| 714 | PyObject *_res = NULL; |
| 715 | Boolean _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 716 | SInt32 inOffset; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 717 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 718 | &inOffset)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 719 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 720 | _rv = WEGetRunDirection(inOffset, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 721 | _self->ob_itself); |
| 722 | _res = Py_BuildValue("b", |
| 723 | _rv); |
| 724 | return _res; |
| 725 | } |
| 726 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 727 | static PyObject *wasteObj_WECountParaRuns(wasteObject *_self, PyObject *_args) |
| 728 | { |
| 729 | PyObject *_res = NULL; |
| 730 | SInt32 _rv; |
| 731 | if (!PyArg_ParseTuple(_args, "")) |
| 732 | return NULL; |
| 733 | _rv = WECountParaRuns(_self->ob_itself); |
| 734 | _res = Py_BuildValue("l", |
| 735 | _rv); |
| 736 | return _res; |
| 737 | } |
| 738 | |
| 739 | static PyObject *wasteObj_WEOffsetToParaRun(wasteObject *_self, PyObject *_args) |
| 740 | { |
| 741 | PyObject *_res = NULL; |
| 742 | SInt32 _rv; |
| 743 | SInt32 inOffset; |
| 744 | if (!PyArg_ParseTuple(_args, "l", |
| 745 | &inOffset)) |
| 746 | return NULL; |
| 747 | _rv = WEOffsetToParaRun(inOffset, |
| 748 | _self->ob_itself); |
| 749 | _res = Py_BuildValue("l", |
| 750 | _rv); |
| 751 | return _res; |
| 752 | } |
| 753 | |
| 754 | static PyObject *wasteObj_WEGetParaRunRange(wasteObject *_self, PyObject *_args) |
| 755 | { |
| 756 | PyObject *_res = NULL; |
| 757 | SInt32 inParagraphRunIndex; |
| 758 | SInt32 outParagraphRunStart; |
| 759 | SInt32 outParagraphRunEnd; |
| 760 | if (!PyArg_ParseTuple(_args, "l", |
| 761 | &inParagraphRunIndex)) |
| 762 | return NULL; |
| 763 | WEGetParaRunRange(inParagraphRunIndex, |
| 764 | &outParagraphRunStart, |
| 765 | &outParagraphRunEnd, |
| 766 | _self->ob_itself); |
| 767 | _res = Py_BuildValue("ll", |
| 768 | outParagraphRunStart, |
| 769 | outParagraphRunEnd); |
| 770 | return _res; |
| 771 | } |
| 772 | |
| 773 | static PyObject *wasteObj_WECountLines(wasteObject *_self, PyObject *_args) |
| 774 | { |
| 775 | PyObject *_res = NULL; |
| 776 | SInt32 _rv; |
| 777 | if (!PyArg_ParseTuple(_args, "")) |
| 778 | return NULL; |
| 779 | _rv = WECountLines(_self->ob_itself); |
| 780 | _res = Py_BuildValue("l", |
| 781 | _rv); |
| 782 | return _res; |
| 783 | } |
| 784 | |
| 785 | static PyObject *wasteObj_WEOffsetToLine(wasteObject *_self, PyObject *_args) |
| 786 | { |
| 787 | PyObject *_res = NULL; |
| 788 | SInt32 _rv; |
| 789 | SInt32 inOffset; |
| 790 | if (!PyArg_ParseTuple(_args, "l", |
| 791 | &inOffset)) |
| 792 | return NULL; |
| 793 | _rv = WEOffsetToLine(inOffset, |
| 794 | _self->ob_itself); |
| 795 | _res = Py_BuildValue("l", |
| 796 | _rv); |
| 797 | return _res; |
| 798 | } |
| 799 | |
| 800 | static PyObject *wasteObj_WEGetLineRange(wasteObject *_self, PyObject *_args) |
| 801 | { |
| 802 | PyObject *_res = NULL; |
| 803 | SInt32 inLineIndex; |
| 804 | SInt32 outLineStart; |
| 805 | SInt32 outLineEnd; |
| 806 | if (!PyArg_ParseTuple(_args, "l", |
| 807 | &inLineIndex)) |
| 808 | return NULL; |
| 809 | WEGetLineRange(inLineIndex, |
| 810 | &outLineStart, |
| 811 | &outLineEnd, |
| 812 | _self->ob_itself); |
| 813 | _res = Py_BuildValue("ll", |
| 814 | outLineStart, |
| 815 | outLineEnd); |
| 816 | return _res; |
| 817 | } |
| 818 | |
| 819 | static PyObject *wasteObj_WEGetHeight(wasteObject *_self, PyObject *_args) |
| 820 | { |
| 821 | PyObject *_res = NULL; |
| 822 | SInt32 _rv; |
| 823 | SInt32 inStartLineIndex; |
| 824 | SInt32 inEndLineIndex; |
| 825 | if (!PyArg_ParseTuple(_args, "ll", |
| 826 | &inStartLineIndex, |
| 827 | &inEndLineIndex)) |
| 828 | return NULL; |
| 829 | _rv = WEGetHeight(inStartLineIndex, |
| 830 | inEndLineIndex, |
| 831 | _self->ob_itself); |
| 832 | _res = Py_BuildValue("l", |
| 833 | _rv); |
| 834 | return _res; |
| 835 | } |
| 836 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 837 | static PyObject *wasteObj_WEGetOffset(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 838 | { |
| 839 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 840 | SInt32 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 841 | LongPt inPoint; |
| 842 | WEEdge outEdge; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 843 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 844 | LongPt_Convert, &inPoint)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 845 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 846 | _rv = WEGetOffset(&inPoint, |
| 847 | &outEdge, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 848 | _self->ob_itself); |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 849 | _res = Py_BuildValue("lB", |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 850 | _rv, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 851 | outEdge); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 852 | return _res; |
| 853 | } |
| 854 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 855 | static PyObject *wasteObj_WEGetPoint(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 856 | { |
| 857 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 858 | SInt32 inOffset; |
| 859 | SInt16 inDirection; |
| 860 | LongPt outPoint; |
| 861 | SInt16 outLineHeight; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 862 | if (!PyArg_ParseTuple(_args, "lh", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 863 | &inOffset, |
| 864 | &inDirection)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 865 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 866 | WEGetPoint(inOffset, |
| 867 | inDirection, |
| 868 | &outPoint, |
| 869 | &outLineHeight, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 870 | _self->ob_itself); |
| 871 | _res = Py_BuildValue("O&h", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 872 | LongPt_New, &outPoint, |
| 873 | outLineHeight); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 874 | return _res; |
| 875 | } |
| 876 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 877 | static PyObject *wasteObj_WEFindWord(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 878 | { |
| 879 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 880 | SInt32 inOffset; |
| 881 | WEEdge inEdge; |
| 882 | SInt32 outWordStart; |
| 883 | SInt32 outWordEnd; |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 884 | if (!PyArg_ParseTuple(_args, "lB", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 885 | &inOffset, |
| 886 | &inEdge)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 887 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 888 | WEFindWord(inOffset, |
| 889 | inEdge, |
| 890 | &outWordStart, |
| 891 | &outWordEnd, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 892 | _self->ob_itself); |
| 893 | _res = Py_BuildValue("ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 894 | outWordStart, |
| 895 | outWordEnd); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 896 | return _res; |
| 897 | } |
| 898 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 899 | static PyObject *wasteObj_WEFindLine(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 900 | { |
| 901 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 902 | SInt32 inOffset; |
| 903 | WEEdge inEdge; |
| 904 | SInt32 outLineStart; |
| 905 | SInt32 outLineEnd; |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 906 | if (!PyArg_ParseTuple(_args, "lB", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 907 | &inOffset, |
| 908 | &inEdge)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 909 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 910 | WEFindLine(inOffset, |
| 911 | inEdge, |
| 912 | &outLineStart, |
| 913 | &outLineEnd, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 914 | _self->ob_itself); |
| 915 | _res = Py_BuildValue("ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 916 | outLineStart, |
| 917 | outLineEnd); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 918 | return _res; |
| 919 | } |
| 920 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 921 | static PyObject *wasteObj_WEFindParagraph(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 922 | { |
| 923 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 924 | SInt32 inOffset; |
| 925 | WEEdge inEdge; |
| 926 | SInt32 outParagraphStart; |
| 927 | SInt32 outParagraphEnd; |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 928 | if (!PyArg_ParseTuple(_args, "lB", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 929 | &inOffset, |
| 930 | &inEdge)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 931 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 932 | WEFindParagraph(inOffset, |
| 933 | inEdge, |
| 934 | &outParagraphStart, |
| 935 | &outParagraphEnd, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 936 | _self->ob_itself); |
| 937 | _res = Py_BuildValue("ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 938 | outParagraphStart, |
| 939 | outParagraphEnd); |
| 940 | return _res; |
| 941 | } |
| 942 | |
| 943 | static PyObject *wasteObj_WEFind(wasteObject *_self, PyObject *_args) |
| 944 | { |
| 945 | PyObject *_res = NULL; |
| 946 | OSErr _err; |
| 947 | char* inKey; |
| 948 | SInt32 inKeyLength; |
| 949 | TextEncoding inKeyEncoding; |
| 950 | OptionBits inMatchOptions; |
| 951 | SInt32 inRangeStart; |
| 952 | SInt32 inRangeEnd; |
| 953 | SInt32 outMatchStart; |
| 954 | SInt32 outMatchEnd; |
| 955 | if (!PyArg_ParseTuple(_args, "slllll", |
| 956 | &inKey, |
| 957 | &inKeyLength, |
| 958 | &inKeyEncoding, |
| 959 | &inMatchOptions, |
| 960 | &inRangeStart, |
| 961 | &inRangeEnd)) |
| 962 | return NULL; |
| 963 | _err = WEFind(inKey, |
| 964 | inKeyLength, |
| 965 | inKeyEncoding, |
| 966 | inMatchOptions, |
| 967 | inRangeStart, |
| 968 | inRangeEnd, |
| 969 | &outMatchStart, |
| 970 | &outMatchEnd, |
| 971 | _self->ob_itself); |
| 972 | if (_err != noErr) return PyMac_Error(_err); |
| 973 | _res = Py_BuildValue("ll", |
| 974 | outMatchStart, |
| 975 | outMatchEnd); |
| 976 | return _res; |
| 977 | } |
| 978 | |
| 979 | static PyObject *wasteObj_WEStreamRange(wasteObject *_self, PyObject *_args) |
| 980 | { |
| 981 | PyObject *_res = NULL; |
| 982 | OSErr _err; |
| 983 | SInt32 inRangeStart; |
| 984 | SInt32 inRangeEnd; |
| 985 | FlavorType inRequestedType; |
| 986 | OptionBits inStreamOptions; |
| 987 | Handle outData; |
| 988 | if (!PyArg_ParseTuple(_args, "llO&lO&", |
| 989 | &inRangeStart, |
| 990 | &inRangeEnd, |
| 991 | PyMac_GetOSType, &inRequestedType, |
| 992 | &inStreamOptions, |
| 993 | ResObj_Convert, &outData)) |
| 994 | return NULL; |
| 995 | _err = WEStreamRange(inRangeStart, |
| 996 | inRangeEnd, |
| 997 | inRequestedType, |
| 998 | inStreamOptions, |
| 999 | outData, |
| 1000 | _self->ob_itself); |
| 1001 | if (_err != noErr) return PyMac_Error(_err); |
| 1002 | Py_INCREF(Py_None); |
| 1003 | _res = Py_None; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1004 | return _res; |
| 1005 | } |
| 1006 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1007 | static PyObject *wasteObj_WECopyRange(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1008 | { |
| 1009 | PyObject *_res = NULL; |
| 1010 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1011 | SInt32 inRangeStart; |
| 1012 | SInt32 inRangeEnd; |
| 1013 | Handle outText; |
| 1014 | StScrpHandle outStyles; |
| 1015 | WESoupHandle outSoup; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1016 | if (!PyArg_ParseTuple(_args, "llO&O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1017 | &inRangeStart, |
| 1018 | &inRangeEnd, |
| 1019 | OptResObj_Convert, &outText, |
| 1020 | OptResObj_Convert, &outStyles, |
| 1021 | OptResObj_Convert, &outSoup)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1022 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1023 | _err = WECopyRange(inRangeStart, |
| 1024 | inRangeEnd, |
| 1025 | outText, |
| 1026 | outStyles, |
| 1027 | outSoup, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1028 | _self->ob_itself); |
| 1029 | if (_err != noErr) return PyMac_Error(_err); |
| 1030 | Py_INCREF(Py_None); |
| 1031 | _res = Py_None; |
| 1032 | return _res; |
| 1033 | } |
| 1034 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1035 | static PyObject *wasteObj_WEGetTextRangeAsUnicode(wasteObject *_self, PyObject *_args) |
| 1036 | { |
| 1037 | PyObject *_res = NULL; |
| 1038 | OSErr _err; |
| 1039 | SInt32 inRangeStart; |
| 1040 | SInt32 inRangeEnd; |
| 1041 | Handle outUnicodeText; |
| 1042 | Handle ioCharFormat; |
| 1043 | Handle ioParaFormat; |
| 1044 | TextEncodingVariant inUnicodeVariant; |
| 1045 | TextEncodingFormat inTransformationFormat; |
| 1046 | OptionBits inGetOptions; |
| 1047 | if (!PyArg_ParseTuple(_args, "llO&O&O&lll", |
| 1048 | &inRangeStart, |
| 1049 | &inRangeEnd, |
| 1050 | ResObj_Convert, &outUnicodeText, |
| 1051 | ResObj_Convert, &ioCharFormat, |
| 1052 | ResObj_Convert, &ioParaFormat, |
| 1053 | &inUnicodeVariant, |
| 1054 | &inTransformationFormat, |
| 1055 | &inGetOptions)) |
| 1056 | return NULL; |
| 1057 | _err = WEGetTextRangeAsUnicode(inRangeStart, |
| 1058 | inRangeEnd, |
| 1059 | outUnicodeText, |
| 1060 | ioCharFormat, |
| 1061 | ioParaFormat, |
| 1062 | inUnicodeVariant, |
| 1063 | inTransformationFormat, |
| 1064 | inGetOptions, |
| 1065 | _self->ob_itself); |
| 1066 | if (_err != noErr) return PyMac_Error(_err); |
| 1067 | Py_INCREF(Py_None); |
| 1068 | _res = Py_None; |
| 1069 | return _res; |
| 1070 | } |
| 1071 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1072 | static PyObject *wasteObj_WEGetAlignment(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1073 | { |
| 1074 | PyObject *_res = NULL; |
| 1075 | WEAlignment _rv; |
| 1076 | if (!PyArg_ParseTuple(_args, "")) |
| 1077 | return NULL; |
| 1078 | _rv = WEGetAlignment(_self->ob_itself); |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 1079 | _res = Py_BuildValue("B", |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1080 | _rv); |
| 1081 | return _res; |
| 1082 | } |
| 1083 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1084 | static PyObject *wasteObj_WESetAlignment(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1085 | { |
| 1086 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1087 | WEAlignment inAlignment; |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 1088 | if (!PyArg_ParseTuple(_args, "B", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1089 | &inAlignment)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1090 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1091 | WESetAlignment(inAlignment, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1092 | _self->ob_itself); |
| 1093 | Py_INCREF(Py_None); |
| 1094 | _res = Py_None; |
| 1095 | return _res; |
| 1096 | } |
| 1097 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1098 | static PyObject *wasteObj_WEGetDirection(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1099 | { |
| 1100 | PyObject *_res = NULL; |
| 1101 | WEDirection _rv; |
| 1102 | if (!PyArg_ParseTuple(_args, "")) |
| 1103 | return NULL; |
| 1104 | _rv = WEGetDirection(_self->ob_itself); |
| 1105 | _res = Py_BuildValue("h", |
| 1106 | _rv); |
| 1107 | return _res; |
| 1108 | } |
| 1109 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1110 | static PyObject *wasteObj_WESetDirection(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1111 | { |
| 1112 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1113 | WEDirection inDirection; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1114 | if (!PyArg_ParseTuple(_args, "h", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1115 | &inDirection)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1116 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1117 | WESetDirection(inDirection, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1118 | _self->ob_itself); |
| 1119 | Py_INCREF(Py_None); |
| 1120 | _res = Py_None; |
| 1121 | return _res; |
| 1122 | } |
| 1123 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1124 | static PyObject *wasteObj_WECalText(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1125 | { |
| 1126 | PyObject *_res = NULL; |
| 1127 | OSErr _err; |
| 1128 | if (!PyArg_ParseTuple(_args, "")) |
| 1129 | return NULL; |
| 1130 | _err = WECalText(_self->ob_itself); |
| 1131 | if (_err != noErr) return PyMac_Error(_err); |
| 1132 | Py_INCREF(Py_None); |
| 1133 | _res = Py_None; |
| 1134 | return _res; |
| 1135 | } |
| 1136 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1137 | static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1138 | { |
| 1139 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1140 | RgnHandle inUpdateRgn; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1141 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1142 | ResObj_Convert, &inUpdateRgn)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1143 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1144 | WEUpdate(inUpdateRgn, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1145 | _self->ob_itself); |
| 1146 | Py_INCREF(Py_None); |
| 1147 | _res = Py_None; |
| 1148 | return _res; |
| 1149 | } |
| 1150 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1151 | static PyObject *wasteObj_WEScroll(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1152 | { |
| 1153 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1154 | SInt32 inHorizontalOffset; |
| 1155 | SInt32 inVerticalOffset; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1156 | if (!PyArg_ParseTuple(_args, "ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1157 | &inHorizontalOffset, |
| 1158 | &inVerticalOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1159 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1160 | WEScroll(inHorizontalOffset, |
| 1161 | inVerticalOffset, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1162 | _self->ob_itself); |
| 1163 | Py_INCREF(Py_None); |
| 1164 | _res = Py_None; |
| 1165 | return _res; |
| 1166 | } |
| 1167 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1168 | static PyObject *wasteObj_WEPinScroll(wasteObject *_self, PyObject *_args) |
| 1169 | { |
| 1170 | PyObject *_res = NULL; |
| 1171 | SInt32 inHorizontalOffset; |
| 1172 | SInt32 inVerticalOffset; |
| 1173 | if (!PyArg_ParseTuple(_args, "ll", |
| 1174 | &inHorizontalOffset, |
| 1175 | &inVerticalOffset)) |
| 1176 | return NULL; |
| 1177 | WEPinScroll(inHorizontalOffset, |
| 1178 | inVerticalOffset, |
| 1179 | _self->ob_itself); |
| 1180 | Py_INCREF(Py_None); |
| 1181 | _res = Py_None; |
| 1182 | return _res; |
| 1183 | } |
| 1184 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1185 | static PyObject *wasteObj_WESelView(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1186 | { |
| 1187 | PyObject *_res = NULL; |
| 1188 | if (!PyArg_ParseTuple(_args, "")) |
| 1189 | return NULL; |
| 1190 | WESelView(_self->ob_itself); |
| 1191 | Py_INCREF(Py_None); |
| 1192 | _res = Py_None; |
| 1193 | return _res; |
| 1194 | } |
| 1195 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1196 | static PyObject *wasteObj_WEActivate(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1197 | { |
| 1198 | PyObject *_res = NULL; |
| 1199 | if (!PyArg_ParseTuple(_args, "")) |
| 1200 | return NULL; |
| 1201 | WEActivate(_self->ob_itself); |
| 1202 | Py_INCREF(Py_None); |
| 1203 | _res = Py_None; |
| 1204 | return _res; |
| 1205 | } |
| 1206 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1207 | static PyObject *wasteObj_WEDeactivate(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1208 | { |
| 1209 | PyObject *_res = NULL; |
| 1210 | if (!PyArg_ParseTuple(_args, "")) |
| 1211 | return NULL; |
| 1212 | WEDeactivate(_self->ob_itself); |
| 1213 | Py_INCREF(Py_None); |
| 1214 | _res = Py_None; |
| 1215 | return _res; |
| 1216 | } |
| 1217 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1218 | static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1219 | { |
| 1220 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1221 | CharParameter inKey; |
| 1222 | EventModifiers inModifiers; |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 1223 | if (!PyArg_ParseTuple(_args, "hH", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1224 | &inKey, |
| 1225 | &inModifiers)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1226 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1227 | WEKey(inKey, |
| 1228 | inModifiers, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1229 | _self->ob_itself); |
| 1230 | Py_INCREF(Py_None); |
| 1231 | _res = Py_None; |
| 1232 | return _res; |
| 1233 | } |
| 1234 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1235 | static PyObject *wasteObj_WEClick(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1236 | { |
| 1237 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1238 | Point inHitPoint; |
| 1239 | EventModifiers inModifiers; |
| 1240 | UInt32 inClickTime; |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 1241 | if (!PyArg_ParseTuple(_args, "O&Hl", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1242 | PyMac_GetPoint, &inHitPoint, |
| 1243 | &inModifiers, |
| 1244 | &inClickTime)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1245 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1246 | WEClick(inHitPoint, |
| 1247 | inModifiers, |
| 1248 | inClickTime, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1249 | _self->ob_itself); |
| 1250 | Py_INCREF(Py_None); |
| 1251 | _res = Py_None; |
| 1252 | return _res; |
| 1253 | } |
| 1254 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1255 | static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1256 | { |
| 1257 | PyObject *_res = NULL; |
| 1258 | Boolean _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1259 | Point inMouseLoc; |
| 1260 | RgnHandle ioMouseRgn; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1261 | if (!PyArg_ParseTuple(_args, "O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1262 | PyMac_GetPoint, &inMouseLoc, |
| 1263 | ResObj_Convert, &ioMouseRgn)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1264 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1265 | _rv = WEAdjustCursor(inMouseLoc, |
| 1266 | ioMouseRgn, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1267 | _self->ob_itself); |
| 1268 | _res = Py_BuildValue("b", |
| 1269 | _rv); |
| 1270 | return _res; |
| 1271 | } |
| 1272 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1273 | static PyObject *wasteObj_WEIdle(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1274 | { |
| 1275 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1276 | UInt32 outMaxSleep; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1277 | if (!PyArg_ParseTuple(_args, "")) |
| 1278 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1279 | WEIdle(&outMaxSleep, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1280 | _self->ob_itself); |
| 1281 | _res = Py_BuildValue("l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1282 | outMaxSleep); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1283 | return _res; |
| 1284 | } |
| 1285 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1286 | static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1287 | { |
| 1288 | PyObject *_res = NULL; |
| 1289 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1290 | char *inTextPtr__in__; |
| 1291 | long inTextPtr__len__; |
| 1292 | int inTextPtr__in_len__; |
| 1293 | StScrpHandle inStyles; |
| 1294 | WESoupHandle inSoup; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1295 | if (!PyArg_ParseTuple(_args, "s#O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1296 | &inTextPtr__in__, &inTextPtr__in_len__, |
| 1297 | OptResObj_Convert, &inStyles, |
| 1298 | OptResObj_Convert, &inSoup)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1299 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1300 | inTextPtr__len__ = inTextPtr__in_len__; |
| 1301 | _err = WEInsert(inTextPtr__in__, inTextPtr__len__, |
| 1302 | inStyles, |
| 1303 | inSoup, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1304 | _self->ob_itself); |
| 1305 | if (_err != noErr) return PyMac_Error(_err); |
| 1306 | Py_INCREF(Py_None); |
| 1307 | _res = Py_None; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1308 | return _res; |
| 1309 | } |
| 1310 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1311 | static PyObject *wasteObj_WEInsertFormattedText(wasteObject *_self, PyObject *_args) |
| 1312 | { |
| 1313 | PyObject *_res = NULL; |
| 1314 | OSErr _err; |
| 1315 | char *inTextPtr__in__; |
| 1316 | long inTextPtr__len__; |
| 1317 | int inTextPtr__in_len__; |
| 1318 | StScrpHandle inStyles; |
| 1319 | WESoupHandle inSoup; |
| 1320 | Handle inParaFormat; |
| 1321 | Handle inRulerScrap; |
| 1322 | if (!PyArg_ParseTuple(_args, "s#O&O&O&O&", |
| 1323 | &inTextPtr__in__, &inTextPtr__in_len__, |
| 1324 | OptResObj_Convert, &inStyles, |
| 1325 | OptResObj_Convert, &inSoup, |
| 1326 | ResObj_Convert, &inParaFormat, |
| 1327 | ResObj_Convert, &inRulerScrap)) |
| 1328 | return NULL; |
| 1329 | inTextPtr__len__ = inTextPtr__in_len__; |
| 1330 | _err = WEInsertFormattedText(inTextPtr__in__, inTextPtr__len__, |
| 1331 | inStyles, |
| 1332 | inSoup, |
| 1333 | inParaFormat, |
| 1334 | inRulerScrap, |
| 1335 | _self->ob_itself); |
| 1336 | if (_err != noErr) return PyMac_Error(_err); |
| 1337 | Py_INCREF(Py_None); |
| 1338 | _res = Py_None; |
| 1339 | return _res; |
| 1340 | } |
| 1341 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1342 | static PyObject *wasteObj_WEDelete(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1343 | { |
| 1344 | PyObject *_res = NULL; |
| 1345 | OSErr _err; |
| 1346 | if (!PyArg_ParseTuple(_args, "")) |
| 1347 | return NULL; |
| 1348 | _err = WEDelete(_self->ob_itself); |
| 1349 | if (_err != noErr) return PyMac_Error(_err); |
| 1350 | Py_INCREF(Py_None); |
| 1351 | _res = Py_None; |
| 1352 | return _res; |
| 1353 | } |
| 1354 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1355 | static PyObject *wasteObj_WEUseText(wasteObject *_self, PyObject *_args) |
| 1356 | { |
| 1357 | PyObject *_res = NULL; |
| 1358 | OSErr _err; |
| 1359 | Handle inText; |
| 1360 | if (!PyArg_ParseTuple(_args, "O&", |
| 1361 | ResObj_Convert, &inText)) |
| 1362 | return NULL; |
| 1363 | _err = WEUseText(inText, |
| 1364 | _self->ob_itself); |
| 1365 | if (_err != noErr) return PyMac_Error(_err); |
| 1366 | Py_INCREF(Py_None); |
| 1367 | _res = Py_None; |
| 1368 | return _res; |
| 1369 | } |
| 1370 | |
| 1371 | static PyObject *wasteObj_WEChangeCase(wasteObject *_self, PyObject *_args) |
| 1372 | { |
| 1373 | PyObject *_res = NULL; |
| 1374 | OSErr _err; |
| 1375 | SInt16 inCase; |
| 1376 | if (!PyArg_ParseTuple(_args, "h", |
| 1377 | &inCase)) |
| 1378 | return NULL; |
| 1379 | _err = WEChangeCase(inCase, |
| 1380 | _self->ob_itself); |
| 1381 | if (_err != noErr) return PyMac_Error(_err); |
| 1382 | Py_INCREF(Py_None); |
| 1383 | _res = Py_None; |
| 1384 | return _res; |
| 1385 | } |
| 1386 | |
| 1387 | static PyObject *wasteObj_WESetOneAttribute(wasteObject *_self, PyObject *_args) |
| 1388 | { |
| 1389 | PyObject *_res = NULL; |
| 1390 | OSErr _err; |
| 1391 | SInt32 inRangeStart; |
| 1392 | SInt32 inRangeEnd; |
| 1393 | WESelector inAttributeSelector; |
| 1394 | char *inAttributeValue__in__; |
| 1395 | long inAttributeValue__len__; |
| 1396 | int inAttributeValue__in_len__; |
| 1397 | if (!PyArg_ParseTuple(_args, "llO&s#", |
| 1398 | &inRangeStart, |
| 1399 | &inRangeEnd, |
| 1400 | PyMac_GetOSType, &inAttributeSelector, |
| 1401 | &inAttributeValue__in__, &inAttributeValue__in_len__)) |
| 1402 | return NULL; |
| 1403 | inAttributeValue__len__ = inAttributeValue__in_len__; |
| 1404 | _err = WESetOneAttribute(inRangeStart, |
| 1405 | inRangeEnd, |
| 1406 | inAttributeSelector, |
| 1407 | inAttributeValue__in__, inAttributeValue__len__, |
| 1408 | _self->ob_itself); |
| 1409 | if (_err != noErr) return PyMac_Error(_err); |
| 1410 | Py_INCREF(Py_None); |
| 1411 | _res = Py_None; |
| 1412 | return _res; |
| 1413 | } |
| 1414 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1415 | static PyObject *wasteObj_WESetStyle(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1416 | { |
| 1417 | PyObject *_res = NULL; |
| 1418 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1419 | WEStyleMode inMode; |
| 1420 | TextStyle inTextStyle; |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 1421 | if (!PyArg_ParseTuple(_args, "HO&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1422 | &inMode, |
| 1423 | TextStyle_Convert, &inTextStyle)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1424 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1425 | _err = WESetStyle(inMode, |
| 1426 | &inTextStyle, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1427 | _self->ob_itself); |
| 1428 | if (_err != noErr) return PyMac_Error(_err); |
| 1429 | Py_INCREF(Py_None); |
| 1430 | _res = Py_None; |
| 1431 | return _res; |
| 1432 | } |
| 1433 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1434 | static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1435 | { |
| 1436 | PyObject *_res = NULL; |
| 1437 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1438 | StScrpHandle inStyles; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1439 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1440 | ResObj_Convert, &inStyles)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1441 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1442 | _err = WEUseStyleScrap(inStyles, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1443 | _self->ob_itself); |
| 1444 | if (_err != noErr) return PyMac_Error(_err); |
| 1445 | Py_INCREF(Py_None); |
| 1446 | _res = Py_None; |
| 1447 | return _res; |
| 1448 | } |
| 1449 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1450 | static PyObject *wasteObj_WEUndo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1451 | { |
| 1452 | PyObject *_res = NULL; |
| 1453 | OSErr _err; |
| 1454 | if (!PyArg_ParseTuple(_args, "")) |
| 1455 | return NULL; |
| 1456 | _err = WEUndo(_self->ob_itself); |
| 1457 | if (_err != noErr) return PyMac_Error(_err); |
| 1458 | Py_INCREF(Py_None); |
| 1459 | _res = Py_None; |
| 1460 | return _res; |
| 1461 | } |
| 1462 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1463 | static PyObject *wasteObj_WERedo(wasteObject *_self, PyObject *_args) |
| 1464 | { |
| 1465 | PyObject *_res = NULL; |
| 1466 | OSErr _err; |
| 1467 | if (!PyArg_ParseTuple(_args, "")) |
| 1468 | return NULL; |
| 1469 | _err = WERedo(_self->ob_itself); |
| 1470 | if (_err != noErr) return PyMac_Error(_err); |
| 1471 | Py_INCREF(Py_None); |
| 1472 | _res = Py_None; |
| 1473 | return _res; |
| 1474 | } |
| 1475 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1476 | static PyObject *wasteObj_WEClearUndo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1477 | { |
| 1478 | PyObject *_res = NULL; |
| 1479 | if (!PyArg_ParseTuple(_args, "")) |
| 1480 | return NULL; |
| 1481 | WEClearUndo(_self->ob_itself); |
| 1482 | Py_INCREF(Py_None); |
| 1483 | _res = Py_None; |
| 1484 | return _res; |
| 1485 | } |
| 1486 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1487 | static PyObject *wasteObj_WEGetUndoInfo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1488 | { |
| 1489 | PyObject *_res = NULL; |
| 1490 | WEActionKind _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1491 | Boolean outRedoFlag; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1492 | if (!PyArg_ParseTuple(_args, "")) |
| 1493 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1494 | _rv = WEGetUndoInfo(&outRedoFlag, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1495 | _self->ob_itself); |
| 1496 | _res = Py_BuildValue("hb", |
| 1497 | _rv, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1498 | outRedoFlag); |
| 1499 | return _res; |
| 1500 | } |
| 1501 | |
| 1502 | static PyObject *wasteObj_WEGetIndUndoInfo(wasteObject *_self, PyObject *_args) |
| 1503 | { |
| 1504 | PyObject *_res = NULL; |
| 1505 | WEActionKind _rv; |
| 1506 | SInt32 inUndoLevel; |
| 1507 | if (!PyArg_ParseTuple(_args, "l", |
| 1508 | &inUndoLevel)) |
| 1509 | return NULL; |
| 1510 | _rv = WEGetIndUndoInfo(inUndoLevel, |
| 1511 | _self->ob_itself); |
| 1512 | _res = Py_BuildValue("h", |
| 1513 | _rv); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1514 | return _res; |
| 1515 | } |
| 1516 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1517 | static PyObject *wasteObj_WEIsTyping(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1518 | { |
| 1519 | PyObject *_res = NULL; |
| 1520 | Boolean _rv; |
| 1521 | if (!PyArg_ParseTuple(_args, "")) |
| 1522 | return NULL; |
| 1523 | _rv = WEIsTyping(_self->ob_itself); |
| 1524 | _res = Py_BuildValue("b", |
| 1525 | _rv); |
| 1526 | return _res; |
| 1527 | } |
| 1528 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1529 | static PyObject *wasteObj_WEBeginAction(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1530 | { |
| 1531 | PyObject *_res = NULL; |
| 1532 | OSErr _err; |
| 1533 | if (!PyArg_ParseTuple(_args, "")) |
| 1534 | return NULL; |
| 1535 | _err = WEBeginAction(_self->ob_itself); |
| 1536 | if (_err != noErr) return PyMac_Error(_err); |
| 1537 | Py_INCREF(Py_None); |
| 1538 | _res = Py_None; |
| 1539 | return _res; |
| 1540 | } |
| 1541 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1542 | static PyObject *wasteObj_WEEndAction(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1543 | { |
| 1544 | PyObject *_res = NULL; |
| 1545 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1546 | WEActionKind inActionKind; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1547 | if (!PyArg_ParseTuple(_args, "h", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1548 | &inActionKind)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1549 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1550 | _err = WEEndAction(inActionKind, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1551 | _self->ob_itself); |
| 1552 | if (_err != noErr) return PyMac_Error(_err); |
| 1553 | Py_INCREF(Py_None); |
| 1554 | _res = Py_None; |
| 1555 | return _res; |
| 1556 | } |
| 1557 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1558 | static PyObject *wasteObj_WEGetModCount(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1559 | { |
| 1560 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1561 | UInt32 _rv; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1562 | if (!PyArg_ParseTuple(_args, "")) |
| 1563 | return NULL; |
| 1564 | _rv = WEGetModCount(_self->ob_itself); |
| 1565 | _res = Py_BuildValue("l", |
| 1566 | _rv); |
| 1567 | return _res; |
| 1568 | } |
| 1569 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1570 | static PyObject *wasteObj_WEResetModCount(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1571 | { |
| 1572 | PyObject *_res = NULL; |
| 1573 | if (!PyArg_ParseTuple(_args, "")) |
| 1574 | return NULL; |
| 1575 | WEResetModCount(_self->ob_itself); |
| 1576 | Py_INCREF(Py_None); |
| 1577 | _res = Py_None; |
| 1578 | return _res; |
| 1579 | } |
| 1580 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1581 | static PyObject *wasteObj_WEInsertObject(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1582 | { |
| 1583 | PyObject *_res = NULL; |
| 1584 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1585 | FlavorType inObjectType; |
| 1586 | Handle inObjectDataHandle; |
| 1587 | Point inObjectSize; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1588 | if (!PyArg_ParseTuple(_args, "O&O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1589 | PyMac_GetOSType, &inObjectType, |
| 1590 | ResObj_Convert, &inObjectDataHandle, |
| 1591 | PyMac_GetPoint, &inObjectSize)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1592 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1593 | _err = WEInsertObject(inObjectType, |
| 1594 | inObjectDataHandle, |
| 1595 | inObjectSize, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1596 | _self->ob_itself); |
| 1597 | if (_err != noErr) return PyMac_Error(_err); |
| 1598 | Py_INCREF(Py_None); |
| 1599 | _res = Py_None; |
| 1600 | return _res; |
| 1601 | } |
| 1602 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1603 | static PyObject *wasteObj_WEGetSelectedObject(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1604 | { |
| 1605 | PyObject *_res = NULL; |
| 1606 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1607 | WEObjectReference outObject; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1608 | if (!PyArg_ParseTuple(_args, "")) |
| 1609 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1610 | _err = WEGetSelectedObject(&outObject, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1611 | _self->ob_itself); |
| 1612 | if (_err != noErr) return PyMac_Error(_err); |
| 1613 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1614 | WEOObj_New, outObject); |
| 1615 | return _res; |
| 1616 | } |
| 1617 | |
| 1618 | static PyObject *wasteObj_WEGetObjectAtOffset(wasteObject *_self, PyObject *_args) |
| 1619 | { |
| 1620 | PyObject *_res = NULL; |
| 1621 | OSErr _err; |
| 1622 | SInt32 inOffset; |
| 1623 | WEObjectReference outObject; |
| 1624 | if (!PyArg_ParseTuple(_args, "l", |
| 1625 | &inOffset)) |
| 1626 | return NULL; |
| 1627 | _err = WEGetObjectAtOffset(inOffset, |
| 1628 | &outObject, |
| 1629 | _self->ob_itself); |
| 1630 | if (_err != noErr) return PyMac_Error(_err); |
| 1631 | _res = Py_BuildValue("O&", |
| 1632 | WEOObj_New, outObject); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1633 | return _res; |
| 1634 | } |
| 1635 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1636 | static PyObject *wasteObj_WEFindNextObject(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1637 | { |
| 1638 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1639 | SInt32 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1640 | SInt32 inOffset; |
| 1641 | WEObjectReference outObject; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1642 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1643 | &inOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1644 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1645 | _rv = WEFindNextObject(inOffset, |
| 1646 | &outObject, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1647 | _self->ob_itself); |
| 1648 | _res = Py_BuildValue("lO&", |
| 1649 | _rv, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1650 | WEOObj_New, outObject); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1651 | return _res; |
| 1652 | } |
| 1653 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1654 | static PyObject *wasteObj_WEUseSoup(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1655 | { |
| 1656 | PyObject *_res = NULL; |
| 1657 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1658 | WESoupHandle inSoup; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1659 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1660 | ResObj_Convert, &inSoup)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1661 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1662 | _err = WEUseSoup(inSoup, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1663 | _self->ob_itself); |
| 1664 | if (_err != noErr) return PyMac_Error(_err); |
| 1665 | Py_INCREF(Py_None); |
| 1666 | _res = Py_None; |
| 1667 | return _res; |
| 1668 | } |
| 1669 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1670 | static PyObject *wasteObj_WECut(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1671 | { |
| 1672 | PyObject *_res = NULL; |
| 1673 | OSErr _err; |
| 1674 | if (!PyArg_ParseTuple(_args, "")) |
| 1675 | return NULL; |
| 1676 | _err = WECut(_self->ob_itself); |
| 1677 | if (_err != noErr) return PyMac_Error(_err); |
| 1678 | Py_INCREF(Py_None); |
| 1679 | _res = Py_None; |
| 1680 | return _res; |
| 1681 | } |
| 1682 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1683 | static PyObject *wasteObj_WECopy(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1684 | { |
| 1685 | PyObject *_res = NULL; |
| 1686 | OSErr _err; |
| 1687 | if (!PyArg_ParseTuple(_args, "")) |
| 1688 | return NULL; |
| 1689 | _err = WECopy(_self->ob_itself); |
| 1690 | if (_err != noErr) return PyMac_Error(_err); |
| 1691 | Py_INCREF(Py_None); |
| 1692 | _res = Py_None; |
| 1693 | return _res; |
| 1694 | } |
| 1695 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1696 | static PyObject *wasteObj_WEPaste(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1697 | { |
| 1698 | PyObject *_res = NULL; |
| 1699 | OSErr _err; |
| 1700 | if (!PyArg_ParseTuple(_args, "")) |
| 1701 | return NULL; |
| 1702 | _err = WEPaste(_self->ob_itself); |
| 1703 | if (_err != noErr) return PyMac_Error(_err); |
| 1704 | Py_INCREF(Py_None); |
| 1705 | _res = Py_None; |
| 1706 | return _res; |
| 1707 | } |
| 1708 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1709 | static PyObject *wasteObj_WECanPaste(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1710 | { |
| 1711 | PyObject *_res = NULL; |
| 1712 | Boolean _rv; |
| 1713 | if (!PyArg_ParseTuple(_args, "")) |
| 1714 | return NULL; |
| 1715 | _rv = WECanPaste(_self->ob_itself); |
| 1716 | _res = Py_BuildValue("b", |
| 1717 | _rv); |
| 1718 | return _res; |
| 1719 | } |
| 1720 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1721 | static PyObject *wasteObj_WEGetHiliteRgn(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1722 | { |
| 1723 | PyObject *_res = NULL; |
| 1724 | RgnHandle _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1725 | SInt32 inRangeStart; |
| 1726 | SInt32 inRangeEnd; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1727 | if (!PyArg_ParseTuple(_args, "ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1728 | &inRangeStart, |
| 1729 | &inRangeEnd)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1730 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1731 | _rv = WEGetHiliteRgn(inRangeStart, |
| 1732 | inRangeEnd, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1733 | _self->ob_itself); |
| 1734 | _res = Py_BuildValue("O&", |
| 1735 | ResObj_New, _rv); |
| 1736 | return _res; |
| 1737 | } |
| 1738 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1739 | static PyObject *wasteObj_WECharByte(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1740 | { |
| 1741 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1742 | SInt16 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1743 | SInt32 inOffset; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1744 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1745 | &inOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1746 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1747 | _rv = WECharByte(inOffset, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1748 | _self->ob_itself); |
| 1749 | _res = Py_BuildValue("h", |
| 1750 | _rv); |
| 1751 | return _res; |
| 1752 | } |
| 1753 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1754 | static PyObject *wasteObj_WECharType(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1755 | { |
| 1756 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1757 | SInt16 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1758 | SInt32 inOffset; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1759 | if (!PyArg_ParseTuple(_args, "l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1760 | &inOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1761 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1762 | _rv = WECharType(inOffset, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1763 | _self->ob_itself); |
| 1764 | _res = Py_BuildValue("h", |
| 1765 | _rv); |
| 1766 | return _res; |
| 1767 | } |
| 1768 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1769 | static PyObject *wasteObj_WEStopInlineSession(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1770 | { |
| 1771 | PyObject *_res = NULL; |
| 1772 | if (!PyArg_ParseTuple(_args, "")) |
| 1773 | return NULL; |
| 1774 | WEStopInlineSession(_self->ob_itself); |
| 1775 | Py_INCREF(Py_None); |
| 1776 | _res = Py_None; |
| 1777 | return _res; |
| 1778 | } |
| 1779 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1780 | static PyObject *wasteObj_WEFeatureFlag(wasteObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1781 | { |
| 1782 | PyObject *_res = NULL; |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1783 | SInt16 _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1784 | SInt16 inFeature; |
| 1785 | SInt16 inAction; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1786 | if (!PyArg_ParseTuple(_args, "hh", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1787 | &inFeature, |
| 1788 | &inAction)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1789 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1790 | _rv = WEFeatureFlag(inFeature, |
| 1791 | inAction, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1792 | _self->ob_itself); |
| 1793 | _res = Py_BuildValue("h", |
| 1794 | _rv); |
| 1795 | return _res; |
| 1796 | } |
| 1797 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1798 | static PyObject *wasteObj_WEGetUserInfo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1799 | { |
| 1800 | PyObject *_res = NULL; |
| 1801 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1802 | WESelector inUserTag; |
| 1803 | SInt32 outUserInfo; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1804 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1805 | PyMac_GetOSType, &inUserTag)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1806 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1807 | _err = WEGetUserInfo(inUserTag, |
| 1808 | &outUserInfo, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1809 | _self->ob_itself); |
| 1810 | if (_err != noErr) return PyMac_Error(_err); |
| 1811 | _res = Py_BuildValue("l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1812 | outUserInfo); |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1813 | return _res; |
| 1814 | } |
| 1815 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1816 | static PyObject *wasteObj_WESetUserInfo(wasteObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1817 | { |
| 1818 | PyObject *_res = NULL; |
| 1819 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1820 | WESelector inUserTag; |
| 1821 | SInt32 inUserInfo; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1822 | if (!PyArg_ParseTuple(_args, "O&l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1823 | PyMac_GetOSType, &inUserTag, |
| 1824 | &inUserInfo)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1825 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1826 | _err = WESetUserInfo(inUserTag, |
| 1827 | inUserInfo, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1828 | _self->ob_itself); |
| 1829 | if (_err != noErr) return PyMac_Error(_err); |
| 1830 | Py_INCREF(Py_None); |
| 1831 | _res = Py_None; |
| 1832 | return _res; |
| 1833 | } |
| 1834 | |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1835 | static PyObject *wasteObj_WERemoveUserInfo(wasteObject *_self, PyObject *_args) |
| 1836 | { |
| 1837 | PyObject *_res = NULL; |
| 1838 | OSErr _err; |
| 1839 | WESelector inUserTag; |
| 1840 | if (!PyArg_ParseTuple(_args, "O&", |
| 1841 | PyMac_GetOSType, &inUserTag)) |
| 1842 | return NULL; |
| 1843 | _err = WERemoveUserInfo(inUserTag, |
| 1844 | _self->ob_itself); |
| 1845 | if (_err != noErr) return PyMac_Error(_err); |
| 1846 | Py_INCREF(Py_None); |
| 1847 | _res = Py_None; |
| 1848 | return _res; |
| 1849 | } |
| 1850 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1851 | static PyObject *wasteObj_WEInstallTabHooks(wasteObject *_self, PyObject *_args) |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 1852 | { |
| 1853 | PyObject *_res = NULL; |
| 1854 | OSErr _err; |
| 1855 | if (!PyArg_ParseTuple(_args, "")) |
| 1856 | return NULL; |
| 1857 | _err = WEInstallTabHooks(_self->ob_itself); |
| 1858 | if (_err != noErr) return PyMac_Error(_err); |
| 1859 | Py_INCREF(Py_None); |
| 1860 | _res = Py_None; |
| 1861 | return _res; |
| 1862 | } |
| 1863 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1864 | static PyObject *wasteObj_WERemoveTabHooks(wasteObject *_self, PyObject *_args) |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 1865 | { |
| 1866 | PyObject *_res = NULL; |
| 1867 | OSErr _err; |
| 1868 | if (!PyArg_ParseTuple(_args, "")) |
| 1869 | return NULL; |
| 1870 | _err = WERemoveTabHooks(_self->ob_itself); |
| 1871 | if (_err != noErr) return PyMac_Error(_err); |
| 1872 | Py_INCREF(Py_None); |
| 1873 | _res = Py_None; |
| 1874 | return _res; |
| 1875 | } |
| 1876 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1877 | static PyObject *wasteObj_WEIsTabHooks(wasteObject *_self, PyObject *_args) |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 1878 | { |
| 1879 | PyObject *_res = NULL; |
| 1880 | Boolean _rv; |
| 1881 | if (!PyArg_ParseTuple(_args, "")) |
| 1882 | return NULL; |
| 1883 | _rv = WEIsTabHooks(_self->ob_itself); |
| 1884 | _res = Py_BuildValue("b", |
| 1885 | _rv); |
| 1886 | return _res; |
| 1887 | } |
| 1888 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1889 | static PyObject *wasteObj_WEGetTabSize(wasteObject *_self, PyObject *_args) |
Jack Jansen | a4f0309 | 1998-03-02 16:56:18 +0000 | [diff] [blame] | 1890 | { |
| 1891 | PyObject *_res = NULL; |
| 1892 | SInt16 _rv; |
| 1893 | if (!PyArg_ParseTuple(_args, "")) |
| 1894 | return NULL; |
| 1895 | _rv = WEGetTabSize(_self->ob_itself); |
| 1896 | _res = Py_BuildValue("h", |
| 1897 | _rv); |
| 1898 | return _res; |
| 1899 | } |
| 1900 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 1901 | static PyObject *wasteObj_WESetTabSize(wasteObject *_self, PyObject *_args) |
Jack Jansen | a4f0309 | 1998-03-02 16:56:18 +0000 | [diff] [blame] | 1902 | { |
| 1903 | PyObject *_res = NULL; |
| 1904 | OSErr _err; |
| 1905 | SInt16 tabWidth; |
| 1906 | if (!PyArg_ParseTuple(_args, "h", |
| 1907 | &tabWidth)) |
| 1908 | return NULL; |
| 1909 | _err = WESetTabSize(tabWidth, |
| 1910 | _self->ob_itself); |
| 1911 | if (_err != noErr) return PyMac_Error(_err); |
| 1912 | Py_INCREF(Py_None); |
| 1913 | _res = Py_None; |
| 1914 | return _res; |
| 1915 | } |
| 1916 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1917 | static PyMethodDef wasteObj_methods[] = { |
| 1918 | {"WEGetText", (PyCFunction)wasteObj_WEGetText, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1919 | PyDoc_STR("() -> (Handle _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1920 | {"WEGetChar", (PyCFunction)wasteObj_WEGetChar, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1921 | PyDoc_STR("(SInt32 inOffset) -> (SInt16 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1922 | {"WEGetTextLength", (PyCFunction)wasteObj_WEGetTextLength, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1923 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1924 | {"WEGetSelection", (PyCFunction)wasteObj_WEGetSelection, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1925 | PyDoc_STR("() -> (SInt32 outSelStart, SInt32 outSelEnd)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1926 | {"WEGetDestRect", (PyCFunction)wasteObj_WEGetDestRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1927 | PyDoc_STR("() -> (LongRect outDestRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1928 | {"WEGetViewRect", (PyCFunction)wasteObj_WEGetViewRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1929 | PyDoc_STR("() -> (LongRect outViewRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1930 | {"WEIsActive", (PyCFunction)wasteObj_WEIsActive, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1931 | PyDoc_STR("() -> (Boolean _rv)")}, |
Jack Jansen | 2268af5 | 1996-08-06 16:04:22 +0000 | [diff] [blame] | 1932 | {"WEGetClickCount", (PyCFunction)wasteObj_WEGetClickCount, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1933 | PyDoc_STR("() -> (UInt16 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1934 | {"WESetSelection", (PyCFunction)wasteObj_WESetSelection, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1935 | PyDoc_STR("(SInt32 inSelStart, SInt32 inSelEnd) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1936 | {"WESetDestRect", (PyCFunction)wasteObj_WESetDestRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1937 | PyDoc_STR("(LongRect inDestRect) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1938 | {"WESetViewRect", (PyCFunction)wasteObj_WESetViewRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1939 | PyDoc_STR("(LongRect inViewRect) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1940 | {"WEContinuousStyle", (PyCFunction)wasteObj_WEContinuousStyle, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1941 | PyDoc_STR("(WEStyleMode ioMode) -> (Boolean _rv, WEStyleMode ioMode, TextStyle outTextStyle)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1942 | {"WECountRuns", (PyCFunction)wasteObj_WECountRuns, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1943 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1944 | {"WEOffsetToRun", (PyCFunction)wasteObj_WEOffsetToRun, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1945 | PyDoc_STR("(SInt32 inOffset) -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1946 | {"WEGetRunRange", (PyCFunction)wasteObj_WEGetRunRange, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1947 | PyDoc_STR("(SInt32 inStyleRunIndex) -> (SInt32 outStyleRunStart, SInt32 outStyleRunEnd)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1948 | {"WEGetRunInfo", (PyCFunction)wasteObj_WEGetRunInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1949 | PyDoc_STR("(SInt32 inOffset) -> (WERunInfo outStyleRunInfo)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1950 | {"WEGetIndRunInfo", (PyCFunction)wasteObj_WEGetIndRunInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1951 | PyDoc_STR("(SInt32 inStyleRunIndex) -> (WERunInfo outStyleRunInfo)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1952 | {"WEGetRunDirection", (PyCFunction)wasteObj_WEGetRunDirection, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1953 | PyDoc_STR("(SInt32 inOffset) -> (Boolean _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1954 | {"WECountParaRuns", (PyCFunction)wasteObj_WECountParaRuns, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1955 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1956 | {"WEOffsetToParaRun", (PyCFunction)wasteObj_WEOffsetToParaRun, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1957 | PyDoc_STR("(SInt32 inOffset) -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1958 | {"WEGetParaRunRange", (PyCFunction)wasteObj_WEGetParaRunRange, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1959 | PyDoc_STR("(SInt32 inParagraphRunIndex) -> (SInt32 outParagraphRunStart, SInt32 outParagraphRunEnd)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1960 | {"WECountLines", (PyCFunction)wasteObj_WECountLines, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1961 | PyDoc_STR("() -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1962 | {"WEOffsetToLine", (PyCFunction)wasteObj_WEOffsetToLine, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1963 | PyDoc_STR("(SInt32 inOffset) -> (SInt32 _rv)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1964 | {"WEGetLineRange", (PyCFunction)wasteObj_WEGetLineRange, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1965 | PyDoc_STR("(SInt32 inLineIndex) -> (SInt32 outLineStart, SInt32 outLineEnd)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1966 | {"WEGetHeight", (PyCFunction)wasteObj_WEGetHeight, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1967 | PyDoc_STR("(SInt32 inStartLineIndex, SInt32 inEndLineIndex) -> (SInt32 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1968 | {"WEGetOffset", (PyCFunction)wasteObj_WEGetOffset, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1969 | PyDoc_STR("(LongPt inPoint) -> (SInt32 _rv, WEEdge outEdge)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1970 | {"WEGetPoint", (PyCFunction)wasteObj_WEGetPoint, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1971 | PyDoc_STR("(SInt32 inOffset, SInt16 inDirection) -> (LongPt outPoint, SInt16 outLineHeight)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1972 | {"WEFindWord", (PyCFunction)wasteObj_WEFindWord, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1973 | PyDoc_STR("(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outWordStart, SInt32 outWordEnd)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1974 | {"WEFindLine", (PyCFunction)wasteObj_WEFindLine, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1975 | PyDoc_STR("(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outLineStart, SInt32 outLineEnd)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1976 | {"WEFindParagraph", (PyCFunction)wasteObj_WEFindParagraph, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1977 | PyDoc_STR("(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outParagraphStart, SInt32 outParagraphEnd)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1978 | {"WEFind", (PyCFunction)wasteObj_WEFind, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1979 | PyDoc_STR("(char* inKey, SInt32 inKeyLength, TextEncoding inKeyEncoding, OptionBits inMatchOptions, SInt32 inRangeStart, SInt32 inRangeEnd) -> (SInt32 outMatchStart, SInt32 outMatchEnd)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1980 | {"WEStreamRange", (PyCFunction)wasteObj_WEStreamRange, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1981 | PyDoc_STR("(SInt32 inRangeStart, SInt32 inRangeEnd, FlavorType inRequestedType, OptionBits inStreamOptions, Handle outData) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1982 | {"WECopyRange", (PyCFunction)wasteObj_WECopyRange, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1983 | PyDoc_STR("(SInt32 inRangeStart, SInt32 inRangeEnd, Handle outText, StScrpHandle outStyles, WESoupHandle outSoup) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 1984 | {"WEGetTextRangeAsUnicode", (PyCFunction)wasteObj_WEGetTextRangeAsUnicode, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1985 | PyDoc_STR("(SInt32 inRangeStart, SInt32 inRangeEnd, Handle outUnicodeText, Handle ioCharFormat, Handle ioParaFormat, TextEncodingVariant inUnicodeVariant, TextEncodingFormat inTransformationFormat, OptionBits inGetOptions) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1986 | {"WEGetAlignment", (PyCFunction)wasteObj_WEGetAlignment, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1987 | PyDoc_STR("() -> (WEAlignment _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1988 | {"WESetAlignment", (PyCFunction)wasteObj_WESetAlignment, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1989 | PyDoc_STR("(WEAlignment inAlignment) -> None")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1990 | {"WEGetDirection", (PyCFunction)wasteObj_WEGetDirection, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1991 | PyDoc_STR("() -> (WEDirection _rv)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 1992 | {"WESetDirection", (PyCFunction)wasteObj_WESetDirection, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1993 | PyDoc_STR("(WEDirection inDirection) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1994 | {"WECalText", (PyCFunction)wasteObj_WECalText, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1995 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1996 | {"WEUpdate", (PyCFunction)wasteObj_WEUpdate, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1997 | PyDoc_STR("(RgnHandle inUpdateRgn) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 1998 | {"WEScroll", (PyCFunction)wasteObj_WEScroll, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 1999 | PyDoc_STR("(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2000 | {"WEPinScroll", (PyCFunction)wasteObj_WEPinScroll, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2001 | PyDoc_STR("(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2002 | {"WESelView", (PyCFunction)wasteObj_WESelView, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2003 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2004 | {"WEActivate", (PyCFunction)wasteObj_WEActivate, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2005 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2006 | {"WEDeactivate", (PyCFunction)wasteObj_WEDeactivate, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2007 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2008 | {"WEKey", (PyCFunction)wasteObj_WEKey, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2009 | PyDoc_STR("(CharParameter inKey, EventModifiers inModifiers) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2010 | {"WEClick", (PyCFunction)wasteObj_WEClick, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2011 | PyDoc_STR("(Point inHitPoint, EventModifiers inModifiers, UInt32 inClickTime) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2012 | {"WEAdjustCursor", (PyCFunction)wasteObj_WEAdjustCursor, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2013 | PyDoc_STR("(Point inMouseLoc, RgnHandle ioMouseRgn) -> (Boolean _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2014 | {"WEIdle", (PyCFunction)wasteObj_WEIdle, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2015 | PyDoc_STR("() -> (UInt32 outMaxSleep)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2016 | {"WEInsert", (PyCFunction)wasteObj_WEInsert, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2017 | PyDoc_STR("(Buffer inTextPtr, StScrpHandle inStyles, WESoupHandle inSoup) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2018 | {"WEInsertFormattedText", (PyCFunction)wasteObj_WEInsertFormattedText, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2019 | PyDoc_STR("(Buffer inTextPtr, StScrpHandle inStyles, WESoupHandle inSoup, Handle inParaFormat, Handle inRulerScrap) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2020 | {"WEDelete", (PyCFunction)wasteObj_WEDelete, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2021 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2022 | {"WEUseText", (PyCFunction)wasteObj_WEUseText, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2023 | PyDoc_STR("(Handle inText) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2024 | {"WEChangeCase", (PyCFunction)wasteObj_WEChangeCase, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2025 | PyDoc_STR("(SInt16 inCase) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2026 | {"WESetOneAttribute", (PyCFunction)wasteObj_WESetOneAttribute, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2027 | PyDoc_STR("(SInt32 inRangeStart, SInt32 inRangeEnd, WESelector inAttributeSelector, Buffer inAttributeValue) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2028 | {"WESetStyle", (PyCFunction)wasteObj_WESetStyle, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2029 | PyDoc_STR("(WEStyleMode inMode, TextStyle inTextStyle) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2030 | {"WEUseStyleScrap", (PyCFunction)wasteObj_WEUseStyleScrap, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2031 | PyDoc_STR("(StScrpHandle inStyles) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2032 | {"WEUndo", (PyCFunction)wasteObj_WEUndo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2033 | PyDoc_STR("() -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2034 | {"WERedo", (PyCFunction)wasteObj_WERedo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2035 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2036 | {"WEClearUndo", (PyCFunction)wasteObj_WEClearUndo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2037 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2038 | {"WEGetUndoInfo", (PyCFunction)wasteObj_WEGetUndoInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2039 | PyDoc_STR("() -> (WEActionKind _rv, Boolean outRedoFlag)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2040 | {"WEGetIndUndoInfo", (PyCFunction)wasteObj_WEGetIndUndoInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2041 | PyDoc_STR("(SInt32 inUndoLevel) -> (WEActionKind _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2042 | {"WEIsTyping", (PyCFunction)wasteObj_WEIsTyping, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2043 | PyDoc_STR("() -> (Boolean _rv)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2044 | {"WEBeginAction", (PyCFunction)wasteObj_WEBeginAction, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2045 | PyDoc_STR("() -> None")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2046 | {"WEEndAction", (PyCFunction)wasteObj_WEEndAction, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2047 | PyDoc_STR("(WEActionKind inActionKind) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2048 | {"WEGetModCount", (PyCFunction)wasteObj_WEGetModCount, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2049 | PyDoc_STR("() -> (UInt32 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2050 | {"WEResetModCount", (PyCFunction)wasteObj_WEResetModCount, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2051 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2052 | {"WEInsertObject", (PyCFunction)wasteObj_WEInsertObject, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2053 | PyDoc_STR("(FlavorType inObjectType, Handle inObjectDataHandle, Point inObjectSize) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2054 | {"WEGetSelectedObject", (PyCFunction)wasteObj_WEGetSelectedObject, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2055 | PyDoc_STR("() -> (WEObjectReference outObject)")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2056 | {"WEGetObjectAtOffset", (PyCFunction)wasteObj_WEGetObjectAtOffset, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2057 | PyDoc_STR("(SInt32 inOffset) -> (WEObjectReference outObject)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2058 | {"WEFindNextObject", (PyCFunction)wasteObj_WEFindNextObject, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2059 | PyDoc_STR("(SInt32 inOffset) -> (SInt32 _rv, WEObjectReference outObject)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2060 | {"WEUseSoup", (PyCFunction)wasteObj_WEUseSoup, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2061 | PyDoc_STR("(WESoupHandle inSoup) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2062 | {"WECut", (PyCFunction)wasteObj_WECut, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2063 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2064 | {"WECopy", (PyCFunction)wasteObj_WECopy, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2065 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2066 | {"WEPaste", (PyCFunction)wasteObj_WEPaste, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2067 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2068 | {"WECanPaste", (PyCFunction)wasteObj_WECanPaste, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2069 | PyDoc_STR("() -> (Boolean _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2070 | {"WEGetHiliteRgn", (PyCFunction)wasteObj_WEGetHiliteRgn, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2071 | PyDoc_STR("(SInt32 inRangeStart, SInt32 inRangeEnd) -> (RgnHandle _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2072 | {"WECharByte", (PyCFunction)wasteObj_WECharByte, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2073 | PyDoc_STR("(SInt32 inOffset) -> (SInt16 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2074 | {"WECharType", (PyCFunction)wasteObj_WECharType, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2075 | PyDoc_STR("(SInt32 inOffset) -> (SInt16 _rv)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2076 | {"WEStopInlineSession", (PyCFunction)wasteObj_WEStopInlineSession, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2077 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2078 | {"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2079 | PyDoc_STR("(SInt16 inFeature, SInt16 inAction) -> (SInt16 _rv)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2080 | {"WEGetUserInfo", (PyCFunction)wasteObj_WEGetUserInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2081 | PyDoc_STR("(WESelector inUserTag) -> (SInt32 outUserInfo)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2082 | {"WESetUserInfo", (PyCFunction)wasteObj_WESetUserInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2083 | PyDoc_STR("(WESelector inUserTag, SInt32 inUserInfo) -> None")}, |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2084 | {"WERemoveUserInfo", (PyCFunction)wasteObj_WERemoveUserInfo, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2085 | PyDoc_STR("(WESelector inUserTag) -> None")}, |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 2086 | {"WEInstallTabHooks", (PyCFunction)wasteObj_WEInstallTabHooks, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2087 | PyDoc_STR("() -> None")}, |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 2088 | {"WERemoveTabHooks", (PyCFunction)wasteObj_WERemoveTabHooks, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2089 | PyDoc_STR("() -> None")}, |
Jack Jansen | 176f3a9 | 1996-10-23 15:43:46 +0000 | [diff] [blame] | 2090 | {"WEIsTabHooks", (PyCFunction)wasteObj_WEIsTabHooks, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2091 | PyDoc_STR("() -> (Boolean _rv)")}, |
Jack Jansen | a4f0309 | 1998-03-02 16:56:18 +0000 | [diff] [blame] | 2092 | {"WEGetTabSize", (PyCFunction)wasteObj_WEGetTabSize, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2093 | PyDoc_STR("() -> (SInt16 _rv)")}, |
Jack Jansen | a4f0309 | 1998-03-02 16:56:18 +0000 | [diff] [blame] | 2094 | {"WESetTabSize", (PyCFunction)wasteObj_WESetTabSize, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2095 | PyDoc_STR("(SInt16 tabWidth) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2096 | {NULL, NULL, 0} |
| 2097 | }; |
| 2098 | |
| 2099 | PyMethodChain wasteObj_chain = { wasteObj_methods, NULL }; |
| 2100 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2101 | static PyObject *wasteObj_getattr(wasteObject *self, char *name) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2102 | { |
| 2103 | return Py_FindMethodInChain(&wasteObj_chain, (PyObject *)self, name); |
| 2104 | } |
| 2105 | |
| 2106 | #define wasteObj_setattr NULL |
| 2107 | |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 2108 | #define wasteObj_compare NULL |
| 2109 | |
| 2110 | #define wasteObj_repr NULL |
| 2111 | |
| 2112 | #define wasteObj_hash NULL |
| 2113 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2114 | PyTypeObject waste_Type = { |
Jack Jansen | b3be216 | 2001-11-30 14:16:36 +0000 | [diff] [blame] | 2115 | PyObject_HEAD_INIT(NULL) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2116 | 0, /*ob_size*/ |
Guido van Rossum | 1464839 | 2001-12-08 18:02:58 +0000 | [diff] [blame] | 2117 | "waste.waste", /*tp_name*/ |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2118 | sizeof(wasteObject), /*tp_basicsize*/ |
| 2119 | 0, /*tp_itemsize*/ |
| 2120 | /* methods */ |
| 2121 | (destructor) wasteObj_dealloc, /*tp_dealloc*/ |
| 2122 | 0, /*tp_print*/ |
| 2123 | (getattrfunc) wasteObj_getattr, /*tp_getattr*/ |
| 2124 | (setattrfunc) wasteObj_setattr, /*tp_setattr*/ |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 2125 | (cmpfunc) wasteObj_compare, /*tp_compare*/ |
| 2126 | (reprfunc) wasteObj_repr, /*tp_repr*/ |
| 2127 | (PyNumberMethods *)0, /* tp_as_number */ |
| 2128 | (PySequenceMethods *)0, /* tp_as_sequence */ |
| 2129 | (PyMappingMethods *)0, /* tp_as_mapping */ |
| 2130 | (hashfunc) wasteObj_hash, /*tp_hash*/ |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2131 | }; |
| 2132 | |
| 2133 | /* --------------------- End object type waste ---------------------- */ |
| 2134 | |
| 2135 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2136 | static PyObject *waste_WENew(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2137 | { |
| 2138 | PyObject *_res = NULL; |
| 2139 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2140 | LongRect inDestRect; |
| 2141 | LongRect inViewRect; |
| 2142 | OptionBits inOptions; |
| 2143 | WEReference outWE; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2144 | if (!PyArg_ParseTuple(_args, "O&O&l", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2145 | LongRect_Convert, &inDestRect, |
| 2146 | LongRect_Convert, &inViewRect, |
| 2147 | &inOptions)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2148 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2149 | _err = WENew(&inDestRect, |
| 2150 | &inViewRect, |
| 2151 | inOptions, |
| 2152 | &outWE); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2153 | if (_err != noErr) return PyMac_Error(_err); |
| 2154 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2155 | wasteObj_New, outWE); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2156 | return _res; |
| 2157 | } |
| 2158 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2159 | static PyObject *waste_WEUpdateStyleScrap(PyObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2160 | { |
| 2161 | PyObject *_res = NULL; |
| 2162 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2163 | StScrpHandle ioStyles; |
| 2164 | WEFontTableHandle inFontTable; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2165 | if (!PyArg_ParseTuple(_args, "O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2166 | ResObj_Convert, &ioStyles, |
| 2167 | ResObj_Convert, &inFontTable)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2168 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2169 | _err = WEUpdateStyleScrap(ioStyles, |
| 2170 | inFontTable); |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2171 | if (_err != noErr) return PyMac_Error(_err); |
| 2172 | Py_INCREF(Py_None); |
| 2173 | _res = Py_None; |
| 2174 | return _res; |
| 2175 | } |
| 2176 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2177 | static PyObject *waste_WEInstallTSMHandlers(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2178 | { |
| 2179 | PyObject *_res = NULL; |
| 2180 | OSErr _err; |
| 2181 | if (!PyArg_ParseTuple(_args, "")) |
| 2182 | return NULL; |
| 2183 | _err = WEInstallTSMHandlers(); |
| 2184 | if (_err != noErr) return PyMac_Error(_err); |
| 2185 | Py_INCREF(Py_None); |
| 2186 | _res = Py_None; |
| 2187 | return _res; |
| 2188 | } |
| 2189 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2190 | static PyObject *waste_WERemoveTSMHandlers(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2191 | { |
| 2192 | PyObject *_res = NULL; |
| 2193 | OSErr _err; |
| 2194 | if (!PyArg_ParseTuple(_args, "")) |
| 2195 | return NULL; |
| 2196 | _err = WERemoveTSMHandlers(); |
| 2197 | if (_err != noErr) return PyMac_Error(_err); |
| 2198 | Py_INCREF(Py_None); |
| 2199 | _res = Py_None; |
| 2200 | return _res; |
| 2201 | } |
| 2202 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2203 | static PyObject *waste_WEHandleTSMEvent(PyObject *_self, PyObject *_args) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2204 | { |
| 2205 | PyObject *_res = NULL; |
| 2206 | OSErr _err; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2207 | AppleEvent inAppleEvent; |
| 2208 | AppleEvent ioReply; |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2209 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2210 | AEDesc_Convert, &inAppleEvent)) |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2211 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2212 | _err = WEHandleTSMEvent(&inAppleEvent, |
| 2213 | &ioReply); |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2214 | if (_err != noErr) return PyMac_Error(_err); |
| 2215 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2216 | AEDesc_New, &ioReply); |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2217 | return _res; |
| 2218 | } |
| 2219 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2220 | static PyObject *waste_WELongPointToPoint(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2221 | { |
| 2222 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2223 | LongPt inLongPoint; |
| 2224 | Point outPoint; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2225 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2226 | LongPt_Convert, &inLongPoint)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2227 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2228 | WELongPointToPoint(&inLongPoint, |
| 2229 | &outPoint); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2230 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2231 | PyMac_BuildPoint, outPoint); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2232 | return _res; |
| 2233 | } |
| 2234 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2235 | static PyObject *waste_WEPointToLongPoint(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2236 | { |
| 2237 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2238 | Point inPoint; |
| 2239 | LongPt outLongPoint; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2240 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2241 | PyMac_GetPoint, &inPoint)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2242 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2243 | WEPointToLongPoint(inPoint, |
| 2244 | &outLongPoint); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2245 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2246 | LongPt_New, &outLongPoint); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2247 | return _res; |
| 2248 | } |
| 2249 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2250 | static PyObject *waste_WESetLongRect(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2251 | { |
| 2252 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2253 | LongRect outLongRect; |
| 2254 | SInt32 inLeft; |
| 2255 | SInt32 inTop; |
| 2256 | SInt32 inRight; |
| 2257 | SInt32 inBottom; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2258 | if (!PyArg_ParseTuple(_args, "llll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2259 | &inLeft, |
| 2260 | &inTop, |
| 2261 | &inRight, |
| 2262 | &inBottom)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2263 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2264 | WESetLongRect(&outLongRect, |
| 2265 | inLeft, |
| 2266 | inTop, |
| 2267 | inRight, |
| 2268 | inBottom); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2269 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2270 | LongRect_New, &outLongRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2271 | return _res; |
| 2272 | } |
| 2273 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2274 | static PyObject *waste_WELongRectToRect(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2275 | { |
| 2276 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2277 | LongRect inLongRect; |
| 2278 | Rect outRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2279 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2280 | LongRect_Convert, &inLongRect)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2281 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2282 | WELongRectToRect(&inLongRect, |
| 2283 | &outRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2284 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2285 | PyMac_BuildRect, &outRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2286 | return _res; |
| 2287 | } |
| 2288 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2289 | static PyObject *waste_WERectToLongRect(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2290 | { |
| 2291 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2292 | Rect inRect; |
| 2293 | LongRect outLongRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2294 | if (!PyArg_ParseTuple(_args, "O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2295 | PyMac_GetRect, &inRect)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2296 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2297 | WERectToLongRect(&inRect, |
| 2298 | &outLongRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2299 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2300 | LongRect_New, &outLongRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2301 | return _res; |
| 2302 | } |
| 2303 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2304 | static PyObject *waste_WEOffsetLongRect(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2305 | { |
| 2306 | PyObject *_res = NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2307 | LongRect ioLongRect; |
| 2308 | SInt32 inHorizontalOffset; |
| 2309 | SInt32 inVerticalOffset; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2310 | if (!PyArg_ParseTuple(_args, "ll", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2311 | &inHorizontalOffset, |
| 2312 | &inVerticalOffset)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2313 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2314 | WEOffsetLongRect(&ioLongRect, |
| 2315 | inHorizontalOffset, |
| 2316 | inVerticalOffset); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2317 | _res = Py_BuildValue("O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2318 | LongRect_New, &ioLongRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2319 | return _res; |
| 2320 | } |
| 2321 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2322 | static PyObject *waste_WELongPointInLongRect(PyObject *_self, PyObject *_args) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2323 | { |
| 2324 | PyObject *_res = NULL; |
| 2325 | Boolean _rv; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2326 | LongPt inLongPoint; |
| 2327 | LongRect inLongRect; |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2328 | if (!PyArg_ParseTuple(_args, "O&O&", |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2329 | LongPt_Convert, &inLongPoint, |
| 2330 | LongRect_Convert, &inLongRect)) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2331 | return NULL; |
Jack Jansen | b99e521 | 2002-01-11 12:37:15 +0000 | [diff] [blame] | 2332 | _rv = WELongPointInLongRect(&inLongPoint, |
| 2333 | &inLongRect); |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2334 | _res = Py_BuildValue("b", |
| 2335 | _rv); |
| 2336 | return _res; |
| 2337 | } |
| 2338 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2339 | static PyObject *waste_STDObjectHandlers(PyObject *_self, PyObject *_args) |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2340 | { |
| 2341 | PyObject *_res = NULL; |
| 2342 | |
| 2343 | OSErr err; |
| 2344 | // install the sample object handlers for pictures and sounds |
| 2345 | #define kTypePicture 'PICT' |
| 2346 | #define kTypeSound 'snd ' |
| 2347 | |
| 2348 | if ( !PyArg_ParseTuple(_args, "") ) return NULL; |
| 2349 | |
| 2350 | if ((err = WEInstallObjectHandler(kTypePicture, weNewHandler, |
| 2351 | (UniversalProcPtr) NewWENewObjectProc(HandleNewPicture), NULL)) != noErr) |
| 2352 | goto cleanup; |
| 2353 | |
| 2354 | if ((err = WEInstallObjectHandler(kTypePicture, weDisposeHandler, |
| 2355 | (UniversalProcPtr) NewWEDisposeObjectProc(HandleDisposePicture), NULL)) != noErr) |
| 2356 | goto cleanup; |
| 2357 | |
| 2358 | if ((err = WEInstallObjectHandler(kTypePicture, weDrawHandler, |
| 2359 | (UniversalProcPtr) NewWEDrawObjectProc(HandleDrawPicture), NULL)) != noErr) |
| 2360 | goto cleanup; |
| 2361 | |
| 2362 | if ((err = WEInstallObjectHandler(kTypeSound, weNewHandler, |
| 2363 | (UniversalProcPtr) NewWENewObjectProc(HandleNewSound), NULL)) != noErr) |
| 2364 | goto cleanup; |
| 2365 | |
| 2366 | if ((err = WEInstallObjectHandler(kTypeSound, weDrawHandler, |
| 2367 | (UniversalProcPtr) NewWEDrawObjectProc(HandleDrawSound), NULL)) != noErr) |
| 2368 | goto cleanup; |
| 2369 | |
| 2370 | if ((err = WEInstallObjectHandler(kTypeSound, weClickHandler, |
| 2371 | (UniversalProcPtr) NewWEClickObjectProc(HandleClickSound), NULL)) != noErr) |
| 2372 | goto cleanup; |
| 2373 | Py_INCREF(Py_None); |
| 2374 | return Py_None; |
| 2375 | |
| 2376 | cleanup: |
| 2377 | return PyMac_Error(err); |
| 2378 | |
| 2379 | } |
| 2380 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2381 | static PyObject *waste_WEInstallObjectHandler(PyObject *_self, PyObject *_args) |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2382 | { |
| 2383 | PyObject *_res = NULL; |
| 2384 | |
| 2385 | OSErr err; |
| 2386 | FlavorType objectType; |
| 2387 | WESelector selector; |
| 2388 | PyObject *py_handler; |
| 2389 | UniversalProcPtr handler; |
| 2390 | WEReference we = NULL; |
| 2391 | PyObject *key; |
| 2392 | |
| 2393 | |
| 2394 | if ( !PyArg_ParseTuple(_args, "O&O&O|O&", |
| 2395 | PyMac_GetOSType, &objectType, |
| 2396 | PyMac_GetOSType, &selector, |
| 2397 | &py_handler, |
Jack Jansen | 7df3606 | 1996-10-01 11:41:14 +0000 | [diff] [blame] | 2398 | WEOObj_Convert, &we) ) return NULL; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2399 | |
Jack Jansen | 25241d9 | 1996-05-20 11:30:45 +0000 | [diff] [blame] | 2400 | if ( selector == weNewHandler ) handler = (UniversalProcPtr)upp_new_handler; |
| 2401 | else if ( selector == weDisposeHandler ) handler = (UniversalProcPtr)upp_dispose_handler; |
| 2402 | else if ( selector == weDrawHandler ) handler = (UniversalProcPtr)upp_draw_handler; |
| 2403 | else if ( selector == weClickHandler ) handler = (UniversalProcPtr)upp_click_handler; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2404 | else return PyMac_Error(weUndefinedSelectorErr); |
| 2405 | |
| 2406 | if ((key = Py_BuildValue("O&O&", |
| 2407 | PyMac_BuildOSType, objectType, |
| 2408 | PyMac_BuildOSType, selector)) == NULL ) |
| 2409 | return NULL; |
| 2410 | |
| 2411 | PyDict_SetItem(callbackdict, key, py_handler); |
| 2412 | |
| 2413 | err = WEInstallObjectHandler(objectType, selector, handler, we); |
| 2414 | if ( err ) return PyMac_Error(err); |
| 2415 | Py_INCREF(Py_None); |
| 2416 | return Py_None; |
| 2417 | |
| 2418 | } |
| 2419 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2420 | static PyMethodDef waste_methods[] = { |
| 2421 | {"WENew", (PyCFunction)waste_WENew, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2422 | PyDoc_STR("(LongRect inDestRect, LongRect inViewRect, OptionBits inOptions) -> (WEReference outWE)")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2423 | {"WEUpdateStyleScrap", (PyCFunction)waste_WEUpdateStyleScrap, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2424 | PyDoc_STR("(StScrpHandle ioStyles, WEFontTableHandle inFontTable) -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2425 | {"WEInstallTSMHandlers", (PyCFunction)waste_WEInstallTSMHandlers, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2426 | PyDoc_STR("() -> None")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2427 | {"WERemoveTSMHandlers", (PyCFunction)waste_WERemoveTSMHandlers, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2428 | PyDoc_STR("() -> None")}, |
Jack Jansen | 2369a98 | 1998-02-20 15:57:30 +0000 | [diff] [blame] | 2429 | {"WEHandleTSMEvent", (PyCFunction)waste_WEHandleTSMEvent, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2430 | PyDoc_STR("(AppleEvent inAppleEvent) -> (AppleEvent ioReply)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2431 | {"WELongPointToPoint", (PyCFunction)waste_WELongPointToPoint, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2432 | PyDoc_STR("(LongPt inLongPoint) -> (Point outPoint)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2433 | {"WEPointToLongPoint", (PyCFunction)waste_WEPointToLongPoint, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2434 | PyDoc_STR("(Point inPoint) -> (LongPt outLongPoint)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2435 | {"WESetLongRect", (PyCFunction)waste_WESetLongRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2436 | PyDoc_STR("(SInt32 inLeft, SInt32 inTop, SInt32 inRight, SInt32 inBottom) -> (LongRect outLongRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2437 | {"WELongRectToRect", (PyCFunction)waste_WELongRectToRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2438 | PyDoc_STR("(LongRect inLongRect) -> (Rect outRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2439 | {"WERectToLongRect", (PyCFunction)waste_WERectToLongRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2440 | PyDoc_STR("(Rect inRect) -> (LongRect outLongRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2441 | {"WEOffsetLongRect", (PyCFunction)waste_WEOffsetLongRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2442 | PyDoc_STR("(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> (LongRect ioLongRect)")}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2443 | {"WELongPointInLongRect", (PyCFunction)waste_WELongPointInLongRect, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2444 | PyDoc_STR("(LongPt inLongPoint, LongRect inLongRect) -> (Boolean _rv)")}, |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2445 | {"STDObjectHandlers", (PyCFunction)waste_STDObjectHandlers, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2446 | PyDoc_STR(NULL)}, |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2447 | {"WEInstallObjectHandler", (PyCFunction)waste_WEInstallObjectHandler, 1, |
Jack Jansen | 286e838 | 2002-08-22 23:29:45 +0000 | [diff] [blame] | 2448 | PyDoc_STR(NULL)}, |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2449 | {NULL, NULL, 0} |
| 2450 | }; |
| 2451 | |
| 2452 | |
| 2453 | |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2454 | /* Return the object corresponding to the window, or NULL */ |
| 2455 | |
| 2456 | PyObject * |
| 2457 | ExistingwasteObj_New(w) |
| 2458 | WEReference w; |
| 2459 | { |
| 2460 | PyObject *it = NULL; |
| 2461 | |
| 2462 | if (w == NULL) |
| 2463 | it = NULL; |
| 2464 | else |
| 2465 | WEGetInfo(weRefCon, (void *)&it, w); |
| 2466 | if (it == NULL || ((wasteObject *)it)->ob_itself != w) |
| 2467 | it = Py_None; |
| 2468 | Py_INCREF(it); |
| 2469 | return it; |
| 2470 | } |
| 2471 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2472 | |
Jack Jansen | fa77e1a | 2001-05-22 21:56:42 +0000 | [diff] [blame] | 2473 | void initwaste(void) |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2474 | { |
| 2475 | PyObject *m; |
| 2476 | PyObject *d; |
| 2477 | |
| 2478 | |
| 2479 | |
| 2480 | |
| 2481 | m = Py_InitModule("waste", waste_methods); |
| 2482 | d = PyModule_GetDict(m); |
| 2483 | waste_Error = PyMac_GetOSErrException(); |
| 2484 | if (waste_Error == NULL || |
| 2485 | PyDict_SetItemString(d, "Error", waste_Error) != 0) |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 2486 | return; |
Jack Jansen | a755e68 | 1997-09-20 17:40:22 +0000 | [diff] [blame] | 2487 | WEO_Type.ob_type = &PyType_Type; |
| 2488 | Py_INCREF(&WEO_Type); |
| 2489 | if (PyDict_SetItemString(d, "WEOType", (PyObject *)&WEO_Type) != 0) |
| 2490 | Py_FatalError("can't initialize WEOType"); |
| 2491 | waste_Type.ob_type = &PyType_Type; |
| 2492 | Py_INCREF(&waste_Type); |
| 2493 | if (PyDict_SetItemString(d, "wasteType", (PyObject *)&waste_Type) != 0) |
| 2494 | Py_FatalError("can't initialize wasteType"); |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2495 | |
| 2496 | callbackdict = PyDict_New(); |
| 2497 | if (callbackdict == NULL || PyDict_SetItemString(d, "callbacks", callbackdict) != 0) |
Jack Jansen | 97ed907 | 2000-09-08 22:06:16 +0000 | [diff] [blame] | 2498 | return; |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2499 | upp_new_handler = NewWENewObjectProc(my_new_handler); |
Jack Jansen | 25241d9 | 1996-05-20 11:30:45 +0000 | [diff] [blame] | 2500 | upp_dispose_handler = NewWEDisposeObjectProc(my_dispose_handler); |
| 2501 | upp_draw_handler = NewWEDrawObjectProc(my_draw_handler); |
| 2502 | upp_click_handler = NewWEClickObjectProc(my_click_handler); |
Jack Jansen | 756522f | 1996-05-07 15:24:01 +0000 | [diff] [blame] | 2503 | |
| 2504 | |
Jack Jansen | 90ecdf4 | 1996-04-16 14:29:15 +0000 | [diff] [blame] | 2505 | } |
| 2506 | |
| 2507 | /* ======================== End module waste ======================== */ |
| 2508 | |