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