1 /***********************************************************
2 Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Stichting Mathematisch
12 Centrum or CWI not be used in advertising or publicity pertaining to
13 distribution of the software without specific, written prior permission.
15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 ******************************************************************/
25 #ifndef SystemSevenOrLater
26 #define SystemSevenOrLater 1
32 #include <StandardFile.h>
34 /* Scheduler parameters */
36 int check_interrupt
; /* if true check for command-dot */
37 int process_events
; /* if nonzero enable evt processing, this mask */
38 int besocial
; /* Be social, give up CPU now and again */
39 double check_interval
; /* how often to check */
40 double bg_yield
; /* yield at most so long when in background */
44 #ifdef GENERATINGCFM /* Defined to 0 or 1 in Universal headers */
45 #define HAVE_UNIVERSAL_HEADERS
48 #ifdef SYMANTEC__CFM68K__
53 void PyMac_FixGUSIcd
Py_PROTO((void)); /* Workaround for GUSI chdir() call */
56 char *PyMac_StrError(int); /* strerror with mac errors */
57 unsigned char *Pstring(char *str
); /* Convert c-string to pascal-string in static buffer */
60 extern int PyMac_ConsoleIsDead
; /* True when exiting */
61 extern void PyMac_SetGUSISpin(void); /* Install our private GUSI spin routine */
62 extern void PyMac_StopGUSISpin(void); /* Stop eventprocessing during exit() */
65 extern short PyMac_AppRefNum
; /* RefNum of application rsrcfork (from macmain.c) */
66 extern FSSpec PyMac_ApplicationFSSpec
; /* Application location (from macargv.c) */
67 extern char PyMac_ApplicationPath
[]; /* Application location (from macargv.c) */
68 extern OSErr PyMac_init_application_location
Py_PROTO((void)); /* Init the above */
69 extern OSErr PyMac_GetFullPath
Py_PROTO((FSSpec
*, char *)); /* convert fsspec->path (macargv.c) */
70 extern int PyMac_GetArgv
Py_PROTO((char ***, int)); /* Get argc, argv (from macargv.c) */
72 extern PyObject
*PyMac_OSErrException
; /* Exception for OSErr */
73 PyObject
*PyMac_GetOSErrException(void); /* Initialize & return it */
75 void PyMac_GetSchedParams
Py_PROTO((PyMacSchedParams
*)); /* Get schedulers params */
76 void PyMac_SetSchedParams
Py_PROTO((PyMacSchedParams
*)); /* Set schedulers params */
77 PyObject
*PyErr_Mac(PyObject
*, int); /* Exception with a mac error */
78 PyObject
*PyMac_Error(OSErr
); /* Uses PyMac_GetOSErrException */
79 int PyMac_HandleEvent
Py_PROTO((EventRecord
*)); /* Handle one event, possibly in Python */
80 void PyMac_HandleEventIntern
Py_PROTO((EventRecord
*)); /* Handle one event internal only */
81 int PyMac_SetEventHandler
Py_PROTO((PyObject
*)); /* set python-coded event handler */
83 void PyMac_InitMenuBar(void); /* Setup menu bar as we want it */
84 void PyMac_RestoreMenuBar(void); /* Restore menu bar for ease of exiting */
86 int PyMac_FindResourceModule(PyStringObject
*, char *, char *); /* Test for 'PYC ' resource in a file */
87 PyObject
* PyMac_LoadResourceModule(char *, char *); /* Load 'PYC ' resource from file */
88 int PyMac_FindCodeResourceModule(PyStringObject
*, char *, char *); /* Test for 'PYD ' resource in a file */
89 PyObject
* PyMac_LoadCodeResourceModule(char *, char *); /* Load 'PYD ' resource from file */
90 struct filedescr
*PyMac_FindModuleExtension(char *, int *, char *); /* Look for module in single folder */
92 int PyMac_GetDirectory(FSSpec
*dirfss
, char *prompt
); /* Ask user for a directory */
93 void PyMac_PromptGetFile(short numTypes
, ConstSFTypeListPtr typeList
,
94 StandardFileReply
*reply
, char *prompt
); /* Ask user for file, with prompt */
96 int PyMac_GetOSType(PyObject
*, OSType
*); /* argument parser for OSType */
97 PyObject
*PyMac_BuildOSType(OSType
); /* Convert OSType to PyObject */
99 PyObject
*PyMac_BuildNumVersion(NumVersion
); /* Convert NumVersion to PyObject */
101 int PyMac_GetStr255(PyObject
*, Str255
); /* argument parser for Str255 */
102 PyObject
*PyMac_BuildStr255(Str255
); /* Convert Str255 to PyObject */
104 int PyMac_GetFSSpec(PyObject
*, FSSpec
*); /* argument parser for FSSpec */
105 PyObject
*PyMac_BuildFSSpec(FSSpec
*); /* Convert FSSpec to PyObject */
107 int PyMac_GetRect(PyObject
*, Rect
*); /* argument parser for Rect */
108 PyObject
*PyMac_BuildRect(Rect
*); /* Convert Rect to PyObject */
110 int PyMac_GetPoint(PyObject
*, Point
*); /* argument parser for Point */
111 PyObject
*PyMac_BuildPoint(Point
); /* Convert Point to PyObject */
113 int PyMac_GetEventRecord(PyObject
*, EventRecord
*); /* argument parser for EventRecord */
114 PyObject
*PyMac_BuildEventRecord(EventRecord
*); /* Convert EventRecord to PyObject */
116 int PyMac_GetFixed(PyObject
*, Fixed
*); /* argument parser for Fixed */
117 PyObject
*PyMac_BuildFixed(Fixed
); /* Convert Fixed to PyObject */
118 int PyMac_Getwide(PyObject
*, wide
*); /* argument parser for wide */
119 PyObject
*PyMac_Buildwide(wide
*); /* Convert wide to PyObject */
120 void PyMac_InitApplet(void); /* Initialize and run an Applet */
121 void PyMac_Initialize(void); /* Initialize function for embedding Python */
123 /* From macfiletype.c: */
125 long getfiletype(char *); /* Get file type */
126 int setfiletype(char *, long, long); /* Set file creator and type */