diff options
Diffstat (limited to 'Mac/Modules/menu')
-rw-r--r-- | Mac/Modules/menu/Menumodule.c | 12 | ||||
-rw-r--r-- | Mac/Modules/menu/menusupport.py | 14 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Mac/Modules/menu/Menumodule.c b/Mac/Modules/menu/Menumodule.c index 782b270..f965586 100644 --- a/Mac/Modules/menu/Menumodule.c +++ b/Mac/Modules/menu/Menumodule.c @@ -11,6 +11,15 @@ #include <Devices.h> /* Defines OpenDeskAcc in universal headers */ #include <Menus.h> +#ifdef USE_TOOLBOX_OBJECT_GLUE + +extern PyObject *_MenuObj_New(MenuHandle); +extern int _MenuObj_Convert(PyObject *, MenuHandle *); + +#define MenuObj_New _MenuObj_New +#define MenuObj_Convert _MenuObj_Convert +#endif + #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define GetMenuID(menu) ((*(menu))->menuID) #define GetMenuWidth(menu) ((*(menu))->menuWidth) @@ -2780,6 +2789,9 @@ void initMenu() + PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert); + m = Py_InitModule("Menu", Menu_methods); d = PyModule_GetDict(m); diff --git a/Mac/Modules/menu/menusupport.py b/Mac/Modules/menu/menusupport.py index 20b4f36..4de26a2 100644 --- a/Mac/Modules/menu/menusupport.py +++ b/Mac/Modules/menu/menusupport.py @@ -39,6 +39,15 @@ includestuff = includestuff + """ #include <Devices.h> /* Defines OpenDeskAcc in universal headers */ #include <%s>""" % MACHEADERFILE + """ +#ifdef USE_TOOLBOX_OBJECT_GLUE + +extern PyObject *_MenuObj_New(MenuHandle); +extern int _MenuObj_Convert(PyObject *, MenuHandle *); + +#define MenuObj_New _MenuObj_New +#define MenuObj_Convert _MenuObj_Convert +#endif + #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define GetMenuID(menu) ((*(menu))->menuID) #define GetMenuWidth(menu) ((*(menu))->menuWidth) @@ -53,6 +62,11 @@ includestuff = includestuff + """ #define as_Resource(h) ((Handle)h) """ +initstuff = initstuff + """ + PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert); +""" + class MyObjectDefinition(GlobalObjectDefinition): pass |