blob: af921d2a66a000aa1031df29ff3c70d2d370230b [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
29** in the range 128-256.
30**
31** Standard python modules use resources in the range
32** 256-512.
33**
34** Python programs that use their own resources are advised to
35** choose resource numbers higher than 512.
36*/
37
38/*
39** Resources that reside in the python executable (or, for
40** shared ppc python, in the core dynamic library)
41*/
42
Jack Jansen41fa7ea1995-08-31 13:59:36 +000043/* The alert for "No Python directory, where is it?" (OBSOLETE) */
44#define NOPYTHON_ALERT 128
45#define YES_ITEM 1
46#define NO_ITEM 2
47#define CURWD_ITEM 3
Jack Jansenc2e6dd81995-08-14 12:34:42 +000048
49/* The alert for "this is an applet template" */
Jack Jansen41fa7ea1995-08-31 13:59:36 +000050#define NOPYC_ALERT 129
Jack Jansenc2e6dd81995-08-14 12:34:42 +000051
52/* The dialog for our GetDirectory and PromptGetFile call */
Jack Jansen41fa7ea1995-08-31 13:59:36 +000053#define GETDIR_ID 130 /* Resource ID for our "get directory" */
Jack Jansenc2e6dd81995-08-14 12:34:42 +000054#define GETFILEPROMPT_ID 132 /* Resource id for prompted get file */
Jack Jansen41fa7ea1995-08-31 13:59:36 +000055#define PROMPT_ITEM 10 /* The prompt, at the top */
56#define SELECTCUR_ITEM 11 /* "Select current directory" button */
Jack Jansenc2e6dd81995-08-14 12:34:42 +000057
58
59/* The dialog for interactive options */
60#define OPT_DIALOG 131 /* Resource ID for dialog */
61#define OPT_OK 1
62#define OPT_CANCEL 2
63#define OPT_INSPECT 3
64#define OPT_VERBOSE 4
65#define OPT_SUPPRESS 5
66#define OPT_UNBUFFERED 6
67#define OPT_DEBUGGING 7
Jack Jansen0168f271995-10-27 13:32:30 +000068#define OPT_KEEPNORMAL 8
69#define OPT_KEEPERROR 9
Jack Jansene355c451996-03-12 13:29:04 +000070#define OPT_CMDLINE 10
Jack Jansenc2e6dd81995-08-14 12:34:42 +000071
Jack Jansen41fa7ea1995-08-31 13:59:36 +000072/* Dialog for 'No preferences directory' */
73#define NOPREFDIR_ID 133
74
75/* Dialog for 'Create preferences file?' */
76#define NOPREFFILE_ID 134
77#define NOPREFFILE_YES 1
78#define NOPREFFILE_NO 2
79
80/* Dialog for 'Bad preference file' */
81#define BADPREFFILE_ID 135
82
Jack Jansen3469e991996-09-06 00:30:45 +000083/* About box */
84#define ABOUT_ID 136
85
Jack Jansend081b131996-10-22 15:24:21 +000086/* No preferences file name resource */
87#define NOPREFNAME_ID 137
88
Jack Jansena58d89e1996-10-11 13:19:52 +000089/* EditPythonPrefs range. Needed here to forestall conflicts with applets */
Jack Jansena83caa01996-12-23 17:23:23 +000090#define EDITPYTHONPREFS_MIN 508
Jack Jansena58d89e1996-10-11 13:19:52 +000091#define EDITPYTHONPREFS_MAX 511
Jack Jansena83caa01996-12-23 17:23:23 +000092/* twit range. Again needed to forestall conflicts with scripts using their own resources */
93#define TWIT_MIN 500
94#define TWIT_MAX 507
Jack Jansen001aa861997-05-28 11:54:43 +000095/* Bruce range. The same */
96#define BRUCE_MIN 468
97#define BRUCE_MAX 499
Jack Jansena58d89e1996-10-11 13:19:52 +000098
Jack Jansenc2e6dd81995-08-14 12:34:42 +000099/*
100** The following are valid both in the binary (or shared library)
Jack Jansenab69eb91996-04-04 15:39:42 +0000101** and in the Preferences file.
Jack Jansen3d228871996-09-06 22:18:40 +0000102** For all these the override is tried first, in the application resource fork
103** only, this allows an applet to override standard settings.
104** If there is no override resource the preferences file is added to the head
105** of the resource file chain and the non-override version of the resource is
106** searched in any resource file.
107**
108** The effect of this is that, for example, a 'Popt' of 128 in the application or
109** shared library provides default options for use when no preferences are set,
110** while a 'Popt' of 129 (in the application *only*) overrides any options in the
111** preferences file.
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000112*/
113
Jack Jansend081b131996-10-22 15:24:21 +0000114/* The STR resource that holds the preference file name */
115/* #define PREFFILENAME_ID 128 */
116#define PREFFILENAME_NAME "\pPythonPreferenceFileName"
117
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000118/* The STR# resource for sys.path initialization */
119#define PYTHONPATH_ID 128
Jack Jansenab69eb91996-04-04 15:39:42 +0000120#define PYTHONPATHOVERRIDE_ID 129
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000121
122/* The alis resource for locating the python home directory */
123#define PYTHONHOME_ID 128
Jack Jansenab69eb91996-04-04 15:39:42 +0000124#define PYTHONHOMEOVERRIDE_ID 129
Jack Jansena4b7e141996-02-21 16:46:57 +0000125
126/* The Python options resource and offset of its members */
127#define PYTHONOPTIONS_ID 128
Jack Jansenab69eb91996-04-04 15:39:42 +0000128#define PYTHONOPTIONSOVERRIDE_ID 129
Jack Jansena4b7e141996-02-21 16:46:57 +0000129#define POPT_INSPECT 0
130#define POPT_VERBOSE 1
131#define POPT_SUPPRESS 2
132#define POPT_UNBUFFERED 3
133#define POPT_DEBUGGING 4
134#define POPT_KEEPNORM 5
135#define POPT_KEEPERR 6
Jack Jansen3d228871996-09-06 22:18:40 +0000136#define POPT_NOINTOPT 7 /* Not settable interactively */
137#define POPT_NOARGS 8 /* Not settable interactively */
Jack Jansen01fbc681996-02-28 15:42:47 +0000138
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000139typedef struct PyMac_PrefRecord {
140 unsigned char inspect;
141 unsigned char verbose;
142 unsigned char suppress_print;
143 unsigned char unbuffered;
144 unsigned char debugging;
145 unsigned char keep_normal;
146 unsigned char keep_error;
147 unsigned char nointopt;
148 unsigned char noargs;
149} PyMac_PrefRecord;
150
Jack Jansen3d228871996-09-06 22:18:40 +0000151/* The GUSI options resources */
152#define GUSIOPTIONS_ID 10240
153#define GUSIOPTIONSOVERRIDE_ID 10241
Jack Jansen3469e991996-09-06 00:30:45 +0000154
Jack Jansen01fbc681996-02-28 15:42:47 +0000155/* From macgetpath.c: */
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000156void PyMac_PreferenceOptions Py_PROTO((PyMac_PrefRecord *));
Jack Jansen01fbc681996-02-28 15:42:47 +0000157
Jack Jansena4b7e141996-02-21 16:46:57 +0000158