[Python-checkins] CVS: python/dist/src/Mac/Modules/menu menusupport.py,1.9,1.10

Jack Jansen jackjansen@users.sourceforge.net
Thu, 17 May 2001 14:56:24 -0700


Update of /cvsroot/python/python/dist/src/Mac/Modules/menu
In directory usw-pr-cvs1:/tmp/cvs-serv8172/Python/Mac/Modules/menu

Modified Files:
	menusupport.py 
Log Message:
First step in porting MacPython modules to OSX/unix: break all references between modules except for the obj_New() and obj_Convert() routines, the PyArg_Parse and Py_BuildValue helpers. 

And these can now be vectored through glue routines (by defining USE_TOOLBOX_OBJECT_GLUE) which will do the necessary imports, whereupon the module's init routine will tell the glue routine about the real conversion routine address and everything is fine again.

Index: menusupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/menusupport.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** menusupport.py	2000/12/10 23:43:49	1.9
--- menusupport.py	2001/05/17 21:56:22	1.10
***************
*** 40,43 ****
--- 40,52 ----
  #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)
***************
*** 52,55 ****
--- 61,69 ----
  #define as_Menu(h) ((MenuHandle)h)
  #define as_Resource(h) ((Handle)h)
+ """
+ 
+ initstuff = initstuff + """
+ 	PyMac_INIT_TOOLBOX_OBJECT_NEW(MenuObj_New);
+ 	PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuObj_Convert);
  """