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/menu/_Menumodule.c

    r2 r391  
    1111/* Macro to test whether a weak-loaded CFM function exists */
    1212#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
    13         PyErr_SetString(PyExc_NotImplementedError, \
    14         "Not available in this shared library/OS version"); \
    15         return NULL; \
     13    PyErr_SetString(PyExc_NotImplementedError, \
     14    "Not available in this shared library/OS version"); \
     15    return NULL; \
    1616    }} while(0)
    1717
     
    3636PyObject *OptMenuObj_New(MenuRef itself)
    3737{
    38         if (itself == NULL) {
    39                 Py_INCREF(Py_None);
    40                 return Py_None;
    41         }
    42         return MenuObj_New(itself);
     38    if (itself == NULL) {
     39        Py_INCREF(Py_None);
     40        return Py_None;
     41    }
     42    return MenuObj_New(itself);
    4343}
    4444
     
    4646int OptMenuObj_Convert(PyObject *v, MenuRef *p_itself)
    4747{
    48         if ( v == Py_None ) {
    49                 *p_itself = NULL;
    50                 return 1;
    51         }
    52         return MenuObj_Convert(v, p_itself);
     48    if ( v == Py_None ) {
     49        *p_itself = NULL;
     50        return 1;
     51    }
     52    return MenuObj_Convert(v, p_itself);
    5353}
    5454
     
    6262
    6363typedef struct MenuObject {
    64         PyObject_HEAD
    65         MenuHandle ob_itself;
     64    PyObject_HEAD
     65    MenuHandle ob_itself;
    6666} MenuObject;
    6767
    6868PyObject *MenuObj_New(MenuHandle itself)
    6969{
    70         MenuObject *it;
    71         it = PyObject_NEW(MenuObject, &Menu_Type);
    72         if (it == NULL) return NULL;
    73         it->ob_itself = itself;
    74         return (PyObject *)it;
     70    MenuObject *it;
     71    it = PyObject_NEW(MenuObject, &Menu_Type);
     72    if (it == NULL) return NULL;
     73    it->ob_itself = itself;
     74    return (PyObject *)it;
    7575}
    7676
    7777int MenuObj_Convert(PyObject *v, MenuHandle *p_itself)
    7878{
    79         if (!MenuObj_Check(v))
    80         {
    81                 PyErr_SetString(PyExc_TypeError, "Menu required");
    82                 return 0;
    83         }
    84         *p_itself = ((MenuObject *)v)->ob_itself;
    85         return 1;
     79    if (!MenuObj_Check(v))
     80    {
     81        PyErr_SetString(PyExc_TypeError, "Menu required");
     82        return 0;
     83    }
     84    *p_itself = ((MenuObject *)v)->ob_itself;
     85    return 1;
    8686}
    8787
    8888static void MenuObj_dealloc(MenuObject *self)
    8989{
    90         /* Cleanup of self->ob_itself goes here */
    91         self->ob_type->tp_free((PyObject *)self);
     90    /* Cleanup of self->ob_itself goes here */
     91    self->ob_type->tp_free((PyObject *)self);
    9292}
    9393
    9494static PyObject *MenuObj_DisposeMenu(MenuObject *_self, PyObject *_args)
    9595{
    96         PyObject *_res = NULL;
     96    PyObject *_res = NULL;
    9797#ifndef DisposeMenu
    98         PyMac_PRECHECK(DisposeMenu);
    99 #endif
    100         if (!PyArg_ParseTuple(_args, ""))
    101                 return NULL;
    102         DisposeMenu(_self->ob_itself);
    103         Py_INCREF(Py_None);
    104         _res = Py_None;
    105         return _res;
     98    PyMac_PRECHECK(DisposeMenu);
     99#endif
     100    if (!PyArg_ParseTuple(_args, ""))
     101        return NULL;
     102    DisposeMenu(_self->ob_itself);
     103    Py_INCREF(Py_None);
     104    _res = Py_None;
     105    return _res;
    106106}
    107107
    108108static PyObject *MenuObj_CalcMenuSize(MenuObject *_self, PyObject *_args)
    109109{
    110         PyObject *_res = NULL;
     110    PyObject *_res = NULL;
    111111#ifndef CalcMenuSize
    112         PyMac_PRECHECK(CalcMenuSize);
    113 #endif
    114         if (!PyArg_ParseTuple(_args, ""))
    115                 return NULL;
    116         CalcMenuSize(_self->ob_itself);
    117         Py_INCREF(Py_None);
    118         _res = Py_None;
    119         return _res;
     112    PyMac_PRECHECK(CalcMenuSize);
     113#endif
     114    if (!PyArg_ParseTuple(_args, ""))
     115        return NULL;
     116    CalcMenuSize(_self->ob_itself);
     117    Py_INCREF(Py_None);
     118    _res = Py_None;
     119    return _res;
    120120}
    121121
    122122static PyObject *MenuObj_CountMenuItems(MenuObject *_self, PyObject *_args)
    123123{
    124         PyObject *_res = NULL;
    125         UInt16 _rv;
     124    PyObject *_res = NULL;
     125    UInt16 _rv;
    126126#ifndef CountMenuItems
    127         PyMac_PRECHECK(CountMenuItems);
    128 #endif
    129         if (!PyArg_ParseTuple(_args, ""))
    130                 return NULL;
    131         _rv = CountMenuItems(_self->ob_itself);
    132         _res = Py_BuildValue("H",
    133                              _rv);
    134         return _res;
     127    PyMac_PRECHECK(CountMenuItems);
     128#endif
     129    if (!PyArg_ParseTuple(_args, ""))
     130        return NULL;
     131    _rv = CountMenuItems(_self->ob_itself);
     132    _res = Py_BuildValue("H",
     133                         _rv);
     134    return _res;
    135135}
    136136
    137137static PyObject *MenuObj_GetMenuFont(MenuObject *_self, PyObject *_args)
    138138{
    139         PyObject *_res = NULL;
    140         OSStatus _err;
    141         SInt16 outFontID;
    142         UInt16 outFontSize;
     139    PyObject *_res = NULL;
     140    OSStatus _err;
     141    SInt16 outFontID;
     142    UInt16 outFontSize;
    143143#ifndef GetMenuFont
    144         PyMac_PRECHECK(GetMenuFont);
    145 #endif
    146         if (!PyArg_ParseTuple(_args, ""))
    147                 return NULL;
    148         _err = GetMenuFont(_self->ob_itself,
    149                            &outFontID,
    150                            &outFontSize);
    151         if (_err != noErr) return PyMac_Error(_err);
    152         _res = Py_BuildValue("hH",
    153                              outFontID,
    154                              outFontSize);
    155         return _res;
     144    PyMac_PRECHECK(GetMenuFont);
     145#endif
     146    if (!PyArg_ParseTuple(_args, ""))
     147        return NULL;
     148    _err = GetMenuFont(_self->ob_itself,
     149                       &outFontID,
     150                       &outFontSize);
     151    if (_err != noErr) return PyMac_Error(_err);
     152    _res = Py_BuildValue("hH",
     153                         outFontID,
     154                         outFontSize);
     155    return _res;
    156156}
    157157
    158158static PyObject *MenuObj_SetMenuFont(MenuObject *_self, PyObject *_args)
    159159{
    160         PyObject *_res = NULL;
    161         OSStatus _err;
    162         SInt16 inFontID;
    163         UInt16 inFontSize;
     160    PyObject *_res = NULL;
     161    OSStatus _err;
     162    SInt16 inFontID;
     163    UInt16 inFontSize;
    164164#ifndef SetMenuFont
    165         PyMac_PRECHECK(SetMenuFont);
    166 #endif
    167         if (!PyArg_ParseTuple(_args, "hH",
    168                               &inFontID,
    169                               &inFontSize))
    170                 return NULL;
    171         _err = SetMenuFont(_self->ob_itself,
    172                            inFontID,
    173                            inFontSize);
    174         if (_err != noErr) return PyMac_Error(_err);
    175         Py_INCREF(Py_None);
    176         _res = Py_None;
    177         return _res;
     165    PyMac_PRECHECK(SetMenuFont);
     166#endif
     167    if (!PyArg_ParseTuple(_args, "hH",
     168                          &inFontID,
     169                          &inFontSize))
     170        return NULL;
     171    _err = SetMenuFont(_self->ob_itself,
     172                       inFontID,
     173                       inFontSize);
     174    if (_err != noErr) return PyMac_Error(_err);
     175    Py_INCREF(Py_None);
     176    _res = Py_None;
     177    return _res;
    178178}
    179179
    180180static PyObject *MenuObj_GetMenuExcludesMarkColumn(MenuObject *_self, PyObject *_args)
    181181{
    182         PyObject *_res = NULL;
    183         Boolean _rv;
     182    PyObject *_res = NULL;
     183    Boolean _rv;
    184184#ifndef GetMenuExcludesMarkColumn
    185         PyMac_PRECHECK(GetMenuExcludesMarkColumn);
    186 #endif
    187         if (!PyArg_ParseTuple(_args, ""))
    188                 return NULL;
    189         _rv = GetMenuExcludesMarkColumn(_self->ob_itself);
    190         _res = Py_BuildValue("b",
    191                              _rv);
    192         return _res;
     185    PyMac_PRECHECK(GetMenuExcludesMarkColumn);
     186#endif
     187    if (!PyArg_ParseTuple(_args, ""))
     188        return NULL;
     189    _rv = GetMenuExcludesMarkColumn(_self->ob_itself);
     190    _res = Py_BuildValue("b",
     191                         _rv);
     192    return _res;
    193193}
    194194
    195195static PyObject *MenuObj_SetMenuExcludesMarkColumn(MenuObject *_self, PyObject *_args)
    196196{
    197         PyObject *_res = NULL;
    198         OSStatus _err;
    199         Boolean excludesMark;
     197    PyObject *_res = NULL;
     198    OSStatus _err;
     199    Boolean excludesMark;
    200200#ifndef SetMenuExcludesMarkColumn
    201         PyMac_PRECHECK(SetMenuExcludesMarkColumn);
    202 #endif
    203         if (!PyArg_ParseTuple(_args, "b",
    204                               &excludesMark))
    205                 return NULL;
    206         _err = SetMenuExcludesMarkColumn(_self->ob_itself,
    207                                          excludesMark);
    208         if (_err != noErr) return PyMac_Error(_err);
    209         Py_INCREF(Py_None);
    210         _res = Py_None;
    211         return _res;
     201    PyMac_PRECHECK(SetMenuExcludesMarkColumn);
     202#endif
     203    if (!PyArg_ParseTuple(_args, "b",
     204                          &excludesMark))
     205        return NULL;
     206    _err = SetMenuExcludesMarkColumn(_self->ob_itself,
     207                                     excludesMark);
     208    if (_err != noErr) return PyMac_Error(_err);
     209    Py_INCREF(Py_None);
     210    _res = Py_None;
     211    return _res;
    212212}
    213213
    214214static PyObject *MenuObj_IsValidMenu(MenuObject *_self, PyObject *_args)
    215215{
    216         PyObject *_res = NULL;
    217         Boolean _rv;
     216    PyObject *_res = NULL;
     217    Boolean _rv;
    218218#ifndef IsValidMenu
    219         PyMac_PRECHECK(IsValidMenu);
    220 #endif
    221         if (!PyArg_ParseTuple(_args, ""))
    222                 return NULL;
    223         _rv = IsValidMenu(_self->ob_itself);
    224         _res = Py_BuildValue("b",
    225                              _rv);
    226         return _res;
     219    PyMac_PRECHECK(IsValidMenu);
     220#endif
     221    if (!PyArg_ParseTuple(_args, ""))
     222        return NULL;
     223    _rv = IsValidMenu(_self->ob_itself);
     224    _res = Py_BuildValue("b",
     225                         _rv);
     226    return _res;
    227227}
    228228
    229229static PyObject *MenuObj_GetMenuRetainCount(MenuObject *_self, PyObject *_args)
    230230{
    231         PyObject *_res = NULL;
    232         ItemCount _rv;
     231    PyObject *_res = NULL;
     232    ItemCount _rv;
    233233#ifndef GetMenuRetainCount
    234         PyMac_PRECHECK(GetMenuRetainCount);
    235 #endif
    236         if (!PyArg_ParseTuple(_args, ""))
    237                 return NULL;
    238         _rv = GetMenuRetainCount(_self->ob_itself);
    239         _res = Py_BuildValue("l",
    240                              _rv);
    241         return _res;
     234    PyMac_PRECHECK(GetMenuRetainCount);
     235#endif
     236    if (!PyArg_ParseTuple(_args, ""))
     237        return NULL;
     238    _rv = GetMenuRetainCount(_self->ob_itself);
     239    _res = Py_BuildValue("l",
     240                         _rv);
     241    return _res;
    242242}
    243243
    244244static PyObject *MenuObj_RetainMenu(MenuObject *_self, PyObject *_args)
    245245{
    246         PyObject *_res = NULL;
    247         OSStatus _err;
     246    PyObject *_res = NULL;
     247    OSStatus _err;
    248248#ifndef RetainMenu
    249         PyMac_PRECHECK(RetainMenu);
    250 #endif
    251         if (!PyArg_ParseTuple(_args, ""))
    252                 return NULL;
    253         _err = RetainMenu(_self->ob_itself);
    254         if (_err != noErr) return PyMac_Error(_err);
    255         Py_INCREF(Py_None);
    256         _res = Py_None;
    257         return _res;
     249    PyMac_PRECHECK(RetainMenu);
     250#endif
     251    if (!PyArg_ParseTuple(_args, ""))
     252        return NULL;
     253    _err = RetainMenu(_self->ob_itself);
     254    if (_err != noErr) return PyMac_Error(_err);
     255    Py_INCREF(Py_None);
     256    _res = Py_None;
     257    return _res;
    258258}
    259259
    260260static PyObject *MenuObj_ReleaseMenu(MenuObject *_self, PyObject *_args)
    261261{
    262         PyObject *_res = NULL;
    263         OSStatus _err;
     262    PyObject *_res = NULL;
     263    OSStatus _err;
    264264#ifndef ReleaseMenu
    265         PyMac_PRECHECK(ReleaseMenu);
    266 #endif
    267         if (!PyArg_ParseTuple(_args, ""))
    268                 return NULL;
    269         _err = ReleaseMenu(_self->ob_itself);
    270         if (_err != noErr) return PyMac_Error(_err);
    271         Py_INCREF(Py_None);
    272         _res = Py_None;
    273         return _res;
     265    PyMac_PRECHECK(ReleaseMenu);
     266#endif
     267    if (!PyArg_ParseTuple(_args, ""))
     268        return NULL;
     269    _err = ReleaseMenu(_self->ob_itself);
     270    if (_err != noErr) return PyMac_Error(_err);
     271    Py_INCREF(Py_None);
     272    _res = Py_None;
     273    return _res;
    274274}
    275275
    276276static PyObject *MenuObj_DuplicateMenu(MenuObject *_self, PyObject *_args)
    277277{
    278         PyObject *_res = NULL;
    279         OSStatus _err;
    280         MenuHandle outMenu;
     278    PyObject *_res = NULL;
     279    OSStatus _err;
     280    MenuHandle outMenu;
    281281#ifndef DuplicateMenu
    282         PyMac_PRECHECK(DuplicateMenu);
    283 #endif
    284         if (!PyArg_ParseTuple(_args, ""))
    285                 return NULL;
    286         _err = DuplicateMenu(_self->ob_itself,
    287                              &outMenu);
    288         if (_err != noErr) return PyMac_Error(_err);
    289         _res = Py_BuildValue("O&",
    290                              MenuObj_New, outMenu);
    291         return _res;
     282    PyMac_PRECHECK(DuplicateMenu);
     283#endif
     284    if (!PyArg_ParseTuple(_args, ""))
     285        return NULL;
     286    _err = DuplicateMenu(_self->ob_itself,
     287                         &outMenu);
     288    if (_err != noErr) return PyMac_Error(_err);
     289    _res = Py_BuildValue("O&",
     290                         MenuObj_New, outMenu);
     291    return _res;
    292292}
    293293
    294294static PyObject *MenuObj_CopyMenuTitleAsCFString(MenuObject *_self, PyObject *_args)
    295295{
    296         PyObject *_res = NULL;
    297         OSStatus _err;
    298         CFStringRef outString;
     296    PyObject *_res = NULL;
     297    OSStatus _err;
     298    CFStringRef outString;
    299299#ifndef CopyMenuTitleAsCFString
    300         PyMac_PRECHECK(CopyMenuTitleAsCFString);
    301 #endif
    302         if (!PyArg_ParseTuple(_args, ""))
    303                 return NULL;
    304         _err = CopyMenuTitleAsCFString(_self->ob_itself,
    305                                        &outString);
    306         if (_err != noErr) return PyMac_Error(_err);
    307         _res = Py_BuildValue("O&",
    308                              CFStringRefObj_New, outString);
    309         return _res;
     300    PyMac_PRECHECK(CopyMenuTitleAsCFString);
     301#endif
     302    if (!PyArg_ParseTuple(_args, ""))
     303        return NULL;
     304    _err = CopyMenuTitleAsCFString(_self->ob_itself,
     305                                   &outString);
     306    if (_err != noErr) return PyMac_Error(_err);
     307    _res = Py_BuildValue("O&",
     308                         CFStringRefObj_New, outString);
     309    return _res;
    310310}
    311311
    312312static PyObject *MenuObj_SetMenuTitleWithCFString(MenuObject *_self, PyObject *_args)
    313313{
    314         PyObject *_res = NULL;
    315         OSStatus _err;
    316         CFStringRef inString;
     314    PyObject *_res = NULL;
     315    OSStatus _err;
     316    CFStringRef inString;
    317317#ifndef SetMenuTitleWithCFString
    318         PyMac_PRECHECK(SetMenuTitleWithCFString);
    319 #endif
    320         if (!PyArg_ParseTuple(_args, "O&",
    321                               CFStringRefObj_Convert, &inString))
    322                 return NULL;
    323         _err = SetMenuTitleWithCFString(_self->ob_itself,
    324                                         inString);
    325         if (_err != noErr) return PyMac_Error(_err);
    326         Py_INCREF(Py_None);
    327         _res = Py_None;
    328         return _res;
     318    PyMac_PRECHECK(SetMenuTitleWithCFString);
     319#endif
     320    if (!PyArg_ParseTuple(_args, "O&",
     321                          CFStringRefObj_Convert, &inString))
     322        return NULL;
     323    _err = SetMenuTitleWithCFString(_self->ob_itself,
     324                                    inString);
     325    if (_err != noErr) return PyMac_Error(_err);
     326    Py_INCREF(Py_None);
     327    _res = Py_None;
     328    return _res;
    329329}
    330330
    331331static PyObject *MenuObj_InvalidateMenuSize(MenuObject *_self, PyObject *_args)
    332332{
    333         PyObject *_res = NULL;
    334         OSStatus _err;
     333    PyObject *_res = NULL;
     334    OSStatus _err;
    335335#ifndef InvalidateMenuSize
    336         PyMac_PRECHECK(InvalidateMenuSize);
    337 #endif
    338         if (!PyArg_ParseTuple(_args, ""))
    339                 return NULL;
    340         _err = InvalidateMenuSize(_self->ob_itself);
    341         if (_err != noErr) return PyMac_Error(_err);
    342         Py_INCREF(Py_None);
    343         _res = Py_None;
    344         return _res;
     336    PyMac_PRECHECK(InvalidateMenuSize);
     337#endif
     338    if (!PyArg_ParseTuple(_args, ""))
     339        return NULL;
     340    _err = InvalidateMenuSize(_self->ob_itself);
     341    if (_err != noErr) return PyMac_Error(_err);
     342    Py_INCREF(Py_None);
     343    _res = Py_None;
     344    return _res;
    345345}
    346346
    347347static PyObject *MenuObj_IsMenuSizeInvalid(MenuObject *_self, PyObject *_args)
    348348{
    349         PyObject *_res = NULL;
    350         Boolean _rv;
     349    PyObject *_res = NULL;
     350    Boolean _rv;
    351351#ifndef IsMenuSizeInvalid
    352         PyMac_PRECHECK(IsMenuSizeInvalid);
    353 #endif
    354         if (!PyArg_ParseTuple(_args, ""))
    355                 return NULL;
    356         _rv = IsMenuSizeInvalid(_self->ob_itself);
    357         _res = Py_BuildValue("b",
    358                              _rv);
    359         return _res;
     352    PyMac_PRECHECK(IsMenuSizeInvalid);
     353#endif
     354    if (!PyArg_ParseTuple(_args, ""))
     355        return NULL;
     356    _rv = IsMenuSizeInvalid(_self->ob_itself);
     357    _res = Py_BuildValue("b",
     358                         _rv);
     359    return _res;
    360360}
    361361
    362362static PyObject *MenuObj_MacAppendMenu(MenuObject *_self, PyObject *_args)
    363363{
    364         PyObject *_res = NULL;
    365         Str255 data;
     364    PyObject *_res = NULL;
     365    Str255 data;
    366366#ifndef MacAppendMenu
    367         PyMac_PRECHECK(MacAppendMenu);
    368 #endif
    369         if (!PyArg_ParseTuple(_args, "O&",
    370                               PyMac_GetStr255, data))
    371                 return NULL;
    372         MacAppendMenu(_self->ob_itself,
    373                       data);
    374         Py_INCREF(Py_None);
    375         _res = Py_None;
    376         return _res;
     367    PyMac_PRECHECK(MacAppendMenu);
     368#endif
     369    if (!PyArg_ParseTuple(_args, "O&",
     370                          PyMac_GetStr255, data))
     371        return NULL;
     372    MacAppendMenu(_self->ob_itself,
     373                  data);
     374    Py_INCREF(Py_None);
     375    _res = Py_None;
     376    return _res;
    377377}
    378378
    379379static PyObject *MenuObj_InsertResMenu(MenuObject *_self, PyObject *_args)
    380380{
    381         PyObject *_res = NULL;
    382         ResType theType;
    383         short afterItem;
     381    PyObject *_res = NULL;
     382    ResType theType;
     383    short afterItem;
    384384#ifndef InsertResMenu
    385         PyMac_PRECHECK(InsertResMenu);
    386 #endif
    387         if (!PyArg_ParseTuple(_args, "O&h",
    388                               PyMac_GetOSType, &theType,
    389                               &afterItem))
    390                 return NULL;
    391         InsertResMenu(_self->ob_itself,
    392                       theType,
    393                       afterItem);
    394         Py_INCREF(Py_None);
    395         _res = Py_None;
    396         return _res;
     385    PyMac_PRECHECK(InsertResMenu);
     386#endif
     387    if (!PyArg_ParseTuple(_args, "O&h",
     388                          PyMac_GetOSType, &theType,
     389                          &afterItem))
     390        return NULL;
     391    InsertResMenu(_self->ob_itself,
     392                  theType,
     393                  afterItem);
     394    Py_INCREF(Py_None);
     395    _res = Py_None;
     396    return _res;
    397397}
    398398
    399399static PyObject *MenuObj_AppendResMenu(MenuObject *_self, PyObject *_args)
    400400{
    401         PyObject *_res = NULL;
    402         ResType theType;
     401    PyObject *_res = NULL;
     402    ResType theType;
    403403#ifndef AppendResMenu
    404         PyMac_PRECHECK(AppendResMenu);
    405 #endif
    406         if (!PyArg_ParseTuple(_args, "O&",
    407                               PyMac_GetOSType, &theType))
    408                 return NULL;
    409         AppendResMenu(_self->ob_itself,
    410                       theType);
    411         Py_INCREF(Py_None);
    412         _res = Py_None;
    413         return _res;
     404    PyMac_PRECHECK(AppendResMenu);
     405#endif
     406    if (!PyArg_ParseTuple(_args, "O&",
     407                          PyMac_GetOSType, &theType))
     408        return NULL;
     409    AppendResMenu(_self->ob_itself,
     410                  theType);
     411    Py_INCREF(Py_None);
     412    _res = Py_None;
     413    return _res;
    414414}
    415415
    416416static PyObject *MenuObj_MacInsertMenuItem(MenuObject *_self, PyObject *_args)
    417417{
    418         PyObject *_res = NULL;
    419         Str255 itemString;
    420         short afterItem;
     418    PyObject *_res = NULL;
     419    Str255 itemString;
     420    short afterItem;
    421421#ifndef MacInsertMenuItem
    422         PyMac_PRECHECK(MacInsertMenuItem);
    423 #endif
    424         if (!PyArg_ParseTuple(_args, "O&h",
    425                               PyMac_GetStr255, itemString,
    426                               &afterItem))
    427                 return NULL;
    428         MacInsertMenuItem(_self->ob_itself,
    429                           itemString,
    430                           afterItem);
    431         Py_INCREF(Py_None);
    432         _res = Py_None;
    433         return _res;
     422    PyMac_PRECHECK(MacInsertMenuItem);
     423#endif
     424    if (!PyArg_ParseTuple(_args, "O&h",
     425                          PyMac_GetStr255, itemString,
     426                          &afterItem))
     427        return NULL;
     428    MacInsertMenuItem(_self->ob_itself,
     429                      itemString,
     430                      afterItem);
     431    Py_INCREF(Py_None);
     432    _res = Py_None;
     433    return _res;
    434434}
    435435
    436436static PyObject *MenuObj_DeleteMenuItem(MenuObject *_self, PyObject *_args)
    437437{
    438         PyObject *_res = NULL;
    439         short item;
     438    PyObject *_res = NULL;
     439    short item;
    440440#ifndef DeleteMenuItem
    441         PyMac_PRECHECK(DeleteMenuItem);
    442 #endif
    443         if (!PyArg_ParseTuple(_args, "h",
    444                               &item))
    445                 return NULL;
    446         DeleteMenuItem(_self->ob_itself,
    447                        item);
    448         Py_INCREF(Py_None);
    449         _res = Py_None;
    450         return _res;
     441    PyMac_PRECHECK(DeleteMenuItem);
     442#endif
     443    if (!PyArg_ParseTuple(_args, "h",
     444                          &item))
     445        return NULL;
     446    DeleteMenuItem(_self->ob_itself,
     447                   item);
     448    Py_INCREF(Py_None);
     449    _res = Py_None;
     450    return _res;
    451451}
    452452
    453453static PyObject *MenuObj_InsertFontResMenu(MenuObject *_self, PyObject *_args)
    454454{
    455         PyObject *_res = NULL;
    456         short afterItem;
    457         short scriptFilter;
     455    PyObject *_res = NULL;
     456    short afterItem;
     457    short scriptFilter;
    458458#ifndef InsertFontResMenu
    459         PyMac_PRECHECK(InsertFontResMenu);
    460 #endif
    461         if (!PyArg_ParseTuple(_args, "hh",
    462                               &afterItem,
    463                               &scriptFilter))
    464                 return NULL;
    465         InsertFontResMenu(_self->ob_itself,
    466                           afterItem,
    467                           scriptFilter);
    468         Py_INCREF(Py_None);
    469         _res = Py_None;
    470         return _res;
     459    PyMac_PRECHECK(InsertFontResMenu);
     460#endif
     461    if (!PyArg_ParseTuple(_args, "hh",
     462                          &afterItem,
     463                          &scriptFilter))
     464        return NULL;
     465    InsertFontResMenu(_self->ob_itself,
     466                      afterItem,
     467                      scriptFilter);
     468    Py_INCREF(Py_None);
     469    _res = Py_None;
     470    return _res;
    471471}
    472472
    473473static PyObject *MenuObj_InsertIntlResMenu(MenuObject *_self, PyObject *_args)
    474474{
    475         PyObject *_res = NULL;
    476         ResType theType;
    477         short afterItem;
    478         short scriptFilter;
     475    PyObject *_res = NULL;
     476    ResType theType;
     477    short afterItem;
     478    short scriptFilter;
    479479#ifndef InsertIntlResMenu
    480         PyMac_PRECHECK(InsertIntlResMenu);
    481 #endif
    482         if (!PyArg_ParseTuple(_args, "O&hh",
    483                               PyMac_GetOSType, &theType,
    484                               &afterItem,
    485                               &scriptFilter))
    486                 return NULL;
    487         InsertIntlResMenu(_self->ob_itself,
    488                           theType,
    489                           afterItem,
    490                           scriptFilter);
    491         Py_INCREF(Py_None);
    492         _res = Py_None;
    493         return _res;
     480    PyMac_PRECHECK(InsertIntlResMenu);
     481#endif
     482    if (!PyArg_ParseTuple(_args, "O&hh",
     483                          PyMac_GetOSType, &theType,
     484                          &afterItem,
     485                          &scriptFilter))
     486        return NULL;
     487    InsertIntlResMenu(_self->ob_itself,
     488                      theType,
     489                      afterItem,
     490                      scriptFilter);
     491    Py_INCREF(Py_None);
     492    _res = Py_None;
     493    return _res;
    494494}
    495495
    496496static PyObject *MenuObj_AppendMenuItemText(MenuObject *_self, PyObject *_args)
    497497{
    498         PyObject *_res = NULL;
    499         OSStatus _err;
    500         Str255 inString;
     498    PyObject *_res = NULL;
     499    OSStatus _err;
     500    Str255 inString;
    501501#ifndef AppendMenuItemText
    502         PyMac_PRECHECK(AppendMenuItemText);
    503 #endif
    504         if (!PyArg_ParseTuple(_args, "O&",
    505                               PyMac_GetStr255, inString))
    506                 return NULL;
    507         _err = AppendMenuItemText(_self->ob_itself,
    508                                   inString);
    509         if (_err != noErr) return PyMac_Error(_err);
    510         Py_INCREF(Py_None);
    511         _res = Py_None;
    512         return _res;
     502    PyMac_PRECHECK(AppendMenuItemText);
     503#endif
     504    if (!PyArg_ParseTuple(_args, "O&",
     505                          PyMac_GetStr255, inString))
     506        return NULL;
     507    _err = AppendMenuItemText(_self->ob_itself,
     508                              inString);
     509    if (_err != noErr) return PyMac_Error(_err);
     510    Py_INCREF(Py_None);
     511    _res = Py_None;
     512    return _res;
    513513}
    514514
    515515static PyObject *MenuObj_InsertMenuItemText(MenuObject *_self, PyObject *_args)
    516516{
    517         PyObject *_res = NULL;
    518         OSStatus _err;
    519         Str255 inString;
    520         MenuItemIndex afterItem;
     517    PyObject *_res = NULL;
     518    OSStatus _err;
     519    Str255 inString;
     520    MenuItemIndex afterItem;
    521521#ifndef InsertMenuItemText
    522         PyMac_PRECHECK(InsertMenuItemText);
    523 #endif
    524         if (!PyArg_ParseTuple(_args, "O&h",
    525                               PyMac_GetStr255, inString,
    526                               &afterItem))
    527                 return NULL;
    528         _err = InsertMenuItemText(_self->ob_itself,
    529                                   inString,
    530                                   afterItem);
    531         if (_err != noErr) return PyMac_Error(_err);
    532         Py_INCREF(Py_None);
    533         _res = Py_None;
    534         return _res;
     522    PyMac_PRECHECK(InsertMenuItemText);
     523#endif
     524    if (!PyArg_ParseTuple(_args, "O&h",
     525                          PyMac_GetStr255, inString,
     526                          &afterItem))
     527        return NULL;
     528    _err = InsertMenuItemText(_self->ob_itself,
     529                              inString,
     530                              afterItem);
     531    if (_err != noErr) return PyMac_Error(_err);
     532    Py_INCREF(Py_None);
     533    _res = Py_None;
     534    return _res;
    535535}
    536536
    537537static PyObject *MenuObj_CopyMenuItems(MenuObject *_self, PyObject *_args)
    538538{
    539         PyObject *_res = NULL;
    540         OSStatus _err;
    541         MenuItemIndex inFirstItem;
    542         ItemCount inNumItems;
    543         MenuHandle inDestMenu;
    544         MenuItemIndex inInsertAfter;
     539    PyObject *_res = NULL;
     540    OSStatus _err;
     541    MenuItemIndex inFirstItem;
     542    ItemCount inNumItems;
     543    MenuHandle inDestMenu;
     544    MenuItemIndex inInsertAfter;
    545545#ifndef CopyMenuItems
    546         PyMac_PRECHECK(CopyMenuItems);
    547 #endif
    548         if (!PyArg_ParseTuple(_args, "hlO&h",
    549                               &inFirstItem,
    550                               &inNumItems,
    551                               MenuObj_Convert, &inDestMenu,
    552                               &inInsertAfter))
    553                 return NULL;
    554         _err = CopyMenuItems(_self->ob_itself,
    555                              inFirstItem,
    556                              inNumItems,
    557                              inDestMenu,
    558                              inInsertAfter);
    559         if (_err != noErr) return PyMac_Error(_err);
    560         Py_INCREF(Py_None);
    561         _res = Py_None;
    562         return _res;
     546    PyMac_PRECHECK(CopyMenuItems);
     547#endif
     548    if (!PyArg_ParseTuple(_args, "hlO&h",
     549                          &inFirstItem,
     550                          &inNumItems,
     551                          MenuObj_Convert, &inDestMenu,
     552                          &inInsertAfter))
     553        return NULL;
     554    _err = CopyMenuItems(_self->ob_itself,
     555                         inFirstItem,
     556                         inNumItems,
     557                         inDestMenu,
     558                         inInsertAfter);
     559    if (_err != noErr) return PyMac_Error(_err);
     560    Py_INCREF(Py_None);
     561    _res = Py_None;
     562    return _res;
    563563}
    564564
    565565static PyObject *MenuObj_DeleteMenuItems(MenuObject *_self, PyObject *_args)
    566566{
    567         PyObject *_res = NULL;
    568         OSStatus _err;
    569         MenuItemIndex inFirstItem;
    570         ItemCount inNumItems;
     567    PyObject *_res = NULL;
     568    OSStatus _err;
     569    MenuItemIndex inFirstItem;
     570    ItemCount inNumItems;
    571571#ifndef DeleteMenuItems
    572         PyMac_PRECHECK(DeleteMenuItems);
    573 #endif
    574         if (!PyArg_ParseTuple(_args, "hl",
    575                               &inFirstItem,
    576                               &inNumItems))
    577                 return NULL;
    578         _err = DeleteMenuItems(_self->ob_itself,
    579                                inFirstItem,
    580                                inNumItems);
    581         if (_err != noErr) return PyMac_Error(_err);
    582         Py_INCREF(Py_None);
    583         _res = Py_None;
    584         return _res;
     572    PyMac_PRECHECK(DeleteMenuItems);
     573#endif
     574    if (!PyArg_ParseTuple(_args, "hl",
     575                          &inFirstItem,
     576                          &inNumItems))
     577        return NULL;
     578    _err = DeleteMenuItems(_self->ob_itself,
     579                           inFirstItem,
     580                           inNumItems);
     581    if (_err != noErr) return PyMac_Error(_err);
     582    Py_INCREF(Py_None);
     583    _res = Py_None;
     584    return _res;
    585585}
    586586
    587587static PyObject *MenuObj_AppendMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
    588588{
    589         PyObject *_res = NULL;
    590         OSStatus _err;
    591         CFStringRef inString;
    592         MenuItemAttributes inAttributes;
    593         MenuCommand inCommandID;
    594         MenuItemIndex outNewItem;
     589    PyObject *_res = NULL;
     590    OSStatus _err;
     591    CFStringRef inString;
     592    MenuItemAttributes inAttributes;
     593    MenuCommand inCommandID;
     594    MenuItemIndex outNewItem;
    595595#ifndef AppendMenuItemTextWithCFString
    596         PyMac_PRECHECK(AppendMenuItemTextWithCFString);
    597 #endif
    598         if (!PyArg_ParseTuple(_args, "O&ll",
    599                               CFStringRefObj_Convert, &inString,
    600                               &inAttributes,
    601                               &inCommandID))
    602                 return NULL;
    603         _err = AppendMenuItemTextWithCFString(_self->ob_itself,
    604                                               inString,
    605                                               inAttributes,
    606                                               inCommandID,
    607                                               &outNewItem);
    608         if (_err != noErr) return PyMac_Error(_err);
    609         _res = Py_BuildValue("h",
    610                              outNewItem);
    611         return _res;
     596    PyMac_PRECHECK(AppendMenuItemTextWithCFString);
     597#endif
     598    if (!PyArg_ParseTuple(_args, "O&ll",
     599                          CFStringRefObj_Convert, &inString,
     600                          &inAttributes,
     601                          &inCommandID))
     602        return NULL;
     603    _err = AppendMenuItemTextWithCFString(_self->ob_itself,
     604                                          inString,
     605                                          inAttributes,
     606                                          inCommandID,
     607                                          &outNewItem);
     608    if (_err != noErr) return PyMac_Error(_err);
     609    _res = Py_BuildValue("h",
     610                         outNewItem);
     611    return _res;
    612612}
    613613
    614614static PyObject *MenuObj_InsertMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
    615615{
    616         PyObject *_res = NULL;
    617         OSStatus _err;
    618         CFStringRef inString;
    619         MenuItemIndex inAfterItem;
    620         MenuItemAttributes inAttributes;
    621         MenuCommand inCommandID;
     616    PyObject *_res = NULL;
     617    OSStatus _err;
     618    CFStringRef inString;
     619    MenuItemIndex inAfterItem;
     620    MenuItemAttributes inAttributes;
     621    MenuCommand inCommandID;
    622622#ifndef InsertMenuItemTextWithCFString
    623         PyMac_PRECHECK(InsertMenuItemTextWithCFString);
    624 #endif
    625         if (!PyArg_ParseTuple(_args, "O&hll",
    626                               CFStringRefObj_Convert, &inString,
    627                               &inAfterItem,
    628                               &inAttributes,
    629                               &inCommandID))
    630                 return NULL;
    631         _err = InsertMenuItemTextWithCFString(_self->ob_itself,
    632                                               inString,
    633                                               inAfterItem,
    634                                               inAttributes,
    635                                               inCommandID);
    636         if (_err != noErr) return PyMac_Error(_err);
    637         Py_INCREF(Py_None);
    638         _res = Py_None;
    639         return _res;
     623    PyMac_PRECHECK(InsertMenuItemTextWithCFString);
     624#endif
     625    if (!PyArg_ParseTuple(_args, "O&hll",
     626                          CFStringRefObj_Convert, &inString,
     627                          &inAfterItem,
     628                          &inAttributes,
     629                          &inCommandID))
     630        return NULL;
     631    _err = InsertMenuItemTextWithCFString(_self->ob_itself,
     632                                          inString,
     633                                          inAfterItem,
     634                                          inAttributes,
     635                                          inCommandID);
     636    if (_err != noErr) return PyMac_Error(_err);
     637    Py_INCREF(Py_None);
     638    _res = Py_None;
     639    return _res;
    640640}
    641641
    642642static PyObject *MenuObj_PopUpMenuSelect(MenuObject *_self, PyObject *_args)
    643643{
    644         PyObject *_res = NULL;
    645         long _rv;
    646         short top;
    647         short left;
    648         short popUpItem;
     644    PyObject *_res = NULL;
     645    long _rv;
     646    short top;
     647    short left;
     648    short popUpItem;
    649649#ifndef PopUpMenuSelect
    650         PyMac_PRECHECK(PopUpMenuSelect);
    651 #endif
    652         if (!PyArg_ParseTuple(_args, "hhh",
    653                               &top,
    654                               &left,
    655                               &popUpItem))
    656                 return NULL;
    657         _rv = PopUpMenuSelect(_self->ob_itself,
    658                               top,
    659                               left,
    660                               popUpItem);
    661         _res = Py_BuildValue("l",
    662                              _rv);
    663         return _res;
     650    PyMac_PRECHECK(PopUpMenuSelect);
     651#endif
     652    if (!PyArg_ParseTuple(_args, "hhh",
     653                          &top,
     654                          &left,
     655                          &popUpItem))
     656        return NULL;
     657    _rv = PopUpMenuSelect(_self->ob_itself,
     658                          top,
     659                          left,
     660                          popUpItem);
     661    _res = Py_BuildValue("l",
     662                         _rv);
     663    return _res;
    664664}
    665665
    666666static PyObject *MenuObj_InvalidateMenuEnabling(MenuObject *_self, PyObject *_args)
    667667{
    668         PyObject *_res = NULL;
    669         OSStatus _err;
     668    PyObject *_res = NULL;
     669    OSStatus _err;
    670670#ifndef InvalidateMenuEnabling
    671         PyMac_PRECHECK(InvalidateMenuEnabling);
    672 #endif
    673         if (!PyArg_ParseTuple(_args, ""))
    674                 return NULL;
    675         _err = InvalidateMenuEnabling(_self->ob_itself);
    676         if (_err != noErr) return PyMac_Error(_err);
    677         Py_INCREF(Py_None);
    678         _res = Py_None;
    679         return _res;
     671    PyMac_PRECHECK(InvalidateMenuEnabling);
     672#endif
     673    if (!PyArg_ParseTuple(_args, ""))
     674        return NULL;
     675    _err = InvalidateMenuEnabling(_self->ob_itself);
     676    if (_err != noErr) return PyMac_Error(_err);
     677    Py_INCREF(Py_None);
     678    _res = Py_None;
     679    return _res;
    680680}
    681681
    682682static PyObject *MenuObj_IsMenuBarInvalid(MenuObject *_self, PyObject *_args)
    683683{
    684         PyObject *_res = NULL;
    685         Boolean _rv;
     684    PyObject *_res = NULL;
     685    Boolean _rv;
    686686#ifndef IsMenuBarInvalid
    687         PyMac_PRECHECK(IsMenuBarInvalid);
    688 #endif
    689         if (!PyArg_ParseTuple(_args, ""))
    690                 return NULL;
    691         _rv = IsMenuBarInvalid(_self->ob_itself);
    692         _res = Py_BuildValue("b",
    693                              _rv);
    694         return _res;
     687    PyMac_PRECHECK(IsMenuBarInvalid);
     688#endif
     689    if (!PyArg_ParseTuple(_args, ""))
     690        return NULL;
     691    _rv = IsMenuBarInvalid(_self->ob_itself);
     692    _res = Py_BuildValue("b",
     693                         _rv);
     694    return _res;
    695695}
    696696
    697697static PyObject *MenuObj_MacInsertMenu(MenuObject *_self, PyObject *_args)
    698698{
    699         PyObject *_res = NULL;
    700         MenuID beforeID;
     699    PyObject *_res = NULL;
     700    MenuID beforeID;
    701701#ifndef MacInsertMenu
    702         PyMac_PRECHECK(MacInsertMenu);
    703 #endif
    704         if (!PyArg_ParseTuple(_args, "h",
    705                               &beforeID))
    706                 return NULL;
    707         MacInsertMenu(_self->ob_itself,
    708                       beforeID);
    709         Py_INCREF(Py_None);
    710         _res = Py_None;
    711         return _res;
     702    PyMac_PRECHECK(MacInsertMenu);
     703#endif
     704    if (!PyArg_ParseTuple(_args, "h",
     705                          &beforeID))
     706        return NULL;
     707    MacInsertMenu(_self->ob_itself,
     708                  beforeID);
     709    Py_INCREF(Py_None);
     710    _res = Py_None;
     711    return _res;
    712712}
    713713
    714714static PyObject *MenuObj_SetRootMenu(MenuObject *_self, PyObject *_args)
    715715{
    716         PyObject *_res = NULL;
    717         OSStatus _err;
     716    PyObject *_res = NULL;
     717    OSStatus _err;
    718718#ifndef SetRootMenu
    719         PyMac_PRECHECK(SetRootMenu);
    720 #endif
    721         if (!PyArg_ParseTuple(_args, ""))
    722                 return NULL;
    723         _err = SetRootMenu(_self->ob_itself);
    724         if (_err != noErr) return PyMac_Error(_err);
    725         Py_INCREF(Py_None);
    726         _res = Py_None;
    727         return _res;
     719    PyMac_PRECHECK(SetRootMenu);
     720#endif
     721    if (!PyArg_ParseTuple(_args, ""))
     722        return NULL;
     723    _err = SetRootMenu(_self->ob_itself);
     724    if (_err != noErr) return PyMac_Error(_err);
     725    Py_INCREF(Py_None);
     726    _res = Py_None;
     727    return _res;
    728728}
    729729
    730730static PyObject *MenuObj_MacCheckMenuItem(MenuObject *_self, PyObject *_args)
    731731{
    732         PyObject *_res = NULL;
    733         short item;
    734         Boolean checked;
     732    PyObject *_res = NULL;
     733    short item;
     734    Boolean checked;
    735735#ifndef MacCheckMenuItem
    736         PyMac_PRECHECK(MacCheckMenuItem);
    737 #endif
    738         if (!PyArg_ParseTuple(_args, "hb",
    739                               &item,
    740                               &checked))
    741                 return NULL;
    742         MacCheckMenuItem(_self->ob_itself,
    743                          item,
    744                          checked);
    745         Py_INCREF(Py_None);
    746         _res = Py_None;
    747         return _res;
     736    PyMac_PRECHECK(MacCheckMenuItem);
     737#endif
     738    if (!PyArg_ParseTuple(_args, "hb",
     739                          &item,
     740                          &checked))
     741        return NULL;
     742    MacCheckMenuItem(_self->ob_itself,
     743                     item,
     744                     checked);
     745    Py_INCREF(Py_None);
     746    _res = Py_None;
     747    return _res;
    748748}
    749749
    750750static PyObject *MenuObj_SetMenuItemText(MenuObject *_self, PyObject *_args)
    751751{
    752         PyObject *_res = NULL;
    753         short item;
    754         Str255 itemString;
     752    PyObject *_res = NULL;
     753    short item;
     754    Str255 itemString;
    755755#ifndef SetMenuItemText
    756         PyMac_PRECHECK(SetMenuItemText);
    757 #endif
    758         if (!PyArg_ParseTuple(_args, "hO&",
    759                               &item,
    760                               PyMac_GetStr255, itemString))
    761                 return NULL;
    762         SetMenuItemText(_self->ob_itself,
    763                         item,
    764                         itemString);
    765         Py_INCREF(Py_None);
    766         _res = Py_None;
    767         return _res;
     756    PyMac_PRECHECK(SetMenuItemText);
     757#endif
     758    if (!PyArg_ParseTuple(_args, "hO&",
     759                          &item,
     760                          PyMac_GetStr255, itemString))
     761        return NULL;
     762    SetMenuItemText(_self->ob_itself,
     763                    item,
     764                    itemString);
     765    Py_INCREF(Py_None);
     766    _res = Py_None;
     767    return _res;
    768768}
    769769
    770770static PyObject *MenuObj_GetMenuItemText(MenuObject *_self, PyObject *_args)
    771771{
    772         PyObject *_res = NULL;
    773         short item;
    774         Str255 itemString;
     772    PyObject *_res = NULL;
     773    short item;
     774    Str255 itemString;
    775775#ifndef GetMenuItemText
    776         PyMac_PRECHECK(GetMenuItemText);
    777 #endif
    778         if (!PyArg_ParseTuple(_args, "h",
    779                               &item))
    780                 return NULL;
    781         GetMenuItemText(_self->ob_itself,
    782                         item,
    783                         itemString);
    784         _res = Py_BuildValue("O&",
    785                              PyMac_BuildStr255, itemString);
    786         return _res;
     776    PyMac_PRECHECK(GetMenuItemText);
     777#endif
     778    if (!PyArg_ParseTuple(_args, "h",
     779                          &item))
     780        return NULL;
     781    GetMenuItemText(_self->ob_itself,
     782                    item,
     783                    itemString);
     784    _res = Py_BuildValue("O&",
     785                         PyMac_BuildStr255, itemString);
     786    return _res;
    787787}
    788788
    789789static PyObject *MenuObj_SetItemMark(MenuObject *_self, PyObject *_args)
    790790{
    791         PyObject *_res = NULL;
    792         short item;
    793         CharParameter markChar;
     791    PyObject *_res = NULL;
     792    short item;
     793    CharParameter markChar;
    794794#ifndef SetItemMark
    795         PyMac_PRECHECK(SetItemMark);
    796 #endif
    797         if (!PyArg_ParseTuple(_args, "hh",
    798                               &item,
    799                               &markChar))
    800                 return NULL;
    801         SetItemMark(_self->ob_itself,
    802                     item,
    803                     markChar);
    804         Py_INCREF(Py_None);
    805         _res = Py_None;
    806         return _res;
     795    PyMac_PRECHECK(SetItemMark);
     796#endif
     797    if (!PyArg_ParseTuple(_args, "hh",
     798                          &item,
     799                          &markChar))
     800        return NULL;
     801    SetItemMark(_self->ob_itself,
     802                item,
     803                markChar);
     804    Py_INCREF(Py_None);
     805    _res = Py_None;
     806    return _res;
    807807}
    808808
    809809static PyObject *MenuObj_GetItemMark(MenuObject *_self, PyObject *_args)
    810810{
    811         PyObject *_res = NULL;
    812         short item;
    813         CharParameter markChar;
     811    PyObject *_res = NULL;
     812    short item;
     813    CharParameter markChar;
    814814#ifndef GetItemMark
    815         PyMac_PRECHECK(GetItemMark);
    816 #endif
    817         if (!PyArg_ParseTuple(_args, "h",
    818                               &item))
    819                 return NULL;
    820         GetItemMark(_self->ob_itself,
    821                     item,
    822                     &markChar);
    823         _res = Py_BuildValue("h",
    824                              markChar);
    825         return _res;
     815    PyMac_PRECHECK(GetItemMark);
     816#endif
     817    if (!PyArg_ParseTuple(_args, "h",
     818                          &item))
     819        return NULL;
     820    GetItemMark(_self->ob_itself,
     821                item,
     822                &markChar);
     823    _res = Py_BuildValue("h",
     824                         markChar);
     825    return _res;
    826826}
    827827
    828828static PyObject *MenuObj_SetItemCmd(MenuObject *_self, PyObject *_args)
    829829{
    830         PyObject *_res = NULL;
    831         short item;
    832         CharParameter cmdChar;
     830    PyObject *_res = NULL;
     831    short item;
     832    CharParameter cmdChar;
    833833#ifndef SetItemCmd
    834         PyMac_PRECHECK(SetItemCmd);
    835 #endif
    836         if (!PyArg_ParseTuple(_args, "hh",
    837                               &item,
    838                               &cmdChar))
    839                 return NULL;
    840         SetItemCmd(_self->ob_itself,
    841                    item,
    842                    cmdChar);
    843         Py_INCREF(Py_None);
    844         _res = Py_None;
    845         return _res;
     834    PyMac_PRECHECK(SetItemCmd);
     835#endif
     836    if (!PyArg_ParseTuple(_args, "hh",
     837                          &item,
     838                          &cmdChar))
     839        return NULL;
     840    SetItemCmd(_self->ob_itself,
     841               item,
     842               cmdChar);
     843    Py_INCREF(Py_None);
     844    _res = Py_None;
     845    return _res;
    846846}
    847847
    848848static PyObject *MenuObj_GetItemCmd(MenuObject *_self, PyObject *_args)
    849849{
    850         PyObject *_res = NULL;
    851         short item;
    852         CharParameter cmdChar;
     850    PyObject *_res = NULL;
     851    short item;
     852    CharParameter cmdChar;
    853853#ifndef GetItemCmd
    854         PyMac_PRECHECK(GetItemCmd);
    855 #endif
    856         if (!PyArg_ParseTuple(_args, "h",
    857                               &item))
    858                 return NULL;
    859         GetItemCmd(_self->ob_itself,
    860                    item,
    861                    &cmdChar);
    862         _res = Py_BuildValue("h",
    863                              cmdChar);
    864         return _res;
     854    PyMac_PRECHECK(GetItemCmd);
     855#endif
     856    if (!PyArg_ParseTuple(_args, "h",
     857                          &item))
     858        return NULL;
     859    GetItemCmd(_self->ob_itself,
     860               item,
     861               &cmdChar);
     862    _res = Py_BuildValue("h",
     863                         cmdChar);
     864    return _res;
    865865}
    866866
    867867static PyObject *MenuObj_SetItemIcon(MenuObject *_self, PyObject *_args)
    868868{
    869         PyObject *_res = NULL;
    870         short item;
    871         short iconIndex;
     869    PyObject *_res = NULL;
     870    short item;
     871    short iconIndex;
    872872#ifndef SetItemIcon
    873         PyMac_PRECHECK(SetItemIcon);
    874 #endif
    875         if (!PyArg_ParseTuple(_args, "hh",
    876                               &item,
    877                               &iconIndex))
    878                 return NULL;
    879         SetItemIcon(_self->ob_itself,
    880                     item,
    881                     iconIndex);
    882         Py_INCREF(Py_None);
    883         _res = Py_None;
    884         return _res;
     873    PyMac_PRECHECK(SetItemIcon);
     874#endif
     875    if (!PyArg_ParseTuple(_args, "hh",
     876                          &item,
     877                          &iconIndex))
     878        return NULL;
     879    SetItemIcon(_self->ob_itself,
     880                item,
     881                iconIndex);
     882    Py_INCREF(Py_None);
     883    _res = Py_None;
     884    return _res;
    885885}
    886886
    887887static PyObject *MenuObj_GetItemIcon(MenuObject *_self, PyObject *_args)
    888888{
    889         PyObject *_res = NULL;
    890         short item;
    891         short iconIndex;
     889    PyObject *_res = NULL;
     890    short item;
     891    short iconIndex;
    892892#ifndef GetItemIcon
    893         PyMac_PRECHECK(GetItemIcon);
    894 #endif
    895         if (!PyArg_ParseTuple(_args, "h",
    896                               &item))
    897                 return NULL;
    898         GetItemIcon(_self->ob_itself,
    899                     item,
    900                     &iconIndex);
    901         _res = Py_BuildValue("h",
    902                              iconIndex);
    903         return _res;
     893    PyMac_PRECHECK(GetItemIcon);
     894#endif
     895    if (!PyArg_ParseTuple(_args, "h",
     896                          &item))
     897        return NULL;
     898    GetItemIcon(_self->ob_itself,
     899                item,
     900                &iconIndex);
     901    _res = Py_BuildValue("h",
     902                         iconIndex);
     903    return _res;
    904904}
    905905
    906906static PyObject *MenuObj_SetItemStyle(MenuObject *_self, PyObject *_args)
    907907{
    908         PyObject *_res = NULL;
    909         short item;
    910         StyleParameter chStyle;
     908    PyObject *_res = NULL;
     909    short item;
     910    StyleParameter chStyle;
    911911#ifndef SetItemStyle
    912         PyMac_PRECHECK(SetItemStyle);
    913 #endif
    914         if (!PyArg_ParseTuple(_args, "hh",
    915                               &item,
    916                               &chStyle))
    917                 return NULL;
    918         SetItemStyle(_self->ob_itself,
    919                      item,
    920                      chStyle);
    921         Py_INCREF(Py_None);
    922         _res = Py_None;
    923         return _res;
     912    PyMac_PRECHECK(SetItemStyle);
     913#endif
     914    if (!PyArg_ParseTuple(_args, "hh",
     915                          &item,
     916                          &chStyle))
     917        return NULL;
     918    SetItemStyle(_self->ob_itself,
     919                 item,
     920                 chStyle);
     921    Py_INCREF(Py_None);
     922    _res = Py_None;
     923    return _res;
    924924}
    925925
    926926static PyObject *MenuObj_GetItemStyle(MenuObject *_self, PyObject *_args)
    927927{
    928         PyObject *_res = NULL;
    929         short item;
    930         Style chStyle;
     928    PyObject *_res = NULL;
     929    short item;
     930    Style chStyle;
    931931#ifndef GetItemStyle
    932         PyMac_PRECHECK(GetItemStyle);
    933 #endif
    934         if (!PyArg_ParseTuple(_args, "h",
    935                               &item))
    936                 return NULL;
    937         GetItemStyle(_self->ob_itself,
    938                      item,
    939                      &chStyle);
    940         _res = Py_BuildValue("b",
    941                              chStyle);
    942         return _res;
     932    PyMac_PRECHECK(GetItemStyle);
     933#endif
     934    if (!PyArg_ParseTuple(_args, "h",
     935                          &item))
     936        return NULL;
     937    GetItemStyle(_self->ob_itself,
     938                 item,
     939                 &chStyle);
     940    _res = Py_BuildValue("b",
     941                         chStyle);
     942    return _res;
    943943}
    944944
    945945static PyObject *MenuObj_SetMenuItemCommandID(MenuObject *_self, PyObject *_args)
    946946{
    947         PyObject *_res = NULL;
    948         OSErr _err;
    949         SInt16 inItem;
    950         MenuCommand inCommandID;
     947    PyObject *_res = NULL;
     948    OSErr _err;
     949    SInt16 inItem;
     950    MenuCommand inCommandID;
    951951#ifndef SetMenuItemCommandID
    952         PyMac_PRECHECK(SetMenuItemCommandID);
    953 #endif
    954         if (!PyArg_ParseTuple(_args, "hl",
    955                               &inItem,
    956                               &inCommandID))
    957                 return NULL;
    958         _err = SetMenuItemCommandID(_self->ob_itself,
    959                                     inItem,
    960                                     inCommandID);
    961         if (_err != noErr) return PyMac_Error(_err);
    962         Py_INCREF(Py_None);
    963         _res = Py_None;
    964         return _res;
     952    PyMac_PRECHECK(SetMenuItemCommandID);
     953#endif
     954    if (!PyArg_ParseTuple(_args, "hl",
     955                          &inItem,
     956                          &inCommandID))
     957        return NULL;
     958    _err = SetMenuItemCommandID(_self->ob_itself,
     959                                inItem,
     960                                inCommandID);
     961    if (_err != noErr) return PyMac_Error(_err);
     962    Py_INCREF(Py_None);
     963    _res = Py_None;
     964    return _res;
    965965}
    966966
    967967static PyObject *MenuObj_GetMenuItemCommandID(MenuObject *_self, PyObject *_args)
    968968{
    969         PyObject *_res = NULL;
    970         OSErr _err;
    971         SInt16 inItem;
    972         MenuCommand outCommandID;
     969    PyObject *_res = NULL;
     970    OSErr _err;
     971    SInt16 inItem;
     972    MenuCommand outCommandID;
    973973#ifndef GetMenuItemCommandID
    974         PyMac_PRECHECK(GetMenuItemCommandID);
    975 #endif
    976         if (!PyArg_ParseTuple(_args, "h",
    977                               &inItem))
    978                 return NULL;
    979         _err = GetMenuItemCommandID(_self->ob_itself,
    980                                     inItem,
    981                                     &outCommandID);
    982         if (_err != noErr) return PyMac_Error(_err);
    983         _res = Py_BuildValue("l",
    984                              outCommandID);
    985         return _res;
     974    PyMac_PRECHECK(GetMenuItemCommandID);
     975#endif
     976    if (!PyArg_ParseTuple(_args, "h",
     977                          &inItem))
     978        return NULL;
     979    _err = GetMenuItemCommandID(_self->ob_itself,
     980                                inItem,
     981                                &outCommandID);
     982    if (_err != noErr) return PyMac_Error(_err);
     983    _res = Py_BuildValue("l",
     984                         outCommandID);
     985    return _res;
    986986}
    987987
    988988static PyObject *MenuObj_SetMenuItemModifiers(MenuObject *_self, PyObject *_args)
    989989{
    990         PyObject *_res = NULL;
    991         OSErr _err;
    992         SInt16 inItem;
    993         UInt8 inModifiers;
     990    PyObject *_res = NULL;
     991    OSErr _err;
     992    SInt16 inItem;
     993    UInt8 inModifiers;
    994994#ifndef SetMenuItemModifiers
    995         PyMac_PRECHECK(SetMenuItemModifiers);
    996 #endif
    997         if (!PyArg_ParseTuple(_args, "hb",
    998                               &inItem,
    999                               &inModifiers))
    1000                 return NULL;
    1001         _err = SetMenuItemModifiers(_self->ob_itself,
    1002                                     inItem,
    1003                                     inModifiers);
    1004         if (_err != noErr) return PyMac_Error(_err);
    1005         Py_INCREF(Py_None);
    1006         _res = Py_None;
    1007         return _res;
     995    PyMac_PRECHECK(SetMenuItemModifiers);
     996#endif
     997    if (!PyArg_ParseTuple(_args, "hb",
     998                          &inItem,
     999                          &inModifiers))
     1000        return NULL;
     1001    _err = SetMenuItemModifiers(_self->ob_itself,
     1002                                inItem,
     1003                                inModifiers);
     1004    if (_err != noErr) return PyMac_Error(_err);
     1005    Py_INCREF(Py_None);
     1006    _res = Py_None;
     1007    return _res;
    10081008}
    10091009
    10101010static PyObject *MenuObj_GetMenuItemModifiers(MenuObject *_self, PyObject *_args)
    10111011{
    1012         PyObject *_res = NULL;
    1013         OSErr _err;
    1014         SInt16 inItem;
    1015         UInt8 outModifiers;
     1012    PyObject *_res = NULL;
     1013    OSErr _err;
     1014    SInt16 inItem;
     1015    UInt8 outModifiers;
    10161016#ifndef GetMenuItemModifiers
    1017         PyMac_PRECHECK(GetMenuItemModifiers);
    1018 #endif
    1019         if (!PyArg_ParseTuple(_args, "h",
    1020                               &inItem))
    1021                 return NULL;
    1022         _err = GetMenuItemModifiers(_self->ob_itself,
    1023                                     inItem,
    1024                                     &outModifiers);
    1025         if (_err != noErr) return PyMac_Error(_err);
    1026         _res = Py_BuildValue("b",
    1027                              outModifiers);
    1028         return _res;
     1017    PyMac_PRECHECK(GetMenuItemModifiers);
     1018#endif
     1019    if (!PyArg_ParseTuple(_args, "h",
     1020                          &inItem))
     1021        return NULL;
     1022    _err = GetMenuItemModifiers(_self->ob_itself,
     1023                                inItem,
     1024                                &outModifiers);
     1025    if (_err != noErr) return PyMac_Error(_err);
     1026    _res = Py_BuildValue("b",
     1027                         outModifiers);
     1028    return _res;
    10291029}
    10301030
    10311031static PyObject *MenuObj_SetMenuItemIconHandle(MenuObject *_self, PyObject *_args)
    10321032{
    1033         PyObject *_res = NULL;
    1034         OSErr _err;
    1035         SInt16 inItem;
    1036         UInt8 inIconType;
    1037         Handle inIconHandle;
     1033    PyObject *_res = NULL;
     1034    OSErr _err;
     1035    SInt16 inItem;
     1036    UInt8 inIconType;
     1037    Handle inIconHandle;
    10381038#ifndef SetMenuItemIconHandle
    1039         PyMac_PRECHECK(SetMenuItemIconHandle);
    1040 #endif
    1041         if (!PyArg_ParseTuple(_args, "hbO&",
    1042                               &inItem,
    1043                               &inIconType,
    1044                               ResObj_Convert, &inIconHandle))
    1045                 return NULL;
    1046         _err = SetMenuItemIconHandle(_self->ob_itself,
    1047                                      inItem,
    1048                                      inIconType,
    1049                                      inIconHandle);
    1050         if (_err != noErr) return PyMac_Error(_err);
    1051         Py_INCREF(Py_None);
    1052         _res = Py_None;
    1053         return _res;
     1039    PyMac_PRECHECK(SetMenuItemIconHandle);
     1040#endif
     1041    if (!PyArg_ParseTuple(_args, "hbO&",
     1042                          &inItem,
     1043                          &inIconType,
     1044                          ResObj_Convert, &inIconHandle))
     1045        return NULL;
     1046    _err = SetMenuItemIconHandle(_self->ob_itself,
     1047                                 inItem,
     1048                                 inIconType,
     1049                                 inIconHandle);
     1050    if (_err != noErr) return PyMac_Error(_err);
     1051    Py_INCREF(Py_None);
     1052    _res = Py_None;
     1053    return _res;
    10541054}
    10551055
    10561056static PyObject *MenuObj_GetMenuItemIconHandle(MenuObject *_self, PyObject *_args)
    10571057{
    1058         PyObject *_res = NULL;
    1059         OSErr _err;
    1060         SInt16 inItem;
    1061         UInt8 outIconType;
    1062         Handle outIconHandle;
     1058    PyObject *_res = NULL;
     1059    OSErr _err;
     1060    SInt16 inItem;
     1061    UInt8 outIconType;
     1062    Handle outIconHandle;
    10631063#ifndef GetMenuItemIconHandle
    1064         PyMac_PRECHECK(GetMenuItemIconHandle);
    1065 #endif
    1066         if (!PyArg_ParseTuple(_args, "h",
    1067                               &inItem))
    1068                 return NULL;
    1069         _err = GetMenuItemIconHandle(_self->ob_itself,
    1070                                      inItem,
    1071                                      &outIconType,
    1072                                      &outIconHandle);
    1073         if (_err != noErr) return PyMac_Error(_err);
    1074         _res = Py_BuildValue("bO&",
    1075                              outIconType,
    1076                              ResObj_New, outIconHandle);
    1077         return _res;
     1064    PyMac_PRECHECK(GetMenuItemIconHandle);
     1065#endif
     1066    if (!PyArg_ParseTuple(_args, "h",
     1067                          &inItem))
     1068        return NULL;
     1069    _err = GetMenuItemIconHandle(_self->ob_itself,
     1070                                 inItem,
     1071                                 &outIconType,
     1072                                 &outIconHandle);
     1073    if (_err != noErr) return PyMac_Error(_err);
     1074    _res = Py_BuildValue("bO&",
     1075                         outIconType,
     1076                         ResObj_New, outIconHandle);
     1077    return _res;
    10781078}
    10791079
    10801080static PyObject *MenuObj_SetMenuItemTextEncoding(MenuObject *_self, PyObject *_args)
    10811081{
    1082         PyObject *_res = NULL;
    1083         OSErr _err;
    1084         SInt16 inItem;
    1085         TextEncoding inScriptID;
     1082    PyObject *_res = NULL;
     1083    OSErr _err;
     1084    SInt16 inItem;
     1085    TextEncoding inScriptID;
    10861086#ifndef SetMenuItemTextEncoding
    1087         PyMac_PRECHECK(SetMenuItemTextEncoding);
    1088 #endif
    1089         if (!PyArg_ParseTuple(_args, "hl",
    1090                               &inItem,
    1091                               &inScriptID))
    1092                 return NULL;
    1093         _err = SetMenuItemTextEncoding(_self->ob_itself,
    1094                                        inItem,
    1095                                        inScriptID);
    1096         if (_err != noErr) return PyMac_Error(_err);
    1097         Py_INCREF(Py_None);
    1098         _res = Py_None;
    1099         return _res;
     1087    PyMac_PRECHECK(SetMenuItemTextEncoding);
     1088#endif
     1089    if (!PyArg_ParseTuple(_args, "hl",
     1090                          &inItem,
     1091                          &inScriptID))
     1092        return NULL;
     1093    _err = SetMenuItemTextEncoding(_self->ob_itself,
     1094                                   inItem,
     1095                                   inScriptID);
     1096    if (_err != noErr) return PyMac_Error(_err);
     1097    Py_INCREF(Py_None);
     1098    _res = Py_None;
     1099    return _res;
    11001100}
    11011101
    11021102static PyObject *MenuObj_GetMenuItemTextEncoding(MenuObject *_self, PyObject *_args)
    11031103{
    1104         PyObject *_res = NULL;
    1105         OSErr _err;
    1106         SInt16 inItem;
    1107         TextEncoding outScriptID;
     1104    PyObject *_res = NULL;
     1105    OSErr _err;
     1106    SInt16 inItem;
     1107    TextEncoding outScriptID;
    11081108#ifndef GetMenuItemTextEncoding
    1109         PyMac_PRECHECK(GetMenuItemTextEncoding);
    1110 #endif
    1111         if (!PyArg_ParseTuple(_args, "h",
    1112                               &inItem))
    1113                 return NULL;
    1114         _err = GetMenuItemTextEncoding(_self->ob_itself,
    1115                                        inItem,
    1116                                        &outScriptID);
    1117         if (_err != noErr) return PyMac_Error(_err);
    1118         _res = Py_BuildValue("l",
    1119                              outScriptID);
    1120         return _res;
     1109    PyMac_PRECHECK(GetMenuItemTextEncoding);
     1110#endif
     1111    if (!PyArg_ParseTuple(_args, "h",
     1112                          &inItem))
     1113        return NULL;
     1114    _err = GetMenuItemTextEncoding(_self->ob_itself,
     1115                                   inItem,
     1116                                   &outScriptID);
     1117    if (_err != noErr) return PyMac_Error(_err);
     1118    _res = Py_BuildValue("l",
     1119                         outScriptID);
     1120    return _res;
    11211121}
    11221122
    11231123static PyObject *MenuObj_SetMenuItemHierarchicalID(MenuObject *_self, PyObject *_args)
    11241124{
    1125         PyObject *_res = NULL;
    1126         OSErr _err;
    1127         SInt16 inItem;
    1128         MenuID inHierID;
     1125    PyObject *_res = NULL;
     1126    OSErr _err;
     1127    SInt16 inItem;
     1128    MenuID inHierID;
    11291129#ifndef SetMenuItemHierarchicalID
    1130         PyMac_PRECHECK(SetMenuItemHierarchicalID);
    1131 #endif
    1132         if (!PyArg_ParseTuple(_args, "hh",
    1133                               &inItem,
    1134                               &inHierID))
    1135                 return NULL;
    1136         _err = SetMenuItemHierarchicalID(_self->ob_itself,
    1137                                          inItem,
    1138                                          inHierID);
    1139         if (_err != noErr) return PyMac_Error(_err);
    1140         Py_INCREF(Py_None);
    1141         _res = Py_None;
    1142         return _res;
     1130    PyMac_PRECHECK(SetMenuItemHierarchicalID);
     1131#endif
     1132    if (!PyArg_ParseTuple(_args, "hh",
     1133                          &inItem,
     1134                          &inHierID))
     1135        return NULL;
     1136    _err = SetMenuItemHierarchicalID(_self->ob_itself,
     1137                                     inItem,
     1138                                     inHierID);
     1139    if (_err != noErr) return PyMac_Error(_err);
     1140    Py_INCREF(Py_None);
     1141    _res = Py_None;
     1142    return _res;
    11431143}
    11441144
    11451145static PyObject *MenuObj_GetMenuItemHierarchicalID(MenuObject *_self, PyObject *_args)
    11461146{
    1147         PyObject *_res = NULL;
    1148         OSErr _err;
    1149         SInt16 inItem;
    1150         MenuID outHierID;
     1147    PyObject *_res = NULL;
     1148    OSErr _err;
     1149    SInt16 inItem;
     1150    MenuID outHierID;
    11511151#ifndef GetMenuItemHierarchicalID
    1152         PyMac_PRECHECK(GetMenuItemHierarchicalID);
    1153 #endif
    1154         if (!PyArg_ParseTuple(_args, "h",
    1155                               &inItem))
    1156                 return NULL;
    1157         _err = GetMenuItemHierarchicalID(_self->ob_itself,
    1158                                          inItem,
    1159                                          &outHierID);
    1160         if (_err != noErr) return PyMac_Error(_err);
    1161         _res = Py_BuildValue("h",
    1162                              outHierID);
    1163         return _res;
     1152    PyMac_PRECHECK(GetMenuItemHierarchicalID);
     1153#endif
     1154    if (!PyArg_ParseTuple(_args, "h",
     1155                          &inItem))
     1156        return NULL;
     1157    _err = GetMenuItemHierarchicalID(_self->ob_itself,
     1158                                     inItem,
     1159                                     &outHierID);
     1160    if (_err != noErr) return PyMac_Error(_err);
     1161    _res = Py_BuildValue("h",
     1162                         outHierID);
     1163    return _res;
    11641164}
    11651165
    11661166static PyObject *MenuObj_SetMenuItemFontID(MenuObject *_self, PyObject *_args)
    11671167{
    1168         PyObject *_res = NULL;
    1169         OSErr _err;
    1170         SInt16 inItem;
    1171         SInt16 inFontID;
     1168    PyObject *_res = NULL;
     1169    OSErr _err;
     1170    SInt16 inItem;
     1171    SInt16 inFontID;
    11721172#ifndef SetMenuItemFontID
    1173         PyMac_PRECHECK(SetMenuItemFontID);
    1174 #endif
    1175         if (!PyArg_ParseTuple(_args, "hh",
    1176                               &inItem,
    1177                               &inFontID))
    1178                 return NULL;
    1179         _err = SetMenuItemFontID(_self->ob_itself,
    1180                                  inItem,
    1181                                  inFontID);
    1182         if (_err != noErr) return PyMac_Error(_err);
    1183         Py_INCREF(Py_None);
    1184         _res = Py_None;
    1185         return _res;
     1173    PyMac_PRECHECK(SetMenuItemFontID);
     1174#endif
     1175    if (!PyArg_ParseTuple(_args, "hh",
     1176                          &inItem,
     1177                          &inFontID))
     1178        return NULL;
     1179    _err = SetMenuItemFontID(_self->ob_itself,
     1180                             inItem,
     1181                             inFontID);
     1182    if (_err != noErr) return PyMac_Error(_err);
     1183    Py_INCREF(Py_None);
     1184    _res = Py_None;
     1185    return _res;
    11861186}
    11871187
    11881188static PyObject *MenuObj_GetMenuItemFontID(MenuObject *_self, PyObject *_args)
    11891189{
    1190         PyObject *_res = NULL;
    1191         OSErr _err;
    1192         SInt16 inItem;
    1193         SInt16 outFontID;
     1190    PyObject *_res = NULL;
     1191    OSErr _err;
     1192    SInt16 inItem;
     1193    SInt16 outFontID;
    11941194#ifndef GetMenuItemFontID
    1195         PyMac_PRECHECK(GetMenuItemFontID);
    1196 #endif
    1197         if (!PyArg_ParseTuple(_args, "h",
    1198                               &inItem))
    1199                 return NULL;
    1200         _err = GetMenuItemFontID(_self->ob_itself,
    1201                                  inItem,
    1202                                  &outFontID);
    1203         if (_err != noErr) return PyMac_Error(_err);
    1204         _res = Py_BuildValue("h",
    1205                              outFontID);
    1206         return _res;
     1195    PyMac_PRECHECK(GetMenuItemFontID);
     1196#endif
     1197    if (!PyArg_ParseTuple(_args, "h",
     1198                          &inItem))
     1199        return NULL;
     1200    _err = GetMenuItemFontID(_self->ob_itself,
     1201                             inItem,
     1202                             &outFontID);
     1203    if (_err != noErr) return PyMac_Error(_err);
     1204    _res = Py_BuildValue("h",
     1205                         outFontID);
     1206    return _res;
    12071207}
    12081208
    12091209static PyObject *MenuObj_SetMenuItemRefCon(MenuObject *_self, PyObject *_args)
    12101210{
    1211         PyObject *_res = NULL;
    1212         OSErr _err;
    1213         SInt16 inItem;
    1214         UInt32 inRefCon;
     1211    PyObject *_res = NULL;
     1212    OSErr _err;
     1213    SInt16 inItem;
     1214    UInt32 inRefCon;
    12151215#ifndef SetMenuItemRefCon
    1216         PyMac_PRECHECK(SetMenuItemRefCon);
    1217 #endif
    1218         if (!PyArg_ParseTuple(_args, "hl",
    1219                               &inItem,
    1220                               &inRefCon))
    1221                 return NULL;
    1222         _err = SetMenuItemRefCon(_self->ob_itself,
    1223                                  inItem,
    1224                                  inRefCon);
    1225         if (_err != noErr) return PyMac_Error(_err);
    1226         Py_INCREF(Py_None);
    1227         _res = Py_None;
    1228         return _res;
     1216    PyMac_PRECHECK(SetMenuItemRefCon);
     1217#endif
     1218    if (!PyArg_ParseTuple(_args, "hl",
     1219                          &inItem,
     1220                          &inRefCon))
     1221        return NULL;
     1222    _err = SetMenuItemRefCon(_self->ob_itself,
     1223                             inItem,
     1224                             inRefCon);
     1225    if (_err != noErr) return PyMac_Error(_err);
     1226    Py_INCREF(Py_None);
     1227    _res = Py_None;
     1228    return _res;
    12291229}
    12301230
    12311231static PyObject *MenuObj_GetMenuItemRefCon(MenuObject *_self, PyObject *_args)
    12321232{
    1233         PyObject *_res = NULL;
    1234         OSErr _err;
    1235         SInt16 inItem;
    1236         UInt32 outRefCon;
     1233    PyObject *_res = NULL;
     1234    OSErr _err;
     1235    SInt16 inItem;
     1236    UInt32 outRefCon;
    12371237#ifndef GetMenuItemRefCon
    1238         PyMac_PRECHECK(GetMenuItemRefCon);
    1239 #endif
    1240         if (!PyArg_ParseTuple(_args, "h",
    1241                               &inItem))
    1242                 return NULL;
    1243         _err = GetMenuItemRefCon(_self->ob_itself,
    1244                                  inItem,
    1245                                  &outRefCon);
    1246         if (_err != noErr) return PyMac_Error(_err);
    1247         _res = Py_BuildValue("l",
    1248                              outRefCon);
    1249         return _res;
     1238    PyMac_PRECHECK(GetMenuItemRefCon);
     1239#endif
     1240    if (!PyArg_ParseTuple(_args, "h",
     1241                          &inItem))
     1242        return NULL;
     1243    _err = GetMenuItemRefCon(_self->ob_itself,
     1244                             inItem,
     1245                             &outRefCon);
     1246    if (_err != noErr) return PyMac_Error(_err);
     1247    _res = Py_BuildValue("l",
     1248                         outRefCon);
     1249    return _res;
    12501250}
    12511251
    12521252static PyObject *MenuObj_SetMenuItemKeyGlyph(MenuObject *_self, PyObject *_args)
    12531253{
    1254         PyObject *_res = NULL;
    1255         OSErr _err;
    1256         SInt16 inItem;
    1257         SInt16 inGlyph;
     1254    PyObject *_res = NULL;
     1255    OSErr _err;
     1256    SInt16 inItem;
     1257    SInt16 inGlyph;
    12581258#ifndef SetMenuItemKeyGlyph
    1259         PyMac_PRECHECK(SetMenuItemKeyGlyph);
    1260 #endif
    1261         if (!PyArg_ParseTuple(_args, "hh",
    1262                               &inItem,
    1263                               &inGlyph))
    1264                 return NULL;
    1265         _err = SetMenuItemKeyGlyph(_self->ob_itself,
    1266                                    inItem,
    1267                                    inGlyph);
    1268         if (_err != noErr) return PyMac_Error(_err);
    1269         Py_INCREF(Py_None);
    1270         _res = Py_None;
    1271         return _res;
     1259    PyMac_PRECHECK(SetMenuItemKeyGlyph);
     1260#endif
     1261    if (!PyArg_ParseTuple(_args, "hh",
     1262                          &inItem,
     1263                          &inGlyph))
     1264        return NULL;
     1265    _err = SetMenuItemKeyGlyph(_self->ob_itself,
     1266                               inItem,
     1267                               inGlyph);
     1268    if (_err != noErr) return PyMac_Error(_err);
     1269    Py_INCREF(Py_None);
     1270    _res = Py_None;
     1271    return _res;
    12721272}
    12731273
    12741274static PyObject *MenuObj_GetMenuItemKeyGlyph(MenuObject *_self, PyObject *_args)
    12751275{
    1276         PyObject *_res = NULL;
    1277         OSErr _err;
    1278         SInt16 inItem;
    1279         SInt16 outGlyph;
     1276    PyObject *_res = NULL;
     1277    OSErr _err;
     1278    SInt16 inItem;
     1279    SInt16 outGlyph;
    12801280#ifndef GetMenuItemKeyGlyph
    1281         PyMac_PRECHECK(GetMenuItemKeyGlyph);
    1282 #endif
    1283         if (!PyArg_ParseTuple(_args, "h",
    1284                               &inItem))
    1285                 return NULL;
    1286         _err = GetMenuItemKeyGlyph(_self->ob_itself,
    1287                                    inItem,
    1288                                    &outGlyph);
    1289         if (_err != noErr) return PyMac_Error(_err);
    1290         _res = Py_BuildValue("h",
    1291                              outGlyph);
    1292         return _res;
     1281    PyMac_PRECHECK(GetMenuItemKeyGlyph);
     1282#endif
     1283    if (!PyArg_ParseTuple(_args, "h",
     1284                          &inItem))
     1285        return NULL;
     1286    _err = GetMenuItemKeyGlyph(_self->ob_itself,
     1287                               inItem,
     1288                               &outGlyph);
     1289    if (_err != noErr) return PyMac_Error(_err);
     1290    _res = Py_BuildValue("h",
     1291                         outGlyph);
     1292    return _res;
    12931293}
    12941294
    12951295static PyObject *MenuObj_MacEnableMenuItem(MenuObject *_self, PyObject *_args)
    12961296{
    1297         PyObject *_res = NULL;
    1298         MenuItemIndex item;
     1297    PyObject *_res = NULL;
     1298    MenuItemIndex item;
    12991299#ifndef MacEnableMenuItem
    1300         PyMac_PRECHECK(MacEnableMenuItem);
    1301 #endif
    1302         if (!PyArg_ParseTuple(_args, "h",
    1303                               &item))
    1304                 return NULL;
    1305         MacEnableMenuItem(_self->ob_itself,
    1306                           item);
    1307         Py_INCREF(Py_None);
    1308         _res = Py_None;
    1309         return _res;
     1300    PyMac_PRECHECK(MacEnableMenuItem);
     1301#endif
     1302    if (!PyArg_ParseTuple(_args, "h",
     1303                          &item))
     1304        return NULL;
     1305    MacEnableMenuItem(_self->ob_itself,
     1306                      item);
     1307    Py_INCREF(Py_None);
     1308    _res = Py_None;
     1309    return _res;
    13101310}
    13111311
    13121312static PyObject *MenuObj_DisableMenuItem(MenuObject *_self, PyObject *_args)
    13131313{
    1314         PyObject *_res = NULL;
    1315         MenuItemIndex item;
     1314    PyObject *_res = NULL;
     1315    MenuItemIndex item;
    13161316#ifndef DisableMenuItem
    1317         PyMac_PRECHECK(DisableMenuItem);
    1318 #endif
    1319         if (!PyArg_ParseTuple(_args, "h",
    1320                               &item))
    1321                 return NULL;
    1322         DisableMenuItem(_self->ob_itself,
    1323                         item);
    1324         Py_INCREF(Py_None);
    1325         _res = Py_None;
    1326         return _res;
     1317    PyMac_PRECHECK(DisableMenuItem);
     1318#endif
     1319    if (!PyArg_ParseTuple(_args, "h",
     1320                          &item))
     1321        return NULL;
     1322    DisableMenuItem(_self->ob_itself,
     1323                    item);
     1324    Py_INCREF(Py_None);
     1325    _res = Py_None;
     1326    return _res;
    13271327}
    13281328
    13291329static PyObject *MenuObj_IsMenuItemEnabled(MenuObject *_self, PyObject *_args)
    13301330{
    1331         PyObject *_res = NULL;
    1332         Boolean _rv;
    1333         MenuItemIndex item;
     1331    PyObject *_res = NULL;
     1332    Boolean _rv;
     1333    MenuItemIndex item;
    13341334#ifndef IsMenuItemEnabled
    1335         PyMac_PRECHECK(IsMenuItemEnabled);
    1336 #endif
    1337         if (!PyArg_ParseTuple(_args, "h",
    1338                               &item))
    1339                 return NULL;
    1340         _rv = IsMenuItemEnabled(_self->ob_itself,
    1341                                 item);
    1342         _res = Py_BuildValue("b",
    1343                              _rv);
    1344         return _res;
     1335    PyMac_PRECHECK(IsMenuItemEnabled);
     1336#endif
     1337    if (!PyArg_ParseTuple(_args, "h",
     1338                          &item))
     1339        return NULL;
     1340    _rv = IsMenuItemEnabled(_self->ob_itself,
     1341                            item);
     1342    _res = Py_BuildValue("b",
     1343                         _rv);
     1344    return _res;
    13451345}
    13461346
    13471347static PyObject *MenuObj_EnableMenuItemIcon(MenuObject *_self, PyObject *_args)
    13481348{
    1349         PyObject *_res = NULL;
    1350         MenuItemIndex item;
     1349    PyObject *_res = NULL;
     1350    MenuItemIndex item;
    13511351#ifndef EnableMenuItemIcon
    1352         PyMac_PRECHECK(EnableMenuItemIcon);
    1353 #endif
    1354         if (!PyArg_ParseTuple(_args, "h",
    1355                               &item))
    1356                 return NULL;
    1357         EnableMenuItemIcon(_self->ob_itself,
    1358                            item);
    1359         Py_INCREF(Py_None);
    1360         _res = Py_None;
    1361         return _res;
     1352    PyMac_PRECHECK(EnableMenuItemIcon);
     1353#endif
     1354    if (!PyArg_ParseTuple(_args, "h",
     1355                          &item))
     1356        return NULL;
     1357    EnableMenuItemIcon(_self->ob_itself,
     1358                       item);
     1359    Py_INCREF(Py_None);
     1360    _res = Py_None;
     1361    return _res;
    13621362}
    13631363
    13641364static PyObject *MenuObj_DisableMenuItemIcon(MenuObject *_self, PyObject *_args)
    13651365{
    1366         PyObject *_res = NULL;
    1367         MenuItemIndex item;
     1366    PyObject *_res = NULL;
     1367    MenuItemIndex item;
    13681368#ifndef DisableMenuItemIcon
    1369         PyMac_PRECHECK(DisableMenuItemIcon);
    1370 #endif
    1371         if (!PyArg_ParseTuple(_args, "h",
    1372                               &item))
    1373                 return NULL;
    1374         DisableMenuItemIcon(_self->ob_itself,
    1375                             item);
    1376         Py_INCREF(Py_None);
    1377         _res = Py_None;
    1378         return _res;
     1369    PyMac_PRECHECK(DisableMenuItemIcon);
     1370#endif
     1371    if (!PyArg_ParseTuple(_args, "h",
     1372                          &item))
     1373        return NULL;
     1374    DisableMenuItemIcon(_self->ob_itself,
     1375                        item);
     1376    Py_INCREF(Py_None);
     1377    _res = Py_None;
     1378    return _res;
    13791379}
    13801380
    13811381static PyObject *MenuObj_IsMenuItemIconEnabled(MenuObject *_self, PyObject *_args)
    13821382{
    1383         PyObject *_res = NULL;
    1384         Boolean _rv;
    1385         MenuItemIndex item;
     1383    PyObject *_res = NULL;
     1384    Boolean _rv;
     1385    MenuItemIndex item;
    13861386#ifndef IsMenuItemIconEnabled
    1387         PyMac_PRECHECK(IsMenuItemIconEnabled);
    1388 #endif
    1389         if (!PyArg_ParseTuple(_args, "h",
    1390                               &item))
    1391                 return NULL;
    1392         _rv = IsMenuItemIconEnabled(_self->ob_itself,
    1393                                     item);
    1394         _res = Py_BuildValue("b",
    1395                              _rv);
    1396         return _res;
     1387    PyMac_PRECHECK(IsMenuItemIconEnabled);
     1388#endif
     1389    if (!PyArg_ParseTuple(_args, "h",
     1390                          &item))
     1391        return NULL;
     1392    _rv = IsMenuItemIconEnabled(_self->ob_itself,
     1393                                item);
     1394    _res = Py_BuildValue("b",
     1395                         _rv);
     1396    return _res;
    13971397}
    13981398
    13991399static PyObject *MenuObj_SetMenuItemHierarchicalMenu(MenuObject *_self, PyObject *_args)
    14001400{
    1401         PyObject *_res = NULL;
    1402         OSStatus _err;
    1403         MenuItemIndex inItem;
    1404         MenuHandle inHierMenu;
     1401    PyObject *_res = NULL;
     1402    OSStatus _err;
     1403    MenuItemIndex inItem;
     1404    MenuHandle inHierMenu;
    14051405#ifndef SetMenuItemHierarchicalMenu
    1406         PyMac_PRECHECK(SetMenuItemHierarchicalMenu);
    1407 #endif
    1408         if (!PyArg_ParseTuple(_args, "hO&",
    1409                               &inItem,
    1410                               MenuObj_Convert, &inHierMenu))
    1411                 return NULL;
    1412         _err = SetMenuItemHierarchicalMenu(_self->ob_itself,
    1413                                            inItem,
    1414                                            inHierMenu);
    1415         if (_err != noErr) return PyMac_Error(_err);
    1416         Py_INCREF(Py_None);
    1417         _res = Py_None;
    1418         return _res;
     1406    PyMac_PRECHECK(SetMenuItemHierarchicalMenu);
     1407#endif
     1408    if (!PyArg_ParseTuple(_args, "hO&",
     1409                          &inItem,
     1410                          MenuObj_Convert, &inHierMenu))
     1411        return NULL;
     1412    _err = SetMenuItemHierarchicalMenu(_self->ob_itself,
     1413                                       inItem,
     1414                                       inHierMenu);
     1415    if (_err != noErr) return PyMac_Error(_err);
     1416    Py_INCREF(Py_None);
     1417    _res = Py_None;
     1418    return _res;
    14191419}
    14201420
    14211421static PyObject *MenuObj_GetMenuItemHierarchicalMenu(MenuObject *_self, PyObject *_args)
    14221422{
    1423         PyObject *_res = NULL;
    1424         OSStatus _err;
    1425         MenuItemIndex inItem;
    1426         MenuHandle outHierMenu;
     1423    PyObject *_res = NULL;
     1424    OSStatus _err;
     1425    MenuItemIndex inItem;
     1426    MenuHandle outHierMenu;
    14271427#ifndef GetMenuItemHierarchicalMenu
    1428         PyMac_PRECHECK(GetMenuItemHierarchicalMenu);
    1429 #endif
    1430         if (!PyArg_ParseTuple(_args, "h",
    1431                               &inItem))
    1432                 return NULL;
    1433         _err = GetMenuItemHierarchicalMenu(_self->ob_itself,
    1434                                            inItem,
    1435                                            &outHierMenu);
    1436         if (_err != noErr) return PyMac_Error(_err);
    1437         _res = Py_BuildValue("O&",
    1438                              OptMenuObj_New, outHierMenu);
    1439         return _res;
     1428    PyMac_PRECHECK(GetMenuItemHierarchicalMenu);
     1429#endif
     1430    if (!PyArg_ParseTuple(_args, "h",
     1431                          &inItem))
     1432        return NULL;
     1433    _err = GetMenuItemHierarchicalMenu(_self->ob_itself,
     1434                                       inItem,
     1435                                       &outHierMenu);
     1436    if (_err != noErr) return PyMac_Error(_err);
     1437    _res = Py_BuildValue("O&",
     1438                         OptMenuObj_New, outHierMenu);
     1439    return _res;
    14401440}
    14411441
    14421442static PyObject *MenuObj_CopyMenuItemTextAsCFString(MenuObject *_self, PyObject *_args)
    14431443{
    1444         PyObject *_res = NULL;
    1445         OSStatus _err;
    1446         MenuItemIndex inItem;
    1447         CFStringRef outString;
     1444    PyObject *_res = NULL;
     1445    OSStatus _err;
     1446    MenuItemIndex inItem;
     1447    CFStringRef outString;
    14481448#ifndef CopyMenuItemTextAsCFString
    1449         PyMac_PRECHECK(CopyMenuItemTextAsCFString);
    1450 #endif
    1451         if (!PyArg_ParseTuple(_args, "h",
    1452                               &inItem))
    1453                 return NULL;
    1454         _err = CopyMenuItemTextAsCFString(_self->ob_itself,
    1455                                           inItem,
    1456                                           &outString);
    1457         if (_err != noErr) return PyMac_Error(_err);
    1458         _res = Py_BuildValue("O&",
    1459                              CFStringRefObj_New, outString);
    1460         return _res;
     1449    PyMac_PRECHECK(CopyMenuItemTextAsCFString);
     1450#endif
     1451    if (!PyArg_ParseTuple(_args, "h",
     1452                          &inItem))
     1453        return NULL;
     1454    _err = CopyMenuItemTextAsCFString(_self->ob_itself,
     1455                                      inItem,
     1456                                      &outString);
     1457    if (_err != noErr) return PyMac_Error(_err);
     1458    _res = Py_BuildValue("O&",
     1459                         CFStringRefObj_New, outString);
     1460    return _res;
    14611461}
    14621462
    14631463static PyObject *MenuObj_SetMenuItemTextWithCFString(MenuObject *_self, PyObject *_args)
    14641464{
    1465         PyObject *_res = NULL;
    1466         OSStatus _err;
    1467         MenuItemIndex inItem;
    1468         CFStringRef inString;
     1465    PyObject *_res = NULL;
     1466    OSStatus _err;
     1467    MenuItemIndex inItem;
     1468    CFStringRef inString;
    14691469#ifndef SetMenuItemTextWithCFString
    1470         PyMac_PRECHECK(SetMenuItemTextWithCFString);
    1471 #endif
    1472         if (!PyArg_ParseTuple(_args, "hO&",
    1473                               &inItem,
    1474                               CFStringRefObj_Convert, &inString))
    1475                 return NULL;
    1476         _err = SetMenuItemTextWithCFString(_self->ob_itself,
    1477                                            inItem,
    1478                                            inString);
    1479         if (_err != noErr) return PyMac_Error(_err);
    1480         Py_INCREF(Py_None);
    1481         _res = Py_None;
    1482         return _res;
     1470    PyMac_PRECHECK(SetMenuItemTextWithCFString);
     1471#endif
     1472    if (!PyArg_ParseTuple(_args, "hO&",
     1473                          &inItem,
     1474                          CFStringRefObj_Convert, &inString))
     1475        return NULL;
     1476    _err = SetMenuItemTextWithCFString(_self->ob_itself,
     1477                                       inItem,
     1478                                       inString);
     1479    if (_err != noErr) return PyMac_Error(_err);
     1480    Py_INCREF(Py_None);
     1481    _res = Py_None;
     1482    return _res;
    14831483}
    14841484
    14851485static PyObject *MenuObj_GetMenuItemIndent(MenuObject *_self, PyObject *_args)
    14861486{
    1487         PyObject *_res = NULL;
    1488         OSStatus _err;
    1489         MenuItemIndex inItem;
    1490         UInt32 outIndent;
     1487    PyObject *_res = NULL;
     1488    OSStatus _err;
     1489    MenuItemIndex inItem;
     1490    UInt32 outIndent;
    14911491#ifndef GetMenuItemIndent
    1492         PyMac_PRECHECK(GetMenuItemIndent);
    1493 #endif
    1494         if (!PyArg_ParseTuple(_args, "h",
    1495                               &inItem))
    1496                 return NULL;
    1497         _err = GetMenuItemIndent(_self->ob_itself,
    1498                                  inItem,
    1499                                  &outIndent);
    1500         if (_err != noErr) return PyMac_Error(_err);
    1501         _res = Py_BuildValue("l",
    1502                              outIndent);
    1503         return _res;
     1492    PyMac_PRECHECK(GetMenuItemIndent);
     1493#endif
     1494    if (!PyArg_ParseTuple(_args, "h",
     1495                          &inItem))
     1496        return NULL;
     1497    _err = GetMenuItemIndent(_self->ob_itself,
     1498                             inItem,
     1499                             &outIndent);
     1500    if (_err != noErr) return PyMac_Error(_err);
     1501    _res = Py_BuildValue("l",
     1502                         outIndent);
     1503    return _res;
    15041504}
    15051505
    15061506static PyObject *MenuObj_SetMenuItemIndent(MenuObject *_self, PyObject *_args)
    15071507{
    1508         PyObject *_res = NULL;
    1509         OSStatus _err;
    1510         MenuItemIndex inItem;
    1511         UInt32 inIndent;
     1508    PyObject *_res = NULL;
     1509    OSStatus _err;
     1510    MenuItemIndex inItem;
     1511    UInt32 inIndent;
    15121512#ifndef SetMenuItemIndent
    1513         PyMac_PRECHECK(SetMenuItemIndent);
    1514 #endif
    1515         if (!PyArg_ParseTuple(_args, "hl",
    1516                               &inItem,
    1517                               &inIndent))
    1518                 return NULL;
    1519         _err = SetMenuItemIndent(_self->ob_itself,
    1520                                  inItem,
    1521                                  inIndent);
    1522         if (_err != noErr) return PyMac_Error(_err);
    1523         Py_INCREF(Py_None);
    1524         _res = Py_None;
    1525         return _res;
     1513    PyMac_PRECHECK(SetMenuItemIndent);
     1514#endif
     1515    if (!PyArg_ParseTuple(_args, "hl",
     1516                          &inItem,
     1517                          &inIndent))
     1518        return NULL;
     1519    _err = SetMenuItemIndent(_self->ob_itself,
     1520                             inItem,
     1521                             inIndent);
     1522    if (_err != noErr) return PyMac_Error(_err);
     1523    Py_INCREF(Py_None);
     1524    _res = Py_None;
     1525    return _res;
    15261526}
    15271527
    15281528static PyObject *MenuObj_GetMenuItemCommandKey(MenuObject *_self, PyObject *_args)
    15291529{
    1530         PyObject *_res = NULL;
    1531         OSStatus _err;
    1532         MenuItemIndex inItem;
    1533         Boolean inGetVirtualKey;
    1534         UInt16 outKey;
     1530    PyObject *_res = NULL;
     1531    OSStatus _err;
     1532    MenuItemIndex inItem;
     1533    Boolean inGetVirtualKey;
     1534    UInt16 outKey;
    15351535#ifndef GetMenuItemCommandKey
    1536         PyMac_PRECHECK(GetMenuItemCommandKey);
    1537 #endif
    1538         if (!PyArg_ParseTuple(_args, "hb",
    1539                               &inItem,
    1540                               &inGetVirtualKey))
    1541                 return NULL;
    1542         _err = GetMenuItemCommandKey(_self->ob_itself,
    1543                                      inItem,
    1544                                      inGetVirtualKey,
    1545                                      &outKey);
    1546         if (_err != noErr) return PyMac_Error(_err);
    1547         _res = Py_BuildValue("H",
    1548                              outKey);
    1549         return _res;
     1536    PyMac_PRECHECK(GetMenuItemCommandKey);
     1537#endif
     1538    if (!PyArg_ParseTuple(_args, "hb",
     1539                          &inItem,
     1540                          &inGetVirtualKey))
     1541        return NULL;
     1542    _err = GetMenuItemCommandKey(_self->ob_itself,
     1543                                 inItem,
     1544                                 inGetVirtualKey,
     1545                                 &outKey);
     1546    if (_err != noErr) return PyMac_Error(_err);
     1547    _res = Py_BuildValue("H",
     1548                         outKey);
     1549    return _res;
    15501550}
    15511551
    15521552static PyObject *MenuObj_SetMenuItemCommandKey(MenuObject *_self, PyObject *_args)
    15531553{
    1554         PyObject *_res = NULL;
    1555         OSStatus _err;
    1556         MenuItemIndex inItem;
    1557         Boolean inSetVirtualKey;
    1558         UInt16 inKey;
     1554    PyObject *_res = NULL;
     1555    OSStatus _err;
     1556    MenuItemIndex inItem;
     1557    Boolean inSetVirtualKey;
     1558    UInt16 inKey;
    15591559#ifndef SetMenuItemCommandKey
    1560         PyMac_PRECHECK(SetMenuItemCommandKey);
    1561 #endif
    1562         if (!PyArg_ParseTuple(_args, "hbH",
    1563                               &inItem,
    1564                               &inSetVirtualKey,
    1565                               &inKey))
    1566                 return NULL;
    1567         _err = SetMenuItemCommandKey(_self->ob_itself,
    1568                                      inItem,
    1569                                      inSetVirtualKey,
    1570                                      inKey);
    1571         if (_err != noErr) return PyMac_Error(_err);
    1572         Py_INCREF(Py_None);
    1573         _res = Py_None;
    1574         return _res;
     1560    PyMac_PRECHECK(SetMenuItemCommandKey);
     1561#endif
     1562    if (!PyArg_ParseTuple(_args, "hbH",
     1563                          &inItem,
     1564                          &inSetVirtualKey,
     1565                          &inKey))
     1566        return NULL;
     1567    _err = SetMenuItemCommandKey(_self->ob_itself,
     1568                                 inItem,
     1569                                 inSetVirtualKey,
     1570                                 inKey);
     1571    if (_err != noErr) return PyMac_Error(_err);
     1572    Py_INCREF(Py_None);
     1573    _res = Py_None;
     1574    return _res;
    15751575}
    15761576
    15771577static PyObject *MenuObj_GetMenuItemPropertyAttributes(MenuObject *_self, PyObject *_args)
    15781578{
    1579         PyObject *_res = NULL;
    1580         OSStatus _err;
    1581         MenuItemIndex item;
    1582         OSType propertyCreator;
    1583         OSType propertyTag;
    1584         UInt32 attributes;
     1579    PyObject *_res = NULL;
     1580    OSStatus _err;
     1581    MenuItemIndex item;
     1582    OSType propertyCreator;
     1583    OSType propertyTag;
     1584    UInt32 attributes;
    15851585#ifndef GetMenuItemPropertyAttributes
    1586         PyMac_PRECHECK(GetMenuItemPropertyAttributes);
    1587 #endif
    1588         if (!PyArg_ParseTuple(_args, "hO&O&",
    1589                               &item,
    1590                               PyMac_GetOSType, &propertyCreator,
    1591                               PyMac_GetOSType, &propertyTag))
    1592                 return NULL;
    1593         _err = GetMenuItemPropertyAttributes(_self->ob_itself,
    1594                                              item,
    1595                                              propertyCreator,
    1596                                              propertyTag,
    1597                                              &attributes);
    1598         if (_err != noErr) return PyMac_Error(_err);
    1599         _res = Py_BuildValue("l",
    1600                              attributes);
    1601         return _res;
     1586    PyMac_PRECHECK(GetMenuItemPropertyAttributes);
     1587#endif
     1588    if (!PyArg_ParseTuple(_args, "hO&O&",
     1589                          &item,
     1590                          PyMac_GetOSType, &propertyCreator,
     1591                          PyMac_GetOSType, &propertyTag))
     1592        return NULL;
     1593    _err = GetMenuItemPropertyAttributes(_self->ob_itself,
     1594                                         item,
     1595                                         propertyCreator,
     1596                                         propertyTag,
     1597                                         &attributes);
     1598    if (_err != noErr) return PyMac_Error(_err);
     1599    _res = Py_BuildValue("l",
     1600                         attributes);
     1601    return _res;
    16021602}
    16031603
    16041604static PyObject *MenuObj_ChangeMenuItemPropertyAttributes(MenuObject *_self, PyObject *_args)
    16051605{
    1606         PyObject *_res = NULL;
    1607         OSStatus _err;
    1608         MenuItemIndex item;
    1609         OSType propertyCreator;
    1610         OSType propertyTag;
    1611         UInt32 attributesToSet;
    1612         UInt32 attributesToClear;
     1606    PyObject *_res = NULL;
     1607    OSStatus _err;
     1608    MenuItemIndex item;
     1609    OSType propertyCreator;
     1610    OSType propertyTag;
     1611    UInt32 attributesToSet;
     1612    UInt32 attributesToClear;
    16131613#ifndef ChangeMenuItemPropertyAttributes
    1614         PyMac_PRECHECK(ChangeMenuItemPropertyAttributes);
    1615 #endif
    1616         if (!PyArg_ParseTuple(_args, "hO&O&ll",
    1617                               &item,
    1618                               PyMac_GetOSType, &propertyCreator,
    1619                               PyMac_GetOSType, &propertyTag,
    1620                               &attributesToSet,
    1621                               &attributesToClear))
    1622                 return NULL;
    1623         _err = ChangeMenuItemPropertyAttributes(_self->ob_itself,
    1624                                                 item,
    1625                                                 propertyCreator,
    1626                                                 propertyTag,
    1627                                                 attributesToSet,
    1628                                                 attributesToClear);
    1629         if (_err != noErr) return PyMac_Error(_err);
    1630         Py_INCREF(Py_None);
    1631         _res = Py_None;
    1632         return _res;
     1614    PyMac_PRECHECK(ChangeMenuItemPropertyAttributes);
     1615#endif
     1616    if (!PyArg_ParseTuple(_args, "hO&O&ll",
     1617                          &item,
     1618                          PyMac_GetOSType, &propertyCreator,
     1619                          PyMac_GetOSType, &propertyTag,
     1620                          &attributesToSet,
     1621                          &attributesToClear))
     1622        return NULL;
     1623    _err = ChangeMenuItemPropertyAttributes(_self->ob_itself,
     1624                                            item,
     1625                                            propertyCreator,
     1626                                            propertyTag,
     1627                                            attributesToSet,
     1628                                            attributesToClear);
     1629    if (_err != noErr) return PyMac_Error(_err);
     1630    Py_INCREF(Py_None);
     1631    _res = Py_None;
     1632    return _res;
    16331633}
    16341634
    16351635static PyObject *MenuObj_GetMenuAttributes(MenuObject *_self, PyObject *_args)
    16361636{
    1637         PyObject *_res = NULL;
    1638         OSStatus _err;
    1639         MenuAttributes outAttributes;
     1637    PyObject *_res = NULL;
     1638    OSStatus _err;
     1639    MenuAttributes outAttributes;
    16401640#ifndef GetMenuAttributes
    1641         PyMac_PRECHECK(GetMenuAttributes);
    1642 #endif
    1643         if (!PyArg_ParseTuple(_args, ""))
    1644                 return NULL;
    1645         _err = GetMenuAttributes(_self->ob_itself,
    1646                                  &outAttributes);
    1647         if (_err != noErr) return PyMac_Error(_err);
    1648         _res = Py_BuildValue("l",
    1649                              outAttributes);
    1650         return _res;
     1641    PyMac_PRECHECK(GetMenuAttributes);
     1642#endif
     1643    if (!PyArg_ParseTuple(_args, ""))
     1644        return NULL;
     1645    _err = GetMenuAttributes(_self->ob_itself,
     1646                             &outAttributes);
     1647    if (_err != noErr) return PyMac_Error(_err);
     1648    _res = Py_BuildValue("l",
     1649                         outAttributes);
     1650    return _res;
    16511651}
    16521652
    16531653static PyObject *MenuObj_ChangeMenuAttributes(MenuObject *_self, PyObject *_args)
    16541654{
    1655         PyObject *_res = NULL;
    1656         OSStatus _err;
    1657         MenuAttributes setTheseAttributes;
    1658         MenuAttributes clearTheseAttributes;
     1655    PyObject *_res = NULL;
     1656    OSStatus _err;
     1657    MenuAttributes setTheseAttributes;
     1658    MenuAttributes clearTheseAttributes;
    16591659#ifndef ChangeMenuAttributes
    1660         PyMac_PRECHECK(ChangeMenuAttributes);
    1661 #endif
    1662         if (!PyArg_ParseTuple(_args, "ll",
    1663                               &setTheseAttributes,
    1664                               &clearTheseAttributes))
    1665                 return NULL;
    1666         _err = ChangeMenuAttributes(_self->ob_itself,
    1667                                     setTheseAttributes,
    1668                                     clearTheseAttributes);
    1669         if (_err != noErr) return PyMac_Error(_err);
    1670         Py_INCREF(Py_None);
    1671         _res = Py_None;
    1672         return _res;
     1660    PyMac_PRECHECK(ChangeMenuAttributes);
     1661#endif
     1662    if (!PyArg_ParseTuple(_args, "ll",
     1663                          &setTheseAttributes,
     1664                          &clearTheseAttributes))
     1665        return NULL;
     1666    _err = ChangeMenuAttributes(_self->ob_itself,
     1667                                setTheseAttributes,
     1668                                clearTheseAttributes);
     1669    if (_err != noErr) return PyMac_Error(_err);
     1670    Py_INCREF(Py_None);
     1671    _res = Py_None;
     1672    return _res;
    16731673}
    16741674
    16751675static PyObject *MenuObj_GetMenuItemAttributes(MenuObject *_self, PyObject *_args)
    16761676{
    1677         PyObject *_res = NULL;
    1678         OSStatus _err;
    1679         MenuItemIndex item;
    1680         MenuItemAttributes outAttributes;
     1677    PyObject *_res = NULL;
     1678    OSStatus _err;
     1679    MenuItemIndex item;
     1680    MenuItemAttributes outAttributes;
    16811681#ifndef GetMenuItemAttributes
    1682         PyMac_PRECHECK(GetMenuItemAttributes);
    1683 #endif
    1684         if (!PyArg_ParseTuple(_args, "h",
    1685                               &item))
    1686                 return NULL;
    1687         _err = GetMenuItemAttributes(_self->ob_itself,
    1688                                      item,
    1689                                      &outAttributes);
    1690         if (_err != noErr) return PyMac_Error(_err);
    1691         _res = Py_BuildValue("l",
    1692                              outAttributes);
    1693         return _res;
     1682    PyMac_PRECHECK(GetMenuItemAttributes);
     1683#endif
     1684    if (!PyArg_ParseTuple(_args, "h",
     1685                          &item))
     1686        return NULL;
     1687    _err = GetMenuItemAttributes(_self->ob_itself,
     1688                                 item,
     1689                                 &outAttributes);
     1690    if (_err != noErr) return PyMac_Error(_err);
     1691    _res = Py_BuildValue("l",
     1692                         outAttributes);
     1693    return _res;
    16941694}
    16951695
    16961696static PyObject *MenuObj_ChangeMenuItemAttributes(MenuObject *_self, PyObject *_args)
    16971697{
    1698         PyObject *_res = NULL;
    1699         OSStatus _err;
    1700         MenuItemIndex item;
    1701         MenuItemAttributes setTheseAttributes;
    1702         MenuItemAttributes clearTheseAttributes;
     1698    PyObject *_res = NULL;
     1699    OSStatus _err;
     1700    MenuItemIndex item;
     1701    MenuItemAttributes setTheseAttributes;
     1702    MenuItemAttributes clearTheseAttributes;
    17031703#ifndef ChangeMenuItemAttributes
    1704         PyMac_PRECHECK(ChangeMenuItemAttributes);
    1705 #endif
    1706         if (!PyArg_ParseTuple(_args, "hll",
    1707                               &item,
    1708                               &setTheseAttributes,
    1709                               &clearTheseAttributes))
    1710                 return NULL;
    1711         _err = ChangeMenuItemAttributes(_self->ob_itself,
    1712                                         item,
    1713                                         setTheseAttributes,
    1714                                         clearTheseAttributes);
    1715         if (_err != noErr) return PyMac_Error(_err);
    1716         Py_INCREF(Py_None);
    1717         _res = Py_None;
    1718         return _res;
     1704    PyMac_PRECHECK(ChangeMenuItemAttributes);
     1705#endif
     1706    if (!PyArg_ParseTuple(_args, "hll",
     1707                          &item,
     1708                          &setTheseAttributes,
     1709                          &clearTheseAttributes))
     1710        return NULL;
     1711    _err = ChangeMenuItemAttributes(_self->ob_itself,
     1712                                    item,
     1713                                    setTheseAttributes,
     1714                                    clearTheseAttributes);
     1715    if (_err != noErr) return PyMac_Error(_err);
     1716    Py_INCREF(Py_None);
     1717    _res = Py_None;
     1718    return _res;
    17191719}
    17201720
    17211721static PyObject *MenuObj_DisableAllMenuItems(MenuObject *_self, PyObject *_args)
    17221722{
    1723         PyObject *_res = NULL;
     1723    PyObject *_res = NULL;
    17241724#ifndef DisableAllMenuItems
    1725         PyMac_PRECHECK(DisableAllMenuItems);
    1726 #endif
    1727         if (!PyArg_ParseTuple(_args, ""))
    1728                 return NULL;
    1729         DisableAllMenuItems(_self->ob_itself);
    1730         Py_INCREF(Py_None);
    1731         _res = Py_None;
    1732         return _res;
     1725    PyMac_PRECHECK(DisableAllMenuItems);
     1726#endif
     1727    if (!PyArg_ParseTuple(_args, ""))
     1728        return NULL;
     1729    DisableAllMenuItems(_self->ob_itself);
     1730    Py_INCREF(Py_None);
     1731    _res = Py_None;
     1732    return _res;
    17331733}
    17341734
    17351735static PyObject *MenuObj_EnableAllMenuItems(MenuObject *_self, PyObject *_args)
    17361736{
    1737         PyObject *_res = NULL;
     1737    PyObject *_res = NULL;
    17381738#ifndef EnableAllMenuItems
    1739         PyMac_PRECHECK(EnableAllMenuItems);
    1740 #endif
    1741         if (!PyArg_ParseTuple(_args, ""))
    1742                 return NULL;
    1743         EnableAllMenuItems(_self->ob_itself);
    1744         Py_INCREF(Py_None);
    1745         _res = Py_None;
    1746         return _res;
     1739    PyMac_PRECHECK(EnableAllMenuItems);
     1740#endif
     1741    if (!PyArg_ParseTuple(_args, ""))
     1742        return NULL;
     1743    EnableAllMenuItems(_self->ob_itself);
     1744    Py_INCREF(Py_None);
     1745    _res = Py_None;
     1746    return _res;
    17471747}
    17481748
    17491749static PyObject *MenuObj_MenuHasEnabledItems(MenuObject *_self, PyObject *_args)
    17501750{
    1751         PyObject *_res = NULL;
    1752         Boolean _rv;
     1751    PyObject *_res = NULL;
     1752    Boolean _rv;
    17531753#ifndef MenuHasEnabledItems
    1754         PyMac_PRECHECK(MenuHasEnabledItems);
    1755 #endif
    1756         if (!PyArg_ParseTuple(_args, ""))
    1757                 return NULL;
    1758         _rv = MenuHasEnabledItems(_self->ob_itself);
    1759         _res = Py_BuildValue("b",
    1760                              _rv);
    1761         return _res;
     1754    PyMac_PRECHECK(MenuHasEnabledItems);
     1755#endif
     1756    if (!PyArg_ParseTuple(_args, ""))
     1757        return NULL;
     1758    _rv = MenuHasEnabledItems(_self->ob_itself);
     1759    _res = Py_BuildValue("b",
     1760                         _rv);
     1761    return _res;
    17621762}
    17631763
    17641764static PyObject *MenuObj_GetMenuType(MenuObject *_self, PyObject *_args)
    17651765{
    1766         PyObject *_res = NULL;
    1767         OSStatus _err;
    1768         UInt16 outType;
     1766    PyObject *_res = NULL;
     1767    OSStatus _err;
     1768    UInt16 outType;
    17691769#ifndef GetMenuType
    1770         PyMac_PRECHECK(GetMenuType);
    1771 #endif
    1772         if (!PyArg_ParseTuple(_args, ""))
    1773                 return NULL;
    1774         _err = GetMenuType(_self->ob_itself,
    1775                            &outType);
    1776         if (_err != noErr) return PyMac_Error(_err);
    1777         _res = Py_BuildValue("H",
    1778                              outType);
    1779         return _res;
     1770    PyMac_PRECHECK(GetMenuType);
     1771#endif
     1772    if (!PyArg_ParseTuple(_args, ""))
     1773        return NULL;
     1774    _err = GetMenuType(_self->ob_itself,
     1775                       &outType);
     1776    if (_err != noErr) return PyMac_Error(_err);
     1777    _res = Py_BuildValue("H",
     1778                         outType);
     1779    return _res;
    17801780}
    17811781
    17821782static PyObject *MenuObj_CountMenuItemsWithCommandID(MenuObject *_self, PyObject *_args)
    17831783{
    1784         PyObject *_res = NULL;
    1785         ItemCount _rv;
    1786         MenuCommand inCommandID;
     1784    PyObject *_res = NULL;
     1785    ItemCount _rv;
     1786    MenuCommand inCommandID;
    17871787#ifndef CountMenuItemsWithCommandID
    1788         PyMac_PRECHECK(CountMenuItemsWithCommandID);
    1789 #endif
    1790         if (!PyArg_ParseTuple(_args, "l",
    1791                               &inCommandID))
    1792                 return NULL;
    1793         _rv = CountMenuItemsWithCommandID(_self->ob_itself,
    1794                                           inCommandID);
    1795         _res = Py_BuildValue("l",
    1796                              _rv);
    1797         return _res;
     1788    PyMac_PRECHECK(CountMenuItemsWithCommandID);
     1789#endif
     1790    if (!PyArg_ParseTuple(_args, "l",
     1791                          &inCommandID))
     1792        return NULL;
     1793    _rv = CountMenuItemsWithCommandID(_self->ob_itself,
     1794                                      inCommandID);
     1795    _res = Py_BuildValue("l",
     1796                         _rv);
     1797    return _res;
    17981798}
    17991799
    18001800static PyObject *MenuObj_GetIndMenuItemWithCommandID(MenuObject *_self, PyObject *_args)
    18011801{
    1802         PyObject *_res = NULL;
    1803         OSStatus _err;
    1804         MenuCommand inCommandID;
    1805         UInt32 inItemIndex;
    1806         MenuHandle outMenu;
    1807         MenuItemIndex outIndex;
     1802    PyObject *_res = NULL;
     1803    OSStatus _err;
     1804    MenuCommand inCommandID;
     1805    UInt32 inItemIndex;
     1806    MenuHandle outMenu;
     1807    MenuItemIndex outIndex;
    18081808#ifndef GetIndMenuItemWithCommandID
    1809         PyMac_PRECHECK(GetIndMenuItemWithCommandID);
    1810 #endif
    1811         if (!PyArg_ParseTuple(_args, "ll",
    1812                               &inCommandID,
    1813                               &inItemIndex))
    1814                 return NULL;
    1815         _err = GetIndMenuItemWithCommandID(_self->ob_itself,
    1816                                            inCommandID,
    1817                                            inItemIndex,
    1818                                            &outMenu,
    1819                                            &outIndex);
    1820         if (_err != noErr) return PyMac_Error(_err);
    1821         _res = Py_BuildValue("O&h",
    1822                              MenuObj_New, outMenu,
    1823                              outIndex);
    1824         return _res;
     1809    PyMac_PRECHECK(GetIndMenuItemWithCommandID);
     1810#endif
     1811    if (!PyArg_ParseTuple(_args, "ll",
     1812                          &inCommandID,
     1813                          &inItemIndex))
     1814        return NULL;
     1815    _err = GetIndMenuItemWithCommandID(_self->ob_itself,
     1816                                       inCommandID,
     1817                                       inItemIndex,
     1818                                       &outMenu,
     1819                                       &outIndex);
     1820    if (_err != noErr) return PyMac_Error(_err);
     1821    _res = Py_BuildValue("O&h",
     1822                         MenuObj_New, outMenu,
     1823                         outIndex);
     1824    return _res;
    18251825}
    18261826
    18271827static PyObject *MenuObj_EnableMenuCommand(MenuObject *_self, PyObject *_args)
    18281828{
    1829         PyObject *_res = NULL;
    1830         MenuCommand inCommandID;
     1829    PyObject *_res = NULL;
     1830    MenuCommand inCommandID;
    18311831#ifndef EnableMenuCommand
    1832         PyMac_PRECHECK(EnableMenuCommand);
    1833 #endif
    1834         if (!PyArg_ParseTuple(_args, "l",
    1835                               &inCommandID))
    1836                 return NULL;
    1837         EnableMenuCommand(_self->ob_itself,
    1838                           inCommandID);
    1839         Py_INCREF(Py_None);
    1840         _res = Py_None;
    1841         return _res;
     1832    PyMac_PRECHECK(EnableMenuCommand);
     1833#endif
     1834    if (!PyArg_ParseTuple(_args, "l",
     1835                          &inCommandID))
     1836        return NULL;
     1837    EnableMenuCommand(_self->ob_itself,
     1838                      inCommandID);
     1839    Py_INCREF(Py_None);
     1840    _res = Py_None;
     1841    return _res;
    18421842}
    18431843
    18441844static PyObject *MenuObj_DisableMenuCommand(MenuObject *_self, PyObject *_args)
    18451845{
    1846         PyObject *_res = NULL;
    1847         MenuCommand inCommandID;
     1846    PyObject *_res = NULL;
     1847    MenuCommand inCommandID;
    18481848#ifndef DisableMenuCommand
    1849         PyMac_PRECHECK(DisableMenuCommand);
    1850 #endif
    1851         if (!PyArg_ParseTuple(_args, "l",
    1852                               &inCommandID))
    1853                 return NULL;
    1854         DisableMenuCommand(_self->ob_itself,
    1855                            inCommandID);
    1856         Py_INCREF(Py_None);
    1857         _res = Py_None;
    1858         return _res;
     1849    PyMac_PRECHECK(DisableMenuCommand);
     1850#endif
     1851    if (!PyArg_ParseTuple(_args, "l",
     1852                          &inCommandID))
     1853        return NULL;
     1854    DisableMenuCommand(_self->ob_itself,
     1855                       inCommandID);
     1856    Py_INCREF(Py_None);
     1857    _res = Py_None;
     1858    return _res;
    18591859}
    18601860
    18611861static PyObject *MenuObj_IsMenuCommandEnabled(MenuObject *_self, PyObject *_args)
    18621862{
    1863         PyObject *_res = NULL;
    1864         Boolean _rv;
    1865         MenuCommand inCommandID;
     1863    PyObject *_res = NULL;
     1864    Boolean _rv;
     1865    MenuCommand inCommandID;
    18661866#ifndef IsMenuCommandEnabled
    1867         PyMac_PRECHECK(IsMenuCommandEnabled);
    1868 #endif
    1869         if (!PyArg_ParseTuple(_args, "l",
    1870                               &inCommandID))
    1871                 return NULL;
    1872         _rv = IsMenuCommandEnabled(_self->ob_itself,
    1873                                    inCommandID);
    1874         _res = Py_BuildValue("b",
    1875                              _rv);
    1876         return _res;
     1867    PyMac_PRECHECK(IsMenuCommandEnabled);
     1868#endif
     1869    if (!PyArg_ParseTuple(_args, "l",
     1870                          &inCommandID))
     1871        return NULL;
     1872    _rv = IsMenuCommandEnabled(_self->ob_itself,
     1873                               inCommandID);
     1874    _res = Py_BuildValue("b",
     1875                         _rv);
     1876    return _res;
    18771877}
    18781878
    18791879static PyObject *MenuObj_SetMenuCommandMark(MenuObject *_self, PyObject *_args)
    18801880{
    1881         PyObject *_res = NULL;
    1882         OSStatus _err;
    1883         MenuCommand inCommandID;
    1884         UniChar inMark;
     1881    PyObject *_res = NULL;
     1882    OSStatus _err;
     1883    MenuCommand inCommandID;
     1884    UniChar inMark;
    18851885#ifndef SetMenuCommandMark
    1886         PyMac_PRECHECK(SetMenuCommandMark);
    1887 #endif
    1888         if (!PyArg_ParseTuple(_args, "lh",
    1889                               &inCommandID,
    1890                               &inMark))
    1891                 return NULL;
    1892         _err = SetMenuCommandMark(_self->ob_itself,
    1893                                   inCommandID,
    1894                                   inMark);
    1895         if (_err != noErr) return PyMac_Error(_err);
    1896         Py_INCREF(Py_None);
    1897         _res = Py_None;
    1898         return _res;
     1886    PyMac_PRECHECK(SetMenuCommandMark);
     1887#endif
     1888    if (!PyArg_ParseTuple(_args, "lh",
     1889                          &inCommandID,
     1890                          &inMark))
     1891        return NULL;
     1892    _err = SetMenuCommandMark(_self->ob_itself,
     1893                              inCommandID,
     1894                              inMark);
     1895    if (_err != noErr) return PyMac_Error(_err);
     1896    Py_INCREF(Py_None);
     1897    _res = Py_None;
     1898    return _res;
    18991899}
    19001900
    19011901static PyObject *MenuObj_GetMenuCommandMark(MenuObject *_self, PyObject *_args)
    19021902{
    1903         PyObject *_res = NULL;
    1904         OSStatus _err;
    1905         MenuCommand inCommandID;
    1906         UniChar outMark;
     1903    PyObject *_res = NULL;
     1904    OSStatus _err;
     1905    MenuCommand inCommandID;
     1906    UniChar outMark;
    19071907#ifndef GetMenuCommandMark
    1908         PyMac_PRECHECK(GetMenuCommandMark);
    1909 #endif
    1910         if (!PyArg_ParseTuple(_args, "l",
    1911                               &inCommandID))
    1912                 return NULL;
    1913         _err = GetMenuCommandMark(_self->ob_itself,
    1914                                   inCommandID,
    1915                                   &outMark);
    1916         if (_err != noErr) return PyMac_Error(_err);
    1917         _res = Py_BuildValue("h",
    1918                              outMark);
    1919         return _res;
     1908    PyMac_PRECHECK(GetMenuCommandMark);
     1909#endif
     1910    if (!PyArg_ParseTuple(_args, "l",
     1911                          &inCommandID))
     1912        return NULL;
     1913    _err = GetMenuCommandMark(_self->ob_itself,
     1914                              inCommandID,
     1915                              &outMark);
     1916    if (_err != noErr) return PyMac_Error(_err);
     1917    _res = Py_BuildValue("h",
     1918                         outMark);
     1919    return _res;
    19201920}
    19211921
    19221922static PyObject *MenuObj_GetMenuCommandPropertySize(MenuObject *_self, PyObject *_args)
    19231923{
    1924         PyObject *_res = NULL;
    1925         OSStatus _err;
    1926         MenuCommand inCommandID;
    1927         OSType inPropertyCreator;
    1928         OSType inPropertyTag;
    1929         ByteCount outSize;
     1924    PyObject *_res = NULL;
     1925    OSStatus _err;
     1926    MenuCommand inCommandID;
     1927    OSType inPropertyCreator;
     1928    OSType inPropertyTag;
     1929    ByteCount outSize;
    19301930#ifndef GetMenuCommandPropertySize
    1931         PyMac_PRECHECK(GetMenuCommandPropertySize);
    1932 #endif
    1933         if (!PyArg_ParseTuple(_args, "lO&O&",
    1934                               &inCommandID,
    1935                               PyMac_GetOSType, &inPropertyCreator,
    1936                               PyMac_GetOSType, &inPropertyTag))
    1937                 return NULL;
    1938         _err = GetMenuCommandPropertySize(_self->ob_itself,
    1939                                           inCommandID,
    1940                                           inPropertyCreator,
    1941                                           inPropertyTag,
    1942                                           &outSize);
    1943         if (_err != noErr) return PyMac_Error(_err);
    1944         _res = Py_BuildValue("l",
    1945                              outSize);
    1946         return _res;
     1931    PyMac_PRECHECK(GetMenuCommandPropertySize);
     1932#endif
     1933    if (!PyArg_ParseTuple(_args, "lO&O&",
     1934                          &inCommandID,
     1935                          PyMac_GetOSType, &inPropertyCreator,
     1936                          PyMac_GetOSType, &inPropertyTag))
     1937        return NULL;
     1938    _err = GetMenuCommandPropertySize(_self->ob_itself,
     1939                                      inCommandID,
     1940                                      inPropertyCreator,
     1941                                      inPropertyTag,
     1942                                      &outSize);
     1943    if (_err != noErr) return PyMac_Error(_err);
     1944    _res = Py_BuildValue("l",
     1945                         outSize);
     1946    return _res;
    19471947}
    19481948
    19491949static PyObject *MenuObj_RemoveMenuCommandProperty(MenuObject *_self, PyObject *_args)
    19501950{
    1951         PyObject *_res = NULL;
    1952         OSStatus _err;
    1953         MenuCommand inCommandID;
    1954         OSType inPropertyCreator;
    1955         OSType inPropertyTag;
     1951    PyObject *_res = NULL;
     1952    OSStatus _err;
     1953    MenuCommand inCommandID;
     1954    OSType inPropertyCreator;
     1955    OSType inPropertyTag;
    19561956#ifndef RemoveMenuCommandProperty
    1957         PyMac_PRECHECK(RemoveMenuCommandProperty);
    1958 #endif
    1959         if (!PyArg_ParseTuple(_args, "lO&O&",
    1960                               &inCommandID,
    1961                               PyMac_GetOSType, &inPropertyCreator,
    1962                               PyMac_GetOSType, &inPropertyTag))
    1963                 return NULL;
    1964         _err = RemoveMenuCommandProperty(_self->ob_itself,
    1965                                          inCommandID,
    1966                                          inPropertyCreator,
    1967                                          inPropertyTag);
    1968         if (_err != noErr) return PyMac_Error(_err);
    1969         Py_INCREF(Py_None);
    1970         _res = Py_None;
    1971         return _res;
     1957    PyMac_PRECHECK(RemoveMenuCommandProperty);
     1958#endif
     1959    if (!PyArg_ParseTuple(_args, "lO&O&",
     1960                          &inCommandID,
     1961                          PyMac_GetOSType, &inPropertyCreator,
     1962                          PyMac_GetOSType, &inPropertyTag))
     1963        return NULL;
     1964    _err = RemoveMenuCommandProperty(_self->ob_itself,
     1965                                     inCommandID,
     1966                                     inPropertyCreator,
     1967                                     inPropertyTag);
     1968    if (_err != noErr) return PyMac_Error(_err);
     1969    Py_INCREF(Py_None);
     1970    _res = Py_None;
     1971    return _res;
    19721972}
    19731973
    19741974static PyObject *MenuObj_IsMenuItemInvalid(MenuObject *_self, PyObject *_args)
    19751975{
    1976         PyObject *_res = NULL;
    1977         Boolean _rv;
    1978         MenuItemIndex inItem;
     1976    PyObject *_res = NULL;
     1977    Boolean _rv;
     1978    MenuItemIndex inItem;
    19791979#ifndef IsMenuItemInvalid
    1980         PyMac_PRECHECK(IsMenuItemInvalid);
    1981 #endif
    1982         if (!PyArg_ParseTuple(_args, "h",
    1983                               &inItem))
    1984                 return NULL;
    1985         _rv = IsMenuItemInvalid(_self->ob_itself,
    1986                                 inItem);
    1987         _res = Py_BuildValue("b",
    1988                              _rv);
    1989         return _res;
     1980    PyMac_PRECHECK(IsMenuItemInvalid);
     1981#endif
     1982    if (!PyArg_ParseTuple(_args, "h",
     1983                          &inItem))
     1984        return NULL;
     1985    _rv = IsMenuItemInvalid(_self->ob_itself,
     1986                            inItem);
     1987    _res = Py_BuildValue("b",
     1988                         _rv);
     1989    return _res;
    19901990}
    19911991
    19921992static PyObject *MenuObj_InvalidateMenuItems(MenuObject *_self, PyObject *_args)
    19931993{
    1994         PyObject *_res = NULL;
    1995         OSStatus _err;
    1996         MenuItemIndex inFirstItem;
    1997         ItemCount inNumItems;
     1994    PyObject *_res = NULL;
     1995    OSStatus _err;
     1996    MenuItemIndex inFirstItem;
     1997    ItemCount inNumItems;
    19981998#ifndef InvalidateMenuItems
    1999         PyMac_PRECHECK(InvalidateMenuItems);
    2000 #endif
    2001         if (!PyArg_ParseTuple(_args, "hl",
    2002                               &inFirstItem,
    2003                               &inNumItems))
    2004                 return NULL;
    2005         _err = InvalidateMenuItems(_self->ob_itself,
    2006                                    inFirstItem,
    2007                                    inNumItems);
    2008         if (_err != noErr) return PyMac_Error(_err);
    2009         Py_INCREF(Py_None);
    2010         _res = Py_None;
    2011         return _res;
     1999    PyMac_PRECHECK(InvalidateMenuItems);
     2000#endif
     2001    if (!PyArg_ParseTuple(_args, "hl",
     2002                          &inFirstItem,
     2003                          &inNumItems))
     2004        return NULL;
     2005    _err = InvalidateMenuItems(_self->ob_itself,
     2006                               inFirstItem,
     2007                               inNumItems);
     2008    if (_err != noErr) return PyMac_Error(_err);
     2009    Py_INCREF(Py_None);
     2010    _res = Py_None;
     2011    return _res;
    20122012}
    20132013
    20142014static PyObject *MenuObj_UpdateInvalidMenuItems(MenuObject *_self, PyObject *_args)
    20152015{
    2016         PyObject *_res = NULL;
    2017         OSStatus _err;
     2016    PyObject *_res = NULL;
     2017    OSStatus _err;
    20182018#ifndef UpdateInvalidMenuItems
    2019         PyMac_PRECHECK(UpdateInvalidMenuItems);
    2020 #endif
    2021         if (!PyArg_ParseTuple(_args, ""))
    2022                 return NULL;
    2023         _err = UpdateInvalidMenuItems(_self->ob_itself);
    2024         if (_err != noErr) return PyMac_Error(_err);
    2025         Py_INCREF(Py_None);
    2026         _res = Py_None;
    2027         return _res;
     2019    PyMac_PRECHECK(UpdateInvalidMenuItems);
     2020#endif
     2021    if (!PyArg_ParseTuple(_args, ""))
     2022        return NULL;
     2023    _err = UpdateInvalidMenuItems(_self->ob_itself);
     2024    if (_err != noErr) return PyMac_Error(_err);
     2025    Py_INCREF(Py_None);
     2026    _res = Py_None;
     2027    return _res;
    20282028}
    20292029
    20302030static PyObject *MenuObj_CreateStandardFontMenu(MenuObject *_self, PyObject *_args)
    20312031{
    2032         PyObject *_res = NULL;
    2033         OSStatus _err;
    2034         MenuItemIndex afterItem;
    2035         MenuID firstHierMenuID;
    2036         OptionBits options;
    2037         ItemCount outHierMenuCount;
     2032    PyObject *_res = NULL;
     2033    OSStatus _err;
     2034    MenuItemIndex afterItem;
     2035    MenuID firstHierMenuID;
     2036    OptionBits options;
     2037    ItemCount outHierMenuCount;
    20382038#ifndef CreateStandardFontMenu
    2039         PyMac_PRECHECK(CreateStandardFontMenu);
    2040 #endif
    2041         if (!PyArg_ParseTuple(_args, "hhl",
    2042                               &afterItem,
    2043                               &firstHierMenuID,
    2044                               &options))
    2045                 return NULL;
    2046         _err = CreateStandardFontMenu(_self->ob_itself,
    2047                                       afterItem,
    2048                                       firstHierMenuID,
    2049                                       options,
    2050                                       &outHierMenuCount);
    2051         if (_err != noErr) return PyMac_Error(_err);
    2052         _res = Py_BuildValue("l",
    2053                              outHierMenuCount);
    2054         return _res;
     2039    PyMac_PRECHECK(CreateStandardFontMenu);
     2040#endif
     2041    if (!PyArg_ParseTuple(_args, "hhl",
     2042                          &afterItem,
     2043                          &firstHierMenuID,
     2044                          &options))
     2045        return NULL;
     2046    _err = CreateStandardFontMenu(_self->ob_itself,
     2047                                  afterItem,
     2048                                  firstHierMenuID,
     2049                                  options,
     2050                                  &outHierMenuCount);
     2051    if (_err != noErr) return PyMac_Error(_err);
     2052    _res = Py_BuildValue("l",
     2053                         outHierMenuCount);
     2054    return _res;
    20552055}
    20562056
    20572057static PyObject *MenuObj_UpdateStandardFontMenu(MenuObject *_self, PyObject *_args)
    20582058{
    2059         PyObject *_res = NULL;
    2060         OSStatus _err;
    2061         ItemCount outHierMenuCount;
     2059    PyObject *_res = NULL;
     2060    OSStatus _err;
     2061    ItemCount outHierMenuCount;
    20622062#ifndef UpdateStandardFontMenu
    2063         PyMac_PRECHECK(UpdateStandardFontMenu);
    2064 #endif
    2065         if (!PyArg_ParseTuple(_args, ""))
    2066                 return NULL;
    2067         _err = UpdateStandardFontMenu(_self->ob_itself,
    2068                                       &outHierMenuCount);
    2069         if (_err != noErr) return PyMac_Error(_err);
    2070         _res = Py_BuildValue("l",
    2071                              outHierMenuCount);
    2072         return _res;
     2063    PyMac_PRECHECK(UpdateStandardFontMenu);
     2064#endif
     2065    if (!PyArg_ParseTuple(_args, ""))
     2066        return NULL;
     2067    _err = UpdateStandardFontMenu(_self->ob_itself,
     2068                                  &outHierMenuCount);
     2069    if (_err != noErr) return PyMac_Error(_err);
     2070    _res = Py_BuildValue("l",
     2071                         outHierMenuCount);
     2072    return _res;
    20732073}
    20742074
    20752075static PyObject *MenuObj_GetFontFamilyFromMenuSelection(MenuObject *_self, PyObject *_args)
    20762076{
    2077         PyObject *_res = NULL;
    2078         OSStatus _err;
    2079         MenuItemIndex item;
    2080         FMFontFamily outFontFamily;
    2081         FMFontStyle outStyle;
     2077    PyObject *_res = NULL;
     2078    OSStatus _err;
     2079    MenuItemIndex item;
     2080    FMFontFamily outFontFamily;
     2081    FMFontStyle outStyle;
    20822082#ifndef GetFontFamilyFromMenuSelection
    2083         PyMac_PRECHECK(GetFontFamilyFromMenuSelection);
    2084 #endif
    2085         if (!PyArg_ParseTuple(_args, "h",
    2086                               &item))
    2087                 return NULL;
    2088         _err = GetFontFamilyFromMenuSelection(_self->ob_itself,
    2089                                               item,
    2090                                               &outFontFamily,
    2091                                               &outStyle);
    2092         if (_err != noErr) return PyMac_Error(_err);
    2093         _res = Py_BuildValue("hh",
    2094                              outFontFamily,
    2095                              outStyle);
    2096         return _res;
     2083    PyMac_PRECHECK(GetFontFamilyFromMenuSelection);
     2084#endif
     2085    if (!PyArg_ParseTuple(_args, "h",
     2086                          &item))
     2087        return NULL;
     2088    _err = GetFontFamilyFromMenuSelection(_self->ob_itself,
     2089                                          item,
     2090                                          &outFontFamily,
     2091                                          &outStyle);
     2092    if (_err != noErr) return PyMac_Error(_err);
     2093    _res = Py_BuildValue("hh",
     2094                         outFontFamily,
     2095                         outStyle);
     2096    return _res;
    20972097}
    20982098
    20992099static PyObject *MenuObj_GetMenuID(MenuObject *_self, PyObject *_args)
    21002100{
    2101         PyObject *_res = NULL;
    2102         MenuID _rv;
     2101    PyObject *_res = NULL;
     2102    MenuID _rv;
    21032103#ifndef GetMenuID
    2104         PyMac_PRECHECK(GetMenuID);
    2105 #endif
    2106         if (!PyArg_ParseTuple(_args, ""))
    2107                 return NULL;
    2108         _rv = GetMenuID(_self->ob_itself);
    2109         _res = Py_BuildValue("h",
    2110                              _rv);
    2111         return _res;
     2104    PyMac_PRECHECK(GetMenuID);
     2105#endif
     2106    if (!PyArg_ParseTuple(_args, ""))
     2107        return NULL;
     2108    _rv = GetMenuID(_self->ob_itself);
     2109    _res = Py_BuildValue("h",
     2110                         _rv);
     2111    return _res;
    21122112}
    21132113
    21142114static PyObject *MenuObj_GetMenuWidth(MenuObject *_self, PyObject *_args)
    21152115{
    2116         PyObject *_res = NULL;
    2117         SInt16 _rv;
     2116    PyObject *_res = NULL;
     2117    SInt16 _rv;
    21182118#ifndef GetMenuWidth
    2119         PyMac_PRECHECK(GetMenuWidth);
    2120 #endif
    2121         if (!PyArg_ParseTuple(_args, ""))
    2122                 return NULL;
    2123         _rv = GetMenuWidth(_self->ob_itself);
    2124         _res = Py_BuildValue("h",
    2125                              _rv);
    2126         return _res;
     2119    PyMac_PRECHECK(GetMenuWidth);
     2120#endif
     2121    if (!PyArg_ParseTuple(_args, ""))
     2122        return NULL;
     2123    _rv = GetMenuWidth(_self->ob_itself);
     2124    _res = Py_BuildValue("h",
     2125                         _rv);
     2126    return _res;
    21272127}
    21282128
    21292129static PyObject *MenuObj_GetMenuHeight(MenuObject *_self, PyObject *_args)
    21302130{
    2131         PyObject *_res = NULL;
    2132         SInt16 _rv;
     2131    PyObject *_res = NULL;
     2132    SInt16 _rv;
    21332133#ifndef GetMenuHeight
    2134         PyMac_PRECHECK(GetMenuHeight);
    2135 #endif
    2136         if (!PyArg_ParseTuple(_args, ""))
    2137                 return NULL;
    2138         _rv = GetMenuHeight(_self->ob_itself);
    2139         _res = Py_BuildValue("h",
    2140                              _rv);
    2141         return _res;
     2134    PyMac_PRECHECK(GetMenuHeight);
     2135#endif
     2136    if (!PyArg_ParseTuple(_args, ""))
     2137        return NULL;
     2138    _rv = GetMenuHeight(_self->ob_itself);
     2139    _res = Py_BuildValue("h",
     2140                         _rv);
     2141    return _res;
    21422142}
    21432143
    21442144static PyObject *MenuObj_SetMenuID(MenuObject *_self, PyObject *_args)
    21452145{
    2146         PyObject *_res = NULL;
    2147         MenuID menuID;
     2146    PyObject *_res = NULL;
     2147    MenuID menuID;
    21482148#ifndef SetMenuID
    2149         PyMac_PRECHECK(SetMenuID);
    2150 #endif
    2151         if (!PyArg_ParseTuple(_args, "h",
    2152                               &menuID))
    2153                 return NULL;
    2154         SetMenuID(_self->ob_itself,
    2155                   menuID);
    2156         Py_INCREF(Py_None);
    2157         _res = Py_None;
    2158         return _res;
     2149    PyMac_PRECHECK(SetMenuID);
     2150#endif
     2151    if (!PyArg_ParseTuple(_args, "h",
     2152                          &menuID))
     2153        return NULL;
     2154    SetMenuID(_self->ob_itself,
     2155              menuID);
     2156    Py_INCREF(Py_None);
     2157    _res = Py_None;
     2158    return _res;
    21592159}
    21602160
    21612161static PyObject *MenuObj_SetMenuWidth(MenuObject *_self, PyObject *_args)
    21622162{
    2163         PyObject *_res = NULL;
    2164         SInt16 width;
     2163    PyObject *_res = NULL;
     2164    SInt16 width;
    21652165#ifndef SetMenuWidth
    2166         PyMac_PRECHECK(SetMenuWidth);
    2167 #endif
    2168         if (!PyArg_ParseTuple(_args, "h",
    2169                               &width))
    2170                 return NULL;
    2171         SetMenuWidth(_self->ob_itself,
    2172                      width);
    2173         Py_INCREF(Py_None);
    2174         _res = Py_None;
    2175         return _res;
     2166    PyMac_PRECHECK(SetMenuWidth);
     2167#endif
     2168    if (!PyArg_ParseTuple(_args, "h",
     2169                          &width))
     2170        return NULL;
     2171    SetMenuWidth(_self->ob_itself,
     2172                 width);
     2173    Py_INCREF(Py_None);
     2174    _res = Py_None;
     2175    return _res;
    21762176}
    21772177
    21782178static PyObject *MenuObj_SetMenuHeight(MenuObject *_self, PyObject *_args)
    21792179{
    2180         PyObject *_res = NULL;
    2181         SInt16 height;
     2180    PyObject *_res = NULL;
     2181    SInt16 height;
    21822182#ifndef SetMenuHeight
    2183         PyMac_PRECHECK(SetMenuHeight);
    2184 #endif
    2185         if (!PyArg_ParseTuple(_args, "h",
    2186                               &height))
    2187                 return NULL;
    2188         SetMenuHeight(_self->ob_itself,
    2189                       height);
    2190         Py_INCREF(Py_None);
    2191         _res = Py_None;
    2192         return _res;
     2183    PyMac_PRECHECK(SetMenuHeight);
     2184#endif
     2185    if (!PyArg_ParseTuple(_args, "h",
     2186                          &height))
     2187        return NULL;
     2188    SetMenuHeight(_self->ob_itself,
     2189                  height);
     2190    Py_INCREF(Py_None);
     2191    _res = Py_None;
     2192    return _res;
    21932193}
    21942194
    21952195static PyObject *MenuObj_as_Resource(MenuObject *_self, PyObject *_args)
    21962196{
    2197         PyObject *_res = NULL;
    2198         Handle _rv;
     2197    PyObject *_res = NULL;
     2198    Handle _rv;
    21992199#ifndef as_Resource
    2200         PyMac_PRECHECK(as_Resource);
    2201 #endif
    2202         if (!PyArg_ParseTuple(_args, ""))
    2203                 return NULL;
    2204         _rv = as_Resource(_self->ob_itself);
    2205         _res = Py_BuildValue("O&",
    2206                              ResObj_New, _rv);
    2207         return _res;
     2200    PyMac_PRECHECK(as_Resource);
     2201#endif
     2202    if (!PyArg_ParseTuple(_args, ""))
     2203        return NULL;
     2204    _rv = as_Resource(_self->ob_itself);
     2205    _res = Py_BuildValue("O&",
     2206                         ResObj_New, _rv);
     2207    return _res;
    22082208}
    22092209
    22102210static PyObject *MenuObj_AppendMenu(MenuObject *_self, PyObject *_args)
    22112211{
    2212         PyObject *_res = NULL;
    2213         Str255 data;
     2212    PyObject *_res = NULL;
     2213    Str255 data;
    22142214#ifndef AppendMenu
    2215         PyMac_PRECHECK(AppendMenu);
    2216 #endif
    2217         if (!PyArg_ParseTuple(_args, "O&",
    2218                               PyMac_GetStr255, data))
    2219                 return NULL;
    2220         AppendMenu(_self->ob_itself,
    2221                    data);
    2222         Py_INCREF(Py_None);
    2223         _res = Py_None;
    2224         return _res;
     2215    PyMac_PRECHECK(AppendMenu);
     2216#endif
     2217    if (!PyArg_ParseTuple(_args, "O&",
     2218                          PyMac_GetStr255, data))
     2219        return NULL;
     2220    AppendMenu(_self->ob_itself,
     2221               data);
     2222    Py_INCREF(Py_None);
     2223    _res = Py_None;
     2224    return _res;
    22252225}
    22262226
    22272227static PyObject *MenuObj_InsertMenu(MenuObject *_self, PyObject *_args)
    22282228{
    2229         PyObject *_res = NULL;
    2230         short beforeID;
     2229    PyObject *_res = NULL;
     2230    short beforeID;
    22312231#ifndef InsertMenu
    2232         PyMac_PRECHECK(InsertMenu);
    2233 #endif
    2234         if (!PyArg_ParseTuple(_args, "h",
    2235                               &beforeID))
    2236                 return NULL;
    2237         InsertMenu(_self->ob_itself,
    2238                    beforeID);
    2239         Py_INCREF(Py_None);
    2240         _res = Py_None;
    2241         return _res;
     2232    PyMac_PRECHECK(InsertMenu);
     2233#endif
     2234    if (!PyArg_ParseTuple(_args, "h",
     2235                          &beforeID))
     2236        return NULL;
     2237    InsertMenu(_self->ob_itself,
     2238               beforeID);
     2239    Py_INCREF(Py_None);
     2240    _res = Py_None;
     2241    return _res;
    22422242}
    22432243
    22442244static PyObject *MenuObj_InsertMenuItem(MenuObject *_self, PyObject *_args)
    22452245{
    2246         PyObject *_res = NULL;
    2247         Str255 itemString;
    2248         short afterItem;
     2246    PyObject *_res = NULL;
     2247    Str255 itemString;
     2248    short afterItem;
    22492249#ifndef InsertMenuItem
    2250         PyMac_PRECHECK(InsertMenuItem);
    2251 #endif
    2252         if (!PyArg_ParseTuple(_args, "O&h",
    2253                               PyMac_GetStr255, itemString,
    2254                               &afterItem))
    2255                 return NULL;
    2256         InsertMenuItem(_self->ob_itself,
    2257                        itemString,
    2258                        afterItem);
    2259         Py_INCREF(Py_None);
    2260         _res = Py_None;
    2261         return _res;
     2250    PyMac_PRECHECK(InsertMenuItem);
     2251#endif
     2252    if (!PyArg_ParseTuple(_args, "O&h",
     2253                          PyMac_GetStr255, itemString,
     2254                          &afterItem))
     2255        return NULL;
     2256    InsertMenuItem(_self->ob_itself,
     2257                   itemString,
     2258                   afterItem);
     2259    Py_INCREF(Py_None);
     2260    _res = Py_None;
     2261    return _res;
    22622262}
    22632263
    22642264static PyObject *MenuObj_EnableMenuItem(MenuObject *_self, PyObject *_args)
    22652265{
    2266         PyObject *_res = NULL;
    2267         UInt16 item;
     2266    PyObject *_res = NULL;
     2267    UInt16 item;
    22682268#ifndef EnableMenuItem
    2269         PyMac_PRECHECK(EnableMenuItem);
    2270 #endif
    2271         if (!PyArg_ParseTuple(_args, "H",
    2272                               &item))
    2273                 return NULL;
    2274         EnableMenuItem(_self->ob_itself,
    2275                        item);
    2276         Py_INCREF(Py_None);
    2277         _res = Py_None;
    2278         return _res;
     2269    PyMac_PRECHECK(EnableMenuItem);
     2270#endif
     2271    if (!PyArg_ParseTuple(_args, "H",
     2272                          &item))
     2273        return NULL;
     2274    EnableMenuItem(_self->ob_itself,
     2275                   item);
     2276    Py_INCREF(Py_None);
     2277    _res = Py_None;
     2278    return _res;
    22792279}
    22802280
    22812281static PyObject *MenuObj_CheckMenuItem(MenuObject *_self, PyObject *_args)
    22822282{
    2283         PyObject *_res = NULL;
    2284         short item;
    2285         Boolean checked;
     2283    PyObject *_res = NULL;
     2284    short item;
     2285    Boolean checked;
    22862286#ifndef CheckMenuItem
    2287         PyMac_PRECHECK(CheckMenuItem);
    2288 #endif
    2289         if (!PyArg_ParseTuple(_args, "hb",
    2290                               &item,
    2291                               &checked))
    2292                 return NULL;
    2293         CheckMenuItem(_self->ob_itself,
    2294                       item,
    2295                       checked);
    2296         Py_INCREF(Py_None);
    2297         _res = Py_None;
    2298         return _res;
     2287    PyMac_PRECHECK(CheckMenuItem);
     2288#endif
     2289    if (!PyArg_ParseTuple(_args, "hb",
     2290                          &item,
     2291                          &checked))
     2292        return NULL;
     2293    CheckMenuItem(_self->ob_itself,
     2294                  item,
     2295                  checked);
     2296    Py_INCREF(Py_None);
     2297    _res = Py_None;
     2298    return _res;
    22992299}
    23002300
    23012301static PyMethodDef MenuObj_methods[] = {
    2302         {"DisposeMenu", (PyCFunction)MenuObj_DisposeMenu, 1,
    2303         PyDoc_STR("() -> None")},
    2304         {"CalcMenuSize", (PyCFunction)MenuObj_CalcMenuSize, 1,
    2305         PyDoc_STR("() -> None")},
    2306         {"CountMenuItems", (PyCFunction)MenuObj_CountMenuItems, 1,
    2307         PyDoc_STR("() -> (UInt16 _rv)")},
    2308         {"GetMenuFont", (PyCFunction)MenuObj_GetMenuFont, 1,
    2309         PyDoc_STR("() -> (SInt16 outFontID, UInt16 outFontSize)")},
    2310         {"SetMenuFont", (PyCFunction)MenuObj_SetMenuFont, 1,
    2311         PyDoc_STR("(SInt16 inFontID, UInt16 inFontSize) -> None")},
    2312         {"GetMenuExcludesMarkColumn", (PyCFunction)MenuObj_GetMenuExcludesMarkColumn, 1,
    2313         PyDoc_STR("() -> (Boolean _rv)")},
    2314         {"SetMenuExcludesMarkColumn", (PyCFunction)MenuObj_SetMenuExcludesMarkColumn, 1,
    2315         PyDoc_STR("(Boolean excludesMark) -> None")},
    2316         {"IsValidMenu", (PyCFunction)MenuObj_IsValidMenu, 1,
    2317         PyDoc_STR("() -> (Boolean _rv)")},
    2318         {"GetMenuRetainCount", (PyCFunction)MenuObj_GetMenuRetainCount, 1,
    2319         PyDoc_STR("() -> (ItemCount _rv)")},
    2320         {"RetainMenu", (PyCFunction)MenuObj_RetainMenu, 1,
    2321         PyDoc_STR("() -> None")},
    2322         {"ReleaseMenu", (PyCFunction)MenuObj_ReleaseMenu, 1,
    2323         PyDoc_STR("() -> None")},
    2324         {"DuplicateMenu", (PyCFunction)MenuObj_DuplicateMenu, 1,
    2325         PyDoc_STR("() -> (MenuHandle outMenu)")},
    2326         {"CopyMenuTitleAsCFString", (PyCFunction)MenuObj_CopyMenuTitleAsCFString, 1,
    2327         PyDoc_STR("() -> (CFStringRef outString)")},
    2328         {"SetMenuTitleWithCFString", (PyCFunction)MenuObj_SetMenuTitleWithCFString, 1,
    2329         PyDoc_STR("(CFStringRef inString) -> None")},
    2330         {"InvalidateMenuSize", (PyCFunction)MenuObj_InvalidateMenuSize, 1,
    2331         PyDoc_STR("() -> None")},
    2332         {"IsMenuSizeInvalid", (PyCFunction)MenuObj_IsMenuSizeInvalid, 1,
    2333         PyDoc_STR("() -> (Boolean _rv)")},
    2334         {"MacAppendMenu", (PyCFunction)MenuObj_MacAppendMenu, 1,
    2335         PyDoc_STR("(Str255 data) -> None")},
    2336         {"InsertResMenu", (PyCFunction)MenuObj_InsertResMenu, 1,
    2337         PyDoc_STR("(ResType theType, short afterItem) -> None")},
    2338         {"AppendResMenu", (PyCFunction)MenuObj_AppendResMenu, 1,
    2339         PyDoc_STR("(ResType theType) -> None")},
    2340         {"MacInsertMenuItem", (PyCFunction)MenuObj_MacInsertMenuItem, 1,
    2341         PyDoc_STR("(Str255 itemString, short afterItem) -> None")},
    2342         {"DeleteMenuItem", (PyCFunction)MenuObj_DeleteMenuItem, 1,
    2343         PyDoc_STR("(short item) -> None")},
    2344         {"InsertFontResMenu", (PyCFunction)MenuObj_InsertFontResMenu, 1,
    2345         PyDoc_STR("(short afterItem, short scriptFilter) -> None")},
    2346         {"InsertIntlResMenu", (PyCFunction)MenuObj_InsertIntlResMenu, 1,
    2347         PyDoc_STR("(ResType theType, short afterItem, short scriptFilter) -> None")},
    2348         {"AppendMenuItemText", (PyCFunction)MenuObj_AppendMenuItemText, 1,
    2349         PyDoc_STR("(Str255 inString) -> None")},
    2350         {"InsertMenuItemText", (PyCFunction)MenuObj_InsertMenuItemText, 1,
    2351         PyDoc_STR("(Str255 inString, MenuItemIndex afterItem) -> None")},
    2352         {"CopyMenuItems", (PyCFunction)MenuObj_CopyMenuItems, 1,
    2353         PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems, MenuHandle inDestMenu, MenuItemIndex inInsertAfter) -> None")},
    2354         {"DeleteMenuItems", (PyCFunction)MenuObj_DeleteMenuItems, 1,
    2355         PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None")},
    2356         {"AppendMenuItemTextWithCFString", (PyCFunction)MenuObj_AppendMenuItemTextWithCFString, 1,
    2357         PyDoc_STR("(CFStringRef inString, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> (MenuItemIndex outNewItem)")},
    2358         {"InsertMenuItemTextWithCFString", (PyCFunction)MenuObj_InsertMenuItemTextWithCFString, 1,
    2359         PyDoc_STR("(CFStringRef inString, MenuItemIndex inAfterItem, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> None")},
    2360         {"PopUpMenuSelect", (PyCFunction)MenuObj_PopUpMenuSelect, 1,
    2361         PyDoc_STR("(short top, short left, short popUpItem) -> (long _rv)")},
    2362         {"InvalidateMenuEnabling", (PyCFunction)MenuObj_InvalidateMenuEnabling, 1,
    2363         PyDoc_STR("() -> None")},
    2364         {"IsMenuBarInvalid", (PyCFunction)MenuObj_IsMenuBarInvalid, 1,
    2365         PyDoc_STR("() -> (Boolean _rv)")},
    2366         {"MacInsertMenu", (PyCFunction)MenuObj_MacInsertMenu, 1,
    2367         PyDoc_STR("(MenuID beforeID) -> None")},
    2368         {"SetRootMenu", (PyCFunction)MenuObj_SetRootMenu, 1,
    2369         PyDoc_STR("() -> None")},
    2370         {"MacCheckMenuItem", (PyCFunction)MenuObj_MacCheckMenuItem, 1,
    2371         PyDoc_STR("(short item, Boolean checked) -> None")},
    2372         {"SetMenuItemText", (PyCFunction)MenuObj_SetMenuItemText, 1,
    2373         PyDoc_STR("(short item, Str255 itemString) -> None")},
    2374         {"GetMenuItemText", (PyCFunction)MenuObj_GetMenuItemText, 1,
    2375         PyDoc_STR("(short item) -> (Str255 itemString)")},
    2376         {"SetItemMark", (PyCFunction)MenuObj_SetItemMark, 1,
    2377         PyDoc_STR("(short item, CharParameter markChar) -> None")},
    2378         {"GetItemMark", (PyCFunction)MenuObj_GetItemMark, 1,
    2379         PyDoc_STR("(short item) -> (CharParameter markChar)")},
    2380         {"SetItemCmd", (PyCFunction)MenuObj_SetItemCmd, 1,
    2381         PyDoc_STR("(short item, CharParameter cmdChar) -> None")},
    2382         {"GetItemCmd", (PyCFunction)MenuObj_GetItemCmd, 1,
    2383         PyDoc_STR("(short item) -> (CharParameter cmdChar)")},
    2384         {"SetItemIcon", (PyCFunction)MenuObj_SetItemIcon, 1,
    2385         PyDoc_STR("(short item, short iconIndex) -> None")},
    2386         {"GetItemIcon", (PyCFunction)MenuObj_GetItemIcon, 1,
    2387         PyDoc_STR("(short item) -> (short iconIndex)")},
    2388         {"SetItemStyle", (PyCFunction)MenuObj_SetItemStyle, 1,
    2389         PyDoc_STR("(short item, StyleParameter chStyle) -> None")},
    2390         {"GetItemStyle", (PyCFunction)MenuObj_GetItemStyle, 1,
    2391         PyDoc_STR("(short item) -> (Style chStyle)")},
    2392         {"SetMenuItemCommandID", (PyCFunction)MenuObj_SetMenuItemCommandID, 1,
    2393         PyDoc_STR("(SInt16 inItem, MenuCommand inCommandID) -> None")},
    2394         {"GetMenuItemCommandID", (PyCFunction)MenuObj_GetMenuItemCommandID, 1,
    2395         PyDoc_STR("(SInt16 inItem) -> (MenuCommand outCommandID)")},
    2396         {"SetMenuItemModifiers", (PyCFunction)MenuObj_SetMenuItemModifiers, 1,
    2397         PyDoc_STR("(SInt16 inItem, UInt8 inModifiers) -> None")},
    2398         {"GetMenuItemModifiers", (PyCFunction)MenuObj_GetMenuItemModifiers, 1,
    2399         PyDoc_STR("(SInt16 inItem) -> (UInt8 outModifiers)")},
    2400         {"SetMenuItemIconHandle", (PyCFunction)MenuObj_SetMenuItemIconHandle, 1,
    2401         PyDoc_STR("(SInt16 inItem, UInt8 inIconType, Handle inIconHandle) -> None")},
    2402         {"GetMenuItemIconHandle", (PyCFunction)MenuObj_GetMenuItemIconHandle, 1,
    2403         PyDoc_STR("(SInt16 inItem) -> (UInt8 outIconType, Handle outIconHandle)")},
    2404         {"SetMenuItemTextEncoding", (PyCFunction)MenuObj_SetMenuItemTextEncoding, 1,
    2405         PyDoc_STR("(SInt16 inItem, TextEncoding inScriptID) -> None")},
    2406         {"GetMenuItemTextEncoding", (PyCFunction)MenuObj_GetMenuItemTextEncoding, 1,
    2407         PyDoc_STR("(SInt16 inItem) -> (TextEncoding outScriptID)")},
    2408         {"SetMenuItemHierarchicalID", (PyCFunction)MenuObj_SetMenuItemHierarchicalID, 1,
    2409         PyDoc_STR("(SInt16 inItem, MenuID inHierID) -> None")},
    2410         {"GetMenuItemHierarchicalID", (PyCFunction)MenuObj_GetMenuItemHierarchicalID, 1,
    2411         PyDoc_STR("(SInt16 inItem) -> (MenuID outHierID)")},
    2412         {"SetMenuItemFontID", (PyCFunction)MenuObj_SetMenuItemFontID, 1,
    2413         PyDoc_STR("(SInt16 inItem, SInt16 inFontID) -> None")},
    2414         {"GetMenuItemFontID", (PyCFunction)MenuObj_GetMenuItemFontID, 1,
    2415         PyDoc_STR("(SInt16 inItem) -> (SInt16 outFontID)")},
    2416         {"SetMenuItemRefCon", (PyCFunction)MenuObj_SetMenuItemRefCon, 1,
    2417         PyDoc_STR("(SInt16 inItem, UInt32 inRefCon) -> None")},
    2418         {"GetMenuItemRefCon", (PyCFunction)MenuObj_GetMenuItemRefCon, 1,
    2419         PyDoc_STR("(SInt16 inItem) -> (UInt32 outRefCon)")},
    2420         {"SetMenuItemKeyGlyph", (PyCFunction)MenuObj_SetMenuItemKeyGlyph, 1,
    2421         PyDoc_STR("(SInt16 inItem, SInt16 inGlyph) -> None")},
    2422         {"GetMenuItemKeyGlyph", (PyCFunction)MenuObj_GetMenuItemKeyGlyph, 1,
    2423         PyDoc_STR("(SInt16 inItem) -> (SInt16 outGlyph)")},
    2424         {"MacEnableMenuItem", (PyCFunction)MenuObj_MacEnableMenuItem, 1,
    2425         PyDoc_STR("(MenuItemIndex item) -> None")},
    2426         {"DisableMenuItem", (PyCFunction)MenuObj_DisableMenuItem, 1,
    2427         PyDoc_STR("(MenuItemIndex item) -> None")},
    2428         {"IsMenuItemEnabled", (PyCFunction)MenuObj_IsMenuItemEnabled, 1,
    2429         PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
    2430         {"EnableMenuItemIcon", (PyCFunction)MenuObj_EnableMenuItemIcon, 1,
    2431         PyDoc_STR("(MenuItemIndex item) -> None")},
    2432         {"DisableMenuItemIcon", (PyCFunction)MenuObj_DisableMenuItemIcon, 1,
    2433         PyDoc_STR("(MenuItemIndex item) -> None")},
    2434         {"IsMenuItemIconEnabled", (PyCFunction)MenuObj_IsMenuItemIconEnabled, 1,
    2435         PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
    2436         {"SetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_SetMenuItemHierarchicalMenu, 1,
    2437         PyDoc_STR("(MenuItemIndex inItem, MenuHandle inHierMenu) -> None")},
    2438         {"GetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_GetMenuItemHierarchicalMenu, 1,
    2439         PyDoc_STR("(MenuItemIndex inItem) -> (MenuHandle outHierMenu)")},
    2440         {"CopyMenuItemTextAsCFString", (PyCFunction)MenuObj_CopyMenuItemTextAsCFString, 1,
    2441         PyDoc_STR("(MenuItemIndex inItem) -> (CFStringRef outString)")},
    2442         {"SetMenuItemTextWithCFString", (PyCFunction)MenuObj_SetMenuItemTextWithCFString, 1,
    2443         PyDoc_STR("(MenuItemIndex inItem, CFStringRef inString) -> None")},
    2444         {"GetMenuItemIndent", (PyCFunction)MenuObj_GetMenuItemIndent, 1,
    2445         PyDoc_STR("(MenuItemIndex inItem) -> (UInt32 outIndent)")},
    2446         {"SetMenuItemIndent", (PyCFunction)MenuObj_SetMenuItemIndent, 1,
    2447         PyDoc_STR("(MenuItemIndex inItem, UInt32 inIndent) -> None")},
    2448         {"GetMenuItemCommandKey", (PyCFunction)MenuObj_GetMenuItemCommandKey, 1,
    2449         PyDoc_STR("(MenuItemIndex inItem, Boolean inGetVirtualKey) -> (UInt16 outKey)")},
    2450         {"SetMenuItemCommandKey", (PyCFunction)MenuObj_SetMenuItemCommandKey, 1,
    2451         PyDoc_STR("(MenuItemIndex inItem, Boolean inSetVirtualKey, UInt16 inKey) -> None")},
    2452         {"GetMenuItemPropertyAttributes", (PyCFunction)MenuObj_GetMenuItemPropertyAttributes, 1,
    2453         PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
    2454         {"ChangeMenuItemPropertyAttributes", (PyCFunction)MenuObj_ChangeMenuItemPropertyAttributes, 1,
    2455         PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
    2456         {"GetMenuAttributes", (PyCFunction)MenuObj_GetMenuAttributes, 1,
    2457         PyDoc_STR("() -> (MenuAttributes outAttributes)")},
    2458         {"ChangeMenuAttributes", (PyCFunction)MenuObj_ChangeMenuAttributes, 1,
    2459         PyDoc_STR("(MenuAttributes setTheseAttributes, MenuAttributes clearTheseAttributes) -> None")},
    2460         {"GetMenuItemAttributes", (PyCFunction)MenuObj_GetMenuItemAttributes, 1,
    2461         PyDoc_STR("(MenuItemIndex item) -> (MenuItemAttributes outAttributes)")},
    2462         {"ChangeMenuItemAttributes", (PyCFunction)MenuObj_ChangeMenuItemAttributes, 1,
    2463         PyDoc_STR("(MenuItemIndex item, MenuItemAttributes setTheseAttributes, MenuItemAttributes clearTheseAttributes) -> None")},
    2464         {"DisableAllMenuItems", (PyCFunction)MenuObj_DisableAllMenuItems, 1,
    2465         PyDoc_STR("() -> None")},
    2466         {"EnableAllMenuItems", (PyCFunction)MenuObj_EnableAllMenuItems, 1,
    2467         PyDoc_STR("() -> None")},
    2468         {"MenuHasEnabledItems", (PyCFunction)MenuObj_MenuHasEnabledItems, 1,
    2469         PyDoc_STR("() -> (Boolean _rv)")},
    2470         {"GetMenuType", (PyCFunction)MenuObj_GetMenuType, 1,
    2471         PyDoc_STR("() -> (UInt16 outType)")},
    2472         {"CountMenuItemsWithCommandID", (PyCFunction)MenuObj_CountMenuItemsWithCommandID, 1,
    2473         PyDoc_STR("(MenuCommand inCommandID) -> (ItemCount _rv)")},
    2474         {"GetIndMenuItemWithCommandID", (PyCFunction)MenuObj_GetIndMenuItemWithCommandID, 1,
    2475         PyDoc_STR("(MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
    2476         {"EnableMenuCommand", (PyCFunction)MenuObj_EnableMenuCommand, 1,
    2477         PyDoc_STR("(MenuCommand inCommandID) -> None")},
    2478         {"DisableMenuCommand", (PyCFunction)MenuObj_DisableMenuCommand, 1,
    2479         PyDoc_STR("(MenuCommand inCommandID) -> None")},
    2480         {"IsMenuCommandEnabled", (PyCFunction)MenuObj_IsMenuCommandEnabled, 1,
    2481         PyDoc_STR("(MenuCommand inCommandID) -> (Boolean _rv)")},
    2482         {"SetMenuCommandMark", (PyCFunction)MenuObj_SetMenuCommandMark, 1,
    2483         PyDoc_STR("(MenuCommand inCommandID, UniChar inMark) -> None")},
    2484         {"GetMenuCommandMark", (PyCFunction)MenuObj_GetMenuCommandMark, 1,
    2485         PyDoc_STR("(MenuCommand inCommandID) -> (UniChar outMark)")},
    2486         {"GetMenuCommandPropertySize", (PyCFunction)MenuObj_GetMenuCommandPropertySize, 1,
    2487         PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
    2488         {"RemoveMenuCommandProperty", (PyCFunction)MenuObj_RemoveMenuCommandProperty, 1,
    2489         PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
    2490         {"IsMenuItemInvalid", (PyCFunction)MenuObj_IsMenuItemInvalid, 1,
    2491         PyDoc_STR("(MenuItemIndex inItem) -> (Boolean _rv)")},
    2492         {"InvalidateMenuItems", (PyCFunction)MenuObj_InvalidateMenuItems, 1,
    2493         PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None")},
    2494         {"UpdateInvalidMenuItems", (PyCFunction)MenuObj_UpdateInvalidMenuItems, 1,
    2495         PyDoc_STR("() -> None")},
    2496         {"CreateStandardFontMenu", (PyCFunction)MenuObj_CreateStandardFontMenu, 1,
    2497         PyDoc_STR("(MenuItemIndex afterItem, MenuID firstHierMenuID, OptionBits options) -> (ItemCount outHierMenuCount)")},
    2498         {"UpdateStandardFontMenu", (PyCFunction)MenuObj_UpdateStandardFontMenu, 1,
    2499         PyDoc_STR("() -> (ItemCount outHierMenuCount)")},
    2500         {"GetFontFamilyFromMenuSelection", (PyCFunction)MenuObj_GetFontFamilyFromMenuSelection, 1,
    2501         PyDoc_STR("(MenuItemIndex item) -> (FMFontFamily outFontFamily, FMFontStyle outStyle)")},
    2502         {"GetMenuID", (PyCFunction)MenuObj_GetMenuID, 1,
    2503         PyDoc_STR("() -> (MenuID _rv)")},
    2504         {"GetMenuWidth", (PyCFunction)MenuObj_GetMenuWidth, 1,
    2505         PyDoc_STR("() -> (SInt16 _rv)")},
    2506         {"GetMenuHeight", (PyCFunction)MenuObj_GetMenuHeight, 1,
    2507         PyDoc_STR("() -> (SInt16 _rv)")},
    2508         {"SetMenuID", (PyCFunction)MenuObj_SetMenuID, 1,
    2509         PyDoc_STR("(MenuID menuID) -> None")},
    2510         {"SetMenuWidth", (PyCFunction)MenuObj_SetMenuWidth, 1,
    2511         PyDoc_STR("(SInt16 width) -> None")},
    2512         {"SetMenuHeight", (PyCFunction)MenuObj_SetMenuHeight, 1,
    2513         PyDoc_STR("(SInt16 height) -> None")},
    2514         {"as_Resource", (PyCFunction)MenuObj_as_Resource, 1,
    2515         PyDoc_STR("() -> (Handle _rv)")},
    2516         {"AppendMenu", (PyCFunction)MenuObj_AppendMenu, 1,
    2517         PyDoc_STR("(Str255 data) -> None")},
    2518         {"InsertMenu", (PyCFunction)MenuObj_InsertMenu, 1,
    2519         PyDoc_STR("(short beforeID) -> None")},
    2520         {"InsertMenuItem", (PyCFunction)MenuObj_InsertMenuItem, 1,
    2521         PyDoc_STR("(Str255 itemString, short afterItem) -> None")},
    2522         {"EnableMenuItem", (PyCFunction)MenuObj_EnableMenuItem, 1,
    2523         PyDoc_STR("(UInt16 item) -> None")},
    2524         {"CheckMenuItem", (PyCFunction)MenuObj_CheckMenuItem, 1,
    2525         PyDoc_STR("(short item, Boolean checked) -> None")},
    2526         {NULL, NULL, 0}
     2302    {"DisposeMenu", (PyCFunction)MenuObj_DisposeMenu, 1,
     2303    PyDoc_STR("() -> None")},
     2304    {"CalcMenuSize", (PyCFunction)MenuObj_CalcMenuSize, 1,
     2305    PyDoc_STR("() -> None")},
     2306    {"CountMenuItems", (PyCFunction)MenuObj_CountMenuItems, 1,
     2307    PyDoc_STR("() -> (UInt16 _rv)")},
     2308    {"GetMenuFont", (PyCFunction)MenuObj_GetMenuFont, 1,
     2309    PyDoc_STR("() -> (SInt16 outFontID, UInt16 outFontSize)")},
     2310    {"SetMenuFont", (PyCFunction)MenuObj_SetMenuFont, 1,
     2311    PyDoc_STR("(SInt16 inFontID, UInt16 inFontSize) -> None")},
     2312    {"GetMenuExcludesMarkColumn", (PyCFunction)MenuObj_GetMenuExcludesMarkColumn, 1,
     2313    PyDoc_STR("() -> (Boolean _rv)")},
     2314    {"SetMenuExcludesMarkColumn", (PyCFunction)MenuObj_SetMenuExcludesMarkColumn, 1,
     2315    PyDoc_STR("(Boolean excludesMark) -> None")},
     2316    {"IsValidMenu", (PyCFunction)MenuObj_IsValidMenu, 1,
     2317    PyDoc_STR("() -> (Boolean _rv)")},
     2318    {"GetMenuRetainCount", (PyCFunction)MenuObj_GetMenuRetainCount, 1,
     2319    PyDoc_STR("() -> (ItemCount _rv)")},
     2320    {"RetainMenu", (PyCFunction)MenuObj_RetainMenu, 1,
     2321    PyDoc_STR("() -> None")},
     2322    {"ReleaseMenu", (PyCFunction)MenuObj_ReleaseMenu, 1,
     2323    PyDoc_STR("() -> None")},
     2324    {"DuplicateMenu", (PyCFunction)MenuObj_DuplicateMenu, 1,
     2325    PyDoc_STR("() -> (MenuHandle outMenu)")},
     2326    {"CopyMenuTitleAsCFString", (PyCFunction)MenuObj_CopyMenuTitleAsCFString, 1,
     2327    PyDoc_STR("() -> (CFStringRef outString)")},
     2328    {"SetMenuTitleWithCFString", (PyCFunction)MenuObj_SetMenuTitleWithCFString, 1,
     2329    PyDoc_STR("(CFStringRef inString) -> None")},
     2330    {"InvalidateMenuSize", (PyCFunction)MenuObj_InvalidateMenuSize, 1,
     2331    PyDoc_STR("() -> None")},
     2332    {"IsMenuSizeInvalid", (PyCFunction)MenuObj_IsMenuSizeInvalid, 1,
     2333    PyDoc_STR("() -> (Boolean _rv)")},
     2334    {"MacAppendMenu", (PyCFunction)MenuObj_MacAppendMenu, 1,
     2335    PyDoc_STR("(Str255 data) -> None")},
     2336    {"InsertResMenu", (PyCFunction)MenuObj_InsertResMenu, 1,
     2337    PyDoc_STR("(ResType theType, short afterItem) -> None")},
     2338    {"AppendResMenu", (PyCFunction)MenuObj_AppendResMenu, 1,
     2339    PyDoc_STR("(ResType theType) -> None")},
     2340    {"MacInsertMenuItem", (PyCFunction)MenuObj_MacInsertMenuItem, 1,
     2341    PyDoc_STR("(Str255 itemString, short afterItem) -> None")},
     2342    {"DeleteMenuItem", (PyCFunction)MenuObj_DeleteMenuItem, 1,
     2343    PyDoc_STR("(short item) -> None")},
     2344    {"InsertFontResMenu", (PyCFunction)MenuObj_InsertFontResMenu, 1,
     2345    PyDoc_STR("(short afterItem, short scriptFilter) -> None")},
     2346    {"InsertIntlResMenu", (PyCFunction)MenuObj_InsertIntlResMenu, 1,
     2347    PyDoc_STR("(ResType theType, short afterItem, short scriptFilter) -> None")},
     2348    {"AppendMenuItemText", (PyCFunction)MenuObj_AppendMenuItemText, 1,
     2349    PyDoc_STR("(Str255 inString) -> None")},
     2350    {"InsertMenuItemText", (PyCFunction)MenuObj_InsertMenuItemText, 1,
     2351    PyDoc_STR("(Str255 inString, MenuItemIndex afterItem) -> None")},
     2352    {"CopyMenuItems", (PyCFunction)MenuObj_CopyMenuItems, 1,
     2353    PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems, MenuHandle inDestMenu, MenuItemIndex inInsertAfter) -> None")},
     2354    {"DeleteMenuItems", (PyCFunction)MenuObj_DeleteMenuItems, 1,
     2355    PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None")},
     2356    {"AppendMenuItemTextWithCFString", (PyCFunction)MenuObj_AppendMenuItemTextWithCFString, 1,
     2357    PyDoc_STR("(CFStringRef inString, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> (MenuItemIndex outNewItem)")},
     2358    {"InsertMenuItemTextWithCFString", (PyCFunction)MenuObj_InsertMenuItemTextWithCFString, 1,
     2359    PyDoc_STR("(CFStringRef inString, MenuItemIndex inAfterItem, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> None")},
     2360    {"PopUpMenuSelect", (PyCFunction)MenuObj_PopUpMenuSelect, 1,
     2361    PyDoc_STR("(short top, short left, short popUpItem) -> (long _rv)")},
     2362    {"InvalidateMenuEnabling", (PyCFunction)MenuObj_InvalidateMenuEnabling, 1,
     2363    PyDoc_STR("() -> None")},
     2364    {"IsMenuBarInvalid", (PyCFunction)MenuObj_IsMenuBarInvalid, 1,
     2365    PyDoc_STR("() -> (Boolean _rv)")},
     2366    {"MacInsertMenu", (PyCFunction)MenuObj_MacInsertMenu, 1,
     2367    PyDoc_STR("(MenuID beforeID) -> None")},
     2368    {"SetRootMenu", (PyCFunction)MenuObj_SetRootMenu, 1,
     2369    PyDoc_STR("() -> None")},
     2370    {"MacCheckMenuItem", (PyCFunction)MenuObj_MacCheckMenuItem, 1,
     2371    PyDoc_STR("(short item, Boolean checked) -> None")},
     2372    {"SetMenuItemText", (PyCFunction)MenuObj_SetMenuItemText, 1,
     2373    PyDoc_STR("(short item, Str255 itemString) -> None")},
     2374    {"GetMenuItemText", (PyCFunction)MenuObj_GetMenuItemText, 1,
     2375    PyDoc_STR("(short item) -> (Str255 itemString)")},
     2376    {"SetItemMark", (PyCFunction)MenuObj_SetItemMark, 1,
     2377    PyDoc_STR("(short item, CharParameter markChar) -> None")},
     2378    {"GetItemMark", (PyCFunction)MenuObj_GetItemMark, 1,
     2379    PyDoc_STR("(short item) -> (CharParameter markChar)")},
     2380    {"SetItemCmd", (PyCFunction)MenuObj_SetItemCmd, 1,
     2381    PyDoc_STR("(short item, CharParameter cmdChar) -> None")},
     2382    {"GetItemCmd", (PyCFunction)MenuObj_GetItemCmd, 1,
     2383    PyDoc_STR("(short item) -> (CharParameter cmdChar)")},
     2384    {"SetItemIcon", (PyCFunction)MenuObj_SetItemIcon, 1,
     2385    PyDoc_STR("(short item, short iconIndex) -> None")},
     2386    {"GetItemIcon", (PyCFunction)MenuObj_GetItemIcon, 1,
     2387    PyDoc_STR("(short item) -> (short iconIndex)")},
     2388    {"SetItemStyle", (PyCFunction)MenuObj_SetItemStyle, 1,
     2389    PyDoc_STR("(short item, StyleParameter chStyle) -> None")},
     2390    {"GetItemStyle", (PyCFunction)MenuObj_GetItemStyle, 1,
     2391    PyDoc_STR("(short item) -> (Style chStyle)")},
     2392    {"SetMenuItemCommandID", (PyCFunction)MenuObj_SetMenuItemCommandID, 1,
     2393    PyDoc_STR("(SInt16 inItem, MenuCommand inCommandID) -> None")},
     2394    {"GetMenuItemCommandID", (PyCFunction)MenuObj_GetMenuItemCommandID, 1,
     2395    PyDoc_STR("(SInt16 inItem) -> (MenuCommand outCommandID)")},
     2396    {"SetMenuItemModifiers", (PyCFunction)MenuObj_SetMenuItemModifiers, 1,
     2397    PyDoc_STR("(SInt16 inItem, UInt8 inModifiers) -> None")},
     2398    {"GetMenuItemModifiers", (PyCFunction)MenuObj_GetMenuItemModifiers, 1,
     2399    PyDoc_STR("(SInt16 inItem) -> (UInt8 outModifiers)")},
     2400    {"SetMenuItemIconHandle", (PyCFunction)MenuObj_SetMenuItemIconHandle, 1,
     2401    PyDoc_STR("(SInt16 inItem, UInt8 inIconType, Handle inIconHandle) -> None")},
     2402    {"GetMenuItemIconHandle", (PyCFunction)MenuObj_GetMenuItemIconHandle, 1,
     2403    PyDoc_STR("(SInt16 inItem) -> (UInt8 outIconType, Handle outIconHandle)")},
     2404    {"SetMenuItemTextEncoding", (PyCFunction)MenuObj_SetMenuItemTextEncoding, 1,
     2405    PyDoc_STR("(SInt16 inItem, TextEncoding inScriptID) -> None")},
     2406    {"GetMenuItemTextEncoding", (PyCFunction)MenuObj_GetMenuItemTextEncoding, 1,
     2407    PyDoc_STR("(SInt16 inItem) -> (TextEncoding outScriptID)")},
     2408    {"SetMenuItemHierarchicalID", (PyCFunction)MenuObj_SetMenuItemHierarchicalID, 1,
     2409    PyDoc_STR("(SInt16 inItem, MenuID inHierID) -> None")},
     2410    {"GetMenuItemHierarchicalID", (PyCFunction)MenuObj_GetMenuItemHierarchicalID, 1,
     2411    PyDoc_STR("(SInt16 inItem) -> (MenuID outHierID)")},
     2412    {"SetMenuItemFontID", (PyCFunction)MenuObj_SetMenuItemFontID, 1,
     2413    PyDoc_STR("(SInt16 inItem, SInt16 inFontID) -> None")},
     2414    {"GetMenuItemFontID", (PyCFunction)MenuObj_GetMenuItemFontID, 1,
     2415    PyDoc_STR("(SInt16 inItem) -> (SInt16 outFontID)")},
     2416    {"SetMenuItemRefCon", (PyCFunction)MenuObj_SetMenuItemRefCon, 1,
     2417    PyDoc_STR("(SInt16 inItem, UInt32 inRefCon) -> None")},
     2418    {"GetMenuItemRefCon", (PyCFunction)MenuObj_GetMenuItemRefCon, 1,
     2419    PyDoc_STR("(SInt16 inItem) -> (UInt32 outRefCon)")},
     2420    {"SetMenuItemKeyGlyph", (PyCFunction)MenuObj_SetMenuItemKeyGlyph, 1,
     2421    PyDoc_STR("(SInt16 inItem, SInt16 inGlyph) -> None")},
     2422    {"GetMenuItemKeyGlyph", (PyCFunction)MenuObj_GetMenuItemKeyGlyph, 1,
     2423    PyDoc_STR("(SInt16 inItem) -> (SInt16 outGlyph)")},
     2424    {"MacEnableMenuItem", (PyCFunction)MenuObj_MacEnableMenuItem, 1,
     2425    PyDoc_STR("(MenuItemIndex item) -> None")},
     2426    {"DisableMenuItem", (PyCFunction)MenuObj_DisableMenuItem, 1,
     2427    PyDoc_STR("(MenuItemIndex item) -> None")},
     2428    {"IsMenuItemEnabled", (PyCFunction)MenuObj_IsMenuItemEnabled, 1,
     2429    PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
     2430    {"EnableMenuItemIcon", (PyCFunction)MenuObj_EnableMenuItemIcon, 1,
     2431    PyDoc_STR("(MenuItemIndex item) -> None")},
     2432    {"DisableMenuItemIcon", (PyCFunction)MenuObj_DisableMenuItemIcon, 1,
     2433    PyDoc_STR("(MenuItemIndex item) -> None")},
     2434    {"IsMenuItemIconEnabled", (PyCFunction)MenuObj_IsMenuItemIconEnabled, 1,
     2435    PyDoc_STR("(MenuItemIndex item) -> (Boolean _rv)")},
     2436    {"SetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_SetMenuItemHierarchicalMenu, 1,
     2437    PyDoc_STR("(MenuItemIndex inItem, MenuHandle inHierMenu) -> None")},
     2438    {"GetMenuItemHierarchicalMenu", (PyCFunction)MenuObj_GetMenuItemHierarchicalMenu, 1,
     2439    PyDoc_STR("(MenuItemIndex inItem) -> (MenuHandle outHierMenu)")},
     2440    {"CopyMenuItemTextAsCFString", (PyCFunction)MenuObj_CopyMenuItemTextAsCFString, 1,
     2441    PyDoc_STR("(MenuItemIndex inItem) -> (CFStringRef outString)")},
     2442    {"SetMenuItemTextWithCFString", (PyCFunction)MenuObj_SetMenuItemTextWithCFString, 1,
     2443    PyDoc_STR("(MenuItemIndex inItem, CFStringRef inString) -> None")},
     2444    {"GetMenuItemIndent", (PyCFunction)MenuObj_GetMenuItemIndent, 1,
     2445    PyDoc_STR("(MenuItemIndex inItem) -> (UInt32 outIndent)")},
     2446    {"SetMenuItemIndent", (PyCFunction)MenuObj_SetMenuItemIndent, 1,
     2447    PyDoc_STR("(MenuItemIndex inItem, UInt32 inIndent) -> None")},
     2448    {"GetMenuItemCommandKey", (PyCFunction)MenuObj_GetMenuItemCommandKey, 1,
     2449    PyDoc_STR("(MenuItemIndex inItem, Boolean inGetVirtualKey) -> (UInt16 outKey)")},
     2450    {"SetMenuItemCommandKey", (PyCFunction)MenuObj_SetMenuItemCommandKey, 1,
     2451    PyDoc_STR("(MenuItemIndex inItem, Boolean inSetVirtualKey, UInt16 inKey) -> None")},
     2452    {"GetMenuItemPropertyAttributes", (PyCFunction)MenuObj_GetMenuItemPropertyAttributes, 1,
     2453    PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)")},
     2454    {"ChangeMenuItemPropertyAttributes", (PyCFunction)MenuObj_ChangeMenuItemPropertyAttributes, 1,
     2455    PyDoc_STR("(MenuItemIndex item, OSType propertyCreator, OSType propertyTag, UInt32 attributesToSet, UInt32 attributesToClear) -> None")},
     2456    {"GetMenuAttributes", (PyCFunction)MenuObj_GetMenuAttributes, 1,
     2457    PyDoc_STR("() -> (MenuAttributes outAttributes)")},
     2458    {"ChangeMenuAttributes", (PyCFunction)MenuObj_ChangeMenuAttributes, 1,
     2459    PyDoc_STR("(MenuAttributes setTheseAttributes, MenuAttributes clearTheseAttributes) -> None")},
     2460    {"GetMenuItemAttributes", (PyCFunction)MenuObj_GetMenuItemAttributes, 1,
     2461    PyDoc_STR("(MenuItemIndex item) -> (MenuItemAttributes outAttributes)")},
     2462    {"ChangeMenuItemAttributes", (PyCFunction)MenuObj_ChangeMenuItemAttributes, 1,
     2463    PyDoc_STR("(MenuItemIndex item, MenuItemAttributes setTheseAttributes, MenuItemAttributes clearTheseAttributes) -> None")},
     2464    {"DisableAllMenuItems", (PyCFunction)MenuObj_DisableAllMenuItems, 1,
     2465    PyDoc_STR("() -> None")},
     2466    {"EnableAllMenuItems", (PyCFunction)MenuObj_EnableAllMenuItems, 1,
     2467    PyDoc_STR("() -> None")},
     2468    {"MenuHasEnabledItems", (PyCFunction)MenuObj_MenuHasEnabledItems, 1,
     2469    PyDoc_STR("() -> (Boolean _rv)")},
     2470    {"GetMenuType", (PyCFunction)MenuObj_GetMenuType, 1,
     2471    PyDoc_STR("() -> (UInt16 outType)")},
     2472    {"CountMenuItemsWithCommandID", (PyCFunction)MenuObj_CountMenuItemsWithCommandID, 1,
     2473    PyDoc_STR("(MenuCommand inCommandID) -> (ItemCount _rv)")},
     2474    {"GetIndMenuItemWithCommandID", (PyCFunction)MenuObj_GetIndMenuItemWithCommandID, 1,
     2475    PyDoc_STR("(MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
     2476    {"EnableMenuCommand", (PyCFunction)MenuObj_EnableMenuCommand, 1,
     2477    PyDoc_STR("(MenuCommand inCommandID) -> None")},
     2478    {"DisableMenuCommand", (PyCFunction)MenuObj_DisableMenuCommand, 1,
     2479    PyDoc_STR("(MenuCommand inCommandID) -> None")},
     2480    {"IsMenuCommandEnabled", (PyCFunction)MenuObj_IsMenuCommandEnabled, 1,
     2481    PyDoc_STR("(MenuCommand inCommandID) -> (Boolean _rv)")},
     2482    {"SetMenuCommandMark", (PyCFunction)MenuObj_SetMenuCommandMark, 1,
     2483    PyDoc_STR("(MenuCommand inCommandID, UniChar inMark) -> None")},
     2484    {"GetMenuCommandMark", (PyCFunction)MenuObj_GetMenuCommandMark, 1,
     2485    PyDoc_STR("(MenuCommand inCommandID) -> (UniChar outMark)")},
     2486    {"GetMenuCommandPropertySize", (PyCFunction)MenuObj_GetMenuCommandPropertySize, 1,
     2487    PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
     2488    {"RemoveMenuCommandProperty", (PyCFunction)MenuObj_RemoveMenuCommandProperty, 1,
     2489    PyDoc_STR("(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
     2490    {"IsMenuItemInvalid", (PyCFunction)MenuObj_IsMenuItemInvalid, 1,
     2491    PyDoc_STR("(MenuItemIndex inItem) -> (Boolean _rv)")},
     2492    {"InvalidateMenuItems", (PyCFunction)MenuObj_InvalidateMenuItems, 1,
     2493    PyDoc_STR("(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None")},
     2494    {"UpdateInvalidMenuItems", (PyCFunction)MenuObj_UpdateInvalidMenuItems, 1,
     2495    PyDoc_STR("() -> None")},
     2496    {"CreateStandardFontMenu", (PyCFunction)MenuObj_CreateStandardFontMenu, 1,
     2497    PyDoc_STR("(MenuItemIndex afterItem, MenuID firstHierMenuID, OptionBits options) -> (ItemCount outHierMenuCount)")},
     2498    {"UpdateStandardFontMenu", (PyCFunction)MenuObj_UpdateStandardFontMenu, 1,
     2499    PyDoc_STR("() -> (ItemCount outHierMenuCount)")},
     2500    {"GetFontFamilyFromMenuSelection", (PyCFunction)MenuObj_GetFontFamilyFromMenuSelection, 1,
     2501    PyDoc_STR("(MenuItemIndex item) -> (FMFontFamily outFontFamily, FMFontStyle outStyle)")},
     2502    {"GetMenuID", (PyCFunction)MenuObj_GetMenuID, 1,
     2503    PyDoc_STR("() -> (MenuID _rv)")},
     2504    {"GetMenuWidth", (PyCFunction)MenuObj_GetMenuWidth, 1,
     2505    PyDoc_STR("() -> (SInt16 _rv)")},
     2506    {"GetMenuHeight", (PyCFunction)MenuObj_GetMenuHeight, 1,
     2507    PyDoc_STR("() -> (SInt16 _rv)")},
     2508    {"SetMenuID", (PyCFunction)MenuObj_SetMenuID, 1,
     2509    PyDoc_STR("(MenuID menuID) -> None")},
     2510    {"SetMenuWidth", (PyCFunction)MenuObj_SetMenuWidth, 1,
     2511    PyDoc_STR("(SInt16 width) -> None")},
     2512    {"SetMenuHeight", (PyCFunction)MenuObj_SetMenuHeight, 1,
     2513    PyDoc_STR("(SInt16 height) -> None")},
     2514    {"as_Resource", (PyCFunction)MenuObj_as_Resource, 1,
     2515    PyDoc_STR("() -> (Handle _rv)")},
     2516    {"AppendMenu", (PyCFunction)MenuObj_AppendMenu, 1,
     2517    PyDoc_STR("(Str255 data) -> None")},
     2518    {"InsertMenu", (PyCFunction)MenuObj_InsertMenu, 1,
     2519    PyDoc_STR("(short beforeID) -> None")},
     2520    {"InsertMenuItem", (PyCFunction)MenuObj_InsertMenuItem, 1,
     2521    PyDoc_STR("(Str255 itemString, short afterItem) -> None")},
     2522    {"EnableMenuItem", (PyCFunction)MenuObj_EnableMenuItem, 1,
     2523    PyDoc_STR("(UInt16 item) -> None")},
     2524    {"CheckMenuItem", (PyCFunction)MenuObj_CheckMenuItem, 1,
     2525    PyDoc_STR("(short item, Boolean checked) -> None")},
     2526    {NULL, NULL, 0}
    25272527};
    25282528
     
    25412541static PyObject *MenuObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
    25422542{
    2543         PyObject *_self;
    2544         MenuHandle itself;
    2545         char *kw[] = {"itself", 0};
    2546 
    2547         if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, MenuObj_Convert, &itself)) return NULL;
    2548         if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
    2549         ((MenuObject *)_self)->ob_itself = itself;
    2550         return _self;
     2543    PyObject *_self;
     2544    MenuHandle itself;
     2545    char *kw[] = {"itself", 0};
     2546
     2547    if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, MenuObj_Convert, &itself)) return NULL;
     2548    if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
     2549    ((MenuObject *)_self)->ob_itself = itself;
     2550    return _self;
    25512551}
    25522552
     
    25552555
    25562556PyTypeObject Menu_Type = {
    2557         PyObject_HEAD_INIT(NULL)
    2558         0, /*ob_size*/
    2559         "_Menu.Menu", /*tp_name*/
    2560         sizeof(MenuObject), /*tp_basicsize*/
    2561         0, /*tp_itemsize*/
    2562         /* methods */
    2563         (destructor) MenuObj_dealloc, /*tp_dealloc*/
    2564         0, /*tp_print*/
    2565         (getattrfunc)0, /*tp_getattr*/
    2566         (setattrfunc)0, /*tp_setattr*/
    2567         (cmpfunc) MenuObj_compare, /*tp_compare*/
    2568         (reprfunc) MenuObj_repr, /*tp_repr*/
    2569         (PyNumberMethods *)0, /* tp_as_number */
    2570         (PySequenceMethods *)0, /* tp_as_sequence */
    2571         (PyMappingMethods *)0, /* tp_as_mapping */
    2572         (hashfunc) MenuObj_hash, /*tp_hash*/
    2573         0, /*tp_call*/
    2574         0, /*tp_str*/
    2575         PyObject_GenericGetAttr, /*tp_getattro*/
    2576         PyObject_GenericSetAttr, /*tp_setattro */
    2577         0, /*tp_as_buffer*/
    2578         Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
    2579         0, /*tp_doc*/
    2580         0, /*tp_traverse*/
    2581         0, /*tp_clear*/
    2582         0, /*tp_richcompare*/
    2583         0, /*tp_weaklistoffset*/
    2584         0, /*tp_iter*/
    2585         0, /*tp_iternext*/
    2586         MenuObj_methods, /* tp_methods */
    2587         0, /*tp_members*/
    2588         MenuObj_getsetlist, /*tp_getset*/
    2589         0, /*tp_base*/
    2590         0, /*tp_dict*/
    2591         0, /*tp_descr_get*/
    2592         0, /*tp_descr_set*/
    2593         0, /*tp_dictoffset*/
    2594         MenuObj_tp_init, /* tp_init */
    2595         MenuObj_tp_alloc, /* tp_alloc */
    2596         MenuObj_tp_new, /* tp_new */
    2597         MenuObj_tp_free, /* tp_free */
     2557    PyObject_HEAD_INIT(NULL)
     2558    0, /*ob_size*/
     2559    "_Menu.Menu", /*tp_name*/
     2560    sizeof(MenuObject), /*tp_basicsize*/
     2561    0, /*tp_itemsize*/
     2562    /* methods */
     2563    (destructor) MenuObj_dealloc, /*tp_dealloc*/
     2564    0, /*tp_print*/
     2565    (getattrfunc)0, /*tp_getattr*/
     2566    (setattrfunc)0, /*tp_setattr*/
     2567    (cmpfunc) MenuObj_compare, /*tp_compare*/
     2568    (reprfunc) MenuObj_repr, /*tp_repr*/
     2569    (PyNumberMethods *)0, /* tp_as_number */
     2570    (PySequenceMethods *)0, /* tp_as_sequence */
     2571    (PyMappingMethods *)0, /* tp_as_mapping */
     2572    (hashfunc) MenuObj_hash, /*tp_hash*/
     2573    0, /*tp_call*/
     2574    0, /*tp_str*/
     2575    PyObject_GenericGetAttr, /*tp_getattro*/
     2576    PyObject_GenericSetAttr, /*tp_setattro */
     2577    0, /*tp_as_buffer*/
     2578    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
     2579    0, /*tp_doc*/
     2580    0, /*tp_traverse*/
     2581    0, /*tp_clear*/
     2582    0, /*tp_richcompare*/
     2583    0, /*tp_weaklistoffset*/
     2584    0, /*tp_iter*/
     2585    0, /*tp_iternext*/
     2586    MenuObj_methods, /* tp_methods */
     2587    0, /*tp_members*/
     2588    MenuObj_getsetlist, /*tp_getset*/
     2589    0, /*tp_base*/
     2590    0, /*tp_dict*/
     2591    0, /*tp_descr_get*/
     2592    0, /*tp_descr_set*/
     2593    0, /*tp_dictoffset*/
     2594    MenuObj_tp_init, /* tp_init */
     2595    MenuObj_tp_alloc, /* tp_alloc */
     2596    MenuObj_tp_new, /* tp_new */
     2597    MenuObj_tp_free, /* tp_free */
    25982598};
    25992599
     
    26032603static PyObject *Menu_NewMenu(PyObject *_self, PyObject *_args)
    26042604{
    2605         PyObject *_res = NULL;
    2606         MenuHandle _rv;
    2607         MenuID menuID;
    2608         Str255 menuTitle;
     2605    PyObject *_res = NULL;
     2606    MenuHandle _rv;
     2607    MenuID menuID;
     2608    Str255 menuTitle;
    26092609#ifndef NewMenu
    2610         PyMac_PRECHECK(NewMenu);
    2611 #endif
    2612         if (!PyArg_ParseTuple(_args, "hO&",
    2613                               &menuID,
    2614                               PyMac_GetStr255, menuTitle))
    2615                 return NULL;
    2616         _rv = NewMenu(menuID,
    2617                       menuTitle);
    2618         _res = Py_BuildValue("O&",
    2619                              MenuObj_New, _rv);
    2620         return _res;
     2610    PyMac_PRECHECK(NewMenu);
     2611#endif
     2612    if (!PyArg_ParseTuple(_args, "hO&",
     2613                          &menuID,
     2614                          PyMac_GetStr255, menuTitle))
     2615        return NULL;
     2616    _rv = NewMenu(menuID,
     2617                  menuTitle);
     2618    _res = Py_BuildValue("O&",
     2619                         MenuObj_New, _rv);
     2620    return _res;
    26212621}
    26222622
    26232623static PyObject *Menu_MacGetMenu(PyObject *_self, PyObject *_args)
    26242624{
    2625         PyObject *_res = NULL;
    2626         MenuHandle _rv;
    2627         short resourceID;
     2625    PyObject *_res = NULL;
     2626    MenuHandle _rv;
     2627    short resourceID;
    26282628#ifndef MacGetMenu
    2629         PyMac_PRECHECK(MacGetMenu);
    2630 #endif
    2631         if (!PyArg_ParseTuple(_args, "h",
    2632                               &resourceID))
    2633                 return NULL;
    2634         _rv = MacGetMenu(resourceID);
    2635         _res = Py_BuildValue("O&",
    2636                              MenuObj_New, _rv);
    2637         return _res;
     2629    PyMac_PRECHECK(MacGetMenu);
     2630#endif
     2631    if (!PyArg_ParseTuple(_args, "h",
     2632                          &resourceID))
     2633        return NULL;
     2634    _rv = MacGetMenu(resourceID);
     2635    _res = Py_BuildValue("O&",
     2636                         MenuObj_New, _rv);
     2637    return _res;
    26382638}
    26392639
    26402640static PyObject *Menu_CreateNewMenu(PyObject *_self, PyObject *_args)
    26412641{
    2642         PyObject *_res = NULL;
    2643         OSStatus _err;
    2644         MenuID inMenuID;
    2645         MenuAttributes inMenuAttributes;
    2646         MenuHandle outMenuRef;
     2642    PyObject *_res = NULL;
     2643    OSStatus _err;
     2644    MenuID inMenuID;
     2645    MenuAttributes inMenuAttributes;
     2646    MenuHandle outMenuRef;
    26472647#ifndef CreateNewMenu
    2648         PyMac_PRECHECK(CreateNewMenu);
    2649 #endif
    2650         if (!PyArg_ParseTuple(_args, "hl",
    2651                               &inMenuID,
    2652                               &inMenuAttributes))
    2653                 return NULL;
    2654         _err = CreateNewMenu(inMenuID,
    2655                              inMenuAttributes,
    2656                              &outMenuRef);
    2657         if (_err != noErr) return PyMac_Error(_err);
    2658         _res = Py_BuildValue("O&",
    2659                              MenuObj_New, outMenuRef);
    2660         return _res;
     2648    PyMac_PRECHECK(CreateNewMenu);
     2649#endif
     2650    if (!PyArg_ParseTuple(_args, "hl",
     2651                          &inMenuID,
     2652                          &inMenuAttributes))
     2653        return NULL;
     2654    _err = CreateNewMenu(inMenuID,
     2655                         inMenuAttributes,
     2656                         &outMenuRef);
     2657    if (_err != noErr) return PyMac_Error(_err);
     2658    _res = Py_BuildValue("O&",
     2659                         MenuObj_New, outMenuRef);
     2660    return _res;
    26612661}
    26622662
    26632663static PyObject *Menu_MenuKey(PyObject *_self, PyObject *_args)
    26642664{
    2665         PyObject *_res = NULL;
    2666         long _rv;
    2667         CharParameter ch;
     2665    PyObject *_res = NULL;
     2666    long _rv;
     2667    CharParameter ch;
    26682668#ifndef MenuKey
    2669         PyMac_PRECHECK(MenuKey);
    2670 #endif
    2671         if (!PyArg_ParseTuple(_args, "h",
    2672                               &ch))
    2673                 return NULL;
    2674         _rv = MenuKey(ch);
    2675         _res = Py_BuildValue("l",
    2676                              _rv);
    2677         return _res;
     2669    PyMac_PRECHECK(MenuKey);
     2670#endif
     2671    if (!PyArg_ParseTuple(_args, "h",
     2672                          &ch))
     2673        return NULL;
     2674    _rv = MenuKey(ch);
     2675    _res = Py_BuildValue("l",
     2676                         _rv);
     2677    return _res;
    26782678}
    26792679
    26802680static PyObject *Menu_MenuSelect(PyObject *_self, PyObject *_args)
    26812681{
    2682         PyObject *_res = NULL;
    2683         long _rv;
    2684         Point startPt;
     2682    PyObject *_res = NULL;
     2683    long _rv;
     2684    Point startPt;
    26852685#ifndef MenuSelect
    2686         PyMac_PRECHECK(MenuSelect);
    2687 #endif
    2688         if (!PyArg_ParseTuple(_args, "O&",
    2689                               PyMac_GetPoint, &startPt))
    2690                 return NULL;
    2691         _rv = MenuSelect(startPt);
    2692         _res = Py_BuildValue("l",
    2693                              _rv);
    2694         return _res;
     2686    PyMac_PRECHECK(MenuSelect);
     2687#endif
     2688    if (!PyArg_ParseTuple(_args, "O&",
     2689                          PyMac_GetPoint, &startPt))
     2690        return NULL;
     2691    _rv = MenuSelect(startPt);
     2692    _res = Py_BuildValue("l",
     2693                         _rv);
     2694    return _res;
    26952695}
    26962696
    26972697static PyObject *Menu_MenuChoice(PyObject *_self, PyObject *_args)
    26982698{
    2699         PyObject *_res = NULL;
    2700         long _rv;
     2699    PyObject *_res = NULL;
     2700    long _rv;
    27012701#ifndef MenuChoice
    2702         PyMac_PRECHECK(MenuChoice);
    2703 #endif
    2704         if (!PyArg_ParseTuple(_args, ""))
    2705                 return NULL;
    2706         _rv = MenuChoice();
    2707         _res = Py_BuildValue("l",
    2708                              _rv);
    2709         return _res;
     2702    PyMac_PRECHECK(MenuChoice);
     2703#endif
     2704    if (!PyArg_ParseTuple(_args, ""))
     2705        return NULL;
     2706    _rv = MenuChoice();
     2707    _res = Py_BuildValue("l",
     2708                         _rv);
     2709    return _res;
    27102710}
    27112711
    27122712static PyObject *Menu_MenuEvent(PyObject *_self, PyObject *_args)
    27132713{
    2714         PyObject *_res = NULL;
    2715         UInt32 _rv;
    2716         EventRecord inEvent;
     2714    PyObject *_res = NULL;
     2715    UInt32 _rv;
     2716    EventRecord inEvent;
    27172717#ifndef MenuEvent
    2718         PyMac_PRECHECK(MenuEvent);
    2719 #endif
    2720         if (!PyArg_ParseTuple(_args, "O&",
    2721                               PyMac_GetEventRecord, &inEvent))
    2722                 return NULL;
    2723         _rv = MenuEvent(&inEvent);
    2724         _res = Py_BuildValue("l",
    2725                              _rv);
    2726         return _res;
     2718    PyMac_PRECHECK(MenuEvent);
     2719#endif
     2720    if (!PyArg_ParseTuple(_args, "O&",
     2721                          PyMac_GetEventRecord, &inEvent))
     2722        return NULL;
     2723    _rv = MenuEvent(&inEvent);
     2724    _res = Py_BuildValue("l",
     2725                         _rv);
     2726    return _res;
    27272727}
    27282728
    27292729static PyObject *Menu_GetMBarHeight(PyObject *_self, PyObject *_args)
    27302730{
    2731         PyObject *_res = NULL;
    2732         short _rv;
     2731    PyObject *_res = NULL;
     2732    short _rv;
    27332733#ifndef GetMBarHeight
    2734         PyMac_PRECHECK(GetMBarHeight);
    2735 #endif
    2736         if (!PyArg_ParseTuple(_args, ""))
    2737                 return NULL;
    2738         _rv = GetMBarHeight();
    2739         _res = Py_BuildValue("h",
    2740                              _rv);
    2741         return _res;
     2734    PyMac_PRECHECK(GetMBarHeight);
     2735#endif
     2736    if (!PyArg_ParseTuple(_args, ""))
     2737        return NULL;
     2738    _rv = GetMBarHeight();
     2739    _res = Py_BuildValue("h",
     2740                         _rv);
     2741    return _res;
    27422742}
    27432743
    27442744static PyObject *Menu_MacDrawMenuBar(PyObject *_self, PyObject *_args)
    27452745{
    2746         PyObject *_res = NULL;
     2746    PyObject *_res = NULL;
    27472747#ifndef MacDrawMenuBar
    2748         PyMac_PRECHECK(MacDrawMenuBar);
    2749 #endif
    2750         if (!PyArg_ParseTuple(_args, ""))
    2751                 return NULL;
    2752         MacDrawMenuBar();
    2753         Py_INCREF(Py_None);
    2754         _res = Py_None;
    2755         return _res;
     2748    PyMac_PRECHECK(MacDrawMenuBar);
     2749#endif
     2750    if (!PyArg_ParseTuple(_args, ""))
     2751        return NULL;
     2752    MacDrawMenuBar();
     2753    Py_INCREF(Py_None);
     2754    _res = Py_None;
     2755    return _res;
    27562756}
    27572757
    27582758static PyObject *Menu_InvalMenuBar(PyObject *_self, PyObject *_args)
    27592759{
    2760         PyObject *_res = NULL;
     2760    PyObject *_res = NULL;
    27612761#ifndef InvalMenuBar
    2762         PyMac_PRECHECK(InvalMenuBar);
    2763 #endif
    2764         if (!PyArg_ParseTuple(_args, ""))
    2765                 return NULL;
    2766         InvalMenuBar();
    2767         Py_INCREF(Py_None);
    2768         _res = Py_None;
    2769         return _res;
     2762    PyMac_PRECHECK(InvalMenuBar);
     2763#endif
     2764    if (!PyArg_ParseTuple(_args, ""))
     2765        return NULL;
     2766    InvalMenuBar();
     2767    Py_INCREF(Py_None);
     2768    _res = Py_None;
     2769    return _res;
    27702770}
    27712771
    27722772static PyObject *Menu_HiliteMenu(PyObject *_self, PyObject *_args)
    27732773{
    2774         PyObject *_res = NULL;
    2775         MenuID menuID;
     2774    PyObject *_res = NULL;
     2775    MenuID menuID;
    27762776#ifndef HiliteMenu
    2777         PyMac_PRECHECK(HiliteMenu);
    2778 #endif
    2779         if (!PyArg_ParseTuple(_args, "h",
    2780                               &menuID))
    2781                 return NULL;
    2782         HiliteMenu(menuID);
    2783         Py_INCREF(Py_None);
    2784         _res = Py_None;
    2785         return _res;
     2777    PyMac_PRECHECK(HiliteMenu);
     2778#endif
     2779    if (!PyArg_ParseTuple(_args, "h",
     2780                          &menuID))
     2781        return NULL;
     2782    HiliteMenu(menuID);
     2783    Py_INCREF(Py_None);
     2784    _res = Py_None;
     2785    return _res;
    27862786}
    27872787
    27882788static PyObject *Menu_GetNewMBar(PyObject *_self, PyObject *_args)
    27892789{
    2790         PyObject *_res = NULL;
    2791         MenuBarHandle _rv;
    2792         short menuBarID;
     2790    PyObject *_res = NULL;
     2791    MenuBarHandle _rv;
     2792    short menuBarID;
    27932793#ifndef GetNewMBar
    2794         PyMac_PRECHECK(GetNewMBar);
    2795 #endif
    2796         if (!PyArg_ParseTuple(_args, "h",
    2797                               &menuBarID))
    2798                 return NULL;
    2799         _rv = GetNewMBar(menuBarID);
    2800         _res = Py_BuildValue("O&",
    2801                              ResObj_New, _rv);
    2802         return _res;
     2794    PyMac_PRECHECK(GetNewMBar);
     2795#endif
     2796    if (!PyArg_ParseTuple(_args, "h",
     2797                          &menuBarID))
     2798        return NULL;
     2799    _rv = GetNewMBar(menuBarID);
     2800    _res = Py_BuildValue("O&",
     2801                         ResObj_New, _rv);
     2802    return _res;
    28032803}
    28042804
    28052805static PyObject *Menu_GetMenuBar(PyObject *_self, PyObject *_args)
    28062806{
    2807         PyObject *_res = NULL;
    2808         MenuBarHandle _rv;
     2807    PyObject *_res = NULL;
     2808    MenuBarHandle _rv;
    28092809#ifndef GetMenuBar
    2810         PyMac_PRECHECK(GetMenuBar);
    2811 #endif
    2812         if (!PyArg_ParseTuple(_args, ""))
    2813                 return NULL;
    2814         _rv = GetMenuBar();
    2815         _res = Py_BuildValue("O&",
    2816                              ResObj_New, _rv);
    2817         return _res;
     2810    PyMac_PRECHECK(GetMenuBar);
     2811#endif
     2812    if (!PyArg_ParseTuple(_args, ""))
     2813        return NULL;
     2814    _rv = GetMenuBar();
     2815    _res = Py_BuildValue("O&",
     2816                         ResObj_New, _rv);
     2817    return _res;
    28182818}
    28192819
    28202820static PyObject *Menu_SetMenuBar(PyObject *_self, PyObject *_args)
    28212821{
    2822         PyObject *_res = NULL;
    2823         MenuBarHandle mbar;
     2822    PyObject *_res = NULL;
     2823    MenuBarHandle mbar;
    28242824#ifndef SetMenuBar
    2825         PyMac_PRECHECK(SetMenuBar);
    2826 #endif
    2827         if (!PyArg_ParseTuple(_args, "O&",
    2828                               ResObj_Convert, &mbar))
    2829                 return NULL;
    2830         SetMenuBar(mbar);
    2831         Py_INCREF(Py_None);
    2832         _res = Py_None;
    2833         return _res;
     2825    PyMac_PRECHECK(SetMenuBar);
     2826#endif
     2827    if (!PyArg_ParseTuple(_args, "O&",
     2828                          ResObj_Convert, &mbar))
     2829        return NULL;
     2830    SetMenuBar(mbar);
     2831    Py_INCREF(Py_None);
     2832    _res = Py_None;
     2833    return _res;
    28342834}
    28352835
    28362836static PyObject *Menu_DuplicateMenuBar(PyObject *_self, PyObject *_args)
    28372837{
    2838         PyObject *_res = NULL;
    2839         OSStatus _err;
    2840         MenuBarHandle inMbar;
    2841         MenuBarHandle outMbar;
     2838    PyObject *_res = NULL;
     2839    OSStatus _err;
     2840    MenuBarHandle inMbar;
     2841    MenuBarHandle outMbar;
    28422842#ifndef DuplicateMenuBar
    2843         PyMac_PRECHECK(DuplicateMenuBar);
    2844 #endif
    2845         if (!PyArg_ParseTuple(_args, "O&",
    2846                               ResObj_Convert, &inMbar))
    2847                 return NULL;
    2848         _err = DuplicateMenuBar(inMbar,
    2849                                 &outMbar);
    2850         if (_err != noErr) return PyMac_Error(_err);
    2851         _res = Py_BuildValue("O&",
    2852                              ResObj_New, outMbar);
    2853         return _res;
     2843    PyMac_PRECHECK(DuplicateMenuBar);
     2844#endif
     2845    if (!PyArg_ParseTuple(_args, "O&",
     2846                          ResObj_Convert, &inMbar))
     2847        return NULL;
     2848    _err = DuplicateMenuBar(inMbar,
     2849                            &outMbar);
     2850    if (_err != noErr) return PyMac_Error(_err);
     2851    _res = Py_BuildValue("O&",
     2852                         ResObj_New, outMbar);
     2853    return _res;
    28542854}
    28552855
    28562856static PyObject *Menu_DisposeMenuBar(PyObject *_self, PyObject *_args)
    28572857{
    2858         PyObject *_res = NULL;
    2859         OSStatus _err;
    2860         MenuBarHandle inMbar;
     2858    PyObject *_res = NULL;
     2859    OSStatus _err;
     2860    MenuBarHandle inMbar;
    28612861#ifndef DisposeMenuBar
    2862         PyMac_PRECHECK(DisposeMenuBar);
    2863 #endif
    2864         if (!PyArg_ParseTuple(_args, "O&",
    2865                               ResObj_Convert, &inMbar))
    2866                 return NULL;
    2867         _err = DisposeMenuBar(inMbar);
    2868         if (_err != noErr) return PyMac_Error(_err);
    2869         Py_INCREF(Py_None);
    2870         _res = Py_None;
    2871         return _res;
     2862    PyMac_PRECHECK(DisposeMenuBar);
     2863#endif
     2864    if (!PyArg_ParseTuple(_args, "O&",
     2865                          ResObj_Convert, &inMbar))
     2866        return NULL;
     2867    _err = DisposeMenuBar(inMbar);
     2868    if (_err != noErr) return PyMac_Error(_err);
     2869    Py_INCREF(Py_None);
     2870    _res = Py_None;
     2871    return _res;
    28722872}
    28732873
    28742874static PyObject *Menu_GetMenuHandle(PyObject *_self, PyObject *_args)
    28752875{
    2876         PyObject *_res = NULL;
    2877         MenuHandle _rv;
    2878         MenuID menuID;
     2876    PyObject *_res = NULL;
     2877    MenuHandle _rv;
     2878    MenuID menuID;
    28792879#ifndef GetMenuHandle
    2880         PyMac_PRECHECK(GetMenuHandle);
    2881 #endif
    2882         if (!PyArg_ParseTuple(_args, "h",
    2883                               &menuID))
    2884                 return NULL;
    2885         _rv = GetMenuHandle(menuID);
    2886         _res = Py_BuildValue("O&",
    2887                              MenuObj_New, _rv);
    2888         return _res;
     2880    PyMac_PRECHECK(GetMenuHandle);
     2881#endif
     2882    if (!PyArg_ParseTuple(_args, "h",
     2883                          &menuID))
     2884        return NULL;
     2885    _rv = GetMenuHandle(menuID);
     2886    _res = Py_BuildValue("O&",
     2887                         MenuObj_New, _rv);
     2888    return _res;
    28892889}
    28902890
    28912891static PyObject *Menu_MacDeleteMenu(PyObject *_self, PyObject *_args)
    28922892{
    2893         PyObject *_res = NULL;
    2894         MenuID menuID;
     2893    PyObject *_res = NULL;
     2894    MenuID menuID;
    28952895#ifndef MacDeleteMenu
    2896         PyMac_PRECHECK(MacDeleteMenu);
    2897 #endif
    2898         if (!PyArg_ParseTuple(_args, "h",
    2899                               &menuID))
    2900                 return NULL;
    2901         MacDeleteMenu(menuID);
    2902         Py_INCREF(Py_None);
    2903         _res = Py_None;
    2904         return _res;
     2896    PyMac_PRECHECK(MacDeleteMenu);
     2897#endif
     2898    if (!PyArg_ParseTuple(_args, "h",
     2899                          &menuID))
     2900        return NULL;
     2901    MacDeleteMenu(menuID);
     2902    Py_INCREF(Py_None);
     2903    _res = Py_None;
     2904    return _res;
    29052905}
    29062906
    29072907static PyObject *Menu_ClearMenuBar(PyObject *_self, PyObject *_args)
    29082908{
    2909         PyObject *_res = NULL;
     2909    PyObject *_res = NULL;
    29102910#ifndef ClearMenuBar
    2911         PyMac_PRECHECK(ClearMenuBar);
    2912 #endif
    2913         if (!PyArg_ParseTuple(_args, ""))
    2914                 return NULL;
    2915         ClearMenuBar();
    2916         Py_INCREF(Py_None);
    2917         _res = Py_None;
    2918         return _res;
     2911    PyMac_PRECHECK(ClearMenuBar);
     2912#endif
     2913    if (!PyArg_ParseTuple(_args, ""))
     2914        return NULL;
     2915    ClearMenuBar();
     2916    Py_INCREF(Py_None);
     2917    _res = Py_None;
     2918    return _res;
    29192919}
    29202920
    29212921static PyObject *Menu_SetMenuFlashCount(PyObject *_self, PyObject *_args)
    29222922{
    2923         PyObject *_res = NULL;
    2924         short count;
     2923    PyObject *_res = NULL;
     2924    short count;
    29252925#ifndef SetMenuFlashCount
    2926         PyMac_PRECHECK(SetMenuFlashCount);
    2927 #endif
    2928         if (!PyArg_ParseTuple(_args, "h",
    2929                               &count))
    2930                 return NULL;
    2931         SetMenuFlashCount(count);
    2932         Py_INCREF(Py_None);
    2933         _res = Py_None;
    2934         return _res;
     2926    PyMac_PRECHECK(SetMenuFlashCount);
     2927#endif
     2928    if (!PyArg_ParseTuple(_args, "h",
     2929                          &count))
     2930        return NULL;
     2931    SetMenuFlashCount(count);
     2932    Py_INCREF(Py_None);
     2933    _res = Py_None;
     2934    return _res;
    29352935}
    29362936
    29372937static PyObject *Menu_FlashMenuBar(PyObject *_self, PyObject *_args)
    29382938{
    2939         PyObject *_res = NULL;
    2940         MenuID menuID;
     2939    PyObject *_res = NULL;
     2940    MenuID menuID;
    29412941#ifndef FlashMenuBar
    2942         PyMac_PRECHECK(FlashMenuBar);
    2943 #endif
    2944         if (!PyArg_ParseTuple(_args, "h",
    2945                               &menuID))
    2946                 return NULL;
    2947         FlashMenuBar(menuID);
    2948         Py_INCREF(Py_None);
    2949         _res = Py_None;
    2950         return _res;
     2942    PyMac_PRECHECK(FlashMenuBar);
     2943#endif
     2944    if (!PyArg_ParseTuple(_args, "h",
     2945                          &menuID))
     2946        return NULL;
     2947    FlashMenuBar(menuID);
     2948    Py_INCREF(Py_None);
     2949    _res = Py_None;
     2950    return _res;
    29512951}
    29522952
    29532953static PyObject *Menu_IsMenuBarVisible(PyObject *_self, PyObject *_args)
    29542954{
    2955         PyObject *_res = NULL;
    2956         Boolean _rv;
     2955    PyObject *_res = NULL;
     2956    Boolean _rv;
    29572957#ifndef IsMenuBarVisible
    2958         PyMac_PRECHECK(IsMenuBarVisible);
    2959 #endif
    2960         if (!PyArg_ParseTuple(_args, ""))
    2961                 return NULL;
    2962         _rv = IsMenuBarVisible();
    2963         _res = Py_BuildValue("b",
    2964                              _rv);
    2965         return _res;
     2958    PyMac_PRECHECK(IsMenuBarVisible);
     2959#endif
     2960    if (!PyArg_ParseTuple(_args, ""))
     2961        return NULL;
     2962    _rv = IsMenuBarVisible();
     2963    _res = Py_BuildValue("b",
     2964                         _rv);
     2965    return _res;
    29662966}
    29672967
    29682968static PyObject *Menu_ShowMenuBar(PyObject *_self, PyObject *_args)
    29692969{
    2970         PyObject *_res = NULL;
     2970    PyObject *_res = NULL;
    29712971#ifndef ShowMenuBar
    2972         PyMac_PRECHECK(ShowMenuBar);
    2973 #endif
    2974         if (!PyArg_ParseTuple(_args, ""))
    2975                 return NULL;
    2976         ShowMenuBar();
    2977         Py_INCREF(Py_None);
    2978         _res = Py_None;
    2979         return _res;
     2972    PyMac_PRECHECK(ShowMenuBar);
     2973#endif
     2974    if (!PyArg_ParseTuple(_args, ""))
     2975        return NULL;
     2976    ShowMenuBar();
     2977    Py_INCREF(Py_None);
     2978    _res = Py_None;
     2979    return _res;
    29802980}
    29812981
    29822982static PyObject *Menu_HideMenuBar(PyObject *_self, PyObject *_args)
    29832983{
    2984         PyObject *_res = NULL;
     2984    PyObject *_res = NULL;
    29852985#ifndef HideMenuBar
    2986         PyMac_PRECHECK(HideMenuBar);
    2987 #endif
    2988         if (!PyArg_ParseTuple(_args, ""))
    2989                 return NULL;
    2990         HideMenuBar();
    2991         Py_INCREF(Py_None);
    2992         _res = Py_None;
    2993         return _res;
     2986    PyMac_PRECHECK(HideMenuBar);
     2987#endif
     2988    if (!PyArg_ParseTuple(_args, ""))
     2989        return NULL;
     2990    HideMenuBar();
     2991    Py_INCREF(Py_None);
     2992    _res = Py_None;
     2993    return _res;
    29942994}
    29952995
    29962996static PyObject *Menu_AcquireRootMenu(PyObject *_self, PyObject *_args)
    29972997{
    2998         PyObject *_res = NULL;
    2999         MenuHandle _rv;
     2998    PyObject *_res = NULL;
     2999    MenuHandle _rv;
    30003000#ifndef AcquireRootMenu
    3001         PyMac_PRECHECK(AcquireRootMenu);
    3002 #endif
    3003         if (!PyArg_ParseTuple(_args, ""))
    3004                 return NULL;
    3005         _rv = AcquireRootMenu();
    3006         _res = Py_BuildValue("O&",
    3007                              MenuObj_New, _rv);
    3008         return _res;
     3001    PyMac_PRECHECK(AcquireRootMenu);
     3002#endif
     3003    if (!PyArg_ParseTuple(_args, ""))
     3004        return NULL;
     3005    _rv = AcquireRootMenu();
     3006    _res = Py_BuildValue("O&",
     3007                         MenuObj_New, _rv);
     3008    return _res;
    30093009}
    30103010
    30113011static PyObject *Menu_DeleteMCEntries(PyObject *_self, PyObject *_args)
    30123012{
    3013         PyObject *_res = NULL;
    3014         MenuID menuID;
    3015         short menuItem;
     3013    PyObject *_res = NULL;
     3014    MenuID menuID;
     3015    short menuItem;
    30163016#ifndef DeleteMCEntries
    3017         PyMac_PRECHECK(DeleteMCEntries);
    3018 #endif
    3019         if (!PyArg_ParseTuple(_args, "hh",
    3020                               &menuID,
    3021                               &menuItem))
    3022                 return NULL;
    3023         DeleteMCEntries(menuID,
    3024                         menuItem);
    3025         Py_INCREF(Py_None);
    3026         _res = Py_None;
    3027         return _res;
     3017    PyMac_PRECHECK(DeleteMCEntries);
     3018#endif
     3019    if (!PyArg_ParseTuple(_args, "hh",
     3020                          &menuID,
     3021                          &menuItem))
     3022        return NULL;
     3023    DeleteMCEntries(menuID,
     3024                    menuItem);
     3025    Py_INCREF(Py_None);
     3026    _res = Py_None;
     3027    return _res;
    30283028}
    30293029
    30303030static PyObject *Menu_InitContextualMenus(PyObject *_self, PyObject *_args)
    30313031{
    3032         PyObject *_res = NULL;
    3033         OSStatus _err;
     3032    PyObject *_res = NULL;
     3033    OSStatus _err;
    30343034#ifndef InitContextualMenus
    3035         PyMac_PRECHECK(InitContextualMenus);
    3036 #endif
    3037         if (!PyArg_ParseTuple(_args, ""))
    3038                 return NULL;
    3039         _err = InitContextualMenus();
    3040         if (_err != noErr) return PyMac_Error(_err);
    3041         Py_INCREF(Py_None);
    3042         _res = Py_None;
    3043         return _res;
     3035    PyMac_PRECHECK(InitContextualMenus);
     3036#endif
     3037    if (!PyArg_ParseTuple(_args, ""))
     3038        return NULL;
     3039    _err = InitContextualMenus();
     3040    if (_err != noErr) return PyMac_Error(_err);
     3041    Py_INCREF(Py_None);
     3042    _res = Py_None;
     3043    return _res;
    30443044}
    30453045
    30463046static PyObject *Menu_IsShowContextualMenuClick(PyObject *_self, PyObject *_args)
    30473047{
    3048         PyObject *_res = NULL;
    3049         Boolean _rv;
    3050         EventRecord inEvent;
     3048    PyObject *_res = NULL;
     3049    Boolean _rv;
     3050    EventRecord inEvent;
    30513051#ifndef IsShowContextualMenuClick
    3052         PyMac_PRECHECK(IsShowContextualMenuClick);
    3053 #endif
    3054         if (!PyArg_ParseTuple(_args, "O&",
    3055                               PyMac_GetEventRecord, &inEvent))
    3056                 return NULL;
    3057         _rv = IsShowContextualMenuClick(&inEvent);
    3058         _res = Py_BuildValue("b",
    3059                              _rv);
    3060         return _res;
     3052    PyMac_PRECHECK(IsShowContextualMenuClick);
     3053#endif
     3054    if (!PyArg_ParseTuple(_args, "O&",
     3055                          PyMac_GetEventRecord, &inEvent))
     3056        return NULL;
     3057    _rv = IsShowContextualMenuClick(&inEvent);
     3058    _res = Py_BuildValue("b",
     3059                         _rv);
     3060    return _res;
    30613061}
    30623062
    30633063static PyObject *Menu_LMGetTheMenu(PyObject *_self, PyObject *_args)
    30643064{
    3065         PyObject *_res = NULL;
    3066         SInt16 _rv;
     3065    PyObject *_res = NULL;
     3066    SInt16 _rv;
    30673067#ifndef LMGetTheMenu
    3068         PyMac_PRECHECK(LMGetTheMenu);
    3069 #endif
    3070         if (!PyArg_ParseTuple(_args, ""))
    3071                 return NULL;
    3072         _rv = LMGetTheMenu();
    3073         _res = Py_BuildValue("h",
    3074                              _rv);
    3075         return _res;
     3068    PyMac_PRECHECK(LMGetTheMenu);
     3069#endif
     3070    if (!PyArg_ParseTuple(_args, ""))
     3071        return NULL;
     3072    _rv = LMGetTheMenu();
     3073    _res = Py_BuildValue("h",
     3074                         _rv);
     3075    return _res;
    30763076}
    30773077
    30783078static PyObject *Menu_as_Menu(PyObject *_self, PyObject *_args)
    30793079{
    3080         PyObject *_res = NULL;
    3081         MenuHandle _rv;
    3082         Handle h;
     3080    PyObject *_res = NULL;
     3081    MenuHandle _rv;
     3082    Handle h;
    30833083#ifndef as_Menu
    3084         PyMac_PRECHECK(as_Menu);
    3085 #endif
    3086         if (!PyArg_ParseTuple(_args, "O&",
    3087                               ResObj_Convert, &h))
    3088                 return NULL;
    3089         _rv = as_Menu(h);
    3090         _res = Py_BuildValue("O&",
    3091                              MenuObj_New, _rv);
    3092         return _res;
     3084    PyMac_PRECHECK(as_Menu);
     3085#endif
     3086    if (!PyArg_ParseTuple(_args, "O&",
     3087                          ResObj_Convert, &h))
     3088        return NULL;
     3089    _rv = as_Menu(h);
     3090    _res = Py_BuildValue("O&",
     3091                         MenuObj_New, _rv);
     3092    return _res;
    30933093}
    30943094
    30953095static PyObject *Menu_GetMenu(PyObject *_self, PyObject *_args)
    30963096{
    3097         PyObject *_res = NULL;
    3098         MenuHandle _rv;
    3099         short resourceID;
     3097    PyObject *_res = NULL;
     3098    MenuHandle _rv;
     3099    short resourceID;
    31003100#ifndef GetMenu
    3101         PyMac_PRECHECK(GetMenu);
    3102 #endif
    3103         if (!PyArg_ParseTuple(_args, "h",
    3104                               &resourceID))
    3105                 return NULL;
    3106         _rv = GetMenu(resourceID);
    3107         _res = Py_BuildValue("O&",
    3108                              MenuObj_New, _rv);
    3109         return _res;
     3101    PyMac_PRECHECK(GetMenu);
     3102#endif
     3103    if (!PyArg_ParseTuple(_args, "h",
     3104                          &resourceID))
     3105        return NULL;
     3106    _rv = GetMenu(resourceID);
     3107    _res = Py_BuildValue("O&",
     3108                         MenuObj_New, _rv);
     3109    return _res;
    31103110}
    31113111
    31123112static PyObject *Menu_DeleteMenu(PyObject *_self, PyObject *_args)
    31133113{
    3114         PyObject *_res = NULL;
    3115         short menuID;
     3114    PyObject *_res = NULL;
     3115    short menuID;
    31163116#ifndef DeleteMenu
    3117         PyMac_PRECHECK(DeleteMenu);
    3118 #endif
    3119         if (!PyArg_ParseTuple(_args, "h",
    3120                               &menuID))
    3121                 return NULL;
    3122         DeleteMenu(menuID);
    3123         Py_INCREF(Py_None);
    3124         _res = Py_None;
    3125         return _res;
     3117    PyMac_PRECHECK(DeleteMenu);
     3118#endif
     3119    if (!PyArg_ParseTuple(_args, "h",
     3120                          &menuID))
     3121        return NULL;
     3122    DeleteMenu(menuID);
     3123    Py_INCREF(Py_None);
     3124    _res = Py_None;
     3125    return _res;
    31263126}
    31273127
    31283128static PyObject *Menu_DrawMenuBar(PyObject *_self, PyObject *_args)
    31293129{
    3130         PyObject *_res = NULL;
     3130    PyObject *_res = NULL;
    31313131#ifndef DrawMenuBar
    3132         PyMac_PRECHECK(DrawMenuBar);
    3133 #endif
    3134         if (!PyArg_ParseTuple(_args, ""))
    3135                 return NULL;
    3136         DrawMenuBar();
    3137         Py_INCREF(Py_None);
    3138         _res = Py_None;
    3139         return _res;
     3132    PyMac_PRECHECK(DrawMenuBar);
     3133#endif
     3134    if (!PyArg_ParseTuple(_args, ""))
     3135        return NULL;
     3136    DrawMenuBar();
     3137    Py_INCREF(Py_None);
     3138    _res = Py_None;
     3139    return _res;
    31403140}
    31413141
    31423142static PyObject *Menu_CountMenuItemsWithCommandID(PyObject *_self, PyObject *_args)
    31433143{
    3144         PyObject *_res = NULL;
    3145         ItemCount _rv;
    3146         MenuHandle inMenu;
    3147         MenuCommand inCommandID;
     3144    PyObject *_res = NULL;
     3145    ItemCount _rv;
     3146    MenuHandle inMenu;
     3147    MenuCommand inCommandID;
    31483148#ifndef CountMenuItemsWithCommandID
    3149         PyMac_PRECHECK(CountMenuItemsWithCommandID);
    3150 #endif
    3151         if (!PyArg_ParseTuple(_args, "O&l",
    3152                               OptMenuObj_Convert, &inMenu,
    3153                               &inCommandID))
    3154                 return NULL;
    3155         _rv = CountMenuItemsWithCommandID(inMenu,
    3156                                           inCommandID);
    3157         _res = Py_BuildValue("l",
    3158                              _rv);
    3159         return _res;
     3149    PyMac_PRECHECK(CountMenuItemsWithCommandID);
     3150#endif
     3151    if (!PyArg_ParseTuple(_args, "O&l",
     3152                          OptMenuObj_Convert, &inMenu,
     3153                          &inCommandID))
     3154        return NULL;
     3155    _rv = CountMenuItemsWithCommandID(inMenu,
     3156                                      inCommandID);
     3157    _res = Py_BuildValue("l",
     3158                         _rv);
     3159    return _res;
    31603160}
    31613161
    31623162static PyObject *Menu_GetIndMenuItemWithCommandID(PyObject *_self, PyObject *_args)
    31633163{
    3164         PyObject *_res = NULL;
    3165         OSStatus _err;
    3166         MenuHandle inMenu;
    3167         MenuCommand inCommandID;
    3168         UInt32 inItemIndex;
    3169         MenuHandle outMenu;
    3170         MenuItemIndex outIndex;
     3164    PyObject *_res = NULL;
     3165    OSStatus _err;
     3166    MenuHandle inMenu;
     3167    MenuCommand inCommandID;
     3168    UInt32 inItemIndex;
     3169    MenuHandle outMenu;
     3170    MenuItemIndex outIndex;
    31713171#ifndef GetIndMenuItemWithCommandID
    3172         PyMac_PRECHECK(GetIndMenuItemWithCommandID);
    3173 #endif
    3174         if (!PyArg_ParseTuple(_args, "O&ll",
    3175                               OptMenuObj_Convert, &inMenu,
    3176                               &inCommandID,
    3177                               &inItemIndex))
    3178                 return NULL;
    3179         _err = GetIndMenuItemWithCommandID(inMenu,
    3180                                            inCommandID,
    3181                                            inItemIndex,
    3182                                            &outMenu,
    3183                                            &outIndex);
    3184         if (_err != noErr) return PyMac_Error(_err);
    3185         _res = Py_BuildValue("O&h",
    3186                              MenuObj_New, outMenu,
    3187                              outIndex);
    3188         return _res;
     3172    PyMac_PRECHECK(GetIndMenuItemWithCommandID);
     3173#endif
     3174    if (!PyArg_ParseTuple(_args, "O&ll",
     3175                          OptMenuObj_Convert, &inMenu,
     3176                          &inCommandID,
     3177                          &inItemIndex))
     3178        return NULL;
     3179    _err = GetIndMenuItemWithCommandID(inMenu,
     3180                                       inCommandID,
     3181                                       inItemIndex,
     3182                                       &outMenu,
     3183                                       &outIndex);
     3184    if (_err != noErr) return PyMac_Error(_err);
     3185    _res = Py_BuildValue("O&h",
     3186                         MenuObj_New, outMenu,
     3187                         outIndex);
     3188    return _res;
    31893189}
    31903190
    31913191static PyObject *Menu_EnableMenuCommand(PyObject *_self, PyObject *_args)
    31923192{
    3193         PyObject *_res = NULL;
    3194         MenuHandle inMenu;
    3195         MenuCommand inCommandID;
     3193    PyObject *_res = NULL;
     3194    MenuHandle inMenu;
     3195    MenuCommand inCommandID;
    31963196#ifndef EnableMenuCommand
    3197         PyMac_PRECHECK(EnableMenuCommand);
    3198 #endif
    3199         if (!PyArg_ParseTuple(_args, "O&l",
    3200                               OptMenuObj_Convert, &inMenu,
    3201                               &inCommandID))
    3202                 return NULL;
    3203         EnableMenuCommand(inMenu,
    3204                           inCommandID);
    3205         Py_INCREF(Py_None);
    3206         _res = Py_None;
    3207         return _res;
     3197    PyMac_PRECHECK(EnableMenuCommand);
     3198#endif
     3199    if (!PyArg_ParseTuple(_args, "O&l",
     3200                          OptMenuObj_Convert, &inMenu,
     3201                          &inCommandID))
     3202        return NULL;
     3203    EnableMenuCommand(inMenu,
     3204                      inCommandID);
     3205    Py_INCREF(Py_None);
     3206    _res = Py_None;
     3207    return _res;
    32083208}
    32093209
    32103210static PyObject *Menu_DisableMenuCommand(PyObject *_self, PyObject *_args)
    32113211{
    3212         PyObject *_res = NULL;
    3213         MenuHandle inMenu;
    3214         MenuCommand inCommandID;
     3212    PyObject *_res = NULL;
     3213    MenuHandle inMenu;
     3214    MenuCommand inCommandID;
    32153215#ifndef DisableMenuCommand
    3216         PyMac_PRECHECK(DisableMenuCommand);
    3217 #endif
    3218         if (!PyArg_ParseTuple(_args, "O&l",
    3219                               OptMenuObj_Convert, &inMenu,
    3220                               &inCommandID))
    3221                 return NULL;
    3222         DisableMenuCommand(inMenu,
    3223                            inCommandID);
    3224         Py_INCREF(Py_None);
    3225         _res = Py_None;
    3226         return _res;
     3216    PyMac_PRECHECK(DisableMenuCommand);
     3217#endif
     3218    if (!PyArg_ParseTuple(_args, "O&l",
     3219                          OptMenuObj_Convert, &inMenu,
     3220                          &inCommandID))
     3221        return NULL;
     3222    DisableMenuCommand(inMenu,
     3223                       inCommandID);
     3224    Py_INCREF(Py_None);
     3225    _res = Py_None;
     3226    return _res;
    32273227}
    32283228
    32293229static PyObject *Menu_IsMenuCommandEnabled(PyObject *_self, PyObject *_args)
    32303230{
    3231         PyObject *_res = NULL;
    3232         Boolean _rv;
    3233         MenuHandle inMenu;
    3234         MenuCommand inCommandID;
     3231    PyObject *_res = NULL;
     3232    Boolean _rv;
     3233    MenuHandle inMenu;
     3234    MenuCommand inCommandID;
    32353235#ifndef IsMenuCommandEnabled
    3236         PyMac_PRECHECK(IsMenuCommandEnabled);
    3237 #endif
    3238         if (!PyArg_ParseTuple(_args, "O&l",
    3239                               OptMenuObj_Convert, &inMenu,
    3240                               &inCommandID))
    3241                 return NULL;
    3242         _rv = IsMenuCommandEnabled(inMenu,
    3243                                    inCommandID);
    3244         _res = Py_BuildValue("b",
    3245                              _rv);
    3246         return _res;
     3236    PyMac_PRECHECK(IsMenuCommandEnabled);
     3237#endif
     3238    if (!PyArg_ParseTuple(_args, "O&l",
     3239                          OptMenuObj_Convert, &inMenu,
     3240                          &inCommandID))
     3241        return NULL;
     3242    _rv = IsMenuCommandEnabled(inMenu,
     3243                               inCommandID);
     3244    _res = Py_BuildValue("b",
     3245                         _rv);
     3246    return _res;
    32473247}
    32483248
    32493249static PyObject *Menu_SetMenuCommandMark(PyObject *_self, PyObject *_args)
    32503250{
    3251         PyObject *_res = NULL;
    3252         OSStatus _err;
    3253         MenuHandle inMenu;
    3254         MenuCommand inCommandID;
    3255         UniChar inMark;
     3251    PyObject *_res = NULL;
     3252    OSStatus _err;
     3253    MenuHandle inMenu;
     3254    MenuCommand inCommandID;
     3255    UniChar inMark;
    32563256#ifndef SetMenuCommandMark
    3257         PyMac_PRECHECK(SetMenuCommandMark);
    3258 #endif
    3259         if (!PyArg_ParseTuple(_args, "O&lh",
    3260                               OptMenuObj_Convert, &inMenu,
    3261                               &inCommandID,
    3262                               &inMark))
    3263                 return NULL;
    3264         _err = SetMenuCommandMark(inMenu,
    3265                                   inCommandID,
    3266                                   inMark);
    3267         if (_err != noErr) return PyMac_Error(_err);
    3268         Py_INCREF(Py_None);
    3269         _res = Py_None;
    3270         return _res;
     3257    PyMac_PRECHECK(SetMenuCommandMark);
     3258#endif
     3259    if (!PyArg_ParseTuple(_args, "O&lh",
     3260                          OptMenuObj_Convert, &inMenu,
     3261                          &inCommandID,
     3262                          &inMark))
     3263        return NULL;
     3264    _err = SetMenuCommandMark(inMenu,
     3265                              inCommandID,
     3266                              inMark);
     3267    if (_err != noErr) return PyMac_Error(_err);
     3268    Py_INCREF(Py_None);
     3269    _res = Py_None;
     3270    return _res;
    32713271}
    32723272
    32733273static PyObject *Menu_GetMenuCommandMark(PyObject *_self, PyObject *_args)
    32743274{
    3275         PyObject *_res = NULL;
    3276         OSStatus _err;
    3277         MenuHandle inMenu;
    3278         MenuCommand inCommandID;
    3279         UniChar outMark;
     3275    PyObject *_res = NULL;
     3276    OSStatus _err;
     3277    MenuHandle inMenu;
     3278    MenuCommand inCommandID;
     3279    UniChar outMark;
    32803280#ifndef GetMenuCommandMark
    3281         PyMac_PRECHECK(GetMenuCommandMark);
    3282 #endif
    3283         if (!PyArg_ParseTuple(_args, "O&l",
    3284                               OptMenuObj_Convert, &inMenu,
    3285                               &inCommandID))
    3286                 return NULL;
    3287         _err = GetMenuCommandMark(inMenu,
    3288                                   inCommandID,
    3289                                   &outMark);
    3290         if (_err != noErr) return PyMac_Error(_err);
    3291         _res = Py_BuildValue("h",
    3292                              outMark);
    3293         return _res;
     3281    PyMac_PRECHECK(GetMenuCommandMark);
     3282#endif
     3283    if (!PyArg_ParseTuple(_args, "O&l",
     3284                          OptMenuObj_Convert, &inMenu,
     3285                          &inCommandID))
     3286        return NULL;
     3287    _err = GetMenuCommandMark(inMenu,
     3288                              inCommandID,
     3289                              &outMark);
     3290    if (_err != noErr) return PyMac_Error(_err);
     3291    _res = Py_BuildValue("h",
     3292                         outMark);
     3293    return _res;
    32943294}
    32953295
    32963296static PyObject *Menu_GetMenuCommandPropertySize(PyObject *_self, PyObject *_args)
    32973297{
    3298         PyObject *_res = NULL;
    3299         OSStatus _err;
    3300         MenuHandle inMenu;
    3301         MenuCommand inCommandID;
    3302         OSType inPropertyCreator;
    3303         OSType inPropertyTag;
    3304         ByteCount outSize;
     3298    PyObject *_res = NULL;
     3299    OSStatus _err;
     3300    MenuHandle inMenu;
     3301    MenuCommand inCommandID;
     3302    OSType inPropertyCreator;
     3303    OSType inPropertyTag;
     3304    ByteCount outSize;
    33053305#ifndef GetMenuCommandPropertySize
    3306         PyMac_PRECHECK(GetMenuCommandPropertySize);
    3307 #endif
    3308         if (!PyArg_ParseTuple(_args, "O&lO&O&",
    3309                               OptMenuObj_Convert, &inMenu,
    3310                               &inCommandID,
    3311                               PyMac_GetOSType, &inPropertyCreator,
    3312                               PyMac_GetOSType, &inPropertyTag))
    3313                 return NULL;
    3314         _err = GetMenuCommandPropertySize(inMenu,
    3315                                           inCommandID,
    3316                                           inPropertyCreator,
    3317                                           inPropertyTag,
    3318                                           &outSize);
    3319         if (_err != noErr) return PyMac_Error(_err);
    3320         _res = Py_BuildValue("l",
    3321                              outSize);
    3322         return _res;
     3306    PyMac_PRECHECK(GetMenuCommandPropertySize);
     3307#endif
     3308    if (!PyArg_ParseTuple(_args, "O&lO&O&",
     3309                          OptMenuObj_Convert, &inMenu,
     3310                          &inCommandID,
     3311                          PyMac_GetOSType, &inPropertyCreator,
     3312                          PyMac_GetOSType, &inPropertyTag))
     3313        return NULL;
     3314    _err = GetMenuCommandPropertySize(inMenu,
     3315                                      inCommandID,
     3316                                      inPropertyCreator,
     3317                                      inPropertyTag,
     3318                                      &outSize);
     3319    if (_err != noErr) return PyMac_Error(_err);
     3320    _res = Py_BuildValue("l",
     3321                         outSize);
     3322    return _res;
    33233323}
    33243324
    33253325static PyObject *Menu_RemoveMenuCommandProperty(PyObject *_self, PyObject *_args)
    33263326{
    3327         PyObject *_res = NULL;
    3328         OSStatus _err;
    3329         MenuHandle inMenu;
    3330         MenuCommand inCommandID;
    3331         OSType inPropertyCreator;
    3332         OSType inPropertyTag;
     3327    PyObject *_res = NULL;
     3328    OSStatus _err;
     3329    MenuHandle inMenu;
     3330    MenuCommand inCommandID;
     3331    OSType inPropertyCreator;
     3332    OSType inPropertyTag;
    33333333#ifndef RemoveMenuCommandProperty
    3334         PyMac_PRECHECK(RemoveMenuCommandProperty);
    3335 #endif
    3336         if (!PyArg_ParseTuple(_args, "O&lO&O&",
    3337                               OptMenuObj_Convert, &inMenu,
    3338                               &inCommandID,
    3339                               PyMac_GetOSType, &inPropertyCreator,
    3340                               PyMac_GetOSType, &inPropertyTag))
    3341                 return NULL;
    3342         _err = RemoveMenuCommandProperty(inMenu,
    3343                                          inCommandID,
    3344                                          inPropertyCreator,
    3345                                          inPropertyTag);
    3346         if (_err != noErr) return PyMac_Error(_err);
    3347         Py_INCREF(Py_None);
    3348         _res = Py_None;
    3349         return _res;
     3334    PyMac_PRECHECK(RemoveMenuCommandProperty);
     3335#endif
     3336    if (!PyArg_ParseTuple(_args, "O&lO&O&",
     3337                          OptMenuObj_Convert, &inMenu,
     3338                          &inCommandID,
     3339                          PyMac_GetOSType, &inPropertyCreator,
     3340                          PyMac_GetOSType, &inPropertyTag))
     3341        return NULL;
     3342    _err = RemoveMenuCommandProperty(inMenu,
     3343                                     inCommandID,
     3344                                     inPropertyCreator,
     3345                                     inPropertyTag);
     3346    if (_err != noErr) return PyMac_Error(_err);
     3347    Py_INCREF(Py_None);
     3348    _res = Py_None;
     3349    return _res;
    33503350}
    33513351#endif /* __LP64__ */
     
    33533353static PyMethodDef Menu_methods[] = {
    33543354#ifndef __LP64__
    3355         {"NewMenu", (PyCFunction)Menu_NewMenu, 1,
    3356         PyDoc_STR("(MenuID menuID, Str255 menuTitle) -> (MenuHandle _rv)")},
    3357         {"MacGetMenu", (PyCFunction)Menu_MacGetMenu, 1,
    3358         PyDoc_STR("(short resourceID) -> (MenuHandle _rv)")},
    3359         {"CreateNewMenu", (PyCFunction)Menu_CreateNewMenu, 1,
    3360         PyDoc_STR("(MenuID inMenuID, MenuAttributes inMenuAttributes) -> (MenuHandle outMenuRef)")},
    3361         {"MenuKey", (PyCFunction)Menu_MenuKey, 1,
    3362         PyDoc_STR("(CharParameter ch) -> (long _rv)")},
    3363         {"MenuSelect", (PyCFunction)Menu_MenuSelect, 1,
    3364         PyDoc_STR("(Point startPt) -> (long _rv)")},
    3365         {"MenuChoice", (PyCFunction)Menu_MenuChoice, 1,
    3366         PyDoc_STR("() -> (long _rv)")},
    3367         {"MenuEvent", (PyCFunction)Menu_MenuEvent, 1,
    3368         PyDoc_STR("(EventRecord inEvent) -> (UInt32 _rv)")},
    3369         {"GetMBarHeight", (PyCFunction)Menu_GetMBarHeight, 1,
    3370         PyDoc_STR("() -> (short _rv)")},
    3371         {"MacDrawMenuBar", (PyCFunction)Menu_MacDrawMenuBar, 1,
    3372         PyDoc_STR("() -> None")},
    3373         {"InvalMenuBar", (PyCFunction)Menu_InvalMenuBar, 1,
    3374         PyDoc_STR("() -> None")},
    3375         {"HiliteMenu", (PyCFunction)Menu_HiliteMenu, 1,
    3376         PyDoc_STR("(MenuID menuID) -> None")},
    3377         {"GetNewMBar", (PyCFunction)Menu_GetNewMBar, 1,
    3378         PyDoc_STR("(short menuBarID) -> (MenuBarHandle _rv)")},
    3379         {"GetMenuBar", (PyCFunction)Menu_GetMenuBar, 1,
    3380         PyDoc_STR("() -> (MenuBarHandle _rv)")},
    3381         {"SetMenuBar", (PyCFunction)Menu_SetMenuBar, 1,
    3382         PyDoc_STR("(MenuBarHandle mbar) -> None")},
    3383         {"DuplicateMenuBar", (PyCFunction)Menu_DuplicateMenuBar, 1,
    3384         PyDoc_STR("(MenuBarHandle inMbar) -> (MenuBarHandle outMbar)")},
    3385         {"DisposeMenuBar", (PyCFunction)Menu_DisposeMenuBar, 1,
    3386         PyDoc_STR("(MenuBarHandle inMbar) -> None")},
    3387         {"GetMenuHandle", (PyCFunction)Menu_GetMenuHandle, 1,
    3388         PyDoc_STR("(MenuID menuID) -> (MenuHandle _rv)")},
    3389         {"MacDeleteMenu", (PyCFunction)Menu_MacDeleteMenu, 1,
    3390         PyDoc_STR("(MenuID menuID) -> None")},
    3391         {"ClearMenuBar", (PyCFunction)Menu_ClearMenuBar, 1,
    3392         PyDoc_STR("() -> None")},
    3393         {"SetMenuFlashCount", (PyCFunction)Menu_SetMenuFlashCount, 1,
    3394         PyDoc_STR("(short count) -> None")},
    3395         {"FlashMenuBar", (PyCFunction)Menu_FlashMenuBar, 1,
    3396         PyDoc_STR("(MenuID menuID) -> None")},
    3397         {"IsMenuBarVisible", (PyCFunction)Menu_IsMenuBarVisible, 1,
    3398         PyDoc_STR("() -> (Boolean _rv)")},
    3399         {"ShowMenuBar", (PyCFunction)Menu_ShowMenuBar, 1,
    3400         PyDoc_STR("() -> None")},
    3401         {"HideMenuBar", (PyCFunction)Menu_HideMenuBar, 1,
    3402         PyDoc_STR("() -> None")},
    3403         {"AcquireRootMenu", (PyCFunction)Menu_AcquireRootMenu, 1,
    3404         PyDoc_STR("() -> (MenuHandle _rv)")},
    3405         {"DeleteMCEntries", (PyCFunction)Menu_DeleteMCEntries, 1,
    3406         PyDoc_STR("(MenuID menuID, short menuItem) -> None")},
    3407         {"InitContextualMenus", (PyCFunction)Menu_InitContextualMenus, 1,
    3408         PyDoc_STR("() -> None")},
    3409         {"IsShowContextualMenuClick", (PyCFunction)Menu_IsShowContextualMenuClick, 1,
    3410         PyDoc_STR("(EventRecord inEvent) -> (Boolean _rv)")},
    3411         {"LMGetTheMenu", (PyCFunction)Menu_LMGetTheMenu, 1,
    3412         PyDoc_STR("() -> (SInt16 _rv)")},
    3413         {"as_Menu", (PyCFunction)Menu_as_Menu, 1,
    3414         PyDoc_STR("(Handle h) -> (MenuHandle _rv)")},
    3415         {"GetMenu", (PyCFunction)Menu_GetMenu, 1,
    3416         PyDoc_STR("(short resourceID) -> (MenuHandle _rv)")},
    3417         {"DeleteMenu", (PyCFunction)Menu_DeleteMenu, 1,
    3418         PyDoc_STR("(short menuID) -> None")},
    3419         {"DrawMenuBar", (PyCFunction)Menu_DrawMenuBar, 1,
    3420         PyDoc_STR("() -> None")},
    3421         {"CountMenuItemsWithCommandID", (PyCFunction)Menu_CountMenuItemsWithCommandID, 1,
    3422         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (ItemCount _rv)")},
    3423         {"GetIndMenuItemWithCommandID", (PyCFunction)Menu_GetIndMenuItemWithCommandID, 1,
    3424         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
    3425         {"EnableMenuCommand", (PyCFunction)Menu_EnableMenuCommand, 1,
    3426         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
    3427         {"DisableMenuCommand", (PyCFunction)Menu_DisableMenuCommand, 1,
    3428         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
    3429         {"IsMenuCommandEnabled", (PyCFunction)Menu_IsMenuCommandEnabled, 1,
    3430         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (Boolean _rv)")},
    3431         {"SetMenuCommandMark", (PyCFunction)Menu_SetMenuCommandMark, 1,
    3432         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UniChar inMark) -> None")},
    3433         {"GetMenuCommandMark", (PyCFunction)Menu_GetMenuCommandMark, 1,
    3434         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (UniChar outMark)")},
    3435         {"GetMenuCommandPropertySize", (PyCFunction)Menu_GetMenuCommandPropertySize, 1,
    3436         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
    3437         {"RemoveMenuCommandProperty", (PyCFunction)Menu_RemoveMenuCommandProperty, 1,
    3438         PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
     3355    {"NewMenu", (PyCFunction)Menu_NewMenu, 1,
     3356    PyDoc_STR("(MenuID menuID, Str255 menuTitle) -> (MenuHandle _rv)")},
     3357    {"MacGetMenu", (PyCFunction)Menu_MacGetMenu, 1,
     3358    PyDoc_STR("(short resourceID) -> (MenuHandle _rv)")},
     3359    {"CreateNewMenu", (PyCFunction)Menu_CreateNewMenu, 1,
     3360    PyDoc_STR("(MenuID inMenuID, MenuAttributes inMenuAttributes) -> (MenuHandle outMenuRef)")},
     3361    {"MenuKey", (PyCFunction)Menu_MenuKey, 1,
     3362    PyDoc_STR("(CharParameter ch) -> (long _rv)")},
     3363    {"MenuSelect", (PyCFunction)Menu_MenuSelect, 1,
     3364    PyDoc_STR("(Point startPt) -> (long _rv)")},
     3365    {"MenuChoice", (PyCFunction)Menu_MenuChoice, 1,
     3366    PyDoc_STR("() -> (long _rv)")},
     3367    {"MenuEvent", (PyCFunction)Menu_MenuEvent, 1,
     3368    PyDoc_STR("(EventRecord inEvent) -> (UInt32 _rv)")},
     3369    {"GetMBarHeight", (PyCFunction)Menu_GetMBarHeight, 1,
     3370    PyDoc_STR("() -> (short _rv)")},
     3371    {"MacDrawMenuBar", (PyCFunction)Menu_MacDrawMenuBar, 1,
     3372    PyDoc_STR("() -> None")},
     3373    {"InvalMenuBar", (PyCFunction)Menu_InvalMenuBar, 1,
     3374    PyDoc_STR("() -> None")},
     3375    {"HiliteMenu", (PyCFunction)Menu_HiliteMenu, 1,
     3376    PyDoc_STR("(MenuID menuID) -> None")},
     3377    {"GetNewMBar", (PyCFunction)Menu_GetNewMBar, 1,
     3378    PyDoc_STR("(short menuBarID) -> (MenuBarHandle _rv)")},
     3379    {"GetMenuBar", (PyCFunction)Menu_GetMenuBar, 1,
     3380    PyDoc_STR("() -> (MenuBarHandle _rv)")},
     3381    {"SetMenuBar", (PyCFunction)Menu_SetMenuBar, 1,
     3382    PyDoc_STR("(MenuBarHandle mbar) -> None")},
     3383    {"DuplicateMenuBar", (PyCFunction)Menu_DuplicateMenuBar, 1,
     3384    PyDoc_STR("(MenuBarHandle inMbar) -> (MenuBarHandle outMbar)")},
     3385    {"DisposeMenuBar", (PyCFunction)Menu_DisposeMenuBar, 1,
     3386    PyDoc_STR("(MenuBarHandle inMbar) -> None")},
     3387    {"GetMenuHandle", (PyCFunction)Menu_GetMenuHandle, 1,
     3388    PyDoc_STR("(MenuID menuID) -> (MenuHandle _rv)")},
     3389    {"MacDeleteMenu", (PyCFunction)Menu_MacDeleteMenu, 1,
     3390    PyDoc_STR("(MenuID menuID) -> None")},
     3391    {"ClearMenuBar", (PyCFunction)Menu_ClearMenuBar, 1,
     3392    PyDoc_STR("() -> None")},
     3393    {"SetMenuFlashCount", (PyCFunction)Menu_SetMenuFlashCount, 1,
     3394    PyDoc_STR("(short count) -> None")},
     3395    {"FlashMenuBar", (PyCFunction)Menu_FlashMenuBar, 1,
     3396    PyDoc_STR("(MenuID menuID) -> None")},
     3397    {"IsMenuBarVisible", (PyCFunction)Menu_IsMenuBarVisible, 1,
     3398    PyDoc_STR("() -> (Boolean _rv)")},
     3399    {"ShowMenuBar", (PyCFunction)Menu_ShowMenuBar, 1,
     3400    PyDoc_STR("() -> None")},
     3401    {"HideMenuBar", (PyCFunction)Menu_HideMenuBar, 1,
     3402    PyDoc_STR("() -> None")},
     3403    {"AcquireRootMenu", (PyCFunction)Menu_AcquireRootMenu, 1,
     3404    PyDoc_STR("() -> (MenuHandle _rv)")},
     3405    {"DeleteMCEntries", (PyCFunction)Menu_DeleteMCEntries, 1,
     3406    PyDoc_STR("(MenuID menuID, short menuItem) -> None")},
     3407    {"InitContextualMenus", (PyCFunction)Menu_InitContextualMenus, 1,
     3408    PyDoc_STR("() -> None")},
     3409    {"IsShowContextualMenuClick", (PyCFunction)Menu_IsShowContextualMenuClick, 1,
     3410    PyDoc_STR("(EventRecord inEvent) -> (Boolean _rv)")},
     3411    {"LMGetTheMenu", (PyCFunction)Menu_LMGetTheMenu, 1,
     3412    PyDoc_STR("() -> (SInt16 _rv)")},
     3413    {"as_Menu", (PyCFunction)Menu_as_Menu, 1,
     3414    PyDoc_STR("(Handle h) -> (MenuHandle _rv)")},
     3415    {"GetMenu", (PyCFunction)Menu_GetMenu, 1,
     3416    PyDoc_STR("(short resourceID) -> (MenuHandle _rv)")},
     3417    {"DeleteMenu", (PyCFunction)Menu_DeleteMenu, 1,
     3418    PyDoc_STR("(short menuID) -> None")},
     3419    {"DrawMenuBar", (PyCFunction)Menu_DrawMenuBar, 1,
     3420    PyDoc_STR("() -> None")},
     3421    {"CountMenuItemsWithCommandID", (PyCFunction)Menu_CountMenuItemsWithCommandID, 1,
     3422    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (ItemCount _rv)")},
     3423    {"GetIndMenuItemWithCommandID", (PyCFunction)Menu_GetIndMenuItemWithCommandID, 1,
     3424    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UInt32 inItemIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)")},
     3425    {"EnableMenuCommand", (PyCFunction)Menu_EnableMenuCommand, 1,
     3426    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
     3427    {"DisableMenuCommand", (PyCFunction)Menu_DisableMenuCommand, 1,
     3428    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> None")},
     3429    {"IsMenuCommandEnabled", (PyCFunction)Menu_IsMenuCommandEnabled, 1,
     3430    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (Boolean _rv)")},
     3431    {"SetMenuCommandMark", (PyCFunction)Menu_SetMenuCommandMark, 1,
     3432    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, UniChar inMark) -> None")},
     3433    {"GetMenuCommandMark", (PyCFunction)Menu_GetMenuCommandMark, 1,
     3434    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID) -> (UniChar outMark)")},
     3435    {"GetMenuCommandPropertySize", (PyCFunction)Menu_GetMenuCommandPropertySize, 1,
     3436    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outSize)")},
     3437    {"RemoveMenuCommandProperty", (PyCFunction)Menu_RemoveMenuCommandProperty, 1,
     3438    PyDoc_STR("(MenuHandle inMenu, MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None")},
    34393439#endif /* __LP64__ */
    3440         {NULL, NULL, 0}
     3440    {NULL, NULL, 0}
    34413441};
    34423442
     
    34463446void init_Menu(void)
    34473447{
    3448         PyObject *m;
     3448    PyObject *m;
    34493449#ifndef __LP64__
    3450         PyObject *d;
    3451 
    3452 
    3453 
    3454                 PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New);
    3455                 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
     3450    PyObject *d;
     3451
     3452
     3453
     3454        PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuHandle, MenuObj_New);
     3455        PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
    34563456#endif /* __LP64__ */
    34573457
    34583458
    3459         m = Py_InitModule("_Menu", Menu_methods);
     3459    m = Py_InitModule("_Menu", Menu_methods);
    34603460#ifndef __LP64__
    3461         d = PyModule_GetDict(m);
    3462         Menu_Error = PyMac_GetOSErrException();
    3463         if (Menu_Error == NULL ||
    3464             PyDict_SetItemString(d, "Error", Menu_Error) != 0)
    3465                 return;
    3466         Menu_Type.ob_type = &PyType_Type;
    3467         if (PyType_Ready(&Menu_Type) < 0) return;
    3468         Py_INCREF(&Menu_Type);
    3469         PyModule_AddObject(m, "Menu", (PyObject *)&Menu_Type);
    3470         /* Backward-compatible name */
    3471         Py_INCREF(&Menu_Type);
    3472         PyModule_AddObject(m, "MenuType", (PyObject *)&Menu_Type);
     3461    d = PyModule_GetDict(m);
     3462    Menu_Error = PyMac_GetOSErrException();
     3463    if (Menu_Error == NULL ||
     3464        PyDict_SetItemString(d, "Error", Menu_Error) != 0)
     3465        return;
     3466    Menu_Type.ob_type = &PyType_Type;
     3467    if (PyType_Ready(&Menu_Type) < 0) return;
     3468    Py_INCREF(&Menu_Type);
     3469    PyModule_AddObject(m, "Menu", (PyObject *)&Menu_Type);
     3470    /* Backward-compatible name */
     3471    Py_INCREF(&Menu_Type);
     3472    PyModule_AddObject(m, "MenuType", (PyObject *)&Menu_Type);
    34733473#endif /* __LP64__ */
    34743474}
Note: See TracChangeset for help on using the changeset viewer.