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