blob: 8cd47a318a558e29adfa1974fd497503baee5348 [file] [log] [blame]
Jack Jansen42218ce1997-01-31 16:15:11 +00001/***********************************************************
2Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam,
3The Netherlands.
4
5 All Rights Reserved
6
7Permission to use, copy, modify, and distribute this software and its
8documentation for any purpose and without fee is hereby granted,
9provided that the above copyright notice appear in all copies and that
10both that copyright notice and this permission notice appear in
11supporting documentation, and that the names of Stichting Mathematisch
12Centrum or CWI not be used in advertising or publicity pertaining to
13distribution of the software without specific, written prior permission.
14
15STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23******************************************************************/
24
Jack Jansenc2e6dd81995-08-14 12:34:42 +000025/*
26** Resource-IDs in use by Python.
27**
28** All resources used by the python interpreter itself fall
Jack Jansen6b02ac21998-01-06 16:48:49 +000029** in the range 228-256. The range 128-228 is not used, because
30** there is too much chance of conflicts with other packages.
Jack Jansenc2e6dd81995-08-14 12:34:42 +000031**
32** Standard python modules use resources in the range
33** 256-512.
34**
35** Python programs that use their own resources are advised to
36** choose resource numbers higher than 512.
37*/
38
39/*
40** Resources that reside in the python executable (or, for
41** shared ppc python, in the core dynamic library)
42*/
43
Jack Jansen41fa7ea1995-08-31 13:59:36 +000044/* The alert for "No Python directory, where is it?" (OBSOLETE) */
Jack Jansen6b02ac21998-01-06 16:48:49 +000045#define NOPYTHON_ALERT 228
Jack Jansen41fa7ea1995-08-31 13:59:36 +000046#define YES_ITEM 1
47#define NO_ITEM 2
48#define CURWD_ITEM 3
Jack Jansenc2e6dd81995-08-14 12:34:42 +000049
50/* The alert for "this is an applet template" */
Jack Jansen6b02ac21998-01-06 16:48:49 +000051#define NOPYC_ALERT 229
Jack Jansenc2e6dd81995-08-14 12:34:42 +000052
53/* The dialog for our GetDirectory and PromptGetFile call */
Jack Jansen6b02ac21998-01-06 16:48:49 +000054#define GETDIR_ID 230 /* Resource ID for our "get directory" */
55#define GETFILEPROMPT_ID 232 /* Resource id for prompted get file */
Jack Jansen41fa7ea1995-08-31 13:59:36 +000056#define PROMPT_ITEM 10 /* The prompt, at the top */
57#define SELECTCUR_ITEM 11 /* "Select current directory" button */
Jack Jansenc2e6dd81995-08-14 12:34:42 +000058
59
60/* The dialog for interactive options */
Jack Jansen6b02ac21998-01-06 16:48:49 +000061#define OPT_DIALOG 231 /* Resource ID for dialog */
Jack Jansenc2e6dd81995-08-14 12:34:42 +000062#define OPT_OK 1
63#define OPT_CANCEL 2
64#define OPT_INSPECT 3
65#define OPT_VERBOSE 4
Jack Jansenc6bb2811997-09-09 13:50:40 +000066#define OPT_OPTIMIZE 5
Jack Jansenc2e6dd81995-08-14 12:34:42 +000067#define OPT_UNBUFFERED 6
68#define OPT_DEBUGGING 7
Jack Jansen0168f271995-10-27 13:32:30 +000069#define OPT_KEEPNORMAL 8
70#define OPT_KEEPERROR 9
Jack Jansene355c451996-03-12 13:29:04 +000071#define OPT_CMDLINE 10
Jack Jansenc6bb2811997-09-09 13:50:40 +000072#define OPT_OLDEXC 13
73#define OPT_NOSITE 14
74#define OPT_HELP 16
Jack Jansenc2e6dd81995-08-14 12:34:42 +000075
Jack Jansen41fa7ea1995-08-31 13:59:36 +000076/* Dialog for 'No preferences directory' */
Jack Jansen6b02ac21998-01-06 16:48:49 +000077#define NOPREFDIR_ID 233
Jack Jansen41fa7ea1995-08-31 13:59:36 +000078
Jack Jansen447e01b1997-09-08 13:24:54 +000079/* Dialog for 'Bad or outdated preferences' */
Jack Jansen6b02ac21998-01-06 16:48:49 +000080#define BADPREFERENCES_ID 234
Jack Jansen447e01b1997-09-08 13:24:54 +000081#define BADPREF_DELETE 1
82#define BADPREF_CONTINUE 2
83#define BADPREF_QUIT 3
Jack Jansen41fa7ea1995-08-31 13:59:36 +000084/* Dialog for 'Bad preference file' */
Jack Jansen6b02ac21998-01-06 16:48:49 +000085#define BADPREFFILE_ID 235
Jack Jansen41fa7ea1995-08-31 13:59:36 +000086
Jack Jansen3469e991996-09-06 00:30:45 +000087/* About box */
Jack Jansen6b02ac21998-01-06 16:48:49 +000088#define ABOUT_ID 236
Jack Jansen3469e991996-09-06 00:30:45 +000089
Jack Jansend081b131996-10-22 15:24:21 +000090/* No preferences file name resource */
Jack Jansen6b02ac21998-01-06 16:48:49 +000091#define NOPREFNAME_ID 237
Jack Jansend081b131996-10-22 15:24:21 +000092
Jack Jansena58d89e1996-10-11 13:19:52 +000093/* EditPythonPrefs range. Needed here to forestall conflicts with applets */
Jack Jansena83caa01996-12-23 17:23:23 +000094#define EDITPYTHONPREFS_MIN 508
Jack Jansena58d89e1996-10-11 13:19:52 +000095#define EDITPYTHONPREFS_MAX 511
Jack Jansena83caa01996-12-23 17:23:23 +000096/* twit range. Again needed to forestall conflicts with scripts using their own resources */
97#define TWIT_MIN 500
98#define TWIT_MAX 507
Jack Jansen001aa861997-05-28 11:54:43 +000099/* Bruce range. The same */
100#define BRUCE_MIN 468
101#define BRUCE_MAX 499
Jack Jansena58d89e1996-10-11 13:19:52 +0000102
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000103/*
104** The following are valid both in the binary (or shared library)
Jack Jansenab69eb91996-04-04 15:39:42 +0000105** and in the Preferences file.
Jack Jansen3d228871996-09-06 22:18:40 +0000106** For all these the override is tried first, in the application resource fork
107** only, this allows an applet to override standard settings.
108** If there is no override resource the preferences file is added to the head
109** of the resource file chain and the non-override version of the resource is
110** searched in any resource file.
111**
Jack Jansen6b02ac21998-01-06 16:48:49 +0000112** The effect of this is that, for example, a 'Popt' of 228 in the application or
Jack Jansen3d228871996-09-06 22:18:40 +0000113** shared library provides default options for use when no preferences are set,
Jack Jansen6b02ac21998-01-06 16:48:49 +0000114** while a 'Popt' of 229 (in the application *only*) overrides any options in the
Jack Jansen3d228871996-09-06 22:18:40 +0000115** preferences file.
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000116*/
117
Jack Jansend081b131996-10-22 15:24:21 +0000118/* The STR resource that holds the preference file name */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000119/* #define PREFFILENAME_ID 228 */
Jack Jansend081b131996-10-22 15:24:21 +0000120#define PREFFILENAME_NAME "\pPythonPreferenceFileName"
121
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000122/* The STR# resource for sys.path initialization */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000123#define PYTHONPATH_ID 228
124#define PYTHONPATHOVERRIDE_ID 229
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000125
126/* The alis resource for locating the python home directory */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000127#define PYTHONHOME_ID 228
128#define PYTHONHOMEOVERRIDE_ID 229
Jack Jansena4b7e141996-02-21 16:46:57 +0000129
130/* The Python options resource and offset of its members */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000131#define PYTHONOPTIONS_ID 228
132#define PYTHONOPTIONSOVERRIDE_ID 229
Jack Jansenc6bb2811997-09-09 13:50:40 +0000133#if 0
Jack Jansena4b7e141996-02-21 16:46:57 +0000134#define POPT_INSPECT 0
135#define POPT_VERBOSE 1
Jack Jansen447e01b1997-09-08 13:24:54 +0000136#define POPT_OPTIMIZE 2
Jack Jansena4b7e141996-02-21 16:46:57 +0000137#define POPT_UNBUFFERED 3
138#define POPT_DEBUGGING 4
139#define POPT_KEEPNORM 5
140#define POPT_KEEPERR 6
Jack Jansenc6bb2811997-09-09 13:50:40 +0000141#endif
Jack Jansen447e01b1997-09-08 13:24:54 +0000142
Jack Jansenc6bb2811997-09-09 13:50:40 +0000143#define POPT_VERSION_CURRENT 4 /* Current version number */
Jack Jansen01fbc681996-02-28 15:42:47 +0000144
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000145typedef struct PyMac_PrefRecord {
Jack Jansen447e01b1997-09-08 13:24:54 +0000146 unsigned char version;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000147 unsigned char inspect;
148 unsigned char verbose;
Jack Jansen447e01b1997-09-08 13:24:54 +0000149 unsigned char optimize;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000150 unsigned char unbuffered;
151 unsigned char debugging;
152 unsigned char keep_normal;
153 unsigned char keep_error;
154 unsigned char nointopt;
155 unsigned char noargs;
Jack Jansenc6bb2811997-09-09 13:50:40 +0000156 unsigned char oldexc;
157 unsigned char nosite;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000158} PyMac_PrefRecord;
159
Jack Jansen3d228871996-09-06 22:18:40 +0000160/* The GUSI options resources */
161#define GUSIOPTIONS_ID 10240
162#define GUSIOPTIONSOVERRIDE_ID 10241
Jack Jansen3469e991996-09-06 00:30:45 +0000163
Jack Jansen01fbc681996-02-28 15:42:47 +0000164/* From macgetpath.c: */
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000165void PyMac_PreferenceOptions Py_PROTO((PyMac_PrefRecord *));
Jack Jansen447e01b1997-09-08 13:24:54 +0000166char * PyMac_GetPythonDir Py_PROTO((void));