[Python-checkins] CVS: python/dist/src/Mac/Include pymactoolbox.h,1.4,1.5
Jack Jansen
jackjansen@users.sourceforge.net
Thu, 17 May 2001 15:11:46 -0700
Update of /cvsroot/python/python/dist/src/Mac/Include
In directory usw-pr-cvs1:/tmp/cvs-serv11689/Python/Mac/Include
Modified Files:
pymactoolbox.h
Log Message:
Glue code to connect obj_New and obj_Convert routines (the PyArg_Parse and Py_BuildTuple helpers) from one dynamically imported module to another.
Index: pymactoolbox.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Include/pymactoolbox.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** pymactoolbox.h 2001/02/09 15:59:18 1.4
--- pymactoolbox.h 2001/05/17 22:11:44 1.5
***************
*** 16,19 ****
--- 16,41 ----
#include <Errors.h>
+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ /*
+ ** These macros are used in the module init code. If we use toolbox object glue
+ ** it sets the function pointer to point to the real function.
+ */
+ #define PyMac_INIT_TOOLBOX_OBJECT_NEW(rtn) { \
+ extern PyObject *(*PyMacGluePtr_##rtn)(object); \
+ PyMacGluePtr_##rtn = _##rtn; \
+ }
+ #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(rtn) { \
+ extern int (*PyMacGluePtr_##rtn)(object); \
+ PyMacGluePtr_##rtn = _##rtn; \
+ }
+ #else
+ /*
+ ** If we don't use toolbox object glue the init macros are empty. Moreover, we define
+ ** _xxx_New to be the same as xxx_New, and the code in mactoolboxglue isn't included.
+ */
+ #define PyMac_INIT_TOOLBOX_OBJECT_NEW(rtn)
+ #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(rtn)
+ #endif /* USE_TOOLBOX_OBJECT_GLUE */
+
/* AE exports */
extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */
***************
*** 33,40 ****
extern PyObject *DlgObj_New(DialogPtr);
extern int DlgObj_Convert(PyObject *, DialogPtr *);
- extern WindowPtr DlgObj_ConvertToWindow(PyObject *);
extern PyObject *DlgObj_WhichDialog(DialogPtr);
- extern PyTypeObject Dialog_Type;
- #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
/* Drag exports */
--- 55,59 ----
***************
*** 68,72 ****
extern int MovieObj_Convert(PyObject *, Movie *);
extern PyObject *MovieCtlObj_New(MovieController);
! extern int MovieCtlObj_Convert(PyObject *, TimeBase *);
extern PyObject *TimeBaseObj_New(TimeBase);
extern int TimeBaseObj_Convert(PyObject *, TimeBase *);
--- 87,91 ----
extern int MovieObj_Convert(PyObject *, Movie *);
extern PyObject *MovieCtlObj_New(MovieController);
! extern int MovieCtlObj_Convert(PyObject *, MovieController *);
extern PyObject *TimeBaseObj_New(TimeBase);
extern int TimeBaseObj_Convert(PyObject *, TimeBase *);
***************
*** 90,95 ****
extern int WinObj_Convert(PyObject *, WindowPtr *);
extern PyObject *WinObj_WhichWindow(WindowPtr);
- extern PyTypeObject Window_Type;
- #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
--- 109,112 ----