Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Mac/Modules/te/_TEmodule.c

    r2 r391  
    1111/* Macro to test whether a weak-loaded CFM function exists */
    1212#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
    13         PyErr_SetString(PyExc_NotImplementedError, \
    14         "Not available in this shared library/OS version"); \
    15         return NULL; \
     13    PyErr_SetString(PyExc_NotImplementedError, \
     14    "Not available in this shared library/OS version"); \
     15    return NULL; \
    1616    }} while(0)
    1717
     
    3737{
    3838
    39         return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
    40                                 &itself->tsColor);
     39    return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
     40                            &itself->tsColor);
    4141}
    4242
     
    4444TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
    4545{
    46         long font, face, size;
    47 
    48         if( !PyArg_ParseTuple(v, "lllO&", &font, &face, &size, QdRGB_Convert, &p_itself->tsColor) )
    49                 return 0;
    50         p_itself->tsFont = (short)font;
    51         p_itself->tsFace = (Style)face;
    52         p_itself->tsSize = (short)size;
    53         return 1;
     46    long font, face, size;
     47
     48    if( !PyArg_ParseTuple(v, "lllO&", &font, &face, &size, QdRGB_Convert, &p_itself->tsColor) )
     49        return 0;
     50    p_itself->tsFont = (short)font;
     51    p_itself->tsFace = (Style)face;
     52    p_itself->tsSize = (short)size;
     53    return 1;
    5454}
    5555
     
    6363
    6464typedef struct TEObject {
    65         PyObject_HEAD
    66         TEHandle ob_itself;
     65    PyObject_HEAD
     66    TEHandle ob_itself;
    6767} TEObject;
    6868
    6969PyObject *TEObj_New(TEHandle itself)
    7070{
    71         TEObject *it;
    72         if (itself == NULL) {
    73                                         PyErr_SetString(TE_Error,"Cannot create null TE");
    74                                         return NULL;
    75                                 }
    76         it = PyObject_NEW(TEObject, &TE_Type);
    77         if (it == NULL) return NULL;
    78         it->ob_itself = itself;
    79         return (PyObject *)it;
     71    TEObject *it;
     72    if (itself == NULL) {
     73                                    PyErr_SetString(TE_Error,"Cannot create null TE");
     74                                    return NULL;
     75                            }
     76    it = PyObject_NEW(TEObject, &TE_Type);
     77    if (it == NULL) return NULL;
     78    it->ob_itself = itself;
     79    return (PyObject *)it;
    8080}
    8181
    8282int TEObj_Convert(PyObject *v, TEHandle *p_itself)
    8383{
    84         if (!TEObj_Check(v))
    85         {
    86                 PyErr_SetString(PyExc_TypeError, "TE required");
    87                 return 0;
    88         }
    89         *p_itself = ((TEObject *)v)->ob_itself;
    90         return 1;
     84    if (!TEObj_Check(v))
     85    {
     86        PyErr_SetString(PyExc_TypeError, "TE required");
     87        return 0;
     88    }
     89    *p_itself = ((TEObject *)v)->ob_itself;
     90    return 1;
    9191}
    9292
    9393static void TEObj_dealloc(TEObject *self)
    9494{
    95         TEDispose(self->ob_itself);
    96         self->ob_type->tp_free((PyObject *)self);
     95    TEDispose(self->ob_itself);
     96    self->ob_type->tp_free((PyObject *)self);
    9797}
    9898
    9999static PyObject *TEObj_TESetText(TEObject *_self, PyObject *_args)
    100100{
    101         PyObject *_res = NULL;
    102         char *text__in__;
    103         long text__len__;
    104         int text__in_len__;
     101    PyObject *_res = NULL;
     102    char *text__in__;
     103    long text__len__;
     104    int text__in_len__;
    105105#ifndef TESetText
    106         PyMac_PRECHECK(TESetText);
    107 #endif
    108         if (!PyArg_ParseTuple(_args, "s#",
    109                               &text__in__, &text__in_len__))
    110                 return NULL;
    111         text__len__ = text__in_len__;
    112         TESetText(text__in__, text__len__,
    113                   _self->ob_itself);
    114         Py_INCREF(Py_None);
    115         _res = Py_None;
    116         return _res;
     106    PyMac_PRECHECK(TESetText);
     107#endif
     108    if (!PyArg_ParseTuple(_args, "s#",
     109                          &text__in__, &text__in_len__))
     110        return NULL;
     111    text__len__ = text__in_len__;
     112    TESetText(text__in__, text__len__,
     113              _self->ob_itself);
     114    Py_INCREF(Py_None);
     115    _res = Py_None;
     116    return _res;
    117117}
    118118
    119119static PyObject *TEObj_TEGetText(TEObject *_self, PyObject *_args)
    120120{
    121         PyObject *_res = NULL;
    122         CharsHandle _rv;
     121    PyObject *_res = NULL;
     122    CharsHandle _rv;
    123123#ifndef TEGetText
    124         PyMac_PRECHECK(TEGetText);
    125 #endif
    126         if (!PyArg_ParseTuple(_args, ""))
    127                 return NULL;
    128         _rv = TEGetText(_self->ob_itself);
    129         _res = Py_BuildValue("O&",
    130                              ResObj_New, _rv);
    131         return _res;
     124    PyMac_PRECHECK(TEGetText);
     125#endif
     126    if (!PyArg_ParseTuple(_args, ""))
     127        return NULL;
     128    _rv = TEGetText(_self->ob_itself);
     129    _res = Py_BuildValue("O&",
     130                         ResObj_New, _rv);
     131    return _res;
    132132}
    133133
    134134static PyObject *TEObj_TEIdle(TEObject *_self, PyObject *_args)
    135135{
    136         PyObject *_res = NULL;
     136    PyObject *_res = NULL;
    137137#ifndef TEIdle
    138         PyMac_PRECHECK(TEIdle);
    139 #endif
    140         if (!PyArg_ParseTuple(_args, ""))
    141                 return NULL;
    142         TEIdle(_self->ob_itself);
    143         Py_INCREF(Py_None);
    144         _res = Py_None;
    145         return _res;
     138    PyMac_PRECHECK(TEIdle);
     139#endif
     140    if (!PyArg_ParseTuple(_args, ""))
     141        return NULL;
     142    TEIdle(_self->ob_itself);
     143    Py_INCREF(Py_None);
     144    _res = Py_None;
     145    return _res;
    146146}
    147147
    148148static PyObject *TEObj_TESetSelect(TEObject *_self, PyObject *_args)
    149149{
    150         PyObject *_res = NULL;
    151         long selStart;
    152         long selEnd;
     150    PyObject *_res = NULL;
     151    long selStart;
     152    long selEnd;
    153153#ifndef TESetSelect
    154         PyMac_PRECHECK(TESetSelect);
    155 #endif
    156         if (!PyArg_ParseTuple(_args, "ll",
    157                               &selStart,
    158                               &selEnd))
    159                 return NULL;
    160         TESetSelect(selStart,
    161                     selEnd,
    162                     _self->ob_itself);
    163         Py_INCREF(Py_None);
    164         _res = Py_None;
    165         return _res;
     154    PyMac_PRECHECK(TESetSelect);
     155#endif
     156    if (!PyArg_ParseTuple(_args, "ll",
     157                          &selStart,
     158                          &selEnd))
     159        return NULL;
     160    TESetSelect(selStart,
     161                selEnd,
     162                _self->ob_itself);
     163    Py_INCREF(Py_None);
     164    _res = Py_None;
     165    return _res;
    166166}
    167167
    168168static PyObject *TEObj_TEActivate(TEObject *_self, PyObject *_args)
    169169{
    170         PyObject *_res = NULL;
     170    PyObject *_res = NULL;
    171171#ifndef TEActivate
    172         PyMac_PRECHECK(TEActivate);
    173 #endif
    174         if (!PyArg_ParseTuple(_args, ""))
    175                 return NULL;
    176         TEActivate(_self->ob_itself);
    177         Py_INCREF(Py_None);
    178         _res = Py_None;
    179         return _res;
     172    PyMac_PRECHECK(TEActivate);
     173#endif
     174    if (!PyArg_ParseTuple(_args, ""))
     175        return NULL;
     176    TEActivate(_self->ob_itself);
     177    Py_INCREF(Py_None);
     178    _res = Py_None;
     179    return _res;
    180180}
    181181
    182182static PyObject *TEObj_TEDeactivate(TEObject *_self, PyObject *_args)
    183183{
    184         PyObject *_res = NULL;
     184    PyObject *_res = NULL;
    185185#ifndef TEDeactivate
    186         PyMac_PRECHECK(TEDeactivate);
    187 #endif
    188         if (!PyArg_ParseTuple(_args, ""))
    189                 return NULL;
    190         TEDeactivate(_self->ob_itself);
    191         Py_INCREF(Py_None);
    192         _res = Py_None;
    193         return _res;
     186    PyMac_PRECHECK(TEDeactivate);
     187#endif
     188    if (!PyArg_ParseTuple(_args, ""))
     189        return NULL;
     190    TEDeactivate(_self->ob_itself);
     191    Py_INCREF(Py_None);
     192    _res = Py_None;
     193    return _res;
    194194}
    195195
    196196static PyObject *TEObj_TEKey(TEObject *_self, PyObject *_args)
    197197{
    198         PyObject *_res = NULL;
    199         CharParameter key;
     198    PyObject *_res = NULL;
     199    CharParameter key;
    200200#ifndef TEKey
    201         PyMac_PRECHECK(TEKey);
    202 #endif
    203         if (!PyArg_ParseTuple(_args, "h",
    204                               &key))
    205                 return NULL;
    206         TEKey(key,
    207               _self->ob_itself);
    208         Py_INCREF(Py_None);
    209         _res = Py_None;
    210         return _res;
     201    PyMac_PRECHECK(TEKey);
     202#endif
     203    if (!PyArg_ParseTuple(_args, "h",
     204                          &key))
     205        return NULL;
     206    TEKey(key,
     207          _self->ob_itself);
     208    Py_INCREF(Py_None);
     209    _res = Py_None;
     210    return _res;
    211211}
    212212
    213213static PyObject *TEObj_TECut(TEObject *_self, PyObject *_args)
    214214{
    215         PyObject *_res = NULL;
     215    PyObject *_res = NULL;
    216216#ifndef TECut
    217         PyMac_PRECHECK(TECut);
    218 #endif
    219         if (!PyArg_ParseTuple(_args, ""))
    220                 return NULL;
    221         TECut(_self->ob_itself);
    222         Py_INCREF(Py_None);
    223         _res = Py_None;
    224         return _res;
     217    PyMac_PRECHECK(TECut);
     218#endif
     219    if (!PyArg_ParseTuple(_args, ""))
     220        return NULL;
     221    TECut(_self->ob_itself);
     222    Py_INCREF(Py_None);
     223    _res = Py_None;
     224    return _res;
    225225}
    226226
    227227static PyObject *TEObj_TECopy(TEObject *_self, PyObject *_args)
    228228{
    229         PyObject *_res = NULL;
     229    PyObject *_res = NULL;
    230230#ifndef TECopy
    231         PyMac_PRECHECK(TECopy);
    232 #endif
    233         if (!PyArg_ParseTuple(_args, ""))
    234                 return NULL;
    235         TECopy(_self->ob_itself);
    236         Py_INCREF(Py_None);
    237         _res = Py_None;
    238         return _res;
     231    PyMac_PRECHECK(TECopy);
     232#endif
     233    if (!PyArg_ParseTuple(_args, ""))
     234        return NULL;
     235    TECopy(_self->ob_itself);
     236    Py_INCREF(Py_None);
     237    _res = Py_None;
     238    return _res;
    239239}
    240240
    241241static PyObject *TEObj_TEPaste(TEObject *_self, PyObject *_args)
    242242{
    243         PyObject *_res = NULL;
     243    PyObject *_res = NULL;
    244244#ifndef TEPaste
    245         PyMac_PRECHECK(TEPaste);
    246 #endif
    247         if (!PyArg_ParseTuple(_args, ""))
    248                 return NULL;
    249         TEPaste(_self->ob_itself);
    250         Py_INCREF(Py_None);
    251         _res = Py_None;
    252         return _res;
     245    PyMac_PRECHECK(TEPaste);
     246#endif
     247    if (!PyArg_ParseTuple(_args, ""))
     248        return NULL;
     249    TEPaste(_self->ob_itself);
     250    Py_INCREF(Py_None);
     251    _res = Py_None;
     252    return _res;
    253253}
    254254
    255255static PyObject *TEObj_TEDelete(TEObject *_self, PyObject *_args)
    256256{
    257         PyObject *_res = NULL;
     257    PyObject *_res = NULL;
    258258#ifndef TEDelete
    259         PyMac_PRECHECK(TEDelete);
    260 #endif
    261         if (!PyArg_ParseTuple(_args, ""))
    262                 return NULL;
    263         TEDelete(_self->ob_itself);
    264         Py_INCREF(Py_None);
    265         _res = Py_None;
    266         return _res;
     259    PyMac_PRECHECK(TEDelete);
     260#endif
     261    if (!PyArg_ParseTuple(_args, ""))
     262        return NULL;
     263    TEDelete(_self->ob_itself);
     264    Py_INCREF(Py_None);
     265    _res = Py_None;
     266    return _res;
    267267}
    268268
    269269static PyObject *TEObj_TEInsert(TEObject *_self, PyObject *_args)
    270270{
    271         PyObject *_res = NULL;
    272         char *text__in__;
    273         long text__len__;
    274         int text__in_len__;
     271    PyObject *_res = NULL;
     272    char *text__in__;
     273    long text__len__;
     274    int text__in_len__;
    275275#ifndef TEInsert
    276         PyMac_PRECHECK(TEInsert);
    277 #endif
    278         if (!PyArg_ParseTuple(_args, "s#",
    279                               &text__in__, &text__in_len__))
    280                 return NULL;
    281         text__len__ = text__in_len__;
    282         TEInsert(text__in__, text__len__,
    283                  _self->ob_itself);
    284         Py_INCREF(Py_None);
    285         _res = Py_None;
    286         return _res;
     276    PyMac_PRECHECK(TEInsert);
     277#endif
     278    if (!PyArg_ParseTuple(_args, "s#",
     279                          &text__in__, &text__in_len__))
     280        return NULL;
     281    text__len__ = text__in_len__;
     282    TEInsert(text__in__, text__len__,
     283             _self->ob_itself);
     284    Py_INCREF(Py_None);
     285    _res = Py_None;
     286    return _res;
    287287}
    288288
    289289static PyObject *TEObj_TESetAlignment(TEObject *_self, PyObject *_args)
    290290{
    291         PyObject *_res = NULL;
    292         short just;
     291    PyObject *_res = NULL;
     292    short just;
    293293#ifndef TESetAlignment
    294         PyMac_PRECHECK(TESetAlignment);
    295 #endif
    296         if (!PyArg_ParseTuple(_args, "h",
    297                               &just))
    298                 return NULL;
    299         TESetAlignment(just,
    300                        _self->ob_itself);
    301         Py_INCREF(Py_None);
    302         _res = Py_None;
    303         return _res;
     294    PyMac_PRECHECK(TESetAlignment);
     295#endif
     296    if (!PyArg_ParseTuple(_args, "h",
     297                          &just))
     298        return NULL;
     299    TESetAlignment(just,
     300                   _self->ob_itself);
     301    Py_INCREF(Py_None);
     302    _res = Py_None;
     303    return _res;
    304304}
    305305
    306306static PyObject *TEObj_TEUpdate(TEObject *_self, PyObject *_args)
    307307{
    308         PyObject *_res = NULL;
    309         Rect rUpdate;
     308    PyObject *_res = NULL;
     309    Rect rUpdate;
    310310#ifndef TEUpdate
    311         PyMac_PRECHECK(TEUpdate);
    312 #endif
    313         if (!PyArg_ParseTuple(_args, "O&",
    314                               PyMac_GetRect, &rUpdate))
    315                 return NULL;
    316         TEUpdate(&rUpdate,
    317                  _self->ob_itself);
    318         Py_INCREF(Py_None);
    319         _res = Py_None;
    320         return _res;
     311    PyMac_PRECHECK(TEUpdate);
     312#endif
     313    if (!PyArg_ParseTuple(_args, "O&",
     314                          PyMac_GetRect, &rUpdate))
     315        return NULL;
     316    TEUpdate(&rUpdate,
     317             _self->ob_itself);
     318    Py_INCREF(Py_None);
     319    _res = Py_None;
     320    return _res;
    321321}
    322322
    323323static PyObject *TEObj_TEScroll(TEObject *_self, PyObject *_args)
    324324{
    325         PyObject *_res = NULL;
    326         short dh;
    327         short dv;
     325    PyObject *_res = NULL;
     326    short dh;
     327    short dv;
    328328#ifndef TEScroll
    329         PyMac_PRECHECK(TEScroll);
    330 #endif
    331         if (!PyArg_ParseTuple(_args, "hh",
    332                               &dh,
    333                               &dv))
    334                 return NULL;
    335         TEScroll(dh,
    336                  dv,
    337                  _self->ob_itself);
    338         Py_INCREF(Py_None);
    339         _res = Py_None;
    340         return _res;
     329    PyMac_PRECHECK(TEScroll);
     330#endif
     331    if (!PyArg_ParseTuple(_args, "hh",
     332                          &dh,
     333                          &dv))
     334        return NULL;
     335    TEScroll(dh,
     336             dv,
     337             _self->ob_itself);
     338    Py_INCREF(Py_None);
     339    _res = Py_None;
     340    return _res;
    341341}
    342342
    343343static PyObject *TEObj_TESelView(TEObject *_self, PyObject *_args)
    344344{
    345         PyObject *_res = NULL;
     345    PyObject *_res = NULL;
    346346#ifndef TESelView
    347         PyMac_PRECHECK(TESelView);
    348 #endif
    349         if (!PyArg_ParseTuple(_args, ""))
    350                 return NULL;
    351         TESelView(_self->ob_itself);
    352         Py_INCREF(Py_None);
    353         _res = Py_None;
    354         return _res;
     347    PyMac_PRECHECK(TESelView);
     348#endif
     349    if (!PyArg_ParseTuple(_args, ""))
     350        return NULL;
     351    TESelView(_self->ob_itself);
     352    Py_INCREF(Py_None);
     353    _res = Py_None;
     354    return _res;
    355355}
    356356
    357357static PyObject *TEObj_TEPinScroll(TEObject *_self, PyObject *_args)
    358358{
    359         PyObject *_res = NULL;
    360         short dh;
    361         short dv;
     359    PyObject *_res = NULL;
     360    short dh;
     361    short dv;
    362362#ifndef TEPinScroll
    363         PyMac_PRECHECK(TEPinScroll);
    364 #endif
    365         if (!PyArg_ParseTuple(_args, "hh",
    366                               &dh,
    367                               &dv))
    368                 return NULL;
    369         TEPinScroll(dh,
    370                     dv,
    371                     _self->ob_itself);
    372         Py_INCREF(Py_None);
    373         _res = Py_None;
    374         return _res;
     363    PyMac_PRECHECK(TEPinScroll);
     364#endif
     365    if (!PyArg_ParseTuple(_args, "hh",
     366                          &dh,
     367                          &dv))
     368        return NULL;
     369    TEPinScroll(dh,
     370                dv,
     371                _self->ob_itself);
     372    Py_INCREF(Py_None);
     373    _res = Py_None;
     374    return _res;
    375375}
    376376
    377377static PyObject *TEObj_TEAutoView(TEObject *_self, PyObject *_args)
    378378{
    379         PyObject *_res = NULL;
    380         Boolean fAuto;
     379    PyObject *_res = NULL;
     380    Boolean fAuto;
    381381#ifndef TEAutoView
    382         PyMac_PRECHECK(TEAutoView);
    383 #endif
    384         if (!PyArg_ParseTuple(_args, "b",
    385                               &fAuto))
    386                 return NULL;
    387         TEAutoView(fAuto,
    388                    _self->ob_itself);
    389         Py_INCREF(Py_None);
    390         _res = Py_None;
    391         return _res;
     382    PyMac_PRECHECK(TEAutoView);
     383#endif
     384    if (!PyArg_ParseTuple(_args, "b",
     385                          &fAuto))
     386        return NULL;
     387    TEAutoView(fAuto,
     388               _self->ob_itself);
     389    Py_INCREF(Py_None);
     390    _res = Py_None;
     391    return _res;
    392392}
    393393
    394394static PyObject *TEObj_TECalText(TEObject *_self, PyObject *_args)
    395395{
    396         PyObject *_res = NULL;
     396    PyObject *_res = NULL;
    397397#ifndef TECalText
    398         PyMac_PRECHECK(TECalText);
    399 #endif
    400         if (!PyArg_ParseTuple(_args, ""))
    401                 return NULL;
    402         TECalText(_self->ob_itself);
    403         Py_INCREF(Py_None);
    404         _res = Py_None;
    405         return _res;
     398    PyMac_PRECHECK(TECalText);
     399#endif
     400    if (!PyArg_ParseTuple(_args, ""))
     401        return NULL;
     402    TECalText(_self->ob_itself);
     403    Py_INCREF(Py_None);
     404    _res = Py_None;
     405    return _res;
    406406}
    407407
    408408static PyObject *TEObj_TEGetOffset(TEObject *_self, PyObject *_args)
    409409{
    410         PyObject *_res = NULL;
    411         short _rv;
    412         Point pt;
     410    PyObject *_res = NULL;
     411    short _rv;
     412    Point pt;
    413413#ifndef TEGetOffset
    414         PyMac_PRECHECK(TEGetOffset);
    415 #endif
    416         if (!PyArg_ParseTuple(_args, "O&",
    417                               PyMac_GetPoint, &pt))
    418                 return NULL;
    419         _rv = TEGetOffset(pt,
    420                           _self->ob_itself);
    421         _res = Py_BuildValue("h",
    422                              _rv);
    423         return _res;
     414    PyMac_PRECHECK(TEGetOffset);
     415#endif
     416    if (!PyArg_ParseTuple(_args, "O&",
     417                          PyMac_GetPoint, &pt))
     418        return NULL;
     419    _rv = TEGetOffset(pt,
     420                      _self->ob_itself);
     421    _res = Py_BuildValue("h",
     422                         _rv);
     423    return _res;
    424424}
    425425
    426426static PyObject *TEObj_TEGetPoint(TEObject *_self, PyObject *_args)
    427427{
    428         PyObject *_res = NULL;
    429         Point _rv;
    430         short offset;
     428    PyObject *_res = NULL;
     429    Point _rv;
     430    short offset;
    431431#ifndef TEGetPoint
    432         PyMac_PRECHECK(TEGetPoint);
    433 #endif
    434         if (!PyArg_ParseTuple(_args, "h",
    435                               &offset))
    436                 return NULL;
    437         _rv = TEGetPoint(offset,
    438                          _self->ob_itself);
    439         _res = Py_BuildValue("O&",
    440                              PyMac_BuildPoint, _rv);
    441         return _res;
     432    PyMac_PRECHECK(TEGetPoint);
     433#endif
     434    if (!PyArg_ParseTuple(_args, "h",
     435                          &offset))
     436        return NULL;
     437    _rv = TEGetPoint(offset,
     438                     _self->ob_itself);
     439    _res = Py_BuildValue("O&",
     440                         PyMac_BuildPoint, _rv);
     441    return _res;
    442442}
    443443
    444444static PyObject *TEObj_TEClick(TEObject *_self, PyObject *_args)
    445445{
    446         PyObject *_res = NULL;
    447         Point pt;
    448         Boolean fExtend;
     446    PyObject *_res = NULL;
     447    Point pt;
     448    Boolean fExtend;
    449449#ifndef TEClick
    450         PyMac_PRECHECK(TEClick);
    451 #endif
    452         if (!PyArg_ParseTuple(_args, "O&b",
    453                               PyMac_GetPoint, &pt,
    454                               &fExtend))
    455                 return NULL;
    456         TEClick(pt,
    457                 fExtend,
    458                 _self->ob_itself);
    459         Py_INCREF(Py_None);
    460         _res = Py_None;
    461         return _res;
     450    PyMac_PRECHECK(TEClick);
     451#endif
     452    if (!PyArg_ParseTuple(_args, "O&b",
     453                          PyMac_GetPoint, &pt,
     454                          &fExtend))
     455        return NULL;
     456    TEClick(pt,
     457        fExtend,
     458        _self->ob_itself);
     459    Py_INCREF(Py_None);
     460    _res = Py_None;
     461    return _res;
    462462}
    463463
    464464static PyObject *TEObj_TESetStyleHandle(TEObject *_self, PyObject *_args)
    465465{
    466         PyObject *_res = NULL;
    467         TEStyleHandle theHandle;
     466    PyObject *_res = NULL;
     467    TEStyleHandle theHandle;
    468468#ifndef TESetStyleHandle
    469         PyMac_PRECHECK(TESetStyleHandle);
    470 #endif
    471         if (!PyArg_ParseTuple(_args, "O&",
    472                               ResObj_Convert, &theHandle))
    473                 return NULL;
    474         TESetStyleHandle(theHandle,
    475                          _self->ob_itself);
    476         Py_INCREF(Py_None);
    477         _res = Py_None;
    478         return _res;
     469    PyMac_PRECHECK(TESetStyleHandle);
     470#endif
     471    if (!PyArg_ParseTuple(_args, "O&",
     472                          ResObj_Convert, &theHandle))
     473        return NULL;
     474    TESetStyleHandle(theHandle,
     475                     _self->ob_itself);
     476    Py_INCREF(Py_None);
     477    _res = Py_None;
     478    return _res;
    479479}
    480480
    481481static PyObject *TEObj_TEGetStyleHandle(TEObject *_self, PyObject *_args)
    482482{
    483         PyObject *_res = NULL;
    484         TEStyleHandle _rv;
     483    PyObject *_res = NULL;
     484    TEStyleHandle _rv;
    485485#ifndef TEGetStyleHandle
    486         PyMac_PRECHECK(TEGetStyleHandle);
    487 #endif
    488         if (!PyArg_ParseTuple(_args, ""))
    489                 return NULL;
    490         _rv = TEGetStyleHandle(_self->ob_itself);
    491         _res = Py_BuildValue("O&",
    492                              ResObj_New, _rv);
    493         return _res;
     486    PyMac_PRECHECK(TEGetStyleHandle);
     487#endif
     488    if (!PyArg_ParseTuple(_args, ""))
     489        return NULL;
     490    _rv = TEGetStyleHandle(_self->ob_itself);
     491    _res = Py_BuildValue("O&",
     492                         ResObj_New, _rv);
     493    return _res;
    494494}
    495495
    496496static PyObject *TEObj_TEGetStyle(TEObject *_self, PyObject *_args)
    497497{
    498         PyObject *_res = NULL;
    499         short offset;
    500         TextStyle theStyle;
    501         short lineHeight;
    502         short fontAscent;
     498    PyObject *_res = NULL;
     499    short offset;
     500    TextStyle theStyle;
     501    short lineHeight;
     502    short fontAscent;
    503503#ifndef TEGetStyle
    504         PyMac_PRECHECK(TEGetStyle);
    505 #endif
    506         if (!PyArg_ParseTuple(_args, "h",
    507                               &offset))
    508                 return NULL;
    509         TEGetStyle(offset,
    510                    &theStyle,
    511                    &lineHeight,
    512                    &fontAscent,
    513                    _self->ob_itself);
    514         _res = Py_BuildValue("O&hh",
    515                              TextStyle_New, &theStyle,
    516                              lineHeight,
    517                              fontAscent);
    518         return _res;
     504    PyMac_PRECHECK(TEGetStyle);
     505#endif
     506    if (!PyArg_ParseTuple(_args, "h",
     507                          &offset))
     508        return NULL;
     509    TEGetStyle(offset,
     510               &theStyle,
     511               &lineHeight,
     512               &fontAscent,
     513               _self->ob_itself);
     514    _res = Py_BuildValue("O&hh",
     515                         TextStyle_New, &theStyle,
     516                         lineHeight,
     517                         fontAscent);
     518    return _res;
    519519}
    520520
    521521static PyObject *TEObj_TEStylePaste(TEObject *_self, PyObject *_args)
    522522{
    523         PyObject *_res = NULL;
     523    PyObject *_res = NULL;
    524524#ifndef TEStylePaste
    525         PyMac_PRECHECK(TEStylePaste);
    526 #endif
    527         if (!PyArg_ParseTuple(_args, ""))
    528                 return NULL;
    529         TEStylePaste(_self->ob_itself);
    530         Py_INCREF(Py_None);
    531         _res = Py_None;
    532         return _res;
     525    PyMac_PRECHECK(TEStylePaste);
     526#endif
     527    if (!PyArg_ParseTuple(_args, ""))
     528        return NULL;
     529    TEStylePaste(_self->ob_itself);
     530    Py_INCREF(Py_None);
     531    _res = Py_None;
     532    return _res;
    533533}
    534534
    535535static PyObject *TEObj_TESetStyle(TEObject *_self, PyObject *_args)
    536536{
    537         PyObject *_res = NULL;
    538         short mode;
    539         TextStyle newStyle;
    540         Boolean fRedraw;
     537    PyObject *_res = NULL;
     538    short mode;
     539    TextStyle newStyle;
     540    Boolean fRedraw;
    541541#ifndef TESetStyle
    542         PyMac_PRECHECK(TESetStyle);
    543 #endif
    544         if (!PyArg_ParseTuple(_args, "hO&b",
    545                               &mode,
    546                               TextStyle_Convert, &newStyle,
    547                               &fRedraw))
    548                 return NULL;
    549         TESetStyle(mode,
    550                    &newStyle,
    551                    fRedraw,
    552                    _self->ob_itself);
    553         Py_INCREF(Py_None);
    554         _res = Py_None;
    555         return _res;
     542    PyMac_PRECHECK(TESetStyle);
     543#endif
     544    if (!PyArg_ParseTuple(_args, "hO&b",
     545                          &mode,
     546                          TextStyle_Convert, &newStyle,
     547                          &fRedraw))
     548        return NULL;
     549    TESetStyle(mode,
     550               &newStyle,
     551               fRedraw,
     552               _self->ob_itself);
     553    Py_INCREF(Py_None);
     554    _res = Py_None;
     555    return _res;
    556556}
    557557
    558558static PyObject *TEObj_TEReplaceStyle(TEObject *_self, PyObject *_args)
    559559{
    560         PyObject *_res = NULL;
    561         short mode;
    562         TextStyle oldStyle;
    563         TextStyle newStyle;
    564         Boolean fRedraw;
     560    PyObject *_res = NULL;
     561    short mode;
     562    TextStyle oldStyle;
     563    TextStyle newStyle;
     564    Boolean fRedraw;
    565565#ifndef TEReplaceStyle
    566         PyMac_PRECHECK(TEReplaceStyle);
    567 #endif
    568         if (!PyArg_ParseTuple(_args, "hO&O&b",
    569                               &mode,
    570                               TextStyle_Convert, &oldStyle,
    571                               TextStyle_Convert, &newStyle,
    572                               &fRedraw))
    573                 return NULL;
    574         TEReplaceStyle(mode,
    575                        &oldStyle,
    576                        &newStyle,
    577                        fRedraw,
    578                        _self->ob_itself);
    579         Py_INCREF(Py_None);
    580         _res = Py_None;
    581         return _res;
     566    PyMac_PRECHECK(TEReplaceStyle);
     567#endif
     568    if (!PyArg_ParseTuple(_args, "hO&O&b",
     569                          &mode,
     570                          TextStyle_Convert, &oldStyle,
     571                          TextStyle_Convert, &newStyle,
     572                          &fRedraw))
     573        return NULL;
     574    TEReplaceStyle(mode,
     575                   &oldStyle,
     576                   &newStyle,
     577                   fRedraw,
     578                   _self->ob_itself);
     579    Py_INCREF(Py_None);
     580    _res = Py_None;
     581    return _res;
    582582}
    583583
    584584static PyObject *TEObj_TEGetStyleScrapHandle(TEObject *_self, PyObject *_args)
    585585{
    586         PyObject *_res = NULL;
    587         StScrpHandle _rv;
     586    PyObject *_res = NULL;
     587    StScrpHandle _rv;
    588588#ifndef TEGetStyleScrapHandle
    589         PyMac_PRECHECK(TEGetStyleScrapHandle);
    590 #endif
    591         if (!PyArg_ParseTuple(_args, ""))
    592                 return NULL;
    593         _rv = TEGetStyleScrapHandle(_self->ob_itself);
    594         _res = Py_BuildValue("O&",
    595                              ResObj_New, _rv);
    596         return _res;
     589    PyMac_PRECHECK(TEGetStyleScrapHandle);
     590#endif
     591    if (!PyArg_ParseTuple(_args, ""))
     592        return NULL;
     593    _rv = TEGetStyleScrapHandle(_self->ob_itself);
     594    _res = Py_BuildValue("O&",
     595                         ResObj_New, _rv);
     596    return _res;
    597597}
    598598
    599599static PyObject *TEObj_TEStyleInsert(TEObject *_self, PyObject *_args)
    600600{
    601         PyObject *_res = NULL;
    602         char *text__in__;
    603         long text__len__;
    604         int text__in_len__;
    605         StScrpHandle hST;
     601    PyObject *_res = NULL;
     602    char *text__in__;
     603    long text__len__;
     604    int text__in_len__;
     605    StScrpHandle hST;
    606606#ifndef TEStyleInsert
    607         PyMac_PRECHECK(TEStyleInsert);
    608 #endif
    609         if (!PyArg_ParseTuple(_args, "s#O&",
    610                               &text__in__, &text__in_len__,
    611                               ResObj_Convert, &hST))
    612                 return NULL;
    613         text__len__ = text__in_len__;
    614         TEStyleInsert(text__in__, text__len__,
    615                       hST,
    616                       _self->ob_itself);
    617         Py_INCREF(Py_None);
    618         _res = Py_None;
    619         return _res;
     607    PyMac_PRECHECK(TEStyleInsert);
     608#endif
     609    if (!PyArg_ParseTuple(_args, "s#O&",
     610                          &text__in__, &text__in_len__,
     611                          ResObj_Convert, &hST))
     612        return NULL;
     613    text__len__ = text__in_len__;
     614    TEStyleInsert(text__in__, text__len__,
     615                  hST,
     616                  _self->ob_itself);
     617    Py_INCREF(Py_None);
     618    _res = Py_None;
     619    return _res;
    620620}
    621621
    622622static PyObject *TEObj_TEGetHeight(TEObject *_self, PyObject *_args)
    623623{
    624         PyObject *_res = NULL;
    625         long _rv;
    626         long endLine;
    627         long startLine;
     624    PyObject *_res = NULL;
     625    long _rv;
     626    long endLine;
     627    long startLine;
    628628#ifndef TEGetHeight
    629         PyMac_PRECHECK(TEGetHeight);
    630 #endif
    631         if (!PyArg_ParseTuple(_args, "ll",
    632                               &endLine,
    633                               &startLine))
    634                 return NULL;
    635         _rv = TEGetHeight(endLine,
    636                           startLine,
    637                           _self->ob_itself);
    638         _res = Py_BuildValue("l",
    639                              _rv);
    640         return _res;
     629    PyMac_PRECHECK(TEGetHeight);
     630#endif
     631    if (!PyArg_ParseTuple(_args, "ll",
     632                          &endLine,
     633                          &startLine))
     634        return NULL;
     635    _rv = TEGetHeight(endLine,
     636                      startLine,
     637                      _self->ob_itself);
     638    _res = Py_BuildValue("l",
     639                         _rv);
     640    return _res;
    641641}
    642642
    643643static PyObject *TEObj_TEContinuousStyle(TEObject *_self, PyObject *_args)
    644644{
    645         PyObject *_res = NULL;
    646         Boolean _rv;
    647         short mode;
    648         TextStyle aStyle;
     645    PyObject *_res = NULL;
     646    Boolean _rv;
     647    short mode;
     648    TextStyle aStyle;
    649649#ifndef TEContinuousStyle
    650         PyMac_PRECHECK(TEContinuousStyle);
    651 #endif
    652         if (!PyArg_ParseTuple(_args, "hO&",
    653                               &mode,
    654                               TextStyle_Convert, &aStyle))
    655                 return NULL;
    656         _rv = TEContinuousStyle(&mode,
    657                                 &aStyle,
    658                                 _self->ob_itself);
    659         _res = Py_BuildValue("bhO&",
    660                              _rv,
    661                              mode,
    662                              TextStyle_New, &aStyle);
    663         return _res;
     650    PyMac_PRECHECK(TEContinuousStyle);
     651#endif
     652    if (!PyArg_ParseTuple(_args, "hO&",
     653                          &mode,
     654                          TextStyle_Convert, &aStyle))
     655        return NULL;
     656    _rv = TEContinuousStyle(&mode,
     657                            &aStyle,
     658                            _self->ob_itself);
     659    _res = Py_BuildValue("bhO&",
     660                         _rv,
     661                         mode,
     662                         TextStyle_New, &aStyle);
     663    return _res;
    664664}
    665665
    666666static PyObject *TEObj_TEUseStyleScrap(TEObject *_self, PyObject *_args)
    667667{
    668         PyObject *_res = NULL;
    669         long rangeStart;
    670         long rangeEnd;
    671         StScrpHandle newStyles;
    672         Boolean fRedraw;
     668    PyObject *_res = NULL;
     669    long rangeStart;
     670    long rangeEnd;
     671    StScrpHandle newStyles;
     672    Boolean fRedraw;
    673673#ifndef TEUseStyleScrap
    674         PyMac_PRECHECK(TEUseStyleScrap);
    675 #endif
    676         if (!PyArg_ParseTuple(_args, "llO&b",
    677                               &rangeStart,
    678                               &rangeEnd,
    679                               ResObj_Convert, &newStyles,
    680                               &fRedraw))
    681                 return NULL;
    682         TEUseStyleScrap(rangeStart,
    683                         rangeEnd,
    684                         newStyles,
    685                         fRedraw,
    686                         _self->ob_itself);
    687         Py_INCREF(Py_None);
    688         _res = Py_None;
    689         return _res;
     674    PyMac_PRECHECK(TEUseStyleScrap);
     675#endif
     676    if (!PyArg_ParseTuple(_args, "llO&b",
     677                          &rangeStart,
     678                          &rangeEnd,
     679                          ResObj_Convert, &newStyles,
     680                          &fRedraw))
     681        return NULL;
     682    TEUseStyleScrap(rangeStart,
     683                    rangeEnd,
     684                    newStyles,
     685                    fRedraw,
     686                    _self->ob_itself);
     687    Py_INCREF(Py_None);
     688    _res = Py_None;
     689    return _res;
    690690}
    691691
    692692static PyObject *TEObj_TENumStyles(TEObject *_self, PyObject *_args)
    693693{
    694         PyObject *_res = NULL;
    695         long _rv;
    696         long rangeStart;
    697         long rangeEnd;
     694    PyObject *_res = NULL;
     695    long _rv;
     696    long rangeStart;
     697    long rangeEnd;
    698698#ifndef TENumStyles
    699         PyMac_PRECHECK(TENumStyles);
    700 #endif
    701         if (!PyArg_ParseTuple(_args, "ll",
    702                               &rangeStart,
    703                               &rangeEnd))
    704                 return NULL;
    705         _rv = TENumStyles(rangeStart,
    706                           rangeEnd,
    707                           _self->ob_itself);
    708         _res = Py_BuildValue("l",
    709                              _rv);
    710         return _res;
     699    PyMac_PRECHECK(TENumStyles);
     700#endif
     701    if (!PyArg_ParseTuple(_args, "ll",
     702                          &rangeStart,
     703                          &rangeEnd))
     704        return NULL;
     705    _rv = TENumStyles(rangeStart,
     706                      rangeEnd,
     707                      _self->ob_itself);
     708    _res = Py_BuildValue("l",
     709                         _rv);
     710    return _res;
    711711}
    712712
    713713static PyObject *TEObj_TEFeatureFlag(TEObject *_self, PyObject *_args)
    714714{
    715         PyObject *_res = NULL;
    716         short _rv;
    717         short feature;
    718         short action;
     715    PyObject *_res = NULL;
     716    short _rv;
     717    short feature;
     718    short action;
    719719#ifndef TEFeatureFlag
    720         PyMac_PRECHECK(TEFeatureFlag);
    721 #endif
    722         if (!PyArg_ParseTuple(_args, "hh",
    723                               &feature,
    724                               &action))
    725                 return NULL;
    726         _rv = TEFeatureFlag(feature,
    727                             action,
    728                             _self->ob_itself);
    729         _res = Py_BuildValue("h",
    730                              _rv);
    731         return _res;
     720    PyMac_PRECHECK(TEFeatureFlag);
     721#endif
     722    if (!PyArg_ParseTuple(_args, "hh",
     723                          &feature,
     724                          &action))
     725        return NULL;
     726    _rv = TEFeatureFlag(feature,
     727                        action,
     728                        _self->ob_itself);
     729    _res = Py_BuildValue("h",
     730                         _rv);
     731    return _res;
    732732}
    733733
    734734static PyObject *TEObj_TEGetHiliteRgn(TEObject *_self, PyObject *_args)
    735735{
    736         PyObject *_res = NULL;
    737         OSErr _err;
    738         RgnHandle region;
     736    PyObject *_res = NULL;
     737    OSErr _err;
     738    RgnHandle region;
    739739#ifndef TEGetHiliteRgn
    740         PyMac_PRECHECK(TEGetHiliteRgn);
    741 #endif
    742         if (!PyArg_ParseTuple(_args, "O&",
    743                               ResObj_Convert, &region))
    744                 return NULL;
    745         _err = TEGetHiliteRgn(region,
    746                               _self->ob_itself);
    747         if (_err != noErr) return PyMac_Error(_err);
    748         Py_INCREF(Py_None);
    749         _res = Py_None;
    750         return _res;
     740    PyMac_PRECHECK(TEGetHiliteRgn);
     741#endif
     742    if (!PyArg_ParseTuple(_args, "O&",
     743                          ResObj_Convert, &region))
     744        return NULL;
     745    _err = TEGetHiliteRgn(region,
     746                          _self->ob_itself);
     747    if (_err != noErr) return PyMac_Error(_err);
     748    Py_INCREF(Py_None);
     749    _res = Py_None;
     750    return _res;
    751751}
    752752
    753753static PyObject *TEObj_as_Resource(TEObject *_self, PyObject *_args)
    754754{
    755         PyObject *_res = NULL;
    756         Handle _rv;
     755    PyObject *_res = NULL;
     756    Handle _rv;
    757757#ifndef as_Resource
    758         PyMac_PRECHECK(as_Resource);
    759 #endif
    760         if (!PyArg_ParseTuple(_args, ""))
    761                 return NULL;
    762         _rv = as_Resource(_self->ob_itself);
    763         _res = Py_BuildValue("O&",
    764                              ResObj_New, _rv);
    765         return _res;
     758    PyMac_PRECHECK(as_Resource);
     759#endif
     760    if (!PyArg_ParseTuple(_args, ""))
     761        return NULL;
     762    _rv = as_Resource(_self->ob_itself);
     763    _res = Py_BuildValue("O&",
     764                         ResObj_New, _rv);
     765    return _res;
    766766}
    767767
    768768static PyMethodDef TEObj_methods[] = {
    769         {"TESetText", (PyCFunction)TEObj_TESetText, 1,
    770         PyDoc_STR("(Buffer text) -> None")},
    771         {"TEGetText", (PyCFunction)TEObj_TEGetText, 1,
    772         PyDoc_STR("() -> (CharsHandle _rv)")},
    773         {"TEIdle", (PyCFunction)TEObj_TEIdle, 1,
    774         PyDoc_STR("() -> None")},
    775         {"TESetSelect", (PyCFunction)TEObj_TESetSelect, 1,
    776         PyDoc_STR("(long selStart, long selEnd) -> None")},
    777         {"TEActivate", (PyCFunction)TEObj_TEActivate, 1,
    778         PyDoc_STR("() -> None")},
    779         {"TEDeactivate", (PyCFunction)TEObj_TEDeactivate, 1,
    780         PyDoc_STR("() -> None")},
    781         {"TEKey", (PyCFunction)TEObj_TEKey, 1,
    782         PyDoc_STR("(CharParameter key) -> None")},
    783         {"TECut", (PyCFunction)TEObj_TECut, 1,
    784         PyDoc_STR("() -> None")},
    785         {"TECopy", (PyCFunction)TEObj_TECopy, 1,
    786         PyDoc_STR("() -> None")},
    787         {"TEPaste", (PyCFunction)TEObj_TEPaste, 1,
    788         PyDoc_STR("() -> None")},
    789         {"TEDelete", (PyCFunction)TEObj_TEDelete, 1,
    790         PyDoc_STR("() -> None")},
    791         {"TEInsert", (PyCFunction)TEObj_TEInsert, 1,
    792         PyDoc_STR("(Buffer text) -> None")},
    793         {"TESetAlignment", (PyCFunction)TEObj_TESetAlignment, 1,
    794         PyDoc_STR("(short just) -> None")},
    795         {"TEUpdate", (PyCFunction)TEObj_TEUpdate, 1,
    796         PyDoc_STR("(Rect rUpdate) -> None")},
    797         {"TEScroll", (PyCFunction)TEObj_TEScroll, 1,
    798         PyDoc_STR("(short dh, short dv) -> None")},
    799         {"TESelView", (PyCFunction)TEObj_TESelView, 1,
    800         PyDoc_STR("() -> None")},
    801         {"TEPinScroll", (PyCFunction)TEObj_TEPinScroll, 1,
    802         PyDoc_STR("(short dh, short dv) -> None")},
    803         {"TEAutoView", (PyCFunction)TEObj_TEAutoView, 1,
    804         PyDoc_STR("(Boolean fAuto) -> None")},
    805         {"TECalText", (PyCFunction)TEObj_TECalText, 1,
    806         PyDoc_STR("() -> None")},
    807         {"TEGetOffset", (PyCFunction)TEObj_TEGetOffset, 1,
    808         PyDoc_STR("(Point pt) -> (short _rv)")},
    809         {"TEGetPoint", (PyCFunction)TEObj_TEGetPoint, 1,
    810         PyDoc_STR("(short offset) -> (Point _rv)")},
    811         {"TEClick", (PyCFunction)TEObj_TEClick, 1,
    812         PyDoc_STR("(Point pt, Boolean fExtend) -> None")},
    813         {"TESetStyleHandle", (PyCFunction)TEObj_TESetStyleHandle, 1,
    814         PyDoc_STR("(TEStyleHandle theHandle) -> None")},
    815         {"TEGetStyleHandle", (PyCFunction)TEObj_TEGetStyleHandle, 1,
    816         PyDoc_STR("() -> (TEStyleHandle _rv)")},
    817         {"TEGetStyle", (PyCFunction)TEObj_TEGetStyle, 1,
    818         PyDoc_STR("(short offset) -> (TextStyle theStyle, short lineHeight, short fontAscent)")},
    819         {"TEStylePaste", (PyCFunction)TEObj_TEStylePaste, 1,
    820         PyDoc_STR("() -> None")},
    821         {"TESetStyle", (PyCFunction)TEObj_TESetStyle, 1,
    822         PyDoc_STR("(short mode, TextStyle newStyle, Boolean fRedraw) -> None")},
    823         {"TEReplaceStyle", (PyCFunction)TEObj_TEReplaceStyle, 1,
    824         PyDoc_STR("(short mode, TextStyle oldStyle, TextStyle newStyle, Boolean fRedraw) -> None")},
    825         {"TEGetStyleScrapHandle", (PyCFunction)TEObj_TEGetStyleScrapHandle, 1,
    826         PyDoc_STR("() -> (StScrpHandle _rv)")},
    827         {"TEStyleInsert", (PyCFunction)TEObj_TEStyleInsert, 1,
    828         PyDoc_STR("(Buffer text, StScrpHandle hST) -> None")},
    829         {"TEGetHeight", (PyCFunction)TEObj_TEGetHeight, 1,
    830         PyDoc_STR("(long endLine, long startLine) -> (long _rv)")},
    831         {"TEContinuousStyle", (PyCFunction)TEObj_TEContinuousStyle, 1,
    832         PyDoc_STR("(short mode, TextStyle aStyle) -> (Boolean _rv, short mode, TextStyle aStyle)")},
    833         {"TEUseStyleScrap", (PyCFunction)TEObj_TEUseStyleScrap, 1,
    834         PyDoc_STR("(long rangeStart, long rangeEnd, StScrpHandle newStyles, Boolean fRedraw) -> None")},
    835         {"TENumStyles", (PyCFunction)TEObj_TENumStyles, 1,
    836         PyDoc_STR("(long rangeStart, long rangeEnd) -> (long _rv)")},
    837         {"TEFeatureFlag", (PyCFunction)TEObj_TEFeatureFlag, 1,
    838         PyDoc_STR("(short feature, short action) -> (short _rv)")},
    839         {"TEGetHiliteRgn", (PyCFunction)TEObj_TEGetHiliteRgn, 1,
    840         PyDoc_STR("(RgnHandle region) -> None")},
    841         {"as_Resource", (PyCFunction)TEObj_as_Resource, 1,
    842         PyDoc_STR("() -> (Handle _rv)")},
    843         {NULL, NULL, 0}
     769    {"TESetText", (PyCFunction)TEObj_TESetText, 1,
     770    PyDoc_STR("(Buffer text) -> None")},
     771    {"TEGetText", (PyCFunction)TEObj_TEGetText, 1,
     772    PyDoc_STR("() -> (CharsHandle _rv)")},
     773    {"TEIdle", (PyCFunction)TEObj_TEIdle, 1,
     774    PyDoc_STR("() -> None")},
     775    {"TESetSelect", (PyCFunction)TEObj_TESetSelect, 1,
     776    PyDoc_STR("(long selStart, long selEnd) -> None")},
     777    {"TEActivate", (PyCFunction)TEObj_TEActivate, 1,
     778    PyDoc_STR("() -> None")},
     779    {"TEDeactivate", (PyCFunction)TEObj_TEDeactivate, 1,
     780    PyDoc_STR("() -> None")},
     781    {"TEKey", (PyCFunction)TEObj_TEKey, 1,
     782    PyDoc_STR("(CharParameter key) -> None")},
     783    {"TECut", (PyCFunction)TEObj_TECut, 1,
     784    PyDoc_STR("() -> None")},
     785    {"TECopy", (PyCFunction)TEObj_TECopy, 1,
     786    PyDoc_STR("() -> None")},
     787    {"TEPaste", (PyCFunction)TEObj_TEPaste, 1,
     788    PyDoc_STR("() -> None")},
     789    {"TEDelete", (PyCFunction)TEObj_TEDelete, 1,
     790    PyDoc_STR("() -> None")},
     791    {"TEInsert", (PyCFunction)TEObj_TEInsert, 1,
     792    PyDoc_STR("(Buffer text) -> None")},
     793    {"TESetAlignment", (PyCFunction)TEObj_TESetAlignment, 1,
     794    PyDoc_STR("(short just) -> None")},
     795    {"TEUpdate", (PyCFunction)TEObj_TEUpdate, 1,
     796    PyDoc_STR("(Rect rUpdate) -> None")},
     797    {"TEScroll", (PyCFunction)TEObj_TEScroll, 1,
     798    PyDoc_STR("(short dh, short dv) -> None")},
     799    {"TESelView", (PyCFunction)TEObj_TESelView, 1,
     800    PyDoc_STR("() -> None")},
     801    {"TEPinScroll", (PyCFunction)TEObj_TEPinScroll, 1,
     802    PyDoc_STR("(short dh, short dv) -> None")},
     803    {"TEAutoView", (PyCFunction)TEObj_TEAutoView, 1,
     804    PyDoc_STR("(Boolean fAuto) -> None")},
     805    {"TECalText", (PyCFunction)TEObj_TECalText, 1,
     806    PyDoc_STR("() -> None")},
     807    {"TEGetOffset", (PyCFunction)TEObj_TEGetOffset, 1,
     808    PyDoc_STR("(Point pt) -> (short _rv)")},
     809    {"TEGetPoint", (PyCFunction)TEObj_TEGetPoint, 1,
     810    PyDoc_STR("(short offset) -> (Point _rv)")},
     811    {"TEClick", (PyCFunction)TEObj_TEClick, 1,
     812    PyDoc_STR("(Point pt, Boolean fExtend) -> None")},
     813    {"TESetStyleHandle", (PyCFunction)TEObj_TESetStyleHandle, 1,
     814    PyDoc_STR("(TEStyleHandle theHandle) -> None")},
     815    {"TEGetStyleHandle", (PyCFunction)TEObj_TEGetStyleHandle, 1,
     816    PyDoc_STR("() -> (TEStyleHandle _rv)")},
     817    {"TEGetStyle", (PyCFunction)TEObj_TEGetStyle, 1,
     818    PyDoc_STR("(short offset) -> (TextStyle theStyle, short lineHeight, short fontAscent)")},
     819    {"TEStylePaste", (PyCFunction)TEObj_TEStylePaste, 1,
     820    PyDoc_STR("() -> None")},
     821    {"TESetStyle", (PyCFunction)TEObj_TESetStyle, 1,
     822    PyDoc_STR("(short mode, TextStyle newStyle, Boolean fRedraw) -> None")},
     823    {"TEReplaceStyle", (PyCFunction)TEObj_TEReplaceStyle, 1,
     824    PyDoc_STR("(short mode, TextStyle oldStyle, TextStyle newStyle, Boolean fRedraw) -> None")},
     825    {"TEGetStyleScrapHandle", (PyCFunction)TEObj_TEGetStyleScrapHandle, 1,
     826    PyDoc_STR("() -> (StScrpHandle _rv)")},
     827    {"TEStyleInsert", (PyCFunction)TEObj_TEStyleInsert, 1,
     828    PyDoc_STR("(Buffer text, StScrpHandle hST) -> None")},
     829    {"TEGetHeight", (PyCFunction)TEObj_TEGetHeight, 1,
     830    PyDoc_STR("(long endLine, long startLine) -> (long _rv)")},
     831    {"TEContinuousStyle", (PyCFunction)TEObj_TEContinuousStyle, 1,
     832    PyDoc_STR("(short mode, TextStyle aStyle) -> (Boolean _rv, short mode, TextStyle aStyle)")},
     833    {"TEUseStyleScrap", (PyCFunction)TEObj_TEUseStyleScrap, 1,
     834    PyDoc_STR("(long rangeStart, long rangeEnd, StScrpHandle newStyles, Boolean fRedraw) -> None")},
     835    {"TENumStyles", (PyCFunction)TEObj_TENumStyles, 1,
     836    PyDoc_STR("(long rangeStart, long rangeEnd) -> (long _rv)")},
     837    {"TEFeatureFlag", (PyCFunction)TEObj_TEFeatureFlag, 1,
     838    PyDoc_STR("(short feature, short action) -> (short _rv)")},
     839    {"TEGetHiliteRgn", (PyCFunction)TEObj_TEGetHiliteRgn, 1,
     840    PyDoc_STR("(RgnHandle region) -> None")},
     841    {"as_Resource", (PyCFunction)TEObj_as_Resource, 1,
     842    PyDoc_STR("() -> (Handle _rv)")},
     843    {NULL, NULL, 0}
    844844};
    845845
    846846static PyObject *TEObj_get_destRect(TEObject *self, void *closure)
    847847{
    848         return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->destRect);
     848    return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->destRect);
    849849}
    850850
     
    853853static PyObject *TEObj_get_viewRect(TEObject *self, void *closure)
    854854{
    855         return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->viewRect);
     855    return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->viewRect);
    856856}
    857857
     
    860860static PyObject *TEObj_get_selRect(TEObject *self, void *closure)
    861861{
    862         return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->selRect);
     862    return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->selRect);
    863863}
    864864
     
    867867static PyObject *TEObj_get_lineHeight(TEObject *self, void *closure)
    868868{
    869         return Py_BuildValue("h", (*self->ob_itself)->lineHeight);
     869    return Py_BuildValue("h", (*self->ob_itself)->lineHeight);
    870870}
    871871
     
    874874static PyObject *TEObj_get_fontAscent(TEObject *self, void *closure)
    875875{
    876         return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
     876    return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
    877877}
    878878
     
    881881static PyObject *TEObj_get_selPoint(TEObject *self, void *closure)
    882882{
    883         return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->selPoint);
     883    return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->selPoint);
    884884}
    885885
     
    888888static PyObject *TEObj_get_selStart(TEObject *self, void *closure)
    889889{
    890         return Py_BuildValue("h", (*self->ob_itself)->selStart);
     890    return Py_BuildValue("h", (*self->ob_itself)->selStart);
    891891}
    892892
     
    895895static PyObject *TEObj_get_selEnd(TEObject *self, void *closure)
    896896{
    897         return Py_BuildValue("h", (*self->ob_itself)->selEnd);
     897    return Py_BuildValue("h", (*self->ob_itself)->selEnd);
    898898}
    899899
     
    902902static PyObject *TEObj_get_active(TEObject *self, void *closure)
    903903{
    904         return Py_BuildValue("h", (*self->ob_itself)->active);
     904    return Py_BuildValue("h", (*self->ob_itself)->active);
    905905}
    906906
     
    909909static PyObject *TEObj_get_just(TEObject *self, void *closure)
    910910{
    911         return Py_BuildValue("h", (*self->ob_itself)->just);
     911    return Py_BuildValue("h", (*self->ob_itself)->just);
    912912}
    913913
     
    916916static PyObject *TEObj_get_teLength(TEObject *self, void *closure)
    917917{
    918         return Py_BuildValue("h", (*self->ob_itself)->teLength);
     918    return Py_BuildValue("h", (*self->ob_itself)->teLength);
    919919}
    920920
     
    923923static PyObject *TEObj_get_txFont(TEObject *self, void *closure)
    924924{
    925         return Py_BuildValue("h", (*self->ob_itself)->txFont);
     925    return Py_BuildValue("h", (*self->ob_itself)->txFont);
    926926}
    927927
     
    930930static PyObject *TEObj_get_txFace(TEObject *self, void *closure)
    931931{
    932         return Py_BuildValue("h", (*self->ob_itself)->txFace);
     932    return Py_BuildValue("h", (*self->ob_itself)->txFace);
    933933}
    934934
     
    937937static PyObject *TEObj_get_txMode(TEObject *self, void *closure)
    938938{
    939         return Py_BuildValue("h", (*self->ob_itself)->txMode);
     939    return Py_BuildValue("h", (*self->ob_itself)->txMode);
    940940}
    941941
     
    944944static PyObject *TEObj_get_txSize(TEObject *self, void *closure)
    945945{
    946         return Py_BuildValue("h", (*self->ob_itself)->txSize);
     946    return Py_BuildValue("h", (*self->ob_itself)->txSize);
    947947}
    948948
     
    951951static PyObject *TEObj_get_nLines(TEObject *self, void *closure)
    952952{
    953         return Py_BuildValue("h", (*self->ob_itself)->nLines);
     953    return Py_BuildValue("h", (*self->ob_itself)->nLines);
    954954}
    955955
     
    957957
    958958static PyGetSetDef TEObj_getsetlist[] = {
    959         {"destRect", (getter)TEObj_get_destRect, (setter)TEObj_set_destRect, "Destination rectangle"},
    960         {"viewRect", (getter)TEObj_get_viewRect, (setter)TEObj_set_viewRect, "Viewing rectangle"},
    961         {"selRect", (getter)TEObj_get_selRect, (setter)TEObj_set_selRect, "Selection rectangle"},
    962         {"lineHeight", (getter)TEObj_get_lineHeight, (setter)TEObj_set_lineHeight, "Height of a line"},
    963         {"fontAscent", (getter)TEObj_get_fontAscent, (setter)TEObj_set_fontAscent, "Ascent of a line"},
    964         {"selPoint", (getter)TEObj_get_selPoint, (setter)TEObj_set_selPoint, "Selection Point"},
    965         {"selStart", (getter)TEObj_get_selStart, (setter)TEObj_set_selStart, "Start of selection"},
    966         {"selEnd", (getter)TEObj_get_selEnd, (setter)TEObj_set_selEnd, "End of selection"},
    967         {"active", (getter)TEObj_get_active, (setter)TEObj_set_active, "TBD"},
    968         {"just", (getter)TEObj_get_just, (setter)TEObj_set_just, "Justification"},
    969         {"teLength", (getter)TEObj_get_teLength, (setter)TEObj_set_teLength, "TBD"},
    970         {"txFont", (getter)TEObj_get_txFont, (setter)TEObj_set_txFont, "Current font"},
    971         {"txFace", (getter)TEObj_get_txFace, (setter)TEObj_set_txFace, "Current font variant"},
    972         {"txMode", (getter)TEObj_get_txMode, (setter)TEObj_set_txMode, "Current text-drawing mode"},
    973         {"txSize", (getter)TEObj_get_txSize, (setter)TEObj_set_txSize, "Current font size"},
    974         {"nLines", (getter)TEObj_get_nLines, (setter)TEObj_set_nLines, "TBD"},
    975         {NULL, NULL, NULL, NULL},
     959    {"destRect", (getter)TEObj_get_destRect, (setter)TEObj_set_destRect, "Destination rectangle"},
     960    {"viewRect", (getter)TEObj_get_viewRect, (setter)TEObj_set_viewRect, "Viewing rectangle"},
     961    {"selRect", (getter)TEObj_get_selRect, (setter)TEObj_set_selRect, "Selection rectangle"},
     962    {"lineHeight", (getter)TEObj_get_lineHeight, (setter)TEObj_set_lineHeight, "Height of a line"},
     963    {"fontAscent", (getter)TEObj_get_fontAscent, (setter)TEObj_set_fontAscent, "Ascent of a line"},
     964    {"selPoint", (getter)TEObj_get_selPoint, (setter)TEObj_set_selPoint, "Selection Point"},
     965    {"selStart", (getter)TEObj_get_selStart, (setter)TEObj_set_selStart, "Start of selection"},
     966    {"selEnd", (getter)TEObj_get_selEnd, (setter)TEObj_set_selEnd, "End of selection"},
     967    {"active", (getter)TEObj_get_active, (setter)TEObj_set_active, "TBD"},
     968    {"just", (getter)TEObj_get_just, (setter)TEObj_set_just, "Justification"},
     969    {"teLength", (getter)TEObj_get_teLength, (setter)TEObj_set_teLength, "TBD"},
     970    {"txFont", (getter)TEObj_get_txFont, (setter)TEObj_set_txFont, "Current font"},
     971    {"txFace", (getter)TEObj_get_txFace, (setter)TEObj_set_txFace, "Current font variant"},
     972    {"txMode", (getter)TEObj_get_txMode, (setter)TEObj_set_txMode, "Current text-drawing mode"},
     973    {"txSize", (getter)TEObj_get_txSize, (setter)TEObj_set_txSize, "Current font size"},
     974    {"nLines", (getter)TEObj_get_nLines, (setter)TEObj_set_nLines, "TBD"},
     975    {NULL, NULL, NULL, NULL},
    976976};
    977977
     
    988988static PyObject *TEObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
    989989{
    990         PyObject *_self;
    991         TEHandle itself;
    992         char *kw[] = {"itself", 0};
    993 
    994         if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, TEObj_Convert, &itself)) return NULL;
    995         if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
    996         ((TEObject *)_self)->ob_itself = itself;
    997         return _self;
     990    PyObject *_self;
     991    TEHandle itself;
     992    char *kw[] = {"itself", 0};
     993
     994    if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, TEObj_Convert, &itself)) return NULL;
     995    if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
     996    ((TEObject *)_self)->ob_itself = itself;
     997    return _self;
    998998}
    999999
     
    10021002
    10031003PyTypeObject TE_Type = {
    1004         PyObject_HEAD_INIT(NULL)
    1005         0, /*ob_size*/
    1006         "_TE.TE", /*tp_name*/
    1007         sizeof(TEObject), /*tp_basicsize*/
    1008         0, /*tp_itemsize*/
    1009         /* methods */
    1010         (destructor) TEObj_dealloc, /*tp_dealloc*/
    1011         0, /*tp_print*/
    1012         (getattrfunc)0, /*tp_getattr*/
    1013         (setattrfunc)0, /*tp_setattr*/
    1014         (cmpfunc) TEObj_compare, /*tp_compare*/
    1015         (reprfunc) TEObj_repr, /*tp_repr*/
    1016         (PyNumberMethods *)0, /* tp_as_number */
    1017         (PySequenceMethods *)0, /* tp_as_sequence */
    1018         (PyMappingMethods *)0, /* tp_as_mapping */
    1019         (hashfunc) TEObj_hash, /*tp_hash*/
    1020         0, /*tp_call*/
    1021         0, /*tp_str*/
    1022         PyObject_GenericGetAttr, /*tp_getattro*/
    1023         PyObject_GenericSetAttr, /*tp_setattro */
    1024         0, /*tp_as_buffer*/
    1025         Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
    1026         0, /*tp_doc*/
    1027         0, /*tp_traverse*/
    1028         0, /*tp_clear*/
    1029         0, /*tp_richcompare*/
    1030         0, /*tp_weaklistoffset*/
    1031         0, /*tp_iter*/
    1032         0, /*tp_iternext*/
    1033         TEObj_methods, /* tp_methods */
    1034         0, /*tp_members*/
    1035         TEObj_getsetlist, /*tp_getset*/
    1036         0, /*tp_base*/
    1037         0, /*tp_dict*/
    1038         0, /*tp_descr_get*/
    1039         0, /*tp_descr_set*/
    1040         0, /*tp_dictoffset*/
    1041         TEObj_tp_init, /* tp_init */
    1042         TEObj_tp_alloc, /* tp_alloc */
    1043         TEObj_tp_new, /* tp_new */
    1044         TEObj_tp_free, /* tp_free */
     1004    PyObject_HEAD_INIT(NULL)
     1005    0, /*ob_size*/
     1006    "_TE.TE", /*tp_name*/
     1007    sizeof(TEObject), /*tp_basicsize*/
     1008    0, /*tp_itemsize*/
     1009    /* methods */
     1010    (destructor) TEObj_dealloc, /*tp_dealloc*/
     1011    0, /*tp_print*/
     1012    (getattrfunc)0, /*tp_getattr*/
     1013    (setattrfunc)0, /*tp_setattr*/
     1014    (cmpfunc) TEObj_compare, /*tp_compare*/
     1015    (reprfunc) TEObj_repr, /*tp_repr*/
     1016    (PyNumberMethods *)0, /* tp_as_number */
     1017    (PySequenceMethods *)0, /* tp_as_sequence */
     1018    (PyMappingMethods *)0, /* tp_as_mapping */
     1019    (hashfunc) TEObj_hash, /*tp_hash*/
     1020    0, /*tp_call*/
     1021    0, /*tp_str*/
     1022    PyObject_GenericGetAttr, /*tp_getattro*/
     1023    PyObject_GenericSetAttr, /*tp_setattro */
     1024    0, /*tp_as_buffer*/
     1025    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
     1026    0, /*tp_doc*/
     1027    0, /*tp_traverse*/
     1028    0, /*tp_clear*/
     1029    0, /*tp_richcompare*/
     1030    0, /*tp_weaklistoffset*/
     1031    0, /*tp_iter*/
     1032    0, /*tp_iternext*/
     1033    TEObj_methods, /* tp_methods */
     1034    0, /*tp_members*/
     1035    TEObj_getsetlist, /*tp_getset*/
     1036    0, /*tp_base*/
     1037    0, /*tp_dict*/
     1038    0, /*tp_descr_get*/
     1039    0, /*tp_descr_set*/
     1040    0, /*tp_dictoffset*/
     1041    TEObj_tp_init, /* tp_init */
     1042    TEObj_tp_alloc, /* tp_alloc */
     1043    TEObj_tp_new, /* tp_new */
     1044    TEObj_tp_free, /* tp_free */
    10451045};
    10461046
     
    10501050static PyObject *TE_TEScrapHandle(PyObject *_self, PyObject *_args)
    10511051{
    1052         PyObject *_res = NULL;
    1053         Handle _rv;
     1052    PyObject *_res = NULL;
     1053    Handle _rv;
    10541054#ifndef TEScrapHandle
    1055         PyMac_PRECHECK(TEScrapHandle);
    1056 #endif
    1057         if (!PyArg_ParseTuple(_args, ""))
    1058                 return NULL;
    1059         _rv = TEScrapHandle();
    1060         _res = Py_BuildValue("O&",
    1061                              ResObj_New, _rv);
    1062         return _res;
     1055    PyMac_PRECHECK(TEScrapHandle);
     1056#endif
     1057    if (!PyArg_ParseTuple(_args, ""))
     1058        return NULL;
     1059    _rv = TEScrapHandle();
     1060    _res = Py_BuildValue("O&",
     1061                         ResObj_New, _rv);
     1062    return _res;
    10631063}
    10641064
    10651065static PyObject *TE_TEGetScrapLength(PyObject *_self, PyObject *_args)
    10661066{
    1067         PyObject *_res = NULL;
    1068         long _rv;
     1067    PyObject *_res = NULL;
     1068    long _rv;
    10691069#ifndef TEGetScrapLength
    1070         PyMac_PRECHECK(TEGetScrapLength);
    1071 #endif
    1072         if (!PyArg_ParseTuple(_args, ""))
    1073                 return NULL;
    1074         _rv = TEGetScrapLength();
    1075         _res = Py_BuildValue("l",
    1076                              _rv);
    1077         return _res;
     1070    PyMac_PRECHECK(TEGetScrapLength);
     1071#endif
     1072    if (!PyArg_ParseTuple(_args, ""))
     1073        return NULL;
     1074    _rv = TEGetScrapLength();
     1075    _res = Py_BuildValue("l",
     1076                         _rv);
     1077    return _res;
    10781078}
    10791079
    10801080static PyObject *TE_TENew(PyObject *_self, PyObject *_args)
    10811081{
    1082         PyObject *_res = NULL;
    1083         TEHandle _rv;
    1084         Rect destRect;
    1085         Rect viewRect;
     1082    PyObject *_res = NULL;
     1083    TEHandle _rv;
     1084    Rect destRect;
     1085    Rect viewRect;
    10861086#ifndef TENew
    1087         PyMac_PRECHECK(TENew);
    1088 #endif
    1089         if (!PyArg_ParseTuple(_args, "O&O&",
    1090                               PyMac_GetRect, &destRect,
    1091                               PyMac_GetRect, &viewRect))
    1092                 return NULL;
    1093         _rv = TENew(&destRect,
    1094                     &viewRect);
    1095         _res = Py_BuildValue("O&",
    1096                              TEObj_New, _rv);
    1097         return _res;
     1087    PyMac_PRECHECK(TENew);
     1088#endif
     1089    if (!PyArg_ParseTuple(_args, "O&O&",
     1090                          PyMac_GetRect, &destRect,
     1091                          PyMac_GetRect, &viewRect))
     1092        return NULL;
     1093    _rv = TENew(&destRect,
     1094                &viewRect);
     1095    _res = Py_BuildValue("O&",
     1096                         TEObj_New, _rv);
     1097    return _res;
    10981098}
    10991099
    11001100static PyObject *TE_TETextBox(PyObject *_self, PyObject *_args)
    11011101{
    1102         PyObject *_res = NULL;
    1103         char *text__in__;
    1104         long text__len__;
    1105         int text__in_len__;
    1106         Rect box;
    1107         short just;
     1102    PyObject *_res = NULL;
     1103    char *text__in__;
     1104    long text__len__;
     1105    int text__in_len__;
     1106    Rect box;
     1107    short just;
    11081108#ifndef TETextBox
    1109         PyMac_PRECHECK(TETextBox);
    1110 #endif
    1111         if (!PyArg_ParseTuple(_args, "s#O&h",
    1112                               &text__in__, &text__in_len__,
    1113                               PyMac_GetRect, &box,
    1114                               &just))
    1115                 return NULL;
    1116         text__len__ = text__in_len__;
    1117         TETextBox(text__in__, text__len__,
    1118                   &box,
    1119                   just);
    1120         Py_INCREF(Py_None);
    1121         _res = Py_None;
    1122         return _res;
     1109    PyMac_PRECHECK(TETextBox);
     1110#endif
     1111    if (!PyArg_ParseTuple(_args, "s#O&h",
     1112                          &text__in__, &text__in_len__,
     1113                          PyMac_GetRect, &box,
     1114                          &just))
     1115        return NULL;
     1116    text__len__ = text__in_len__;
     1117    TETextBox(text__in__, text__len__,
     1118              &box,
     1119              just);
     1120    Py_INCREF(Py_None);
     1121    _res = Py_None;
     1122    return _res;
    11231123}
    11241124
    11251125static PyObject *TE_TEStyleNew(PyObject *_self, PyObject *_args)
    11261126{
    1127         PyObject *_res = NULL;
    1128         TEHandle _rv;
    1129         Rect destRect;
    1130         Rect viewRect;
     1127    PyObject *_res = NULL;
     1128    TEHandle _rv;
     1129    Rect destRect;
     1130    Rect viewRect;
    11311131#ifndef TEStyleNew
    1132         PyMac_PRECHECK(TEStyleNew);
    1133 #endif
    1134         if (!PyArg_ParseTuple(_args, "O&O&",
    1135                               PyMac_GetRect, &destRect,
    1136                               PyMac_GetRect, &viewRect))
    1137                 return NULL;
    1138         _rv = TEStyleNew(&destRect,
    1139                          &viewRect);
    1140         _res = Py_BuildValue("O&",
    1141                              TEObj_New, _rv);
    1142         return _res;
     1132    PyMac_PRECHECK(TEStyleNew);
     1133#endif
     1134    if (!PyArg_ParseTuple(_args, "O&O&",
     1135                          PyMac_GetRect, &destRect,
     1136                          PyMac_GetRect, &viewRect))
     1137        return NULL;
     1138    _rv = TEStyleNew(&destRect,
     1139                     &viewRect);
     1140    _res = Py_BuildValue("O&",
     1141                         TEObj_New, _rv);
     1142    return _res;
    11431143}
    11441144
    11451145static PyObject *TE_TESetScrapLength(PyObject *_self, PyObject *_args)
    11461146{
    1147         PyObject *_res = NULL;
    1148         long length;
     1147    PyObject *_res = NULL;
     1148    long length;
    11491149#ifndef TESetScrapLength
    1150         PyMac_PRECHECK(TESetScrapLength);
    1151 #endif
    1152         if (!PyArg_ParseTuple(_args, "l",
    1153                               &length))
    1154                 return NULL;
    1155         TESetScrapLength(length);
    1156         Py_INCREF(Py_None);
    1157         _res = Py_None;
    1158         return _res;
     1150    PyMac_PRECHECK(TESetScrapLength);
     1151#endif
     1152    if (!PyArg_ParseTuple(_args, "l",
     1153                          &length))
     1154        return NULL;
     1155    TESetScrapLength(length);
     1156    Py_INCREF(Py_None);
     1157    _res = Py_None;
     1158    return _res;
    11591159}
    11601160
    11611161static PyObject *TE_TEFromScrap(PyObject *_self, PyObject *_args)
    11621162{
    1163         PyObject *_res = NULL;
    1164         OSErr _err;
     1163    PyObject *_res = NULL;
     1164    OSErr _err;
    11651165#ifndef TEFromScrap
    1166         PyMac_PRECHECK(TEFromScrap);
    1167 #endif
    1168         if (!PyArg_ParseTuple(_args, ""))
    1169                 return NULL;
    1170         _err = TEFromScrap();
    1171         if (_err != noErr) return PyMac_Error(_err);
    1172         Py_INCREF(Py_None);
    1173         _res = Py_None;
    1174         return _res;
     1166    PyMac_PRECHECK(TEFromScrap);
     1167#endif
     1168    if (!PyArg_ParseTuple(_args, ""))
     1169        return NULL;
     1170    _err = TEFromScrap();
     1171    if (_err != noErr) return PyMac_Error(_err);
     1172    Py_INCREF(Py_None);
     1173    _res = Py_None;
     1174    return _res;
    11751175}
    11761176
    11771177static PyObject *TE_TEToScrap(PyObject *_self, PyObject *_args)
    11781178{
    1179         PyObject *_res = NULL;
    1180         OSErr _err;
     1179    PyObject *_res = NULL;
     1180    OSErr _err;
    11811181#ifndef TEToScrap
    1182         PyMac_PRECHECK(TEToScrap);
    1183 #endif
    1184         if (!PyArg_ParseTuple(_args, ""))
    1185                 return NULL;
    1186         _err = TEToScrap();
    1187         if (_err != noErr) return PyMac_Error(_err);
    1188         Py_INCREF(Py_None);
    1189         _res = Py_None;
    1190         return _res;
     1182    PyMac_PRECHECK(TEToScrap);
     1183#endif
     1184    if (!PyArg_ParseTuple(_args, ""))
     1185        return NULL;
     1186    _err = TEToScrap();
     1187    if (_err != noErr) return PyMac_Error(_err);
     1188    Py_INCREF(Py_None);
     1189    _res = Py_None;
     1190    return _res;
    11911191}
    11921192
    11931193static PyObject *TE_TEGetScrapHandle(PyObject *_self, PyObject *_args)
    11941194{
    1195         PyObject *_res = NULL;
    1196         Handle _rv;
     1195    PyObject *_res = NULL;
     1196    Handle _rv;
    11971197#ifndef TEGetScrapHandle
    1198         PyMac_PRECHECK(TEGetScrapHandle);
    1199 #endif
    1200         if (!PyArg_ParseTuple(_args, ""))
    1201                 return NULL;
    1202         _rv = TEGetScrapHandle();
    1203         _res = Py_BuildValue("O&",
    1204                              ResObj_New, _rv);
    1205         return _res;
     1198    PyMac_PRECHECK(TEGetScrapHandle);
     1199#endif
     1200    if (!PyArg_ParseTuple(_args, ""))
     1201        return NULL;
     1202    _rv = TEGetScrapHandle();
     1203    _res = Py_BuildValue("O&",
     1204                         ResObj_New, _rv);
     1205    return _res;
    12061206}
    12071207
    12081208static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
    12091209{
    1210         PyObject *_res = NULL;
    1211         Handle value;
     1210    PyObject *_res = NULL;
     1211    Handle value;
    12121212#ifndef TESetScrapHandle
    1213         PyMac_PRECHECK(TESetScrapHandle);
    1214 #endif
    1215         if (!PyArg_ParseTuple(_args, "O&",
    1216                               ResObj_Convert, &value))
    1217                 return NULL;
    1218         TESetScrapHandle(value);
    1219         Py_INCREF(Py_None);
    1220         _res = Py_None;
    1221         return _res;
     1213    PyMac_PRECHECK(TESetScrapHandle);
     1214#endif
     1215    if (!PyArg_ParseTuple(_args, "O&",
     1216                          ResObj_Convert, &value))
     1217        return NULL;
     1218    TESetScrapHandle(value);
     1219    Py_INCREF(Py_None);
     1220    _res = Py_None;
     1221    return _res;
    12221222}
    12231223
    12241224static PyObject *TE_LMGetWordRedraw(PyObject *_self, PyObject *_args)
    12251225{
    1226         PyObject *_res = NULL;
    1227         UInt8 _rv;
     1226    PyObject *_res = NULL;
     1227    UInt8 _rv;
    12281228#ifndef LMGetWordRedraw
    1229         PyMac_PRECHECK(LMGetWordRedraw);
    1230 #endif
    1231         if (!PyArg_ParseTuple(_args, ""))
    1232                 return NULL;
    1233         _rv = LMGetWordRedraw();
    1234         _res = Py_BuildValue("b",
    1235                              _rv);
    1236         return _res;
     1229    PyMac_PRECHECK(LMGetWordRedraw);
     1230#endif
     1231    if (!PyArg_ParseTuple(_args, ""))
     1232        return NULL;
     1233    _rv = LMGetWordRedraw();
     1234    _res = Py_BuildValue("b",
     1235                         _rv);
     1236    return _res;
    12371237}
    12381238
    12391239static PyObject *TE_LMSetWordRedraw(PyObject *_self, PyObject *_args)
    12401240{
    1241         PyObject *_res = NULL;
    1242         UInt8 value;
     1241    PyObject *_res = NULL;
     1242    UInt8 value;
    12431243#ifndef LMSetWordRedraw
    1244         PyMac_PRECHECK(LMSetWordRedraw);
    1245 #endif
    1246         if (!PyArg_ParseTuple(_args, "b",
    1247                               &value))
    1248                 return NULL;
    1249         LMSetWordRedraw(value);
    1250         Py_INCREF(Py_None);
    1251         _res = Py_None;
    1252         return _res;
     1244    PyMac_PRECHECK(LMSetWordRedraw);
     1245#endif
     1246    if (!PyArg_ParseTuple(_args, "b",
     1247                          &value))
     1248        return NULL;
     1249    LMSetWordRedraw(value);
     1250    Py_INCREF(Py_None);
     1251    _res = Py_None;
     1252    return _res;
    12531253}
    12541254
    12551255static PyObject *TE_as_TE(PyObject *_self, PyObject *_args)
    12561256{
    1257         PyObject *_res = NULL;
    1258         TEHandle _rv;
    1259         Handle h;
     1257    PyObject *_res = NULL;
     1258    TEHandle _rv;
     1259    Handle h;
    12601260#ifndef as_TE
    1261         PyMac_PRECHECK(as_TE);
    1262 #endif
    1263         if (!PyArg_ParseTuple(_args, "O&",
    1264                               ResObj_Convert, &h))
    1265                 return NULL;
    1266         _rv = as_TE(h);
    1267         _res = Py_BuildValue("O&",
    1268                              TEObj_New, _rv);
    1269         return _res;
     1261    PyMac_PRECHECK(as_TE);
     1262#endif
     1263    if (!PyArg_ParseTuple(_args, "O&",
     1264                          ResObj_Convert, &h))
     1265        return NULL;
     1266    _rv = as_TE(h);
     1267    _res = Py_BuildValue("O&",
     1268                         TEObj_New, _rv);
     1269    return _res;
    12701270}
    12711271#endif /* __LP64__ */
     
    12731273static PyMethodDef TE_methods[] = {
    12741274#ifndef __LP64__
    1275         {"TEScrapHandle", (PyCFunction)TE_TEScrapHandle, 1,
    1276         PyDoc_STR("() -> (Handle _rv)")},
    1277         {"TEGetScrapLength", (PyCFunction)TE_TEGetScrapLength, 1,
    1278         PyDoc_STR("() -> (long _rv)")},
    1279         {"TENew", (PyCFunction)TE_TENew, 1,
    1280         PyDoc_STR("(Rect destRect, Rect viewRect) -> (TEHandle _rv)")},
    1281         {"TETextBox", (PyCFunction)TE_TETextBox, 1,
    1282         PyDoc_STR("(Buffer text, Rect box, short just) -> None")},
    1283         {"TEStyleNew", (PyCFunction)TE_TEStyleNew, 1,
    1284         PyDoc_STR("(Rect destRect, Rect viewRect) -> (TEHandle _rv)")},
    1285         {"TESetScrapLength", (PyCFunction)TE_TESetScrapLength, 1,
    1286         PyDoc_STR("(long length) -> None")},
    1287         {"TEFromScrap", (PyCFunction)TE_TEFromScrap, 1,
    1288         PyDoc_STR("() -> None")},
    1289         {"TEToScrap", (PyCFunction)TE_TEToScrap, 1,
    1290         PyDoc_STR("() -> None")},
    1291         {"TEGetScrapHandle", (PyCFunction)TE_TEGetScrapHandle, 1,
    1292         PyDoc_STR("() -> (Handle _rv)")},
    1293         {"TESetScrapHandle", (PyCFunction)TE_TESetScrapHandle, 1,
    1294         PyDoc_STR("(Handle value) -> None")},
    1295         {"LMGetWordRedraw", (PyCFunction)TE_LMGetWordRedraw, 1,
    1296         PyDoc_STR("() -> (UInt8 _rv)")},
    1297         {"LMSetWordRedraw", (PyCFunction)TE_LMSetWordRedraw, 1,
    1298         PyDoc_STR("(UInt8 value) -> None")},
    1299         {"as_TE", (PyCFunction)TE_as_TE, 1,
    1300         PyDoc_STR("(Handle h) -> (TEHandle _rv)")},
     1275    {"TEScrapHandle", (PyCFunction)TE_TEScrapHandle, 1,
     1276    PyDoc_STR("() -> (Handle _rv)")},
     1277    {"TEGetScrapLength", (PyCFunction)TE_TEGetScrapLength, 1,
     1278    PyDoc_STR("() -> (long _rv)")},
     1279    {"TENew", (PyCFunction)TE_TENew, 1,
     1280    PyDoc_STR("(Rect destRect, Rect viewRect) -> (TEHandle _rv)")},
     1281    {"TETextBox", (PyCFunction)TE_TETextBox, 1,
     1282    PyDoc_STR("(Buffer text, Rect box, short just) -> None")},
     1283    {"TEStyleNew", (PyCFunction)TE_TEStyleNew, 1,
     1284    PyDoc_STR("(Rect destRect, Rect viewRect) -> (TEHandle _rv)")},
     1285    {"TESetScrapLength", (PyCFunction)TE_TESetScrapLength, 1,
     1286    PyDoc_STR("(long length) -> None")},
     1287    {"TEFromScrap", (PyCFunction)TE_TEFromScrap, 1,
     1288    PyDoc_STR("() -> None")},
     1289    {"TEToScrap", (PyCFunction)TE_TEToScrap, 1,
     1290    PyDoc_STR("() -> None")},
     1291    {"TEGetScrapHandle", (PyCFunction)TE_TEGetScrapHandle, 1,
     1292    PyDoc_STR("() -> (Handle _rv)")},
     1293    {"TESetScrapHandle", (PyCFunction)TE_TESetScrapHandle, 1,
     1294    PyDoc_STR("(Handle value) -> None")},
     1295    {"LMGetWordRedraw", (PyCFunction)TE_LMGetWordRedraw, 1,
     1296    PyDoc_STR("() -> (UInt8 _rv)")},
     1297    {"LMSetWordRedraw", (PyCFunction)TE_LMSetWordRedraw, 1,
     1298    PyDoc_STR("(UInt8 value) -> None")},
     1299    {"as_TE", (PyCFunction)TE_as_TE, 1,
     1300    PyDoc_STR("(Handle h) -> (TEHandle _rv)")},
    13011301#endif /* __LP64__ */
    1302         {NULL, NULL, 0}
     1302    {NULL, NULL, 0}
    13031303};
    13041304
     
    13081308void init_TE(void)
    13091309{
    1310         PyObject *m;
     1310    PyObject *m;
    13111311#ifndef __LP64__
    1312         PyObject *d;
    1313 
    1314 
    1315 
    1316                 PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New);
    1317                 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert);
     1312    PyObject *d;
     1313
     1314
     1315
     1316        PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New);
     1317        PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert);
    13181318
    13191319#endif /* __LP64__ */
    13201320
    1321         m = Py_InitModule("_TE", TE_methods);
     1321    m = Py_InitModule("_TE", TE_methods);
    13221322#ifndef __LP64__
    1323         d = PyModule_GetDict(m);
    1324         TE_Error = PyMac_GetOSErrException();
    1325         if (TE_Error == NULL ||
    1326             PyDict_SetItemString(d, "Error", TE_Error) != 0)
    1327                 return;
    1328         TE_Type.ob_type = &PyType_Type;
    1329         if (PyType_Ready(&TE_Type) < 0) return;
    1330         Py_INCREF(&TE_Type);
    1331         PyModule_AddObject(m, "TE", (PyObject *)&TE_Type);
    1332         /* Backward-compatible name */
    1333         Py_INCREF(&TE_Type);
    1334         PyModule_AddObject(m, "TEType", (PyObject *)&TE_Type);
     1323    d = PyModule_GetDict(m);
     1324    TE_Error = PyMac_GetOSErrException();
     1325    if (TE_Error == NULL ||
     1326        PyDict_SetItemString(d, "Error", TE_Error) != 0)
     1327        return;
     1328    TE_Type.ob_type = &PyType_Type;
     1329    if (PyType_Ready(&TE_Type) < 0) return;
     1330    Py_INCREF(&TE_Type);
     1331    PyModule_AddObject(m, "TE", (PyObject *)&TE_Type);
     1332    /* Backward-compatible name */
     1333    Py_INCREF(&TE_Type);
     1334    PyModule_AddObject(m, "TEType", (PyObject *)&TE_Type);
    13351335#endif /* __LP64__ */
    13361336}
Note: See TracChangeset for help on using the changeset viewer.