Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | make some more internal tables CONST |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-4-branch |
Files: | files | file ages | folders |
SHA1: |
aa7261636c2ac1e7b4d8fff7e9558389 |
User & Date: | jan.nijtmans 2012-04-18 18:08:37 |
Context
2012-04-20
| ||
12:16 | Use vroot size in stead of screen size for clipping window coordinates in ::tk::PlaceWindow. Use ::tk::PlaceWindow in dialog.tcl, in stead of dumplicating the code there. check-in: 53c95a25 user: jan.nijtmans tags: core-8-4-branch | |
2012-04-18
| ||
18:22 | make some internal tables const check-in: a1af7fc2 user: jan.nijtmans tags: core-8-5-branch | |
18:08 | make some more internal tables CONST check-in: aa726163 user: jan.nijtmans tags: core-8-4-branch | |
2012-04-17
| ||
21:12 | make loading of tk.dll in cygwin possible reduce command table size check-in: db6c2704 user: jan.nijtmans tags: core-8-4-branch | |
Changes
Changes to generic/tkArgv.c.
︙ | ︙ | |||
351 352 353 354 355 356 357 | int flags; /* If the TK_ARGV_NO_DEFAULTS bit is set * in this word, then don't generate * information for default options. */ { register Tk_ArgvInfo *infoPtr; int width, i, numSpaces; #define NUM_SPACES 20 | | | 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | int flags; /* If the TK_ARGV_NO_DEFAULTS bit is set * in this word, then don't generate * information for default options. */ { register Tk_ArgvInfo *infoPtr; int width, i, numSpaces; #define NUM_SPACES 20 static CONST char spaces[] = " "; char tmp[TCL_DOUBLE_SPACE]; /* * First, compute the width of the widest option key, so that we * can make everything line up. */ |
︙ | ︙ |
Changes to generic/tkAtom.c.
︙ | ︙ | |||
18 19 20 21 22 23 24 | #include "tkInt.h" /* * The following are a list of the predefined atom strings. * They should match those found in xatom.h */ | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "tkInt.h" /* * The following are a list of the predefined atom strings. * They should match those found in xatom.h */ static CONST char *atomNameArray[] = { "PRIMARY", "SECONDARY", "ARC", "ATOM", "BITMAP", "CARDINAL", "COLORMAP", "CURSOR", "CUT_BUFFER0", "CUT_BUFFER1", "CUT_BUFFER2", "CUT_BUFFER3", "CUT_BUFFER4", "CUT_BUFFER5", "CUT_BUFFER6", "CUT_BUFFER7", "DRAWABLE", "FONT", "INTEGER", "PIXMAP", "POINT", |
︙ | ︙ | |||
195 196 197 198 199 200 201 | dispPtr->atomInit = 1; Tcl_InitHashTable(&dispPtr->nameTable, TCL_STRING_KEYS); Tcl_InitHashTable(&dispPtr->atomTable, TCL_ONE_WORD_KEYS); for (atom = 1; atom <= XA_LAST_PREDEFINED; atom++) { hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom); if (hPtr == NULL) { | | | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | dispPtr->atomInit = 1; Tcl_InitHashTable(&dispPtr->nameTable, TCL_STRING_KEYS); Tcl_InitHashTable(&dispPtr->atomTable, TCL_ONE_WORD_KEYS); for (atom = 1; atom <= XA_LAST_PREDEFINED; atom++) { hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom); if (hPtr == NULL) { CONST char *name; int new; name = atomNameArray[atom - 1]; hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, (char *) name, &new); Tcl_SetHashValue(hPtr, atom); name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr); hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &new); Tcl_SetHashValue(hPtr, name); } } } |
Changes to generic/tkButton.c.
︙ | ︙ | |||
21 22 23 24 25 26 27 | static Tcl_ThreadDataKey dataKey; /* * Class names for buttons, indexed by one of the type values defined * in tkButton.h. */ | | | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | static Tcl_ThreadDataKey dataKey; /* * Class names for buttons, indexed by one of the type values defined * in tkButton.h. */ static CONST char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"}; /* * The following table defines the legal values for the -default option. * It is used together with the "enum defaultValue" declaration in tkButton.h. */ static CONST char *defaultStrings[] = { "active", "disabled", "normal", (char *) NULL }; /* * The following table defines the legal values for the -state option. * It is used together with the "enum state" declaration in tkButton.h. */ static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; /* * The following table defines the legal values for the -compound option. * It is used with the "enum compound" declaration in tkButton.h */ static CONST char *compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", (char *) NULL }; char tkDefButtonBorderWidth[TCL_INTEGER_SPACE] = DEF_BUTTON_BORDER_WIDTH; /* * Information used for parsing configuration options. There is a |
︙ | ︙ |
Changes to generic/tkEntry.c.
︙ | ︙ | |||
31 32 33 34 35 36 37 | /* * A comparison function for double values. For Spinboxes. */ #define MIN_DBL_VAL 1E-9 #define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL) | | | | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | /* * A comparison function for double values. For Spinboxes. */ #define MIN_DBL_VAL 1E-9 #define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL) static CONST char *stateStrings[] = { "disabled", "normal", "readonly", (char *) NULL }; /* * Definitions for -validate option values: */ static CONST char *validateStrings[] = { "all", "key", "focus", "focusin", "focusout", "none", (char *) NULL }; enum validateType { VALIDATE_ALL, VALIDATE_KEY, VALIDATE_FOCUS, VALIDATE_FOCUSIN, VALIDATE_FOCUSOUT, VALIDATE_NONE, /* * These extra enums are for use with EntryValidateChange |
︙ | ︙ |
Changes to generic/tkFrame.c.
︙ | ︙ | |||
166 167 168 169 170 171 172 | enum labelanchor { LABELANCHOR_E, LABELANCHOR_EN, LABELANCHOR_ES, LABELANCHOR_N, LABELANCHOR_NE, LABELANCHOR_NW, LABELANCHOR_S, LABELANCHOR_SE, LABELANCHOR_SW, LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS }; | | | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | enum labelanchor { LABELANCHOR_E, LABELANCHOR_EN, LABELANCHOR_ES, LABELANCHOR_N, LABELANCHOR_NE, LABELANCHOR_NW, LABELANCHOR_S, LABELANCHOR_SE, LABELANCHOR_SW, LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS }; static CONST char *labelAnchorStrings[] = { "e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws", (char *) NULL }; /* * Information used for parsing configuration options. There are * one common table used by all and one table for each widget class. |
︙ | ︙ | |||
298 299 300 301 302 303 304 | (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0} }; /* * Class names for widgets, indexed by FrameType. */ | | | | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0} }; /* * Class names for widgets, indexed by FrameType. */ static CONST char *classNames[] = {"Frame", "Toplevel", "Labelframe"}; /* * The following table maps from FrameType to the option template for * that class of widgets. */ static Tk_OptionSpec *optionSpecs[] = { frameOptSpec, toplevelOptSpec, labelframeOptSpec }; /* * Forward declarations for procedures defined later in this file: */ static void ComputeFrameGeometry _ANSI_ARGS_((Frame *framePtr)); |
︙ | ︙ |
Changes to generic/tkImgBmap.c.
︙ | ︙ | |||
1155 1156 1157 1158 1159 1160 1161 | /* * The bit order of bitmaps in Tk is the opposite of the bit order that * postscript uses. (In Tk, the least significant bit is on the right * side of the bitmap and in postscript the least significant bit is shown * on the left.) The following array is used to reverse the order of bits * within a byte so that the bits will be in the order postscript expects. */ | | | 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 | /* * The bit order of bitmaps in Tk is the opposite of the bit order that * postscript uses. (In Tk, the least significant bit is on the right * side of the bitmap and in postscript the least significant bit is shown * on the left.) The following array is used to reverse the order of bits * within a byte so that the bits will be in the order postscript expects. */ static CONST unsigned char bit_reverse[] = { 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252, 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242, 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250, 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246, |
︙ | ︙ |
Changes to generic/tkListbox.c.
︙ | ︙ | |||
206 207 208 209 210 211 212 | * string table below. */ enum state { STATE_DISABLED, STATE_NORMAL }; | | | | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | * string table below. */ enum state { STATE_DISABLED, STATE_NORMAL }; static CONST char *stateStrings[] = { "disabled", "normal", (char *) NULL }; enum activeStyle { ACTIVE_STYLE_DOTBOX, ACTIVE_STYLE_NONE, ACTIVE_STYLE_UNDERLINE }; static CONST char *activeStyleStrings[] = { "dotbox", "none", "underline", (char *) NULL }; /* * The optionSpecs table defines the valid configuration options for the * listbox widget */ |
︙ | ︙ |
Changes to generic/tkMenubutton.c.
︙ | ︙ | |||
17 18 19 20 21 22 23 | /* * The following table defines the legal values for the -direction * option. It is used together with the "enum direction" declaration * in tkMenubutton.h. */ | | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | /* * The following table defines the legal values for the -direction * option. It is used together with the "enum direction" declaration * in tkMenubutton.h. */ static CONST char *directionStrings[] = { "above", "below", "flush", "left", "right", (char *) NULL }; /* * The following table defines the legal values for the -state option. * It is used together with the "enum state" declaration in tkMenubutton.h. */ static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; /* * The following table defines the legal values for the -compound option. * It is used with the "enum compound" declaration in tkMenuButton.h */ static CONST char *compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", (char *) NULL }; /* * Information used for parsing configuration specs: */ |
︙ | ︙ |
Changes to generic/tkPanedWindow.c.
︙ | ︙ | |||
30 31 32 33 34 35 36 | #define STICK_EAST 2 #define STICK_SOUTH 4 #define STICK_WEST 8 /* * The following table defines the legal values for the -orient option. */ | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #define STICK_EAST 2 #define STICK_SOUTH 4 #define STICK_WEST 8 /* * The following table defines the legal values for the -orient option. */ static CONST char *orientStrings[] = { "horizontal", "vertical", (char *) NULL }; enum orient { ORIENT_HORIZONTAL, ORIENT_VERTICAL }; typedef struct { Tk_OptionTable pwOptions; /* Token for paned window option table. */ |
︙ | ︙ |
Changes to generic/tkPlace.c.
︙ | ︙ | |||
22 23 24 25 26 27 28 | * all borders of master window. * BM_OUTSIDE: relative distances computed using outside area * that includes all borders of master. * BM_IGNORE: border issues are ignored: place relative to * master's actual window size. */ | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | * all borders of master window. * BM_OUTSIDE: relative distances computed using outside area * that includes all borders of master. * BM_IGNORE: border issues are ignored: place relative to * master's actual window size. */ static CONST char *borderModeStrings[] = { "inside", "outside", "ignore", (char *) NULL }; typedef enum {BM_INSIDE, BM_OUTSIDE, BM_IGNORE} BorderMode; /* * For each window whose geometry is managed by the placer there is |
︙ | ︙ |
Changes to generic/tkScale.c.
︙ | ︙ | |||
26 27 28 29 30 31 32 | #include "tkScale.h" /* * The following table defines the legal values for the -orient option. * It is used together with the "enum orient" declaration in tkScale.h. */ | | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include "tkScale.h" /* * The following table defines the legal values for the -orient option. * It is used together with the "enum orient" declaration in tkScale.h. */ static CONST char *orientStrings[] = { "horizontal", "vertical", (char *) NULL }; /* * The following table defines the legal values for the -state option. * It is used together with the "enum state" declaration in tkScale.h. */ static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_SCALE_ACTIVE_BG_COLOR, -1, Tk_Offset(TkScale, activeBorder), 0, (ClientData) DEF_SCALE_ACTIVE_BG_MONO, 0}, |
︙ | ︙ |
Changes to generic/tkTest.c.
︙ | ︙ | |||
713 714 715 716 717 718 719 | Tcl_Obj *justifyPtr; Tcl_Obj *anchorPtr; Tcl_Obj *pixelPtr; Tcl_Obj *mmPtr; Tcl_Obj *customPtr; } TypesRecord; TypesRecord *recordPtr; | | | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 | Tcl_Obj *justifyPtr; Tcl_Obj *anchorPtr; Tcl_Obj *pixelPtr; Tcl_Obj *mmPtr; Tcl_Obj *customPtr; } TypesRecord; TypesRecord *recordPtr; static CONST char *stringTable[] = {"one", "two", "three", "four", (char *) NULL}; static Tk_OptionSpec typesSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", Tk_Offset(TypesRecord, booleanPtr), -1, 0, 0, 0x1}, {TK_OPTION_INT, "-integer", "integer", "Integer", |
︙ | ︙ | |||
1028 1029 1030 1031 1032 1033 1034 | Tk_Anchor anchor; int pixels; double mm; Tk_Window tkwin; char *custom; } InternalRecord; InternalRecord *recordPtr; | | | 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 | Tk_Anchor anchor; int pixels; double mm; Tk_Window tkwin; char *custom; } InternalRecord; InternalRecord *recordPtr; static CONST char *internalStringTable[] = { "one", "two", "three", "four", (char *) NULL }; static Tk_OptionSpec internalSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", -1, Tk_Offset(InternalRecord, boolean), 0, 0, 0x1}, {TK_OPTION_INT, |
︙ | ︙ |