blob: 534d9ea3d8169ffdb6d1e8568f34cdb8a44b92fa [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*/
Jack Jansen47ec1412002-09-10 12:32:47 +000043#ifndef Py_PYTHONRESOURCES_H
44#define Py_PYTHONRESOURCES_H
45
46#ifdef __cplusplus
47 extern "C" {
48#endif
Jack Jansenc2e6dd81995-08-14 12:34:42 +000049
Jack Jansen8f5725a1999-12-07 23:08:10 +000050#define BASE_ID 228
51
Jack Jansenc2e6dd81995-08-14 12:34:42 +000052/* The alert for "this is an applet template" */
Jack Jansen8f5725a1999-12-07 23:08:10 +000053#define NOPYC_ALERT BASE_ID+1
Jack Jansenc2e6dd81995-08-14 12:34:42 +000054
Jack Jansenc2e6dd81995-08-14 12:34:42 +000055
56/* The dialog for interactive options */
Jack Jansen8f5725a1999-12-07 23:08:10 +000057#define OPT_DIALOG BASE_ID+3 /* Resource ID for dialog */
Jack Jansenc2e6dd81995-08-14 12:34:42 +000058#define OPT_OK 1
59#define OPT_CANCEL 2
60#define OPT_INSPECT 3
61#define OPT_VERBOSE 4
Jack Jansenc6bb2811997-09-09 13:50:40 +000062#define OPT_OPTIMIZE 5
Jack Jansenc2e6dd81995-08-14 12:34:42 +000063#define OPT_UNBUFFERED 6
64#define OPT_DEBUGGING 7
Jack Jansen4a5eb962000-09-22 21:50:11 +000065#define OPT_KEEPALWAYS 8
66#define OPT_KEEPOUTPUT 9
67#define OPT_KEEPERROR 10
68#define OPT_KEEPNEVER 11
69#define OPT_CMDLINE 12
Jack Jansene4d7b5e2000-05-07 22:07:26 +000070#define OPT_TABWARN 13
Jack Jansenc6bb2811997-09-09 13:50:40 +000071#define OPT_NOSITE 14
Jack Jansene4d7b5e2000-05-07 22:07:26 +000072#define OPT_HELP 15
73#define OPT_NONAVSERV 16
Jack Jansena5ffeb62001-09-01 22:36:29 +000074#define OPT_VERBOSEVERBOSE 19
75#define OPT_DIVISIONWARN 20
76#define OPT_UNIXNEWLINES 21
Jack Jansenc2e6dd81995-08-14 12:34:42 +000077
Jack Jansen41fa7ea1995-08-31 13:59:36 +000078/* Dialog for 'No preferences directory' */
Jack Jansen8f5725a1999-12-07 23:08:10 +000079#define NOPREFDIR_ID BASE_ID+5
Jack Jansen41fa7ea1995-08-31 13:59:36 +000080
Jack Jansen447e01b1997-09-08 13:24:54 +000081/* Dialog for 'Bad or outdated preferences' */
Jack Jansen8f5725a1999-12-07 23:08:10 +000082#define BADPREFERENCES_ID BASE_ID+6
Jack Jansen447e01b1997-09-08 13:24:54 +000083#define BADPREF_DELETE 1
84#define BADPREF_CONTINUE 2
85#define BADPREF_QUIT 3
Jack Jansen41fa7ea1995-08-31 13:59:36 +000086/* Dialog for 'Bad preference file' */
Jack Jansen8f5725a1999-12-07 23:08:10 +000087#define BADPREFFILE_ID BASE_ID+7
Jack Jansen41fa7ea1995-08-31 13:59:36 +000088
Jack Jansen3469e991996-09-06 00:30:45 +000089/* About box */
Jack Jansen8f5725a1999-12-07 23:08:10 +000090#define ABOUT_ID BASE_ID+8
Jack Jansen3469e991996-09-06 00:30:45 +000091
Jack Jansend081b131996-10-22 15:24:21 +000092/* No preferences file name resource */
Jack Jansen8f5725a1999-12-07 23:08:10 +000093#define NOPREFNAME_ID BASE_ID+9
Jack Jansend081b131996-10-22 15:24:21 +000094
Jack Jansencbed91b2001-08-03 13:31:36 +000095/* Not a script */
96#define NOTASCRIPT_ID BASE_ID+10
97
Jack Jansena58d89e1996-10-11 13:19:52 +000098/* EditPythonPrefs range. Needed here to forestall conflicts with applets */
Jack Jansena83caa01996-12-23 17:23:23 +000099#define EDITPYTHONPREFS_MIN 508
Jack Jansena58d89e1996-10-11 13:19:52 +0000100#define EDITPYTHONPREFS_MAX 511
Jack Jansena83caa01996-12-23 17:23:23 +0000101/* twit range. Again needed to forestall conflicts with scripts using their own resources */
102#define TWIT_MIN 500
103#define TWIT_MAX 507
Jack Jansen001aa861997-05-28 11:54:43 +0000104/* Bruce range. The same */
105#define BRUCE_MIN 468
106#define BRUCE_MAX 499
Jack Jansena58d89e1996-10-11 13:19:52 +0000107
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000108/*
109** The following are valid both in the binary (or shared library)
Jack Jansenab69eb91996-04-04 15:39:42 +0000110** and in the Preferences file.
Jack Jansen3d228871996-09-06 22:18:40 +0000111** 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.
116**
Jack Jansen6b02ac21998-01-06 16:48:49 +0000117** The effect of this is that, for example, a 'Popt' of 228 in the application or
Jack Jansen3d228871996-09-06 22:18:40 +0000118** shared library provides default options for use when no preferences are set,
Jack Jansen6b02ac21998-01-06 16:48:49 +0000119** while a 'Popt' of 229 (in the application *only*) overrides any options in the
Jack Jansen3d228871996-09-06 22:18:40 +0000120** preferences file.
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000121*/
122
Jack Jansend081b131996-10-22 15:24:21 +0000123/* The STR resource that holds the preference file name */
Jack Jansen245d1791999-01-30 13:21:24 +0000124#define PREFFILENAME_ID 228 /* For Rez only */
125#define PREFFILENAME_PASCAL_NAME "PythonPreferenceFileName"
Jack Jansend081b131996-10-22 15:24:21 +0000126#define PREFFILENAME_NAME "\pPythonPreferenceFileName"
127
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000128/* The STR# resource for sys.path initialization */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000129#define PYTHONPATH_ID 228
130#define PYTHONPATHOVERRIDE_ID 229
Jack Jansenc2e6dd81995-08-14 12:34:42 +0000131
132/* The alis resource for locating the python home directory */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000133#define PYTHONHOME_ID 228
134#define PYTHONHOMEOVERRIDE_ID 229
Jack Jansena4b7e141996-02-21 16:46:57 +0000135
136/* The Python options resource and offset of its members */
Jack Jansen6b02ac21998-01-06 16:48:49 +0000137#define PYTHONOPTIONS_ID 228
138#define PYTHONOPTIONSOVERRIDE_ID 229
Jack Jansen447e01b1997-09-08 13:24:54 +0000139
Jack Jansena5ffeb62001-09-01 22:36:29 +0000140#define POPT_VERSION_CURRENT 8 /* Current version number */
Jack Jansen4a5eb962000-09-22 21:50:11 +0000141#define POPT_KEEPCONSOLE_NEVER 0
142#define POPT_KEEPCONSOLE_OUTPUT 1
143#define POPT_KEEPCONSOLE_ERROR 2
144#define POPT_KEEPCONSOLE_ALWAYS 3
Jack Jansen01fbc681996-02-28 15:42:47 +0000145
Jack Jansen245d1791999-01-30 13:21:24 +0000146#ifndef rez
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000147typedef struct PyMac_PrefRecord {
Jack Jansen447e01b1997-09-08 13:24:54 +0000148 unsigned char version;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000149 unsigned char inspect;
150 unsigned char verbose;
Jack Jansen447e01b1997-09-08 13:24:54 +0000151 unsigned char optimize;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000152 unsigned char unbuffered;
153 unsigned char debugging;
Jack Jansen4a5eb962000-09-22 21:50:11 +0000154 unsigned char unused;
155 unsigned char keep_console;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000156 unsigned char nointopt;
157 unsigned char noargs;
Jack Jansene4d7b5e2000-05-07 22:07:26 +0000158 unsigned char tabwarn;
Jack Jansenc6bb2811997-09-09 13:50:40 +0000159 unsigned char nosite;
Jack Jansene4d7b5e2000-05-07 22:07:26 +0000160 unsigned char nonavservice;
Jack Jansen8a387142001-02-11 01:08:04 +0000161 unsigned char delayconsole;
Jack Jansena5ffeb62001-09-01 22:36:29 +0000162 unsigned char divisionwarn;
163 unsigned char unixnewlines;
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000164} PyMac_PrefRecord;
Jack Jansen245d1791999-01-30 13:21:24 +0000165#endif
Jack Jansen7d5f9e81996-09-07 17:09:31 +0000166
Jack Jansen3d228871996-09-06 22:18:40 +0000167/* The GUSI options resources */
168#define GUSIOPTIONS_ID 10240
169#define GUSIOPTIONSOVERRIDE_ID 10241
Jack Jansen3469e991996-09-06 00:30:45 +0000170
Jack Jansen245d1791999-01-30 13:21:24 +0000171#ifndef rez
Jack Jansen01fbc681996-02-28 15:42:47 +0000172/* From macgetpath.c: */
Jack Jansend88296d2000-07-11 19:51:05 +0000173void PyMac_PreferenceOptions(PyMac_PrefRecord *);
174char * PyMac_GetPythonDir(void);
Jack Jansend5fd45f2000-10-13 19:44:40 +0000175/* from macmain.c: */
176extern PyMac_PrefRecord PyMac_options;
Jack Jansen8f5725a1999-12-07 23:08:10 +0000177#endif
Jack Jansen47ec1412002-09-10 12:32:47 +0000178
179#ifdef __cplusplus
180}
181#endif
182
183#endif