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