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