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/win/_Winmodule.c

    r2 r391  
    1010/* Macro to test whether a weak-loaded CFM function exists */
    1111#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
    12         PyErr_SetString(PyExc_NotImplementedError, \
    13         "Not available in this shared library/OS version"); \
    14         return NULL; \
     12    PyErr_SetString(PyExc_NotImplementedError, \
     13    "Not available in this shared library/OS version"); \
     14    return NULL; \
    1515    }} while(0)
    1616
     
    3737PyMac_AutoDisposeWindow(WindowPtr w)
    3838{
    39         DisposeWindow(w);
     39    DisposeWindow(w);
    4040}
    4141
     
    4949
    5050typedef struct WindowObject {
    51         PyObject_HEAD
    52         WindowPtr ob_itself;
    53         void (*ob_freeit)(WindowPtr ptr);
     51    PyObject_HEAD
     52    WindowPtr ob_itself;
     53    void (*ob_freeit)(WindowPtr ptr);
    5454} WindowObject;
    5555
    5656PyObject *WinObj_New(WindowPtr itself)
    5757{
    58         WindowObject *it;
    59         if (itself == NULL) return PyMac_Error(resNotFound);
    60         /* XXXX Or should we use WhichWindow code here? */
    61         it = PyObject_NEW(WindowObject, &Window_Type);
    62         if (it == NULL) return NULL;
    63         it->ob_itself = itself;
    64         it->ob_freeit = NULL;
    65         if (GetWRefCon(itself) == 0)
    66         {
    67                 SetWRefCon(itself, (long)it);
    68                 it->ob_freeit = PyMac_AutoDisposeWindow;
    69         }
    70         return (PyObject *)it;
     58    WindowObject *it;
     59    if (itself == NULL) return PyMac_Error(resNotFound);
     60    /* XXXX Or should we use WhichWindow code here? */
     61    it = PyObject_NEW(WindowObject, &Window_Type);
     62    if (it == NULL) return NULL;
     63    it->ob_itself = itself;
     64    it->ob_freeit = NULL;
     65    if (GetWRefCon(itself) == 0)
     66    {
     67        SetWRefCon(itself, (long)it);
     68        it->ob_freeit = PyMac_AutoDisposeWindow;
     69    }
     70    return (PyObject *)it;
    7171}
    7272
     
    7474{
    7575
    76         if (v == Py_None) { *p_itself = NULL; return 1; }
    77         if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
    78 
    79         {
    80                 DialogRef dlg;
    81                 if (DlgObj_Convert(v, &dlg) && dlg) {
    82                         *p_itself = GetDialogWindow(dlg);
    83                         return 1;
    84                 }
    85                 PyErr_Clear();
    86         }
    87         if (!WinObj_Check(v))
    88         {
    89                 PyErr_SetString(PyExc_TypeError, "Window required");
    90                 return 0;
    91         }
    92         *p_itself = ((WindowObject *)v)->ob_itself;
    93         return 1;
     76    if (v == Py_None) { *p_itself = NULL; return 1; }
     77    if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
     78
     79    {
     80        DialogRef dlg;
     81        if (DlgObj_Convert(v, &dlg) && dlg) {
     82            *p_itself = GetDialogWindow(dlg);
     83            return 1;
     84        }
     85        PyErr_Clear();
     86    }
     87    if (!WinObj_Check(v))
     88    {
     89        PyErr_SetString(PyExc_TypeError, "Window required");
     90        return 0;
     91    }
     92    *p_itself = ((WindowObject *)v)->ob_itself;
     93    return 1;
    9494}
    9595
    9696static void WinObj_dealloc(WindowObject *self)
    9797{
    98         if (self->ob_freeit && self->ob_itself)
    99         {
    100                 SetWRefCon(self->ob_itself, 0);
    101                 self->ob_freeit(self->ob_itself);
    102         }
    103         self->ob_itself = NULL;
    104         self->ob_freeit = NULL;
    105         self->ob_type->tp_free((PyObject *)self);
     98    if (self->ob_freeit && self->ob_itself)
     99    {
     100        SetWRefCon(self->ob_itself, 0);
     101        self->ob_freeit(self->ob_itself);
     102    }
     103    self->ob_itself = NULL;
     104    self->ob_freeit = NULL;
     105    self->ob_type->tp_free((PyObject *)self);
    106106}
    107107
    108108static PyObject *WinObj_GetWindowOwnerCount(WindowObject *_self, PyObject *_args)
    109109{
    110         PyObject *_res = NULL;
    111         OSStatus _err;
    112         UInt32 outCount;
     110    PyObject *_res = NULL;
     111    OSStatus _err;
     112    UInt32 outCount;
    113113#ifndef GetWindowOwnerCount
    114         PyMac_PRECHECK(GetWindowOwnerCount);
    115 #endif
    116         if (!PyArg_ParseTuple(_args, ""))
    117                 return NULL;
    118         _err = GetWindowOwnerCount(_self->ob_itself,
    119                                    &outCount);
    120         if (_err != noErr) return PyMac_Error(_err);
    121         _res = Py_BuildValue("l",
    122                              outCount);
    123         return _res;
     114    PyMac_PRECHECK(GetWindowOwnerCount);
     115#endif
     116    if (!PyArg_ParseTuple(_args, ""))
     117        return NULL;
     118    _err = GetWindowOwnerCount(_self->ob_itself,
     119                               &outCount);
     120    if (_err != noErr) return PyMac_Error(_err);
     121    _res = Py_BuildValue("l",
     122                         outCount);
     123    return _res;
    124124}
    125125
    126126static PyObject *WinObj_CloneWindow(WindowObject *_self, PyObject *_args)
    127127{
    128         PyObject *_res = NULL;
    129         OSStatus _err;
     128    PyObject *_res = NULL;
     129    OSStatus _err;
    130130#ifndef CloneWindow
    131         PyMac_PRECHECK(CloneWindow);
    132 #endif
    133         if (!PyArg_ParseTuple(_args, ""))
    134                 return NULL;
    135         _err = CloneWindow(_self->ob_itself);
    136         if (_err != noErr) return PyMac_Error(_err);
    137         Py_INCREF(Py_None);
    138         _res = Py_None;
    139         return _res;
     131    PyMac_PRECHECK(CloneWindow);
     132#endif
     133    if (!PyArg_ParseTuple(_args, ""))
     134        return NULL;
     135    _err = CloneWindow(_self->ob_itself);
     136    if (_err != noErr) return PyMac_Error(_err);
     137    Py_INCREF(Py_None);
     138    _res = Py_None;
     139    return _res;
    140140}
    141141
    142142static PyObject *WinObj_GetWindowRetainCount(WindowObject *_self, PyObject *_args)
    143143{
    144         PyObject *_res = NULL;
    145         ItemCount _rv;
     144    PyObject *_res = NULL;
     145    ItemCount _rv;
    146146#ifndef GetWindowRetainCount
    147         PyMac_PRECHECK(GetWindowRetainCount);
    148 #endif
    149         if (!PyArg_ParseTuple(_args, ""))
    150                 return NULL;
    151         _rv = GetWindowRetainCount(_self->ob_itself);
    152         _res = Py_BuildValue("l",
    153                              _rv);
    154         return _res;
     147    PyMac_PRECHECK(GetWindowRetainCount);
     148#endif
     149    if (!PyArg_ParseTuple(_args, ""))
     150        return NULL;
     151    _rv = GetWindowRetainCount(_self->ob_itself);
     152    _res = Py_BuildValue("l",
     153                         _rv);
     154    return _res;
    155155}
    156156
    157157static PyObject *WinObj_RetainWindow(WindowObject *_self, PyObject *_args)
    158158{
    159         PyObject *_res = NULL;
    160         OSStatus _err;
     159    PyObject *_res = NULL;
     160    OSStatus _err;
    161161#ifndef RetainWindow
    162         PyMac_PRECHECK(RetainWindow);
    163 #endif
    164         if (!PyArg_ParseTuple(_args, ""))
    165                 return NULL;
    166         _err = RetainWindow(_self->ob_itself);
    167         if (_err != noErr) return PyMac_Error(_err);
    168         Py_INCREF(Py_None);
    169         _res = Py_None;
    170         return _res;
     162    PyMac_PRECHECK(RetainWindow);
     163#endif
     164    if (!PyArg_ParseTuple(_args, ""))
     165        return NULL;
     166    _err = RetainWindow(_self->ob_itself);
     167    if (_err != noErr) return PyMac_Error(_err);
     168    Py_INCREF(Py_None);
     169    _res = Py_None;
     170    return _res;
    171171}
    172172
    173173static PyObject *WinObj_ReleaseWindow(WindowObject *_self, PyObject *_args)
    174174{
    175         PyObject *_res = NULL;
    176         OSStatus _err;
     175    PyObject *_res = NULL;
     176    OSStatus _err;
    177177#ifndef ReleaseWindow
    178         PyMac_PRECHECK(ReleaseWindow);
    179 #endif
    180         if (!PyArg_ParseTuple(_args, ""))
    181                 return NULL;
    182         _err = ReleaseWindow(_self->ob_itself);
    183         if (_err != noErr) return PyMac_Error(_err);
    184         Py_INCREF(Py_None);
    185         _res = Py_None;
    186         return _res;
     178    PyMac_PRECHECK(ReleaseWindow);
     179#endif
     180    if (!PyArg_ParseTuple(_args, ""))
     181        return NULL;
     182    _err = ReleaseWindow(_self->ob_itself);
     183    if (_err != noErr) return PyMac_Error(_err);
     184    Py_INCREF(Py_None);
     185    _res = Py_None;
     186    return _res;
    187187}
    188188
    189189static PyObject *WinObj_ReshapeCustomWindow(WindowObject *_self, PyObject *_args)
    190190{
    191         PyObject *_res = NULL;
    192         OSStatus _err;
     191    PyObject *_res = NULL;
     192    OSStatus _err;
    193193#ifndef ReshapeCustomWindow
    194         PyMac_PRECHECK(ReshapeCustomWindow);
    195 #endif
    196         if (!PyArg_ParseTuple(_args, ""))
    197                 return NULL;
    198         _err = ReshapeCustomWindow(_self->ob_itself);
    199         if (_err != noErr) return PyMac_Error(_err);
    200         Py_INCREF(Py_None);
    201         _res = Py_None;
    202         return _res;
     194    PyMac_PRECHECK(ReshapeCustomWindow);
     195#endif
     196    if (!PyArg_ParseTuple(_args, ""))
     197        return NULL;
     198    _err = ReshapeCustomWindow(_self->ob_itself);
     199    if (_err != noErr) return PyMac_Error(_err);
     200    Py_INCREF(Py_None);
     201    _res = Py_None;
     202    return _res;
    203203}
    204204
    205205static PyObject *WinObj_GetWindowWidgetHilite(WindowObject *_self, PyObject *_args)
    206206{
    207         PyObject *_res = NULL;
    208         OSStatus _err;
    209         WindowDefPartCode outHilite;
     207    PyObject *_res = NULL;
     208    OSStatus _err;
     209    WindowDefPartCode outHilite;
    210210#ifndef GetWindowWidgetHilite
    211         PyMac_PRECHECK(GetWindowWidgetHilite);
    212 #endif
    213         if (!PyArg_ParseTuple(_args, ""))
    214                 return NULL;
    215         _err = GetWindowWidgetHilite(_self->ob_itself,
    216                                      &outHilite);
    217         if (_err != noErr) return PyMac_Error(_err);
    218         _res = Py_BuildValue("h",
    219                              outHilite);
    220         return _res;
     211    PyMac_PRECHECK(GetWindowWidgetHilite);
     212#endif
     213    if (!PyArg_ParseTuple(_args, ""))
     214        return NULL;
     215    _err = GetWindowWidgetHilite(_self->ob_itself,
     216                                 &outHilite);
     217    if (_err != noErr) return PyMac_Error(_err);
     218    _res = Py_BuildValue("h",
     219                         outHilite);
     220    return _res;
    221221}
    222222
    223223static PyObject *WinObj_GetWindowClass(WindowObject *_self, PyObject *_args)
    224224{
    225         PyObject *_res = NULL;
    226         OSStatus _err;
    227         WindowClass outClass;
     225    PyObject *_res = NULL;
     226    OSStatus _err;
     227    WindowClass outClass;
    228228#ifndef GetWindowClass
    229         PyMac_PRECHECK(GetWindowClass);
    230 #endif
    231         if (!PyArg_ParseTuple(_args, ""))
    232                 return NULL;
    233         _err = GetWindowClass(_self->ob_itself,
    234                               &outClass);
    235         if (_err != noErr) return PyMac_Error(_err);
    236         _res = Py_BuildValue("l",
    237                              outClass);
    238         return _res;
     229    PyMac_PRECHECK(GetWindowClass);
     230#endif
     231    if (!PyArg_ParseTuple(_args, ""))
     232        return NULL;
     233    _err = GetWindowClass(_self->ob_itself,
     234                          &outClass);
     235    if (_err != noErr) return PyMac_Error(_err);
     236    _res = Py_BuildValue("l",
     237                         outClass);
     238    return _res;
    239239}
    240240
    241241static PyObject *WinObj_GetWindowAttributes(WindowObject *_self, PyObject *_args)
    242242{
    243         PyObject *_res = NULL;
    244         OSStatus _err;
    245         WindowAttributes outAttributes;
     243    PyObject *_res = NULL;
     244    OSStatus _err;
     245    WindowAttributes outAttributes;
    246246#ifndef GetWindowAttributes
    247         PyMac_PRECHECK(GetWindowAttributes);
    248 #endif
    249         if (!PyArg_ParseTuple(_args, ""))
    250                 return NULL;
    251         _err = GetWindowAttributes(_self->ob_itself,
    252                                    &outAttributes);
    253         if (_err != noErr) return PyMac_Error(_err);
    254         _res = Py_BuildValue("l",
    255                              outAttributes);
    256         return _res;
     247    PyMac_PRECHECK(GetWindowAttributes);
     248#endif
     249    if (!PyArg_ParseTuple(_args, ""))
     250        return NULL;
     251    _err = GetWindowAttributes(_self->ob_itself,
     252                               &outAttributes);
     253    if (_err != noErr) return PyMac_Error(_err);
     254    _res = Py_BuildValue("l",
     255                         outAttributes);
     256    return _res;
    257257}
    258258
    259259static PyObject *WinObj_ChangeWindowAttributes(WindowObject *_self, PyObject *_args)
    260260{
    261         PyObject *_res = NULL;
    262         OSStatus _err;
    263         WindowAttributes setTheseAttributes;
    264         WindowAttributes clearTheseAttributes;
     261    PyObject *_res = NULL;
     262    OSStatus _err;
     263    WindowAttributes setTheseAttributes;
     264    WindowAttributes clearTheseAttributes;
    265265#ifndef ChangeWindowAttributes
    266         PyMac_PRECHECK(ChangeWindowAttributes);
    267 #endif
    268         if (!PyArg_ParseTuple(_args, "ll",
    269                               &setTheseAttributes,
    270                               &clearTheseAttributes))
    271                 return NULL;
    272         _err = ChangeWindowAttributes(_self->ob_itself,
    273                                       setTheseAttributes,
    274                                       clearTheseAttributes);
    275         if (_err != noErr) return PyMac_Error(_err);
    276         Py_INCREF(Py_None);
    277         _res = Py_None;
    278         return _res;
     266    PyMac_PRECHECK(ChangeWindowAttributes);
     267#endif
     268    if (!PyArg_ParseTuple(_args, "ll",
     269                          &setTheseAttributes,
     270                          &clearTheseAttributes))
     271        return NULL;
     272    _err = ChangeWindowAttributes(_self->ob_itself,
     273                                  setTheseAttributes,
     274                                  clearTheseAttributes);
     275    if (_err != noErr) return PyMac_Error(_err);
     276    Py_INCREF(Py_None);
     277    _res = Py_None;
     278    return _res;
    279279}
    280280
    281281static PyObject *WinObj_SetWindowClass(WindowObject *_self, PyObject *_args)
    282282{
    283         PyObject *_res = NULL;
    284         OSStatus _err;
    285         WindowClass inWindowClass;
     283    PyObject *_res = NULL;
     284    OSStatus _err;
     285    WindowClass inWindowClass;
    286286#ifndef SetWindowClass
    287         PyMac_PRECHECK(SetWindowClass);
    288 #endif
    289         if (!PyArg_ParseTuple(_args, "l",
    290                               &inWindowClass))
    291                 return NULL;
    292         _err = SetWindowClass(_self->ob_itself,
    293                               inWindowClass);
    294         if (_err != noErr) return PyMac_Error(_err);
    295         Py_INCREF(Py_None);
    296         _res = Py_None;
    297         return _res;
     287    PyMac_PRECHECK(SetWindowClass);
     288#endif
     289    if (!PyArg_ParseTuple(_args, "l",
     290                          &inWindowClass))
     291        return NULL;
     292    _err = SetWindowClass(_self->ob_itself,
     293                          inWindowClass);
     294    if (_err != noErr) return PyMac_Error(_err);
     295    Py_INCREF(Py_None);
     296    _res = Py_None;
     297    return _res;
    298298}
    299299
    300300static PyObject *WinObj_SetWindowModality(WindowObject *_self, PyObject *_args)
    301301{
    302         PyObject *_res = NULL;
    303         OSStatus _err;
    304         WindowModality inModalKind;
    305         WindowPtr inUnavailableWindow;
     302    PyObject *_res = NULL;
     303    OSStatus _err;
     304    WindowModality inModalKind;
     305    WindowPtr inUnavailableWindow;
    306306#ifndef SetWindowModality
    307         PyMac_PRECHECK(SetWindowModality);
    308 #endif
    309         if (!PyArg_ParseTuple(_args, "lO&",
    310                               &inModalKind,
    311                               WinObj_Convert, &inUnavailableWindow))
    312                 return NULL;
    313         _err = SetWindowModality(_self->ob_itself,
    314                                  inModalKind,
    315                                  inUnavailableWindow);
    316         if (_err != noErr) return PyMac_Error(_err);
    317         Py_INCREF(Py_None);
    318         _res = Py_None;
    319         return _res;
     307    PyMac_PRECHECK(SetWindowModality);
     308#endif
     309    if (!PyArg_ParseTuple(_args, "lO&",
     310                          &inModalKind,
     311                          WinObj_Convert, &inUnavailableWindow))
     312        return NULL;
     313    _err = SetWindowModality(_self->ob_itself,
     314                             inModalKind,
     315                             inUnavailableWindow);
     316    if (_err != noErr) return PyMac_Error(_err);
     317    Py_INCREF(Py_None);
     318    _res = Py_None;
     319    return _res;
    320320}
    321321
    322322static PyObject *WinObj_GetWindowModality(WindowObject *_self, PyObject *_args)
    323323{
    324         PyObject *_res = NULL;
    325         OSStatus _err;
    326         WindowModality outModalKind;
    327         WindowPtr outUnavailableWindow;
     324    PyObject *_res = NULL;
     325    OSStatus _err;
     326    WindowModality outModalKind;
     327    WindowPtr outUnavailableWindow;
    328328#ifndef GetWindowModality
    329         PyMac_PRECHECK(GetWindowModality);
    330 #endif
    331         if (!PyArg_ParseTuple(_args, ""))
    332                 return NULL;
    333         _err = GetWindowModality(_self->ob_itself,
    334                                  &outModalKind,
    335                                  &outUnavailableWindow);
    336         if (_err != noErr) return PyMac_Error(_err);
    337         _res = Py_BuildValue("lO&",
    338                              outModalKind,
    339                              WinObj_WhichWindow, outUnavailableWindow);
    340         return _res;
     329    PyMac_PRECHECK(GetWindowModality);
     330#endif
     331    if (!PyArg_ParseTuple(_args, ""))
     332        return NULL;
     333    _err = GetWindowModality(_self->ob_itself,
     334                             &outModalKind,
     335                             &outUnavailableWindow);
     336    if (_err != noErr) return PyMac_Error(_err);
     337    _res = Py_BuildValue("lO&",
     338                         outModalKind,
     339                         WinObj_WhichWindow, outUnavailableWindow);
     340    return _res;
    341341}
    342342
    343343static PyObject *WinObj_SetWindowContentColor(WindowObject *_self, PyObject *_args)
    344344{
    345         PyObject *_res = NULL;
    346         OSStatus _err;
    347         RGBColor color;
     345    PyObject *_res = NULL;
     346    OSStatus _err;
     347    RGBColor color;
    348348#ifndef SetWindowContentColor
    349         PyMac_PRECHECK(SetWindowContentColor);
    350 #endif
    351         if (!PyArg_ParseTuple(_args, "O&",
    352                               QdRGB_Convert, &color))
    353                 return NULL;
    354         _err = SetWindowContentColor(_self->ob_itself,
    355                                      &color);
    356         if (_err != noErr) return PyMac_Error(_err);
    357         Py_INCREF(Py_None);
    358         _res = Py_None;
    359         return _res;
     349    PyMac_PRECHECK(SetWindowContentColor);
     350#endif
     351    if (!PyArg_ParseTuple(_args, "O&",
     352                          QdRGB_Convert, &color))
     353        return NULL;
     354    _err = SetWindowContentColor(_self->ob_itself,
     355                                 &color);
     356    if (_err != noErr) return PyMac_Error(_err);
     357    Py_INCREF(Py_None);
     358    _res = Py_None;
     359    return _res;
    360360}
    361361
    362362static PyObject *WinObj_GetWindowContentColor(WindowObject *_self, PyObject *_args)
    363363{
    364         PyObject *_res = NULL;
    365         OSStatus _err;
    366         RGBColor color;
     364    PyObject *_res = NULL;
     365    OSStatus _err;
     366    RGBColor color;
    367367#ifndef GetWindowContentColor
    368         PyMac_PRECHECK(GetWindowContentColor);
    369 #endif
    370         if (!PyArg_ParseTuple(_args, ""))
    371                 return NULL;
    372         _err = GetWindowContentColor(_self->ob_itself,
    373                                      &color);
    374         if (_err != noErr) return PyMac_Error(_err);
    375         _res = Py_BuildValue("O&",
    376                              QdRGB_New, &color);
    377         return _res;
     368    PyMac_PRECHECK(GetWindowContentColor);
     369#endif
     370    if (!PyArg_ParseTuple(_args, ""))
     371        return NULL;
     372    _err = GetWindowContentColor(_self->ob_itself,
     373                                 &color);
     374    if (_err != noErr) return PyMac_Error(_err);
     375    _res = Py_BuildValue("O&",
     376                         QdRGB_New, &color);
     377    return _res;
    378378}
    379379
    380380static PyObject *WinObj_GetWindowContentPattern(WindowObject *_self, PyObject *_args)
    381381{
    382         PyObject *_res = NULL;
    383         OSStatus _err;
    384         PixPatHandle outPixPat;
     382    PyObject *_res = NULL;
     383    OSStatus _err;
     384    PixPatHandle outPixPat;
    385385#ifndef GetWindowContentPattern
    386         PyMac_PRECHECK(GetWindowContentPattern);
    387 #endif
    388         if (!PyArg_ParseTuple(_args, "O&",
    389                               ResObj_Convert, &outPixPat))
    390                 return NULL;
    391         _err = GetWindowContentPattern(_self->ob_itself,
    392                                        outPixPat);
    393         if (_err != noErr) return PyMac_Error(_err);
    394         Py_INCREF(Py_None);
    395         _res = Py_None;
    396         return _res;
     386    PyMac_PRECHECK(GetWindowContentPattern);
     387#endif
     388    if (!PyArg_ParseTuple(_args, "O&",
     389                          ResObj_Convert, &outPixPat))
     390        return NULL;
     391    _err = GetWindowContentPattern(_self->ob_itself,
     392                                   outPixPat);
     393    if (_err != noErr) return PyMac_Error(_err);
     394    Py_INCREF(Py_None);
     395    _res = Py_None;
     396    return _res;
    397397}
    398398
    399399static PyObject *WinObj_SetWindowContentPattern(WindowObject *_self, PyObject *_args)
    400400{
    401         PyObject *_res = NULL;
    402         OSStatus _err;
    403         PixPatHandle pixPat;
     401    PyObject *_res = NULL;
     402    OSStatus _err;
     403    PixPatHandle pixPat;
    404404#ifndef SetWindowContentPattern
    405         PyMac_PRECHECK(SetWindowContentPattern);
    406 #endif
    407         if (!PyArg_ParseTuple(_args, "O&",
    408                               ResObj_Convert, &pixPat))
    409                 return NULL;
    410         _err = SetWindowContentPattern(_self->ob_itself,
    411                                        pixPat);
    412         if (_err != noErr) return PyMac_Error(_err);
    413         Py_INCREF(Py_None);
    414         _res = Py_None;
    415         return _res;
     405    PyMac_PRECHECK(SetWindowContentPattern);
     406#endif
     407    if (!PyArg_ParseTuple(_args, "O&",
     408                          ResObj_Convert, &pixPat))
     409        return NULL;
     410    _err = SetWindowContentPattern(_self->ob_itself,
     411                                   pixPat);
     412    if (_err != noErr) return PyMac_Error(_err);
     413    Py_INCREF(Py_None);
     414    _res = Py_None;
     415    return _res;
    416416}
    417417
    418418static PyObject *WinObj_ScrollWindowRect(WindowObject *_self, PyObject *_args)
    419419{
    420         PyObject *_res = NULL;
    421         OSStatus _err;
    422         Rect inScrollRect;
    423         SInt16 inHPixels;
    424         SInt16 inVPixels;
    425         ScrollWindowOptions inOptions;
    426         RgnHandle outExposedRgn;
     420    PyObject *_res = NULL;
     421    OSStatus _err;
     422    Rect inScrollRect;
     423    SInt16 inHPixels;
     424    SInt16 inVPixels;
     425    ScrollWindowOptions inOptions;
     426    RgnHandle outExposedRgn;
    427427#ifndef ScrollWindowRect
    428         PyMac_PRECHECK(ScrollWindowRect);
    429 #endif
    430         if (!PyArg_ParseTuple(_args, "O&hhlO&",
    431                               PyMac_GetRect, &inScrollRect,
    432                               &inHPixels,
    433                               &inVPixels,
    434                               &inOptions,
    435                               ResObj_Convert, &outExposedRgn))
    436                 return NULL;
    437         _err = ScrollWindowRect(_self->ob_itself,
    438                                 &inScrollRect,
    439                                 inHPixels,
    440                                 inVPixels,
    441                                 inOptions,
    442                                 outExposedRgn);
    443         if (_err != noErr) return PyMac_Error(_err);
    444         Py_INCREF(Py_None);
    445         _res = Py_None;
    446         return _res;
     428    PyMac_PRECHECK(ScrollWindowRect);
     429#endif
     430    if (!PyArg_ParseTuple(_args, "O&hhlO&",
     431                          PyMac_GetRect, &inScrollRect,
     432                          &inHPixels,
     433                          &inVPixels,
     434                          &inOptions,
     435                          ResObj_Convert, &outExposedRgn))
     436        return NULL;
     437    _err = ScrollWindowRect(_self->ob_itself,
     438                            &inScrollRect,
     439                            inHPixels,
     440                            inVPixels,
     441                            inOptions,
     442                            outExposedRgn);
     443    if (_err != noErr) return PyMac_Error(_err);
     444    Py_INCREF(Py_None);
     445    _res = Py_None;
     446    return _res;
    447447}
    448448
    449449static PyObject *WinObj_ScrollWindowRegion(WindowObject *_self, PyObject *_args)
    450450{
    451         PyObject *_res = NULL;
    452         OSStatus _err;
    453         RgnHandle inScrollRgn;
    454         SInt16 inHPixels;
    455         SInt16 inVPixels;
    456         ScrollWindowOptions inOptions;
    457         RgnHandle outExposedRgn;
     451    PyObject *_res = NULL;
     452    OSStatus _err;
     453    RgnHandle inScrollRgn;
     454    SInt16 inHPixels;
     455    SInt16 inVPixels;
     456    ScrollWindowOptions inOptions;
     457    RgnHandle outExposedRgn;
    458458#ifndef ScrollWindowRegion
    459         PyMac_PRECHECK(ScrollWindowRegion);
    460 #endif
    461         if (!PyArg_ParseTuple(_args, "O&hhlO&",
    462                               ResObj_Convert, &inScrollRgn,
    463                               &inHPixels,
    464                               &inVPixels,
    465                               &inOptions,
    466                               ResObj_Convert, &outExposedRgn))
    467                 return NULL;
    468         _err = ScrollWindowRegion(_self->ob_itself,
    469                                   inScrollRgn,
    470                                   inHPixels,
    471                                   inVPixels,
    472                                   inOptions,
    473                                   outExposedRgn);
    474         if (_err != noErr) return PyMac_Error(_err);
    475         Py_INCREF(Py_None);
    476         _res = Py_None;
    477         return _res;
     459    PyMac_PRECHECK(ScrollWindowRegion);
     460#endif
     461    if (!PyArg_ParseTuple(_args, "O&hhlO&",
     462                          ResObj_Convert, &inScrollRgn,
     463                          &inHPixels,
     464                          &inVPixels,
     465                          &inOptions,
     466                          ResObj_Convert, &outExposedRgn))
     467        return NULL;
     468    _err = ScrollWindowRegion(_self->ob_itself,
     469                              inScrollRgn,
     470                              inHPixels,
     471                              inVPixels,
     472                              inOptions,
     473                              outExposedRgn);
     474    if (_err != noErr) return PyMac_Error(_err);
     475    Py_INCREF(Py_None);
     476    _res = Py_None;
     477    return _res;
    478478}
    479479
    480480static PyObject *WinObj_ClipAbove(WindowObject *_self, PyObject *_args)
    481481{
    482         PyObject *_res = NULL;
     482    PyObject *_res = NULL;
    483483#ifndef ClipAbove
    484         PyMac_PRECHECK(ClipAbove);
    485 #endif
    486         if (!PyArg_ParseTuple(_args, ""))
    487                 return NULL;
    488         ClipAbove(_self->ob_itself);
    489         Py_INCREF(Py_None);
    490         _res = Py_None;
    491         return _res;
     484    PyMac_PRECHECK(ClipAbove);
     485#endif
     486    if (!PyArg_ParseTuple(_args, ""))
     487        return NULL;
     488    ClipAbove(_self->ob_itself);
     489    Py_INCREF(Py_None);
     490    _res = Py_None;
     491    return _res;
    492492}
    493493
    494494static PyObject *WinObj_PaintOne(WindowObject *_self, PyObject *_args)
    495495{
    496         PyObject *_res = NULL;
    497         RgnHandle clobberedRgn;
     496    PyObject *_res = NULL;
     497    RgnHandle clobberedRgn;
    498498#ifndef PaintOne
    499         PyMac_PRECHECK(PaintOne);
    500 #endif
    501         if (!PyArg_ParseTuple(_args, "O&",
    502                               ResObj_Convert, &clobberedRgn))
    503                 return NULL;
    504         PaintOne(_self->ob_itself,
    505                  clobberedRgn);
    506         Py_INCREF(Py_None);
    507         _res = Py_None;
    508         return _res;
     499    PyMac_PRECHECK(PaintOne);
     500#endif
     501    if (!PyArg_ParseTuple(_args, "O&",
     502                          ResObj_Convert, &clobberedRgn))
     503        return NULL;
     504    PaintOne(_self->ob_itself,
     505             clobberedRgn);
     506    Py_INCREF(Py_None);
     507    _res = Py_None;
     508    return _res;
    509509}
    510510
    511511static PyObject *WinObj_PaintBehind(WindowObject *_self, PyObject *_args)
    512512{
    513         PyObject *_res = NULL;
    514         RgnHandle clobberedRgn;
     513    PyObject *_res = NULL;
     514    RgnHandle clobberedRgn;
    515515#ifndef PaintBehind
    516         PyMac_PRECHECK(PaintBehind);
    517 #endif
    518         if (!PyArg_ParseTuple(_args, "O&",
    519                               ResObj_Convert, &clobberedRgn))
    520                 return NULL;
    521         PaintBehind(_self->ob_itself,
    522                     clobberedRgn);
    523         Py_INCREF(Py_None);
    524         _res = Py_None;
    525         return _res;
     516    PyMac_PRECHECK(PaintBehind);
     517#endif
     518    if (!PyArg_ParseTuple(_args, "O&",
     519                          ResObj_Convert, &clobberedRgn))
     520        return NULL;
     521    PaintBehind(_self->ob_itself,
     522                clobberedRgn);
     523    Py_INCREF(Py_None);
     524    _res = Py_None;
     525    return _res;
    526526}
    527527
    528528static PyObject *WinObj_CalcVis(WindowObject *_self, PyObject *_args)
    529529{
    530         PyObject *_res = NULL;
     530    PyObject *_res = NULL;
    531531#ifndef CalcVis
    532         PyMac_PRECHECK(CalcVis);
    533 #endif
    534         if (!PyArg_ParseTuple(_args, ""))
    535                 return NULL;
    536         CalcVis(_self->ob_itself);
    537         Py_INCREF(Py_None);
    538         _res = Py_None;
    539         return _res;
     532    PyMac_PRECHECK(CalcVis);
     533#endif
     534    if (!PyArg_ParseTuple(_args, ""))
     535        return NULL;
     536    CalcVis(_self->ob_itself);
     537    Py_INCREF(Py_None);
     538    _res = Py_None;
     539    return _res;
    540540}
    541541
    542542static PyObject *WinObj_CalcVisBehind(WindowObject *_self, PyObject *_args)
    543543{
    544         PyObject *_res = NULL;
    545         RgnHandle clobberedRgn;
     544    PyObject *_res = NULL;
     545    RgnHandle clobberedRgn;
    546546#ifndef CalcVisBehind
    547         PyMac_PRECHECK(CalcVisBehind);
    548 #endif
    549         if (!PyArg_ParseTuple(_args, "O&",
    550                               ResObj_Convert, &clobberedRgn))
    551                 return NULL;
    552         CalcVisBehind(_self->ob_itself,
    553                       clobberedRgn);
    554         Py_INCREF(Py_None);
    555         _res = Py_None;
    556         return _res;
     547    PyMac_PRECHECK(CalcVisBehind);
     548#endif
     549    if (!PyArg_ParseTuple(_args, "O&",
     550                          ResObj_Convert, &clobberedRgn))
     551        return NULL;
     552    CalcVisBehind(_self->ob_itself,
     553                  clobberedRgn);
     554    Py_INCREF(Py_None);
     555    _res = Py_None;
     556    return _res;
    557557}
    558558
    559559static PyObject *WinObj_BringToFront(WindowObject *_self, PyObject *_args)
    560560{
    561         PyObject *_res = NULL;
     561    PyObject *_res = NULL;
    562562#ifndef BringToFront
    563         PyMac_PRECHECK(BringToFront);
    564 #endif
    565         if (!PyArg_ParseTuple(_args, ""))
    566                 return NULL;
    567         BringToFront(_self->ob_itself);
    568         Py_INCREF(Py_None);
    569         _res = Py_None;
    570         return _res;
     563    PyMac_PRECHECK(BringToFront);
     564#endif
     565    if (!PyArg_ParseTuple(_args, ""))
     566        return NULL;
     567    BringToFront(_self->ob_itself);
     568    Py_INCREF(Py_None);
     569    _res = Py_None;
     570    return _res;
    571571}
    572572
    573573static PyObject *WinObj_SendBehind(WindowObject *_self, PyObject *_args)
    574574{
    575         PyObject *_res = NULL;
    576         WindowPtr behindWindow;
     575    PyObject *_res = NULL;
     576    WindowPtr behindWindow;
    577577#ifndef SendBehind
    578         PyMac_PRECHECK(SendBehind);
    579 #endif
    580         if (!PyArg_ParseTuple(_args, "O&",
    581                               WinObj_Convert, &behindWindow))
    582                 return NULL;
    583         SendBehind(_self->ob_itself,
    584                    behindWindow);
    585         Py_INCREF(Py_None);
    586         _res = Py_None;
    587         return _res;
     578    PyMac_PRECHECK(SendBehind);
     579#endif
     580    if (!PyArg_ParseTuple(_args, "O&",
     581                          WinObj_Convert, &behindWindow))
     582        return NULL;
     583    SendBehind(_self->ob_itself,
     584               behindWindow);
     585    Py_INCREF(Py_None);
     586    _res = Py_None;
     587    return _res;
    588588}
    589589
    590590static PyObject *WinObj_SelectWindow(WindowObject *_self, PyObject *_args)
    591591{
    592         PyObject *_res = NULL;
     592    PyObject *_res = NULL;
    593593#ifndef SelectWindow
    594         PyMac_PRECHECK(SelectWindow);
    595 #endif
    596         if (!PyArg_ParseTuple(_args, ""))
    597                 return NULL;
    598         SelectWindow(_self->ob_itself);
    599         Py_INCREF(Py_None);
    600         _res = Py_None;
    601         return _res;
     594    PyMac_PRECHECK(SelectWindow);
     595#endif
     596    if (!PyArg_ParseTuple(_args, ""))
     597        return NULL;
     598    SelectWindow(_self->ob_itself);
     599    Py_INCREF(Py_None);
     600    _res = Py_None;
     601    return _res;
    602602}
    603603
    604604static PyObject *WinObj_GetNextWindowOfClass(WindowObject *_self, PyObject *_args)
    605605{
    606         PyObject *_res = NULL;
    607         WindowPtr _rv;
    608         WindowClass inWindowClass;
    609         Boolean mustBeVisible;
     606    PyObject *_res = NULL;
     607    WindowPtr _rv;
     608    WindowClass inWindowClass;
     609    Boolean mustBeVisible;
    610610#ifndef GetNextWindowOfClass
    611         PyMac_PRECHECK(GetNextWindowOfClass);
    612 #endif
    613         if (!PyArg_ParseTuple(_args, "lb",
    614                               &inWindowClass,
    615                               &mustBeVisible))
    616                 return NULL;
    617         _rv = GetNextWindowOfClass(_self->ob_itself,
    618                                    inWindowClass,
    619                                    mustBeVisible);
    620         _res = Py_BuildValue("O&",
    621                              WinObj_New, _rv);
    622         return _res;
     611    PyMac_PRECHECK(GetNextWindowOfClass);
     612#endif
     613    if (!PyArg_ParseTuple(_args, "lb",
     614                          &inWindowClass,
     615                          &mustBeVisible))
     616        return NULL;
     617    _rv = GetNextWindowOfClass(_self->ob_itself,
     618                               inWindowClass,
     619                               mustBeVisible);
     620    _res = Py_BuildValue("O&",
     621                         WinObj_New, _rv);
     622    return _res;
    623623}
    624624
    625625static PyObject *WinObj_SetWindowAlternateTitle(WindowObject *_self, PyObject *_args)
    626626{
    627         PyObject *_res = NULL;
    628         OSStatus _err;
    629         CFStringRef inTitle;
     627    PyObject *_res = NULL;
     628    OSStatus _err;
     629    CFStringRef inTitle;
    630630#ifndef SetWindowAlternateTitle
    631         PyMac_PRECHECK(SetWindowAlternateTitle);
    632 #endif
    633         if (!PyArg_ParseTuple(_args, "O&",
    634                               CFStringRefObj_Convert, &inTitle))
    635                 return NULL;
    636         _err = SetWindowAlternateTitle(_self->ob_itself,
    637                                        inTitle);
    638         if (_err != noErr) return PyMac_Error(_err);
    639         Py_INCREF(Py_None);
    640         _res = Py_None;
    641         return _res;
     631    PyMac_PRECHECK(SetWindowAlternateTitle);
     632#endif
     633    if (!PyArg_ParseTuple(_args, "O&",
     634                          CFStringRefObj_Convert, &inTitle))
     635        return NULL;
     636    _err = SetWindowAlternateTitle(_self->ob_itself,
     637                                   inTitle);
     638    if (_err != noErr) return PyMac_Error(_err);
     639    Py_INCREF(Py_None);
     640    _res = Py_None;
     641    return _res;
    642642}
    643643
    644644static PyObject *WinObj_CopyWindowAlternateTitle(WindowObject *_self, PyObject *_args)
    645645{
    646         PyObject *_res = NULL;
    647         OSStatus _err;
    648         CFStringRef outTitle;
     646    PyObject *_res = NULL;
     647    OSStatus _err;
     648    CFStringRef outTitle;
    649649#ifndef CopyWindowAlternateTitle
    650         PyMac_PRECHECK(CopyWindowAlternateTitle);
    651 #endif
    652         if (!PyArg_ParseTuple(_args, ""))
    653                 return NULL;
    654         _err = CopyWindowAlternateTitle(_self->ob_itself,
    655                                         &outTitle);
    656         if (_err != noErr) return PyMac_Error(_err);
    657         _res = Py_BuildValue("O&",
    658                              CFStringRefObj_New, outTitle);
    659         return _res;
     650    PyMac_PRECHECK(CopyWindowAlternateTitle);
     651#endif
     652    if (!PyArg_ParseTuple(_args, ""))
     653        return NULL;
     654    _err = CopyWindowAlternateTitle(_self->ob_itself,
     655                                    &outTitle);
     656    if (_err != noErr) return PyMac_Error(_err);
     657    _res = Py_BuildValue("O&",
     658                         CFStringRefObj_New, outTitle);
     659    return _res;
    660660}
    661661
    662662static PyObject *WinObj_HiliteWindow(WindowObject *_self, PyObject *_args)
    663663{
    664         PyObject *_res = NULL;
    665         Boolean fHilite;
     664    PyObject *_res = NULL;
     665    Boolean fHilite;
    666666#ifndef HiliteWindow
    667         PyMac_PRECHECK(HiliteWindow);
    668 #endif
    669         if (!PyArg_ParseTuple(_args, "b",
    670                               &fHilite))
    671                 return NULL;
    672         HiliteWindow(_self->ob_itself,
    673                      fHilite);
    674         Py_INCREF(Py_None);
    675         _res = Py_None;
    676         return _res;
     667    PyMac_PRECHECK(HiliteWindow);
     668#endif
     669    if (!PyArg_ParseTuple(_args, "b",
     670                          &fHilite))
     671        return NULL;
     672    HiliteWindow(_self->ob_itself,
     673                 fHilite);
     674    Py_INCREF(Py_None);
     675    _res = Py_None;
     676    return _res;
    677677}
    678678
    679679static PyObject *WinObj_SetWRefCon(WindowObject *_self, PyObject *_args)
    680680{
    681         PyObject *_res = NULL;
    682         long data;
     681    PyObject *_res = NULL;
     682    long data;
    683683#ifndef SetWRefCon
    684         PyMac_PRECHECK(SetWRefCon);
    685 #endif
    686         if (!PyArg_ParseTuple(_args, "l",
    687                               &data))
    688                 return NULL;
    689         SetWRefCon(_self->ob_itself,
    690                    data);
    691         Py_INCREF(Py_None);
    692         _res = Py_None;
    693         return _res;
     684    PyMac_PRECHECK(SetWRefCon);
     685#endif
     686    if (!PyArg_ParseTuple(_args, "l",
     687                          &data))
     688        return NULL;
     689    SetWRefCon(_self->ob_itself,
     690               data);
     691    Py_INCREF(Py_None);
     692    _res = Py_None;
     693    return _res;
    694694}
    695695
    696696static PyObject *WinObj_GetWRefCon(WindowObject *_self, PyObject *_args)
    697697{
    698         PyObject *_res = NULL;
    699         long _rv;
     698    PyObject *_res = NULL;
     699    long _rv;
    700700#ifndef GetWRefCon
    701         PyMac_PRECHECK(GetWRefCon);
    702 #endif
    703         if (!PyArg_ParseTuple(_args, ""))
    704                 return NULL;
    705         _rv = GetWRefCon(_self->ob_itself);
    706         _res = Py_BuildValue("l",
    707                              _rv);
    708         return _res;
     701    PyMac_PRECHECK(GetWRefCon);
     702#endif
     703    if (!PyArg_ParseTuple(_args, ""))
     704        return NULL;
     705    _rv = GetWRefCon(_self->ob_itself);
     706    _res = Py_BuildValue("l",
     707                         _rv);
     708    return _res;
    709709}
    710710
    711711static PyObject *WinObj_SetWindowPic(WindowObject *_self, PyObject *_args)
    712712{
    713         PyObject *_res = NULL;
    714         PicHandle pic;
     713    PyObject *_res = NULL;
     714    PicHandle pic;
    715715#ifndef SetWindowPic
    716         PyMac_PRECHECK(SetWindowPic);
    717 #endif
    718         if (!PyArg_ParseTuple(_args, "O&",
    719                               ResObj_Convert, &pic))
    720                 return NULL;
    721         SetWindowPic(_self->ob_itself,
    722                      pic);
    723         Py_INCREF(Py_None);
    724         _res = Py_None;
    725         return _res;
     716    PyMac_PRECHECK(SetWindowPic);
     717#endif
     718    if (!PyArg_ParseTuple(_args, "O&",
     719                          ResObj_Convert, &pic))
     720        return NULL;
     721    SetWindowPic(_self->ob_itself,
     722                 pic);
     723    Py_INCREF(Py_None);
     724    _res = Py_None;
     725    return _res;
    726726}
    727727
    728728static PyObject *WinObj_GetWindowPic(WindowObject *_self, PyObject *_args)
    729729{
    730         PyObject *_res = NULL;
    731         PicHandle _rv;
     730    PyObject *_res = NULL;
     731    PicHandle _rv;
    732732#ifndef GetWindowPic
    733         PyMac_PRECHECK(GetWindowPic);
    734 #endif
    735         if (!PyArg_ParseTuple(_args, ""))
    736                 return NULL;
    737         _rv = GetWindowPic(_self->ob_itself);
    738         _res = Py_BuildValue("O&",
    739                              ResObj_New, _rv);
    740         return _res;
     733    PyMac_PRECHECK(GetWindowPic);
     734#endif
     735    if (!PyArg_ParseTuple(_args, ""))
     736        return NULL;
     737    _rv = GetWindowPic(_self->ob_itself);
     738    _res = Py_BuildValue("O&",
     739                         ResObj_New, _rv);
     740    return _res;
    741741}
    742742
    743743static PyObject *WinObj_GetWVariant(WindowObject *_self, PyObject *_args)
    744744{
    745         PyObject *_res = NULL;
    746         short _rv;
     745    PyObject *_res = NULL;
     746    short _rv;
    747747#ifndef GetWVariant
    748         PyMac_PRECHECK(GetWVariant);
    749 #endif
    750         if (!PyArg_ParseTuple(_args, ""))
    751                 return NULL;
    752         _rv = GetWVariant(_self->ob_itself);
    753         _res = Py_BuildValue("h",
    754                              _rv);
    755         return _res;
     748    PyMac_PRECHECK(GetWVariant);
     749#endif
     750    if (!PyArg_ParseTuple(_args, ""))
     751        return NULL;
     752    _rv = GetWVariant(_self->ob_itself);
     753    _res = Py_BuildValue("h",
     754                         _rv);
     755    return _res;
    756756}
    757757
    758758static PyObject *WinObj_GetWindowFeatures(WindowObject *_self, PyObject *_args)
    759759{
    760         PyObject *_res = NULL;
    761         OSStatus _err;
    762         UInt32 outFeatures;
     760    PyObject *_res = NULL;
     761    OSStatus _err;
     762    UInt32 outFeatures;
    763763#ifndef GetWindowFeatures
    764         PyMac_PRECHECK(GetWindowFeatures);
    765 #endif
    766         if (!PyArg_ParseTuple(_args, ""))
    767                 return NULL;
    768         _err = GetWindowFeatures(_self->ob_itself,
    769                                  &outFeatures);
    770         if (_err != noErr) return PyMac_Error(_err);
    771         _res = Py_BuildValue("l",
    772                              outFeatures);
    773         return _res;
     764    PyMac_PRECHECK(GetWindowFeatures);
     765#endif
     766    if (!PyArg_ParseTuple(_args, ""))
     767        return NULL;
     768    _err = GetWindowFeatures(_self->ob_itself,
     769                             &outFeatures);
     770    if (_err != noErr) return PyMac_Error(_err);
     771    _res = Py_BuildValue("l",
     772                         outFeatures);
     773    return _res;
    774774}
    775775
    776776static PyObject *WinObj_GetWindowRegion(WindowObject *_self, PyObject *_args)
    777777{
    778         PyObject *_res = NULL;
    779         OSStatus _err;
    780         WindowRegionCode inRegionCode;
    781         RgnHandle ioWinRgn;
     778    PyObject *_res = NULL;
     779    OSStatus _err;
     780    WindowRegionCode inRegionCode;
     781    RgnHandle ioWinRgn;
    782782#ifndef GetWindowRegion
    783         PyMac_PRECHECK(GetWindowRegion);
    784 #endif
    785         if (!PyArg_ParseTuple(_args, "HO&",
    786                               &inRegionCode,
    787                               ResObj_Convert, &ioWinRgn))
    788                 return NULL;
    789         _err = GetWindowRegion(_self->ob_itself,
    790                                inRegionCode,
    791                                ioWinRgn);
    792         if (_err != noErr) return PyMac_Error(_err);
    793         Py_INCREF(Py_None);
    794         _res = Py_None;
    795         return _res;
     783    PyMac_PRECHECK(GetWindowRegion);
     784#endif
     785    if (!PyArg_ParseTuple(_args, "HO&",
     786                          &inRegionCode,
     787                          ResObj_Convert, &ioWinRgn))
     788        return NULL;
     789    _err = GetWindowRegion(_self->ob_itself,
     790                           inRegionCode,
     791                           ioWinRgn);
     792    if (_err != noErr) return PyMac_Error(_err);
     793    Py_INCREF(Py_None);
     794    _res = Py_None;
     795    return _res;
    796796}
    797797
    798798static PyObject *WinObj_GetWindowStructureWidths(WindowObject *_self, PyObject *_args)
    799799{
    800         PyObject *_res = NULL;
    801         OSStatus _err;
    802         Rect outRect;
     800    PyObject *_res = NULL;
     801    OSStatus _err;
     802    Rect outRect;
    803803#ifndef GetWindowStructureWidths
    804         PyMac_PRECHECK(GetWindowStructureWidths);
    805 #endif
    806         if (!PyArg_ParseTuple(_args, ""))
    807                 return NULL;
    808         _err = GetWindowStructureWidths(_self->ob_itself,
    809                                         &outRect);
    810         if (_err != noErr) return PyMac_Error(_err);
    811         _res = Py_BuildValue("O&",
    812                              PyMac_BuildRect, &outRect);
    813         return _res;
     804    PyMac_PRECHECK(GetWindowStructureWidths);
     805#endif
     806    if (!PyArg_ParseTuple(_args, ""))
     807        return NULL;
     808    _err = GetWindowStructureWidths(_self->ob_itself,
     809                                    &outRect);
     810    if (_err != noErr) return PyMac_Error(_err);
     811    _res = Py_BuildValue("O&",
     812                         PyMac_BuildRect, &outRect);
     813    return _res;
    814814}
    815815
    816816static PyObject *WinObj_BeginUpdate(WindowObject *_self, PyObject *_args)
    817817{
    818         PyObject *_res = NULL;
     818    PyObject *_res = NULL;
    819819#ifndef BeginUpdate
    820         PyMac_PRECHECK(BeginUpdate);
    821 #endif
    822         if (!PyArg_ParseTuple(_args, ""))
    823                 return NULL;
    824         BeginUpdate(_self->ob_itself);
    825         Py_INCREF(Py_None);
    826         _res = Py_None;
    827         return _res;
     820    PyMac_PRECHECK(BeginUpdate);
     821#endif
     822    if (!PyArg_ParseTuple(_args, ""))
     823        return NULL;
     824    BeginUpdate(_self->ob_itself);
     825    Py_INCREF(Py_None);
     826    _res = Py_None;
     827    return _res;
    828828}
    829829
    830830static PyObject *WinObj_EndUpdate(WindowObject *_self, PyObject *_args)
    831831{
    832         PyObject *_res = NULL;
     832    PyObject *_res = NULL;
    833833#ifndef EndUpdate
    834         PyMac_PRECHECK(EndUpdate);
    835 #endif
    836         if (!PyArg_ParseTuple(_args, ""))
    837                 return NULL;
    838         EndUpdate(_self->ob_itself);
    839         Py_INCREF(Py_None);
    840         _res = Py_None;
    841         return _res;
     834    PyMac_PRECHECK(EndUpdate);
     835#endif
     836    if (!PyArg_ParseTuple(_args, ""))
     837        return NULL;
     838    EndUpdate(_self->ob_itself);
     839    Py_INCREF(Py_None);
     840    _res = Py_None;
     841    return _res;
    842842}
    843843
    844844static PyObject *WinObj_InvalWindowRgn(WindowObject *_self, PyObject *_args)
    845845{
    846         PyObject *_res = NULL;
    847         OSStatus _err;
    848         RgnHandle region;
     846    PyObject *_res = NULL;
     847    OSStatus _err;
     848    RgnHandle region;
    849849#ifndef InvalWindowRgn
    850         PyMac_PRECHECK(InvalWindowRgn);
    851 #endif
    852         if (!PyArg_ParseTuple(_args, "O&",
    853                               ResObj_Convert, &region))
    854                 return NULL;
    855         _err = InvalWindowRgn(_self->ob_itself,
    856                               region);
    857         if (_err != noErr) return PyMac_Error(_err);
    858         Py_INCREF(Py_None);
    859         _res = Py_None;
    860         return _res;
     850    PyMac_PRECHECK(InvalWindowRgn);
     851#endif
     852    if (!PyArg_ParseTuple(_args, "O&",
     853                          ResObj_Convert, &region))
     854        return NULL;
     855    _err = InvalWindowRgn(_self->ob_itself,
     856                          region);
     857    if (_err != noErr) return PyMac_Error(_err);
     858    Py_INCREF(Py_None);
     859    _res = Py_None;
     860    return _res;
    861861}
    862862
    863863static PyObject *WinObj_InvalWindowRect(WindowObject *_self, PyObject *_args)
    864864{
    865         PyObject *_res = NULL;
    866         OSStatus _err;
    867         Rect bounds;
     865    PyObject *_res = NULL;
     866    OSStatus _err;
     867    Rect bounds;
    868868#ifndef InvalWindowRect
    869         PyMac_PRECHECK(InvalWindowRect);
    870 #endif
    871         if (!PyArg_ParseTuple(_args, "O&",
    872                               PyMac_GetRect, &bounds))
    873                 return NULL;
    874         _err = InvalWindowRect(_self->ob_itself,
    875                                &bounds);
    876         if (_err != noErr) return PyMac_Error(_err);
    877         Py_INCREF(Py_None);
    878         _res = Py_None;
    879         return _res;
     869    PyMac_PRECHECK(InvalWindowRect);
     870#endif
     871    if (!PyArg_ParseTuple(_args, "O&",
     872                          PyMac_GetRect, &bounds))
     873        return NULL;
     874    _err = InvalWindowRect(_self->ob_itself,
     875                           &bounds);
     876    if (_err != noErr) return PyMac_Error(_err);
     877    Py_INCREF(Py_None);
     878    _res = Py_None;
     879    return _res;
    880880}
    881881
    882882static PyObject *WinObj_ValidWindowRgn(WindowObject *_self, PyObject *_args)
    883883{
    884         PyObject *_res = NULL;
    885         OSStatus _err;
    886         RgnHandle region;
     884    PyObject *_res = NULL;
     885    OSStatus _err;
     886    RgnHandle region;
    887887#ifndef ValidWindowRgn
    888         PyMac_PRECHECK(ValidWindowRgn);
    889 #endif
    890         if (!PyArg_ParseTuple(_args, "O&",
    891                               ResObj_Convert, &region))
    892                 return NULL;
    893         _err = ValidWindowRgn(_self->ob_itself,
    894                               region);
    895         if (_err != noErr) return PyMac_Error(_err);
    896         Py_INCREF(Py_None);
    897         _res = Py_None;
    898         return _res;
     888    PyMac_PRECHECK(ValidWindowRgn);
     889#endif
     890    if (!PyArg_ParseTuple(_args, "O&",
     891                          ResObj_Convert, &region))
     892        return NULL;
     893    _err = ValidWindowRgn(_self->ob_itself,
     894                          region);
     895    if (_err != noErr) return PyMac_Error(_err);
     896    Py_INCREF(Py_None);
     897    _res = Py_None;
     898    return _res;
    899899}
    900900
    901901static PyObject *WinObj_ValidWindowRect(WindowObject *_self, PyObject *_args)
    902902{
    903         PyObject *_res = NULL;
    904         OSStatus _err;
    905         Rect bounds;
     903    PyObject *_res = NULL;
     904    OSStatus _err;
     905    Rect bounds;
    906906#ifndef ValidWindowRect
    907         PyMac_PRECHECK(ValidWindowRect);
    908 #endif
    909         if (!PyArg_ParseTuple(_args, "O&",
    910                               PyMac_GetRect, &bounds))
    911                 return NULL;
    912         _err = ValidWindowRect(_self->ob_itself,
    913                                &bounds);
    914         if (_err != noErr) return PyMac_Error(_err);
    915         Py_INCREF(Py_None);
    916         _res = Py_None;
    917         return _res;
     907    PyMac_PRECHECK(ValidWindowRect);
     908#endif
     909    if (!PyArg_ParseTuple(_args, "O&",
     910                          PyMac_GetRect, &bounds))
     911        return NULL;
     912    _err = ValidWindowRect(_self->ob_itself,
     913                           &bounds);
     914    if (_err != noErr) return PyMac_Error(_err);
     915    Py_INCREF(Py_None);
     916    _res = Py_None;
     917    return _res;
    918918}
    919919
    920920static PyObject *WinObj_DrawGrowIcon(WindowObject *_self, PyObject *_args)
    921921{
    922         PyObject *_res = NULL;
     922    PyObject *_res = NULL;
    923923#ifndef DrawGrowIcon
    924         PyMac_PRECHECK(DrawGrowIcon);
    925 #endif
    926         if (!PyArg_ParseTuple(_args, ""))
    927                 return NULL;
    928         DrawGrowIcon(_self->ob_itself);
    929         Py_INCREF(Py_None);
    930         _res = Py_None;
    931         return _res;
     924    PyMac_PRECHECK(DrawGrowIcon);
     925#endif
     926    if (!PyArg_ParseTuple(_args, ""))
     927        return NULL;
     928    DrawGrowIcon(_self->ob_itself);
     929    Py_INCREF(Py_None);
     930    _res = Py_None;
     931    return _res;
    932932}
    933933
    934934static PyObject *WinObj_SetWTitle(WindowObject *_self, PyObject *_args)
    935935{
    936         PyObject *_res = NULL;
    937         Str255 title;
     936    PyObject *_res = NULL;
     937    Str255 title;
    938938#ifndef SetWTitle
    939         PyMac_PRECHECK(SetWTitle);
    940 #endif
    941         if (!PyArg_ParseTuple(_args, "O&",
    942                               PyMac_GetStr255, title))
    943                 return NULL;
    944         SetWTitle(_self->ob_itself,
    945                   title);
    946         Py_INCREF(Py_None);
    947         _res = Py_None;
    948         return _res;
     939    PyMac_PRECHECK(SetWTitle);
     940#endif
     941    if (!PyArg_ParseTuple(_args, "O&",
     942                          PyMac_GetStr255, title))
     943        return NULL;
     944    SetWTitle(_self->ob_itself,
     945              title);
     946    Py_INCREF(Py_None);
     947    _res = Py_None;
     948    return _res;
    949949}
    950950
    951951static PyObject *WinObj_GetWTitle(WindowObject *_self, PyObject *_args)
    952952{
    953         PyObject *_res = NULL;
    954         Str255 title;
     953    PyObject *_res = NULL;
     954    Str255 title;
    955955#ifndef GetWTitle
    956         PyMac_PRECHECK(GetWTitle);
    957 #endif
    958         if (!PyArg_ParseTuple(_args, ""))
    959                 return NULL;
    960         GetWTitle(_self->ob_itself,
    961                   title);
    962         _res = Py_BuildValue("O&",
    963                              PyMac_BuildStr255, title);
    964         return _res;
     956    PyMac_PRECHECK(GetWTitle);
     957#endif
     958    if (!PyArg_ParseTuple(_args, ""))
     959        return NULL;
     960    GetWTitle(_self->ob_itself,
     961              title);
     962    _res = Py_BuildValue("O&",
     963                         PyMac_BuildStr255, title);
     964    return _res;
    965965}
    966966
    967967static PyObject *WinObj_SetWindowTitleWithCFString(WindowObject *_self, PyObject *_args)
    968968{
    969         PyObject *_res = NULL;
    970         OSStatus _err;
    971         CFStringRef inString;
     969    PyObject *_res = NULL;
     970    OSStatus _err;
     971    CFStringRef inString;
    972972#ifndef SetWindowTitleWithCFString
    973         PyMac_PRECHECK(SetWindowTitleWithCFString);
    974 #endif
    975         if (!PyArg_ParseTuple(_args, "O&",
    976                               CFStringRefObj_Convert, &inString))
    977                 return NULL;
    978         _err = SetWindowTitleWithCFString(_self->ob_itself,
    979                                           inString);
    980         if (_err != noErr) return PyMac_Error(_err);
    981         Py_INCREF(Py_None);
    982         _res = Py_None;
    983         return _res;
     973    PyMac_PRECHECK(SetWindowTitleWithCFString);
     974#endif
     975    if (!PyArg_ParseTuple(_args, "O&",
     976                          CFStringRefObj_Convert, &inString))
     977        return NULL;
     978    _err = SetWindowTitleWithCFString(_self->ob_itself,
     979                                      inString);
     980    if (_err != noErr) return PyMac_Error(_err);
     981    Py_INCREF(Py_None);
     982    _res = Py_None;
     983    return _res;
    984984}
    985985
    986986static PyObject *WinObj_CopyWindowTitleAsCFString(WindowObject *_self, PyObject *_args)
    987987{
    988         PyObject *_res = NULL;
    989         OSStatus _err;
    990         CFStringRef outString;
     988    PyObject *_res = NULL;
     989    OSStatus _err;
     990    CFStringRef outString;
    991991#ifndef CopyWindowTitleAsCFString
    992         PyMac_PRECHECK(CopyWindowTitleAsCFString);
    993 #endif
    994         if (!PyArg_ParseTuple(_args, ""))
    995                 return NULL;
    996         _err = CopyWindowTitleAsCFString(_self->ob_itself,
    997                                          &outString);
    998         if (_err != noErr) return PyMac_Error(_err);
    999         _res = Py_BuildValue("O&",
    1000                              CFStringRefObj_New, outString);
    1001         return _res;
     992    PyMac_PRECHECK(CopyWindowTitleAsCFString);
     993#endif
     994    if (!PyArg_ParseTuple(_args, ""))
     995        return NULL;
     996    _err = CopyWindowTitleAsCFString(_self->ob_itself,
     997                                     &outString);
     998    if (_err != noErr) return PyMac_Error(_err);
     999    _res = Py_BuildValue("O&",
     1000                         CFStringRefObj_New, outString);
     1001    return _res;
    10021002}
    10031003
    10041004static PyObject *WinObj_SetWindowProxyFSSpec(WindowObject *_self, PyObject *_args)
    10051005{
    1006         PyObject *_res = NULL;
    1007         OSStatus _err;
    1008         FSSpec inFile;
     1006    PyObject *_res = NULL;
     1007    OSStatus _err;
     1008    FSSpec inFile;
    10091009#ifndef SetWindowProxyFSSpec
    1010         PyMac_PRECHECK(SetWindowProxyFSSpec);
    1011 #endif
    1012         if (!PyArg_ParseTuple(_args, "O&",
    1013                               PyMac_GetFSSpec, &inFile))
    1014                 return NULL;
    1015         _err = SetWindowProxyFSSpec(_self->ob_itself,
    1016                                     &inFile);
    1017         if (_err != noErr) return PyMac_Error(_err);
    1018         Py_INCREF(Py_None);
    1019         _res = Py_None;
    1020         return _res;
     1010    PyMac_PRECHECK(SetWindowProxyFSSpec);
     1011#endif
     1012    if (!PyArg_ParseTuple(_args, "O&",
     1013                          PyMac_GetFSSpec, &inFile))
     1014        return NULL;
     1015    _err = SetWindowProxyFSSpec(_self->ob_itself,
     1016                                &inFile);
     1017    if (_err != noErr) return PyMac_Error(_err);
     1018    Py_INCREF(Py_None);
     1019    _res = Py_None;
     1020    return _res;
    10211021}
    10221022
    10231023static PyObject *WinObj_GetWindowProxyFSSpec(WindowObject *_self, PyObject *_args)
    10241024{
    1025         PyObject *_res = NULL;
    1026         OSStatus _err;
    1027         FSSpec outFile;
     1025    PyObject *_res = NULL;
     1026    OSStatus _err;
     1027    FSSpec outFile;
    10281028#ifndef GetWindowProxyFSSpec
    1029         PyMac_PRECHECK(GetWindowProxyFSSpec);
    1030 #endif
    1031         if (!PyArg_ParseTuple(_args, ""))
    1032                 return NULL;
    1033         _err = GetWindowProxyFSSpec(_self->ob_itself,
    1034                                     &outFile);
    1035         if (_err != noErr) return PyMac_Error(_err);
    1036         _res = Py_BuildValue("O&",
    1037                              PyMac_BuildFSSpec, &outFile);
    1038         return _res;
     1029    PyMac_PRECHECK(GetWindowProxyFSSpec);
     1030#endif
     1031    if (!PyArg_ParseTuple(_args, ""))
     1032        return NULL;
     1033    _err = GetWindowProxyFSSpec(_self->ob_itself,
     1034                                &outFile);
     1035    if (_err != noErr) return PyMac_Error(_err);
     1036    _res = Py_BuildValue("O&",
     1037                         PyMac_BuildFSSpec, &outFile);
     1038    return _res;
    10391039}
    10401040
    10411041static PyObject *WinObj_SetWindowProxyAlias(WindowObject *_self, PyObject *_args)
    10421042{
    1043         PyObject *_res = NULL;
    1044         OSStatus _err;
    1045         AliasHandle inAlias;
     1043    PyObject *_res = NULL;
     1044    OSStatus _err;
     1045    AliasHandle inAlias;
    10461046#ifndef SetWindowProxyAlias
    1047         PyMac_PRECHECK(SetWindowProxyAlias);
    1048 #endif
    1049         if (!PyArg_ParseTuple(_args, "O&",
    1050                               ResObj_Convert, &inAlias))
    1051                 return NULL;
    1052         _err = SetWindowProxyAlias(_self->ob_itself,
    1053                                    inAlias);
    1054         if (_err != noErr) return PyMac_Error(_err);
    1055         Py_INCREF(Py_None);
    1056         _res = Py_None;
    1057         return _res;
     1047    PyMac_PRECHECK(SetWindowProxyAlias);
     1048#endif
     1049    if (!PyArg_ParseTuple(_args, "O&",
     1050                          ResObj_Convert, &inAlias))
     1051        return NULL;
     1052    _err = SetWindowProxyAlias(_self->ob_itself,
     1053                               inAlias);
     1054    if (_err != noErr) return PyMac_Error(_err);
     1055    Py_INCREF(Py_None);
     1056    _res = Py_None;
     1057    return _res;
    10581058}
    10591059
    10601060static PyObject *WinObj_GetWindowProxyAlias(WindowObject *_self, PyObject *_args)
    10611061{
    1062         PyObject *_res = NULL;
    1063         OSStatus _err;
    1064         AliasHandle alias;
     1062    PyObject *_res = NULL;
     1063    OSStatus _err;
     1064    AliasHandle alias;
    10651065#ifndef GetWindowProxyAlias
    1066         PyMac_PRECHECK(GetWindowProxyAlias);
    1067 #endif
    1068         if (!PyArg_ParseTuple(_args, ""))
    1069                 return NULL;
    1070         _err = GetWindowProxyAlias(_self->ob_itself,
    1071                                    &alias);
    1072         if (_err != noErr) return PyMac_Error(_err);
    1073         _res = Py_BuildValue("O&",
    1074                              ResObj_New, alias);
    1075         return _res;
     1066    PyMac_PRECHECK(GetWindowProxyAlias);
     1067#endif
     1068    if (!PyArg_ParseTuple(_args, ""))
     1069        return NULL;
     1070    _err = GetWindowProxyAlias(_self->ob_itself,
     1071                               &alias);
     1072    if (_err != noErr) return PyMac_Error(_err);
     1073    _res = Py_BuildValue("O&",
     1074                         ResObj_New, alias);
     1075    return _res;
    10761076}
    10771077
    10781078static PyObject *WinObj_SetWindowProxyCreatorAndType(WindowObject *_self, PyObject *_args)
    10791079{
    1080         PyObject *_res = NULL;
    1081         OSStatus _err;
    1082         OSType fileCreator;
    1083         OSType fileType;
    1084         SInt16 vRefNum;
     1080    PyObject *_res = NULL;
     1081    OSStatus _err;
     1082    OSType fileCreator;
     1083    OSType fileType;
     1084    SInt16 vRefNum;
    10851085#ifndef SetWindowProxyCreatorAndType
    1086         PyMac_PRECHECK(SetWindowProxyCreatorAndType);
    1087 #endif
    1088         if (!PyArg_ParseTuple(_args, "O&O&h",
    1089                               PyMac_GetOSType, &fileCreator,
    1090                               PyMac_GetOSType, &fileType,
    1091                               &vRefNum))
    1092                 return NULL;
    1093         _err = SetWindowProxyCreatorAndType(_self->ob_itself,
    1094                                             fileCreator,
    1095                                             fileType,
    1096                                             vRefNum);
    1097         if (_err != noErr) return PyMac_Error(_err);
    1098         Py_INCREF(Py_None);
    1099         _res = Py_None;
    1100         return _res;
     1086    PyMac_PRECHECK(SetWindowProxyCreatorAndType);
     1087#endif
     1088    if (!PyArg_ParseTuple(_args, "O&O&h",
     1089                          PyMac_GetOSType, &fileCreator,
     1090                          PyMac_GetOSType, &fileType,
     1091                          &vRefNum))
     1092        return NULL;
     1093    _err = SetWindowProxyCreatorAndType(_self->ob_itself,
     1094                                        fileCreator,
     1095                                        fileType,
     1096                                        vRefNum);
     1097    if (_err != noErr) return PyMac_Error(_err);
     1098    Py_INCREF(Py_None);
     1099    _res = Py_None;
     1100    return _res;
    11011101}
    11021102
    11031103static PyObject *WinObj_GetWindowProxyIcon(WindowObject *_self, PyObject *_args)
    11041104{
    1105         PyObject *_res = NULL;
    1106         OSStatus _err;
    1107         IconRef outIcon;
     1105    PyObject *_res = NULL;
     1106    OSStatus _err;
     1107    IconRef outIcon;
    11081108#ifndef GetWindowProxyIcon
    1109         PyMac_PRECHECK(GetWindowProxyIcon);
    1110 #endif
    1111         if (!PyArg_ParseTuple(_args, ""))
    1112                 return NULL;
    1113         _err = GetWindowProxyIcon(_self->ob_itself,
    1114                                   &outIcon);
    1115         if (_err != noErr) return PyMac_Error(_err);
    1116         _res = Py_BuildValue("O&",
    1117                              ResObj_New, outIcon);
    1118         return _res;
     1109    PyMac_PRECHECK(GetWindowProxyIcon);
     1110#endif
     1111    if (!PyArg_ParseTuple(_args, ""))
     1112        return NULL;
     1113    _err = GetWindowProxyIcon(_self->ob_itself,
     1114                              &outIcon);
     1115    if (_err != noErr) return PyMac_Error(_err);
     1116    _res = Py_BuildValue("O&",
     1117                         ResObj_New, outIcon);
     1118    return _res;
    11191119}
    11201120
    11211121static PyObject *WinObj_SetWindowProxyIcon(WindowObject *_self, PyObject *_args)
    11221122{
    1123         PyObject *_res = NULL;
    1124         OSStatus _err;
    1125         IconRef icon;
     1123    PyObject *_res = NULL;
     1124    OSStatus _err;
     1125    IconRef icon;
    11261126#ifndef SetWindowProxyIcon
    1127         PyMac_PRECHECK(SetWindowProxyIcon);
    1128 #endif
    1129         if (!PyArg_ParseTuple(_args, "O&",
    1130                               ResObj_Convert, &icon))
    1131                 return NULL;
    1132         _err = SetWindowProxyIcon(_self->ob_itself,
    1133                                   icon);
    1134         if (_err != noErr) return PyMac_Error(_err);
    1135         Py_INCREF(Py_None);
    1136         _res = Py_None;
    1137         return _res;
     1127    PyMac_PRECHECK(SetWindowProxyIcon);
     1128#endif
     1129    if (!PyArg_ParseTuple(_args, "O&",
     1130                          ResObj_Convert, &icon))
     1131        return NULL;
     1132    _err = SetWindowProxyIcon(_self->ob_itself,
     1133                              icon);
     1134    if (_err != noErr) return PyMac_Error(_err);
     1135    Py_INCREF(Py_None);
     1136    _res = Py_None;
     1137    return _res;
    11381138}
    11391139
    11401140static PyObject *WinObj_RemoveWindowProxy(WindowObject *_self, PyObject *_args)
    11411141{
    1142         PyObject *_res = NULL;
    1143         OSStatus _err;
     1142    PyObject *_res = NULL;
     1143    OSStatus _err;
    11441144#ifndef RemoveWindowProxy
    1145         PyMac_PRECHECK(RemoveWindowProxy);
    1146 #endif
    1147         if (!PyArg_ParseTuple(_args, ""))
    1148                 return NULL;
    1149         _err = RemoveWindowProxy(_self->ob_itself);
    1150         if (_err != noErr) return PyMac_Error(_err);
    1151         Py_INCREF(Py_None);
    1152         _res = Py_None;
    1153         return _res;
     1145    PyMac_PRECHECK(RemoveWindowProxy);
     1146#endif
     1147    if (!PyArg_ParseTuple(_args, ""))
     1148        return NULL;
     1149    _err = RemoveWindowProxy(_self->ob_itself);
     1150    if (_err != noErr) return PyMac_Error(_err);
     1151    Py_INCREF(Py_None);
     1152    _res = Py_None;
     1153    return _res;
    11541154}
    11551155
    11561156static PyObject *WinObj_BeginWindowProxyDrag(WindowObject *_self, PyObject *_args)
    11571157{
    1158         PyObject *_res = NULL;
    1159         OSStatus _err;
    1160         DragReference outNewDrag;
    1161         RgnHandle outDragOutlineRgn;
     1158    PyObject *_res = NULL;
     1159    OSStatus _err;
     1160    DragReference outNewDrag;
     1161    RgnHandle outDragOutlineRgn;
    11621162#ifndef BeginWindowProxyDrag
    1163         PyMac_PRECHECK(BeginWindowProxyDrag);
    1164 #endif
    1165         if (!PyArg_ParseTuple(_args, "O&",
    1166                               ResObj_Convert, &outDragOutlineRgn))
    1167                 return NULL;
    1168         _err = BeginWindowProxyDrag(_self->ob_itself,
    1169                                     &outNewDrag,
    1170                                     outDragOutlineRgn);
    1171         if (_err != noErr) return PyMac_Error(_err);
    1172         _res = Py_BuildValue("O&",
    1173                              DragObj_New, outNewDrag);
    1174         return _res;
     1163    PyMac_PRECHECK(BeginWindowProxyDrag);
     1164#endif
     1165    if (!PyArg_ParseTuple(_args, "O&",
     1166                          ResObj_Convert, &outDragOutlineRgn))
     1167        return NULL;
     1168    _err = BeginWindowProxyDrag(_self->ob_itself,
     1169                                &outNewDrag,
     1170                                outDragOutlineRgn);
     1171    if (_err != noErr) return PyMac_Error(_err);
     1172    _res = Py_BuildValue("O&",
     1173                         DragObj_New, outNewDrag);
     1174    return _res;
    11751175}
    11761176
    11771177static PyObject *WinObj_EndWindowProxyDrag(WindowObject *_self, PyObject *_args)
    11781178{
    1179         PyObject *_res = NULL;
    1180         OSStatus _err;
    1181         DragReference theDrag;
     1179    PyObject *_res = NULL;
     1180    OSStatus _err;
     1181    DragReference theDrag;
    11821182#ifndef EndWindowProxyDrag
    1183         PyMac_PRECHECK(EndWindowProxyDrag);
    1184 #endif
    1185         if (!PyArg_ParseTuple(_args, "O&",
    1186                               DragObj_Convert, &theDrag))
    1187                 return NULL;
    1188         _err = EndWindowProxyDrag(_self->ob_itself,
    1189                                   theDrag);
    1190         if (_err != noErr) return PyMac_Error(_err);
    1191         Py_INCREF(Py_None);
    1192         _res = Py_None;
    1193         return _res;
     1183    PyMac_PRECHECK(EndWindowProxyDrag);
     1184#endif
     1185    if (!PyArg_ParseTuple(_args, "O&",
     1186                          DragObj_Convert, &theDrag))
     1187        return NULL;
     1188    _err = EndWindowProxyDrag(_self->ob_itself,
     1189                              theDrag);
     1190    if (_err != noErr) return PyMac_Error(_err);
     1191    Py_INCREF(Py_None);
     1192    _res = Py_None;
     1193    return _res;
    11941194}
    11951195
    11961196static PyObject *WinObj_TrackWindowProxyFromExistingDrag(WindowObject *_self, PyObject *_args)
    11971197{
    1198         PyObject *_res = NULL;
    1199         OSStatus _err;
    1200         Point startPt;
    1201         DragReference drag;
    1202         RgnHandle inDragOutlineRgn;
     1198    PyObject *_res = NULL;
     1199    OSStatus _err;
     1200    Point startPt;
     1201    DragReference drag;
     1202    RgnHandle inDragOutlineRgn;
    12031203#ifndef TrackWindowProxyFromExistingDrag
    1204         PyMac_PRECHECK(TrackWindowProxyFromExistingDrag);
    1205 #endif
    1206         if (!PyArg_ParseTuple(_args, "O&O&O&",
    1207                               PyMac_GetPoint, &startPt,
    1208                               DragObj_Convert, &drag,
    1209                               ResObj_Convert, &inDragOutlineRgn))
    1210                 return NULL;
    1211         _err = TrackWindowProxyFromExistingDrag(_self->ob_itself,
    1212                                                 startPt,
    1213                                                 drag,
    1214                                                 inDragOutlineRgn);
    1215         if (_err != noErr) return PyMac_Error(_err);
    1216         Py_INCREF(Py_None);
    1217         _res = Py_None;
    1218         return _res;
     1204    PyMac_PRECHECK(TrackWindowProxyFromExistingDrag);
     1205#endif
     1206    if (!PyArg_ParseTuple(_args, "O&O&O&",
     1207                          PyMac_GetPoint, &startPt,
     1208                          DragObj_Convert, &drag,
     1209                          ResObj_Convert, &inDragOutlineRgn))
     1210        return NULL;
     1211    _err = TrackWindowProxyFromExistingDrag(_self->ob_itself,
     1212                                            startPt,
     1213                                            drag,
     1214                                            inDragOutlineRgn);
     1215    if (_err != noErr) return PyMac_Error(_err);
     1216    Py_INCREF(Py_None);
     1217    _res = Py_None;
     1218    return _res;
    12191219}
    12201220
    12211221static PyObject *WinObj_TrackWindowProxyDrag(WindowObject *_self, PyObject *_args)
    12221222{
    1223         PyObject *_res = NULL;
    1224         OSStatus _err;
    1225         Point startPt;
     1223    PyObject *_res = NULL;
     1224    OSStatus _err;
     1225    Point startPt;
    12261226#ifndef TrackWindowProxyDrag
    1227         PyMac_PRECHECK(TrackWindowProxyDrag);
    1228 #endif
    1229         if (!PyArg_ParseTuple(_args, "O&",
    1230                               PyMac_GetPoint, &startPt))
    1231                 return NULL;
    1232         _err = TrackWindowProxyDrag(_self->ob_itself,
    1233                                     startPt);
    1234         if (_err != noErr) return PyMac_Error(_err);
    1235         Py_INCREF(Py_None);
    1236         _res = Py_None;
    1237         return _res;
     1227    PyMac_PRECHECK(TrackWindowProxyDrag);
     1228#endif
     1229    if (!PyArg_ParseTuple(_args, "O&",
     1230                          PyMac_GetPoint, &startPt))
     1231        return NULL;
     1232    _err = TrackWindowProxyDrag(_self->ob_itself,
     1233                                startPt);
     1234    if (_err != noErr) return PyMac_Error(_err);
     1235    Py_INCREF(Py_None);
     1236    _res = Py_None;
     1237    return _res;
    12381238}
    12391239
    12401240static PyObject *WinObj_IsWindowModified(WindowObject *_self, PyObject *_args)
    12411241{
    1242         PyObject *_res = NULL;
    1243         Boolean _rv;
     1242    PyObject *_res = NULL;
     1243    Boolean _rv;
    12441244#ifndef IsWindowModified
    1245         PyMac_PRECHECK(IsWindowModified);
    1246 #endif
    1247         if (!PyArg_ParseTuple(_args, ""))
    1248                 return NULL;
    1249         _rv = IsWindowModified(_self->ob_itself);
    1250         _res = Py_BuildValue("b",
    1251                              _rv);
    1252         return _res;
     1245    PyMac_PRECHECK(IsWindowModified);
     1246#endif
     1247    if (!PyArg_ParseTuple(_args, ""))
     1248        return NULL;
     1249    _rv = IsWindowModified(_self->ob_itself);
     1250    _res = Py_BuildValue("b",
     1251                         _rv);
     1252    return _res;
    12531253}
    12541254
    12551255static PyObject *WinObj_SetWindowModified(WindowObject *_self, PyObject *_args)
    12561256{
    1257         PyObject *_res = NULL;
    1258         OSStatus _err;
    1259         Boolean modified;
     1257    PyObject *_res = NULL;
     1258    OSStatus _err;
     1259    Boolean modified;
    12601260#ifndef SetWindowModified
    1261         PyMac_PRECHECK(SetWindowModified);
    1262 #endif
    1263         if (!PyArg_ParseTuple(_args, "b",
    1264                               &modified))
    1265                 return NULL;
    1266         _err = SetWindowModified(_self->ob_itself,
    1267                                  modified);
    1268         if (_err != noErr) return PyMac_Error(_err);
    1269         Py_INCREF(Py_None);
    1270         _res = Py_None;
    1271         return _res;
     1261    PyMac_PRECHECK(SetWindowModified);
     1262#endif
     1263    if (!PyArg_ParseTuple(_args, "b",
     1264                          &modified))
     1265        return NULL;
     1266    _err = SetWindowModified(_self->ob_itself,
     1267                             modified);
     1268    if (_err != noErr) return PyMac_Error(_err);
     1269    Py_INCREF(Py_None);
     1270    _res = Py_None;
     1271    return _res;
    12721272}
    12731273
    12741274static PyObject *WinObj_IsWindowPathSelectClick(WindowObject *_self, PyObject *_args)
    12751275{
    1276         PyObject *_res = NULL;
    1277         Boolean _rv;
    1278         EventRecord event;
     1276    PyObject *_res = NULL;
     1277    Boolean _rv;
     1278    EventRecord event;
    12791279#ifndef IsWindowPathSelectClick
    1280         PyMac_PRECHECK(IsWindowPathSelectClick);
    1281 #endif
    1282         if (!PyArg_ParseTuple(_args, "O&",
    1283                               PyMac_GetEventRecord, &event))
    1284                 return NULL;
    1285         _rv = IsWindowPathSelectClick(_self->ob_itself,
    1286                                       &event);
    1287         _res = Py_BuildValue("b",
    1288                              _rv);
    1289         return _res;
     1280    PyMac_PRECHECK(IsWindowPathSelectClick);
     1281#endif
     1282    if (!PyArg_ParseTuple(_args, "O&",
     1283                          PyMac_GetEventRecord, &event))
     1284        return NULL;
     1285    _rv = IsWindowPathSelectClick(_self->ob_itself,
     1286                                  &event);
     1287    _res = Py_BuildValue("b",
     1288                         _rv);
     1289    return _res;
    12901290}
    12911291
    12921292static PyObject *WinObj_WindowPathSelect(WindowObject *_self, PyObject *_args)
    12931293{
    1294         PyObject *_res = NULL;
    1295         OSStatus _err;
    1296         MenuHandle menu;
    1297         SInt32 outMenuResult;
     1294    PyObject *_res = NULL;
     1295    OSStatus _err;
     1296    MenuHandle menu;
     1297    SInt32 outMenuResult;
    12981298#ifndef WindowPathSelect
    1299         PyMac_PRECHECK(WindowPathSelect);
    1300 #endif
    1301         if (!PyArg_ParseTuple(_args, "O&",
    1302                               MenuObj_Convert, &menu))
    1303                 return NULL;
    1304         _err = WindowPathSelect(_self->ob_itself,
    1305                                 menu,
    1306                                 &outMenuResult);
    1307         if (_err != noErr) return PyMac_Error(_err);
    1308         _res = Py_BuildValue("l",
    1309                              outMenuResult);
    1310         return _res;
     1299    PyMac_PRECHECK(WindowPathSelect);
     1300#endif
     1301    if (!PyArg_ParseTuple(_args, "O&",
     1302                          MenuObj_Convert, &menu))
     1303        return NULL;
     1304    _err = WindowPathSelect(_self->ob_itself,
     1305                            menu,
     1306                            &outMenuResult);
     1307    if (_err != noErr) return PyMac_Error(_err);
     1308    _res = Py_BuildValue("l",
     1309                         outMenuResult);
     1310    return _res;
    13111311}
    13121312
    13131313static PyObject *WinObj_HiliteWindowFrameForDrag(WindowObject *_self, PyObject *_args)
    13141314{
    1315         PyObject *_res = NULL;
    1316         OSStatus _err;
    1317         Boolean hilited;
     1315    PyObject *_res = NULL;
     1316    OSStatus _err;
     1317    Boolean hilited;
    13181318#ifndef HiliteWindowFrameForDrag
    1319         PyMac_PRECHECK(HiliteWindowFrameForDrag);
    1320 #endif
    1321         if (!PyArg_ParseTuple(_args, "b",
    1322                               &hilited))
    1323                 return NULL;
    1324         _err = HiliteWindowFrameForDrag(_self->ob_itself,
    1325                                         hilited);
    1326         if (_err != noErr) return PyMac_Error(_err);
    1327         Py_INCREF(Py_None);
    1328         _res = Py_None;
    1329         return _res;
     1319    PyMac_PRECHECK(HiliteWindowFrameForDrag);
     1320#endif
     1321    if (!PyArg_ParseTuple(_args, "b",
     1322                          &hilited))
     1323        return NULL;
     1324    _err = HiliteWindowFrameForDrag(_self->ob_itself,
     1325                                    hilited);
     1326    if (_err != noErr) return PyMac_Error(_err);
     1327    Py_INCREF(Py_None);
     1328    _res = Py_None;
     1329    return _res;
    13301330}
    13311331
    13321332static PyObject *WinObj_TransitionWindow(WindowObject *_self, PyObject *_args)
    13331333{
    1334         PyObject *_res = NULL;
    1335         OSStatus _err;
    1336         WindowTransitionEffect inEffect;
    1337         WindowTransitionAction inAction;
    1338         Rect inRect;
     1334    PyObject *_res = NULL;
     1335    OSStatus _err;
     1336    WindowTransitionEffect inEffect;
     1337    WindowTransitionAction inAction;
     1338    Rect inRect;
    13391339#ifndef TransitionWindow
    1340         PyMac_PRECHECK(TransitionWindow);
    1341 #endif
    1342         if (!PyArg_ParseTuple(_args, "llO&",
    1343                               &inEffect,
    1344                               &inAction,
    1345                               PyMac_GetRect, &inRect))
    1346                 return NULL;
    1347         _err = TransitionWindow(_self->ob_itself,
    1348                                 inEffect,
    1349                                 inAction,
    1350                                 &inRect);
    1351         if (_err != noErr) return PyMac_Error(_err);
    1352         Py_INCREF(Py_None);
    1353         _res = Py_None;
    1354         return _res;
     1340    PyMac_PRECHECK(TransitionWindow);
     1341#endif
     1342    if (!PyArg_ParseTuple(_args, "llO&",
     1343                          &inEffect,
     1344                          &inAction,
     1345                          PyMac_GetRect, &inRect))
     1346        return NULL;
     1347    _err = TransitionWindow(_self->ob_itself,
     1348                            inEffect,
     1349                            inAction,
     1350                            &inRect);
     1351    if (_err != noErr) return PyMac_Error(_err);
     1352    Py_INCREF(Py_None);
     1353    _res = Py_None;
     1354    return _res;
    13551355}
    13561356
    13571357static PyObject *WinObj_TransitionWindowAndParent(WindowObject *_self, PyObject *_args)
    13581358{
    1359         PyObject *_res = NULL;
    1360         OSStatus _err;
    1361         WindowPtr inParentWindow;
    1362         WindowTransitionEffect inEffect;
    1363         WindowTransitionAction inAction;
    1364         Rect inRect;
     1359    PyObject *_res = NULL;
     1360    OSStatus _err;
     1361    WindowPtr inParentWindow;
     1362    WindowTransitionEffect inEffect;
     1363    WindowTransitionAction inAction;
     1364    Rect inRect;
    13651365#ifndef TransitionWindowAndParent
    1366         PyMac_PRECHECK(TransitionWindowAndParent);
    1367 #endif
    1368         if (!PyArg_ParseTuple(_args, "O&llO&",
    1369                               WinObj_Convert, &inParentWindow,
    1370                               &inEffect,
    1371                               &inAction,
    1372                               PyMac_GetRect, &inRect))
    1373                 return NULL;
    1374         _err = TransitionWindowAndParent(_self->ob_itself,
    1375                                          inParentWindow,
    1376                                          inEffect,
    1377                                          inAction,
    1378                                          &inRect);
    1379         if (_err != noErr) return PyMac_Error(_err);
    1380         Py_INCREF(Py_None);
    1381         _res = Py_None;
    1382         return _res;
     1366    PyMac_PRECHECK(TransitionWindowAndParent);
     1367#endif
     1368    if (!PyArg_ParseTuple(_args, "O&llO&",
     1369                          WinObj_Convert, &inParentWindow,
     1370                          &inEffect,
     1371                          &inAction,
     1372                          PyMac_GetRect, &inRect))
     1373        return NULL;
     1374    _err = TransitionWindowAndParent(_self->ob_itself,
     1375                                     inParentWindow,
     1376                                     inEffect,
     1377                                     inAction,
     1378                                     &inRect);
     1379    if (_err != noErr) return PyMac_Error(_err);
     1380    Py_INCREF(Py_None);
     1381    _res = Py_None;
     1382    return _res;
    13831383}
    13841384
    13851385static PyObject *WinObj_MacMoveWindow(WindowObject *_self, PyObject *_args)
    13861386{
    1387         PyObject *_res = NULL;
    1388         short hGlobal;
    1389         short vGlobal;
    1390         Boolean front;
     1387    PyObject *_res = NULL;
     1388    short hGlobal;
     1389    short vGlobal;
     1390    Boolean front;
    13911391#ifndef MacMoveWindow
    1392         PyMac_PRECHECK(MacMoveWindow);
    1393 #endif
    1394         if (!PyArg_ParseTuple(_args, "hhb",
    1395                               &hGlobal,
    1396                               &vGlobal,
    1397                               &front))
    1398                 return NULL;
    1399         MacMoveWindow(_self->ob_itself,
    1400                       hGlobal,
    1401                       vGlobal,
    1402                       front);
    1403         Py_INCREF(Py_None);
    1404         _res = Py_None;
    1405         return _res;
     1392    PyMac_PRECHECK(MacMoveWindow);
     1393#endif
     1394    if (!PyArg_ParseTuple(_args, "hhb",
     1395                          &hGlobal,
     1396                          &vGlobal,
     1397                          &front))
     1398        return NULL;
     1399    MacMoveWindow(_self->ob_itself,
     1400                  hGlobal,
     1401                  vGlobal,
     1402                  front);
     1403    Py_INCREF(Py_None);
     1404    _res = Py_None;
     1405    return _res;
    14061406}
    14071407
    14081408static PyObject *WinObj_SizeWindow(WindowObject *_self, PyObject *_args)
    14091409{
    1410         PyObject *_res = NULL;
    1411         short w;
    1412         short h;
    1413         Boolean fUpdate;
     1410    PyObject *_res = NULL;
     1411    short w;
     1412    short h;
     1413    Boolean fUpdate;
    14141414#ifndef SizeWindow
    1415         PyMac_PRECHECK(SizeWindow);
    1416 #endif
    1417         if (!PyArg_ParseTuple(_args, "hhb",
    1418                               &w,
    1419                               &h,
    1420                               &fUpdate))
    1421                 return NULL;
    1422         SizeWindow(_self->ob_itself,
    1423                    w,
    1424                    h,
    1425                    fUpdate);
    1426         Py_INCREF(Py_None);
    1427         _res = Py_None;
    1428         return _res;
     1415    PyMac_PRECHECK(SizeWindow);
     1416#endif
     1417    if (!PyArg_ParseTuple(_args, "hhb",
     1418                          &w,
     1419                          &h,
     1420                          &fUpdate))
     1421        return NULL;
     1422    SizeWindow(_self->ob_itself,
     1423               w,
     1424               h,
     1425               fUpdate);
     1426    Py_INCREF(Py_None);
     1427    _res = Py_None;
     1428    return _res;
    14291429}
    14301430
    14311431static PyObject *WinObj_GrowWindow(WindowObject *_self, PyObject *_args)
    14321432{
    1433         PyObject *_res = NULL;
    1434         long _rv;
    1435         Point startPt;
    1436         Rect bBox;
     1433    PyObject *_res = NULL;
     1434    long _rv;
     1435    Point startPt;
     1436    Rect bBox;
    14371437#ifndef GrowWindow
    1438         PyMac_PRECHECK(GrowWindow);
    1439 #endif
    1440         if (!PyArg_ParseTuple(_args, "O&O&",
    1441                               PyMac_GetPoint, &startPt,
    1442                               PyMac_GetRect, &bBox))
    1443                 return NULL;
    1444         _rv = GrowWindow(_self->ob_itself,
    1445                          startPt,
    1446                          &bBox);
    1447         _res = Py_BuildValue("l",
    1448                              _rv);
    1449         return _res;
     1438    PyMac_PRECHECK(GrowWindow);
     1439#endif
     1440    if (!PyArg_ParseTuple(_args, "O&O&",
     1441                          PyMac_GetPoint, &startPt,
     1442                          PyMac_GetRect, &bBox))
     1443        return NULL;
     1444    _rv = GrowWindow(_self->ob_itself,
     1445                     startPt,
     1446                     &bBox);
     1447    _res = Py_BuildValue("l",
     1448                         _rv);
     1449    return _res;
    14501450}
    14511451
    14521452static PyObject *WinObj_DragWindow(WindowObject *_self, PyObject *_args)
    14531453{
    1454         PyObject *_res = NULL;
    1455         Point startPt;
    1456         Rect boundsRect;
     1454    PyObject *_res = NULL;
     1455    Point startPt;
     1456    Rect boundsRect;
    14571457#ifndef DragWindow
    1458         PyMac_PRECHECK(DragWindow);
    1459 #endif
    1460         if (!PyArg_ParseTuple(_args, "O&O&",
    1461                               PyMac_GetPoint, &startPt,
    1462                               PyMac_GetRect, &boundsRect))
    1463                 return NULL;
    1464         DragWindow(_self->ob_itself,
    1465                    startPt,
    1466                    &boundsRect);
    1467         Py_INCREF(Py_None);
    1468         _res = Py_None;
    1469         return _res;
     1458    PyMac_PRECHECK(DragWindow);
     1459#endif
     1460    if (!PyArg_ParseTuple(_args, "O&O&",
     1461                          PyMac_GetPoint, &startPt,
     1462                          PyMac_GetRect, &boundsRect))
     1463        return NULL;
     1464    DragWindow(_self->ob_itself,
     1465               startPt,
     1466               &boundsRect);
     1467    Py_INCREF(Py_None);
     1468    _res = Py_None;
     1469    return _res;
    14701470}
    14711471
    14721472static PyObject *WinObj_ZoomWindow(WindowObject *_self, PyObject *_args)
    14731473{
    1474         PyObject *_res = NULL;
    1475         WindowPartCode partCode;
    1476         Boolean front;
     1474    PyObject *_res = NULL;
     1475    WindowPartCode partCode;
     1476    Boolean front;
    14771477#ifndef ZoomWindow
    1478         PyMac_PRECHECK(ZoomWindow);
    1479 #endif
    1480         if (!PyArg_ParseTuple(_args, "hb",
    1481                               &partCode,
    1482                               &front))
    1483                 return NULL;
    1484         ZoomWindow(_self->ob_itself,
    1485                    partCode,
    1486                    front);
    1487         Py_INCREF(Py_None);
    1488         _res = Py_None;
    1489         return _res;
     1478    PyMac_PRECHECK(ZoomWindow);
     1479#endif
     1480    if (!PyArg_ParseTuple(_args, "hb",
     1481                          &partCode,
     1482                          &front))
     1483        return NULL;
     1484    ZoomWindow(_self->ob_itself,
     1485               partCode,
     1486               front);
     1487    Py_INCREF(Py_None);
     1488    _res = Py_None;
     1489    return _res;
    14901490}
    14911491
    14921492static PyObject *WinObj_IsWindowCollapsable(WindowObject *_self, PyObject *_args)
    14931493{
    1494         PyObject *_res = NULL;
    1495         Boolean _rv;
     1494    PyObject *_res = NULL;
     1495    Boolean _rv;
    14961496#ifndef IsWindowCollapsable
    1497         PyMac_PRECHECK(IsWindowCollapsable);
    1498 #endif
    1499         if (!PyArg_ParseTuple(_args, ""))
    1500                 return NULL;
    1501         _rv = IsWindowCollapsable(_self->ob_itself);
    1502         _res = Py_BuildValue("b",
    1503                              _rv);
    1504         return _res;
     1497    PyMac_PRECHECK(IsWindowCollapsable);
     1498#endif
     1499    if (!PyArg_ParseTuple(_args, ""))
     1500        return NULL;
     1501    _rv = IsWindowCollapsable(_self->ob_itself);
     1502    _res = Py_BuildValue("b",
     1503                         _rv);
     1504    return _res;
    15051505}
    15061506
    15071507static PyObject *WinObj_IsWindowCollapsed(WindowObject *_self, PyObject *_args)
    15081508{
    1509         PyObject *_res = NULL;
    1510         Boolean _rv;
     1509    PyObject *_res = NULL;
     1510    Boolean _rv;
    15111511#ifndef IsWindowCollapsed
    1512         PyMac_PRECHECK(IsWindowCollapsed);
    1513 #endif
    1514         if (!PyArg_ParseTuple(_args, ""))
    1515                 return NULL;
    1516         _rv = IsWindowCollapsed(_self->ob_itself);
    1517         _res = Py_BuildValue("b",
    1518                              _rv);
    1519         return _res;
     1512    PyMac_PRECHECK(IsWindowCollapsed);
     1513#endif
     1514    if (!PyArg_ParseTuple(_args, ""))
     1515        return NULL;
     1516    _rv = IsWindowCollapsed(_self->ob_itself);
     1517    _res = Py_BuildValue("b",
     1518                         _rv);
     1519    return _res;
    15201520}
    15211521
    15221522static PyObject *WinObj_CollapseWindow(WindowObject *_self, PyObject *_args)
    15231523{
    1524         PyObject *_res = NULL;
    1525         OSStatus _err;
    1526         Boolean collapse;
     1524    PyObject *_res = NULL;
     1525    OSStatus _err;
     1526    Boolean collapse;
    15271527#ifndef CollapseWindow
    1528         PyMac_PRECHECK(CollapseWindow);
    1529 #endif
    1530         if (!PyArg_ParseTuple(_args, "b",
    1531                               &collapse))
    1532                 return NULL;
    1533         _err = CollapseWindow(_self->ob_itself,
    1534                               collapse);
    1535         if (_err != noErr) return PyMac_Error(_err);
    1536         Py_INCREF(Py_None);
    1537         _res = Py_None;
    1538         return _res;
     1528    PyMac_PRECHECK(CollapseWindow);
     1529#endif
     1530    if (!PyArg_ParseTuple(_args, "b",
     1531                          &collapse))
     1532        return NULL;
     1533    _err = CollapseWindow(_self->ob_itself,
     1534                          collapse);
     1535    if (_err != noErr) return PyMac_Error(_err);
     1536    Py_INCREF(Py_None);
     1537    _res = Py_None;
     1538    return _res;
    15391539}
    15401540
    15411541static PyObject *WinObj_GetWindowBounds(WindowObject *_self, PyObject *_args)
    15421542{
    1543         PyObject *_res = NULL;
    1544         OSStatus _err;
    1545         WindowRegionCode regionCode;
    1546         Rect globalBounds;
     1543    PyObject *_res = NULL;
     1544    OSStatus _err;
     1545    WindowRegionCode regionCode;
     1546    Rect globalBounds;
    15471547#ifndef GetWindowBounds
    1548         PyMac_PRECHECK(GetWindowBounds);
    1549 #endif
    1550         if (!PyArg_ParseTuple(_args, "H",
    1551                               &regionCode))
    1552                 return NULL;
    1553         _err = GetWindowBounds(_self->ob_itself,
    1554                                regionCode,
    1555                                &globalBounds);
    1556         if (_err != noErr) return PyMac_Error(_err);
    1557         _res = Py_BuildValue("O&",
    1558                              PyMac_BuildRect, &globalBounds);
    1559         return _res;
     1548    PyMac_PRECHECK(GetWindowBounds);
     1549#endif
     1550    if (!PyArg_ParseTuple(_args, "H",
     1551                          &regionCode))
     1552        return NULL;
     1553    _err = GetWindowBounds(_self->ob_itself,
     1554                           regionCode,
     1555                           &globalBounds);
     1556    if (_err != noErr) return PyMac_Error(_err);
     1557    _res = Py_BuildValue("O&",
     1558                         PyMac_BuildRect, &globalBounds);
     1559    return _res;
    15601560}
    15611561
    15621562static PyObject *WinObj_ResizeWindow(WindowObject *_self, PyObject *_args)
    15631563{
    1564         PyObject *_res = NULL;
    1565         Boolean _rv;
    1566         Point inStartPoint;
    1567         Rect inSizeConstraints;
    1568         Rect outNewContentRect;
     1564    PyObject *_res = NULL;
     1565    Boolean _rv;
     1566    Point inStartPoint;
     1567    Rect inSizeConstraints;
     1568    Rect outNewContentRect;
    15691569#ifndef ResizeWindow
    1570         PyMac_PRECHECK(ResizeWindow);
    1571 #endif
    1572         if (!PyArg_ParseTuple(_args, "O&O&",
    1573                               PyMac_GetPoint, &inStartPoint,
    1574                               PyMac_GetRect, &inSizeConstraints))
    1575                 return NULL;
    1576         _rv = ResizeWindow(_self->ob_itself,
    1577                            inStartPoint,
    1578                            &inSizeConstraints,
    1579                            &outNewContentRect);
    1580         _res = Py_BuildValue("bO&",
    1581                              _rv,
    1582                              PyMac_BuildRect, &outNewContentRect);
    1583         return _res;
     1570    PyMac_PRECHECK(ResizeWindow);
     1571#endif
     1572    if (!PyArg_ParseTuple(_args, "O&O&",
     1573                          PyMac_GetPoint, &inStartPoint,
     1574                          PyMac_GetRect, &inSizeConstraints))
     1575        return NULL;
     1576    _rv = ResizeWindow(_self->ob_itself,
     1577                       inStartPoint,
     1578                       &inSizeConstraints,
     1579                       &outNewContentRect);
     1580    _res = Py_BuildValue("bO&",
     1581                         _rv,
     1582                         PyMac_BuildRect, &outNewContentRect);
     1583    return _res;
    15841584}
    15851585
    15861586static PyObject *WinObj_SetWindowBounds(WindowObject *_self, PyObject *_args)
    15871587{
    1588         PyObject *_res = NULL;
    1589         OSStatus _err;
    1590         WindowRegionCode regionCode;
    1591         Rect globalBounds;
     1588    PyObject *_res = NULL;
     1589    OSStatus _err;
     1590    WindowRegionCode regionCode;
     1591    Rect globalBounds;
    15921592#ifndef SetWindowBounds
    1593         PyMac_PRECHECK(SetWindowBounds);
    1594 #endif
    1595         if (!PyArg_ParseTuple(_args, "HO&",
    1596                               &regionCode,
    1597                               PyMac_GetRect, &globalBounds))
    1598                 return NULL;
    1599         _err = SetWindowBounds(_self->ob_itself,
    1600                                regionCode,
    1601                                &globalBounds);
    1602         if (_err != noErr) return PyMac_Error(_err);
    1603         Py_INCREF(Py_None);
    1604         _res = Py_None;
    1605         return _res;
     1593    PyMac_PRECHECK(SetWindowBounds);
     1594#endif
     1595    if (!PyArg_ParseTuple(_args, "HO&",
     1596                          &regionCode,
     1597                          PyMac_GetRect, &globalBounds))
     1598        return NULL;
     1599    _err = SetWindowBounds(_self->ob_itself,
     1600                           regionCode,
     1601                           &globalBounds);
     1602    if (_err != noErr) return PyMac_Error(_err);
     1603    Py_INCREF(Py_None);
     1604    _res = Py_None;
     1605    return _res;
    16061606}
    16071607
    16081608static PyObject *WinObj_RepositionWindow(WindowObject *_self, PyObject *_args)
    16091609{
    1610         PyObject *_res = NULL;
    1611         OSStatus _err;
    1612         WindowPtr parentWindow;
    1613         WindowPositionMethod method;
     1610    PyObject *_res = NULL;
     1611    OSStatus _err;
     1612    WindowPtr parentWindow;
     1613    WindowPositionMethod method;
    16141614#ifndef RepositionWindow
    1615         PyMac_PRECHECK(RepositionWindow);
    1616 #endif
    1617         if (!PyArg_ParseTuple(_args, "O&l",
    1618                               WinObj_Convert, &parentWindow,
    1619                               &method))
    1620                 return NULL;
    1621         _err = RepositionWindow(_self->ob_itself,
    1622                                 parentWindow,
    1623                                 method);
    1624         if (_err != noErr) return PyMac_Error(_err);
    1625         Py_INCREF(Py_None);
    1626         _res = Py_None;
    1627         return _res;
     1615    PyMac_PRECHECK(RepositionWindow);
     1616#endif
     1617    if (!PyArg_ParseTuple(_args, "O&l",
     1618                          WinObj_Convert, &parentWindow,
     1619                          &method))
     1620        return NULL;
     1621    _err = RepositionWindow(_self->ob_itself,
     1622                            parentWindow,
     1623                            method);
     1624    if (_err != noErr) return PyMac_Error(_err);
     1625    Py_INCREF(Py_None);
     1626    _res = Py_None;
     1627    return _res;
    16281628}
    16291629
    16301630static PyObject *WinObj_MoveWindowStructure(WindowObject *_self, PyObject *_args)
    16311631{
    1632         PyObject *_res = NULL;
    1633         OSStatus _err;
    1634         short hGlobal;
    1635         short vGlobal;
     1632    PyObject *_res = NULL;
     1633    OSStatus _err;
     1634    short hGlobal;
     1635    short vGlobal;
    16361636#ifndef MoveWindowStructure
    1637         PyMac_PRECHECK(MoveWindowStructure);
    1638 #endif
    1639         if (!PyArg_ParseTuple(_args, "hh",
    1640                               &hGlobal,
    1641                               &vGlobal))
    1642                 return NULL;
    1643         _err = MoveWindowStructure(_self->ob_itself,
    1644                                    hGlobal,
    1645                                    vGlobal);
    1646         if (_err != noErr) return PyMac_Error(_err);
    1647         Py_INCREF(Py_None);
    1648         _res = Py_None;
    1649         return _res;
     1637    PyMac_PRECHECK(MoveWindowStructure);
     1638#endif
     1639    if (!PyArg_ParseTuple(_args, "hh",
     1640                          &hGlobal,
     1641                          &vGlobal))
     1642        return NULL;
     1643    _err = MoveWindowStructure(_self->ob_itself,
     1644                               hGlobal,
     1645                               vGlobal);
     1646    if (_err != noErr) return PyMac_Error(_err);
     1647    Py_INCREF(Py_None);
     1648    _res = Py_None;
     1649    return _res;
    16501650}
    16511651
    16521652static PyObject *WinObj_IsWindowInStandardState(WindowObject *_self, PyObject *_args)
    16531653{
    1654         PyObject *_res = NULL;
    1655         Boolean _rv;
    1656         Point inIdealSize;
    1657         Rect outIdealStandardState;
     1654    PyObject *_res = NULL;
     1655    Boolean _rv;
     1656    Point inIdealSize;
     1657    Rect outIdealStandardState;
    16581658#ifndef IsWindowInStandardState
    1659         PyMac_PRECHECK(IsWindowInStandardState);
    1660 #endif
    1661         if (!PyArg_ParseTuple(_args, "O&",
    1662                               PyMac_GetPoint, &inIdealSize))
    1663                 return NULL;
    1664         _rv = IsWindowInStandardState(_self->ob_itself,
    1665                                       &inIdealSize,
    1666                                       &outIdealStandardState);
    1667         _res = Py_BuildValue("bO&",
    1668                              _rv,
    1669                              PyMac_BuildRect, &outIdealStandardState);
    1670         return _res;
     1659    PyMac_PRECHECK(IsWindowInStandardState);
     1660#endif
     1661    if (!PyArg_ParseTuple(_args, "O&",
     1662                          PyMac_GetPoint, &inIdealSize))
     1663        return NULL;
     1664    _rv = IsWindowInStandardState(_self->ob_itself,
     1665                                  &inIdealSize,
     1666                                  &outIdealStandardState);
     1667    _res = Py_BuildValue("bO&",
     1668                         _rv,
     1669                         PyMac_BuildRect, &outIdealStandardState);
     1670    return _res;
    16711671}
    16721672
    16731673static PyObject *WinObj_ZoomWindowIdeal(WindowObject *_self, PyObject *_args)
    16741674{
    1675         PyObject *_res = NULL;
    1676         OSStatus _err;
    1677         WindowPartCode inPartCode;
    1678         Point ioIdealSize;
     1675    PyObject *_res = NULL;
     1676    OSStatus _err;
     1677    WindowPartCode inPartCode;
     1678    Point ioIdealSize;
    16791679#ifndef ZoomWindowIdeal
    1680         PyMac_PRECHECK(ZoomWindowIdeal);
    1681 #endif
    1682         if (!PyArg_ParseTuple(_args, "h",
    1683                               &inPartCode))
    1684                 return NULL;
    1685         _err = ZoomWindowIdeal(_self->ob_itself,
    1686                                inPartCode,
    1687                                &ioIdealSize);
    1688         if (_err != noErr) return PyMac_Error(_err);
    1689         _res = Py_BuildValue("O&",
    1690                              PyMac_BuildPoint, ioIdealSize);
    1691         return _res;
     1680    PyMac_PRECHECK(ZoomWindowIdeal);
     1681#endif
     1682    if (!PyArg_ParseTuple(_args, "h",
     1683                          &inPartCode))
     1684        return NULL;
     1685    _err = ZoomWindowIdeal(_self->ob_itself,
     1686                           inPartCode,
     1687                           &ioIdealSize);
     1688    if (_err != noErr) return PyMac_Error(_err);
     1689    _res = Py_BuildValue("O&",
     1690                         PyMac_BuildPoint, ioIdealSize);
     1691    return _res;
    16921692}
    16931693
    16941694static PyObject *WinObj_GetWindowIdealUserState(WindowObject *_self, PyObject *_args)
    16951695{
    1696         PyObject *_res = NULL;
    1697         OSStatus _err;
    1698         Rect outUserState;
     1696    PyObject *_res = NULL;
     1697    OSStatus _err;
     1698    Rect outUserState;
    16991699#ifndef GetWindowIdealUserState
    1700         PyMac_PRECHECK(GetWindowIdealUserState);
    1701 #endif
    1702         if (!PyArg_ParseTuple(_args, ""))
    1703                 return NULL;
    1704         _err = GetWindowIdealUserState(_self->ob_itself,
    1705                                        &outUserState);
    1706         if (_err != noErr) return PyMac_Error(_err);
    1707         _res = Py_BuildValue("O&",
    1708                              PyMac_BuildRect, &outUserState);
    1709         return _res;
     1700    PyMac_PRECHECK(GetWindowIdealUserState);
     1701#endif
     1702    if (!PyArg_ParseTuple(_args, ""))
     1703        return NULL;
     1704    _err = GetWindowIdealUserState(_self->ob_itself,
     1705                                   &outUserState);
     1706    if (_err != noErr) return PyMac_Error(_err);
     1707    _res = Py_BuildValue("O&",
     1708                         PyMac_BuildRect, &outUserState);
     1709    return _res;
    17101710}
    17111711
    17121712static PyObject *WinObj_SetWindowIdealUserState(WindowObject *_self, PyObject *_args)
    17131713{
    1714         PyObject *_res = NULL;
    1715         OSStatus _err;
    1716         Rect inUserState;
     1714    PyObject *_res = NULL;
     1715    OSStatus _err;
     1716    Rect inUserState;
    17171717#ifndef SetWindowIdealUserState
    1718         PyMac_PRECHECK(SetWindowIdealUserState);
    1719 #endif
    1720         if (!PyArg_ParseTuple(_args, "O&",
    1721                               PyMac_GetRect, &inUserState))
    1722                 return NULL;
    1723         _err = SetWindowIdealUserState(_self->ob_itself,
    1724                                        &inUserState);
    1725         if (_err != noErr) return PyMac_Error(_err);
    1726         Py_INCREF(Py_None);
    1727         _res = Py_None;
    1728         return _res;
     1718    PyMac_PRECHECK(SetWindowIdealUserState);
     1719#endif
     1720    if (!PyArg_ParseTuple(_args, "O&",
     1721                          PyMac_GetRect, &inUserState))
     1722        return NULL;
     1723    _err = SetWindowIdealUserState(_self->ob_itself,
     1724                                   &inUserState);
     1725    if (_err != noErr) return PyMac_Error(_err);
     1726    Py_INCREF(Py_None);
     1727    _res = Py_None;
     1728    return _res;
    17291729}
    17301730
    17311731static PyObject *WinObj_GetWindowGreatestAreaDevice(WindowObject *_self, PyObject *_args)
    17321732{
    1733         PyObject *_res = NULL;
    1734         OSStatus _err;
    1735         WindowRegionCode inRegion;
    1736         GDHandle outGreatestDevice;
    1737         Rect outGreatestDeviceRect;
     1733    PyObject *_res = NULL;
     1734    OSStatus _err;
     1735    WindowRegionCode inRegion;
     1736    GDHandle outGreatestDevice;
     1737    Rect outGreatestDeviceRect;
    17381738#ifndef GetWindowGreatestAreaDevice
    1739         PyMac_PRECHECK(GetWindowGreatestAreaDevice);
    1740 #endif
    1741         if (!PyArg_ParseTuple(_args, "H",
    1742                               &inRegion))
    1743                 return NULL;
    1744         _err = GetWindowGreatestAreaDevice(_self->ob_itself,
    1745                                            inRegion,
    1746                                            &outGreatestDevice,
    1747                                            &outGreatestDeviceRect);
    1748         if (_err != noErr) return PyMac_Error(_err);
    1749         _res = Py_BuildValue("O&O&",
    1750                              ResObj_New, outGreatestDevice,
    1751                              PyMac_BuildRect, &outGreatestDeviceRect);
    1752         return _res;
     1739    PyMac_PRECHECK(GetWindowGreatestAreaDevice);
     1740#endif
     1741    if (!PyArg_ParseTuple(_args, "H",
     1742                          &inRegion))
     1743        return NULL;
     1744    _err = GetWindowGreatestAreaDevice(_self->ob_itself,
     1745                                       inRegion,
     1746                                       &outGreatestDevice,
     1747                                       &outGreatestDeviceRect);
     1748    if (_err != noErr) return PyMac_Error(_err);
     1749    _res = Py_BuildValue("O&O&",
     1750                         ResObj_New, outGreatestDevice,
     1751                         PyMac_BuildRect, &outGreatestDeviceRect);
     1752    return _res;
    17531753}
    17541754
    17551755static PyObject *WinObj_ConstrainWindowToScreen(WindowObject *_self, PyObject *_args)
    17561756{
    1757         PyObject *_res = NULL;
    1758         OSStatus _err;
    1759         WindowRegionCode inRegionCode;
    1760         WindowConstrainOptions inOptions;
    1761         Rect inScreenRect;
    1762         Rect outStructure;
     1757    PyObject *_res = NULL;
     1758    OSStatus _err;
     1759    WindowRegionCode inRegionCode;
     1760    WindowConstrainOptions inOptions;
     1761    Rect inScreenRect;
     1762    Rect outStructure;
    17631763#ifndef ConstrainWindowToScreen
    1764         PyMac_PRECHECK(ConstrainWindowToScreen);
    1765 #endif
    1766         if (!PyArg_ParseTuple(_args, "HlO&",
    1767                               &inRegionCode,
    1768                               &inOptions,
    1769                               PyMac_GetRect, &inScreenRect))
    1770                 return NULL;
    1771         _err = ConstrainWindowToScreen(_self->ob_itself,
    1772                                        inRegionCode,
    1773                                        inOptions,
    1774                                        &inScreenRect,
    1775                                        &outStructure);
    1776         if (_err != noErr) return PyMac_Error(_err);
    1777         _res = Py_BuildValue("O&",
    1778                              PyMac_BuildRect, &outStructure);
    1779         return _res;
     1764    PyMac_PRECHECK(ConstrainWindowToScreen);
     1765#endif
     1766    if (!PyArg_ParseTuple(_args, "HlO&",
     1767                          &inRegionCode,
     1768                          &inOptions,
     1769                          PyMac_GetRect, &inScreenRect))
     1770        return NULL;
     1771    _err = ConstrainWindowToScreen(_self->ob_itself,
     1772                                   inRegionCode,
     1773                                   inOptions,
     1774                                   &inScreenRect,
     1775                                   &outStructure);
     1776    if (_err != noErr) return PyMac_Error(_err);
     1777    _res = Py_BuildValue("O&",
     1778                         PyMac_BuildRect, &outStructure);
     1779    return _res;
    17801780}
    17811781
    17821782static PyObject *WinObj_HideWindow(WindowObject *_self, PyObject *_args)
    17831783{
    1784         PyObject *_res = NULL;
     1784    PyObject *_res = NULL;
    17851785#ifndef HideWindow
    1786         PyMac_PRECHECK(HideWindow);
    1787 #endif
    1788         if (!PyArg_ParseTuple(_args, ""))
    1789                 return NULL;
    1790         HideWindow(_self->ob_itself);
    1791         Py_INCREF(Py_None);
    1792         _res = Py_None;
    1793         return _res;
     1786    PyMac_PRECHECK(HideWindow);
     1787#endif
     1788    if (!PyArg_ParseTuple(_args, ""))
     1789        return NULL;
     1790    HideWindow(_self->ob_itself);
     1791    Py_INCREF(Py_None);
     1792    _res = Py_None;
     1793    return _res;
    17941794}
    17951795
    17961796static PyObject *WinObj_MacShowWindow(WindowObject *_self, PyObject *_args)
    17971797{
    1798         PyObject *_res = NULL;
     1798    PyObject *_res = NULL;
    17991799#ifndef MacShowWindow
    1800         PyMac_PRECHECK(MacShowWindow);
    1801 #endif
    1802         if (!PyArg_ParseTuple(_args, ""))
    1803                 return NULL;
    1804         MacShowWindow(_self->ob_itself);
    1805         Py_INCREF(Py_None);
    1806         _res = Py_None;
    1807         return _res;
     1800    PyMac_PRECHECK(MacShowWindow);
     1801#endif
     1802    if (!PyArg_ParseTuple(_args, ""))
     1803        return NULL;
     1804    MacShowWindow(_self->ob_itself);
     1805    Py_INCREF(Py_None);
     1806    _res = Py_None;
     1807    return _res;
    18081808}
    18091809
    18101810static PyObject *WinObj_ShowHide(WindowObject *_self, PyObject *_args)
    18111811{
    1812         PyObject *_res = NULL;
    1813         Boolean showFlag;
     1812    PyObject *_res = NULL;
     1813    Boolean showFlag;
    18141814#ifndef ShowHide
    1815         PyMac_PRECHECK(ShowHide);
    1816 #endif
    1817         if (!PyArg_ParseTuple(_args, "b",
    1818                               &showFlag))
    1819                 return NULL;
    1820         ShowHide(_self->ob_itself,
    1821                  showFlag);
    1822         Py_INCREF(Py_None);
    1823         _res = Py_None;
    1824         return _res;
     1815    PyMac_PRECHECK(ShowHide);
     1816#endif
     1817    if (!PyArg_ParseTuple(_args, "b",
     1818                          &showFlag))
     1819        return NULL;
     1820    ShowHide(_self->ob_itself,
     1821             showFlag);
     1822    Py_INCREF(Py_None);
     1823    _res = Py_None;
     1824    return _res;
    18251825}
    18261826
    18271827static PyObject *WinObj_MacIsWindowVisible(WindowObject *_self, PyObject *_args)
    18281828{
    1829         PyObject *_res = NULL;
    1830         Boolean _rv;
     1829    PyObject *_res = NULL;
     1830    Boolean _rv;
    18311831#ifndef MacIsWindowVisible
    1832         PyMac_PRECHECK(MacIsWindowVisible);
    1833 #endif
    1834         if (!PyArg_ParseTuple(_args, ""))
    1835                 return NULL;
    1836         _rv = MacIsWindowVisible(_self->ob_itself);
    1837         _res = Py_BuildValue("b",
    1838                              _rv);
    1839         return _res;
     1832    PyMac_PRECHECK(MacIsWindowVisible);
     1833#endif
     1834    if (!PyArg_ParseTuple(_args, ""))
     1835        return NULL;
     1836    _rv = MacIsWindowVisible(_self->ob_itself);
     1837    _res = Py_BuildValue("b",
     1838                         _rv);
     1839    return _res;
    18401840}
    18411841
    18421842static PyObject *WinObj_ShowSheetWindow(WindowObject *_self, PyObject *_args)
    18431843{
    1844         PyObject *_res = NULL;
    1845         OSStatus _err;
    1846         WindowPtr inParentWindow;
     1844    PyObject *_res = NULL;
     1845    OSStatus _err;
     1846    WindowPtr inParentWindow;
    18471847#ifndef ShowSheetWindow
    1848         PyMac_PRECHECK(ShowSheetWindow);
    1849 #endif
    1850         if (!PyArg_ParseTuple(_args, "O&",
    1851                               WinObj_Convert, &inParentWindow))
    1852                 return NULL;
    1853         _err = ShowSheetWindow(_self->ob_itself,
    1854                                inParentWindow);
    1855         if (_err != noErr) return PyMac_Error(_err);
    1856         Py_INCREF(Py_None);
    1857         _res = Py_None;
    1858         return _res;
     1848    PyMac_PRECHECK(ShowSheetWindow);
     1849#endif
     1850    if (!PyArg_ParseTuple(_args, "O&",
     1851                          WinObj_Convert, &inParentWindow))
     1852        return NULL;
     1853    _err = ShowSheetWindow(_self->ob_itself,
     1854                           inParentWindow);
     1855    if (_err != noErr) return PyMac_Error(_err);
     1856    Py_INCREF(Py_None);
     1857    _res = Py_None;
     1858    return _res;
    18591859}
    18601860
    18611861static PyObject *WinObj_HideSheetWindow(WindowObject *_self, PyObject *_args)
    18621862{
    1863         PyObject *_res = NULL;
    1864         OSStatus _err;
     1863    PyObject *_res = NULL;
     1864    OSStatus _err;
    18651865#ifndef HideSheetWindow
    1866         PyMac_PRECHECK(HideSheetWindow);
    1867 #endif
    1868         if (!PyArg_ParseTuple(_args, ""))
    1869                 return NULL;
    1870         _err = HideSheetWindow(_self->ob_itself);
    1871         if (_err != noErr) return PyMac_Error(_err);
    1872         Py_INCREF(Py_None);
    1873         _res = Py_None;
    1874         return _res;
     1866    PyMac_PRECHECK(HideSheetWindow);
     1867#endif
     1868    if (!PyArg_ParseTuple(_args, ""))
     1869        return NULL;
     1870    _err = HideSheetWindow(_self->ob_itself);
     1871    if (_err != noErr) return PyMac_Error(_err);
     1872    Py_INCREF(Py_None);
     1873    _res = Py_None;
     1874    return _res;
    18751875}
    18761876
    18771877static PyObject *WinObj_GetSheetWindowParent(WindowObject *_self, PyObject *_args)
    18781878{
    1879         PyObject *_res = NULL;
    1880         OSStatus _err;
    1881         WindowPtr outParentWindow;
     1879    PyObject *_res = NULL;
     1880    OSStatus _err;
     1881    WindowPtr outParentWindow;
    18821882#ifndef GetSheetWindowParent
    1883         PyMac_PRECHECK(GetSheetWindowParent);
    1884 #endif
    1885         if (!PyArg_ParseTuple(_args, ""))
    1886                 return NULL;
    1887         _err = GetSheetWindowParent(_self->ob_itself,
    1888                                     &outParentWindow);
    1889         if (_err != noErr) return PyMac_Error(_err);
    1890         _res = Py_BuildValue("O&",
    1891                              WinObj_WhichWindow, outParentWindow);
    1892         return _res;
     1883    PyMac_PRECHECK(GetSheetWindowParent);
     1884#endif
     1885    if (!PyArg_ParseTuple(_args, ""))
     1886        return NULL;
     1887    _err = GetSheetWindowParent(_self->ob_itself,
     1888                                &outParentWindow);
     1889    if (_err != noErr) return PyMac_Error(_err);
     1890    _res = Py_BuildValue("O&",
     1891                         WinObj_WhichWindow, outParentWindow);
     1892    return _res;
    18931893}
    18941894
    18951895static PyObject *WinObj_GetWindowPropertyAttributes(WindowObject *_self, PyObject *_args)
    18961896{
    1897         PyObject *_res = NULL;
    1898         OSStatus _err;
    1899         OSType propertyCreator;
    1900         OSType propertyTag;
    1901         UInt32 attributes;
     1897    PyObject *_res = NULL;
     1898    OSStatus _err;
     1899    OSType propertyCreator;
     1900    OSType propertyTag;
     1901    UInt32 attributes;
    19021902#ifndef GetWindowPropertyAttributes
    1903         PyMac_PRECHECK(GetWindowPropertyAttributes);
    1904 #endif
    1905         if (!PyArg_ParseTuple(_args, "O&O&",
    1906                               PyMac_GetOSType, &propertyCreator,
    1907                               PyMac_GetOSType, &propertyTag))
    1908                 return NULL;
    1909         _err = GetWindowPropertyAttributes(_self->ob_itself,
    1910                                            propertyCreator,
    1911                                            propertyTag,
    1912                                            &attributes);
    1913         if (_err != noErr) return PyMac_Error(_err);
    1914         _res = Py_BuildValue("l",
    1915                              attributes);
    1916         return _res;
     1903    PyMac_PRECHECK(GetWindowPropertyAttributes);
     1904#endif
     1905    if (!PyArg_ParseTuple(_args, "O&O&",
     1906                          PyMac_GetOSType, &propertyCreator,
     1907                          PyMac_GetOSType, &propertyTag))
     1908        return NULL;
     1909    _err = GetWindowPropertyAttributes(_self->ob_itself,
     1910                                       propertyCreator,
     1911                                       propertyTag,
     1912                                       &attributes);
     1913    if (_err != noErr) return PyMac_Error(_err);
     1914    _res = Py_BuildValue("l",
     1915                         attributes);
     1916    return _res;
    19171917}
    19181918
    19191919static PyObject *WinObj_ChangeWindowPropertyAttributes(WindowObject *_self, PyObject *_args)
    19201920{
    1921         PyObject *_res = NULL;
    1922         OSStatus _err;
    1923         OSType propertyCreator;
    1924         OSType propertyTag;
    1925         UInt32 attributesToSet;
    1926         UInt32 attributesToClear;
     1921    PyObject *_res = NULL;
     1922    OSStatus _err;
     1923    OSType propertyCreator;
     1924    OSType propertyTag;
     1925    UInt32 attributesToSet;
     1926    UInt32 attributesToClear;
    19271927#ifndef ChangeWindowPropertyAttributes
    1928         PyMac_PRECHECK(ChangeWindowPropertyAttributes);
    1929 #endif
    1930         if (!PyArg_ParseTuple(_args, "O&O&ll",
    1931                               PyMac_GetOSType, &propertyCreator,
    1932                               PyMac_GetOSType, &propertyTag,
    1933                               &attributesToSet,
    1934                               &attributesToClear))
    1935                 return NULL;
    1936         _err = ChangeWindowPropertyAttributes(_self->ob_itself,
    1937                                               propertyCreator,
    1938                                               propertyTag,
    1939                                               attributesToSet,
    1940                                               attributesToClear);
    1941         if (_err != noErr) return PyMac_Error(_err);
    1942         Py_INCREF(Py_None);
    1943         _res = Py_None;
    1944         return _res;
     1928    PyMac_PRECHECK(ChangeWindowPropertyAttributes);
     1929#endif
     1930    if (!PyArg_ParseTuple(_args, "O&O&ll",
     1931                          PyMac_GetOSType, &propertyCreator,
     1932                          PyMac_GetOSType, &propertyTag,
     1933                          &attributesToSet,
     1934                          &attributesToClear))
     1935        return NULL;
     1936    _err = ChangeWindowPropertyAttributes(_self->ob_itself,
     1937                                          propertyCreator,
     1938                                          propertyTag,
     1939                                          attributesToSet,
     1940                                          attributesToClear);
     1941    if (_err != noErr) return PyMac_Error(_err);
     1942    Py_INCREF(Py_None);
     1943    _res = Py_None;
     1944    return _res;
    19451945}
    19461946
    19471947static PyObject *WinObj_TrackBox(WindowObject *_self, PyObject *_args)
    19481948{
    1949         PyObject *_res = NULL;
    1950         Boolean _rv;
    1951         Point thePt;
    1952         WindowPartCode partCode;
     1949    PyObject *_res = NULL;
     1950    Boolean _rv;
     1951    Point thePt;
     1952    WindowPartCode partCode;
    19531953#ifndef TrackBox
    1954         PyMac_PRECHECK(TrackBox);
    1955 #endif
    1956         if (!PyArg_ParseTuple(_args, "O&h",
    1957                               PyMac_GetPoint, &thePt,
    1958                               &partCode))
    1959                 return NULL;
    1960         _rv = TrackBox(_self->ob_itself,
    1961                        thePt,
    1962                        partCode);
    1963         _res = Py_BuildValue("b",
    1964                              _rv);
    1965         return _res;
     1954    PyMac_PRECHECK(TrackBox);
     1955#endif
     1956    if (!PyArg_ParseTuple(_args, "O&h",
     1957                          PyMac_GetPoint, &thePt,
     1958                          &partCode))
     1959        return NULL;
     1960    _rv = TrackBox(_self->ob_itself,
     1961                   thePt,
     1962                   partCode);
     1963    _res = Py_BuildValue("b",
     1964                         _rv);
     1965    return _res;
    19661966}
    19671967
    19681968static PyObject *WinObj_TrackGoAway(WindowObject *_self, PyObject *_args)
    19691969{
    1970         PyObject *_res = NULL;
    1971         Boolean _rv;
    1972         Point thePt;
     1970    PyObject *_res = NULL;
     1971    Boolean _rv;
     1972    Point thePt;
    19731973#ifndef TrackGoAway
    1974         PyMac_PRECHECK(TrackGoAway);
    1975 #endif
    1976         if (!PyArg_ParseTuple(_args, "O&",
    1977                               PyMac_GetPoint, &thePt))
    1978                 return NULL;
    1979         _rv = TrackGoAway(_self->ob_itself,
    1980                           thePt);
    1981         _res = Py_BuildValue("b",
    1982                              _rv);
    1983         return _res;
     1974    PyMac_PRECHECK(TrackGoAway);
     1975#endif
     1976    if (!PyArg_ParseTuple(_args, "O&",
     1977                          PyMac_GetPoint, &thePt))
     1978        return NULL;
     1979    _rv = TrackGoAway(_self->ob_itself,
     1980                      thePt);
     1981    _res = Py_BuildValue("b",
     1982                         _rv);
     1983    return _res;
    19841984}
    19851985
    19861986static PyObject *WinObj_GetWindowPort(WindowObject *_self, PyObject *_args)
    19871987{
    1988         PyObject *_res = NULL;
    1989         CGrafPtr _rv;
     1988    PyObject *_res = NULL;
     1989    CGrafPtr _rv;
    19901990#ifndef GetWindowPort
    1991         PyMac_PRECHECK(GetWindowPort);
    1992 #endif
    1993         if (!PyArg_ParseTuple(_args, ""))
    1994                 return NULL;
    1995         _rv = GetWindowPort(_self->ob_itself);
    1996         _res = Py_BuildValue("O&",
    1997                              GrafObj_New, _rv);
    1998         return _res;
     1991    PyMac_PRECHECK(GetWindowPort);
     1992#endif
     1993    if (!PyArg_ParseTuple(_args, ""))
     1994        return NULL;
     1995    _rv = GetWindowPort(_self->ob_itself);
     1996    _res = Py_BuildValue("O&",
     1997                         GrafObj_New, _rv);
     1998    return _res;
    19991999}
    20002000
    20012001static PyObject *WinObj_GetWindowStructurePort(WindowObject *_self, PyObject *_args)
    20022002{
    2003         PyObject *_res = NULL;
    2004         CGrafPtr _rv;
     2003    PyObject *_res = NULL;
     2004    CGrafPtr _rv;
    20052005#ifndef GetWindowStructurePort
    2006         PyMac_PRECHECK(GetWindowStructurePort);
    2007 #endif
    2008         if (!PyArg_ParseTuple(_args, ""))
    2009                 return NULL;
    2010         _rv = GetWindowStructurePort(_self->ob_itself);
    2011         _res = Py_BuildValue("O&",
    2012                              GrafObj_New, _rv);
    2013         return _res;
     2006    PyMac_PRECHECK(GetWindowStructurePort);
     2007#endif
     2008    if (!PyArg_ParseTuple(_args, ""))
     2009        return NULL;
     2010    _rv = GetWindowStructurePort(_self->ob_itself);
     2011    _res = Py_BuildValue("O&",
     2012                         GrafObj_New, _rv);
     2013    return _res;
    20142014}
    20152015
    20162016static PyObject *WinObj_GetWindowKind(WindowObject *_self, PyObject *_args)
    20172017{
    2018         PyObject *_res = NULL;
    2019         short _rv;
     2018    PyObject *_res = NULL;
     2019    short _rv;
    20202020#ifndef GetWindowKind
    2021         PyMac_PRECHECK(GetWindowKind);
    2022 #endif
    2023         if (!PyArg_ParseTuple(_args, ""))
    2024                 return NULL;
    2025         _rv = GetWindowKind(_self->ob_itself);
    2026         _res = Py_BuildValue("h",
    2027                              _rv);
    2028         return _res;
     2021    PyMac_PRECHECK(GetWindowKind);
     2022#endif
     2023    if (!PyArg_ParseTuple(_args, ""))
     2024        return NULL;
     2025    _rv = GetWindowKind(_self->ob_itself);
     2026    _res = Py_BuildValue("h",
     2027                         _rv);
     2028    return _res;
    20292029}
    20302030
    20312031static PyObject *WinObj_IsWindowHilited(WindowObject *_self, PyObject *_args)
    20322032{
    2033         PyObject *_res = NULL;
    2034         Boolean _rv;
     2033    PyObject *_res = NULL;
     2034    Boolean _rv;
    20352035#ifndef IsWindowHilited
    2036         PyMac_PRECHECK(IsWindowHilited);
    2037 #endif
    2038         if (!PyArg_ParseTuple(_args, ""))
    2039                 return NULL;
    2040         _rv = IsWindowHilited(_self->ob_itself);
    2041         _res = Py_BuildValue("b",
    2042                              _rv);
    2043         return _res;
     2036    PyMac_PRECHECK(IsWindowHilited);
     2037#endif
     2038    if (!PyArg_ParseTuple(_args, ""))
     2039        return NULL;
     2040    _rv = IsWindowHilited(_self->ob_itself);
     2041    _res = Py_BuildValue("b",
     2042                         _rv);
     2043    return _res;
    20442044}
    20452045
    20462046static PyObject *WinObj_IsWindowUpdatePending(WindowObject *_self, PyObject *_args)
    20472047{
    2048         PyObject *_res = NULL;
    2049         Boolean _rv;
     2048    PyObject *_res = NULL;
     2049    Boolean _rv;
    20502050#ifndef IsWindowUpdatePending
    2051         PyMac_PRECHECK(IsWindowUpdatePending);
    2052 #endif
    2053         if (!PyArg_ParseTuple(_args, ""))
    2054                 return NULL;
    2055         _rv = IsWindowUpdatePending(_self->ob_itself);
    2056         _res = Py_BuildValue("b",
    2057                              _rv);
    2058         return _res;
     2051    PyMac_PRECHECK(IsWindowUpdatePending);
     2052#endif
     2053    if (!PyArg_ParseTuple(_args, ""))
     2054        return NULL;
     2055    _rv = IsWindowUpdatePending(_self->ob_itself);
     2056    _res = Py_BuildValue("b",
     2057                         _rv);
     2058    return _res;
    20592059}
    20602060
    20612061static PyObject *WinObj_MacGetNextWindow(WindowObject *_self, PyObject *_args)
    20622062{
    2063         PyObject *_res = NULL;
    2064         WindowPtr _rv;
     2063    PyObject *_res = NULL;
     2064    WindowPtr _rv;
    20652065#ifndef MacGetNextWindow
    2066         PyMac_PRECHECK(MacGetNextWindow);
    2067 #endif
    2068         if (!PyArg_ParseTuple(_args, ""))
    2069                 return NULL;
    2070         _rv = MacGetNextWindow(_self->ob_itself);
    2071         _res = Py_BuildValue("O&",
    2072                              WinObj_New, _rv);
    2073         return _res;
     2066    PyMac_PRECHECK(MacGetNextWindow);
     2067#endif
     2068    if (!PyArg_ParseTuple(_args, ""))
     2069        return NULL;
     2070    _rv = MacGetNextWindow(_self->ob_itself);
     2071    _res = Py_BuildValue("O&",
     2072                         WinObj_New, _rv);
     2073    return _res;
    20742074}
    20752075
    20762076static PyObject *WinObj_GetWindowStandardState(WindowObject *_self, PyObject *_args)
    20772077{
    2078         PyObject *_res = NULL;
    2079         Rect rect;
     2078    PyObject *_res = NULL;
     2079    Rect rect;
    20802080#ifndef GetWindowStandardState
    2081         PyMac_PRECHECK(GetWindowStandardState);
    2082 #endif
    2083         if (!PyArg_ParseTuple(_args, ""))
    2084                 return NULL;
    2085         GetWindowStandardState(_self->ob_itself,
    2086                                &rect);
    2087         _res = Py_BuildValue("O&",
    2088                              PyMac_BuildRect, &rect);
    2089         return _res;
     2081    PyMac_PRECHECK(GetWindowStandardState);
     2082#endif
     2083    if (!PyArg_ParseTuple(_args, ""))
     2084        return NULL;
     2085    GetWindowStandardState(_self->ob_itself,
     2086                           &rect);
     2087    _res = Py_BuildValue("O&",
     2088                         PyMac_BuildRect, &rect);
     2089    return _res;
    20902090}
    20912091
    20922092static PyObject *WinObj_GetWindowUserState(WindowObject *_self, PyObject *_args)
    20932093{
    2094         PyObject *_res = NULL;
    2095         Rect rect;
     2094    PyObject *_res = NULL;
     2095    Rect rect;
    20962096#ifndef GetWindowUserState
    2097         PyMac_PRECHECK(GetWindowUserState);
    2098 #endif
    2099         if (!PyArg_ParseTuple(_args, ""))
    2100                 return NULL;
    2101         GetWindowUserState(_self->ob_itself,
    2102                            &rect);
    2103         _res = Py_BuildValue("O&",
    2104                              PyMac_BuildRect, &rect);
    2105         return _res;
     2097    PyMac_PRECHECK(GetWindowUserState);
     2098#endif
     2099    if (!PyArg_ParseTuple(_args, ""))
     2100        return NULL;
     2101    GetWindowUserState(_self->ob_itself,
     2102                       &rect);
     2103    _res = Py_BuildValue("O&",
     2104                         PyMac_BuildRect, &rect);
     2105    return _res;
    21062106}
    21072107
    21082108static PyObject *WinObj_SetWindowKind(WindowObject *_self, PyObject *_args)
    21092109{
    2110         PyObject *_res = NULL;
    2111         short kind;
     2110    PyObject *_res = NULL;
     2111    short kind;
    21122112#ifndef SetWindowKind
    2113         PyMac_PRECHECK(SetWindowKind);
    2114 #endif
    2115         if (!PyArg_ParseTuple(_args, "h",
    2116                               &kind))
    2117                 return NULL;
    2118         SetWindowKind(_self->ob_itself,
    2119                       kind);
    2120         Py_INCREF(Py_None);
    2121         _res = Py_None;
    2122         return _res;
     2113    PyMac_PRECHECK(SetWindowKind);
     2114#endif
     2115    if (!PyArg_ParseTuple(_args, "h",
     2116                          &kind))
     2117        return NULL;
     2118    SetWindowKind(_self->ob_itself,
     2119                  kind);
     2120    Py_INCREF(Py_None);
     2121    _res = Py_None;
     2122    return _res;
    21232123}
    21242124
    21252125static PyObject *WinObj_SetWindowStandardState(WindowObject *_self, PyObject *_args)
    21262126{
    2127         PyObject *_res = NULL;
    2128         Rect rect;
     2127    PyObject *_res = NULL;
     2128    Rect rect;
    21292129#ifndef SetWindowStandardState
    2130         PyMac_PRECHECK(SetWindowStandardState);
    2131 #endif
    2132         if (!PyArg_ParseTuple(_args, "O&",
    2133                               PyMac_GetRect, &rect))
    2134                 return NULL;
    2135         SetWindowStandardState(_self->ob_itself,
    2136                                &rect);
    2137         Py_INCREF(Py_None);
    2138         _res = Py_None;
    2139         return _res;
     2130    PyMac_PRECHECK(SetWindowStandardState);
     2131#endif
     2132    if (!PyArg_ParseTuple(_args, "O&",
     2133                          PyMac_GetRect, &rect))
     2134        return NULL;
     2135    SetWindowStandardState(_self->ob_itself,
     2136                           &rect);
     2137    Py_INCREF(Py_None);
     2138    _res = Py_None;
     2139    return _res;
    21402140}
    21412141
    21422142static PyObject *WinObj_SetWindowUserState(WindowObject *_self, PyObject *_args)
    21432143{
    2144         PyObject *_res = NULL;
    2145         Rect rect;
     2144    PyObject *_res = NULL;
     2145    Rect rect;
    21462146#ifndef SetWindowUserState
    2147         PyMac_PRECHECK(SetWindowUserState);
    2148 #endif
    2149         if (!PyArg_ParseTuple(_args, "O&",
    2150                               PyMac_GetRect, &rect))
    2151                 return NULL;
    2152         SetWindowUserState(_self->ob_itself,
    2153                            &rect);
    2154         Py_INCREF(Py_None);
    2155         _res = Py_None;
    2156         return _res;
     2147    PyMac_PRECHECK(SetWindowUserState);
     2148#endif
     2149    if (!PyArg_ParseTuple(_args, "O&",
     2150                          PyMac_GetRect, &rect))
     2151        return NULL;
     2152    SetWindowUserState(_self->ob_itself,
     2153                       &rect);
     2154    Py_INCREF(Py_None);
     2155    _res = Py_None;
     2156    return _res;
    21572157}
    21582158
    21592159static PyObject *WinObj_SetPortWindowPort(WindowObject *_self, PyObject *_args)
    21602160{
    2161         PyObject *_res = NULL;
     2161    PyObject *_res = NULL;
    21622162#ifndef SetPortWindowPort
    2163         PyMac_PRECHECK(SetPortWindowPort);
    2164 #endif
    2165         if (!PyArg_ParseTuple(_args, ""))
    2166                 return NULL;
    2167         SetPortWindowPort(_self->ob_itself);
    2168         Py_INCREF(Py_None);
    2169         _res = Py_None;
    2170         return _res;
     2163    PyMac_PRECHECK(SetPortWindowPort);
     2164#endif
     2165    if (!PyArg_ParseTuple(_args, ""))
     2166        return NULL;
     2167    SetPortWindowPort(_self->ob_itself);
     2168    Py_INCREF(Py_None);
     2169    _res = Py_None;
     2170    return _res;
    21712171}
    21722172
    21732173static PyObject *WinObj_GetWindowPortBounds(WindowObject *_self, PyObject *_args)
    21742174{
    2175         PyObject *_res = NULL;
    2176         Rect bounds;
     2175    PyObject *_res = NULL;
     2176    Rect bounds;
    21772177#ifndef GetWindowPortBounds
    2178         PyMac_PRECHECK(GetWindowPortBounds);
    2179 #endif
    2180         if (!PyArg_ParseTuple(_args, ""))
    2181                 return NULL;
    2182         GetWindowPortBounds(_self->ob_itself,
    2183                             &bounds);
    2184         _res = Py_BuildValue("O&",
    2185                              PyMac_BuildRect, &bounds);
    2186         return _res;
     2178    PyMac_PRECHECK(GetWindowPortBounds);
     2179#endif
     2180    if (!PyArg_ParseTuple(_args, ""))
     2181        return NULL;
     2182    GetWindowPortBounds(_self->ob_itself,
     2183                        &bounds);
     2184    _res = Py_BuildValue("O&",
     2185                         PyMac_BuildRect, &bounds);
     2186    return _res;
    21872187}
    21882188
    21892189static PyObject *WinObj_IsWindowVisible(WindowObject *_self, PyObject *_args)
    21902190{
    2191         PyObject *_res = NULL;
    2192         Boolean _rv;
     2191    PyObject *_res = NULL;
     2192    Boolean _rv;
    21932193#ifndef IsWindowVisible
    2194         PyMac_PRECHECK(IsWindowVisible);
    2195 #endif
    2196         if (!PyArg_ParseTuple(_args, ""))
    2197                 return NULL;
    2198         _rv = IsWindowVisible(_self->ob_itself);
    2199         _res = Py_BuildValue("b",
    2200                              _rv);
    2201         return _res;
     2194    PyMac_PRECHECK(IsWindowVisible);
     2195#endif
     2196    if (!PyArg_ParseTuple(_args, ""))
     2197        return NULL;
     2198    _rv = IsWindowVisible(_self->ob_itself);
     2199    _res = Py_BuildValue("b",
     2200                         _rv);
     2201    return _res;
    22022202}
    22032203
    22042204static PyObject *WinObj_GetWindowStructureRgn(WindowObject *_self, PyObject *_args)
    22052205{
    2206         PyObject *_res = NULL;
    2207         RgnHandle r;
     2206    PyObject *_res = NULL;
     2207    RgnHandle r;
    22082208#ifndef GetWindowStructureRgn
    2209         PyMac_PRECHECK(GetWindowStructureRgn);
    2210 #endif
    2211         if (!PyArg_ParseTuple(_args, "O&",
    2212                               ResObj_Convert, &r))
    2213                 return NULL;
    2214         GetWindowStructureRgn(_self->ob_itself,
    2215                               r);
    2216         Py_INCREF(Py_None);
    2217         _res = Py_None;
    2218         return _res;
     2209    PyMac_PRECHECK(GetWindowStructureRgn);
     2210#endif
     2211    if (!PyArg_ParseTuple(_args, "O&",
     2212                          ResObj_Convert, &r))
     2213        return NULL;
     2214    GetWindowStructureRgn(_self->ob_itself,
     2215                          r);
     2216    Py_INCREF(Py_None);
     2217    _res = Py_None;
     2218    return _res;
    22192219}
    22202220
    22212221static PyObject *WinObj_GetWindowContentRgn(WindowObject *_self, PyObject *_args)
    22222222{
    2223         PyObject *_res = NULL;
    2224         RgnHandle r;
     2223    PyObject *_res = NULL;
     2224    RgnHandle r;
    22252225#ifndef GetWindowContentRgn
    2226         PyMac_PRECHECK(GetWindowContentRgn);
    2227 #endif
    2228         if (!PyArg_ParseTuple(_args, "O&",
    2229                               ResObj_Convert, &r))
    2230                 return NULL;
    2231         GetWindowContentRgn(_self->ob_itself,
    2232                             r);
    2233         Py_INCREF(Py_None);
    2234         _res = Py_None;
    2235         return _res;
     2226    PyMac_PRECHECK(GetWindowContentRgn);
     2227#endif
     2228    if (!PyArg_ParseTuple(_args, "O&",
     2229                          ResObj_Convert, &r))
     2230        return NULL;
     2231    GetWindowContentRgn(_self->ob_itself,
     2232                        r);
     2233    Py_INCREF(Py_None);
     2234    _res = Py_None;
     2235    return _res;
    22362236}
    22372237
    22382238static PyObject *WinObj_GetWindowUpdateRgn(WindowObject *_self, PyObject *_args)
    22392239{
    2240         PyObject *_res = NULL;
    2241         RgnHandle r;
     2240    PyObject *_res = NULL;
     2241    RgnHandle r;
    22422242#ifndef GetWindowUpdateRgn
    2243         PyMac_PRECHECK(GetWindowUpdateRgn);
    2244 #endif
    2245         if (!PyArg_ParseTuple(_args, "O&",
    2246                               ResObj_Convert, &r))
    2247                 return NULL;
    2248         GetWindowUpdateRgn(_self->ob_itself,
    2249                            r);
    2250         Py_INCREF(Py_None);
    2251         _res = Py_None;
    2252         return _res;
     2243    PyMac_PRECHECK(GetWindowUpdateRgn);
     2244#endif
     2245    if (!PyArg_ParseTuple(_args, "O&",
     2246                          ResObj_Convert, &r))
     2247        return NULL;
     2248    GetWindowUpdateRgn(_self->ob_itself,
     2249                       r);
     2250    Py_INCREF(Py_None);
     2251    _res = Py_None;
     2252    return _res;
    22532253}
    22542254
    22552255static PyObject *WinObj_GetNextWindow(WindowObject *_self, PyObject *_args)
    22562256{
    2257         PyObject *_res = NULL;
    2258         WindowPtr _rv;
     2257    PyObject *_res = NULL;
     2258    WindowPtr _rv;
    22592259#ifndef GetNextWindow
    2260         PyMac_PRECHECK(GetNextWindow);
    2261 #endif
    2262         if (!PyArg_ParseTuple(_args, ""))
    2263                 return NULL;
    2264         _rv = GetNextWindow(_self->ob_itself);
    2265         _res = Py_BuildValue("O&",
    2266                              WinObj_WhichWindow, _rv);
    2267         return _res;
     2260    PyMac_PRECHECK(GetNextWindow);
     2261#endif
     2262    if (!PyArg_ParseTuple(_args, ""))
     2263        return NULL;
     2264    _rv = GetNextWindow(_self->ob_itself);
     2265    _res = Py_BuildValue("O&",
     2266                         WinObj_WhichWindow, _rv);
     2267    return _res;
    22682268}
    22692269
    22702270static PyObject *WinObj_MoveWindow(WindowObject *_self, PyObject *_args)
    22712271{
    2272         PyObject *_res = NULL;
    2273         short hGlobal;
    2274         short vGlobal;
    2275         Boolean front;
     2272    PyObject *_res = NULL;
     2273    short hGlobal;
     2274    short vGlobal;
     2275    Boolean front;
    22762276#ifndef MoveWindow
    2277         PyMac_PRECHECK(MoveWindow);
    2278 #endif
    2279         if (!PyArg_ParseTuple(_args, "hhb",
    2280                               &hGlobal,
    2281                               &vGlobal,
    2282                               &front))
    2283                 return NULL;
    2284         MoveWindow(_self->ob_itself,
    2285                    hGlobal,
    2286                    vGlobal,
    2287                    front);
    2288         Py_INCREF(Py_None);
    2289         _res = Py_None;
    2290         return _res;
     2277    PyMac_PRECHECK(MoveWindow);
     2278#endif
     2279    if (!PyArg_ParseTuple(_args, "hhb",
     2280                          &hGlobal,
     2281                          &vGlobal,
     2282                          &front))
     2283        return NULL;
     2284    MoveWindow(_self->ob_itself,
     2285               hGlobal,
     2286               vGlobal,
     2287               front);
     2288    Py_INCREF(Py_None);
     2289    _res = Py_None;
     2290    return _res;
    22912291}
    22922292
    22932293static PyObject *WinObj_ShowWindow(WindowObject *_self, PyObject *_args)
    22942294{
    2295         PyObject *_res = NULL;
     2295    PyObject *_res = NULL;
    22962296#ifndef ShowWindow
    2297         PyMac_PRECHECK(ShowWindow);
    2298 #endif
    2299         if (!PyArg_ParseTuple(_args, ""))
    2300                 return NULL;
    2301         ShowWindow(_self->ob_itself);
    2302         Py_INCREF(Py_None);
    2303         _res = Py_None;
    2304         return _res;
     2297    PyMac_PRECHECK(ShowWindow);
     2298#endif
     2299    if (!PyArg_ParseTuple(_args, ""))
     2300        return NULL;
     2301    ShowWindow(_self->ob_itself);
     2302    Py_INCREF(Py_None);
     2303    _res = Py_None;
     2304    return _res;
    23052305}
    23062306
    23072307static PyObject *WinObj_AutoDispose(WindowObject *_self, PyObject *_args)
    23082308{
    2309         PyObject *_res = NULL;
    2310 
    2311         int onoff, old = 0;
    2312         if (!PyArg_ParseTuple(_args, "i", &onoff))
    2313                 return NULL;
    2314         if ( _self->ob_freeit )
    2315                 old = 1;
    2316         if ( onoff )
    2317                 _self->ob_freeit = PyMac_AutoDisposeWindow;
    2318         else
    2319                 _self->ob_freeit = NULL;
    2320         _res = Py_BuildValue("i", old);
    2321         return _res;
     2309    PyObject *_res = NULL;
     2310
     2311    int onoff, old = 0;
     2312    if (!PyArg_ParseTuple(_args, "i", &onoff))
     2313        return NULL;
     2314    if ( _self->ob_freeit )
     2315        old = 1;
     2316    if ( onoff )
     2317        _self->ob_freeit = PyMac_AutoDisposeWindow;
     2318    else
     2319        _self->ob_freeit = NULL;
     2320    _res = Py_BuildValue("i", old);
     2321    return _res;
    23222322
    23232323}
    23242324
    23252325static PyMethodDef WinObj_methods[] = {
    2326         {"GetWindowOwnerCount", (PyCFunction)WinObj_GetWindowOwnerCount, 1,
    2327         PyDoc_STR("() -> (UInt32 outCount)")},
    2328         {"CloneWindow", (PyCFunction)WinObj_CloneWindow, 1,
    2329         PyDoc_STR("() -> None")},
    2330         {"GetWindowRetainCount", (PyCFunction)WinObj_GetWindowRetainCount, 1,
    2331         PyDoc_STR("() -> (ItemCount _rv)")},
    2332         {"RetainWindow", (PyCFunction)WinObj_RetainWindow, 1,
    2333         PyDoc_STR("() -> None")},
    2334         {"ReleaseWindow", (PyCFunction)WinObj_ReleaseWindow, 1,
    2335         PyDoc_STR("() -> None")},
    2336         {"ReshapeCustomWindow", (PyCFunction)WinObj_ReshapeCustomWindow, 1,
    2337         PyDoc_STR("() -> None")},
    2338         {"GetWindowWidgetHilite", (PyCFunction)WinObj_GetWindowWidgetHilite, 1,
    2339         PyDoc_STR("() -> (WindowDefPartCode outHilite)")},
    2340         {"GetWindowClass", (PyCFunction)WinObj_GetWindowClass, 1,
    2341         PyDoc_STR("() -> (WindowClass outClass)")},
    2342         {"GetWindowAttributes", (PyCFunction)WinObj_GetWindowAttributes, 1,
    2343         PyDoc_STR("() -> (WindowAttributes outAttributes)")},
    2344         {"ChangeWindowAttributes", (PyCFunction)WinObj_ChangeWindowAttributes, 1,
    2345         PyDoc_STR("(WindowAttributes setTheseAttributes, WindowAttributes clearTheseAttributes) -> None")},
    2346         {"SetWindowClass", (PyCFunction)WinObj_SetWindowClass, 1,
    2347         PyDoc_STR("(WindowClass inWindowClass) -> None")},
    2348         {"SetWindowModality", (PyCFunction)WinObj_SetWindowModality, 1,
    2349         PyDoc_STR("(WindowModality inModalKind, WindowPtr inUnavailableWindow) -> None")},
    2350         {"GetWindowModality", (PyCFunction)WinObj_GetWindowModality, 1,
    2351         PyDoc_STR("() -> (WindowModality outModalKind, WindowPtr outUnavailableWindow)")},
    2352         {"SetWindowContentColor", (PyCFunction)WinObj_SetWindowContentColor, 1,
    2353         PyDoc_STR("(RGBColor color) -> None")},
    2354         {"GetWindowContentColor", (PyCFunction)WinObj_GetWindowContentColor, 1,
    2355         PyDoc_STR("() -> (RGBColor color)")},
    2356         {"GetWindowContentPattern", (PyCFunction)WinObj_GetWindowContentPattern, 1,
    2357         PyDoc_STR("(PixPatHandle outPixPat) -> None")},
    2358         {"SetWindowContentPattern", (PyCFunction)WinObj_SetWindowContentPattern, 1,
    2359         PyDoc_STR("(PixPatHandle pixPat) -> None")},
    2360         {"ScrollWindowRect", (PyCFunction)WinObj_ScrollWindowRect, 1,
    2361         PyDoc_STR("(Rect inScrollRect, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
    2362         {"ScrollWindowRegion", (PyCFunction)WinObj_ScrollWindowRegion, 1,
    2363         PyDoc_STR("(RgnHandle inScrollRgn, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
    2364         {"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1,
    2365         PyDoc_STR("() -> None")},
    2366         {"PaintOne", (PyCFunction)WinObj_PaintOne, 1,
    2367         PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
    2368         {"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1,
    2369         PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
    2370         {"CalcVis", (PyCFunction)WinObj_CalcVis, 1,
    2371         PyDoc_STR("() -> None")},
    2372         {"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1,
    2373         PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
    2374         {"BringToFront", (PyCFunction)WinObj_BringToFront, 1,
    2375         PyDoc_STR("() -> None")},
    2376         {"SendBehind", (PyCFunction)WinObj_SendBehind, 1,
    2377         PyDoc_STR("(WindowPtr behindWindow) -> None")},
    2378         {"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1,
    2379         PyDoc_STR("() -> None")},
    2380         {"GetNextWindowOfClass", (PyCFunction)WinObj_GetNextWindowOfClass, 1,
    2381         PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
    2382         {"SetWindowAlternateTitle", (PyCFunction)WinObj_SetWindowAlternateTitle, 1,
    2383         PyDoc_STR("(CFStringRef inTitle) -> None")},
    2384         {"CopyWindowAlternateTitle", (PyCFunction)WinObj_CopyWindowAlternateTitle, 1,
    2385         PyDoc_STR("() -> (CFStringRef outTitle)")},
    2386         {"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1,
    2387         PyDoc_STR("(Boolean fHilite) -> None")},
    2388         {"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1,
    2389         PyDoc_STR("(long data) -> None")},
    2390         {"GetWRefCon", (PyCFunction)WinObj_GetWRefCon, 1,
    2391         PyDoc_STR("() -> (long _rv)")},
    2392         {"SetWindowPic", (PyCFunction)WinObj_SetWindowPic, 1,
    2393         PyDoc_STR("(PicHandle pic) -> None")},
    2394         {"GetWindowPic", (PyCFunction)WinObj_GetWindowPic, 1,
    2395         PyDoc_STR("() -> (PicHandle _rv)")},
    2396         {"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1,
    2397         PyDoc_STR("() -> (short _rv)")},
    2398         {"GetWindowFeatures", (PyCFunction)WinObj_GetWindowFeatures, 1,
    2399         PyDoc_STR("() -> (UInt32 outFeatures)")},
    2400         {"GetWindowRegion", (PyCFunction)WinObj_GetWindowRegion, 1,
    2401         PyDoc_STR("(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> None")},
    2402         {"GetWindowStructureWidths", (PyCFunction)WinObj_GetWindowStructureWidths, 1,
    2403         PyDoc_STR("() -> (Rect outRect)")},
    2404         {"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1,
    2405         PyDoc_STR("() -> None")},
    2406         {"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1,
    2407         PyDoc_STR("() -> None")},
    2408         {"InvalWindowRgn", (PyCFunction)WinObj_InvalWindowRgn, 1,
    2409         PyDoc_STR("(RgnHandle region) -> None")},
    2410         {"InvalWindowRect", (PyCFunction)WinObj_InvalWindowRect, 1,
    2411         PyDoc_STR("(Rect bounds) -> None")},
    2412         {"ValidWindowRgn", (PyCFunction)WinObj_ValidWindowRgn, 1,
    2413         PyDoc_STR("(RgnHandle region) -> None")},
    2414         {"ValidWindowRect", (PyCFunction)WinObj_ValidWindowRect, 1,
    2415         PyDoc_STR("(Rect bounds) -> None")},
    2416         {"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1,
    2417         PyDoc_STR("() -> None")},
    2418         {"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1,
    2419         PyDoc_STR("(Str255 title) -> None")},
    2420         {"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1,
    2421         PyDoc_STR("() -> (Str255 title)")},
    2422         {"SetWindowTitleWithCFString", (PyCFunction)WinObj_SetWindowTitleWithCFString, 1,
    2423         PyDoc_STR("(CFStringRef inString) -> None")},
    2424         {"CopyWindowTitleAsCFString", (PyCFunction)WinObj_CopyWindowTitleAsCFString, 1,
    2425         PyDoc_STR("() -> (CFStringRef outString)")},
    2426         {"SetWindowProxyFSSpec", (PyCFunction)WinObj_SetWindowProxyFSSpec, 1,
    2427         PyDoc_STR("(FSSpec inFile) -> None")},
    2428         {"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1,
    2429         PyDoc_STR("() -> (FSSpec outFile)")},
    2430         {"SetWindowProxyAlias", (PyCFunction)WinObj_SetWindowProxyAlias, 1,
    2431         PyDoc_STR("(AliasHandle inAlias) -> None")},
    2432         {"GetWindowProxyAlias", (PyCFunction)WinObj_GetWindowProxyAlias, 1,
    2433         PyDoc_STR("() -> (AliasHandle alias)")},
    2434         {"SetWindowProxyCreatorAndType", (PyCFunction)WinObj_SetWindowProxyCreatorAndType, 1,
    2435         PyDoc_STR("(OSType fileCreator, OSType fileType, SInt16 vRefNum) -> None")},
    2436         {"GetWindowProxyIcon", (PyCFunction)WinObj_GetWindowProxyIcon, 1,
    2437         PyDoc_STR("() -> (IconRef outIcon)")},
    2438         {"SetWindowProxyIcon", (PyCFunction)WinObj_SetWindowProxyIcon, 1,
    2439         PyDoc_STR("(IconRef icon) -> None")},
    2440         {"RemoveWindowProxy", (PyCFunction)WinObj_RemoveWindowProxy, 1,
    2441         PyDoc_STR("() -> None")},
    2442         {"BeginWindowProxyDrag", (PyCFunction)WinObj_BeginWindowProxyDrag, 1,
    2443         PyDoc_STR("(RgnHandle outDragOutlineRgn) -> (DragReference outNewDrag)")},
    2444         {"EndWindowProxyDrag", (PyCFunction)WinObj_EndWindowProxyDrag, 1,
    2445         PyDoc_STR("(DragReference theDrag) -> None")},
    2446         {"TrackWindowProxyFromExistingDrag", (PyCFunction)WinObj_TrackWindowProxyFromExistingDrag, 1,
    2447         PyDoc_STR("(Point startPt, DragReference drag, RgnHandle inDragOutlineRgn) -> None")},
    2448         {"TrackWindowProxyDrag", (PyCFunction)WinObj_TrackWindowProxyDrag, 1,
    2449         PyDoc_STR("(Point startPt) -> None")},
    2450         {"IsWindowModified", (PyCFunction)WinObj_IsWindowModified, 1,
    2451         PyDoc_STR("() -> (Boolean _rv)")},
    2452         {"SetWindowModified", (PyCFunction)WinObj_SetWindowModified, 1,
    2453         PyDoc_STR("(Boolean modified) -> None")},
    2454         {"IsWindowPathSelectClick", (PyCFunction)WinObj_IsWindowPathSelectClick, 1,
    2455         PyDoc_STR("(EventRecord event) -> (Boolean _rv)")},
    2456         {"WindowPathSelect", (PyCFunction)WinObj_WindowPathSelect, 1,
    2457         PyDoc_STR("(MenuHandle menu) -> (SInt32 outMenuResult)")},
    2458         {"HiliteWindowFrameForDrag", (PyCFunction)WinObj_HiliteWindowFrameForDrag, 1,
    2459         PyDoc_STR("(Boolean hilited) -> None")},
    2460         {"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1,
    2461         PyDoc_STR("(WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
    2462         {"TransitionWindowAndParent", (PyCFunction)WinObj_TransitionWindowAndParent, 1,
    2463         PyDoc_STR("(WindowPtr inParentWindow, WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
    2464         {"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1,
    2465         PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
    2466         {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1,
    2467         PyDoc_STR("(short w, short h, Boolean fUpdate) -> None")},
    2468         {"GrowWindow", (PyCFunction)WinObj_GrowWindow, 1,
    2469         PyDoc_STR("(Point startPt, Rect bBox) -> (long _rv)")},
    2470         {"DragWindow", (PyCFunction)WinObj_DragWindow, 1,
    2471         PyDoc_STR("(Point startPt, Rect boundsRect) -> None")},
    2472         {"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1,
    2473         PyDoc_STR("(WindowPartCode partCode, Boolean front) -> None")},
    2474         {"IsWindowCollapsable", (PyCFunction)WinObj_IsWindowCollapsable, 1,
    2475         PyDoc_STR("() -> (Boolean _rv)")},
    2476         {"IsWindowCollapsed", (PyCFunction)WinObj_IsWindowCollapsed, 1,
    2477         PyDoc_STR("() -> (Boolean _rv)")},
    2478         {"CollapseWindow", (PyCFunction)WinObj_CollapseWindow, 1,
    2479         PyDoc_STR("(Boolean collapse) -> None")},
    2480         {"GetWindowBounds", (PyCFunction)WinObj_GetWindowBounds, 1,
    2481         PyDoc_STR("(WindowRegionCode regionCode) -> (Rect globalBounds)")},
    2482         {"ResizeWindow", (PyCFunction)WinObj_ResizeWindow, 1,
    2483         PyDoc_STR("(Point inStartPoint, Rect inSizeConstraints) -> (Boolean _rv, Rect outNewContentRect)")},
    2484         {"SetWindowBounds", (PyCFunction)WinObj_SetWindowBounds, 1,
    2485         PyDoc_STR("(WindowRegionCode regionCode, Rect globalBounds) -> None")},
    2486         {"RepositionWindow", (PyCFunction)WinObj_RepositionWindow, 1,
    2487         PyDoc_STR("(WindowPtr parentWindow, WindowPositionMethod method) -> None")},
    2488         {"MoveWindowStructure", (PyCFunction)WinObj_MoveWindowStructure, 1,
    2489         PyDoc_STR("(short hGlobal, short vGlobal) -> None")},
    2490         {"IsWindowInStandardState", (PyCFunction)WinObj_IsWindowInStandardState, 1,
    2491         PyDoc_STR("(Point inIdealSize) -> (Boolean _rv, Rect outIdealStandardState)")},
    2492         {"ZoomWindowIdeal", (PyCFunction)WinObj_ZoomWindowIdeal, 1,
    2493         PyDoc_STR("(WindowPartCode inPartCode) -> (Point ioIdealSize)")},
    2494         {"GetWindowIdealUserState", (PyCFunction)WinObj_GetWindowIdealUserState, 1,
    2495         PyDoc_STR("() -> (Rect outUserState)")},
    2496         {"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1,
    2497         PyDoc_STR("(Rect inUserState) -> None")},
    2498         {"GetWindowGreatestAreaDevice", (PyCFunction)WinObj_GetWindowGreatestAreaDevice, 1,
    2499         PyDoc_STR("(WindowRegionCode inRegion) -> (GDHandle outGreatestDevice, Rect outGreatestDeviceRect)")},
    2500         {"ConstrainWindowToScreen", (PyCFunction)WinObj_ConstrainWindowToScreen, 1,
    2501         PyDoc_STR("(WindowRegionCode inRegionCode, WindowConstrainOptions inOptions, Rect inScreenRect) -> (Rect outStructure)")},
    2502         {"HideWindow", (PyCFunction)WinObj_HideWindow, 1,
    2503         PyDoc_STR("() -> None")},
    2504         {"MacShowWindow", (PyCFunction)WinObj_MacShowWindow, 1,
    2505         PyDoc_STR("() -> None")},
    2506         {"ShowHide", (PyCFunction)WinObj_ShowHide, 1,
    2507         PyDoc_STR("(Boolean showFlag) -> None")},
    2508         {"MacIsWindowVisible", (PyCFunction)WinObj_MacIsWindowVisible, 1,
    2509         PyDoc_STR("() -> (Boolean _rv)")},
    2510         {"ShowSheetWindow", (PyCFunction)WinObj_ShowSheetWindow, 1,
    2511         PyDoc_STR("(WindowPtr inParentWindow) -> None")},
    2512         {"HideSheetWindow", (PyCFunction)WinObj_HideSheetWindow, 1,
    2513         PyDoc_STR("() -> None")},
    2514         {"GetSheetWindowParent", (PyCFunction)WinObj_GetSheetWindowParent, 1,
    2515         PyDoc_STR("() -> (WindowPtr outParentWindow)")},
    2516         {"GetWindowPropertyAttributes", (PyCFunction)WinObj_GetWindowPropertyAttributes, 1,
    2517         PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
    2518         {"ChangeWindowPropertyAttributes", (PyCFunction)WinObj_ChangeWindowPropertyAttributes, 1,
    2519         PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
    2520         {"TrackBox", (PyCFunction)WinObj_TrackBox, 1,
    2521         PyDoc_STR("(Point thePt, WindowPartCode partCode) -> (Boolean _rv)")},
    2522         {"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1,
    2523         PyDoc_STR("(Point thePt) -> (Boolean _rv)")},
    2524         {"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1,
    2525         PyDoc_STR("() -> (CGrafPtr _rv)")},
    2526         {"GetWindowStructurePort", (PyCFunction)WinObj_GetWindowStructurePort, 1,
    2527         PyDoc_STR("() -> (CGrafPtr _rv)")},
    2528         {"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1,
    2529         PyDoc_STR("() -> (short _rv)")},
    2530         {"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1,
    2531         PyDoc_STR("() -> (Boolean _rv)")},
    2532         {"IsWindowUpdatePending", (PyCFunction)WinObj_IsWindowUpdatePending, 1,
    2533         PyDoc_STR("() -> (Boolean _rv)")},
    2534         {"MacGetNextWindow", (PyCFunction)WinObj_MacGetNextWindow, 1,
    2535         PyDoc_STR("() -> (WindowPtr _rv)")},
    2536         {"GetWindowStandardState", (PyCFunction)WinObj_GetWindowStandardState, 1,
    2537         PyDoc_STR("() -> (Rect rect)")},
    2538         {"GetWindowUserState", (PyCFunction)WinObj_GetWindowUserState, 1,
    2539         PyDoc_STR("() -> (Rect rect)")},
    2540         {"SetWindowKind", (PyCFunction)WinObj_SetWindowKind, 1,
    2541         PyDoc_STR("(short kind) -> None")},
    2542         {"SetWindowStandardState", (PyCFunction)WinObj_SetWindowStandardState, 1,
    2543         PyDoc_STR("(Rect rect) -> None")},
    2544         {"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1,
    2545         PyDoc_STR("(Rect rect) -> None")},
    2546         {"SetPortWindowPort", (PyCFunction)WinObj_SetPortWindowPort, 1,
    2547         PyDoc_STR("() -> None")},
    2548         {"GetWindowPortBounds", (PyCFunction)WinObj_GetWindowPortBounds, 1,
    2549         PyDoc_STR("() -> (Rect bounds)")},
    2550         {"IsWindowVisible", (PyCFunction)WinObj_IsWindowVisible, 1,
    2551         PyDoc_STR("() -> (Boolean _rv)")},
    2552         {"GetWindowStructureRgn", (PyCFunction)WinObj_GetWindowStructureRgn, 1,
    2553         PyDoc_STR("(RgnHandle r) -> None")},
    2554         {"GetWindowContentRgn", (PyCFunction)WinObj_GetWindowContentRgn, 1,
    2555         PyDoc_STR("(RgnHandle r) -> None")},
    2556         {"GetWindowUpdateRgn", (PyCFunction)WinObj_GetWindowUpdateRgn, 1,
    2557         PyDoc_STR("(RgnHandle r) -> None")},
    2558         {"GetNextWindow", (PyCFunction)WinObj_GetNextWindow, 1,
    2559         PyDoc_STR("() -> (WindowPtr _rv)")},
    2560         {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
    2561         PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
    2562         {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1,
    2563         PyDoc_STR("() -> None")},
    2564         {"AutoDispose", (PyCFunction)WinObj_AutoDispose, 1,
    2565         PyDoc_STR("(int)->int. Automatically DisposeHandle the object on Python object cleanup")},
    2566         {NULL, NULL, 0}
     2326    {"GetWindowOwnerCount", (PyCFunction)WinObj_GetWindowOwnerCount, 1,
     2327    PyDoc_STR("() -> (UInt32 outCount)")},
     2328    {"CloneWindow", (PyCFunction)WinObj_CloneWindow, 1,
     2329    PyDoc_STR("() -> None")},
     2330    {"GetWindowRetainCount", (PyCFunction)WinObj_GetWindowRetainCount, 1,
     2331    PyDoc_STR("() -> (ItemCount _rv)")},
     2332    {"RetainWindow", (PyCFunction)WinObj_RetainWindow, 1,
     2333    PyDoc_STR("() -> None")},
     2334    {"ReleaseWindow", (PyCFunction)WinObj_ReleaseWindow, 1,
     2335    PyDoc_STR("() -> None")},
     2336    {"ReshapeCustomWindow", (PyCFunction)WinObj_ReshapeCustomWindow, 1,
     2337    PyDoc_STR("() -> None")},
     2338    {"GetWindowWidgetHilite", (PyCFunction)WinObj_GetWindowWidgetHilite, 1,
     2339    PyDoc_STR("() -> (WindowDefPartCode outHilite)")},
     2340    {"GetWindowClass", (PyCFunction)WinObj_GetWindowClass, 1,
     2341    PyDoc_STR("() -> (WindowClass outClass)")},
     2342    {"GetWindowAttributes", (PyCFunction)WinObj_GetWindowAttributes, 1,
     2343    PyDoc_STR("() -> (WindowAttributes outAttributes)")},
     2344    {"ChangeWindowAttributes", (PyCFunction)WinObj_ChangeWindowAttributes, 1,
     2345    PyDoc_STR("(WindowAttributes setTheseAttributes, WindowAttributes clearTheseAttributes) -> None")},
     2346    {"SetWindowClass", (PyCFunction)WinObj_SetWindowClass, 1,
     2347    PyDoc_STR("(WindowClass inWindowClass) -> None")},
     2348    {"SetWindowModality", (PyCFunction)WinObj_SetWindowModality, 1,
     2349    PyDoc_STR("(WindowModality inModalKind, WindowPtr inUnavailableWindow) -> None")},
     2350    {"GetWindowModality", (PyCFunction)WinObj_GetWindowModality, 1,
     2351    PyDoc_STR("() -> (WindowModality outModalKind, WindowPtr outUnavailableWindow)")},
     2352    {"SetWindowContentColor", (PyCFunction)WinObj_SetWindowContentColor, 1,
     2353    PyDoc_STR("(RGBColor color) -> None")},
     2354    {"GetWindowContentColor", (PyCFunction)WinObj_GetWindowContentColor, 1,
     2355    PyDoc_STR("() -> (RGBColor color)")},
     2356    {"GetWindowContentPattern", (PyCFunction)WinObj_GetWindowContentPattern, 1,
     2357    PyDoc_STR("(PixPatHandle outPixPat) -> None")},
     2358    {"SetWindowContentPattern", (PyCFunction)WinObj_SetWindowContentPattern, 1,
     2359    PyDoc_STR("(PixPatHandle pixPat) -> None")},
     2360    {"ScrollWindowRect", (PyCFunction)WinObj_ScrollWindowRect, 1,
     2361    PyDoc_STR("(Rect inScrollRect, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
     2362    {"ScrollWindowRegion", (PyCFunction)WinObj_ScrollWindowRegion, 1,
     2363    PyDoc_STR("(RgnHandle inScrollRgn, SInt16 inHPixels, SInt16 inVPixels, ScrollWindowOptions inOptions, RgnHandle outExposedRgn) -> None")},
     2364    {"ClipAbove", (PyCFunction)WinObj_ClipAbove, 1,
     2365    PyDoc_STR("() -> None")},
     2366    {"PaintOne", (PyCFunction)WinObj_PaintOne, 1,
     2367    PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
     2368    {"PaintBehind", (PyCFunction)WinObj_PaintBehind, 1,
     2369    PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
     2370    {"CalcVis", (PyCFunction)WinObj_CalcVis, 1,
     2371    PyDoc_STR("() -> None")},
     2372    {"CalcVisBehind", (PyCFunction)WinObj_CalcVisBehind, 1,
     2373    PyDoc_STR("(RgnHandle clobberedRgn) -> None")},
     2374    {"BringToFront", (PyCFunction)WinObj_BringToFront, 1,
     2375    PyDoc_STR("() -> None")},
     2376    {"SendBehind", (PyCFunction)WinObj_SendBehind, 1,
     2377    PyDoc_STR("(WindowPtr behindWindow) -> None")},
     2378    {"SelectWindow", (PyCFunction)WinObj_SelectWindow, 1,
     2379    PyDoc_STR("() -> None")},
     2380    {"GetNextWindowOfClass", (PyCFunction)WinObj_GetNextWindowOfClass, 1,
     2381    PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
     2382    {"SetWindowAlternateTitle", (PyCFunction)WinObj_SetWindowAlternateTitle, 1,
     2383    PyDoc_STR("(CFStringRef inTitle) -> None")},
     2384    {"CopyWindowAlternateTitle", (PyCFunction)WinObj_CopyWindowAlternateTitle, 1,
     2385    PyDoc_STR("() -> (CFStringRef outTitle)")},
     2386    {"HiliteWindow", (PyCFunction)WinObj_HiliteWindow, 1,
     2387    PyDoc_STR("(Boolean fHilite) -> None")},
     2388    {"SetWRefCon", (PyCFunction)WinObj_SetWRefCon, 1,
     2389    PyDoc_STR("(long data) -> None")},
     2390    {"GetWRefCon", (PyCFunction)WinObj_GetWRefCon, 1,
     2391    PyDoc_STR("() -> (long _rv)")},
     2392    {"SetWindowPic", (PyCFunction)WinObj_SetWindowPic, 1,
     2393    PyDoc_STR("(PicHandle pic) -> None")},
     2394    {"GetWindowPic", (PyCFunction)WinObj_GetWindowPic, 1,
     2395    PyDoc_STR("() -> (PicHandle _rv)")},
     2396    {"GetWVariant", (PyCFunction)WinObj_GetWVariant, 1,
     2397    PyDoc_STR("() -> (short _rv)")},
     2398    {"GetWindowFeatures", (PyCFunction)WinObj_GetWindowFeatures, 1,
     2399    PyDoc_STR("() -> (UInt32 outFeatures)")},
     2400    {"GetWindowRegion", (PyCFunction)WinObj_GetWindowRegion, 1,
     2401    PyDoc_STR("(WindowRegionCode inRegionCode, RgnHandle ioWinRgn) -> None")},
     2402    {"GetWindowStructureWidths", (PyCFunction)WinObj_GetWindowStructureWidths, 1,
     2403    PyDoc_STR("() -> (Rect outRect)")},
     2404    {"BeginUpdate", (PyCFunction)WinObj_BeginUpdate, 1,
     2405    PyDoc_STR("() -> None")},
     2406    {"EndUpdate", (PyCFunction)WinObj_EndUpdate, 1,
     2407    PyDoc_STR("() -> None")},
     2408    {"InvalWindowRgn", (PyCFunction)WinObj_InvalWindowRgn, 1,
     2409    PyDoc_STR("(RgnHandle region) -> None")},
     2410    {"InvalWindowRect", (PyCFunction)WinObj_InvalWindowRect, 1,
     2411    PyDoc_STR("(Rect bounds) -> None")},
     2412    {"ValidWindowRgn", (PyCFunction)WinObj_ValidWindowRgn, 1,
     2413    PyDoc_STR("(RgnHandle region) -> None")},
     2414    {"ValidWindowRect", (PyCFunction)WinObj_ValidWindowRect, 1,
     2415    PyDoc_STR("(Rect bounds) -> None")},
     2416    {"DrawGrowIcon", (PyCFunction)WinObj_DrawGrowIcon, 1,
     2417    PyDoc_STR("() -> None")},
     2418    {"SetWTitle", (PyCFunction)WinObj_SetWTitle, 1,
     2419    PyDoc_STR("(Str255 title) -> None")},
     2420    {"GetWTitle", (PyCFunction)WinObj_GetWTitle, 1,
     2421    PyDoc_STR("() -> (Str255 title)")},
     2422    {"SetWindowTitleWithCFString", (PyCFunction)WinObj_SetWindowTitleWithCFString, 1,
     2423    PyDoc_STR("(CFStringRef inString) -> None")},
     2424    {"CopyWindowTitleAsCFString", (PyCFunction)WinObj_CopyWindowTitleAsCFString, 1,
     2425    PyDoc_STR("() -> (CFStringRef outString)")},
     2426    {"SetWindowProxyFSSpec", (PyCFunction)WinObj_SetWindowProxyFSSpec, 1,
     2427    PyDoc_STR("(FSSpec inFile) -> None")},
     2428    {"GetWindowProxyFSSpec", (PyCFunction)WinObj_GetWindowProxyFSSpec, 1,
     2429    PyDoc_STR("() -> (FSSpec outFile)")},
     2430    {"SetWindowProxyAlias", (PyCFunction)WinObj_SetWindowProxyAlias, 1,
     2431    PyDoc_STR("(AliasHandle inAlias) -> None")},
     2432    {"GetWindowProxyAlias", (PyCFunction)WinObj_GetWindowProxyAlias, 1,
     2433    PyDoc_STR("() -> (AliasHandle alias)")},
     2434    {"SetWindowProxyCreatorAndType", (PyCFunction)WinObj_SetWindowProxyCreatorAndType, 1,
     2435    PyDoc_STR("(OSType fileCreator, OSType fileType, SInt16 vRefNum) -> None")},
     2436    {"GetWindowProxyIcon", (PyCFunction)WinObj_GetWindowProxyIcon, 1,
     2437    PyDoc_STR("() -> (IconRef outIcon)")},
     2438    {"SetWindowProxyIcon", (PyCFunction)WinObj_SetWindowProxyIcon, 1,
     2439    PyDoc_STR("(IconRef icon) -> None")},
     2440    {"RemoveWindowProxy", (PyCFunction)WinObj_RemoveWindowProxy, 1,
     2441    PyDoc_STR("() -> None")},
     2442    {"BeginWindowProxyDrag", (PyCFunction)WinObj_BeginWindowProxyDrag, 1,
     2443    PyDoc_STR("(RgnHandle outDragOutlineRgn) -> (DragReference outNewDrag)")},
     2444    {"EndWindowProxyDrag", (PyCFunction)WinObj_EndWindowProxyDrag, 1,
     2445    PyDoc_STR("(DragReference theDrag) -> None")},
     2446    {"TrackWindowProxyFromExistingDrag", (PyCFunction)WinObj_TrackWindowProxyFromExistingDrag, 1,
     2447    PyDoc_STR("(Point startPt, DragReference drag, RgnHandle inDragOutlineRgn) -> None")},
     2448    {"TrackWindowProxyDrag", (PyCFunction)WinObj_TrackWindowProxyDrag, 1,
     2449    PyDoc_STR("(Point startPt) -> None")},
     2450    {"IsWindowModified", (PyCFunction)WinObj_IsWindowModified, 1,
     2451    PyDoc_STR("() -> (Boolean _rv)")},
     2452    {"SetWindowModified", (PyCFunction)WinObj_SetWindowModified, 1,
     2453    PyDoc_STR("(Boolean modified) -> None")},
     2454    {"IsWindowPathSelectClick", (PyCFunction)WinObj_IsWindowPathSelectClick, 1,
     2455    PyDoc_STR("(EventRecord event) -> (Boolean _rv)")},
     2456    {"WindowPathSelect", (PyCFunction)WinObj_WindowPathSelect, 1,
     2457    PyDoc_STR("(MenuHandle menu) -> (SInt32 outMenuResult)")},
     2458    {"HiliteWindowFrameForDrag", (PyCFunction)WinObj_HiliteWindowFrameForDrag, 1,
     2459    PyDoc_STR("(Boolean hilited) -> None")},
     2460    {"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1,
     2461    PyDoc_STR("(WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
     2462    {"TransitionWindowAndParent", (PyCFunction)WinObj_TransitionWindowAndParent, 1,
     2463    PyDoc_STR("(WindowPtr inParentWindow, WindowTransitionEffect inEffect, WindowTransitionAction inAction, Rect inRect) -> None")},
     2464    {"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1,
     2465    PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
     2466    {"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1,
     2467    PyDoc_STR("(short w, short h, Boolean fUpdate) -> None")},
     2468    {"GrowWindow", (PyCFunction)WinObj_GrowWindow, 1,
     2469    PyDoc_STR("(Point startPt, Rect bBox) -> (long _rv)")},
     2470    {"DragWindow", (PyCFunction)WinObj_DragWindow, 1,
     2471    PyDoc_STR("(Point startPt, Rect boundsRect) -> None")},
     2472    {"ZoomWindow", (PyCFunction)WinObj_ZoomWindow, 1,
     2473    PyDoc_STR("(WindowPartCode partCode, Boolean front) -> None")},
     2474    {"IsWindowCollapsable", (PyCFunction)WinObj_IsWindowCollapsable, 1,
     2475    PyDoc_STR("() -> (Boolean _rv)")},
     2476    {"IsWindowCollapsed", (PyCFunction)WinObj_IsWindowCollapsed, 1,
     2477    PyDoc_STR("() -> (Boolean _rv)")},
     2478    {"CollapseWindow", (PyCFunction)WinObj_CollapseWindow, 1,
     2479    PyDoc_STR("(Boolean collapse) -> None")},
     2480    {"GetWindowBounds", (PyCFunction)WinObj_GetWindowBounds, 1,
     2481    PyDoc_STR("(WindowRegionCode regionCode) -> (Rect globalBounds)")},
     2482    {"ResizeWindow", (PyCFunction)WinObj_ResizeWindow, 1,
     2483    PyDoc_STR("(Point inStartPoint, Rect inSizeConstraints) -> (Boolean _rv, Rect outNewContentRect)")},
     2484    {"SetWindowBounds", (PyCFunction)WinObj_SetWindowBounds, 1,
     2485    PyDoc_STR("(WindowRegionCode regionCode, Rect globalBounds) -> None")},
     2486    {"RepositionWindow", (PyCFunction)WinObj_RepositionWindow, 1,
     2487    PyDoc_STR("(WindowPtr parentWindow, WindowPositionMethod method) -> None")},
     2488    {"MoveWindowStructure", (PyCFunction)WinObj_MoveWindowStructure, 1,
     2489    PyDoc_STR("(short hGlobal, short vGlobal) -> None")},
     2490    {"IsWindowInStandardState", (PyCFunction)WinObj_IsWindowInStandardState, 1,
     2491    PyDoc_STR("(Point inIdealSize) -> (Boolean _rv, Rect outIdealStandardState)")},
     2492    {"ZoomWindowIdeal", (PyCFunction)WinObj_ZoomWindowIdeal, 1,
     2493    PyDoc_STR("(WindowPartCode inPartCode) -> (Point ioIdealSize)")},
     2494    {"GetWindowIdealUserState", (PyCFunction)WinObj_GetWindowIdealUserState, 1,
     2495    PyDoc_STR("() -> (Rect outUserState)")},
     2496    {"SetWindowIdealUserState", (PyCFunction)WinObj_SetWindowIdealUserState, 1,
     2497    PyDoc_STR("(Rect inUserState) -> None")},
     2498    {"GetWindowGreatestAreaDevice", (PyCFunction)WinObj_GetWindowGreatestAreaDevice, 1,
     2499    PyDoc_STR("(WindowRegionCode inRegion) -> (GDHandle outGreatestDevice, Rect outGreatestDeviceRect)")},
     2500    {"ConstrainWindowToScreen", (PyCFunction)WinObj_ConstrainWindowToScreen, 1,
     2501    PyDoc_STR("(WindowRegionCode inRegionCode, WindowConstrainOptions inOptions, Rect inScreenRect) -> (Rect outStructure)")},
     2502    {"HideWindow", (PyCFunction)WinObj_HideWindow, 1,
     2503    PyDoc_STR("() -> None")},
     2504    {"MacShowWindow", (PyCFunction)WinObj_MacShowWindow, 1,
     2505    PyDoc_STR("() -> None")},
     2506    {"ShowHide", (PyCFunction)WinObj_ShowHide, 1,
     2507    PyDoc_STR("(Boolean showFlag) -> None")},
     2508    {"MacIsWindowVisible", (PyCFunction)WinObj_MacIsWindowVisible, 1,
     2509    PyDoc_STR("() -> (Boolean _rv)")},
     2510    {"ShowSheetWindow", (PyCFunction)WinObj_ShowSheetWindow, 1,
     2511    PyDoc_STR("(WindowPtr inParentWindow) -> None")},
     2512    {"HideSheetWindow", (PyCFunction)WinObj_HideSheetWindow, 1,
     2513    PyDoc_STR("() -> None")},
     2514    {"GetSheetWindowParent", (PyCFunction)WinObj_GetSheetWindowParent, 1,
     2515    PyDoc_STR("() -> (WindowPtr outParentWindow)")},
     2516    {"GetWindowPropertyAttributes", (PyCFunction)WinObj_GetWindowPropertyAttributes, 1,
     2517    PyDoc_STR("(OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
     2518    {"ChangeWindowPropertyAttributes", (PyCFunction)WinObj_ChangeWindowPropertyAttributes, 1,
     2519    PyDoc_STR("(OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
     2520    {"TrackBox", (PyCFunction)WinObj_TrackBox, 1,
     2521    PyDoc_STR("(Point thePt, WindowPartCode partCode) -> (Boolean _rv)")},
     2522    {"TrackGoAway", (PyCFunction)WinObj_TrackGoAway, 1,
     2523    PyDoc_STR("(Point thePt) -> (Boolean _rv)")},
     2524    {"GetWindowPort", (PyCFunction)WinObj_GetWindowPort, 1,
     2525    PyDoc_STR("() -> (CGrafPtr _rv)")},
     2526    {"GetWindowStructurePort", (PyCFunction)WinObj_GetWindowStructurePort, 1,
     2527    PyDoc_STR("() -> (CGrafPtr _rv)")},
     2528    {"GetWindowKind", (PyCFunction)WinObj_GetWindowKind, 1,
     2529    PyDoc_STR("() -> (short _rv)")},
     2530    {"IsWindowHilited", (PyCFunction)WinObj_IsWindowHilited, 1,
     2531    PyDoc_STR("() -> (Boolean _rv)")},
     2532    {"IsWindowUpdatePending", (PyCFunction)WinObj_IsWindowUpdatePending, 1,
     2533    PyDoc_STR("() -> (Boolean _rv)")},
     2534    {"MacGetNextWindow", (PyCFunction)WinObj_MacGetNextWindow, 1,
     2535    PyDoc_STR("() -> (WindowPtr _rv)")},
     2536    {"GetWindowStandardState", (PyCFunction)WinObj_GetWindowStandardState, 1,
     2537    PyDoc_STR("() -> (Rect rect)")},
     2538    {"GetWindowUserState", (PyCFunction)WinObj_GetWindowUserState, 1,
     2539    PyDoc_STR("() -> (Rect rect)")},
     2540    {"SetWindowKind", (PyCFunction)WinObj_SetWindowKind, 1,
     2541    PyDoc_STR("(short kind) -> None")},
     2542    {"SetWindowStandardState", (PyCFunction)WinObj_SetWindowStandardState, 1,
     2543    PyDoc_STR("(Rect rect) -> None")},
     2544    {"SetWindowUserState", (PyCFunction)WinObj_SetWindowUserState, 1,
     2545    PyDoc_STR("(Rect rect) -> None")},
     2546    {"SetPortWindowPort", (PyCFunction)WinObj_SetPortWindowPort, 1,
     2547    PyDoc_STR("() -> None")},
     2548    {"GetWindowPortBounds", (PyCFunction)WinObj_GetWindowPortBounds, 1,
     2549    PyDoc_STR("() -> (Rect bounds)")},
     2550    {"IsWindowVisible", (PyCFunction)WinObj_IsWindowVisible, 1,
     2551    PyDoc_STR("() -> (Boolean _rv)")},
     2552    {"GetWindowStructureRgn", (PyCFunction)WinObj_GetWindowStructureRgn, 1,
     2553    PyDoc_STR("(RgnHandle r) -> None")},
     2554    {"GetWindowContentRgn", (PyCFunction)WinObj_GetWindowContentRgn, 1,
     2555    PyDoc_STR("(RgnHandle r) -> None")},
     2556    {"GetWindowUpdateRgn", (PyCFunction)WinObj_GetWindowUpdateRgn, 1,
     2557    PyDoc_STR("(RgnHandle r) -> None")},
     2558    {"GetNextWindow", (PyCFunction)WinObj_GetNextWindow, 1,
     2559    PyDoc_STR("() -> (WindowPtr _rv)")},
     2560    {"MoveWindow", (PyCFunction)WinObj_MoveWindow, 1,
     2561    PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
     2562    {"ShowWindow", (PyCFunction)WinObj_ShowWindow, 1,
     2563    PyDoc_STR("() -> None")},
     2564    {"AutoDispose", (PyCFunction)WinObj_AutoDispose, 1,
     2565    PyDoc_STR("(int)->int. Automatically DisposeHandle the object on Python object cleanup")},
     2566    {NULL, NULL, 0}
    25672567};
    25682568
     
    25722572static int WinObj_compare(WindowObject *self, WindowObject *other)
    25732573{
    2574         if ( self->ob_itself > other->ob_itself ) return 1;
    2575         if ( self->ob_itself < other->ob_itself ) return -1;
    2576         return 0;
     2574    if ( self->ob_itself > other->ob_itself ) return 1;
     2575    if ( self->ob_itself < other->ob_itself ) return -1;
     2576    return 0;
    25772577}
    25782578
    25792579static PyObject * WinObj_repr(WindowObject *self)
    25802580{
    2581         char buf[100];
    2582         sprintf(buf, "<Window object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
    2583         return PyString_FromString(buf);
     2581    char buf[100];
     2582    sprintf(buf, "<Window object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
     2583    return PyString_FromString(buf);
    25842584}
    25852585
    25862586static int WinObj_hash(WindowObject *self)
    25872587{
    2588         return (int)self->ob_itself;
     2588    return (int)self->ob_itself;
    25892589}
    25902590#define WinObj_tp_init 0
     
    25942594static PyObject *WinObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
    25952595{
    2596         PyObject *_self;
    2597         WindowPtr itself;
    2598         char *kw[] = {"itself", 0};
    2599 
    2600         if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, WinObj_Convert, &itself)) return NULL;
    2601         if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
    2602         ((WindowObject *)_self)->ob_itself = itself;
    2603         return _self;
     2596    PyObject *_self;
     2597    WindowPtr itself;
     2598    char *kw[] = {"itself", 0};
     2599
     2600    if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, WinObj_Convert, &itself)) return NULL;
     2601    if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
     2602    ((WindowObject *)_self)->ob_itself = itself;
     2603    return _self;
    26042604}
    26052605
     
    26082608
    26092609PyTypeObject Window_Type = {
    2610         PyObject_HEAD_INIT(NULL)
    2611         0, /*ob_size*/
    2612         "_Win.Window", /*tp_name*/
    2613         sizeof(WindowObject), /*tp_basicsize*/
    2614         0, /*tp_itemsize*/
    2615         /* methods */
    2616         (destructor) WinObj_dealloc, /*tp_dealloc*/
    2617         0, /*tp_print*/
    2618         (getattrfunc)0, /*tp_getattr*/
    2619         (setattrfunc)0, /*tp_setattr*/
    2620         (cmpfunc) WinObj_compare, /*tp_compare*/
    2621         (reprfunc) WinObj_repr, /*tp_repr*/
    2622         (PyNumberMethods *)0, /* tp_as_number */
    2623         (PySequenceMethods *)0, /* tp_as_sequence */
    2624         (PyMappingMethods *)0, /* tp_as_mapping */
    2625         (hashfunc) WinObj_hash, /*tp_hash*/
    2626         0, /*tp_call*/
    2627         0, /*tp_str*/
    2628         PyObject_GenericGetAttr, /*tp_getattro*/
    2629         PyObject_GenericSetAttr, /*tp_setattro */
    2630         0, /*tp_as_buffer*/
    2631         Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
    2632         0, /*tp_doc*/
    2633         0, /*tp_traverse*/
    2634         0, /*tp_clear*/
    2635         0, /*tp_richcompare*/
    2636         0, /*tp_weaklistoffset*/
    2637         0, /*tp_iter*/
    2638         0, /*tp_iternext*/
    2639         WinObj_methods, /* tp_methods */
    2640         0, /*tp_members*/
    2641         WinObj_getsetlist, /*tp_getset*/
    2642         0, /*tp_base*/
    2643         0, /*tp_dict*/
    2644         0, /*tp_descr_get*/
    2645         0, /*tp_descr_set*/
    2646         0, /*tp_dictoffset*/
    2647         WinObj_tp_init, /* tp_init */
    2648         WinObj_tp_alloc, /* tp_alloc */
    2649         WinObj_tp_new, /* tp_new */
    2650         WinObj_tp_free, /* tp_free */
     2610    PyObject_HEAD_INIT(NULL)
     2611    0, /*ob_size*/
     2612    "_Win.Window", /*tp_name*/
     2613    sizeof(WindowObject), /*tp_basicsize*/
     2614    0, /*tp_itemsize*/
     2615    /* methods */
     2616    (destructor) WinObj_dealloc, /*tp_dealloc*/
     2617    0, /*tp_print*/
     2618    (getattrfunc)0, /*tp_getattr*/
     2619    (setattrfunc)0, /*tp_setattr*/
     2620    (cmpfunc) WinObj_compare, /*tp_compare*/
     2621    (reprfunc) WinObj_repr, /*tp_repr*/
     2622    (PyNumberMethods *)0, /* tp_as_number */
     2623    (PySequenceMethods *)0, /* tp_as_sequence */
     2624    (PyMappingMethods *)0, /* tp_as_mapping */
     2625    (hashfunc) WinObj_hash, /*tp_hash*/
     2626    0, /*tp_call*/
     2627    0, /*tp_str*/
     2628    PyObject_GenericGetAttr, /*tp_getattro*/
     2629    PyObject_GenericSetAttr, /*tp_setattro */
     2630    0, /*tp_as_buffer*/
     2631    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
     2632    0, /*tp_doc*/
     2633    0, /*tp_traverse*/
     2634    0, /*tp_clear*/
     2635    0, /*tp_richcompare*/
     2636    0, /*tp_weaklistoffset*/
     2637    0, /*tp_iter*/
     2638    0, /*tp_iternext*/
     2639    WinObj_methods, /* tp_methods */
     2640    0, /*tp_members*/
     2641    WinObj_getsetlist, /*tp_getset*/
     2642    0, /*tp_base*/
     2643    0, /*tp_dict*/
     2644    0, /*tp_descr_get*/
     2645    0, /*tp_descr_set*/
     2646    0, /*tp_dictoffset*/
     2647    WinObj_tp_init, /* tp_init */
     2648    WinObj_tp_alloc, /* tp_alloc */
     2649    WinObj_tp_new, /* tp_new */
     2650    WinObj_tp_free, /* tp_free */
    26512651};
    26522652
     
    26562656static PyObject *Win_GetNewCWindow(PyObject *_self, PyObject *_args)
    26572657{
    2658         PyObject *_res = NULL;
    2659         WindowPtr _rv;
    2660         short windowID;
    2661         WindowPtr behind;
     2658    PyObject *_res = NULL;
     2659    WindowPtr _rv;
     2660    short windowID;
     2661    WindowPtr behind;
    26622662#ifndef GetNewCWindow
    2663         PyMac_PRECHECK(GetNewCWindow);
    2664 #endif
    2665         if (!PyArg_ParseTuple(_args, "hO&",
    2666                               &windowID,
    2667                               WinObj_Convert, &behind))
    2668                 return NULL;
    2669         _rv = GetNewCWindow(windowID,
    2670                             (void *)0,
    2671                             behind);
    2672         _res = Py_BuildValue("O&",
    2673                              WinObj_New, _rv);
    2674         return _res;
     2663    PyMac_PRECHECK(GetNewCWindow);
     2664#endif
     2665    if (!PyArg_ParseTuple(_args, "hO&",
     2666                          &windowID,
     2667                          WinObj_Convert, &behind))
     2668        return NULL;
     2669    _rv = GetNewCWindow(windowID,
     2670                        (void *)0,
     2671                        behind);
     2672    _res = Py_BuildValue("O&",
     2673                         WinObj_New, _rv);
     2674    return _res;
    26752675}
    26762676
    26772677static PyObject *Win_NewWindow(PyObject *_self, PyObject *_args)
    26782678{
    2679         PyObject *_res = NULL;
    2680         WindowPtr _rv;
    2681         Rect boundsRect;
    2682         Str255 title;
    2683         Boolean visible;
    2684         short theProc;
    2685         WindowPtr behind;
    2686         Boolean goAwayFlag;
    2687         long refCon;
     2679    PyObject *_res = NULL;
     2680    WindowPtr _rv;
     2681    Rect boundsRect;
     2682    Str255 title;
     2683    Boolean visible;
     2684    short theProc;
     2685    WindowPtr behind;
     2686    Boolean goAwayFlag;
     2687    long refCon;
    26882688#ifndef NewWindow
    2689         PyMac_PRECHECK(NewWindow);
    2690 #endif
    2691         if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
    2692                               PyMac_GetRect, &boundsRect,
    2693                               PyMac_GetStr255, title,
    2694                               &visible,
    2695                               &theProc,
    2696                               WinObj_Convert, &behind,
    2697                               &goAwayFlag,
    2698                               &refCon))
    2699                 return NULL;
    2700         _rv = NewWindow((void *)0,
    2701                         &boundsRect,
    2702                         title,
    2703                         visible,
    2704                         theProc,
    2705                         behind,
    2706                         goAwayFlag,
    2707                         refCon);
    2708         _res = Py_BuildValue("O&",
    2709                              WinObj_New, _rv);
    2710         return _res;
     2689    PyMac_PRECHECK(NewWindow);
     2690#endif
     2691    if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
     2692                          PyMac_GetRect, &boundsRect,
     2693                          PyMac_GetStr255, title,
     2694                          &visible,
     2695                          &theProc,
     2696                          WinObj_Convert, &behind,
     2697                          &goAwayFlag,
     2698                          &refCon))
     2699        return NULL;
     2700    _rv = NewWindow((void *)0,
     2701                    &boundsRect,
     2702                    title,
     2703                    visible,
     2704                    theProc,
     2705                    behind,
     2706                    goAwayFlag,
     2707                    refCon);
     2708    _res = Py_BuildValue("O&",
     2709                         WinObj_New, _rv);
     2710    return _res;
    27112711}
    27122712
    27132713static PyObject *Win_GetNewWindow(PyObject *_self, PyObject *_args)
    27142714{
    2715         PyObject *_res = NULL;
    2716         WindowPtr _rv;
    2717         short windowID;
    2718         WindowPtr behind;
     2715    PyObject *_res = NULL;
     2716    WindowPtr _rv;
     2717    short windowID;
     2718    WindowPtr behind;
    27192719#ifndef GetNewWindow
    2720         PyMac_PRECHECK(GetNewWindow);
    2721 #endif
    2722         if (!PyArg_ParseTuple(_args, "hO&",
    2723                               &windowID,
    2724                               WinObj_Convert, &behind))
    2725                 return NULL;
    2726         _rv = GetNewWindow(windowID,
    2727                            (void *)0,
    2728                            behind);
    2729         _res = Py_BuildValue("O&",
    2730                              WinObj_New, _rv);
    2731         return _res;
     2720    PyMac_PRECHECK(GetNewWindow);
     2721#endif
     2722    if (!PyArg_ParseTuple(_args, "hO&",
     2723                          &windowID,
     2724                          WinObj_Convert, &behind))
     2725        return NULL;
     2726    _rv = GetNewWindow(windowID,
     2727                       (void *)0,
     2728                       behind);
     2729    _res = Py_BuildValue("O&",
     2730                         WinObj_New, _rv);
     2731    return _res;
    27322732}
    27332733
    27342734static PyObject *Win_NewCWindow(PyObject *_self, PyObject *_args)
    27352735{
    2736         PyObject *_res = NULL;
    2737         WindowPtr _rv;
    2738         Rect boundsRect;
    2739         Str255 title;
    2740         Boolean visible;
    2741         short procID;
    2742         WindowPtr behind;
    2743         Boolean goAwayFlag;
    2744         long refCon;
     2736    PyObject *_res = NULL;
     2737    WindowPtr _rv;
     2738    Rect boundsRect;
     2739    Str255 title;
     2740    Boolean visible;
     2741    short procID;
     2742    WindowPtr behind;
     2743    Boolean goAwayFlag;
     2744    long refCon;
    27452745#ifndef NewCWindow
    2746         PyMac_PRECHECK(NewCWindow);
    2747 #endif
    2748         if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
    2749                               PyMac_GetRect, &boundsRect,
    2750                               PyMac_GetStr255, title,
    2751                               &visible,
    2752                               &procID,
    2753                               WinObj_Convert, &behind,
    2754                               &goAwayFlag,
    2755                               &refCon))
    2756                 return NULL;
    2757         _rv = NewCWindow((void *)0,
    2758                          &boundsRect,
    2759                          title,
    2760                          visible,
    2761                          procID,
    2762                          behind,
    2763                          goAwayFlag,
    2764                          refCon);
    2765         _res = Py_BuildValue("O&",
    2766                              WinObj_New, _rv);
    2767         return _res;
     2746    PyMac_PRECHECK(NewCWindow);
     2747#endif
     2748    if (!PyArg_ParseTuple(_args, "O&O&bhO&bl",
     2749                          PyMac_GetRect, &boundsRect,
     2750                          PyMac_GetStr255, title,
     2751                          &visible,
     2752                          &procID,
     2753                          WinObj_Convert, &behind,
     2754                          &goAwayFlag,
     2755                          &refCon))
     2756        return NULL;
     2757    _rv = NewCWindow((void *)0,
     2758                     &boundsRect,
     2759                     title,
     2760                     visible,
     2761                     procID,
     2762                     behind,
     2763                     goAwayFlag,
     2764                     refCon);
     2765    _res = Py_BuildValue("O&",
     2766                         WinObj_New, _rv);
     2767    return _res;
    27682768}
    27692769
    27702770static PyObject *Win_CreateNewWindow(PyObject *_self, PyObject *_args)
    27712771{
    2772         PyObject *_res = NULL;
    2773         OSStatus _err;
    2774         WindowClass windowClass;
    2775         WindowAttributes attributes;
    2776         Rect contentBounds;
    2777         WindowPtr outWindow;
     2772    PyObject *_res = NULL;
     2773    OSStatus _err;
     2774    WindowClass windowClass;
     2775    WindowAttributes attributes;
     2776    Rect contentBounds;
     2777    WindowPtr outWindow;
    27782778#ifndef CreateNewWindow
    2779         PyMac_PRECHECK(CreateNewWindow);
    2780 #endif
    2781         if (!PyArg_ParseTuple(_args, "llO&",
    2782                               &windowClass,
    2783                               &attributes,
    2784                               PyMac_GetRect, &contentBounds))
    2785                 return NULL;
    2786         _err = CreateNewWindow(windowClass,
    2787                                attributes,
    2788                                &contentBounds,
    2789                                &outWindow);
    2790         if (_err != noErr) return PyMac_Error(_err);
    2791         _res = Py_BuildValue("O&",
    2792                              WinObj_New, outWindow);
    2793         return _res;
     2779    PyMac_PRECHECK(CreateNewWindow);
     2780#endif
     2781    if (!PyArg_ParseTuple(_args, "llO&",
     2782                          &windowClass,
     2783                          &attributes,
     2784                          PyMac_GetRect, &contentBounds))
     2785        return NULL;
     2786    _err = CreateNewWindow(windowClass,
     2787                           attributes,
     2788                           &contentBounds,
     2789                           &outWindow);
     2790    if (_err != noErr) return PyMac_Error(_err);
     2791    _res = Py_BuildValue("O&",
     2792                         WinObj_New, outWindow);
     2793    return _res;
    27942794}
    27952795
    27962796static PyObject *Win_CreateWindowFromResource(PyObject *_self, PyObject *_args)
    27972797{
    2798         PyObject *_res = NULL;
    2799         OSStatus _err;
    2800         SInt16 resID;
    2801         WindowPtr outWindow;
     2798    PyObject *_res = NULL;
     2799    OSStatus _err;
     2800    SInt16 resID;
     2801    WindowPtr outWindow;
    28022802#ifndef CreateWindowFromResource
    2803         PyMac_PRECHECK(CreateWindowFromResource);
    2804 #endif
    2805         if (!PyArg_ParseTuple(_args, "h",
    2806                               &resID))
    2807                 return NULL;
    2808         _err = CreateWindowFromResource(resID,
    2809                                         &outWindow);
    2810         if (_err != noErr) return PyMac_Error(_err);
    2811         _res = Py_BuildValue("O&",
    2812                              WinObj_New, outWindow);
    2813         return _res;
     2803    PyMac_PRECHECK(CreateWindowFromResource);
     2804#endif
     2805    if (!PyArg_ParseTuple(_args, "h",
     2806                          &resID))
     2807        return NULL;
     2808    _err = CreateWindowFromResource(resID,
     2809                                    &outWindow);
     2810    if (_err != noErr) return PyMac_Error(_err);
     2811    _res = Py_BuildValue("O&",
     2812                         WinObj_New, outWindow);
     2813    return _res;
    28142814}
    28152815
    28162816static PyObject *Win_ShowFloatingWindows(PyObject *_self, PyObject *_args)
    28172817{
    2818         PyObject *_res = NULL;
    2819         OSStatus _err;
     2818    PyObject *_res = NULL;
     2819    OSStatus _err;
    28202820#ifndef ShowFloatingWindows
    2821         PyMac_PRECHECK(ShowFloatingWindows);
    2822 #endif
    2823         if (!PyArg_ParseTuple(_args, ""))
    2824                 return NULL;
    2825         _err = ShowFloatingWindows();
    2826         if (_err != noErr) return PyMac_Error(_err);
    2827         Py_INCREF(Py_None);
    2828         _res = Py_None;
    2829         return _res;
     2821    PyMac_PRECHECK(ShowFloatingWindows);
     2822#endif
     2823    if (!PyArg_ParseTuple(_args, ""))
     2824        return NULL;
     2825    _err = ShowFloatingWindows();
     2826    if (_err != noErr) return PyMac_Error(_err);
     2827    Py_INCREF(Py_None);
     2828    _res = Py_None;
     2829    return _res;
    28302830}
    28312831
    28322832static PyObject *Win_HideFloatingWindows(PyObject *_self, PyObject *_args)
    28332833{
    2834         PyObject *_res = NULL;
    2835         OSStatus _err;
     2834    PyObject *_res = NULL;
     2835    OSStatus _err;
    28362836#ifndef HideFloatingWindows
    2837         PyMac_PRECHECK(HideFloatingWindows);
    2838 #endif
    2839         if (!PyArg_ParseTuple(_args, ""))
    2840                 return NULL;
    2841         _err = HideFloatingWindows();
    2842         if (_err != noErr) return PyMac_Error(_err);
    2843         Py_INCREF(Py_None);
    2844         _res = Py_None;
    2845         return _res;
     2837    PyMac_PRECHECK(HideFloatingWindows);
     2838#endif
     2839    if (!PyArg_ParseTuple(_args, ""))
     2840        return NULL;
     2841    _err = HideFloatingWindows();
     2842    if (_err != noErr) return PyMac_Error(_err);
     2843    Py_INCREF(Py_None);
     2844    _res = Py_None;
     2845    return _res;
    28462846}
    28472847
    28482848static PyObject *Win_AreFloatingWindowsVisible(PyObject *_self, PyObject *_args)
    28492849{
    2850         PyObject *_res = NULL;
    2851         Boolean _rv;
     2850    PyObject *_res = NULL;
     2851    Boolean _rv;
    28522852#ifndef AreFloatingWindowsVisible
    2853         PyMac_PRECHECK(AreFloatingWindowsVisible);
    2854 #endif
    2855         if (!PyArg_ParseTuple(_args, ""))
    2856                 return NULL;
    2857         _rv = AreFloatingWindowsVisible();
    2858         _res = Py_BuildValue("b",
    2859                              _rv);
    2860         return _res;
     2853    PyMac_PRECHECK(AreFloatingWindowsVisible);
     2854#endif
     2855    if (!PyArg_ParseTuple(_args, ""))
     2856        return NULL;
     2857    _rv = AreFloatingWindowsVisible();
     2858    _res = Py_BuildValue("b",
     2859                         _rv);
     2860    return _res;
    28612861}
    28622862
    28632863static PyObject *Win_CheckUpdate(PyObject *_self, PyObject *_args)
    28642864{
    2865         PyObject *_res = NULL;
    2866         Boolean _rv;
    2867         EventRecord theEvent;
     2865    PyObject *_res = NULL;
     2866    Boolean _rv;
     2867    EventRecord theEvent;
    28682868#ifndef CheckUpdate
    2869         PyMac_PRECHECK(CheckUpdate);
    2870 #endif
    2871         if (!PyArg_ParseTuple(_args, ""))
    2872                 return NULL;
    2873         _rv = CheckUpdate(&theEvent);
    2874         _res = Py_BuildValue("bO&",
    2875                              _rv,
    2876                              PyMac_BuildEventRecord, &theEvent);
    2877         return _res;
     2869    PyMac_PRECHECK(CheckUpdate);
     2870#endif
     2871    if (!PyArg_ParseTuple(_args, ""))
     2872        return NULL;
     2873    _rv = CheckUpdate(&theEvent);
     2874    _res = Py_BuildValue("bO&",
     2875                         _rv,
     2876                         PyMac_BuildEventRecord, &theEvent);
     2877    return _res;
    28782878}
    28792879
    28802880static PyObject *Win_MacFindWindow(PyObject *_self, PyObject *_args)
    28812881{
    2882         PyObject *_res = NULL;
    2883         WindowPartCode _rv;
    2884         Point thePoint;
    2885         WindowPtr window;
     2882    PyObject *_res = NULL;
     2883    WindowPartCode _rv;
     2884    Point thePoint;
     2885    WindowPtr window;
    28862886#ifndef MacFindWindow
    2887         PyMac_PRECHECK(MacFindWindow);
    2888 #endif
    2889         if (!PyArg_ParseTuple(_args, "O&",
    2890                               PyMac_GetPoint, &thePoint))
    2891                 return NULL;
    2892         _rv = MacFindWindow(thePoint,
    2893                             &window);
    2894         _res = Py_BuildValue("hO&",
    2895                              _rv,
    2896                              WinObj_WhichWindow, window);
    2897         return _res;
     2887    PyMac_PRECHECK(MacFindWindow);
     2888#endif
     2889    if (!PyArg_ParseTuple(_args, "O&",
     2890                          PyMac_GetPoint, &thePoint))
     2891        return NULL;
     2892    _rv = MacFindWindow(thePoint,
     2893                        &window);
     2894    _res = Py_BuildValue("hO&",
     2895                         _rv,
     2896                         WinObj_WhichWindow, window);
     2897    return _res;
    28982898}
    28992899
    29002900static PyObject *Win_FrontWindow(PyObject *_self, PyObject *_args)
    29012901{
    2902         PyObject *_res = NULL;
    2903         WindowPtr _rv;
     2902    PyObject *_res = NULL;
     2903    WindowPtr _rv;
    29042904#ifndef FrontWindow
    2905         PyMac_PRECHECK(FrontWindow);
    2906 #endif
    2907         if (!PyArg_ParseTuple(_args, ""))
    2908                 return NULL;
    2909         _rv = FrontWindow();
    2910         _res = Py_BuildValue("O&",
    2911                              WinObj_WhichWindow, _rv);
    2912         return _res;
     2905    PyMac_PRECHECK(FrontWindow);
     2906#endif
     2907    if (!PyArg_ParseTuple(_args, ""))
     2908        return NULL;
     2909    _rv = FrontWindow();
     2910    _res = Py_BuildValue("O&",
     2911                         WinObj_WhichWindow, _rv);
     2912    return _res;
    29132913}
    29142914
    29152915static PyObject *Win_FrontNonFloatingWindow(PyObject *_self, PyObject *_args)
    29162916{
    2917         PyObject *_res = NULL;
    2918         WindowPtr _rv;
     2917    PyObject *_res = NULL;
     2918    WindowPtr _rv;
    29192919#ifndef FrontNonFloatingWindow
    2920         PyMac_PRECHECK(FrontNonFloatingWindow);
    2921 #endif
    2922         if (!PyArg_ParseTuple(_args, ""))
    2923                 return NULL;
    2924         _rv = FrontNonFloatingWindow();
    2925         _res = Py_BuildValue("O&",
    2926                              WinObj_WhichWindow, _rv);
    2927         return _res;
     2920    PyMac_PRECHECK(FrontNonFloatingWindow);
     2921#endif
     2922    if (!PyArg_ParseTuple(_args, ""))
     2923        return NULL;
     2924    _rv = FrontNonFloatingWindow();
     2925    _res = Py_BuildValue("O&",
     2926                         WinObj_WhichWindow, _rv);
     2927    return _res;
    29282928}
    29292929
    29302930static PyObject *Win_GetFrontWindowOfClass(PyObject *_self, PyObject *_args)
    29312931{
    2932         PyObject *_res = NULL;
    2933         WindowPtr _rv;
    2934         WindowClass inWindowClass;
    2935         Boolean mustBeVisible;
     2932    PyObject *_res = NULL;
     2933    WindowPtr _rv;
     2934    WindowClass inWindowClass;
     2935    Boolean mustBeVisible;
    29362936#ifndef GetFrontWindowOfClass
    2937         PyMac_PRECHECK(GetFrontWindowOfClass);
    2938 #endif
    2939         if (!PyArg_ParseTuple(_args, "lb",
    2940                               &inWindowClass,
    2941                               &mustBeVisible))
    2942                 return NULL;
    2943         _rv = GetFrontWindowOfClass(inWindowClass,
    2944                                     mustBeVisible);
    2945         _res = Py_BuildValue("O&",
    2946                              WinObj_New, _rv);
    2947         return _res;
     2937    PyMac_PRECHECK(GetFrontWindowOfClass);
     2938#endif
     2939    if (!PyArg_ParseTuple(_args, "lb",
     2940                          &inWindowClass,
     2941                          &mustBeVisible))
     2942        return NULL;
     2943    _rv = GetFrontWindowOfClass(inWindowClass,
     2944                                mustBeVisible);
     2945    _res = Py_BuildValue("O&",
     2946                         WinObj_New, _rv);
     2947    return _res;
    29482948}
    29492949
    29502950static PyObject *Win_FindWindowOfClass(PyObject *_self, PyObject *_args)
    29512951{
    2952         PyObject *_res = NULL;
    2953         OSStatus _err;
    2954         Point where;
    2955         WindowClass inWindowClass;
    2956         WindowPtr outWindow;
    2957         WindowPartCode outWindowPart;
     2952    PyObject *_res = NULL;
     2953    OSStatus _err;
     2954    Point where;
     2955    WindowClass inWindowClass;
     2956    WindowPtr outWindow;
     2957    WindowPartCode outWindowPart;
    29582958#ifndef FindWindowOfClass
    2959         PyMac_PRECHECK(FindWindowOfClass);
    2960 #endif
    2961         if (!PyArg_ParseTuple(_args, "O&l",
    2962                               PyMac_GetPoint, &where,
    2963                               &inWindowClass))
    2964                 return NULL;
    2965         _err = FindWindowOfClass(&where,
    2966                                  inWindowClass,
    2967                                  &outWindow,
    2968                                  &outWindowPart);
    2969         if (_err != noErr) return PyMac_Error(_err);
    2970         _res = Py_BuildValue("O&h",
    2971                              WinObj_WhichWindow, outWindow,
    2972                              outWindowPart);
    2973         return _res;
     2959    PyMac_PRECHECK(FindWindowOfClass);
     2960#endif
     2961    if (!PyArg_ParseTuple(_args, "O&l",
     2962                          PyMac_GetPoint, &where,
     2963                          &inWindowClass))
     2964        return NULL;
     2965    _err = FindWindowOfClass(&where,
     2966                             inWindowClass,
     2967                             &outWindow,
     2968                             &outWindowPart);
     2969    if (_err != noErr) return PyMac_Error(_err);
     2970    _res = Py_BuildValue("O&h",
     2971                         WinObj_WhichWindow, outWindow,
     2972                         outWindowPart);
     2973    return _res;
    29742974}
    29752975
    29762976static PyObject *Win_CreateStandardWindowMenu(PyObject *_self, PyObject *_args)
    29772977{
    2978         PyObject *_res = NULL;
    2979         OSStatus _err;
    2980         OptionBits inOptions;
    2981         MenuHandle outMenu;
     2978    PyObject *_res = NULL;
     2979    OSStatus _err;
     2980    OptionBits inOptions;
     2981    MenuHandle outMenu;
    29822982#ifndef CreateStandardWindowMenu
    2983         PyMac_PRECHECK(CreateStandardWindowMenu);
    2984 #endif
    2985         if (!PyArg_ParseTuple(_args, "l",
    2986                               &inOptions))
    2987                 return NULL;
    2988         _err = CreateStandardWindowMenu(inOptions,
    2989                                         &outMenu);
    2990         if (_err != noErr) return PyMac_Error(_err);
    2991         _res = Py_BuildValue("O&",
    2992                              MenuObj_New, outMenu);
    2993         return _res;
     2983    PyMac_PRECHECK(CreateStandardWindowMenu);
     2984#endif
     2985    if (!PyArg_ParseTuple(_args, "l",
     2986                          &inOptions))
     2987        return NULL;
     2988    _err = CreateStandardWindowMenu(inOptions,
     2989                                    &outMenu);
     2990    if (_err != noErr) return PyMac_Error(_err);
     2991    _res = Py_BuildValue("O&",
     2992                         MenuObj_New, outMenu);
     2993    return _res;
    29942994}
    29952995
    29962996static PyObject *Win_CollapseAllWindows(PyObject *_self, PyObject *_args)
    29972997{
    2998         PyObject *_res = NULL;
    2999         OSStatus _err;
    3000         Boolean collapse;
     2998    PyObject *_res = NULL;
     2999    OSStatus _err;
     3000    Boolean collapse;
    30013001#ifndef CollapseAllWindows
    3002         PyMac_PRECHECK(CollapseAllWindows);
    3003 #endif
    3004         if (!PyArg_ParseTuple(_args, "b",
    3005                               &collapse))
    3006                 return NULL;
    3007         _err = CollapseAllWindows(collapse);
    3008         if (_err != noErr) return PyMac_Error(_err);
    3009         Py_INCREF(Py_None);
    3010         _res = Py_None;
    3011         return _res;
     3002    PyMac_PRECHECK(CollapseAllWindows);
     3003#endif
     3004    if (!PyArg_ParseTuple(_args, "b",
     3005                          &collapse))
     3006        return NULL;
     3007    _err = CollapseAllWindows(collapse);
     3008    if (_err != noErr) return PyMac_Error(_err);
     3009    Py_INCREF(Py_None);
     3010    _res = Py_None;
     3011    return _res;
    30123012}
    30133013
    30143014static PyObject *Win_GetAvailableWindowPositioningBounds(PyObject *_self, PyObject *_args)
    30153015{
    3016         PyObject *_res = NULL;
    3017         OSStatus _err;
    3018         GDHandle inDevice;
    3019         Rect outAvailableRect;
     3016    PyObject *_res = NULL;
     3017    OSStatus _err;
     3018    GDHandle inDevice;
     3019    Rect outAvailableRect;
    30203020#ifndef GetAvailableWindowPositioningBounds
    3021         PyMac_PRECHECK(GetAvailableWindowPositioningBounds);
    3022 #endif
    3023         if (!PyArg_ParseTuple(_args, "O&",
    3024                               ResObj_Convert, &inDevice))
    3025                 return NULL;
    3026         _err = GetAvailableWindowPositioningBounds(inDevice,
    3027                                                    &outAvailableRect);
    3028         if (_err != noErr) return PyMac_Error(_err);
    3029         _res = Py_BuildValue("O&",
    3030                              PyMac_BuildRect, &outAvailableRect);
    3031         return _res;
     3021    PyMac_PRECHECK(GetAvailableWindowPositioningBounds);
     3022#endif
     3023    if (!PyArg_ParseTuple(_args, "O&",
     3024                          ResObj_Convert, &inDevice))
     3025        return NULL;
     3026    _err = GetAvailableWindowPositioningBounds(inDevice,
     3027                                               &outAvailableRect);
     3028    if (_err != noErr) return PyMac_Error(_err);
     3029    _res = Py_BuildValue("O&",
     3030                         PyMac_BuildRect, &outAvailableRect);
     3031    return _res;
    30323032}
    30333033
    30343034static PyObject *Win_DisableScreenUpdates(PyObject *_self, PyObject *_args)
    30353035{
    3036         PyObject *_res = NULL;
    3037         OSStatus _err;
     3036    PyObject *_res = NULL;
     3037    OSStatus _err;
    30383038#ifndef DisableScreenUpdates
    3039         PyMac_PRECHECK(DisableScreenUpdates);
    3040 #endif
    3041         if (!PyArg_ParseTuple(_args, ""))
    3042                 return NULL;
    3043         _err = DisableScreenUpdates();
    3044         if (_err != noErr) return PyMac_Error(_err);
    3045         Py_INCREF(Py_None);
    3046         _res = Py_None;
    3047         return _res;
     3039    PyMac_PRECHECK(DisableScreenUpdates);
     3040#endif
     3041    if (!PyArg_ParseTuple(_args, ""))
     3042        return NULL;
     3043    _err = DisableScreenUpdates();
     3044    if (_err != noErr) return PyMac_Error(_err);
     3045    Py_INCREF(Py_None);
     3046    _res = Py_None;
     3047    return _res;
    30483048}
    30493049
    30503050static PyObject *Win_EnableScreenUpdates(PyObject *_self, PyObject *_args)
    30513051{
    3052         PyObject *_res = NULL;
    3053         OSStatus _err;
     3052    PyObject *_res = NULL;
     3053    OSStatus _err;
    30543054#ifndef EnableScreenUpdates
    3055         PyMac_PRECHECK(EnableScreenUpdates);
    3056 #endif
    3057         if (!PyArg_ParseTuple(_args, ""))
    3058                 return NULL;
    3059         _err = EnableScreenUpdates();
    3060         if (_err != noErr) return PyMac_Error(_err);
    3061         Py_INCREF(Py_None);
    3062         _res = Py_None;
    3063         return _res;
     3055    PyMac_PRECHECK(EnableScreenUpdates);
     3056#endif
     3057    if (!PyArg_ParseTuple(_args, ""))
     3058        return NULL;
     3059    _err = EnableScreenUpdates();
     3060    if (_err != noErr) return PyMac_Error(_err);
     3061    Py_INCREF(Py_None);
     3062    _res = Py_None;
     3063    return _res;
    30643064}
    30653065
    30663066static PyObject *Win_PinRect(PyObject *_self, PyObject *_args)
    30673067{
    3068         PyObject *_res = NULL;
    3069         long _rv;
    3070         Rect theRect;
    3071         Point thePt;
     3068    PyObject *_res = NULL;
     3069    long _rv;
     3070    Rect theRect;
     3071    Point thePt;
    30723072#ifndef PinRect
    3073         PyMac_PRECHECK(PinRect);
    3074 #endif
    3075         if (!PyArg_ParseTuple(_args, "O&O&",
    3076                               PyMac_GetRect, &theRect,
    3077                               PyMac_GetPoint, &thePt))
    3078                 return NULL;
    3079         _rv = PinRect(&theRect,
    3080                       thePt);
    3081         _res = Py_BuildValue("l",
    3082                              _rv);
    3083         return _res;
     3073    PyMac_PRECHECK(PinRect);
     3074#endif
     3075    if (!PyArg_ParseTuple(_args, "O&O&",
     3076                          PyMac_GetRect, &theRect,
     3077                          PyMac_GetPoint, &thePt))
     3078        return NULL;
     3079    _rv = PinRect(&theRect,
     3080                  thePt);
     3081    _res = Py_BuildValue("l",
     3082                         _rv);
     3083    return _res;
    30843084}
    30853085
    30863086static PyObject *Win_GetGrayRgn(PyObject *_self, PyObject *_args)
    30873087{
    3088         PyObject *_res = NULL;
    3089         RgnHandle _rv;
     3088    PyObject *_res = NULL;
     3089    RgnHandle _rv;
    30903090#ifndef GetGrayRgn
    3091         PyMac_PRECHECK(GetGrayRgn);
    3092 #endif
    3093         if (!PyArg_ParseTuple(_args, ""))
    3094                 return NULL;
    3095         _rv = GetGrayRgn();
    3096         _res = Py_BuildValue("O&",
    3097                              ResObj_New, _rv);
    3098         return _res;
     3091    PyMac_PRECHECK(GetGrayRgn);
     3092#endif
     3093    if (!PyArg_ParseTuple(_args, ""))
     3094        return NULL;
     3095    _rv = GetGrayRgn();
     3096    _res = Py_BuildValue("O&",
     3097                         ResObj_New, _rv);
     3098    return _res;
    30993099}
    31003100
    31013101static PyObject *Win_GetWindowFromPort(PyObject *_self, PyObject *_args)
    31023102{
    3103         PyObject *_res = NULL;
    3104         WindowPtr _rv;
    3105         CGrafPtr port;
     3103    PyObject *_res = NULL;
     3104    WindowPtr _rv;
     3105    CGrafPtr port;
    31063106#ifndef GetWindowFromPort
    3107         PyMac_PRECHECK(GetWindowFromPort);
    3108 #endif
    3109         if (!PyArg_ParseTuple(_args, "O&",
    3110                               GrafObj_Convert, &port))
    3111                 return NULL;
    3112         _rv = GetWindowFromPort(port);
    3113         _res = Py_BuildValue("O&",
    3114                              WinObj_New, _rv);
    3115         return _res;
     3107    PyMac_PRECHECK(GetWindowFromPort);
     3108#endif
     3109    if (!PyArg_ParseTuple(_args, "O&",
     3110                          GrafObj_Convert, &port))
     3111        return NULL;
     3112    _rv = GetWindowFromPort(port);
     3113    _res = Py_BuildValue("O&",
     3114                         WinObj_New, _rv);
     3115    return _res;
    31163116}
    31173117
    31183118static PyObject *Win_WhichWindow(PyObject *_self, PyObject *_args)
    31193119{
    3120         PyObject *_res = NULL;
    3121 
    3122         long ptr;
    3123 
    3124         if ( !PyArg_ParseTuple(_args, "i", &ptr) )
    3125                 return NULL;
    3126         _res = WinObj_WhichWindow((WindowPtr)ptr);
    3127         return _res;
     3120    PyObject *_res = NULL;
     3121
     3122    long ptr;
     3123
     3124    if ( !PyArg_ParseTuple(_args, "i", &ptr) )
     3125        return NULL;
     3126    _res = WinObj_WhichWindow((WindowPtr)ptr);
     3127    return _res;
    31283128
    31293129}
     
    31313131static PyObject *Win_FindWindow(PyObject *_self, PyObject *_args)
    31323132{
    3133         PyObject *_res = NULL;
    3134         short _rv;
    3135         Point thePoint;
    3136         WindowPtr theWindow;
     3133    PyObject *_res = NULL;
     3134    short _rv;
     3135    Point thePoint;
     3136    WindowPtr theWindow;
    31373137#ifndef FindWindow
    3138         PyMac_PRECHECK(FindWindow);
    3139 #endif
    3140         if (!PyArg_ParseTuple(_args, "O&",
    3141                               PyMac_GetPoint, &thePoint))
    3142                 return NULL;
    3143         _rv = FindWindow(thePoint,
    3144                          &theWindow);
    3145         _res = Py_BuildValue("hO&",
    3146                              _rv,
    3147                              WinObj_WhichWindow, theWindow);
    3148         return _res;
     3138    PyMac_PRECHECK(FindWindow);
     3139#endif
     3140    if (!PyArg_ParseTuple(_args, "O&",
     3141                          PyMac_GetPoint, &thePoint))
     3142        return NULL;
     3143    _rv = FindWindow(thePoint,
     3144                     &theWindow);
     3145    _res = Py_BuildValue("hO&",
     3146                         _rv,
     3147                         WinObj_WhichWindow, theWindow);
     3148    return _res;
    31493149}
    31503150#endif /* __LP64__ */
     
    31523152static PyMethodDef Win_methods[] = {
    31533153#ifndef __LP64__
    3154         {"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1,
    3155         PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")},
    3156         {"NewWindow", (PyCFunction)Win_NewWindow, 1,
    3157         PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")},
    3158         {"GetNewWindow", (PyCFunction)Win_GetNewWindow, 1,
    3159         PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")},
    3160         {"NewCWindow", (PyCFunction)Win_NewCWindow, 1,
    3161         PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")},
    3162         {"CreateNewWindow", (PyCFunction)Win_CreateNewWindow, 1,
    3163         PyDoc_STR("(WindowClass windowClass, WindowAttributes attributes, Rect contentBounds) -> (WindowPtr outWindow)")},
    3164         {"CreateWindowFromResource", (PyCFunction)Win_CreateWindowFromResource, 1,
    3165         PyDoc_STR("(SInt16 resID) -> (WindowPtr outWindow)")},
    3166         {"ShowFloatingWindows", (PyCFunction)Win_ShowFloatingWindows, 1,
    3167         PyDoc_STR("() -> None")},
    3168         {"HideFloatingWindows", (PyCFunction)Win_HideFloatingWindows, 1,
    3169         PyDoc_STR("() -> None")},
    3170         {"AreFloatingWindowsVisible", (PyCFunction)Win_AreFloatingWindowsVisible, 1,
    3171         PyDoc_STR("() -> (Boolean _rv)")},
    3172         {"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1,
    3173         PyDoc_STR("() -> (Boolean _rv, EventRecord theEvent)")},
    3174         {"MacFindWindow", (PyCFunction)Win_MacFindWindow, 1,
    3175         PyDoc_STR("(Point thePoint) -> (WindowPartCode _rv, WindowPtr window)")},
    3176         {"FrontWindow", (PyCFunction)Win_FrontWindow, 1,
    3177         PyDoc_STR("() -> (WindowPtr _rv)")},
    3178         {"FrontNonFloatingWindow", (PyCFunction)Win_FrontNonFloatingWindow, 1,
    3179         PyDoc_STR("() -> (WindowPtr _rv)")},
    3180         {"GetFrontWindowOfClass", (PyCFunction)Win_GetFrontWindowOfClass, 1,
    3181         PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
    3182         {"FindWindowOfClass", (PyCFunction)Win_FindWindowOfClass, 1,
    3183         PyDoc_STR("(Point where, WindowClass inWindowClass) -> (WindowPtr outWindow, WindowPartCode outWindowPart)")},
    3184         {"CreateStandardWindowMenu", (PyCFunction)Win_CreateStandardWindowMenu, 1,
    3185         PyDoc_STR("(OptionBits inOptions) -> (MenuHandle outMenu)")},
    3186         {"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1,
    3187         PyDoc_STR("(Boolean collapse) -> None")},
    3188         {"GetAvailableWindowPositioningBounds", (PyCFunction)Win_GetAvailableWindowPositioningBounds, 1,
    3189         PyDoc_STR("(GDHandle inDevice) -> (Rect outAvailableRect)")},
    3190         {"DisableScreenUpdates", (PyCFunction)Win_DisableScreenUpdates, 1,
    3191         PyDoc_STR("() -> None")},
    3192         {"EnableScreenUpdates", (PyCFunction)Win_EnableScreenUpdates, 1,
    3193         PyDoc_STR("() -> None")},
    3194         {"PinRect", (PyCFunction)Win_PinRect, 1,
    3195         PyDoc_STR("(Rect theRect, Point thePt) -> (long _rv)")},
    3196         {"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1,
    3197         PyDoc_STR("() -> (RgnHandle _rv)")},
    3198         {"GetWindowFromPort", (PyCFunction)Win_GetWindowFromPort, 1,
    3199         PyDoc_STR("(CGrafPtr port) -> (WindowPtr _rv)")},
    3200         {"WhichWindow", (PyCFunction)Win_WhichWindow, 1,
    3201         PyDoc_STR("Resolve an integer WindowPtr address to a Window object")},
    3202         {"FindWindow", (PyCFunction)Win_FindWindow, 1,
    3203         PyDoc_STR("(Point thePoint) -> (short _rv, WindowPtr theWindow)")},
    3204         {NULL, NULL, 0}
     3154    {"GetNewCWindow", (PyCFunction)Win_GetNewCWindow, 1,
     3155    PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")},
     3156    {"NewWindow", (PyCFunction)Win_NewWindow, 1,
     3157    PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")},
     3158    {"GetNewWindow", (PyCFunction)Win_GetNewWindow, 1,
     3159    PyDoc_STR("(short windowID, WindowPtr behind) -> (WindowPtr _rv)")},
     3160    {"NewCWindow", (PyCFunction)Win_NewCWindow, 1,
     3161    PyDoc_STR("(Rect boundsRect, Str255 title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon) -> (WindowPtr _rv)")},
     3162    {"CreateNewWindow", (PyCFunction)Win_CreateNewWindow, 1,
     3163    PyDoc_STR("(WindowClass windowClass, WindowAttributes attributes, Rect contentBounds) -> (WindowPtr outWindow)")},
     3164    {"CreateWindowFromResource", (PyCFunction)Win_CreateWindowFromResource, 1,
     3165    PyDoc_STR("(SInt16 resID) -> (WindowPtr outWindow)")},
     3166    {"ShowFloatingWindows", (PyCFunction)Win_ShowFloatingWindows, 1,
     3167    PyDoc_STR("() -> None")},
     3168    {"HideFloatingWindows", (PyCFunction)Win_HideFloatingWindows, 1,
     3169    PyDoc_STR("() -> None")},
     3170    {"AreFloatingWindowsVisible", (PyCFunction)Win_AreFloatingWindowsVisible, 1,
     3171    PyDoc_STR("() -> (Boolean _rv)")},
     3172    {"CheckUpdate", (PyCFunction)Win_CheckUpdate, 1,
     3173    PyDoc_STR("() -> (Boolean _rv, EventRecord theEvent)")},
     3174    {"MacFindWindow", (PyCFunction)Win_MacFindWindow, 1,
     3175    PyDoc_STR("(Point thePoint) -> (WindowPartCode _rv, WindowPtr window)")},
     3176    {"FrontWindow", (PyCFunction)Win_FrontWindow, 1,
     3177    PyDoc_STR("() -> (WindowPtr _rv)")},
     3178    {"FrontNonFloatingWindow", (PyCFunction)Win_FrontNonFloatingWindow, 1,
     3179    PyDoc_STR("() -> (WindowPtr _rv)")},
     3180    {"GetFrontWindowOfClass", (PyCFunction)Win_GetFrontWindowOfClass, 1,
     3181    PyDoc_STR("(WindowClass inWindowClass, Boolean mustBeVisible) -> (WindowPtr _rv)")},
     3182    {"FindWindowOfClass", (PyCFunction)Win_FindWindowOfClass, 1,
     3183    PyDoc_STR("(Point where, WindowClass inWindowClass) -> (WindowPtr outWindow, WindowPartCode outWindowPart)")},
     3184    {"CreateStandardWindowMenu", (PyCFunction)Win_CreateStandardWindowMenu, 1,
     3185    PyDoc_STR("(OptionBits inOptions) -> (MenuHandle outMenu)")},
     3186    {"CollapseAllWindows", (PyCFunction)Win_CollapseAllWindows, 1,
     3187    PyDoc_STR("(Boolean collapse) -> None")},
     3188    {"GetAvailableWindowPositioningBounds", (PyCFunction)Win_GetAvailableWindowPositioningBounds, 1,
     3189    PyDoc_STR("(GDHandle inDevice) -> (Rect outAvailableRect)")},
     3190    {"DisableScreenUpdates", (PyCFunction)Win_DisableScreenUpdates, 1,
     3191    PyDoc_STR("() -> None")},
     3192    {"EnableScreenUpdates", (PyCFunction)Win_EnableScreenUpdates, 1,
     3193    PyDoc_STR("() -> None")},
     3194    {"PinRect", (PyCFunction)Win_PinRect, 1,
     3195    PyDoc_STR("(Rect theRect, Point thePt) -> (long _rv)")},
     3196    {"GetGrayRgn", (PyCFunction)Win_GetGrayRgn, 1,
     3197    PyDoc_STR("() -> (RgnHandle _rv)")},
     3198    {"GetWindowFromPort", (PyCFunction)Win_GetWindowFromPort, 1,
     3199    PyDoc_STR("(CGrafPtr port) -> (WindowPtr _rv)")},
     3200    {"WhichWindow", (PyCFunction)Win_WhichWindow, 1,
     3201    PyDoc_STR("Resolve an integer WindowPtr address to a Window object")},
     3202    {"FindWindow", (PyCFunction)Win_FindWindow, 1,
     3203    PyDoc_STR("(Point thePoint) -> (short _rv, WindowPtr theWindow)")},
     3204    {NULL, NULL, 0}
    32053205#endif /* __LP64__ */
    32063206};
     
    32143214WinObj_WhichWindow(WindowPtr w)
    32153215{
    3216         PyObject *it;
    3217 
    3218         if (w == NULL) {
    3219                 it = Py_None;
    3220                 Py_INCREF(it);
     3216    PyObject *it;
     3217
     3218    if (w == NULL) {
     3219        it = Py_None;
     3220        Py_INCREF(it);
     3221    } else {
     3222        it = (PyObject *) GetWRefCon(w);
     3223        if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) {
     3224            it = WinObj_New(w);
     3225            ((WindowObject *)it)->ob_freeit = NULL;
    32213226        } else {
    3222                 it = (PyObject *) GetWRefCon(w);
    3223                 if (it == NULL || !IsPointerValid((Ptr)it) || ((WindowObject *)it)->ob_itself != w || !WinObj_Check(it)) {
    3224                         it = WinObj_New(w);
    3225                         ((WindowObject *)it)->ob_freeit = NULL;
    3226                 } else {
    3227                         Py_INCREF(it);
    3228                 }
     3227            Py_INCREF(it);
    32293228        }
    3230         return it;
     3229    }
     3230    return it;
    32313231}
    32323232
     
    32353235void init_Win(void)
    32363236{
    3237         PyObject *m;
     3237    PyObject *m;
    32383238#ifndef __LP64__
    3239         PyObject *d;
    3240 
    3241         PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
    3242         PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
    3243         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
     3239    PyObject *d;
     3240
     3241    PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
     3242    PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
     3243    PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
    32443244
    32453245#endif /* __LP64__ */
    32463246
    3247         m = Py_InitModule("_Win", Win_methods);
     3247    m = Py_InitModule("_Win", Win_methods);
    32483248#ifndef __LP64__
    3249         d = PyModule_GetDict(m);
    3250         Win_Error = PyMac_GetOSErrException();
    3251         if (Win_Error == NULL ||
    3252             PyDict_SetItemString(d, "Error", Win_Error) != 0)
    3253                 return;
    3254         Window_Type.ob_type = &PyType_Type;
    3255         if (PyType_Ready(&Window_Type) < 0) return;
    3256         Py_INCREF(&Window_Type);
    3257         PyModule_AddObject(m, "Window", (PyObject *)&Window_Type);
    3258         /* Backward-compatible name */
    3259         Py_INCREF(&Window_Type);
    3260         PyModule_AddObject(m, "WindowType", (PyObject *)&Window_Type);
     3249    d = PyModule_GetDict(m);
     3250    Win_Error = PyMac_GetOSErrException();
     3251    if (Win_Error == NULL ||
     3252        PyDict_SetItemString(d, "Error", Win_Error) != 0)
     3253        return;
     3254    Window_Type.ob_type = &PyType_Type;
     3255    if (PyType_Ready(&Window_Type) < 0) return;
     3256    Py_INCREF(&Window_Type);
     3257    PyModule_AddObject(m, "Window", (PyObject *)&Window_Type);
     3258    /* Backward-compatible name */
     3259    Py_INCREF(&Window_Type);
     3260    PyModule_AddObject(m, "WindowType", (PyObject *)&Window_Type);
    32613261#endif /* __LP64__ */
    32623262}
Note: See TracChangeset for help on using the changeset viewer.