diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-22 11:32:30 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-22 11:32:30 (GMT) |
commit | 4ff5c4550c95c7826e799567115b825bbc402d81 (patch) | |
tree | 248a1cba93c46b3e455088839c0f88f5f101ace8 /generic | |
parent | 47959a65e0ee7afdac78bdd4e9364143071c8c99 (diff) | |
parent | 418047d43e5fde9bc3489580cc881324f5f3da7d (diff) | |
download | tk-4ff5c4550c95c7826e799567115b825bbc402d81.zip tk-4ff5c4550c95c7826e799567115b825bbc402d81.tar.gz tk-4ff5c4550c95c7826e799567115b825bbc402d81.tar.bz2 |
More progress
Diffstat (limited to 'generic')
56 files changed, 960 insertions, 955 deletions
diff --git a/generic/tk.h b/generic/tk.h index 5bed741..3282bd2 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -196,7 +196,7 @@ typedef struct Tk_OptionSpec { * holds the value of this option, specified * as an offset in bytes from the start of the * record. Use the offsetof macro to generate - * values for this. TCL_AUTO_LENGTH means don't + * values for this. TCL_INDEX_NONE means don't * store the Tcl_Obj in the record. */ size_t internalOffset; /* Where in record to store the internal * representation of the value of this option, @@ -204,7 +204,7 @@ typedef struct Tk_OptionSpec { * specified as an offset in bytes from the * start of the record. Use the offsetof * macro to generate values for it. - * TCL_AUTO_LENGTH means don't store the + * TCL_INDEX_NONE means don't store the * internal representation in the record. */ #else int objOffset; @@ -238,11 +238,19 @@ typedef struct Tk_OptionSpec { * option config code to handle a custom option. */ +#if TCL_MAJOR_VERSION > 8 +typedef int (Tk_CustomOptionSetProc) (ClientData clientData, + Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, + size_t offset, char *saveInternalPtr, int flags); +typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, + Tk_Window tkwin, char *widgRec, size_t offset); +#else typedef int (Tk_CustomOptionSetProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec, int offset, char *saveInternalPtr, int flags); typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset); +#endif typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData, Tk_Window tkwin, char *internalPtr, char *saveInternalPtr); typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin, @@ -346,10 +354,17 @@ typedef struct Tk_SavedOptions { #ifndef __NO_OLD_CONFIG +#if TCL_MAJOR_VERSION > 8 typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset); + Tk_Window tkwin, const char *value, char *widgRec, size_t offset); +typedef const char *(Tk_OptionPrintProc) (ClientData clientData, + Tk_Window tkwin, char *widgRec, size_t offset, Tcl_FreeProc **freeProcPtr); +#else +typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp, + Tk_Window tkwin, const char *value, char *widgRec, size_t offset); typedef const char *(Tk_OptionPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); +#endif typedef struct Tk_CustomOption { Tk_OptionParseProc *parseProc; diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 124ee68..5014eeb 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -23,7 +23,7 @@ static const Tk_OptionSpec busyOptionSpecs[] = { {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUSY_CURSOR, TCL_AUTO_LENGTH, offsetof(Busy, cursor), + DEF_BUSY_CURSOR, TCL_INDEX_NONE, offsetof(Busy, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/tkButton.c b/generic/tkButton.c index e13eafc..8056f31 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -70,60 +70,60 @@ char tkDefLabelPady[TCL_INTEGER_SPACE] = DEF_LABCHKRAD_PADY; static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_BUTTON_ACTIVE_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeFg), + DEF_BUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, TCL_AUTO_LENGTH, offsetof(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, TCL_AUTO_LENGTH, offsetof(TkButton, bitmap), + DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(TkButton, cursor), + DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, + TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, TCL_AUTO_LENGTH, offsetof(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_BUTTON_FG, TCL_AUTO_LENGTH, offsetof(TkButton, normalFg), 0, 0, 0}, + DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, highlightBorder), 0, + TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefLabelHighlightWidth, offsetof(TkButton, highlightWidthPtr), offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, TCL_AUTO_LENGTH, offsetof(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", tkDefLabelPadx, offsetof(TkButton, padXPtr), offsetof(TkButton, padX), 0, 0, 0}, @@ -131,22 +131,22 @@ static const Tk_OptionSpec labelOptionSpecs[] = { tkDefLabelPady, offsetof(TkButton, padYPtr), offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, TCL_AUTO_LENGTH, offsetof(TkButton, state), + DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_LABEL_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_AUTO_LENGTH, + DEF_LABEL_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), offsetof(TkButton, wrapLength), 0, 0, 0}, @@ -155,68 +155,68 @@ static const Tk_OptionSpec labelOptionSpecs[] = { static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_BUTTON_ACTIVE_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeFg), + DEF_BUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, TCL_AUTO_LENGTH, offsetof(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, TCL_AUTO_LENGTH, offsetof(TkButton, bitmap), + DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(TkButton, cursor), + DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", - DEF_BUTTON_DEFAULT, TCL_AUTO_LENGTH, offsetof(TkButton, defaultState), + DEF_BUTTON_DEFAULT, TCL_INDEX_NONE, offsetof(TkButton, defaultState), 0, defaultStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, + TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, TCL_AUTO_LENGTH, offsetof(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_BUTTON_FG, TCL_AUTO_LENGTH, offsetof(TkButton, normalFg), 0, 0, 0}, + DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, highlightBorder), 0, + TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, offsetof(TkButton, highlightWidthPtr), offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, TCL_AUTO_LENGTH, offsetof(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", tkDefButtonPadx, offsetof(TkButton, padXPtr), @@ -225,104 +225,104 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { tkDefButtonPady, offsetof(TkButton, padYPtr), offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_BUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, relief), + DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_BUTTON_REPEAT_DELAY, TCL_AUTO_LENGTH, offsetof(TkButton, repeatDelay), + DEF_BUTTON_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(TkButton, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_BUTTON_REPEAT_INTERVAL, TCL_AUTO_LENGTH, offsetof(TkButton, repeatInterval), + DEF_BUTTON_REPEAT_INTERVAL, TCL_INDEX_NONE, offsetof(TkButton, repeatInterval), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, TCL_AUTO_LENGTH, offsetof(TkButton, state), + DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), offsetof(TkButton, wrapLength), 0, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeFg), + DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, TCL_AUTO_LENGTH, offsetof(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, TCL_AUTO_LENGTH, offsetof(TkButton, bitmap), + DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(TkButton, cursor), + DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, + TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, TCL_AUTO_LENGTH, offsetof(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_CHKRAD_FG, TCL_AUTO_LENGTH, offsetof(TkButton, normalFg), 0, 0, 0}, + DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, highlightBorder), 0, + TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, offsetof(TkButton, highlightWidthPtr), offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_BUTTON_INDICATOR, TCL_AUTO_LENGTH, offsetof(TkButton, indicatorOn), 0, 0, 0}, + DEF_BUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, TCL_AUTO_LENGTH, offsetof(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief", - DEF_BUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, offRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_STRING, "-offvalue", "offValue", "Value", - DEF_BUTTON_OFF_VALUE, offsetof(TkButton, offValuePtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_OFF_VALUE, offsetof(TkButton, offValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-onvalue", "onValue", "Value", - DEF_BUTTON_ON_VALUE, offsetof(TkButton, onValuePtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_ON_VALUE, offsetof(TkButton, onValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", tkDefLabelPadx, offsetof(TkButton, padXPtr), @@ -331,108 +331,108 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { tkDefLabelPady, offsetof(TkButton, padYPtr), offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", - DEF_BUTTON_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, selectBorder), + DEF_BUTTON_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", - DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, TCL_AUTO_LENGTH, offsetof(TkButton, state), + DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage", - DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue", - DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_CHECKBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_AUTO_LENGTH, + DEF_CHECKBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), offsetof(TkButton, wrapLength), 0, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, activeFg), + DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, TCL_AUTO_LENGTH, offsetof(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, TCL_AUTO_LENGTH, offsetof(TkButton, bitmap), + DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(TkButton, cursor), + DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, + TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, TCL_AUTO_LENGTH, offsetof(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_CHKRAD_FG, TCL_AUTO_LENGTH, offsetof(TkButton, normalFg), 0, 0, 0}, + DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkButton, highlightBorder), 0, + TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, offsetof(TkButton, highlightWidthPtr), offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_BUTTON_INDICATOR, TCL_AUTO_LENGTH, offsetof(TkButton, indicatorOn), + DEF_BUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, TCL_AUTO_LENGTH, offsetof(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief", - DEF_BUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, offRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", tkDefLabelPadx, offsetof(TkButton, padXPtr), @@ -441,42 +441,42 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { tkDefLabelPady, offsetof(TkButton, padYPtr), offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, TCL_AUTO_LENGTH, offsetof(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", - DEF_BUTTON_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(TkButton, selectBorder), + DEF_BUTTON_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", - DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, TCL_AUTO_LENGTH, offsetof(TkButton, state), + DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage", - DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), TCL_AUTO_LENGTH, + DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue", - DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-value", "value", "Value", - DEF_BUTTON_VALUE, offsetof(TkButton, onValuePtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_VALUE, offsetof(TkButton, onValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_RADIOBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_AUTO_LENGTH, + DEF_RADIOBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_AUTO_LENGTH, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), offsetof(TkButton, wrapLength), 0, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* @@ -1127,7 +1127,7 @@ ConfigureButton( if (butPtr->selVarNamePtr == NULL) { butPtr->selVarNamePtr = Tcl_NewStringObj( - Tk_Name(butPtr->tkwin), TCL_AUTO_LENGTH); + Tk_Name(butPtr->tkwin), TCL_INDEX_NONE); Tcl_IncrRefCount(butPtr->selVarNamePtr); } namePtr = butPtr->selVarNamePtr; diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 6952f4d..1f78c7c 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -88,9 +88,9 @@ typedef struct ArcItem { static int StyleParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, - char *widgRec, int offset); + char *widgRec, TkSizeT offset); static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) @@ -99,7 +99,7 @@ static const Tk_CustomOption styleOption = { StyleParseProc, StylePrintProc, NULL }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -2202,7 +2202,7 @@ StyleParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { int c; size_t length; @@ -2265,7 +2265,7 @@ StylePrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Ignored. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset into item. */ + TkSizeT offset, /* Offset into item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 3053469..b2dc012 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -45,7 +45,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 34b52ea..53e9c25 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -47,7 +47,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 0737d76..beb8942 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -108,15 +108,15 @@ static int LineToPostscript(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass); static int ArrowParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, int offset); + const char *value, char *recordPtr, TkSizeT offset); static const char * ArrowPrintProc(ClientData clientData, - Tk_Window tkwin, char *recordPtr, int offset, + Tk_Window tkwin, char *recordPtr, TkSizeT offset, Tcl_FreeProc **freeProcPtr); static int ParseArrowShape(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, int offset); + const char *value, char *recordPtr, TkSizeT offset); static const char * PrintArrowShape(ClientData clientData, - Tk_Window tkwin, char *recordPtr, int offset, + Tk_Window tkwin, char *recordPtr, TkSizeT offset, Tcl_FreeProc **freeProcPtr); static void RotateLine(Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double angleRad); @@ -145,7 +145,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -1937,7 +1937,7 @@ ParseArrowShape( const char *value, /* Textual specification of arrow shape. */ char *recordPtr, /* Pointer to item record in which to store * arrow information. */ - int offset) /* Offset of shape information in widget + TkSizeT offset) /* Offset of shape information in widget * record. */ { LineItem *linePtr = (LineItem *) recordPtr; @@ -2005,7 +2005,7 @@ PrintArrowShape( Tk_Window tkwin, /* Window associated with linePtr's widget. */ char *recordPtr, /* Pointer to item record containing current * shape information. */ - int offset, /* Offset of arrow information in record. */ + TkSizeT offset, /* Offset of arrow information in record. */ Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free * string here. */ { @@ -2046,7 +2046,7 @@ ArrowParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { int c; size_t length; @@ -2113,7 +2113,7 @@ ArrowPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset into item. */ + TkSizeT offset, /* Offset into item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index c0329d6..71e67f8 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -62,7 +62,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index b94384c..d873d12 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -87,7 +87,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_CustomOption offsetOption = { TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 1d6a394..eee1ad2 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -402,13 +402,13 @@ Tk_CanvasGetTextInfo( */ int -Tk_CanvasTagsParseProc( +TkCanvasTagsParseProc( ClientData dummy, /* Not used.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option (list of tag names). */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item (ignored). */ + TkSizeT offset) /* Offset into item (ignored). */ { Tk_Item *itemPtr = (Tk_Item *) widgRec; int argc, i; @@ -472,11 +472,11 @@ Tk_CanvasTagsParseProc( */ const char * -Tk_CanvasTagsPrintProc( +TkCanvasTagsPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Ignored. */ + TkSizeT offset, /* Ignored. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -523,7 +523,7 @@ TkCanvasDashParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { (void)dummy; (void)tkwin; @@ -558,7 +558,7 @@ TkCanvasDashPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset in record for item. */ + TkSizeT offset, /* Offset in record for item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -747,7 +747,7 @@ TkSmoothParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { const Tk_SmoothMethod **smoothPtr = (const Tk_SmoothMethod **) (widgRec + offset); @@ -839,7 +839,7 @@ TkSmoothPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset into item. */ + TkSizeT offset, /* Offset into item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 22729d6..8028c14 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -41,7 +41,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 1950cf6..d4ffa7c 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -279,7 +279,7 @@ Tk_CreateOptionTable( } } if (((specPtr->type == TK_OPTION_STRING) - && (specPtr->internalOffset != TCL_AUTO_LENGTH)) + && (specPtr->internalOffset != TCL_INDEX_NONE)) || (specPtr->type == TK_OPTION_COLOR) || (specPtr->type == TK_OPTION_FONT) || (specPtr->type == TK_OPTION_BITMAP) @@ -584,7 +584,7 @@ DoObjConfig( */ specPtr = optionPtr->specPtr; - if (specPtr->objOffset != TCL_AUTO_LENGTH) { + if (specPtr->objOffset != TCL_INDEX_NONE) { slotPtrPtr = (Tcl_Obj **) ((char *)recordPtr + specPtr->objOffset); oldPtr = *slotPtrPtr; } else { @@ -597,7 +597,7 @@ DoObjConfig( * object and internal forms, if they exist. */ - if (specPtr->internalOffset != TCL_AUTO_LENGTH) { + if (specPtr->internalOffset != TCL_INDEX_NONE) { internalPtr = (char *)recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; @@ -1374,12 +1374,12 @@ Tk_RestoreSavedOptions( * record. */ - if (specPtr->objOffset != TCL_AUTO_LENGTH) { + if (specPtr->objOffset != TCL_INDEX_NONE) { newPtr = *((Tcl_Obj **) ((char *)savePtr->recordPtr + specPtr->objOffset)); } else { newPtr = NULL; } - if (specPtr->internalOffset != TCL_AUTO_LENGTH) { + if (specPtr->internalOffset != TCL_INDEX_NONE) { internalPtr = (char *)savePtr->recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; @@ -1395,11 +1395,11 @@ Tk_RestoreSavedOptions( * Now restore the old value of the option. */ - if (specPtr->objOffset != TCL_AUTO_LENGTH) { + if (specPtr->objOffset != TCL_INDEX_NONE) { *((Tcl_Obj **) ((char *)savePtr->recordPtr + specPtr->objOffset)) = savePtr->items[i].valuePtr; } - if (specPtr->internalOffset != TCL_AUTO_LENGTH) { + if (specPtr->internalOffset != TCL_INDEX_NONE) { char *ptr = (char *) &savePtr->items[i].internalForm; CLANG_ASSERT(internalPtr); @@ -1552,14 +1552,14 @@ Tk_FreeConfigOptions( if (specPtr->type == TK_OPTION_SYNONYM) { continue; } - if (specPtr->objOffset != TCL_AUTO_LENGTH) { + if (specPtr->objOffset != TCL_INDEX_NONE) { oldPtrPtr = (Tcl_Obj **) ((char *)recordPtr + specPtr->objOffset); oldPtr = *oldPtrPtr; *oldPtrPtr = NULL; } else { oldPtr = NULL; } - if (specPtr->internalOffset != TCL_AUTO_LENGTH) { + if (specPtr->internalOffset != TCL_INDEX_NONE) { oldInternalPtr = (char *)recordPtr + specPtr->internalOffset; } else { oldInternalPtr = NULL; @@ -1611,7 +1611,7 @@ FreeResources( * form, then use the object form. */ - internalFormExists = optionPtr->specPtr->internalOffset != TCL_AUTO_LENGTH; + internalFormExists = optionPtr->specPtr->internalOffset != TCL_INDEX_NONE; switch (optionPtr->specPtr->type) { case TK_OPTION_STRING: if (internalFormExists) { @@ -1828,7 +1828,7 @@ GetConfigList( } Tcl_ListObjAppendElement(NULL, listPtr, elementPtr); - if (optionPtr->specPtr->objOffset != TCL_AUTO_LENGTH) { + if (optionPtr->specPtr->objOffset != TCL_INDEX_NONE) { elementPtr = *((Tcl_Obj **) ((char *)recordPtr + optionPtr->specPtr->objOffset)); if (elementPtr == NULL) { @@ -2023,7 +2023,7 @@ Tk_GetOptionValue( if (optionPtr->specPtr->type == TK_OPTION_SYNONYM) { optionPtr = optionPtr->extra.synonymPtr; } - if (optionPtr->specPtr->objOffset != TCL_AUTO_LENGTH) { + if (optionPtr->specPtr->objOffset != TCL_INDEX_NONE) { resultPtr = *((Tcl_Obj **) ((char *)recordPtr+optionPtr->specPtr->objOffset)); if (resultPtr == NULL) { /* diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 0d52f2f..0d52f2f 100644..100755 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 815b261..67c4794 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -63,108 +63,108 @@ enum validateType { static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_ENTRY_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, normalBorder), + DEF_ENTRY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, normalBorder), 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, borderWidth), 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_ENTRY_CURSOR, TCL_AUTO_LENGTH, offsetof(Entry, cursor), + DEF_ENTRY_CURSOR, TCL_INDEX_NONE, offsetof(Entry, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", - "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_AUTO_LENGTH, + "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", - "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_AUTO_LENGTH, + "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE, offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_AUTO_LENGTH, + "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_INDEX_NONE, offsetof(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, TCL_AUTO_LENGTH, offsetof(Entry, tkfont), 0, 0, 0}, + DEF_ENTRY_FONT, TCL_INDEX_NONE, offsetof(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_ENTRY_FG, TCL_AUTO_LENGTH, offsetof(Entry, fgColorPtr), 0, 0, 0}, + DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, - TCL_AUTO_LENGTH, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_ENTRY_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(Entry, highlightColorPtr), 0, 0, 0}, + DEF_ENTRY_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", - DEF_ENTRY_INSERT_BG, TCL_AUTO_LENGTH, offsetof(Entry, insertBorder), 0, 0, 0}, + DEF_ENTRY_INSERT_BG, TCL_INDEX_NONE, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_AUTO_LENGTH, + "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, insertBorderWidth), 0, (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_ENTRY_INSERT_OFF_TIME, TCL_AUTO_LENGTH, offsetof(Entry, insertOffTime), + DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_ENTRY_INSERT_ON_TIME, TCL_AUTO_LENGTH, offsetof(Entry, insertOnTime), 0, 0, 0}, + DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, insertWidth), 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - DEF_ENTRY_INVALIDCMD, TCL_AUTO_LENGTH, offsetof(Entry, invalidCmd), + DEF_ENTRY_INVALIDCMD, TCL_INDEX_NONE, offsetof(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-invalidcommand", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_ENTRY_JUSTIFY, TCL_AUTO_LENGTH, offsetof(Entry, justify), 0, 0, 0}, + DEF_ENTRY_JUSTIFY, TCL_INDEX_NONE, offsetof(Entry, justify), 0, 0, 0}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - DEF_ENTRY_PLACEHOLDER, TCL_AUTO_LENGTH, offsetof(Entry, placeholderString), + DEF_ENTRY_PLACEHOLDER, TCL_INDEX_NONE, offsetof(Entry, placeholderString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", - "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_AUTO_LENGTH, + "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE, offsetof(Entry, placeholderColorPtr), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", - "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_AUTO_LENGTH, + "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_ENTRY_RELIEF, TCL_AUTO_LENGTH, offsetof(Entry, relief), 0, 0, 0}, + DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_ENTRY_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, selBorder), + DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_AUTO_LENGTH, + "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_ENTRY_SELECT_FG_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, selFgColorPtr), + DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", - DEF_ENTRY_SHOW, TCL_AUTO_LENGTH, offsetof(Entry, showChar), + DEF_ENTRY_SHOW, TCL_INDEX_NONE, offsetof(Entry, showChar), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_ENTRY_STATE, TCL_AUTO_LENGTH, offsetof(Entry, state), + DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_ENTRY_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(Entry, takeFocus), + DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_ENTRY_TEXT_VARIABLE, TCL_AUTO_LENGTH, offsetof(Entry, textVarName), + DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - DEF_ENTRY_VALIDATE, TCL_AUTO_LENGTH, offsetof(Entry, validate), + DEF_ENTRY_VALIDATE, TCL_INDEX_NONE, offsetof(Entry, validate), 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-validatecommand", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, prefWidth), 0, 0, 0}, + DEF_ENTRY_WIDTH, TCL_INDEX_NONE, offsetof(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_ENTRY_SCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(Entry, scrollCmd), + DEF_ENTRY_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Entry, scrollCmd), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* @@ -186,141 +186,141 @@ static const Tk_OptionSpec entryOptSpec[] = { static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background", - DEF_BUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Spinbox, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(Spinbox, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_ENTRY_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, normalBorder), + DEF_ENTRY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, normalBorder), 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, borderWidth), 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-buttonbackground", "buttonBackground", "Background", - DEF_BUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Spinbox, buttonBorder), + DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(Spinbox, buttonBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_CURSOR, "-buttoncursor", "buttonCursor", "Cursor", - DEF_BUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(Spinbox, bCursor), + DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(Spinbox, bCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-buttondownrelief", "buttonDownRelief", "Relief", - DEF_BUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(Spinbox, bdRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(Spinbox, bdRelief), 0, 0, 0}, {TK_OPTION_RELIEF, "-buttonuprelief", "buttonUpRelief", "Relief", - DEF_BUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(Spinbox, buRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(Spinbox, buRelief), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_SPINBOX_CMD, TCL_AUTO_LENGTH, offsetof(Spinbox, command), + DEF_SPINBOX_CMD, TCL_INDEX_NONE, offsetof(Spinbox, command), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_ENTRY_CURSOR, TCL_AUTO_LENGTH, offsetof(Entry, cursor), + DEF_ENTRY_CURSOR, TCL_INDEX_NONE, offsetof(Entry, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", - "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_AUTO_LENGTH, + "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", - "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_AUTO_LENGTH, + "DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE, offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_AUTO_LENGTH, + "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_INDEX_NONE, offsetof(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, TCL_AUTO_LENGTH, offsetof(Entry, tkfont), 0, 0, 0}, + DEF_ENTRY_FONT, TCL_INDEX_NONE, offsetof(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_ENTRY_FG, TCL_AUTO_LENGTH, offsetof(Entry, fgColorPtr), 0, 0, 0}, + DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0}, {TK_OPTION_STRING, "-format", "format", "Format", - DEF_SPINBOX_FORMAT, TCL_AUTO_LENGTH, offsetof(Spinbox, reqFormat), + DEF_SPINBOX_FORMAT, TCL_INDEX_NONE, offsetof(Spinbox, reqFormat), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-from", "from", "From", - DEF_SPINBOX_FROM, TCL_AUTO_LENGTH, offsetof(Spinbox, fromValue), 0, 0, 0}, + DEF_SPINBOX_FROM, TCL_INDEX_NONE, offsetof(Spinbox, fromValue), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, - TCL_AUTO_LENGTH, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_ENTRY_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(Entry, highlightColorPtr), 0, 0, 0}, + DEF_ENTRY_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", - DEF_SPINBOX_INCREMENT, TCL_AUTO_LENGTH, offsetof(Spinbox, increment), 0, 0, 0}, + DEF_SPINBOX_INCREMENT, TCL_INDEX_NONE, offsetof(Spinbox, increment), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", - DEF_ENTRY_INSERT_BG, TCL_AUTO_LENGTH, offsetof(Entry, insertBorder), 0, 0, 0}, + DEF_ENTRY_INSERT_BG, TCL_INDEX_NONE, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_AUTO_LENGTH, + "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, insertBorderWidth), 0, (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_ENTRY_INSERT_OFF_TIME, TCL_AUTO_LENGTH, offsetof(Entry, insertOffTime), + DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_ENTRY_INSERT_ON_TIME, TCL_AUTO_LENGTH, offsetof(Entry, insertOnTime), 0, 0, 0}, + DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, insertWidth), 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - DEF_ENTRY_INVALIDCMD, TCL_AUTO_LENGTH, offsetof(Entry, invalidCmd), + DEF_ENTRY_INVALIDCMD, TCL_INDEX_NONE, offsetof(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-invalidcommand", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_ENTRY_JUSTIFY, TCL_AUTO_LENGTH, offsetof(Entry, justify), 0, 0, 0}, + DEF_ENTRY_JUSTIFY, TCL_INDEX_NONE, offsetof(Entry, justify), 0, 0, 0}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - DEF_ENTRY_PLACEHOLDER, TCL_AUTO_LENGTH, offsetof(Entry, placeholderString), + DEF_ENTRY_PLACEHOLDER, TCL_INDEX_NONE, offsetof(Entry, placeholderString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", - "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_AUTO_LENGTH, + "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE, offsetof(Entry, placeholderColorPtr), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_ENTRY_RELIEF, TCL_AUTO_LENGTH, offsetof(Entry, relief), 0, 0, 0}, + DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", - "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_AUTO_LENGTH, + "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SPINBOX_REPEAT_DELAY, TCL_AUTO_LENGTH, offsetof(Spinbox, repeatDelay), + DEF_SPINBOX_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(Spinbox, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SPINBOX_REPEAT_INTERVAL, TCL_AUTO_LENGTH, offsetof(Spinbox, repeatInterval), + DEF_SPINBOX_REPEAT_INTERVAL, TCL_INDEX_NONE, offsetof(Spinbox, repeatInterval), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_ENTRY_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, selBorder), + DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_AUTO_LENGTH, + "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_ENTRY_SELECT_FG_COLOR, TCL_AUTO_LENGTH, offsetof(Entry, selFgColorPtr), + DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_ENTRY_STATE, TCL_AUTO_LENGTH, offsetof(Entry, state), + DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_ENTRY_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(Entry, takeFocus), + DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_ENTRY_TEXT_VARIABLE, TCL_AUTO_LENGTH, offsetof(Entry, textVarName), + DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", - DEF_SPINBOX_TO, TCL_AUTO_LENGTH, offsetof(Spinbox, toValue), 0, 0, 0}, + DEF_SPINBOX_TO, TCL_INDEX_NONE, offsetof(Spinbox, toValue), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - DEF_ENTRY_VALIDATE, TCL_AUTO_LENGTH, offsetof(Entry, validate), + DEF_ENTRY_VALIDATE, TCL_INDEX_NONE, offsetof(Entry, validate), 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-values", "values", "Values", - DEF_SPINBOX_VALUES, TCL_AUTO_LENGTH, offsetof(Spinbox, valueStr), + DEF_SPINBOX_VALUES, TCL_INDEX_NONE, offsetof(Spinbox, valueStr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-validatecommand", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, TCL_AUTO_LENGTH, offsetof(Entry, prefWidth), 0, 0, 0}, + DEF_ENTRY_WIDTH, TCL_INDEX_NONE, offsetof(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap", - DEF_SPINBOX_WRAP, TCL_AUTO_LENGTH, offsetof(Spinbox, wrap), 0, 0, 0}, + DEF_SPINBOX_WRAP, TCL_INDEX_NONE, offsetof(Spinbox, wrap), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_ENTRY_SCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(Entry, scrollCmd), + DEF_ENTRY_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Entry, scrollCmd), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* @@ -709,7 +709,7 @@ EntryWidgetObjCmd( Tcl_WrongNumArgs(interp, 2, objv, NULL); goto error; } - Tcl_SetObjResult(interp, Tcl_NewStringObj(entryPtr->string, TCL_AUTO_LENGTH)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(entryPtr->string, TCL_INDEX_NONE)); break; case COMMAND_ICURSOR: @@ -1260,7 +1260,7 @@ ConfigureEntry( Tcl_Obj *newObjPtr; int nelems; - newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, TCL_AUTO_LENGTH); + newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, TCL_INDEX_NONE); if (Tcl_ListObjLength(interp, newObjPtr, &nelems) != TCL_OK) { valuesChanged = -1; @@ -2174,7 +2174,7 @@ InsertChars( */ oldChars = entryPtr->numChars; - entryPtr->numChars = Tcl_NumUtfChars(newStr, TCL_AUTO_LENGTH); + entryPtr->numChars = Tcl_NumUtfChars(newStr, TCL_INDEX_NONE); charsAdded = entryPtr->numChars - oldChars; entryPtr->numBytes += byteCount; @@ -3089,12 +3089,12 @@ EntryUpdateScrollbar( Tcl_PrintDouble(NULL, first, firstStr); Tcl_PrintDouble(NULL, last, lastStr); Tcl_DStringInit(&buf); - Tcl_DStringAppend(&buf, entryPtr->scrollCmd, TCL_AUTO_LENGTH); - Tcl_DStringAppend(&buf, " ", TCL_AUTO_LENGTH); - Tcl_DStringAppend(&buf, firstStr, TCL_AUTO_LENGTH); - Tcl_DStringAppend(&buf, " ", TCL_AUTO_LENGTH); - Tcl_DStringAppend(&buf, lastStr, TCL_AUTO_LENGTH); - code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_AUTO_LENGTH, 0); + Tcl_DStringAppend(&buf, entryPtr->scrollCmd, TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, " ", TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, firstStr, TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, " ", TCL_INDEX_NONE); + Tcl_DStringAppend(&buf, lastStr, TCL_INDEX_NONE); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), TCL_INDEX_NONE, 0); Tcl_DStringFree(&buf); if (code != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( @@ -3314,7 +3314,7 @@ EntryValidate( Tcl_Interp *interp = entryPtr->interp; int code, isOK; - code = Tcl_EvalEx(interp, cmd, TCL_AUTO_LENGTH, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); + code = Tcl_EvalEx(interp, cmd, TCL_INDEX_NONE, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); /* * We accept TCL_OK and TCL_RETURN as valid return codes from the command diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 81f1f2c..df370af 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -184,32 +184,32 @@ static const char *const labelAnchorStrings[] = { static const Tk_OptionSpec commonOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_FRAME_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Frame, border), + DEF_FRAME_BG_COLOR, TCL_INDEX_NONE, offsetof(Frame, border), TK_OPTION_NULL_OK, DEF_FRAME_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_STRING, "-colormap", "colormap", "Colormap", - DEF_FRAME_COLORMAP, TCL_AUTO_LENGTH, offsetof(Frame, colormapName), + DEF_FRAME_COLORMAP, TCL_INDEX_NONE, offsetof(Frame, colormapName), TK_OPTION_NULL_OK, 0, 0}, /* * Having -container is useless in a labelframe since a container has * no border. It should be deprecated. */ {TK_OPTION_BOOLEAN, "-container", "container", "Container", - DEF_FRAME_CONTAINER, TCL_AUTO_LENGTH, offsetof(Frame, isContainer), 0, 0, 0}, + DEF_FRAME_CONTAINER, TCL_INDEX_NONE, offsetof(Frame, isContainer), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_FRAME_CURSOR, TCL_AUTO_LENGTH, offsetof(Frame, cursor), + DEF_FRAME_CURSOR, TCL_INDEX_NONE, offsetof(Frame, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_FRAME_HEIGHT, TCL_AUTO_LENGTH, offsetof(Frame, height), 0, 0, 0}, + DEF_FRAME_HEIGHT, TCL_INDEX_NONE, offsetof(Frame, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", - "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, TCL_AUTO_LENGTH, + "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Frame, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_FRAME_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(Frame, highlightColorPtr), + DEF_FRAME_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Frame, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(Frame, highlightWidth), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", DEF_FRAME_PADX, offsetof(Frame, padXPtr), @@ -218,60 +218,60 @@ static const Tk_OptionSpec commonOptSpec[] = { DEF_FRAME_PADY, offsetof(Frame, padYPtr), offsetof(Frame, padY), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_FRAME_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(Frame, takeFocus), + DEF_FRAME_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Frame, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-visual", "visual", "Visual", - DEF_FRAME_VISUAL, TCL_AUTO_LENGTH, offsetof(Frame, visualName), + DEF_FRAME_VISUAL, TCL_INDEX_NONE, offsetof(Frame, visualName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_FRAME_WIDTH, TCL_AUTO_LENGTH, offsetof(Frame, width), 0, 0, 0}, + DEF_FRAME_WIDTH, TCL_INDEX_NONE, offsetof(Frame, width), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec frameOptSpec[] = { {TK_OPTION_STRING, "-backgroundimage", "backgroundImage", "BackgroundImage", - DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_AUTO_LENGTH, + DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-backgroundimage", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Frame, borderWidth), 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_FRAME_CLASS, TCL_AUTO_LENGTH, offsetof(Frame, className), 0, 0, 0}, + DEF_FRAME_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_FRAME_RELIEF, TCL_AUTO_LENGTH, offsetof(Frame, relief), 0, 0, 0}, + DEF_FRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile", - DEF_FRAME_BG_TILE, TCL_AUTO_LENGTH, offsetof(Frame, tile), 0, 0, 0}, + DEF_FRAME_BG_TILE, TCL_INDEX_NONE, offsetof(Frame, tile), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, commonOptSpec, 0} }; static const Tk_OptionSpec toplevelOptSpec[] = { {TK_OPTION_STRING, "-backgroundimage", "backgroundImage", "BackgroundImage", - DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_AUTO_LENGTH, + DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-backgroundimage", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Frame, borderWidth), 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_TOPLEVEL_CLASS, TCL_AUTO_LENGTH, offsetof(Frame, className), 0, 0, 0}, + DEF_TOPLEVEL_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", - DEF_TOPLEVEL_MENU, TCL_AUTO_LENGTH, offsetof(Frame, menuName), + DEF_TOPLEVEL_MENU, TCL_INDEX_NONE, offsetof(Frame, menuName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_FRAME_RELIEF, TCL_AUTO_LENGTH, offsetof(Frame, relief), 0, 0, 0}, + DEF_FRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_STRING, "-screen", "screen", "Screen", - DEF_TOPLEVEL_SCREEN, TCL_AUTO_LENGTH, offsetof(Frame, screenName), + DEF_TOPLEVEL_SCREEN, TCL_INDEX_NONE, offsetof(Frame, screenName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile", - DEF_FRAME_BG_TILE, TCL_AUTO_LENGTH, offsetof(Frame, tile), 0, 0, 0}, + DEF_FRAME_BG_TILE, TCL_INDEX_NONE, offsetof(Frame, tile), 0, 0, 0}, {TK_OPTION_STRING, "-use", "use", "Use", - DEF_TOPLEVEL_USE, TCL_AUTO_LENGTH, offsetof(Frame, useThis), + DEF_TOPLEVEL_USE, TCL_INDEX_NONE, offsetof(Frame, useThis), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, commonOptSpec, 0} @@ -279,27 +279,27 @@ static const Tk_OptionSpec toplevelOptSpec[] = { static const Tk_OptionSpec labelframeOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LABELFRAME_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Frame, borderWidth), + DEF_LABELFRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_LABELFRAME_CLASS, TCL_AUTO_LENGTH, offsetof(Frame, className), 0, 0, 0}, + DEF_LABELFRAME_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_LABELFRAME_FONT, TCL_AUTO_LENGTH, offsetof(Labelframe, tkfont), 0, 0, 0}, + DEF_LABELFRAME_FONT, TCL_INDEX_NONE, offsetof(Labelframe, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_LABELFRAME_FG, TCL_AUTO_LENGTH, offsetof(Labelframe, textColorPtr), 0, 0, 0}, + DEF_LABELFRAME_FG, TCL_INDEX_NONE, offsetof(Labelframe, textColorPtr), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor", - DEF_LABELFRAME_LABELANCHOR, TCL_AUTO_LENGTH, offsetof(Labelframe, labelAnchor), + DEF_LABELFRAME_LABELANCHOR, TCL_INDEX_NONE, offsetof(Labelframe, labelAnchor), 0, labelAnchorStrings, 0}, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", - NULL, TCL_AUTO_LENGTH, offsetof(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABELFRAME_RELIEF, TCL_AUTO_LENGTH, offsetof(Frame, relief), 0, 0, 0}, + DEF_LABELFRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_LABELFRAME_TEXT, offsetof(Labelframe, textPtr), TCL_AUTO_LENGTH, + DEF_LABELFRAME_TEXT, offsetof(Labelframe, textPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, commonOptSpec, 0} diff --git a/generic/tkInt.decls b/generic/tkInt.decls index dd493e9..4ac3bab 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -567,51 +567,51 @@ declare 168 { # Next group of functions exposed due to [Bug 2768945]. declare 169 { int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 170 { const char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } declare 171 { int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 172 { const char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } declare 173 { int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 174 { const char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } declare 175 { int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 176 { const char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } declare 177 { int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 178 { const char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } declare 179 { int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, int offset) + Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) } declare 180 { const char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, int offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) } # Angled text API, exposed for Emiliano Gavilán's RBC work. diff --git a/generic/tkInt.h b/generic/tkInt.h index a4c2891..f23aa74 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -113,10 +113,6 @@ # endif #endif -#ifndef TCL_AUTO_LENGTH -# define TCL_AUTO_LENGTH (-1) -#endif - #ifndef TCL_Z_MODIFIER # if defined(_WIN64) # define TCL_Z_MODIFIER "I" @@ -1287,6 +1283,15 @@ MODULE_SCOPE int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin, MODULE_SCOPE int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, XImage *ximage, int x, int y, int width, int height); +#if TCL_MAJOR_VERSION > 8 +MODULE_SCOPE int TkCanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, + Tk_Window tkwin, const char *value, char *widgRec, size_t offset); +MODULE_SCOPE const char *TkCanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin, + char *widgRec, size_t offset, Tcl_FreeProc **freeProcPtr); +#else +#define TkCanvasTagsParseProc Tk_CanvasTagsParseProc +#define TkCanvasTagsPrintProc Tk_CanvasTagsPrintProc +#endif MODULE_SCOPE void TkMapTopFrame(Tk_Window tkwin); MODULE_SCOPE XEvent * TkpGetBindingXEvent(Tcl_Interp *interp); MODULE_SCOPE void TkCreateExitHandler(Tcl_ExitProc *proc, diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 0b3a3cc..f241b75 100644..100755 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -488,51 +488,57 @@ EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr, /* 169 */ EXTERN int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 170 */ EXTERN const char * TkStatePrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 171 */ EXTERN int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 172 */ EXTERN const char * TkCanvasDashPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 173 */ EXTERN int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 174 */ EXTERN const char * TkOffsetPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 175 */ EXTERN int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 176 */ EXTERN const char * TkPixelPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 177 */ EXTERN int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 178 */ EXTERN const char * TkOrientPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 179 */ EXTERN int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + TkSizeT offset); /* 180 */ EXTERN const char * TkSmoothPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 181 */ EXTERN void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, @@ -757,18 +763,18 @@ typedef struct TkIntStubs { void (*tkTextChanged) (struct TkSharedText *sharedTextPtr, struct TkText *textPtr, const struct TkTextIndex *index1Ptr, const struct TkTextIndex *index2Ptr); /* 166 */ int (*tkBTreeNumLines) (TkTextBTree tree, const struct TkText *textPtr); /* 167 */ void (*tkTextInsertDisplayProc) (struct TkText *textPtr, struct TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 168 */ - int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 169 */ - const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 170 */ - int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 171 */ - const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 172 */ - int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 173 */ - const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 174 */ - int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 175 */ - const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 176 */ - int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 177 */ - const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 178 */ - int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 179 */ - const char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 180 */ + int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 169 */ + const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 170 */ + int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 171 */ + const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 172 */ + int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 173 */ + const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 174 */ + int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 175 */ + const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 176 */ + int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 177 */ + const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 178 */ + int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 179 */ + const char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 180 */ void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */ void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */ int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index aecc222..aecc222 100644..100755 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 774075d..774075d 100644..100755 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 58e6d17..6ea80ff 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -239,80 +239,80 @@ static const char *const activeStyleStrings[] = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle", - DEF_LISTBOX_ACTIVE_STYLE, TCL_AUTO_LENGTH, offsetof(Listbox, activeStyle), + DEF_LISTBOX_ACTIVE_STYLE, TCL_INDEX_NONE, offsetof(Listbox, activeStyle), 0, activeStyleStrings, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_LISTBOX_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Listbox, normalBorder), + DEF_LISTBOX_BG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, normalBorder), 0, DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LISTBOX_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(Listbox, borderWidth), + DEF_LISTBOX_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_LISTBOX_CURSOR, TCL_AUTO_LENGTH, offsetof(Listbox, cursor), + DEF_LISTBOX_CURSOR, TCL_INDEX_NONE, offsetof(Listbox, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", - "DisabledForeground", DEF_LISTBOX_DISABLED_FG, TCL_AUTO_LENGTH, + "DisabledForeground", DEF_LISTBOX_DISABLED_FG, TCL_INDEX_NONE, offsetof(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, TCL_AUTO_LENGTH, + "ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, TCL_INDEX_NONE, offsetof(Listbox, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_LISTBOX_FONT, TCL_AUTO_LENGTH, offsetof(Listbox, tkfont), 0, 0, 0}, + DEF_LISTBOX_FONT, TCL_INDEX_NONE, offsetof(Listbox, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_LISTBOX_FG, TCL_AUTO_LENGTH, offsetof(Listbox, fgColorPtr), 0, 0, 0}, + DEF_LISTBOX_FG, TCL_INDEX_NONE, offsetof(Listbox, fgColorPtr), 0, 0, 0}, {TK_OPTION_INT, "-height", "height", "Height", - DEF_LISTBOX_HEIGHT, TCL_AUTO_LENGTH, offsetof(Listbox, height), 0, 0, 0}, + DEF_LISTBOX_HEIGHT, TCL_INDEX_NONE, offsetof(Listbox, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", - "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, TCL_AUTO_LENGTH, + "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Listbox, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_LISTBOX_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(Listbox, highlightColorPtr), + DEF_LISTBOX_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Listbox, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_LISTBOX_JUSTIFY, TCL_AUTO_LENGTH, offsetof(Listbox, justify), 0, 0, 0}, + DEF_LISTBOX_JUSTIFY, TCL_INDEX_NONE, offsetof(Listbox, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LISTBOX_RELIEF, TCL_AUTO_LENGTH, offsetof(Listbox, relief), 0, 0, 0}, + DEF_LISTBOX_RELIEF, TCL_INDEX_NONE, offsetof(Listbox, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_LISTBOX_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(Listbox, selBorder), + DEF_LISTBOX_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selBorder), 0, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_LISTBOX_SELECT_BD, TCL_AUTO_LENGTH, + "BorderWidth", DEF_LISTBOX_SELECT_BD, TCL_INDEX_NONE, offsetof(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_LISTBOX_SELECT_FG_COLOR, TCL_AUTO_LENGTH, offsetof(Listbox, selFgColorPtr), + DEF_LISTBOX_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selFgColorPtr), TK_OPTION_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", - DEF_LISTBOX_SELECT_MODE, TCL_AUTO_LENGTH, offsetof(Listbox, selectMode), + DEF_LISTBOX_SELECT_MODE, TCL_INDEX_NONE, offsetof(Listbox, selectMode), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", - DEF_LISTBOX_SET_GRID, TCL_AUTO_LENGTH, offsetof(Listbox, setGrid), 0, 0, 0}, + DEF_LISTBOX_SET_GRID, TCL_INDEX_NONE, offsetof(Listbox, setGrid), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_LISTBOX_STATE, TCL_AUTO_LENGTH, offsetof(Listbox, state), + DEF_LISTBOX_STATE, TCL_INDEX_NONE, offsetof(Listbox, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_LISTBOX_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(Listbox, takeFocus), + DEF_LISTBOX_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Listbox, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_LISTBOX_WIDTH, TCL_AUTO_LENGTH, offsetof(Listbox, width), 0, 0, 0}, + DEF_LISTBOX_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, width), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_LISTBOX_SCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(Listbox, xScrollCmd), + DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_LISTBOX_SCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(Listbox, yScrollCmd), + DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, yScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable", - DEF_LISTBOX_LIST_VARIABLE, TCL_AUTO_LENGTH, offsetof(Listbox, listVarName), + DEF_LISTBOX_LIST_VARIABLE, TCL_INDEX_NONE, offsetof(Listbox, listVarName), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* @@ -322,25 +322,25 @@ static const Tk_OptionSpec optionSpecs[] = { static const Tk_OptionSpec itemAttrOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - NULL, TCL_AUTO_LENGTH, offsetof(ItemAttr, border), + NULL, TCL_INDEX_NONE, offsetof(ItemAttr, border), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - NULL, TCL_AUTO_LENGTH, offsetof(ItemAttr, fgColor), + NULL, TCL_INDEX_NONE, offsetof(ItemAttr, fgColor), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - NULL, TCL_AUTO_LENGTH, offsetof(ItemAttr, selBorder), + NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selBorder), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - NULL, TCL_AUTO_LENGTH, offsetof(ItemAttr, selFgColor), + NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selFgColor), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, DEF_LISTBOX_SELECT_FG_MONO, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 33acc37..3b50daa 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -118,117 +118,117 @@ static const char *const compoundStrings[] = { static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", NULL, NULL, - DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_AUTO_LENGTH, + DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", NULL, NULL, DEF_MENU_ENTRY_ACTIVE_FG, - offsetof(TkMenuEntry, activeFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, activeFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-accelerator", NULL, NULL, DEF_MENU_ENTRY_ACCELERATOR, - offsetof(TkMenuEntry, accelPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, accelPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BORDER, "-background", NULL, NULL, DEF_MENU_ENTRY_BG, - offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BITMAP, "-bitmap", NULL, NULL, DEF_MENU_ENTRY_BITMAP, - offsetof(TkMenuEntry, bitmapPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, bitmapPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL, DEF_MENU_ENTRY_COLUMN_BREAK, - TCL_AUTO_LENGTH, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0}, + TCL_INDEX_NONE, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0}, {TK_OPTION_STRING, "-command", NULL, NULL, DEF_MENU_ENTRY_COMMAND, - offsetof(TkMenuEntry, commandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_MENU_ENTRY_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, compound), 0, + DEF_MENU_ENTRY_COMPOUND, TCL_INDEX_NONE, offsetof(TkMenuEntry, compound), 0, (ClientData) compoundStrings, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, DEF_MENU_ENTRY_FONT, - offsetof(TkMenuEntry, fontPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, fontPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, DEF_MENU_ENTRY_FG, - offsetof(TkMenuEntry, fgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, fgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL, DEF_MENU_ENTRY_HIDE_MARGIN, - TCL_AUTO_LENGTH, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0}, + TCL_INDEX_NONE, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0}, {TK_OPTION_STRING, "-image", NULL, NULL, DEF_MENU_ENTRY_IMAGE, - offsetof(TkMenuEntry, imagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-label", NULL, NULL, DEF_MENU_ENTRY_LABEL, - offsetof(TkMenuEntry, labelPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenuEntry, labelPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, DEF_MENU_ENTRY_STATE, - TCL_AUTO_LENGTH, offsetof(TkMenuEntry, state), 0, + TCL_INDEX_NONE, offsetof(TkMenuEntry, state), 0, (ClientData) menuStateStrings, 0}, {TK_OPTION_INT, "-underline", NULL, NULL, - DEF_MENU_ENTRY_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, underline), 0, NULL, 0}, + DEF_MENU_ENTRY_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuEntry, underline), 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; static const Tk_OptionSpec tkSeparatorEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, DEF_MENU_ENTRY_BG, - offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; static const Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = { {TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL, DEF_MENU_ENTRY_INDICATOR, - TCL_AUTO_LENGTH, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, + TCL_INDEX_NONE, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, {TK_OPTION_STRING, "-offvalue", NULL, NULL, DEF_MENU_ENTRY_OFF_VALUE, - offsetof(TkMenuEntry, offValuePtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenuEntry, offValuePtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-onvalue", NULL, NULL, DEF_MENU_ENTRY_ON_VALUE, - offsetof(TkMenuEntry, onValuePtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenuEntry, onValuePtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", NULL, NULL, DEF_MENU_ENTRY_SELECT, - offsetof(TkMenuEntry, indicatorFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, indicatorFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-selectimage", NULL, NULL, DEF_MENU_ENTRY_SELECT_IMAGE, - offsetof(TkMenuEntry, selectImagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-variable", NULL, NULL, DEF_MENU_ENTRY_CHECK_VARIABLE, - offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = { {TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL, DEF_MENU_ENTRY_INDICATOR, - TCL_AUTO_LENGTH, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, + TCL_INDEX_NONE, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", NULL, NULL, DEF_MENU_ENTRY_SELECT, - offsetof(TkMenuEntry, indicatorFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, indicatorFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-selectimage", NULL, NULL, DEF_MENU_ENTRY_SELECT_IMAGE, - offsetof(TkMenuEntry, selectImagePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, selectImagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-value", NULL, NULL, DEF_MENU_ENTRY_VALUE, - offsetof(TkMenuEntry, onValuePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, onValuePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-variable", NULL, NULL, DEF_MENU_ENTRY_RADIO_VARIABLE, - offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = { {TK_OPTION_STRING, "-menu", NULL, NULL, DEF_MENU_ENTRY_MENU, - offsetof(TkMenuEntry, namePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, namePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, TCL_INDEX_NONE, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, DEF_MENU_ENTRY_BG, - offsetof(TkMenuEntry, borderPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, - DEF_MENU_ENTRY_STATE, TCL_AUTO_LENGTH, offsetof(TkMenuEntry, state), 0, + DEF_MENU_ENTRY_STATE, TCL_INDEX_NONE, offsetof(TkMenuEntry, state), 0, (ClientData) menuStateStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; @@ -250,62 +250,62 @@ static const char *const menuTypeStrings[] = { static const Tk_OptionSpec tkMenuConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENU_ACTIVE_BG_COLOR, - offsetof(TkMenu, activeBorderPtr), TCL_AUTO_LENGTH, 0, + offsetof(TkMenu, activeBorderPtr), TCL_INDEX_NONE, 0, (ClientData) DEF_MENU_ACTIVE_BG_MONO, 0}, {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth", "BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH, - offsetof(TkMenu, activeBorderWidthPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenu, activeBorderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENU_ACTIVE_FG_COLOR, - offsetof(TkMenu, activeFgPtr), TCL_AUTO_LENGTH, 0, + offsetof(TkMenu, activeFgPtr), TCL_INDEX_NONE, 0, (ClientData) DEF_MENU_ACTIVE_FG_MONO, 0}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief", DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr), - TCL_AUTO_LENGTH, 0, NULL, 0}, + TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_AUTO_LENGTH, 0, + DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_INDEX_NONE, 0, (ClientData) DEF_MENU_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENU_BORDER_WIDTH, - offsetof(TkMenu, borderWidthPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(TkMenu, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENU_CURSOR, - offsetof(TkMenu, cursorPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, cursorPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENU_DISABLED_FG_COLOR, - offsetof(TkMenu, disabledFgPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, + offsetof(TkMenu, disabledFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, (ClientData) DEF_MENU_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-postcommand", "postCommand", "Command", DEF_MENU_POST_COMMAND, - offsetof(TkMenu, postCommandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background", - DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_AUTO_LENGTH, 0, + DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0, (ClientData) DEF_MENU_SELECT_MONO, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENU_TAKE_FOCUS, - offsetof(TkMenu, takeFocusPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff", - DEF_MENU_TEAROFF, TCL_AUTO_LENGTH, offsetof(TkMenu, tearoff), 0, NULL, 0}, + DEF_MENU_TEAROFF, TCL_INDEX_NONE, offsetof(TkMenu, tearoff), 0, NULL, 0}, {TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand", "TearOffCommand", DEF_MENU_TEAROFF_CMD, - offsetof(TkMenu, tearoffCommandPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, tearoffCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-title", "title", "Title", - DEF_MENU_TITLE, offsetof(TkMenu, titlePtr), TCL_AUTO_LENGTH, + DEF_MENU_TITLE, offsetof(TkMenu, titlePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-type", "type", "Type", - DEF_MENU_TYPE, offsetof(TkMenu, menuTypePtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, + DEF_MENU_TYPE, offsetof(TkMenu, menuTypePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, (ClientData) menuTypeStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 085f5e7..4b7a492 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -60,99 +60,99 @@ static const char *const compoundStrings[] = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_MENUBUTTON_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, activeBorder), 0, (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_MENUBUTTON_ACTIVE_FG_COLOR, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, activeFg), 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_MENUBUTTON_ANCHOR, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkMenuButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MENUBUTTON_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkMenuButton, normalBorder), + DEF_MENUBUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, normalBorder), 0, DEF_MENUBUTTON_BG_MONO, 0}, - {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, (ClientData) "-borderwidth", 0}, - {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, (ClientData) "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_MENUBUTTON_BITMAP, TCL_AUTO_LENGTH, offsetof(TkMenuButton, bitmap), + DEF_MENUBUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkMenuButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_MENUBUTTON_BORDER_WIDTH, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkMenuButton, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_MENUBUTTON_CURSOR, TCL_AUTO_LENGTH, offsetof(TkMenuButton, cursor), + DEF_MENUBUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkMenuButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", - DEF_MENUBUTTON_DIRECTION, TCL_AUTO_LENGTH, offsetof(TkMenuButton, direction), + DEF_MENUBUTTON_DIRECTION, TCL_INDEX_NONE, offsetof(TkMenuButton, direction), 0, directionStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, + TCL_INDEX_NONE, offsetof(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0}, - {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, (ClientData) "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MENUBUTTON_FONT, TCL_AUTO_LENGTH, offsetof(TkMenuButton, tkfont), 0, 0, 0}, + DEF_MENUBUTTON_FONT, TCL_INDEX_NONE, offsetof(TkMenuButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MENUBUTTON_FG, TCL_AUTO_LENGTH, offsetof(TkMenuButton, normalFg), 0, 0, 0}, + DEF_MENUBUTTON_FG, TCL_INDEX_NONE, offsetof(TkMenuButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_MENUBUTTON_HEIGHT, TCL_AUTO_LENGTH, offsetof(TkMenuButton, heightString), + DEF_MENUBUTTON_HEIGHT, TCL_INDEX_NONE, offsetof(TkMenuButton, heightString), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkMenuButton, highlightBgColorPtr), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(TkMenuButton, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_MENUBUTTON_HIGHLIGHT, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkMenuButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH, - TCL_AUTO_LENGTH, offsetof(TkMenuButton, highlightWidth), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(TkMenuButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_MENUBUTTON_IMAGE, TCL_AUTO_LENGTH, offsetof(TkMenuButton, imageString), + DEF_MENUBUTTON_IMAGE, TCL_INDEX_NONE, offsetof(TkMenuButton, imageString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_MENUBUTTON_INDICATOR, TCL_AUTO_LENGTH, offsetof(TkMenuButton, indicatorOn), + DEF_MENUBUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkMenuButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_MENUBUTTON_JUSTIFY, TCL_AUTO_LENGTH, offsetof(TkMenuButton, justify), 0, 0, 0}, + DEF_MENUBUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkMenuButton, justify), 0, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", - DEF_MENUBUTTON_MENU, TCL_AUTO_LENGTH, offsetof(TkMenuButton, menuName), + DEF_MENUBUTTON_MENU, TCL_INDEX_NONE, offsetof(TkMenuButton, menuName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_MENUBUTTON_PADX, TCL_AUTO_LENGTH, offsetof(TkMenuButton, padX), + DEF_MENUBUTTON_PADX, TCL_INDEX_NONE, offsetof(TkMenuButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_MENUBUTTON_PADY, TCL_AUTO_LENGTH, offsetof(TkMenuButton, padY), + DEF_MENUBUTTON_PADY, TCL_INDEX_NONE, offsetof(TkMenuButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MENUBUTTON_RELIEF, TCL_AUTO_LENGTH, offsetof(TkMenuButton, relief), + DEF_MENUBUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkMenuButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, TCL_AUTO_LENGTH, offsetof(TkMenuButton, compound), 0, + DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkMenuButton, compound), 0, compoundStrings, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_MENUBUTTON_STATE, TCL_AUTO_LENGTH, offsetof(TkMenuButton, state), + DEF_MENUBUTTON_STATE, TCL_INDEX_NONE, offsetof(TkMenuButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_MENUBUTTON_TAKE_FOCUS, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_MENUBUTTON_TEXT, TCL_AUTO_LENGTH, offsetof(TkMenuButton, text), 0, 0, 0}, + DEF_MENUBUTTON_TEXT, TCL_INDEX_NONE, offsetof(TkMenuButton, text), 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_MENUBUTTON_TEXT_VARIABLE, TCL_AUTO_LENGTH, + DEF_MENUBUTTON_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_MENUBUTTON_UNDERLINE, TCL_AUTO_LENGTH, offsetof(TkMenuButton, underline), + DEF_MENUBUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_MENUBUTTON_WIDTH, TCL_AUTO_LENGTH, offsetof(TkMenuButton, widthString), + DEF_MENUBUTTON_WIDTH, TCL_INDEX_NONE, offsetof(TkMenuButton, widthString), 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_MENUBUTTON_WRAP_LENGTH, TCL_AUTO_LENGTH, offsetof(TkMenuButton, wrapLength), + DEF_MENUBUTTON_WRAP_LENGTH, TCL_INDEX_NONE, offsetof(TkMenuButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; diff --git a/generic/tkMessage.c b/generic/tkMessage.c index e43d660..f7d1a33 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -109,39 +109,39 @@ typedef struct { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, - TCL_AUTO_LENGTH, offsetof(Message, anchor), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Message, anchor), 0, 0, 0}, {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT, - TCL_AUTO_LENGTH, offsetof(Message, aspect), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MESSAGE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(Message, border), 0, + DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0, DEF_MESSAGE_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, - 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, - 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_MESSAGE_BORDER_WIDTH, TCL_AUTO_LENGTH, + DEF_MESSAGE_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Message, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_MESSAGE_CURSOR, TCL_AUTO_LENGTH, offsetof(Message, cursor), + DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, - 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MESSAGE_FONT, TCL_AUTO_LENGTH, offsetof(Message, tkfont), 0, 0, 0}, + DEF_MESSAGE_FONT, TCL_INDEX_NONE, offsetof(Message, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MESSAGE_FG, TCL_AUTO_LENGTH, offsetof(Message, fgColorPtr), 0, 0, 0}, + DEF_MESSAGE_FG, TCL_INDEX_NONE, offsetof(Message, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", - "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_AUTO_LENGTH, + "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Message, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_MESSAGE_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(Message, highlightColorPtr), + DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(Message, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_MESSAGE_JUSTIFY, TCL_AUTO_LENGTH, offsetof(Message, justify), 0, 0, 0}, + DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", DEF_MESSAGE_PADX, offsetof(Message, padXPtr), offsetof(Message, padX), 0, 0, 0}, @@ -149,17 +149,17 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_MESSAGE_PADY, offsetof(Message, padYPtr), offsetof(Message, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MESSAGE_RELIEF, TCL_AUTO_LENGTH, offsetof(Message, relief), 0, 0, 0}, + DEF_MESSAGE_RELIEF, TCL_INDEX_NONE, offsetof(Message, relief), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_MESSAGE_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(Message, takeFocus), + DEF_MESSAGE_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Message, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_MESSAGE_TEXT, TCL_AUTO_LENGTH, offsetof(Message, string), 0, 0, 0}, + DEF_MESSAGE_TEXT, TCL_INDEX_NONE, offsetof(Message, string), 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_MESSAGE_TEXT_VARIABLE, TCL_AUTO_LENGTH, offsetof(Message, textVarName), + DEF_MESSAGE_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Message, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_MESSAGE_WIDTH, TCL_AUTO_LENGTH, offsetof(Message, width), 0, 0 ,0}, + DEF_MESSAGE_WIDTH, TCL_INDEX_NONE, offsetof(Message, width), 0, 0 ,0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 9508a42..5972f69 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -225,10 +225,10 @@ static void DestroyOptionTables(ClientData clientData, Tcl_Interp *interp); static int SetSticky(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, - int internalOffset, char *oldInternalPtr, + TkSizeT internalOffset, char *oldInternalPtr, int flags); static Tcl_Obj * GetSticky(ClientData clientData, Tk_Window tkwin, - char *recordPtr, int internalOffset); + char *recordPtr, TkSizeT internalOffset); static void RestoreSticky(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); static void AdjustForSticky(int sticky, int cavityWidth, @@ -236,7 +236,7 @@ static void AdjustForSticky(int sticky, int cavityWidth, int *slaveWidthPtr, int *slaveHeightPtr); static void MoveSash(PanedWindow *pwPtr, int sash, int diff); static int ObjectIsEmpty(Tcl_Obj *objPtr); -static void * ComputeSlotAddress(void *recordPtr, size_t offset); +static void * ComputeSlotAddress(void *recordPtr, TkSizeT offset); static int PanedWindowIdentifyCoords(PanedWindow *pwPtr, Tcl_Interp *interp, int x, int y); @@ -275,20 +275,20 @@ static const Tk_ObjCustomOption stickyOption = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_PANEDWINDOW_BG_COLOR, TCL_AUTO_LENGTH, offsetof(PanedWindow, background), 0, + DEF_PANEDWINDOW_BG_COLOR, TCL_INDEX_NONE, offsetof(PanedWindow, background), 0, DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PANEDWINDOW_BORDERWIDTH, TCL_AUTO_LENGTH, offsetof(PanedWindow, borderWidth), + DEF_PANEDWINDOW_BORDERWIDTH, TCL_INDEX_NONE, offsetof(PanedWindow, borderWidth), 0, 0, GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_PANEDWINDOW_CURSOR, TCL_AUTO_LENGTH, offsetof(PanedWindow, cursor), + DEF_PANEDWINDOW_CURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", - DEF_PANEDWINDOW_HANDLEPAD, TCL_AUTO_LENGTH, offsetof(PanedWindow, handlePad), + DEF_PANEDWINDOW_HANDLEPAD, TCL_INDEX_NONE, offsetof(PanedWindow, handlePad), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), @@ -297,36 +297,36 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightPtr), offsetof(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", - DEF_PANEDWINDOW_OPAQUERESIZE, TCL_AUTO_LENGTH, + DEF_PANEDWINDOW_OPAQUERESIZE, TCL_INDEX_NONE, offsetof(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - DEF_PANEDWINDOW_ORIENT, TCL_AUTO_LENGTH, offsetof(PanedWindow, orient), + DEF_PANEDWINDOW_ORIENT, TCL_INDEX_NONE, offsetof(PanedWindow, orient), 0, orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - 0, TCL_AUTO_LENGTH, offsetof(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, + 0, TCL_INDEX_NONE, offsetof(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", DEF_PANEDWINDOW_PROXYBORDER, offsetof(PanedWindow, proxyBorderWidthPtr), offsetof(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", - 0, TCL_AUTO_LENGTH, offsetof(PanedWindow, proxyRelief), + 0, TCL_INDEX_NONE, offsetof(PanedWindow, proxyRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_PANEDWINDOW_RELIEF, TCL_AUTO_LENGTH, offsetof(PanedWindow, relief), 0, 0, 0}, + DEF_PANEDWINDOW_RELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", - DEF_PANEDWINDOW_SASHCURSOR, TCL_AUTO_LENGTH, offsetof(PanedWindow, sashCursor), + DEF_PANEDWINDOW_SASHCURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, sashCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad", - DEF_PANEDWINDOW_SASHPAD, TCL_AUTO_LENGTH, offsetof(PanedWindow, sashPad), + DEF_PANEDWINDOW_SASHPAD, TCL_INDEX_NONE, offsetof(PanedWindow, sashPad), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief", - DEF_PANEDWINDOW_SASHRELIEF, TCL_AUTO_LENGTH, offsetof(PanedWindow, sashRelief), + DEF_PANEDWINDOW_SASHRELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, sashRelief), 0, 0, 0}, {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", DEF_PANEDWINDOW_SASHWIDTH, offsetof(PanedWindow, sashWidthPtr), offsetof(PanedWindow, sashWidth), 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", - DEF_PANEDWINDOW_SHOWHANDLE, TCL_AUTO_LENGTH, offsetof(PanedWindow, showHandle), + DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthPtr), @@ -336,27 +336,27 @@ static const Tk_OptionSpec optionSpecs[] = { static const Tk_OptionSpec slaveOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, - DEF_PANEDWINDOW_PANE_AFTER, TCL_AUTO_LENGTH, offsetof(Slave, after), + DEF_PANEDWINDOW_PANE_AFTER, TCL_INDEX_NONE, offsetof(Slave, after), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, - DEF_PANEDWINDOW_PANE_BEFORE, TCL_AUTO_LENGTH, offsetof(Slave, before), + DEF_PANEDWINDOW_PANE_BEFORE, TCL_INDEX_NONE, offsetof(Slave, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Slave, heightPtr), offsetof(Slave, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", - DEF_PANEDWINDOW_PANE_HIDE, TCL_AUTO_LENGTH, offsetof(Slave, hide), 0,0,GEOMETRY}, + DEF_PANEDWINDOW_PANE_HIDE, TCL_INDEX_NONE, offsetof(Slave, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, - DEF_PANEDWINDOW_PANE_MINSIZE, TCL_AUTO_LENGTH, offsetof(Slave, minSize), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_MINSIZE, TCL_INDEX_NONE, offsetof(Slave, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADX, TCL_AUTO_LENGTH, offsetof(Slave, padx), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADX, TCL_INDEX_NONE, offsetof(Slave, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADY, TCL_AUTO_LENGTH, offsetof(Slave, pady), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADY, TCL_INDEX_NONE, offsetof(Slave, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, - DEF_PANEDWINDOW_PANE_STICKY, TCL_AUTO_LENGTH, offsetof(Slave, sticky), 0, + DEF_PANEDWINDOW_PANE_STICKY, TCL_INDEX_NONE, offsetof(Slave, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", - DEF_PANEDWINDOW_PANE_STRETCH, TCL_AUTO_LENGTH, offsetof(Slave, stretch), 0, + DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Slave, stretch), 0, (ClientData) stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Slave, widthPtr), @@ -2402,7 +2402,7 @@ GetSticky( ClientData dummy, Tk_Window tkwin, char *recordPtr, /* Pointer to widget record. */ - int internalOffset) /* Offset within *recordPtr containing the + TkSizeT internalOffset) /* Offset within *recordPtr containing the * sticky value. */ { int sticky = *(int *)(recordPtr + internalOffset); @@ -2456,7 +2456,7 @@ SetSticky( * We use a pointer to the pointer because we * may need to return a value (NULL). */ char *recordPtr, /* Pointer to storage for the widget record. */ - int internalOffset, /* Offset within *recordPtr at which the + TkSizeT internalOffset, /* Offset within *recordPtr at which the * internal value is to be stored. */ char *oldInternalPtr, /* Pointer to storage for the old value. */ int flags) /* Flags for the option, set Tk_SetOptions. */ @@ -3035,9 +3035,9 @@ ObjectIsEmpty( static void * ComputeSlotAddress( void *recordPtr, /* Pointer to the start of a record. */ - size_t offset) /* Offset of a slot within that record; may be -1. */ + TkSizeT offset) /* Offset of a slot within that record; may be TCL_INDEX_NONE. */ { - if (offset != (size_t)-1) { + if (offset != TCL_INDEX_NONE) { return (char *)recordPtr + offset; } else { return NULL; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index ce79677..2b5ab2d 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -81,13 +81,13 @@ typedef struct Slave { #define IN_MASK 1 static const Tk_OptionSpec optionSpecs[] = { - {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", TCL_AUTO_LENGTH, + {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", TCL_INDEX_NONE, offsetof(Slave, anchor), 0, 0, 0}, - {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", TCL_AUTO_LENGTH, + {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", TCL_INDEX_NONE, offsetof(Slave, borderMode), 0, borderModeStrings, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, "", offsetof(Slave, heightPtr), offsetof(Slave, height), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_WINDOW, "-in", NULL, NULL, "", TCL_AUTO_LENGTH, offsetof(Slave, inTkwin), + {TK_OPTION_WINDOW, "-in", NULL, NULL, "", TCL_INDEX_NONE, offsetof(Slave, inTkwin), 0, 0, IN_MASK}, {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, "", offsetof(Slave, relHeightPtr), offsetof(Slave, relHeight), @@ -95,9 +95,9 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "", offsetof(Slave, relWidthPtr), offsetof(Slave, relWidth), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", TCL_AUTO_LENGTH, + {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", TCL_INDEX_NONE, offsetof(Slave, relX), 0, 0, 0}, - {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", TCL_AUTO_LENGTH, + {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", TCL_INDEX_NONE, offsetof(Slave, relY), 0, 0, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, "", offsetof(Slave, widthPtr), offsetof(Slave, width), TK_OPTION_NULL_OK, 0, 0}, @@ -105,7 +105,7 @@ static const Tk_OptionSpec optionSpecs[] = { offsetof(Slave, x), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", offsetof(Slave, yPtr), offsetof(Slave, y), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index db9141c..db9141c 100644..100755 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index a820411..76bf03b 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -47,7 +47,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL + TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL diff --git a/generic/tkScale.c b/generic/tkScale.c index 9fbc2cc..affea94 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -45,97 +45,97 @@ static const char *const stateStrings[] = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCALE_ACTIVE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkScale, activeBorder), + DEF_SCALE_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, activeBorder), 0, DEF_SCALE_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_SCALE_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkScale, bgBorder), + DEF_SCALE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, bgBorder), 0, DEF_SCALE_BG_MONO, 0}, {TK_OPTION_DOUBLE, "-bigincrement", "bigIncrement", "BigIncrement", - DEF_SCALE_BIG_INCREMENT, TCL_AUTO_LENGTH, offsetof(TkScale, bigIncrement), + DEF_SCALE_BIG_INCREMENT, TCL_INDEX_NONE, offsetof(TkScale, bigIncrement), 0, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCALE_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(TkScale, borderWidth), + DEF_SCALE_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_SCALE_COMMAND, TCL_AUTO_LENGTH, offsetof(TkScale, command), + DEF_SCALE_COMMAND, TCL_INDEX_NONE, offsetof(TkScale, command), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_SCALE_CURSOR, TCL_AUTO_LENGTH, offsetof(TkScale, cursor), + DEF_SCALE_CURSOR, TCL_INDEX_NONE, offsetof(TkScale, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-digits", "digits", "Digits", - DEF_SCALE_DIGITS, TCL_AUTO_LENGTH, offsetof(TkScale, digits), + DEF_SCALE_DIGITS, TCL_INDEX_NONE, offsetof(TkScale, digits), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_SCALE_FONT, TCL_AUTO_LENGTH, offsetof(TkScale, tkfont), 0, 0, 0}, + DEF_SCALE_FONT, TCL_INDEX_NONE, offsetof(TkScale, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_SCALE_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkScale, textColorPtr), 0, + DEF_SCALE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, textColorPtr), 0, (ClientData) DEF_SCALE_FG_MONO, 0}, - {TK_OPTION_DOUBLE, "-from", "from", "From", DEF_SCALE_FROM, TCL_AUTO_LENGTH, + {TK_OPTION_DOUBLE, "-from", "from", "From", DEF_SCALE_FROM, TCL_INDEX_NONE, offsetof(TkScale, fromValue), 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCALE_HIGHLIGHT_BG_COLOR, - TCL_AUTO_LENGTH, offsetof(TkScale, highlightBorder), + TCL_INDEX_NONE, offsetof(TkScale, highlightBorder), 0, DEF_SCALE_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_SCALE_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkScale, highlightColorPtr), + DEF_SCALE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkScale, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_SCALE_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_SCALE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-label", "label", "Label", - DEF_SCALE_LABEL, TCL_AUTO_LENGTH, offsetof(TkScale, label), + DEF_SCALE_LABEL, TCL_INDEX_NONE, offsetof(TkScale, label), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_SCALE_LENGTH, TCL_AUTO_LENGTH, offsetof(TkScale, length), 0, 0, 0}, + DEF_SCALE_LENGTH, TCL_INDEX_NONE, offsetof(TkScale, length), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - DEF_SCALE_ORIENT, TCL_AUTO_LENGTH, offsetof(TkScale, orient), + DEF_SCALE_ORIENT, TCL_INDEX_NONE, offsetof(TkScale, orient), 0, orientStrings, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_SCALE_RELIEF, TCL_AUTO_LENGTH, offsetof(TkScale, relief), 0, 0, 0}, + DEF_SCALE_RELIEF, TCL_INDEX_NONE, offsetof(TkScale, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SCALE_REPEAT_DELAY, TCL_AUTO_LENGTH, offsetof(TkScale, repeatDelay), + DEF_SCALE_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(TkScale, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SCALE_REPEAT_INTERVAL, TCL_AUTO_LENGTH, offsetof(TkScale, repeatInterval), + DEF_SCALE_REPEAT_INTERVAL, TCL_INDEX_NONE, offsetof(TkScale, repeatInterval), 0, 0, 0}, {TK_OPTION_DOUBLE, "-resolution", "resolution", "Resolution", - DEF_SCALE_RESOLUTION, TCL_AUTO_LENGTH, offsetof(TkScale, resolution), + DEF_SCALE_RESOLUTION, TCL_INDEX_NONE, offsetof(TkScale, resolution), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-showvalue", "showValue", "ShowValue", - DEF_SCALE_SHOW_VALUE, TCL_AUTO_LENGTH, offsetof(TkScale, showValue), + DEF_SCALE_SHOW_VALUE, TCL_INDEX_NONE, offsetof(TkScale, showValue), 0, 0, 0}, {TK_OPTION_PIXELS, "-sliderlength", "sliderLength", "SliderLength", - DEF_SCALE_SLIDER_LENGTH, TCL_AUTO_LENGTH, offsetof(TkScale, sliderLength), + DEF_SCALE_SLIDER_LENGTH, TCL_INDEX_NONE, offsetof(TkScale, sliderLength), 0, 0, 0}, {TK_OPTION_RELIEF, "-sliderrelief", "sliderRelief", "SliderRelief", - DEF_SCALE_SLIDER_RELIEF, TCL_AUTO_LENGTH, offsetof(TkScale, sliderRelief), + DEF_SCALE_SLIDER_RELIEF, TCL_INDEX_NONE, offsetof(TkScale, sliderRelief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_SCALE_STATE, TCL_AUTO_LENGTH, offsetof(TkScale, state), + DEF_SCALE_STATE, TCL_INDEX_NONE, offsetof(TkScale, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_SCALE_TAKE_FOCUS, offsetof(TkScale, takeFocusPtr), TCL_AUTO_LENGTH, + DEF_SCALE_TAKE_FOCUS, offsetof(TkScale, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-tickinterval", "tickInterval", "TickInterval", - DEF_SCALE_TICK_INTERVAL, TCL_AUTO_LENGTH, offsetof(TkScale, tickInterval), + DEF_SCALE_TICK_INTERVAL, TCL_INDEX_NONE, offsetof(TkScale, tickInterval), 0, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", - DEF_SCALE_TO, TCL_AUTO_LENGTH, offsetof(TkScale, toValue), 0, 0, 0}, + DEF_SCALE_TO, TCL_INDEX_NONE, offsetof(TkScale, toValue), 0, 0, 0}, {TK_OPTION_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCALE_TROUGH_COLOR, TCL_AUTO_LENGTH, offsetof(TkScale, troughColorPtr), + DEF_SCALE_TROUGH_COLOR, TCL_INDEX_NONE, offsetof(TkScale, troughColorPtr), 0, DEF_SCALE_TROUGH_MONO, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_SCALE_VARIABLE, offsetof(TkScale, varNamePtr), TCL_AUTO_LENGTH, + DEF_SCALE_VARIABLE, offsetof(TkScale, varNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_SCALE_WIDTH, TCL_AUTO_LENGTH, offsetof(TkScale, width), 0, 0, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, 0, 0} + DEF_SCALE_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, width), 0, 0, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* diff --git a/generic/tkSquare.c b/generic/tkSquare.c index b2ec521..2b2d3c5 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -66,29 +66,29 @@ typedef struct { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - "#d9d9d9", offsetof(Square, bgBorderPtr), TCL_AUTO_LENGTH, 0, + "#d9d9d9", offsetof(Square, bgBorderPtr), TCL_INDEX_NONE, 0, "white", 0}, - {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, - {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - "2", offsetof(Square, borderWidthPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", offsetof(Square, doubleBufferPtr), TCL_AUTO_LENGTH, 0 , NULL, 0}, - {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0}, + {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", - "#b03060", offsetof(Square, fgBorderPtr), TCL_AUTO_LENGTH, 0, + "#b03060", offsetof(Square, fgBorderPtr), TCL_INDEX_NONE, 0, "black", 0}, {TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0", - offsetof(Square, xPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(Square, xPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_PIXELS, "-posy", "posy", "PosY", "0", - offsetof(Square, yPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(Square, yPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - "raised", offsetof(Square, reliefPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + "raised", offsetof(Square, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_PIXELS, "-size", "size", "Size", "20", - offsetof(Square, sizeObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(Square, sizeObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 1942173..8b98928 100644..100755 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -100,6 +100,12 @@ static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) #define TkMacOSXInitAppleEvents_ TkMacOSXInitAppleEvents #define TkGenWMConfigureEvent_ TkGenWMConfigureEvent #define TkGenerateActivateEvents_ TkGenerateActivateEvents +#define Tk_CanvasTagsParseProc \ + (int (*) (void *, Tcl_Interp *,Tk_Window, const char *, char *, \ + int offset))(void *)TkCanvasTagsParseProc +#define Tk_CanvasTagsPrintProc \ + (const char *(*) (void *,Tk_Window, char *, int, \ + Tcl_FreeProc **))(void *)TkCanvasTagsPrintProc #ifdef _WIN32 diff --git a/generic/tkTest.c b/generic/tkTest.c index c4eb3fe..1f76fe2 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -186,19 +186,10 @@ static int TestmetricsObjCmd(ClientData dummy, static int TestobjconfigObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); -static int CustomOptionSet(ClientData clientData, - Tcl_Interp *interp, Tk_Window tkwin, - Tcl_Obj **value, char *recordPtr, - int internalOffset, char *saveInternalPtr, - int flags); -static Tcl_Obj * CustomOptionGet(ClientData clientData, - Tk_Window tkwin, char *recordPtr, - int internalOffset); -static void CustomOptionRestore(ClientData clientData, - Tk_Window tkwin, char *internalPtr, - char *saveInternalPtr); -static void CustomOptionFree(ClientData clientData, - Tk_Window tkwin, char *internalPtr); +static Tk_CustomOptionSetProc CustomOptionSet; +static Tk_CustomOptionGetProc CustomOptionGet; +static Tk_CustomOptionRestoreProc CustomOptionRestore; +static Tk_CustomOptionFreeProc CustomOptionFree; static int TestpropObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]); @@ -567,9 +558,9 @@ TestobjconfigObjCmd( } ExtensionWidgetRecord; static const Tk_OptionSpec baseSpecs[] = { {TK_OPTION_STRING, "-one", "one", "One", "one", - offsetof(ExtensionWidgetRecord, base1ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base1ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-two", "two", "Two", "two", - offsetof(ExtensionWidgetRecord, base2ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base2ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; @@ -611,50 +602,50 @@ TestobjconfigObjCmd( }; static const Tk_OptionSpec typesSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", - offsetof(TypesRecord, booleanPtr), TCL_AUTO_LENGTH, 0, 0, 0x1}, + offsetof(TypesRecord, booleanPtr), TCL_INDEX_NONE, 0, 0, 0x1}, {TK_OPTION_INT, "-integer", "integer", "Integer", "7", - offsetof(TypesRecord, integerPtr), TCL_AUTO_LENGTH, 0, 0, 0x2}, + offsetof(TypesRecord, integerPtr), TCL_INDEX_NONE, 0, 0, 0x2}, {TK_OPTION_DOUBLE, "-double", "double", "Double", "3.14159", - offsetof(TypesRecord, doublePtr), TCL_AUTO_LENGTH, 0, 0, 0x4}, + offsetof(TypesRecord, doublePtr), TCL_INDEX_NONE, 0, 0, 0x4}, {TK_OPTION_STRING, "-string", "string", "String", - "foo", offsetof(TypesRecord, stringPtr), TCL_AUTO_LENGTH, + "foo", offsetof(TypesRecord, stringPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x8}, {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", - "one", offsetof(TypesRecord, stringTablePtr), TCL_AUTO_LENGTH, + "one", offsetof(TypesRecord, stringTablePtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, stringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", - "red", offsetof(TypesRecord, colorPtr), TCL_AUTO_LENGTH, + "red", offsetof(TypesRecord, colorPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", - offsetof(TypesRecord, fontPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, fontPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x40}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", "gray50", - offsetof(TypesRecord, bitmapPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, bitmapPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", - "blue", offsetof(TypesRecord, borderPtr), TCL_AUTO_LENGTH, + "blue", offsetof(TypesRecord, borderPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", - offsetof(TypesRecord, reliefPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, reliefPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x200}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm", - offsetof(TypesRecord, cursorPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, cursorPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x400}, {TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left", - offsetof(TypesRecord, justifyPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, justifyPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x800}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, - offsetof(TypesRecord, anchorPtr), TCL_AUTO_LENGTH, + offsetof(TypesRecord, anchorPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x1000}, {TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel", - "1", offsetof(TypesRecord, pixelPtr), TCL_AUTO_LENGTH, + "1", offsetof(TypesRecord, pixelPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, 0, 0x2000}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, - "", offsetof(TypesRecord, customPtr), TCL_AUTO_LENGTH, + "", offsetof(TypesRecord, customPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-color", 0x8000}, + NULL, 0, TCL_INDEX_NONE, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_OptionTable optionTable; @@ -756,15 +747,15 @@ TestobjconfigObjCmd( ExtensionWidgetRecord *recordPtr; static const Tk_OptionSpec extensionSpecs[] = { {TK_OPTION_STRING, "-three", "three", "Three", "three", - offsetof(ExtensionWidgetRecord, extension3ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, extension3ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-four", "four", "Four", "four", - offsetof(ExtensionWidgetRecord, extension4ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, extension4ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-two", "two", "Two", "two and a half", - offsetof(ExtensionWidgetRecord, base2ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base2ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-oneAgain", "oneAgain", "OneAgain", "one again", - offsetof(ExtensionWidgetRecord, extension5ObjPtr), TCL_AUTO_LENGTH, 0, NULL, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_AUTO_LENGTH, 0, + offsetof(ExtensionWidgetRecord, extension5ObjPtr), TCL_INDEX_NONE, 0, NULL, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, (ClientData) baseSpecs, 0} }; Tk_Window tkwin; @@ -886,53 +877,53 @@ TestobjconfigObjCmd( }; static const Tk_OptionSpec internalSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", - TCL_AUTO_LENGTH, offsetof(InternalRecord, boolean), 0, 0, 0x1}, + TCL_INDEX_NONE, offsetof(InternalRecord, boolean), 0, 0, 0x1}, {TK_OPTION_INT, "-integer", "integer", "Integer", "148962237", - TCL_AUTO_LENGTH, offsetof(InternalRecord, integer), 0, 0, 0x2}, + TCL_INDEX_NONE, offsetof(InternalRecord, integer), 0, 0, 0x2}, {TK_OPTION_DOUBLE, "-double", "double", "Double", "3.14159", - TCL_AUTO_LENGTH, offsetof(InternalRecord, doubleValue), 0, 0, 0x4}, + TCL_INDEX_NONE, offsetof(InternalRecord, doubleValue), 0, 0, 0x4}, {TK_OPTION_STRING, "-string", "string", "String", "foo", - TCL_AUTO_LENGTH, offsetof(InternalRecord, string), + TCL_INDEX_NONE, offsetof(InternalRecord, string), TK_CONFIG_NULL_OK, 0, 0x8}, {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", "one", - TCL_AUTO_LENGTH, offsetof(InternalRecord, index), + TCL_INDEX_NONE, offsetof(InternalRecord, index), TK_CONFIG_NULL_OK, internalStringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", "red", - TCL_AUTO_LENGTH, offsetof(InternalRecord, colorPtr), + TCL_INDEX_NONE, offsetof(InternalRecord, colorPtr), TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", - TCL_AUTO_LENGTH, offsetof(InternalRecord, tkfont), + TCL_INDEX_NONE, offsetof(InternalRecord, tkfont), TK_CONFIG_NULL_OK, 0, 0x40}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", "gray50", - TCL_AUTO_LENGTH, offsetof(InternalRecord, bitmap), + TCL_INDEX_NONE, offsetof(InternalRecord, bitmap), TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", "blue", - TCL_AUTO_LENGTH, offsetof(InternalRecord, border), + TCL_INDEX_NONE, offsetof(InternalRecord, border), TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", - TCL_AUTO_LENGTH, offsetof(InternalRecord, relief), + TCL_INDEX_NONE, offsetof(InternalRecord, relief), TK_CONFIG_NULL_OK, 0, 0x200}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm", - TCL_AUTO_LENGTH, offsetof(InternalRecord, cursor), + TCL_INDEX_NONE, offsetof(InternalRecord, cursor), TK_CONFIG_NULL_OK, 0, 0x400}, {TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left", - TCL_AUTO_LENGTH, offsetof(InternalRecord, justify), + TCL_INDEX_NONE, offsetof(InternalRecord, justify), TK_CONFIG_NULL_OK, 0, 0x800}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, - TCL_AUTO_LENGTH, offsetof(InternalRecord, anchor), + TCL_INDEX_NONE, offsetof(InternalRecord, anchor), TK_CONFIG_NULL_OK, 0, 0x1000}, {TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel", "1", - TCL_AUTO_LENGTH, offsetof(InternalRecord, pixels), + TCL_INDEX_NONE, offsetof(InternalRecord, pixels), TK_CONFIG_NULL_OK, 0, 0x2000}, {TK_OPTION_WINDOW, "-window", "window", "Window", NULL, - TCL_AUTO_LENGTH, offsetof(InternalRecord, tkwin), + TCL_INDEX_NONE, offsetof(InternalRecord, tkwin), TK_CONFIG_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, "", - TCL_AUTO_LENGTH, offsetof(InternalRecord, custom), + TCL_INDEX_NONE, offsetof(InternalRecord, custom), TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, - NULL, TCL_AUTO_LENGTH, TCL_AUTO_LENGTH, 0, "-color", 0x8000}, + NULL, TCL_INDEX_NONE, TCL_INDEX_NONE, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_OptionTable optionTable; @@ -1003,15 +994,15 @@ TestobjconfigObjCmd( FiveRecord *recordPtr; static const Tk_OptionSpec smallSpecs[] = { {TK_OPTION_INT, "-one", "one", "One", "1", - offsetof(FiveRecord, one), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(FiveRecord, one), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_INT, "-two", "two", "Two", "2", - offsetof(FiveRecord, two), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(FiveRecord, two), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_INT, "-three", "three", "Three", "3", - offsetof(FiveRecord, three), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(FiveRecord, three), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_INT, "-four", "four", "Four", "4", - offsetof(FiveRecord, four), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(FiveRecord, four), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-five", NULL, NULL, NULL, - offsetof(FiveRecord, five), TCL_AUTO_LENGTH, 0, NULL, 0}, + offsetof(FiveRecord, five), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; @@ -1088,7 +1079,7 @@ TestobjconfigObjCmd( SlaveRecord *recordPtr; static const Tk_OptionSpec slaveSpecs[] = { {TK_OPTION_WINDOW, "-window", "window", "Window", ".bar", - offsetof(SlaveRecord, windowPtr), TCL_AUTO_LENGTH, TK_CONFIG_NULL_OK, NULL, 0}, + offsetof(SlaveRecord, windowPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_Window tkwin = Tk_CreateWindowFromPath(interp, @@ -2047,8 +2038,7 @@ TestwrapperObjCmd( * CustomOptionSet Sets option value to new setting. * CustomOptionGet Creates a new Tcl_Obj. * CustomOptionRestore Resets option value to original value. - * CustomOptionFree Free storage for internal rep of - * option. + * CustomOptionFree Free storage for internal rep of option. * *---------------------------------------------------------------------- */ @@ -2060,7 +2050,7 @@ CustomOptionSet( Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, - int internalOffset, + TkSizeT internalOffset, char *saveInternalPtr, int flags) { @@ -2071,7 +2061,7 @@ CustomOptionSet( objEmpty = 0; - if (internalOffset != -1) { + if (internalOffset != TCL_INDEX_NONE) { internalPtr = recordPtr + internalOffset; } else { internalPtr = NULL; @@ -2121,7 +2111,7 @@ CustomOptionGet( ClientData dummy, Tk_Window tkwin, char *recordPtr, - int internalOffset) + TkSizeT internalOffset) { (void)dummy; (void)tkwin; diff --git a/generic/tkText.c b/generic/tkText.c index 9822806..06ca03c 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -96,11 +96,11 @@ static const char *const insertUnfocussedStrings[] = { static int SetLineStartEnd(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, - int internalOffset, char *oldInternalPtr, + TkSizeT internalOffset, char *oldInternalPtr, int flags); static Tcl_Obj * GetLineStartEnd(ClientData clientData, Tk_Window tkwin, char *recordPtr, - int internalOffset); + TkSizeT internalOffset); static void RestoreLineStartEnd(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); @@ -121,90 +121,90 @@ static const Tk_ObjCustomOption lineOption = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BOOLEAN, "-autoseparators", "autoSeparators", - "AutoSeparators", DEF_TEXT_AUTO_SEPARATORS, TCL_AUTO_LENGTH, + "AutoSeparators", DEF_TEXT_AUTO_SEPARATORS, TCL_INDEX_NONE, offsetof(TkText, autoSeparators), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_TEXT_BG_COLOR, TCL_AUTO_LENGTH, offsetof(TkText, border), + DEF_TEXT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkText, border), 0, DEF_TEXT_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-borderwidth", + NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-background", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BOOLEAN, "-blockcursor", "blockCursor", - "BlockCursor", DEF_TEXT_BLOCK_CURSOR, TCL_AUTO_LENGTH, + "BlockCursor", DEF_TEXT_BLOCK_CURSOR, TCL_INDEX_NONE, offsetof(TkText, insertCursorType), 0, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_TEXT_BORDER_WIDTH, TCL_AUTO_LENGTH, offsetof(TkText, borderWidth), + DEF_TEXT_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkText, borderWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_TEXT_CURSOR, TCL_AUTO_LENGTH, offsetof(TkText, cursor), + DEF_TEXT_CURSOR, TCL_INDEX_NONE, offsetof(TkText, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-endline", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkText, end), TK_OPTION_NULL_OK, + NULL, TCL_INDEX_NONE, offsetof(TkText, end), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", DEF_TEXT_EXPORT_SELECTION, TCL_AUTO_LENGTH, + "ExportSelection", DEF_TEXT_EXPORT_SELECTION, TCL_INDEX_NONE, offsetof(TkText, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, TCL_AUTO_LENGTH, 0, "-foreground", 0}, + NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_TEXT_FONT, TCL_AUTO_LENGTH, offsetof(TkText, tkfont), 0, 0, + DEF_TEXT_FONT, TCL_INDEX_NONE, offsetof(TkText, tkfont), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_TEXT_FG, TCL_AUTO_LENGTH, offsetof(TkText, fgColor), 0, + DEF_TEXT_FG, TCL_INDEX_NONE, offsetof(TkText, fgColor), 0, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_TEXT_HEIGHT, TCL_AUTO_LENGTH, offsetof(TkText, height), 0, 0, 0}, + DEF_TEXT_HEIGHT, TCL_INDEX_NONE, offsetof(TkText, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_TEXT_HIGHLIGHT_BG, - TCL_AUTO_LENGTH, offsetof(TkText, highlightBgColorPtr), + TCL_INDEX_NONE, offsetof(TkText, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_TEXT_HIGHLIGHT, TCL_AUTO_LENGTH, offsetof(TkText, highlightColorPtr), + DEF_TEXT_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkText, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_TEXT_HIGHLIGHT_WIDTH, TCL_AUTO_LENGTH, + "HighlightThickness", DEF_TEXT_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, highlightWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_BORDER, "-inactiveselectbackground","inactiveSelectBackground", "Foreground", DEF_TEXT_INACTIVE_SELECT_COLOR, - TCL_AUTO_LENGTH, offsetof(TkText, inactiveSelBorder), + TCL_INDEX_NONE, offsetof(TkText, inactiveSelBorder), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_TEXT_INSERT_BG, - TCL_AUTO_LENGTH, offsetof(TkText, insertBorder), + TCL_INDEX_NONE, offsetof(TkText, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, TCL_AUTO_LENGTH, + "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, TCL_INDEX_NONE, offsetof(TkText, insertBorderWidth), 0, (ClientData) DEF_TEXT_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_TEXT_INSERT_OFF_TIME, TCL_AUTO_LENGTH, offsetof(TkText, insertOffTime), + DEF_TEXT_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(TkText, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_TEXT_INSERT_ON_TIME, TCL_AUTO_LENGTH, offsetof(TkText, insertOnTime), + DEF_TEXT_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(TkText, insertOnTime), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed", - DEF_TEXT_INSERT_UNFOCUSSED, TCL_AUTO_LENGTH, offsetof(TkText, insertUnfocussed), + DEF_TEXT_INSERT_UNFOCUSSED, TCL_INDEX_NONE, offsetof(TkText, insertUnfocussed), 0, insertUnfocussedStrings, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_TEXT_INSERT_WIDTH, TCL_AUTO_LENGTH, offsetof(TkText, insertWidth), + DEF_TEXT_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, insertWidth), 0, 0, 0}, {TK_OPTION_INT, "-maxundo", "maxUndo", "MaxUndo", - DEF_TEXT_MAX_UNDO, TCL_AUTO_LENGTH, offsetof(TkText, maxUndo), + DEF_TEXT_MAX_UNDO, TCL_INDEX_NONE, offsetof(TkText, maxUndo), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_TEXT_PADX, TCL_AUTO_LENGTH, offsetof(TkText, padX), 0, 0, + DEF_TEXT_PADX, TCL_INDEX_NONE, offsetof(TkText, padX), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_TEXT_PADY, TCL_AUTO_LENGTH, offsetof(TkText, padY), 0, 0, 0}, + DEF_TEXT_PADY, TCL_INDEX_NONE, offsetof(TkText, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_TEXT_RELIEF, TCL_AUTO_LENGTH, offsetof(TkText, relief), 0, 0, 0}, + DEF_TEXT_RELIEF, TCL_INDEX_NONE, offsetof(TkText, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_TEXT_SELECT_COLOR, TCL_AUTO_LENGTH, offsetof(TkText, selBorder), + DEF_TEXT_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkText, selBorder), 0, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_TEXT_SELECT_BD_COLOR, @@ -212,48 +212,48 @@ static const Tk_OptionSpec optionSpecs[] = { offsetof(TkText, selBorderWidth), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_TEXT_SELECT_FG_COLOR, TCL_AUTO_LENGTH, offsetof(TkText, selFgColorPtr), + DEF_TEXT_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(TkText, selFgColorPtr), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", - DEF_TEXT_SET_GRID, TCL_AUTO_LENGTH, offsetof(TkText, setGrid), 0, 0, 0}, + DEF_TEXT_SET_GRID, TCL_INDEX_NONE, offsetof(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", - DEF_TEXT_SPACING1, TCL_AUTO_LENGTH, offsetof(TkText, spacing1), + DEF_TEXT_SPACING1, TCL_INDEX_NONE, offsetof(TkText, spacing1), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", - DEF_TEXT_SPACING2, TCL_AUTO_LENGTH, offsetof(TkText, spacing2), + DEF_TEXT_SPACING2, TCL_INDEX_NONE, offsetof(TkText, spacing2), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", - DEF_TEXT_SPACING3, TCL_AUTO_LENGTH, offsetof(TkText, spacing3), + DEF_TEXT_SPACING3, TCL_INDEX_NONE, offsetof(TkText, spacing3), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkText, start), TK_OPTION_NULL_OK, + NULL, TCL_INDEX_NONE, offsetof(TkText, start), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_TEXT_STATE, TCL_AUTO_LENGTH, offsetof(TkText, state), + DEF_TEXT_STATE, TCL_INDEX_NONE, offsetof(TkText, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", - DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), TCL_AUTO_LENGTH, + DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", - DEF_TEXT_TABSTYLE, TCL_AUTO_LENGTH, offsetof(TkText, tabStyle), + DEF_TEXT_TABSTYLE, TCL_INDEX_NONE, offsetof(TkText, tabStyle), 0, tabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_TEXT_TAKE_FOCUS, TCL_AUTO_LENGTH, offsetof(TkText, takeFocus), + DEF_TEXT_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(TkText, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-undo", "undo", "Undo", - DEF_TEXT_UNDO, TCL_AUTO_LENGTH, offsetof(TkText, undo), + DEF_TEXT_UNDO, TCL_INDEX_NONE, offsetof(TkText, undo), TK_OPTION_DONT_SET_DEFAULT, 0 , 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_TEXT_WIDTH, TCL_AUTO_LENGTH, offsetof(TkText, width), 0, 0, + DEF_TEXT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, width), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-wrap", "wrap", "Wrap", - DEF_TEXT_WRAP, TCL_AUTO_LENGTH, offsetof(TkText, wrapMode), + DEF_TEXT_WRAP, TCL_INDEX_NONE, offsetof(TkText, wrapMode), 0, wrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_TEXT_XSCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(TkText, xScrollCmd), + DEF_TEXT_XSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_TEXT_YSCROLL_COMMAND, TCL_AUTO_LENGTH, offsetof(TkText, yScrollCmd), + DEF_TEXT_YSCROLL_COMMAND, TCL_INDEX_NONE, offsetof(TkText, yScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0} }; @@ -6780,14 +6780,14 @@ GetLineStartEnd( ClientData dummy, Tk_Window tkwin, char *recordPtr, /* Pointer to widget record. */ - int internalOffset) /* Offset within *recordPtr containing the + TkSizeT internalOffset) /* Offset within *recordPtr containing the * line value. */ { TkTextLine *linePtr = *(TkTextLine **)(recordPtr + internalOffset); (void)dummy; (void)tkwin; - if (linePtr == NULL) { + if ((internalOffset == TCL_INDEX_NONE) || (recordPtr == NULL)) { return Tcl_NewObj(); } return Tcl_NewWideIntObj(1 + TkBTreeLinesTo(NULL, linePtr)); @@ -6821,7 +6821,7 @@ SetLineStartEnd( * We use a pointer to the pointer because we * may need to return a value (NULL). */ char *recordPtr, /* Pointer to storage for the widget record. */ - int internalOffset, /* Offset within *recordPtr at which the + TkSizeT internalOffset, /* Offset within *recordPtr at which the * internal value is to be stored. */ char *oldInternalPtr, /* Pointer to storage for the old value. */ int flags) /* Flags for the option, set Tk_SetOptions. */ @@ -6832,7 +6832,7 @@ SetLineStartEnd( (void)dummy; (void)tkwin; - if (internalOffset >= 0) { + if (internalOffset != TCL_INDEX_NONE) { internalPtr = (char *)recordPtr + internalOffset; } else { internalPtr = NULL; diff --git a/generic/tkText.h b/generic/tkText.h index e248cd5..4d1d4b3 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -856,8 +856,8 @@ typedef void Tk_SegLineChangeProc(struct TkTextSegment *segPtr, TkTextLine *linePtr); typedef int Tk_SegLayoutProc(struct TkText *textPtr, struct TkTextIndex *indexPtr, - TkTextSegment *segPtr, int offset, int maxX, - int maxChars, int noCharsYet, TkWrapMode wrapMode, + TkTextSegment *segPtr, TkSizeT offset, int maxX, + TkSizeT maxChars, int noCharsYet, TkWrapMode wrapMode, struct TkTextDispChunk *chunkPtr); typedef void Tk_SegCheckProc(TkTextSegment *segPtr, TkTextLine *linePtr); @@ -1060,7 +1060,7 @@ MODULE_SCOPE int TkTextIndexBbox(TkText *textPtr, int *widthPtr, int *heightPtr, int *charWidthPtr); MODULE_SCOPE int TkTextCharLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - int offset, int maxX, int maxChars, int noBreakYet, + TkSizeT offset, int maxX, TkSizeT maxChars, int noBreakYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); MODULE_SCOPE void TkTextCreateDInfo(TkText *textPtr); MODULE_SCOPE int TkTextDLineInfo(TkText *textPtr, diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index f4fb554..2d8a6c3 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -2654,7 +2654,7 @@ TkBTreeStartSearch( /* Where to store information about search's * progress. */ { - int offset; + TkSizeT offset; TkTextIndex index0; /* First index of the tag. */ TkTextSegment *seg0Ptr; /* First segment of the tag. */ @@ -2686,11 +2686,9 @@ TkBTreeStartSearch( searchPtr->nextPtr = seg0Ptr; /* Will be returned by NextTag. */ index1Ptr = &index0; } else { - TkSizeT offset1; searchPtr->curIndex = *index1Ptr; searchPtr->segPtr = NULL; - searchPtr->nextPtr = TkTextIndexToSeg(index1Ptr, &offset1); - offset = offset1; + searchPtr->nextPtr = TkTextIndexToSeg(index1Ptr, &offset); searchPtr->curIndex.byteIndex -= offset; } searchPtr->lastPtr = TkTextIndexToSeg(index2Ptr, NULL); @@ -2752,8 +2750,7 @@ TkBTreeStartSearchBack( /* Where to store information about search's * progress. */ { - int offset; - TkSizeT offset1; + TkSizeT offset; TkTextIndex index0; /* Last index of the tag. */ TkTextIndex backOne; /* One character before starting index. */ TkTextSegment *seg0Ptr; /* Last segment of the tag. */ @@ -2790,8 +2787,7 @@ TkBTreeStartSearchBack( COUNT_INDICES); } searchPtr->segPtr = NULL; - searchPtr->nextPtr = TkTextIndexToSeg(&searchPtr->curIndex, &offset1); - offset = offset1; + searchPtr->nextPtr = TkTextIndexToSeg(&searchPtr->curIndex, &offset); searchPtr->curIndex.byteIndex -= offset; /* diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 5ff021f..c75d98b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -1173,7 +1173,8 @@ LayoutDLine( /* Pointer to last chunk in display lines with * numBytes > 0. Used to drop 0-sized chunks * from the end of the line. */ - int byteOffset, ascent, descent, code, elide, elidesize; + TkSizeT byteOffset; + int ascent, descent, code, elide, elidesize; StyleValues *sValuePtr; TkTextElideInfo info; /* Keep track of elide state. */ @@ -1334,7 +1335,7 @@ LayoutDLine( connectNextLogicalLine: byteOffset = curIndex.byteIndex; segPtr = curIndex.linePtr->segPtr; - while ((byteOffset > 0) && (byteOffset >= segPtr->size)) { + while ((byteOffset + 1 > 1) && (byteOffset >= (TkSizeT)segPtr->size)) { byteOffset -= segPtr->size; segPtr = segPtr->nextPtr; @@ -1374,7 +1375,7 @@ LayoutDLine( if (elide && (lastChunkPtr != NULL) && (lastChunkPtr->displayProc == NULL /*ElideDisplayProc*/)) { elidesize = segPtr->size - byteOffset; - if (elidesize > 0) { + if ((TkSizeT)segPtr->size > byteOffset) { curIndex.byteIndex += elidesize; lastChunkPtr->numBytes += elidesize; breakByteOffset = lastChunkPtr->breakIndex @@ -1620,7 +1621,7 @@ LayoutDLine( } curIndex.byteIndex += chunkPtr->numBytes; byteOffset += chunkPtr->numBytes; - if (byteOffset >= segPtr->size) { + if (byteOffset >= (TkSizeT)segPtr->size) { byteOffset = 0; segPtr = segPtr->nextPtr; if (elide && segPtr == NULL) { @@ -1697,12 +1698,10 @@ LayoutDLine( ckfree(chunkPtr); } if (breakByteOffset != breakChunkPtr->numBytes) { - TkSizeT byteOffset1; if (breakChunkPtr->undisplayProc != NULL) { breakChunkPtr->undisplayProc(textPtr, breakChunkPtr); } - segPtr = TkTextIndexToSeg(&breakIndex, &byteOffset1); - byteOffset = byteOffset1; + segPtr = TkTextIndexToSeg(&breakIndex, &byteOffset); segPtr->typePtr->layoutProc(textPtr, &breakIndex, segPtr, byteOffset, maxX, breakByteOffset, 0, wrapMode, breakChunkPtr); @@ -3061,7 +3060,7 @@ AsyncUpdateLineMetrics( * and we've reached the last line, then we're done. */ - if (dInfoPtr->metricEpoch == TCL_AUTO_LENGTH + if (dInfoPtr->metricEpoch == TCL_INDEX_NONE && lineNum == dInfoPtr->lastMetricUpdateLine) { /* * We have looped over all lines, so we're done. We must release our @@ -3245,7 +3244,7 @@ TkTextUpdateLineMetrics( * then we can't be done. */ - if (textPtr->dInfoPtr->metricEpoch == TCL_AUTO_LENGTH && lineNum == endLine) { + if (textPtr->dInfoPtr->metricEpoch == TCL_INDEX_NONE && lineNum == endLine) { /* @@ -7605,11 +7604,11 @@ TkTextCharLayoutProc( TkTextIndex *indexPtr, /* Index of first character to lay out * (corresponds to segPtr and offset). */ TkTextSegment *segPtr, /* Segment being layed out. */ - int byteOffset, /* Byte offset within segment of first + TkSizeT byteOffset, /* Byte offset within segment of first * character to consider. */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - int maxBytes, /* Chunk must not include more than this many + TkSizeT maxBytes, /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this display line yet. */ @@ -7686,7 +7685,7 @@ TkTextCharLayoutProc( chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ - if (bytesThatFit < maxBytes) { + if ((TkSizeT)bytesThatFit + 1 <= maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { int ch; int chLen = TkUtfToUniChar(p, &ch); @@ -7823,7 +7822,7 @@ TkTextCharLayoutProc( } } checkForNextChunk: - if ((bytesThatFit + byteOffset) == segPtr->size) { + if ((bytesThatFit + byteOffset) == (TkSizeT)segPtr->size) { for (nextPtr = segPtr->nextPtr; nextPtr != NULL; nextPtr = nextPtr->nextPtr) { if (nextPtr->size != 0) { diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 4dc2c75..cc229d6 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -43,7 +43,7 @@ static void EmbImageDisplayProc(TkText *textPtr, Drawable dst, int screenY); static int EmbImageLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - int offset, int maxX, int maxChars, + TkSizeT offset, int maxX, TkSizeT maxChars, int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static void EmbImageProc(ClientData clientData, int x, int y, @@ -83,17 +83,17 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, - "center", TCL_AUTO_LENGTH, offsetof(TkTextEmbImage, align), + "center", TCL_INDEX_NONE, offsetof(TkTextEmbImage, align), 0, alignStrings, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", TCL_AUTO_LENGTH, offsetof(TkTextEmbImage, padX), 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbImage, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", TCL_AUTO_LENGTH, offsetof(TkTextEmbImage, padY), 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbImage, padY), 0, 0, 0}, {TK_OPTION_STRING, "-image", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextEmbImage, imageString), + NULL, TCL_INDEX_NONE, offsetof(TkTextEmbImage, imageString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-name", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextEmbImage, imageName), + NULL, TCL_INDEX_NONE, offsetof(TkTextEmbImage, imageName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -533,11 +533,11 @@ EmbImageLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TkTextIndex *indexPtr, /* Identifies first character in chunk. */ TkTextSegment *eiPtr, /* Segment corresponding to indexPtr. */ - int offset, /* Offset within segPtr corresponding to + TkSizeT offset, /* Offset within segPtr corresponding to * indexPtr (always 0). */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - int maxChars, /* Chunk must not include more than this many + TkSizeT maxChars, /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 4687157..81cad85 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -1488,8 +1488,7 @@ TkTextIndexForwChars( TkTextLine *linePtr; TkTextSegment *segPtr; TkTextElideInfo *infoPtr = NULL; - TkSizeT byteOffset1; - int byteOffset; + TkSizeT byteOffset; char *start, *end, *p; int ch; int elide = 0; @@ -1520,8 +1519,7 @@ TkTextIndexForwChars( segPtr = infoPtr->segPtr; byteOffset = dstPtr->byteIndex - infoPtr->segOffset; } else { - segPtr = TkTextIndexToSeg(dstPtr, &byteOffset1); - byteOffset = byteOffset1; + segPtr = TkTextIndexToSeg(dstPtr, &byteOffset); } while (1) { @@ -1599,7 +1597,7 @@ TkTextIndexForwChars( charCount--; } } else if (type & COUNT_INDICES) { - if (charCount < segPtr->size - byteOffset) { + if (charCount + byteOffset < (TkSizeT)segPtr->size) { dstPtr->byteIndex += charCount; goto forwardCharDone; } @@ -1678,8 +1676,7 @@ IndexCountBytesOrdered( /* Index describing location of last character * at which to stop the count. */ { - int byteCount, offset; - TkSizeT offset1; + TkSizeT byteCount, offset; TkTextSegment *segPtr, *segPtr1; TkTextLine *linePtr; @@ -1695,8 +1692,7 @@ IndexCountBytesOrdered( * bytes between start of the indexPtr2 line and indexPtr2 */ - segPtr1 = TkTextIndexToSeg(indexPtr1, &offset1); - offset = offset1; + segPtr1 = TkTextIndexToSeg(indexPtr1, &offset); byteCount = -offset; for (segPtr = segPtr1; segPtr != NULL; segPtr = segPtr->nextPtr) { byteCount += segPtr->size; @@ -1757,8 +1753,8 @@ TkTextIndexCount( TkTextLine *linePtr1; TkTextSegment *segPtr, *seg2Ptr = NULL; TkTextElideInfo *infoPtr = NULL; - TkSizeT byteOffset1, maxBytes1; - int byteOffset, maxBytes, count = 0, elide = 0; + TkSizeT byteOffset, maxBytes, count = 0; + int elide = 0; int checkElided = (type & COUNT_DISPLAY); /* @@ -1766,12 +1762,10 @@ TkTextIndexCount( * count in the given segment. */ - segPtr = TkTextIndexToSeg(indexPtr1, &byteOffset1); - byteOffset = byteOffset1; + segPtr = TkTextIndexToSeg(indexPtr1, &byteOffset); linePtr1 = indexPtr1->linePtr; - seg2Ptr = TkTextIndexToSeg(indexPtr2, &maxBytes1); - maxBytes = maxBytes1; + seg2Ptr = TkTextIndexToSeg(indexPtr2, &maxBytes); if (checkElided) { infoPtr = (TkTextElideInfo *)ckalloc(sizeof(TkTextElideInfo)); @@ -1850,13 +1844,13 @@ TkTextIndexCount( } if (segPtr->typePtr == &tkTextCharType) { - int byteLen = segPtr->size - byteOffset; + TkSizeT byteLen = segPtr->size - byteOffset; unsigned char *str = (unsigned char *) segPtr->body.chars + byteOffset; - int i; + TkSizeT i; if (segPtr == seg2Ptr) { - if (byteLen > (maxBytes - byteOffset)) { + if (byteLen + byteOffset > maxBytes) { byteLen = maxBytes - byteOffset; } } @@ -1883,10 +1877,10 @@ TkTextIndexCount( } } else { if (type & COUNT_INDICES) { - int byteLen = segPtr->size - byteOffset; + TkSizeT byteLen = segPtr->size - byteOffset; if (segPtr == seg2Ptr) { - if (byteLen > (maxBytes - byteOffset)) { + if (byteLen + byteOffset > maxBytes) { byteLen = maxBytes - byteOffset; } } @@ -2303,8 +2297,7 @@ StartEnd( } else if ((*string == 'w') && (strncmp(string, "wordend", length) == 0) && (length >= 5)) { int firstChar = 1; - TkSizeT offset1; - int offset; + TkSizeT offset; /* * If the current character isn't part of a word then just move @@ -2316,8 +2309,7 @@ StartEnd( TkTextIndexForwChars(textPtr, indexPtr, 0, indexPtr, COUNT_DISPLAY_INDICES); } - segPtr = TkTextIndexToSeg(indexPtr, &offset1); - offset = offset1; + segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; @@ -2332,9 +2324,8 @@ StartEnd( } offset += chSize; indexPtr->byteIndex += chSize; - if (offset >= segPtr->size) { - segPtr = TkTextIndexToSeg(indexPtr, &offset1); - offset = offset1; + if (offset >= (TkSizeT)segPtr->size) { + segPtr = TkTextIndexToSeg(indexPtr, &offset); } } if (firstChar) { @@ -2349,8 +2340,7 @@ StartEnd( } else if ((*string == 'w') && (strncmp(string, "wordstart", length) == 0) && (length >= 5)) { int firstChar = 1; - int offset; - TkSizeT offset1; + TkSizeT offset; if (modifier == TKINDEX_DISPLAY) { TkTextIndexForwChars(textPtr, indexPtr, 0, indexPtr, @@ -2364,8 +2354,7 @@ StartEnd( * position. */ - segPtr = TkTextIndexToSeg(indexPtr, &offset1); - offset = offset1; + segPtr = TkTextIndexToSeg(indexPtr, &offset); while (1) { int chSize = 1; @@ -2376,7 +2365,7 @@ StartEnd( if (!Tcl_UniCharIsWordChar(ch)) { break; } - if (offset > 0) { + if (offset + 1 > 1) { chSize = (segPtr->body.chars + offset - TkUtfPrev(segPtr->body.chars + offset, segPtr->body.chars)); @@ -2395,12 +2384,11 @@ StartEnd( indexPtr->byteIndex -= chSize; } offset -= chSize; - if (offset < 0) { + if ((int)offset < 0) { if (indexPtr->byteIndex == 0) { goto done; } - segPtr = TkTextIndexToSeg(indexPtr, &offset1); - offset = offset1; + segPtr = TkTextIndexToSeg(indexPtr, &offset); } } diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 11acf37..8eceda9 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -36,8 +36,8 @@ static TkTextSegment * MarkCleanupProc(TkTextSegment *segPtr, static void MarkCheckProc(TkTextSegment *segPtr, TkTextLine *linePtr); static int MarkLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, - TkTextSegment *segPtr, int offset, int maxX, - int maxChars, int noCharsYet, TkWrapMode wrapMode, + TkTextSegment *segPtr, TkSizeT offset, int maxX, + TkSizeT maxChars, int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static int MarkFindNext(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *markName); @@ -564,11 +564,11 @@ MarkLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TkTextIndex *indexPtr, /* Identifies first character in chunk. */ TkTextSegment *segPtr, /* Segment corresponding to indexPtr. */ - int offset, /* Offset within segPtr corresponding to + TkSizeT offset, /* Offset within segPtr corresponding to * indexPtr (always 0). */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - int maxChars, /* Chunk must not include more than this many + TkSizeT maxChars, /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index d9cfc6b..0846e1e 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -40,66 +40,66 @@ static const char *const tabStyleStrings[] = { static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_STRING, "-elide", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, elideString), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elideString), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-justify", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_STRING, "-lmargin1", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-lmargin2", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-offset", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-overstrike", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, overstrikeString), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, overstrikeColor), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-relief", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing2", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing3", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-tabs", NULL, NULL, - NULL, offsetof(TkTextTag, tabStringPtr), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, tabStyle), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle), TK_OPTION_NULL_OK, tabStyleStrings, 0}, {TK_OPTION_STRING, "-underline", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, underlineString), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, underlineColor), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextTag, wrapMode), + NULL, TCL_INDEX_NONE, offsetof(TkTextTag, wrapMode), TK_OPTION_NULL_OK, wrapStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 6e0d5bb..d0b6a6c 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -57,7 +57,7 @@ static int EmbWinDeleteProc(TkTextSegment *segPtr, TkTextLine *linePtr, int treeGone); static int EmbWinLayoutProc(TkText *textPtr, TkTextIndex *indexPtr, TkTextSegment *segPtr, - int offset, int maxX, int maxChars,int noCharsYet, + TkSizeT offset, int maxX, TkSizeT maxChars,int noCharsYet, TkWrapMode wrapMode, TkTextDispChunk *chunkPtr); static void EmbWinStructureProc(ClientData clientData, XEvent *eventPtr); @@ -99,18 +99,18 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, - "center", TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, align), + "center", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, align), 0, alignStrings, 0}, {TK_OPTION_STRING, "-create", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, padX), 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, padY), 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, padY), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-stretch", NULL, NULL, - "0", TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, stretch), 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, stretch), 0, 0, 0}, {TK_OPTION_WINDOW, "-window", NULL, NULL, - NULL, TCL_AUTO_LENGTH, offsetof(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0}, + NULL, TCL_INDEX_NONE, offsetof(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -822,11 +822,11 @@ EmbWinLayoutProc( TkText *textPtr, /* Text widget being layed out. */ TkTextIndex *indexPtr, /* Identifies first character in chunk. */ TkTextSegment *ewPtr, /* Segment corresponding to indexPtr. */ - int offset, /* Offset within segPtr corresponding to + TkSizeT offset, /* Offset within segPtr corresponding to * indexPtr (always 0). */ int maxX, /* Chunk must not occupy pixels at this * position or higher. */ - int maxChars, /* Chunk must not include more than this many + TkSizeT maxChars, /* Chunk must not include more than this many * characters. */ int noCharsYet, /* Non-zero means no characters have been * assigned to this line yet. */ diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 01155c9..5a970c0 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -51,7 +51,7 @@ TkStateParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { int c; int flags = PTR2INT(clientData); @@ -128,7 +128,7 @@ TkStatePrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset into item. */ + TkSizeT offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -174,7 +174,7 @@ TkOrientParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - int offset) /* Offset into item. */ + TkSizeT offset) /* Offset into item. */ { int c; size_t length; @@ -230,7 +230,7 @@ TkOrientPrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - int offset, /* Offset into item. */ + TkSizeT offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -262,7 +262,7 @@ TkOffsetParseProc( Tk_Window tkwin, /* Window on same display as tile */ const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ - int offset) /* Offset of tile in record */ + TkSizeT offset) /* Offset of tile in record */ { Tk_TSOffset *offsetPtr = (Tk_TSOffset *) (widgRec + offset); Tk_TSOffset tsoffset; @@ -412,7 +412,7 @@ TkOffsetPrintProc( TCL_UNUSED(void *), /* not used */ TCL_UNUSED(Tk_Window), /* not used */ char *widgRec, /* Widget structure record */ - int offset, /* Offset of tile in record */ + TkSizeT offset, /* Offset of tile in record */ Tcl_FreeProc **freeProcPtr) /* not used */ { Tk_TSOffset *offsetPtr = (Tk_TSOffset *) (widgRec + offset); @@ -479,7 +479,7 @@ TkPixelParseProc( Tk_Window tkwin, /* Window on same display as tile */ const char *value, /* Name of image */ char *widgRec, /* Widget structure record */ - int offset) /* Offset of tile in record */ + TkSizeT offset) /* Offset of tile in record */ { double *doublePtr = (double *) (widgRec + offset); int result; @@ -513,7 +513,7 @@ TkPixelPrintProc( TCL_UNUSED(void *), /* not used */ TCL_UNUSED(Tk_Window), /* not used */ char *widgRec, /* Widget structure record */ - int offset, /* Offset of tile in record */ + TkSizeT offset, /* Offset of tile in record */ Tcl_FreeProc **freeProcPtr) /* not used */ { double *doublePtr = (double *) (widgRec + offset); diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index be4a211..9712c66 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -57,45 +57,45 @@ typedef struct static const Tk_OptionSpec BaseOptionSpecs[] = { {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", offsetof(Base,base.justifyObj), TCL_AUTO_LENGTH, + "left", offsetof(Base,base.justifyObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-text", "text", "Text", "", - offsetof(Base,base.textObj), TCL_AUTO_LENGTH, + offsetof(Base,base.textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", "", - offsetof(Base,base.textVariableObj), TCL_AUTO_LENGTH, + offsetof(Base,base.textVariableObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", - "-1", offsetof(Base,base.underlineObj), TCL_AUTO_LENGTH, + "-1", offsetof(Base,base.underlineObj), TCL_INDEX_NONE, 0,0,0 }, /* SB: OPTION_INT, see <<NOTE-NULLOPTIONS>> */ {TK_OPTION_STRING, "-width", "width", "Width", - NULL, offsetof(Base,base.widthObj), TCL_AUTO_LENGTH, + NULL, offsetof(Base,base.widthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, /* * Image options */ {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, - offsetof(Base,base.imageObj), TCL_AUTO_LENGTH, + offsetof(Base,base.imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, /* * Compound base/image options */ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - NULL, offsetof(Base,base.compoundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Base,base.compoundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,(void *)ttkCompoundStrings, GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", - NULL, offsetof(Base,base.paddingObj), TCL_AUTO_LENGTH, + NULL, offsetof(Base,base.paddingObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED}, /* * Compatibility/legacy options */ {TK_OPTION_STRING, "-state", "state", "State", - "normal", offsetof(Base,base.stateObj), TCL_AUTO_LENGTH, + "normal", offsetof(Base,base.stateObj), TCL_INDEX_NONE, 0,0,STATE_CHANGED }, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) @@ -244,28 +244,28 @@ typedef struct static const Tk_OptionSpec LabelOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "frameColor", "FrameColor", - NULL, offsetof(Label,label.backgroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.backgroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, offsetof(Label,label.foregroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.foregroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - NULL, offsetof(Label,label.fontObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.fontObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - NULL, offsetof(Label,label.borderWidthObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.borderWidthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - NULL, offsetof(Label,label.reliefObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, offsetof(Label,label.anchorObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label,label.anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - NULL, offsetof(Label, label.justifyObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label, label.justifyObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - NULL, offsetof(Label, label.wrapLengthObj), TCL_AUTO_LENGTH, + NULL, offsetof(Label, label.wrapLengthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, WIDGET_TAKEFOCUS_FALSE, @@ -327,9 +327,9 @@ typedef struct static const Tk_OptionSpec ButtonOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", - "", offsetof(Button, button.commandObj), TCL_AUTO_LENGTH, 0,0,0}, + "", offsetof(Button, button.commandObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", - "normal", offsetof(Button, button.defaultStateObj), TCL_AUTO_LENGTH, + "normal", offsetof(Button, button.defaultStateObj), TCL_INDEX_NONE, 0, (void *)ttkDefaultStrings, DEFAULTSTATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, @@ -437,16 +437,16 @@ typedef struct static const Tk_OptionSpec CheckbuttonOptionSpecs[] = { {TK_OPTION_STRING, "-variable", "variable", "Variable", - NULL, offsetof(Checkbutton, checkbutton.variableObj), TCL_AUTO_LENGTH, + NULL, offsetof(Checkbutton, checkbutton.variableObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-onvalue", "onValue", "OnValue", - "1", offsetof(Checkbutton, checkbutton.onValueObj), TCL_AUTO_LENGTH, + "1", offsetof(Checkbutton, checkbutton.onValueObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING, "-offvalue", "offValue", "OffValue", - "0", offsetof(Checkbutton, checkbutton.offValueObj), TCL_AUTO_LENGTH, + "0", offsetof(Checkbutton, checkbutton.offValueObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING, "-command", "command", "Command", - "", offsetof(Checkbutton, checkbutton.commandObj), TCL_AUTO_LENGTH, + "", offsetof(Checkbutton, checkbutton.commandObj), TCL_INDEX_NONE, 0,0,0}, WIDGET_TAKEFOCUS_TRUE, @@ -645,13 +645,13 @@ typedef struct static const Tk_OptionSpec RadiobuttonOptionSpecs[] = { {TK_OPTION_STRING, "-variable", "variable", "Variable", - "::selectedButton", offsetof(Radiobutton, radiobutton.variableObj),TCL_AUTO_LENGTH, + "::selectedButton", offsetof(Radiobutton, radiobutton.variableObj),TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING, "-value", "Value", "Value", - "1", offsetof(Radiobutton, radiobutton.valueObj), TCL_AUTO_LENGTH, + "1", offsetof(Radiobutton, radiobutton.valueObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING, "-command", "command", "Command", - "", offsetof(Radiobutton, radiobutton.commandObj), TCL_AUTO_LENGTH, + "", offsetof(Radiobutton, radiobutton.commandObj), TCL_INDEX_NONE, 0,0,0}, WIDGET_TAKEFOCUS_TRUE, @@ -820,9 +820,9 @@ static const char *const directionStrings[] = { static const Tk_OptionSpec MenubuttonOptionSpecs[] = { {TK_OPTION_STRING, "-menu", "menu", "Menu", - "", offsetof(Menubutton, menubutton.menuObj), TCL_AUTO_LENGTH, 0,0,0}, + "", offsetof(Menubutton, menubutton.menuObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", - "below", offsetof(Menubutton, menubutton.directionObj), TCL_AUTO_LENGTH, + "below", offsetof(Menubutton, menubutton.directionObj), TCL_INDEX_NONE, 0,(ClientData)directionStrings,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_TRUE, diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 1d04059..95c1a9a 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -156,53 +156,53 @@ typedef struct { static const Tk_OptionSpec EntryOptionSpecs[] = { {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", "1", TCL_AUTO_LENGTH, offsetof(Entry, entry.exportSelection), + "ExportSelection", "1", TCL_INDEX_NONE, offsetof(Entry, entry.exportSelection), 0,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, offsetof(Entry, entry.fontObj),TCL_AUTO_LENGTH, + DEF_ENTRY_FONT, offsetof(Entry, entry.fontObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, entry.invalidCmd), + NULL, TCL_INDEX_NONE, offsetof(Entry, entry.invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", TCL_AUTO_LENGTH, offsetof(Entry, entry.justify), + "left", TCL_INDEX_NONE, offsetof(Entry, entry.justify), 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - NULL, offsetof(Entry, entry.placeholderObj), TCL_AUTO_LENGTH, + NULL, offsetof(Entry, entry.placeholderObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-show", "show", "Show", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, entry.showChar), + NULL, TCL_INDEX_NONE, offsetof(Entry, entry.showChar), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-state", "state", "State", - "normal", offsetof(Entry, entry.stateObj), TCL_AUTO_LENGTH, + "normal", offsetof(Entry, entry.stateObj), TCL_INDEX_NONE, 0,0,STATE_CHANGED}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - NULL, offsetof(Entry, entry.textVariableObj), TCL_AUTO_LENGTH, + NULL, offsetof(Entry, entry.textVariableObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,TEXTVAR_CHANGED}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - "none", TCL_AUTO_LENGTH, offsetof(Entry, entry.validate), + "none", TCL_INDEX_NONE, offsetof(Entry, entry.validate), 0, (ClientData) validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, entry.validateCmd), + NULL, TCL_INDEX_NONE, offsetof(Entry, entry.validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, offsetof(Entry, entry.widthObj), TCL_AUTO_LENGTH, + DEF_ENTRY_WIDTH, offsetof(Entry, entry.widthObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Entry, entry.xscroll.scrollCmd), + NULL, TCL_INDEX_NONE, offsetof(Entry, entry.xscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, /* EntryStyleData options: */ {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor", - NULL, offsetof(Entry, entry.styleData.backgroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Entry, entry.styleData.backgroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, offsetof(Entry, entry.styleData.foregroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Entry, entry.styleData.foregroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", "PlaceholderForeground", NULL, - offsetof(Entry, entry.styleData.placeholderForegroundObj), TCL_AUTO_LENGTH, + offsetof(Entry, entry.styleData.placeholderForegroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0}, WIDGET_TAKEFOCUS_TRUE, @@ -1768,13 +1768,13 @@ typedef struct { static const Tk_OptionSpec ComboboxOptionSpecs[] = { {TK_OPTION_STRING, "-height", "height", "Height", - DEF_LIST_HEIGHT, offsetof(Combobox, combobox.heightObj), TCL_AUTO_LENGTH, + DEF_LIST_HEIGHT, offsetof(Combobox, combobox.heightObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-postcommand", "postCommand", "PostCommand", - "", offsetof(Combobox, combobox.postCommandObj), TCL_AUTO_LENGTH, + "", offsetof(Combobox, combobox.postCommandObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-values", "values", "Values", - "", offsetof(Combobox, combobox.valuesObj), TCL_AUTO_LENGTH, + "", offsetof(Combobox, combobox.valuesObj), TCL_INDEX_NONE, 0,0,0 }, WIDGET_INHERIT_OPTIONS(EntryOptionSpecs) }; @@ -1939,27 +1939,27 @@ typedef struct { static const Tk_OptionSpec SpinboxOptionSpecs[] = { {TK_OPTION_STRING, "-values", "values", "Values", - "", offsetof(Spinbox, spinbox.valuesObj), TCL_AUTO_LENGTH, + "", offsetof(Spinbox, spinbox.valuesObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_DOUBLE, "-from", "from", "From", - "0", offsetof(Spinbox,spinbox.fromObj), TCL_AUTO_LENGTH, + "0", offsetof(Spinbox,spinbox.fromObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_DOUBLE, "-to", "to", "To", - "0", offsetof(Spinbox,spinbox.toObj), TCL_AUTO_LENGTH, + "0", offsetof(Spinbox,spinbox.toObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", - "1", offsetof(Spinbox,spinbox.incrementObj), TCL_AUTO_LENGTH, + "1", offsetof(Spinbox,spinbox.incrementObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-format", "format", "Format", - "", offsetof(Spinbox, spinbox.formatObj), TCL_AUTO_LENGTH, + "", offsetof(Spinbox, spinbox.formatObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-command", "command", "Command", - "", offsetof(Spinbox, spinbox.commandObj), TCL_AUTO_LENGTH, + "", offsetof(Spinbox, spinbox.commandObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap", - "0", offsetof(Spinbox,spinbox.wrapObj), TCL_AUTO_LENGTH, + "0", offsetof(Spinbox,spinbox.wrapObj), TCL_INDEX_NONE, 0,0,0 }, WIDGET_INHERIT_OPTIONS(EntryOptionSpecs) diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index 9396982..7c43bce 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -28,19 +28,19 @@ typedef struct { static const Tk_OptionSpec FrameOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", NULL, - offsetof(Frame,frame.borderWidthObj), TCL_AUTO_LENGTH, + offsetof(Frame,frame.borderWidthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, - offsetof(Frame,frame.paddingObj), TCL_AUTO_LENGTH, + offsetof(Frame,frame.paddingObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL, - offsetof(Frame,frame.reliefObj), TCL_AUTO_LENGTH, + offsetof(Frame,frame.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_PIXELS, "-width", "width", "Width", "0", - offsetof(Frame,frame.widthObj), TCL_AUTO_LENGTH, + offsetof(Frame,frame.widthObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-height", "height", "Height", "0", - offsetof(Frame,frame.heightObj), TCL_AUTO_LENGTH, + offsetof(Frame,frame.heightObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_FALSE, @@ -252,16 +252,16 @@ typedef struct { static const Tk_OptionSpec LabelframeOptionSpecs[] = { {TK_OPTION_STRING, "-labelanchor", "labelAnchor", "LabelAnchor", - "nw", offsetof(Labelframe, label.labelAnchorObj),TCL_AUTO_LENGTH, + "nw", offsetof(Labelframe, label.labelAnchorObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-text", "text", "Text", "", - offsetof(Labelframe,label.textObj), TCL_AUTO_LENGTH, + offsetof(Labelframe,label.textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", - "-1", offsetof(Labelframe,label.underlineObj), TCL_AUTO_LENGTH, + "-1", offsetof(Labelframe,label.underlineObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", NULL, - TCL_AUTO_LENGTH, offsetof(Labelframe,label.labelWidget), + TCL_INDEX_NONE, offsetof(Labelframe,label.labelWidget), TK_OPTION_NULL_OK,0,LABELWIDGET_CHANGED|GEOMETRY_CHANGED }, WIDGET_INHERIT_OPTIONS(FrameOptionSpecs) diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index b172e32..f14a2db 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -197,11 +197,11 @@ int TtkGetOptionValue( const Tk_OptionSpec ttkCoreOptionSpecs[] = { {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", NULL, - offsetof(WidgetCore, cursorObj), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK,0,0 }, + offsetof(WidgetCore, cursorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "-style", "style", "Style", "", - offsetof(WidgetCore,styleObj), TCL_AUTO_LENGTH, 0,0,STYLE_CHANGED}, + offsetof(WidgetCore,styleObj), TCL_INDEX_NONE, 0,0,STYLE_CHANGED}, {TK_OPTION_STRING, "-class", "", "", NULL, - offsetof(WidgetCore,classObj), TCL_AUTO_LENGTH, 0,0,READONLY_OPTION}, + offsetof(WidgetCore,classObj), TCL_INDEX_NONE, 0,0,READONLY_OPTION}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 9b5a846..ee10a71 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -58,26 +58,26 @@ typedef struct static const Tk_OptionSpec TabOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", "", "", - "normal", TCL_AUTO_LENGTH, offsetof(Tab,state), + "normal", TCL_INDEX_NONE, offsetof(Tab,state), 0,(ClientData)TabStateStrings,0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", - offsetof(Tab,textObj), TCL_AUTO_LENGTH, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, - offsetof(Tab,imageObj), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + offsetof(Tab,imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - NULL, offsetof(Tab,compoundObj), TCL_AUTO_LENGTH, + NULL, offsetof(Tab,compoundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,(void *)ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", "-1", - offsetof(Tab,underlineObj), TCL_AUTO_LENGTH, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,underlineObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } }; static const Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_STRING, "-padding", "padding", "Padding", "0", - offsetof(Tab,paddingObj), TCL_AUTO_LENGTH, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,paddingObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-sticky", "sticky", "Sticky", "nsew", - offsetof(Tab,stickyObj), TCL_AUTO_LENGTH, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,stickyObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, WIDGET_INHERIT_OPTIONS(TabOptionSpecs) }; @@ -110,13 +110,13 @@ typedef struct static const Tk_OptionSpec NotebookOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", "0", - offsetof(Notebook,notebook.widthObj),TCL_AUTO_LENGTH, + offsetof(Notebook,notebook.widthObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-height", "height", "Height", "0", - offsetof(Notebook,notebook.heightObj),TCL_AUTO_LENGTH, + offsetof(Notebook,notebook.heightObj),TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Padding", NULL, - offsetof(Notebook,notebook.paddingObj),TCL_AUTO_LENGTH, + offsetof(Notebook,notebook.paddingObj),TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_TRUE, diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 91abff0..d06c863 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -79,10 +79,10 @@ static const Tk_OptionSpec PanedOptionSpecs[] = { offsetof(Paned,paned.orientObj), offsetof(Paned,paned.orient), 0,(ClientData)ttkOrientStrings,READONLY_OPTION|STYLE_CHANGED }, {TK_OPTION_INT, "-width", "width", "Width", "0", - TCL_AUTO_LENGTH, offsetof(Paned,paned.width), + TCL_INDEX_NONE, offsetof(Paned,paned.width), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-height", "height", "Height", "0", - TCL_AUTO_LENGTH, offsetof(Paned,paned.height), + TCL_INDEX_NONE, offsetof(Paned,paned.height), 0,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_FALSE, @@ -100,8 +100,8 @@ typedef struct { static const Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_INT, "-weight", "weight", "Weight", "0", - TCL_AUTO_LENGTH, offsetof(Pane,weight), 0,0,GEOMETRY_CHANGED }, - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0,0,0} + TCL_INDEX_NONE, offsetof(Pane,weight), 0,0,GEOMETRY_CHANGED }, + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0} }; /* CreatePane -- diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 237c5cf..6e5875e 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -51,44 +51,44 @@ typedef struct { static const Tk_OptionSpec ProgressbarOptionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "w", offsetof(Progressbar,progress.anchorObj), TCL_AUTO_LENGTH, + "w", offsetof(Progressbar,progress.anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, {TK_OPTION_FONT, "-font", "font", "Font", - DEFAULT_FONT, offsetof(Progressbar,progress.fontObj), TCL_AUTO_LENGTH, + DEFAULT_FONT, offsetof(Progressbar,progress.fontObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - "black", offsetof(Progressbar,progress.foregroundObj), TCL_AUTO_LENGTH, + "black", offsetof(Progressbar,progress.foregroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", offsetof(Progressbar,progress.justifyObj), TCL_AUTO_LENGTH, + "left", offsetof(Progressbar,progress.justifyObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_PROGRESSBAR_LENGTH, offsetof(Progressbar,progress.lengthObj), TCL_AUTO_LENGTH, + DEF_PROGRESSBAR_LENGTH, offsetof(Progressbar,progress.lengthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_DOUBLE, "-maximum", "maximum", "Maximum", - "100", offsetof(Progressbar,progress.maximumObj), TCL_AUTO_LENGTH, + "100", offsetof(Progressbar,progress.maximumObj), TCL_INDEX_NONE, 0, 0, 0 }, {TK_OPTION_STRING_TABLE, "-mode", "mode", "ProgressMode", "determinate", offsetof(Progressbar,progress.modeObj), offsetof(Progressbar,progress.mode), 0, (ClientData)ProgressbarModeStrings, 0 }, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - "horizontal", offsetof(Progressbar,progress.orientObj), TCL_AUTO_LENGTH, + "horizontal", offsetof(Progressbar,progress.orientObj), TCL_INDEX_NONE, 0, (ClientData)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_INT, "-phase", "phase", "Phase", - "0", offsetof(Progressbar,progress.phaseObj), TCL_AUTO_LENGTH, + "0", offsetof(Progressbar,progress.phaseObj), TCL_INDEX_NONE, 0, 0, 0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", - offsetof(Progressbar,progress.textObj), TCL_AUTO_LENGTH, + offsetof(Progressbar,progress.textObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_DOUBLE, "-value", "value", "Value", - "0.0", offsetof(Progressbar,progress.valueObj), TCL_AUTO_LENGTH, + "0.0", offsetof(Progressbar,progress.valueObj), TCL_INDEX_NONE, 0, 0, 0 }, {TK_OPTION_STRING, "-variable", "variable", "Variable", - NULL, offsetof(Progressbar,progress.variableObj), TCL_AUTO_LENGTH, + NULL, offsetof(Progressbar,progress.variableObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0 }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - "0", offsetof(Progressbar, progress.wrapLengthObj), TCL_AUTO_LENGTH, + "0", offsetof(Progressbar, progress.wrapLengthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_FALSE, diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index ae817d8..a6bde9a 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -53,10 +53,10 @@ typedef struct static const Tk_OptionSpec ScaleOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - offsetof(Scale,scale.commandObj), TCL_AUTO_LENGTH, + offsetof(Scale,scale.commandObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", "", - offsetof(Scale,scale.variableObj), TCL_AUTO_LENGTH, + offsetof(Scale,scale.variableObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", offsetof(Scale,scale.orientObj), @@ -64,17 +64,17 @@ static const Tk_OptionSpec ScaleOptionSpecs[] = (ClientData)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_DOUBLE, "-from", "from", "From", "0", - offsetof(Scale,scale.fromObj), TCL_AUTO_LENGTH, 0, 0, 0}, + offsetof(Scale,scale.fromObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", "1.0", - offsetof(Scale,scale.toObj), TCL_AUTO_LENGTH, 0, 0, 0}, + offsetof(Scale,scale.toObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_DOUBLE, "-value", "value", "Value", "0", - offsetof(Scale,scale.valueObj), TCL_AUTO_LENGTH, 0, 0, 0}, + offsetof(Scale,scale.valueObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_SCALE_LENGTH, offsetof(Scale,scale.lengthObj), TCL_AUTO_LENGTH, 0, 0, + DEF_SCALE_LENGTH, offsetof(Scale,scale.lengthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-state", "state", "State", - "normal", offsetof(Scale,scale.stateObj), TCL_AUTO_LENGTH, + "normal", offsetof(Scale,scale.stateObj), TCL_INDEX_NONE, 0,0,STATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 00dc1ba..1b915cc 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -34,7 +34,7 @@ typedef struct static const Tk_OptionSpec ScrollbarOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - offsetof(Scrollbar,scrollbar.commandObj), TCL_AUTO_LENGTH, 0,0,0}, + offsetof(Scrollbar,scrollbar.commandObj), TCL_INDEX_NONE, 0,0,0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", offsetof(Scrollbar,scrollbar.orientObj), diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index f2187b9..422afc3 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -51,28 +51,28 @@ typedef struct static const Tk_OptionSpec SquareOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), TCL_AUTO_LENGTH, + DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", DEFAULT_BACKGROUND, offsetof(Square,square.foregroundObj), - TCL_AUTO_LENGTH, 0, 0, 0}, + TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - "50", offsetof(Square,square.widthObj), TCL_AUTO_LENGTH, 0, 0, + "50", offsetof(Square,square.widthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_PIXELS, "-height", "height", "Height", - "50", offsetof(Square,square.heightObj), TCL_AUTO_LENGTH, 0, 0, + "50", offsetof(Square,square.heightObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, - offsetof(Square,square.paddingObj), TCL_AUTO_LENGTH, + offsetof(Square,square.paddingObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - NULL, offsetof(Square,square.reliefObj), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(Square,square.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, offsetof(Square,square.anchorObj), TCL_AUTO_LENGTH, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(Square,square.anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index e923d77..83ca940 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -270,7 +270,7 @@ void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record) for (i = 0; tagTable->optionSpecs[i].type != TK_OPTION_END; ++i) { const Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i; - int offset = optionSpec->objOffset; + size_t offset = optionSpec->objOffset; int prio = LOWEST_PRIORITY; for (j = 0; j < tagSet->nTags; ++j) { @@ -289,7 +289,7 @@ void Ttk_TagSetApplyStyle( const Tk_OptionSpec *optionSpec = tagTable->optionSpecs; while (optionSpec->type != TK_OPTION_END) { - int offset = optionSpec->objOffset; + size_t offset = optionSpec->objOffset; const char *optionName = optionSpec->optionName; Tcl_Obj *val = Ttk_StyleMap(style, optionName, state); if (val) { diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index e5e756d..a8745d7 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -142,7 +142,7 @@ static const Tk_OptionSpec *TTKGetOptionSpec( /* Make sure widget option has a Tcl_Obj* entry: */ - if (optionSpec->objOffset == TCL_AUTO_LENGTH) { + if (optionSpec->objOffset == TCL_INDEX_NONE) { return 0; } diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 7bf9388..2432fcb 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -61,22 +61,22 @@ struct TreeItemRec { static const Tk_OptionSpec ItemOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - "", offsetof(TreeItem,textObj), TCL_AUTO_LENGTH, + "", offsetof(TreeItem,textObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - NULL, offsetof(TreeItem,imageObj), TCL_AUTO_LENGTH, + NULL, offsetof(TreeItem,imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,ITEM_OPTION_IMAGE_CHANGED }, {TK_OPTION_STRING, "-values", "values", "Values", - NULL, offsetof(TreeItem,valuesObj), TCL_AUTO_LENGTH, + NULL, offsetof(TreeItem,valuesObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_BOOLEAN, "-open", "open", "Open", - "0", offsetof(TreeItem,openObj), TCL_AUTO_LENGTH, + "0", offsetof(TreeItem,openObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-tags", "tags", "Tags", - NULL, offsetof(TreeItem,tagsObj), TCL_AUTO_LENGTH, + NULL, offsetof(TreeItem,tagsObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,ITEM_OPTION_TAGS_CHANGED }, - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0,0,0} + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0} }; /* + NewItem -- @@ -189,25 +189,25 @@ typedef struct { static const Tk_OptionSpec TagOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - NULL, offsetof(DisplayItem,textObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,textObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - NULL, offsetof(DisplayItem,imageObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, offsetof(DisplayItem,anchorObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, /* <<NOTE-ANCHOR>> */ {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor", - NULL, offsetof(DisplayItem,backgroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,backgroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, offsetof(DisplayItem,foregroundObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,foregroundObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - NULL, offsetof(DisplayItem,fontObj), TCL_AUTO_LENGTH, + NULL, offsetof(DisplayItem,fontObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0,0,0} + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0} }; /*------------------------------------------------------------------------ @@ -273,40 +273,40 @@ static void FreeColumn(TreeColumn *column) static const Tk_OptionSpec ColumnOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", - DEF_COLWIDTH, TCL_AUTO_LENGTH, offsetof(TreeColumn,width), + DEF_COLWIDTH, TCL_INDEX_NONE, offsetof(TreeColumn,width), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-minwidth", "minWidth", "MinWidth", - DEF_MINWIDTH, TCL_AUTO_LENGTH, offsetof(TreeColumn,minWidth), + DEF_MINWIDTH, TCL_INDEX_NONE, offsetof(TreeColumn,minWidth), 0,0,0 }, {TK_OPTION_BOOLEAN, "-stretch", "stretch", "Stretch", - "1", TCL_AUTO_LENGTH, offsetof(TreeColumn,stretch), + "1", TCL_INDEX_NONE, offsetof(TreeColumn,stretch), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "w", offsetof(TreeColumn,anchorObj), TCL_AUTO_LENGTH, /* <<NOTE-ANCHOR>> */ + "w", offsetof(TreeColumn,anchorObj), TCL_INDEX_NONE, /* <<NOTE-ANCHOR>> */ 0,0,0 }, {TK_OPTION_STRING, "-id", "id", "ID", - NULL, offsetof(TreeColumn,idObj), TCL_AUTO_LENGTH, + NULL, offsetof(TreeColumn,idObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,READONLY_OPTION }, - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0,0,0} + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0} }; static const Tk_OptionSpec HeadingOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - "", offsetof(TreeColumn,headingObj), TCL_AUTO_LENGTH, + "", offsetof(TreeColumn,headingObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - "", offsetof(TreeColumn,headingImageObj), TCL_AUTO_LENGTH, + "", offsetof(TreeColumn,headingImageObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "center", offsetof(TreeColumn,headingAnchorObj), TCL_AUTO_LENGTH, + "center", offsetof(TreeColumn,headingAnchorObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-command", "", "", - "", offsetof(TreeColumn,headingCommandObj), TCL_AUTO_LENGTH, + "", offsetof(TreeColumn,headingCommandObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "state", "", "", - "", offsetof(TreeColumn,headingStateObj), TCL_AUTO_LENGTH, + "", offsetof(TreeColumn,headingStateObj), TCL_INDEX_NONE, 0,0,STATE_CHANGED }, - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0,0,0} + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0} }; /*------------------------------------------------------------------------ @@ -437,31 +437,31 @@ static const char *const SelectModeStrings[] = { "none", "browse", "extended", N static const Tk_OptionSpec TreeviewOptionSpecs[] = { {TK_OPTION_STRING, "-columns", "columns", "Columns", - "", offsetof(Treeview,tree.columnsObj), TCL_AUTO_LENGTH, + "", offsetof(Treeview,tree.columnsObj), TCL_INDEX_NONE, 0,0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ }, {TK_OPTION_STRING, "-displaycolumns","displayColumns","DisplayColumns", - "#all", offsetof(Treeview,tree.displayColumnsObj), TCL_AUTO_LENGTH, + "#all", offsetof(Treeview,tree.displayColumnsObj), TCL_INDEX_NONE, 0,0,DCOLUMNS_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-show", "show", "Show", - DEFAULT_SHOW, offsetof(Treeview,tree.showObj), TCL_AUTO_LENGTH, + DEFAULT_SHOW, offsetof(Treeview,tree.showObj), TCL_INDEX_NONE, 0,0,SHOW_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", - "extended", offsetof(Treeview,tree.selectModeObj), TCL_AUTO_LENGTH, + "extended", offsetof(Treeview,tree.selectModeObj), TCL_INDEX_NONE, 0,(ClientData)SelectModeStrings,0 }, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_TREE_ROWS, offsetof(Treeview,tree.heightObj), TCL_AUTO_LENGTH, + DEF_TREE_ROWS, offsetof(Treeview,tree.heightObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-padding", "padding", "Pad", - NULL, offsetof(Treeview,tree.paddingObj), TCL_AUTO_LENGTH, + NULL, offsetof(Treeview,tree.paddingObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Treeview, tree.xscroll.scrollCmd), + NULL, TCL_INDEX_NONE, offsetof(Treeview, tree.xscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - NULL, TCL_AUTO_LENGTH, offsetof(Treeview, tree.yscroll.scrollCmd), + NULL, TCL_INDEX_NONE, offsetof(Treeview, tree.yscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, WIDGET_TAKEFOCUS_TRUE, diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index e6d17a1..8eaef04 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -117,17 +117,17 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd( */ #define WIDGET_TAKEFOCUS_TRUE \ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ - "ttk::takefocus", offsetof(WidgetCore, takeFocusPtr), TCL_AUTO_LENGTH, 0,0,0 } + "ttk::takefocus", offsetof(WidgetCore, takeFocusPtr), TCL_INDEX_NONE, 0,0,0 } #define WIDGET_TAKEFOCUS_FALSE \ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ - "", offsetof(WidgetCore, takeFocusPtr), TCL_AUTO_LENGTH, 0,0,0 } + "", offsetof(WidgetCore, takeFocusPtr), TCL_INDEX_NONE, 0,0,0 } /* WIDGET_INHERIT_OPTIONS(baseOptionSpecs) -- * Add this at the end of an OptionSpecs table to inherit * the options from 'baseOptionSpecs'. */ #define WIDGET_INHERIT_OPTIONS(baseOptionSpecs) \ - {TK_OPTION_END, 0,0,0, NULL, TCL_AUTO_LENGTH,TCL_AUTO_LENGTH, 0, baseOptionSpecs, 0} + {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0, baseOptionSpecs, 0} /* All widgets should inherit from ttkCoreOptionSpecs[]. */ |