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