Jack Jansen | 42218ce | 1997-01-31 16:15:11 +0000 | [diff] [blame] | 1 | /*********************************************************** |
| 2 | Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam, |
| 3 | The Netherlands. |
| 4 | |
| 5 | All Rights Reserved |
| 6 | |
| 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. |
| 14 | |
| 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. |
| 22 | |
| 23 | ******************************************************************/ |
| 24 | |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 25 | /* |
| 26 | ** Resource-IDs in use by Python. |
| 27 | ** |
| 28 | ** All resources used by the python interpreter itself fall |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 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. |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 31 | ** |
| 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 Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 44 | #define BASE_ID 228 |
| 45 | |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 46 | /* The alert for "No Python directory, where is it?" (OBSOLETE) */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 47 | #define NOPYTHON_ALERT BASE_ID+0 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 48 | #define YES_ITEM 1 |
| 49 | #define NO_ITEM 2 |
| 50 | #define CURWD_ITEM 3 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 51 | |
| 52 | /* The alert for "this is an applet template" */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 53 | #define NOPYC_ALERT BASE_ID+1 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 54 | |
| 55 | /* The dialog for our GetDirectory and PromptGetFile call */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 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 */ |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 60 | |
| 61 | |
| 62 | /* The dialog for interactive options */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 63 | #define OPT_DIALOG BASE_ID+3 /* Resource ID for dialog */ |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 64 | #define OPT_OK 1 |
| 65 | #define OPT_CANCEL 2 |
| 66 | #define OPT_INSPECT 3 |
| 67 | #define OPT_VERBOSE 4 |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 68 | #define OPT_OPTIMIZE 5 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 69 | #define OPT_UNBUFFERED 6 |
| 70 | #define OPT_DEBUGGING 7 |
Jack Jansen | 4a5eb96 | 2000-09-22 21:50:11 +0000 | [diff] [blame] | 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 |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame] | 76 | #define OPT_TABWARN 13 |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 77 | #define OPT_NOSITE 14 |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame] | 78 | #define OPT_HELP 15 |
| 79 | #define OPT_NONAVSERV 16 |
Jack Jansen | a5ffeb6 | 2001-09-01 22:36:29 +0000 | [diff] [blame] | 80 | #define OPT_VERBOSEVERBOSE 19 |
| 81 | #define OPT_DIVISIONWARN 20 |
| 82 | #define OPT_UNIXNEWLINES 21 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 83 | |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 84 | /* Dialog for 'No preferences directory' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 85 | #define NOPREFDIR_ID BASE_ID+5 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 86 | |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 87 | /* Dialog for 'Bad or outdated preferences' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 88 | #define BADPREFERENCES_ID BASE_ID+6 |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 89 | #define BADPREF_DELETE 1 |
| 90 | #define BADPREF_CONTINUE 2 |
| 91 | #define BADPREF_QUIT 3 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 92 | /* Dialog for 'Bad preference file' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 93 | #define BADPREFFILE_ID BASE_ID+7 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 94 | |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 95 | /* About box */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 96 | #define ABOUT_ID BASE_ID+8 |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 97 | |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 98 | /* No preferences file name resource */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 99 | #define NOPREFNAME_ID BASE_ID+9 |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 100 | |
Jack Jansen | cbed91b | 2001-08-03 13:31:36 +0000 | [diff] [blame] | 101 | /* Not a script */ |
| 102 | #define NOTASCRIPT_ID BASE_ID+10 |
| 103 | |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 104 | /* EditPythonPrefs range. Needed here to forestall conflicts with applets */ |
Jack Jansen | a83caa0 | 1996-12-23 17:23:23 +0000 | [diff] [blame] | 105 | #define EDITPYTHONPREFS_MIN 508 |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 106 | #define EDITPYTHONPREFS_MAX 511 |
Jack Jansen | a83caa0 | 1996-12-23 17:23:23 +0000 | [diff] [blame] | 107 | /* twit range. Again needed to forestall conflicts with scripts using their own resources */ |
| 108 | #define TWIT_MIN 500 |
| 109 | #define TWIT_MAX 507 |
Jack Jansen | 001aa86 | 1997-05-28 11:54:43 +0000 | [diff] [blame] | 110 | /* Bruce range. The same */ |
| 111 | #define BRUCE_MIN 468 |
| 112 | #define BRUCE_MAX 499 |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 113 | |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 114 | /* |
| 115 | ** The following are valid both in the binary (or shared library) |
Jack Jansen | ab69eb9 | 1996-04-04 15:39:42 +0000 | [diff] [blame] | 116 | ** and in the Preferences file. |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 117 | ** For all these the override is tried first, in the application resource fork |
| 118 | ** only, this allows an applet to override standard settings. |
| 119 | ** If there is no override resource the preferences file is added to the head |
| 120 | ** of the resource file chain and the non-override version of the resource is |
| 121 | ** searched in any resource file. |
| 122 | ** |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 123 | ** The effect of this is that, for example, a 'Popt' of 228 in the application or |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 124 | ** shared library provides default options for use when no preferences are set, |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 125 | ** while a 'Popt' of 229 (in the application *only*) overrides any options in the |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 126 | ** preferences file. |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 127 | */ |
| 128 | |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 129 | /* The STR resource that holds the preference file name */ |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 130 | #define PREFFILENAME_ID 228 /* For Rez only */ |
| 131 | #define PREFFILENAME_PASCAL_NAME "PythonPreferenceFileName" |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 132 | #define PREFFILENAME_NAME "\pPythonPreferenceFileName" |
| 133 | |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 134 | /* The STR# resource for sys.path initialization */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 135 | #define PYTHONPATH_ID 228 |
| 136 | #define PYTHONPATHOVERRIDE_ID 229 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 137 | |
| 138 | /* The alis resource for locating the python home directory */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 139 | #define PYTHONHOME_ID 228 |
| 140 | #define PYTHONHOMEOVERRIDE_ID 229 |
Jack Jansen | a4b7e14 | 1996-02-21 16:46:57 +0000 | [diff] [blame] | 141 | |
| 142 | /* The Python options resource and offset of its members */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 143 | #define PYTHONOPTIONS_ID 228 |
| 144 | #define PYTHONOPTIONSOVERRIDE_ID 229 |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 145 | |
Jack Jansen | a5ffeb6 | 2001-09-01 22:36:29 +0000 | [diff] [blame] | 146 | #define POPT_VERSION_CURRENT 8 /* Current version number */ |
Jack Jansen | 4a5eb96 | 2000-09-22 21:50:11 +0000 | [diff] [blame] | 147 | #define POPT_KEEPCONSOLE_NEVER 0 |
| 148 | #define POPT_KEEPCONSOLE_OUTPUT 1 |
| 149 | #define POPT_KEEPCONSOLE_ERROR 2 |
| 150 | #define POPT_KEEPCONSOLE_ALWAYS 3 |
Jack Jansen | 01fbc68 | 1996-02-28 15:42:47 +0000 | [diff] [blame] | 151 | |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 152 | #ifndef rez |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 153 | typedef struct PyMac_PrefRecord { |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 154 | unsigned char version; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 155 | unsigned char inspect; |
| 156 | unsigned char verbose; |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 157 | unsigned char optimize; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 158 | unsigned char unbuffered; |
| 159 | unsigned char debugging; |
Jack Jansen | 4a5eb96 | 2000-09-22 21:50:11 +0000 | [diff] [blame] | 160 | unsigned char unused; |
| 161 | unsigned char keep_console; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 162 | unsigned char nointopt; |
| 163 | unsigned char noargs; |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame] | 164 | unsigned char tabwarn; |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 165 | unsigned char nosite; |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame] | 166 | unsigned char nonavservice; |
Jack Jansen | 8a38714 | 2001-02-11 01:08:04 +0000 | [diff] [blame] | 167 | unsigned char delayconsole; |
Jack Jansen | a5ffeb6 | 2001-09-01 22:36:29 +0000 | [diff] [blame] | 168 | unsigned char divisionwarn; |
| 169 | unsigned char unixnewlines; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 170 | } PyMac_PrefRecord; |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 171 | #endif |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 172 | |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 173 | /* The GUSI options resources */ |
| 174 | #define GUSIOPTIONS_ID 10240 |
| 175 | #define GUSIOPTIONSOVERRIDE_ID 10241 |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 176 | |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 177 | #ifndef rez |
Jack Jansen | 01fbc68 | 1996-02-28 15:42:47 +0000 | [diff] [blame] | 178 | /* From macgetpath.c: */ |
Jack Jansen | d88296d | 2000-07-11 19:51:05 +0000 | [diff] [blame] | 179 | void PyMac_PreferenceOptions(PyMac_PrefRecord *); |
| 180 | char * PyMac_GetPythonDir(void); |
Jack Jansen | d5fd45f | 2000-10-13 19:44:40 +0000 | [diff] [blame] | 181 | /* from macmain.c: */ |
| 182 | extern PyMac_PrefRecord PyMac_options; |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 183 | #endif |