diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-08 13:17:31 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-08 13:17:31 (GMT) |
commit | 94bebc038159afe1352f18bdda9a0a0fcabe2793 (patch) | |
tree | 8ba6d86201e08802979d8eb9db3d37396a6ea032 /Mac/Include | |
parent | 11d03c57de36e1e5085c706b4e6275baf04a2388 (diff) | |
download | cpython-94bebc038159afe1352f18bdda9a0a0fcabe2793.zip cpython-94bebc038159afe1352f18bdda9a0a0fcabe2793.tar.gz cpython-94bebc038159afe1352f18bdda9a0a0fcabe2793.tar.bz2 |
Split macglue.c into two: a new mactoolboxglue.c (in ./Python)
with functionality needed for both unix-Python and MacPython and a
new smaller ./Mac/Python/macglue.c which contains MacPython stuff only.
pymactoolbox.h has moved to ./Include from ./Mac/Include and now also
contains the relevant stuff from macglue.h.
The net effect of this is that the ./Mac subdirectory is not needed
anymore for building the unix-Python core on MacOSX (it is needed
for building the extension modules).
Diffstat (limited to 'Mac/Include')
-rw-r--r-- | Mac/Include/macglue.h | 28 | ||||
-rw-r--r-- | Mac/Include/pymactoolbox.h | 123 |
2 files changed, 2 insertions, 149 deletions
diff --git a/Mac/Include/macglue.h b/Mac/Include/macglue.h index e0c0ff5..6f29a20 100644 --- a/Mac/Include/macglue.h +++ b/Mac/Include/macglue.h @@ -31,6 +31,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <Carbon/Carbon.h> #endif +#include "pymactoolbox.h" + #ifdef __cplusplus extern "C" { #endif @@ -44,15 +46,11 @@ typedef struct { double bg_yield; /* yield at most so long when in background */ } PyMacSchedParams; -char *PyMac_getscript(void); /* Get the default encoding for our 8bit character set */ #ifdef USE_GUSI1 void PyMac_FixGUSIcd(void); /* Workaround for GUSI chdir() call */ extern void PyMac_SetGUSISpin(void); /* Install our private GUSI spin routine */ #endif -char *PyMac_StrError(int); /* strerror with mac errors */ -PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */ -PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */ unsigned char *Pstring(char *str); /* Convert c-string to pascal-string in static buffer */ #ifdef USE_GUSI @@ -97,28 +95,6 @@ void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply, char *prompt); /* Ask user for file, with prompt */ #endif /* TARGET_API_MAC_OS8 */ -int PyMac_GetOSType(PyObject *, OSType *); /* argument parser for OSType */ -PyObject *PyMac_BuildOSType(OSType); /* Convert OSType to PyObject */ - -PyObject *PyMac_BuildNumVersion(NumVersion); /* Convert NumVersion to PyObject */ - -int PyMac_GetStr255(PyObject *, Str255); /* argument parser for Str255 */ -PyObject *PyMac_BuildStr255(Str255); /* Convert Str255 to PyObject */ -PyObject *PyMac_BuildOptStr255(Str255); /* Convert Str255 to PyObject, NULL to None */ - -int PyMac_GetRect(PyObject *, Rect *); /* argument parser for Rect */ -PyObject *PyMac_BuildRect(Rect *); /* Convert Rect to PyObject */ - -int PyMac_GetPoint(PyObject *, Point *); /* argument parser for Point */ -PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */ - -int PyMac_GetEventRecord(PyObject *, EventRecord *); /* argument parser for EventRecord */ -PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to PyObject */ - -int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */ -PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */ -int PyMac_Getwide(PyObject *, wide *); /* argument parser for wide */ -PyObject *PyMac_Buildwide(wide *); /* Convert wide to PyObject */ void PyMac_InitApplet(void); /* Initialize and run an Applet */ void PyMac_Initialize(void); /* Initialize function for embedding Python */ diff --git a/Mac/Include/pymactoolbox.h b/Mac/Include/pymactoolbox.h deleted file mode 100644 index 64ac823..0000000 --- a/Mac/Include/pymactoolbox.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -** pymactoolbox.h - global routines exported by the toolbox modules -*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#ifdef WITHOUT_FRAMEWORKS -#include <Memory.h> -#include <Dialogs.h> -#include <Menus.h> -#include <Controls.h> -#include <Components.h> -#include <Lists.h> -#include <Movies.h> -#include <Errors.h> -#else -#include <Carbon/Carbon.h> -#include <QuickTime/QuickTime.h> -#endif - -#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(object, rtn) { \ - extern PyObject *(*PyMacGluePtr_##rtn)(object); \ - PyMacGluePtr_##rtn = _##rtn; \ -} -#define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) { \ - extern int (*PyMacGluePtr_##rtn)(PyObject *, 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(object, rtn) -#define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) -#endif /* USE_TOOLBOX_OBJECT_GLUE */ - -/* macfs exports */ -extern int PyMac_GetFSSpec(PyObject *, FSSpec *); - -/* AE exports */ -extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ -extern int AEDesc_Convert(PyObject *, AppleEvent *); - -/* Cm exports */ -extern PyObject *CmpObj_New(Component); -extern int CmpObj_Convert(PyObject *, Component *); -extern PyObject *CmpInstObj_New(ComponentInstance); -extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); - -/* Ctl exports */ -extern PyObject *CtlObj_New(ControlHandle); -extern int CtlObj_Convert(PyObject *, ControlHandle *); - -/* Dlg exports */ -extern PyObject *DlgObj_New(DialogPtr); -extern int DlgObj_Convert(PyObject *, DialogPtr *); -extern PyObject *DlgObj_WhichDialog(DialogPtr); - -/* Drag exports */ -extern PyObject *DragObj_New(DragReference); -extern int DragObj_Convert(PyObject *, DragReference *); - -/* List exports */ -extern PyObject *ListObj_New(ListHandle); -extern int ListObj_Convert(PyObject *, ListHandle *); - -/* Menu exports */ -extern PyObject *MenuObj_New(MenuHandle); -extern int MenuObj_Convert(PyObject *, MenuHandle *); - -/* Qd exports */ -extern PyObject *GrafObj_New(GrafPtr); -extern int GrafObj_Convert(PyObject *, GrafPtr *); -extern PyObject *BMObj_New(BitMapPtr); -extern int BMObj_Convert(PyObject *, BitMapPtr *); -extern PyObject *QdRGB_New(RGBColor *); -extern int QdRGB_Convert(PyObject *, RGBColor *); - -/* Qdoffs exports */ -extern PyObject *GWorldObj_New(GWorldPtr); -extern int GWorldObj_Convert(PyObject *, GWorldPtr *); - -/* Qt exports */ -extern PyObject *TrackObj_New(Track); -extern int TrackObj_Convert(PyObject *, Track *); -extern PyObject *MovieObj_New(Movie); -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 *); -extern PyObject *UserDataObj_New(UserData); -extern int UserDataObj_Convert(PyObject *, UserData *); -extern PyObject *MediaObj_New(Media); -extern int MediaObj_Convert(PyObject *, Media *); - -/* Res exports */ -extern PyObject *ResObj_New(Handle); -extern int ResObj_Convert(PyObject *, Handle *); -extern PyObject *OptResObj_New(Handle); -extern int OptResObj_Convert(PyObject *, Handle *); - -/* TE exports */ -extern PyObject *TEObj_New(TEHandle); -extern int TEObj_Convert(PyObject *, TEHandle *); - -/* Win exports */ -extern PyObject *WinObj_New(WindowPtr); -extern int WinObj_Convert(PyObject *, WindowPtr *); -extern PyObject *WinObj_WhichWindow(WindowPtr); - - -#ifdef __cplusplus - } -#endif |