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 | 0168f27 | 1995-10-27 13:32:30 +0000 | [diff] [blame] | 71 | #define OPT_KEEPNORMAL 8 |
| 72 | #define OPT_KEEPERROR 9 |
Jack Jansen | e355c45 | 1996-03-12 13:29:04 +0000 | [diff] [blame] | 73 | #define OPT_CMDLINE 10 |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame^] | 74 | #define OPT_TABWARN 13 |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 75 | #define OPT_NOSITE 14 |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame^] | 76 | #define OPT_HELP 15 |
| 77 | #define OPT_NONAVSERV 16 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 78 | |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 79 | /* Dialog for 'No preferences directory' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 80 | #define NOPREFDIR_ID BASE_ID+5 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 81 | |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 82 | /* Dialog for 'Bad or outdated preferences' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 83 | #define BADPREFERENCES_ID BASE_ID+6 |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 84 | #define BADPREF_DELETE 1 |
| 85 | #define BADPREF_CONTINUE 2 |
| 86 | #define BADPREF_QUIT 3 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 87 | /* Dialog for 'Bad preference file' */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 88 | #define BADPREFFILE_ID BASE_ID+7 |
Jack Jansen | 41fa7ea | 1995-08-31 13:59:36 +0000 | [diff] [blame] | 89 | |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 90 | /* About box */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 91 | #define ABOUT_ID BASE_ID+8 |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 92 | |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 93 | /* No preferences file name resource */ |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 94 | #define NOPREFNAME_ID BASE_ID+9 |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 95 | |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 96 | /* EditPythonPrefs range. Needed here to forestall conflicts with applets */ |
Jack Jansen | a83caa0 | 1996-12-23 17:23:23 +0000 | [diff] [blame] | 97 | #define EDITPYTHONPREFS_MIN 508 |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 98 | #define EDITPYTHONPREFS_MAX 511 |
Jack Jansen | a83caa0 | 1996-12-23 17:23:23 +0000 | [diff] [blame] | 99 | /* twit range. Again needed to forestall conflicts with scripts using their own resources */ |
| 100 | #define TWIT_MIN 500 |
| 101 | #define TWIT_MAX 507 |
Jack Jansen | 001aa86 | 1997-05-28 11:54:43 +0000 | [diff] [blame] | 102 | /* Bruce range. The same */ |
| 103 | #define BRUCE_MIN 468 |
| 104 | #define BRUCE_MAX 499 |
Jack Jansen | a58d89e | 1996-10-11 13:19:52 +0000 | [diff] [blame] | 105 | |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 106 | /* |
| 107 | ** The following are valid both in the binary (or shared library) |
Jack Jansen | ab69eb9 | 1996-04-04 15:39:42 +0000 | [diff] [blame] | 108 | ** and in the Preferences file. |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 109 | ** For all these the override is tried first, in the application resource fork |
| 110 | ** only, this allows an applet to override standard settings. |
| 111 | ** If there is no override resource the preferences file is added to the head |
| 112 | ** of the resource file chain and the non-override version of the resource is |
| 113 | ** searched in any resource file. |
| 114 | ** |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 115 | ** 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] | 116 | ** shared library provides default options for use when no preferences are set, |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 117 | ** 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] | 118 | ** preferences file. |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 119 | */ |
| 120 | |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 121 | /* The STR resource that holds the preference file name */ |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 122 | #define PREFFILENAME_ID 228 /* For Rez only */ |
| 123 | #define PREFFILENAME_PASCAL_NAME "PythonPreferenceFileName" |
Jack Jansen | d081b13 | 1996-10-22 15:24:21 +0000 | [diff] [blame] | 124 | #define PREFFILENAME_NAME "\pPythonPreferenceFileName" |
| 125 | |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 126 | /* The STR# resource for sys.path initialization */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 127 | #define PYTHONPATH_ID 228 |
| 128 | #define PYTHONPATHOVERRIDE_ID 229 |
Jack Jansen | c2e6dd8 | 1995-08-14 12:34:42 +0000 | [diff] [blame] | 129 | |
| 130 | /* The alis resource for locating the python home directory */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 131 | #define PYTHONHOME_ID 228 |
| 132 | #define PYTHONHOMEOVERRIDE_ID 229 |
Jack Jansen | a4b7e14 | 1996-02-21 16:46:57 +0000 | [diff] [blame] | 133 | |
| 134 | /* The Python options resource and offset of its members */ |
Jack Jansen | 6b02ac2 | 1998-01-06 16:48:49 +0000 | [diff] [blame] | 135 | #define PYTHONOPTIONS_ID 228 |
| 136 | #define PYTHONOPTIONSOVERRIDE_ID 229 |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 137 | #if 0 |
Jack Jansen | a4b7e14 | 1996-02-21 16:46:57 +0000 | [diff] [blame] | 138 | #define POPT_INSPECT 0 |
| 139 | #define POPT_VERBOSE 1 |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 140 | #define POPT_OPTIMIZE 2 |
Jack Jansen | a4b7e14 | 1996-02-21 16:46:57 +0000 | [diff] [blame] | 141 | #define POPT_UNBUFFERED 3 |
| 142 | #define POPT_DEBUGGING 4 |
| 143 | #define POPT_KEEPNORM 5 |
| 144 | #define POPT_KEEPERR 6 |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 145 | #endif |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 146 | |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame^] | 147 | #define POPT_VERSION_CURRENT 5 /* Current version number */ |
Jack Jansen | 01fbc68 | 1996-02-28 15:42:47 +0000 | [diff] [blame] | 148 | |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 149 | #ifndef rez |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 150 | typedef struct PyMac_PrefRecord { |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 151 | unsigned char version; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 152 | unsigned char inspect; |
| 153 | unsigned char verbose; |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 154 | unsigned char optimize; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 155 | unsigned char unbuffered; |
| 156 | unsigned char debugging; |
| 157 | unsigned char keep_normal; |
| 158 | unsigned char keep_error; |
| 159 | unsigned char nointopt; |
| 160 | unsigned char noargs; |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame^] | 161 | unsigned char tabwarn; |
Jack Jansen | c6bb281 | 1997-09-09 13:50:40 +0000 | [diff] [blame] | 162 | unsigned char nosite; |
Jack Jansen | e4d7b5e | 2000-05-07 22:07:26 +0000 | [diff] [blame^] | 163 | unsigned char nonavservice; |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 164 | } PyMac_PrefRecord; |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 165 | #endif |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 166 | |
Jack Jansen | 3d22887 | 1996-09-06 22:18:40 +0000 | [diff] [blame] | 167 | /* The GUSI options resources */ |
| 168 | #define GUSIOPTIONS_ID 10240 |
| 169 | #define GUSIOPTIONSOVERRIDE_ID 10241 |
Jack Jansen | 3469e99 | 1996-09-06 00:30:45 +0000 | [diff] [blame] | 170 | |
Jack Jansen | 245d179 | 1999-01-30 13:21:24 +0000 | [diff] [blame] | 171 | #ifndef rez |
Jack Jansen | 01fbc68 | 1996-02-28 15:42:47 +0000 | [diff] [blame] | 172 | /* From macgetpath.c: */ |
Jack Jansen | 7d5f9e8 | 1996-09-07 17:09:31 +0000 | [diff] [blame] | 173 | void PyMac_PreferenceOptions Py_PROTO((PyMac_PrefRecord *)); |
Jack Jansen | 447e01b | 1997-09-08 13:24:54 +0000 | [diff] [blame] | 174 | char * PyMac_GetPythonDir Py_PROTO((void)); |
Jack Jansen | 8f5725a | 1999-12-07 23:08:10 +0000 | [diff] [blame] | 175 | #endif |