[Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs qdoffssupport.py,1.3,1.4
Jack Jansen
jackjansen@users.sourceforge.net
Thu, 17 May 2001 14:56:57 -0700
Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs
In directory usw-pr-cvs1:/tmp/cvs-serv8290/Python/Mac/Modules/qdoffs
Modified Files:
qdoffssupport.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: qdoffssupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qdoffs/qdoffssupport.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** qdoffssupport.py 2000/07/14 22:16:42 1.3
--- qdoffssupport.py 2001/05/17 21:56:55 1.4
***************
*** 37,44 ****
--- 37,56 ----
#include <%s>""" % MACHEADERFILE + """
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ extern PyObject *_GWorldObj_New(GWorldPtr);
+ extern int _GWorldObj_Convert(PyObject *, GWorldPtr *);
+
+ #define GWorldObj_New _GWorldObj_New
+ #define GWorldObj_Convert _GWorldObj_Convert
+ #endif
+
#define as_GrafPtr(gworld) ((GrafPtr)(gworld))
"""
+ initstuff = initstuff + """
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldObj_Convert);
+ """
class MyObjectDefinition(GlobalObjectDefinition):