diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-17 21:58:34 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-05-17 21:58:34 (GMT) |
commit | 0e04eecdbf8467cf3fe055e41e96fa48507b998c (patch) | |
tree | 0c3373b79a29ab55b8c542fd06ddbc9d78dd9d39 /Mac/Modules/drag | |
parent | 99f9baa33190482784900970fd3e1c76e7cb48d6 (diff) | |
download | cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.zip cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.gz cpython-0e04eecdbf8467cf3fe055e41e96fa48507b998c.tar.bz2 |
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.
Diffstat (limited to 'Mac/Modules/drag')
-rw-r--r-- | Mac/Modules/drag/Dragmodule.c | 11 | ||||
-rw-r--r-- | Mac/Modules/drag/dragsupport.py | 13 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Mac/Modules/drag/Dragmodule.c b/Mac/Modules/drag/Dragmodule.c index fa6c2d9..3ce19b7 100644 --- a/Mac/Modules/drag/Dragmodule.c +++ b/Mac/Modules/drag/Dragmodule.c @@ -19,6 +19,14 @@ DragInputUPP dragglue_InputUPP; DragDrawingUPP dragglue_DrawingUPP; #endif +#ifdef USE_TOOLBOX_OBJECT_GLUE +extern PyObject *_DragObj_New(DragRef); +extern int _DragObj_Convert(PyObject *, DragRef *); + +#define DragObj_New _DragObj_New +#define DragObj_Convert _DragObj_Convert +#endif + static PyObject *Drag_Error; /* ---------------------- Object type DragObj ----------------------- */ @@ -1040,6 +1048,9 @@ void initDrag() + PyMac_INIT_TOOLBOX_OBJECT_NEW(DragObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragObj_Convert); + m = Py_InitModule("Drag", Drag_methods); d = PyModule_GetDict(m); diff --git a/Mac/Modules/drag/dragsupport.py b/Mac/Modules/drag/dragsupport.py index d90acc9..79bf00c 100644 --- a/Mac/Modules/drag/dragsupport.py +++ b/Mac/Modules/drag/dragsupport.py @@ -54,6 +54,14 @@ DragSendDataUPP dragglue_SendDataUPP; DragInputUPP dragglue_InputUPP; DragDrawingUPP dragglue_DrawingUPP; #endif + +#ifdef USE_TOOLBOX_OBJECT_GLUE +extern PyObject *_DragObj_New(DragRef); +extern int _DragObj_Convert(PyObject *, DragRef *); + +#define DragObj_New _DragObj_New +#define DragObj_Convert _DragObj_Convert +#endif """ finalstuff = finalstuff + """ @@ -153,6 +161,11 @@ dragglue_Drawing(xxxx """ +initstuff = initstuff + """ + PyMac_INIT_TOOLBOX_OBJECT_NEW(DragObj_New); + PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragObj_Convert); +""" + variablestuff = """ dragglue_TrackingHandlerUPP = NewDragTrackingHandlerProc(dragglue_TrackingHandler); dragglue_ReceiveHandlerUPP = NewDragReceiveHandlerProc(dragglue_ReceiveHandler); |