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 ******************************************************************/
26 ** Resource-IDs in use by Python.
28 ** All resources used by the python interpreter itself fall
29 ** in the range 228-256. The range 128-228 is not used, because
30 ** there is too much chance of conflicts with other packages.
32 ** Standard python modules use resources in the range
35 ** Python programs that use their own resources are advised to
36 ** choose resource numbers higher than 512.
40 ** Resources that reside in the python executable (or, for
41 ** shared ppc python, in the core dynamic library)
46 /* The alert for "No Python directory, where is it?" (OBSOLETE) */
47 #define NOPYTHON_ALERT BASE_ID+0
52 /* The alert for "this is an applet template" */
53 #define NOPYC_ALERT BASE_ID+1
55 /* The dialog for our GetDirectory and PromptGetFile call */
56 #define GETDIR_ID BASE_ID+2 /* Resource ID for our "get directory" */
57 #define GETFILEPROMPT_ID BASE_ID+4 /* Resource id for prompted get file */
58 #define PROMPT_ITEM 10 /* The prompt, at the top */
59 #define SELECTCUR_ITEM 11 /* "Select current directory" button */
62 /* The dialog for interactive options */
63 #define OPT_DIALOG BASE_ID+3 /* Resource ID for dialog */
68 #define OPT_OPTIMIZE 5
69 #define OPT_UNBUFFERED 6
70 #define OPT_DEBUGGING 7
71 #define OPT_KEEPALWAYS 8
72 #define OPT_KEEPOUTPUT 9
73 #define OPT_KEEPERROR 10
74 #define OPT_KEEPNEVER 11
75 #define OPT_CMDLINE 12
76 #define OPT_TABWARN 13
79 #define OPT_NONAVSERV 16
81 /* Dialog for 'No preferences directory' */
82 #define NOPREFDIR_ID BASE_ID+5
84 /* Dialog for 'Bad or outdated preferences' */
85 #define BADPREFERENCES_ID BASE_ID+6
86 #define BADPREF_DELETE 1
87 #define BADPREF_CONTINUE 2
88 #define BADPREF_QUIT 3
89 /* Dialog for 'Bad preference file' */
90 #define BADPREFFILE_ID BASE_ID+7
93 #define ABOUT_ID BASE_ID+8
95 /* No preferences file name resource */
96 #define NOPREFNAME_ID BASE_ID+9
98 /* EditPythonPrefs range. Needed here to forestall conflicts with applets */
99 #define EDITPYTHONPREFS_MIN 508
100 #define EDITPYTHONPREFS_MAX 511
101 /* twit range. Again needed to forestall conflicts with scripts using their own resources */
104 /* Bruce range. The same */
105 #define BRUCE_MIN 468
106 #define BRUCE_MAX 499
109 ** The following are valid both in the binary (or shared library)
110 ** and in the Preferences file.
111 ** For all these the override is tried first, in the application resource fork
112 ** only, this allows an applet to override standard settings.
113 ** If there is no override resource the preferences file is added to the head
114 ** of the resource file chain and the non-override version of the resource is
115 ** searched in any resource file.
117 ** The effect of this is that, for example, a 'Popt' of 228 in the application or
118 ** shared library provides default options for use when no preferences are set,
119 ** while a 'Popt' of 229 (in the application *only*) overrides any options in the
123 /* The STR resource that holds the preference file name */
124 #define PREFFILENAME_ID 228 /* For Rez only */
125 #define PREFFILENAME_PASCAL_NAME "PythonPreferenceFileName"
126 #define PREFFILENAME_NAME "\pPythonPreferenceFileName"
128 /* The STR# resource for sys.path initialization */
129 #define PYTHONPATH_ID 228
130 #define PYTHONPATHOVERRIDE_ID 229
132 /* The alis resource for locating the python home directory */
133 #define PYTHONHOME_ID 228
134 #define PYTHONHOMEOVERRIDE_ID 229
136 /* The Python options resource and offset of its members */
137 #define PYTHONOPTIONS_ID 228
138 #define PYTHONOPTIONSOVERRIDE_ID 229
140 #define POPT_VERSION_CURRENT 6 /* Current version number */
141 #define POPT_KEEPCONSOLE_NEVER 0
142 #define POPT_KEEPCONSOLE_OUTPUT 1
143 #define POPT_KEEPCONSOLE_ERROR 2
144 #define POPT_KEEPCONSOLE_ALWAYS 3
147 typedef struct PyMac_PrefRecord
{
148 unsigned char version
;
149 unsigned char inspect
;
150 unsigned char verbose
;
151 unsigned char optimize
;
152 unsigned char unbuffered
;
153 unsigned char debugging
;
154 unsigned char unused
;
155 unsigned char keep_console
;
156 unsigned char nointopt
;
157 unsigned char noargs
;
158 unsigned char tabwarn
;
159 unsigned char nosite
;
160 unsigned char nonavservice
;
164 /* The GUSI options resources */
165 #define GUSIOPTIONS_ID 10240
166 #define GUSIOPTIONSOVERRIDE_ID 10241
169 /* From macgetpath.c: */
170 void PyMac_PreferenceOptions(PyMac_PrefRecord
*);
171 char * PyMac_GetPythonDir(void);