mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
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.
This commit is contained in:
parent
99f9baa331
commit
0e04eecdbf
26 changed files with 463 additions and 2 deletions
|
|
@ -32,6 +32,15 @@
|
|||
|
||||
includestuff = includestuff + """
|
||||
#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
|
||||
#define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH)
|
||||
|
|
@ -139,7 +148,7 @@
|
|||
|
||||
finalstuff = finalstuff + """
|
||||
/* Return the WindowPtr corresponding to a DialogObject */
|
||||
|
||||
#if 0
|
||||
WindowPtr
|
||||
DlgObj_ConvertToWindow(self)
|
||||
PyObject *self;
|
||||
|
|
@ -148,6 +157,7 @@
|
|||
return GetDialogWindow(((DialogObject *)self)->ob_itself);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
/* Return the object corresponding to the dialog, or None */
|
||||
|
||||
PyObject *
|
||||
|
|
@ -180,6 +190,12 @@
|
|||
}
|
||||
"""
|
||||
|
||||
initstuff = initstuff + """
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_New);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(DlgObj_WhichDialog);
|
||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DlgObj_Convert);
|
||||
"""
|
||||
|
||||
|
||||
# Define a class which specializes our object definition
|
||||
class MyObjectDefinition(GlobalObjectDefinition):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue