[Python-checkins] CVS: python/dist/src/Mac/Modules/dlg Dlgmodule.c,1.24,1.25

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


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

Modified Files:
	Dlgmodule.c 
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: Dlgmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/Dlgmodule.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** Dlgmodule.c	2001/02/20 22:27:43	1.24
--- Dlgmodule.c	2001/05/17 21:55:02	1.25
***************
*** 10,13 ****
--- 10,22 ----
  
  #include <Dialogs.h>
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ extern PyObject *_DlgObj_New(DialogRef);
+ extern PyObject *_DlgObj_WhichDialog(DialogRef);
+ extern int _DlgObj_Convert(PyObject *, DialogRef *);
+ 
+ #define DlgObj_New _DlgObj_New
+ #define DlgObj_WhichDialog _DlgObj_WhichDialog
+ #define DlgObj_Convert _DlgObj_Convert
+ #endif
  
  #if !ACCESSOR_CALLS_ARE_FUNCTIONS
***************
*** 1469,1473 ****
  
  /* Return the WindowPtr corresponding to a DialogObject */
! 
  WindowPtr
  DlgObj_ConvertToWindow(self)
--- 1478,1482 ----
  
  /* Return the WindowPtr corresponding to a DialogObject */
! #if 0
  WindowPtr
  DlgObj_ConvertToWindow(self)
***************
*** 1478,1481 ****
--- 1487,1491 ----
  	return NULL;
  }
+ #endif
  /* Return the object corresponding to the dialog, or None */
  
***************
*** 1516,1519 ****
--- 1526,1533 ----
  
  
+ 
+ 		PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_New);
+ 		PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_WhichDialog);
+ 		PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DlgObj_Convert);