Index: doc/ConfigWidg.3 ================================================================== --- doc/ConfigWidg.3 +++ doc/ConfigWidg.3 @@ -105,11 +105,11 @@ int \fItype\fR; const char *\fIargvName\fR; const char *\fIdbName\fR; const char *\fIdbClass\fR; const char *\fIdefValue\fR; - int \fIoffset\fR; + size_t \fIoffset\fR; int \fIspecFlags\fR; const Tk_CustomOption *\fIcustomPtr\fR; } \fBTk_ConfigSpec\fR; .CE The \fItype\fR field indicates what type of configuration option this is @@ -159,13 +159,12 @@ record pointed to by \fIwidgRec\fR. This record is assumed to contain information relevant to the manager of the widget; its exact type is unknown to \fBTk_ConfigureWidget\fR. The \fIoffset\fR field of each \fIspecs\fR entry indicates where in \fIwidgRec\fR to store the information about this configuration option. You should use the -\fBTk_Offset\fR macro to generate \fIoffset\fR values (see below for -a description of \fBTk_Offset\fR). The location indicated by -\fIwidgRec\fR and \fIoffset\fR will be referred to as the +\fBoffsetof\fR macro to generate \fIoffset\fR values. The location +indicated by \fIwidgRec\fR and \fIoffset\fR will be referred to as the .QW target in the descriptions below. .PP The \fItype\fR field of each entry in \fIspecs\fR determines what to do with the string value of that configuration option. The @@ -467,17 +466,10 @@ bits set in its \fIspecFlags\fR field to indicate the widget types for which this entry is valid. When calling \fBTk_ConfigureWidget\fR, \fIflags\fR will have a single one of these bits set to select the entries for the desired widget type. For a working example of this feature, see the code in tkButton.c. -.SH TK_OFFSET -.PP -The \fBTk_Offset\fR macro is provided as a safe way of generating -the \fIoffset\fR values for entries in Tk_ConfigSpec structures. -It takes two arguments: the name of a type of record, and the -name of a field in that record. It returns the byte offset of -the named field in records of the given type. .SH TK_CONFIGUREINFO .PP The \fBTk_ConfigureInfo\fR procedure may be used to obtain information about one or all of the options for a given widget. Given a token for a window (\fItkwin\fR), a table describing the Index: doc/CrtItemType.3 ================================================================== --- doc/CrtItemType.3 +++ doc/CrtItemType.3 @@ -62,11 +62,11 @@ the standard procedures implemented by the type manager: .PP .CS typedef struct Tk_ItemType { const char *\fIname\fR; - int \fIitemSize\fR; + size_t \fIitemSize\fR; Tk_ItemCreateProc *\fIcreateProc\fR; const Tk_ConfigSpec *\fIconfigSpecs\fR; Tk_ItemConfigureProc *\fIconfigProc\fR; Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR; Index: doc/ParseArgv.3 ================================================================== --- doc/ParseArgv.3 +++ doc/ParseArgv.3 @@ -70,12 +70,12 @@ expected; each of its entries has the following structure: .CS typedef struct { const char *\fIkey\fR; int \fItype\fR; - char *\fIsrc\fR; - char *\fIdst\fR; + void *\fIsrc\fR; + void *\fIdst\fR; const char *\fIhelp\fR; } \fBTk_ArgvInfo\fR; .CE The \fIkey\fR field is a string such as .QW \-display @@ -310,17 +310,17 @@ /* * Define option descriptions. */ Tk_ArgvInfo argTable[] = { - {"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag, + {"\-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, "Turn on debugging printfs"}, - {"\-N", TK_ARGV_INT, NULL, (char *) &numReps, + {"\-N", TK_ARGV_INT, NULL, &numReps, "Number of repetitions"}, - {"\-of", TK_ARGV_STRING, NULL, (char *) &fileName, + {"\-of", TK_ARGV_STRING, NULL, &fileName, "Name of file for output"}, - {"x", TK_ARGV_REST, NULL, (char *) &exec, + {"x", TK_ARGV_REST, NULL, &exec, "File to exec, followed by any arguments (must be last argument)."}, {NULL, TK_ARGV_END, NULL, NULL, NULL} }; Index: doc/SetClassProcs.3 ================================================================== --- doc/SetClassProcs.3 +++ doc/SetClassProcs.3 @@ -31,11 +31,11 @@ are used as callbacks in different places. .PP The structure pointed to by \fIprocs\fR contains the following: .CS typedef struct Tk_ClassProcs { - unsigned int \fIsize\fR; + size_t \fIsize\fR; Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; Tk_ClassCreateProc *\fIcreateProc\fR; Tk_ClassModalProc *\fImodalProc\fR; } \fBTk_ClassProcs\fR; .CE Index: doc/SetOptions.3 ================================================================== --- doc/SetOptions.3 +++ doc/SetOptions.3 @@ -6,11 +6,11 @@ '\" .TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions, Tk_Offset \- process configuration options +Tk_CreateOptionTable, Tk_DeleteOptionTable, Tk_InitOptions, Tk_SetOptions, Tk_FreeSavedOptions, Tk_RestoreSavedOptions, Tk_GetOptionValue, Tk_GetOptionInfo, Tk_FreeConfigOptions \- process configuration options .SH SYNOPSIS .nf \fB#include \fR .sp Tk_OptionTable @@ -33,13 +33,10 @@ .sp Tcl_Obj * \fBTk_GetOptionInfo(\fIinterp, recordPtr, optionTable, namePtr, tkwin\fB)\fR .sp \fBTk_FreeConfigOptions(\fIrecordPtr, optionTable, tkwin\fB)\fR -.sp -int -\fBTk_Offset(\fItype, field\fB)\fR .SH ARGUMENTS .AS Tk_SavedOptions "*const objv[]" in/out .AP Tcl_Interp *interp in A Tcl interpreter. Most procedures use this only for returning error messages; if it is NULL then no error messages are returned. For @@ -237,16 +234,10 @@ \fIinterp\fR is NULL. .PP \fBTk_FreeConfigOptions\fR must be invoked when a widget is deleted. It frees all of the resources associated with any of the configuration options defined in \fIrecordPtr\fR by \fIoptionTable\fR. -.PP -The \fBTk_Offset\fR macro is provided as a safe way of generating the -\fIobjOffset\fR and \fIinternalOffset\fR values for entries in -Tk_OptionSpec structures. It takes two arguments: the name of a type -of record, and the name of a field in that record. It returns the byte -offset of the named field in records of the given type. .SH "TEMPLATES" .PP The array of Tk_OptionSpec structures passed to \fBTk_CreateOptionTable\fR via its \fItemplatePtr\fR argument describes the configuration options supported by a particular class of widgets. Each structure specifies @@ -256,12 +247,12 @@ Tk_OptionType \fItype\fR; const char *\fIoptionName\fR; const char *\fIdbName\fR; const char *\fIdbClass\fR; const char *\fIdefValue\fR; - int \fIobjOffset\fR; - int \fIinternalOffset\fR; + size_t \fIobjOffset\fR; + size_t \fIinternalOffset\fR; int \fIflags\fR; const void *\fIclientData\fR; int \fItypeMask\fR; } \fBTk_OptionSpec\fR; .CE @@ -279,11 +270,11 @@ specifies a default value for this configuration option if no value is specified in the option database. The \fIobjOffset\fR and \fIinternalOffset\fR fields indicate where to store the value of this option in widget records (more on this below); values for the \fIobjOffset\fR and \fIinternalOffset\fR fields should always be generated with the -\fBTk_Offset\fR macro. +\fBoffsetof\fR macro. The \fIflags\fR field contains additional information to control the processing of this configuration option (see below for details). \fIClientData\fR provides additional type-specific data needed by certain types. For instance, for \fBTK_OPTION_COLOR\fR types, Index: generic/tk.h ================================================================== --- generic/tk.h +++ generic/tk.h @@ -189,18 +189,18 @@ * the system. */ #if TCL_MAJOR_VERSION > 8 size_t objOffset; /* Where in record to store a Tcl_Obj * that * holds the value of this option, specified * as an offset in bytes from the start of the - * record. Use the Tk_Offset macro to generate + * record. Use the offsetof macro to generate * values for this. -1 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, * such as an int or XColor *. This field is * specified as an offset in bytes from the - * start of the record. Use the Tk_Offset + * start of the record. Use the offsetof * macro to generate values for it. -1 means * don't store the internal representation in * the record. */ #else int objOffset; @@ -266,14 +266,16 @@ /* * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure. * Computes number of bytes from beginning of structure to a given field. */ -#ifdef offsetof -#define Tk_Offset(type, field) ((int) offsetof(type, field)) -#else -#define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field)) +#ifndef TK_NO_DEPRECATED +# define Tk_Offset(type, field) ((int) offsetof(type, field)) +#endif +/* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */ +#ifndef offsetof +# define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field)) #endif /* * The following two structures are used for error handling. When config * options are being modified, the old values are saved in a Tk_SavedOptions @@ -374,11 +376,11 @@ Tk_Uid dbClass; /* Class for option in database. */ Tk_Uid defValue; /* Default value for option if not specified * in command line or database. */ #if TCL_MAJOR_VERSION > 8 size_t offset; /* Where in widget record to store value; use - * Tk_Offset macro to generate values for + * offsetof macro to generate values for * this. */ #else int offset; #endif int specFlags; /* Any combination of the values defined @@ -436,13 +438,13 @@ typedef struct { const char *key; /* The key string that flags the option in the * argv array. */ int type; /* Indicates option type; see below. */ - char *src; /* Value to be used in setting dst; usage + void *src; /* Value to be used in setting dst; usage * depends on type. */ - char *dst; /* Address of value to be modified; usage + void *dst; /* Address of value to be modified; usage * depends on type. */ const char *help; /* Documentation message describing this * option. */ } Tk_ArgvInfo; @@ -614,16 +616,16 @@ * A more general version of this function may be useful if other * size-versioned structure pop up in the future: * * #define Tk_GetField(name, who, which) \ * (((who) == NULL) ? NULL : - * (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which)) + * (((who)->size <= offsetof(name, which)) ? NULL :(name)->which)) */ #define Tk_GetClassProc(procs, which) \ (((procs) == NULL) ? NULL : \ - (((procs)->size <= (size_t)Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which)) + (((procs)->size <= offsetof(Tk_ClassProcs, which)) ? NULL:(procs)->which)) /* * Each geometry manager (the packer, the placer, etc.) is represented by a * structure of the following form, which indicates procedures to invoke in * the geometry manager to carry out certain functions. Index: generic/tkArgv.c ================================================================== --- generic/tkArgv.c +++ generic/tkArgv.c @@ -226,11 +226,11 @@ srcIndex++; argc--; break; case TK_ARGV_FUNC: { typedef int (ArgvFunc)(char *, const char *, const char *); - ArgvFunc *handlerProc = (ArgvFunc *) infoPtr->src; + ArgvFunc *handlerProc = infoPtr->src; if (handlerProc(infoPtr->dst, infoPtr->key, argv[srcIndex])) { srcIndex++; argc--; } @@ -237,11 +237,11 @@ break; } case TK_ARGV_GENFUNC: { typedef int (ArgvGenFunc)(char *, Tcl_Interp *, const char *, int, const char **); - ArgvGenFunc *handlerProc = (ArgvGenFunc *) infoPtr->src; + ArgvGenFunc *handlerProc = infoPtr->src; argc = handlerProc(infoPtr->dst, interp, infoPtr->key, argc, argv+srcIndex); if (argc < 0) { return TCL_ERROR; Index: generic/tkBusy.c ================================================================== --- generic/tkBusy.c +++ generic/tkBusy.c @@ -21,11 +21,11 @@ * platforms this may or may not have an effect. */ static const Tk_OptionSpec busyOptionSpecs[] = { {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUSY_CURSOR, -1, Tk_Offset(Busy, cursor), + DEF_BUSY_CURSOR, -1, offsetof(Busy, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* Index: generic/tkButton.c ================================================================== --- generic/tkButton.c +++ generic/tkButton.c @@ -68,416 +68,416 @@ * separate table for each of the four widget classes. */ static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, -1, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_BUTTON_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), + DEF_BUTTON_ACTIVE_FG_COLOR, -1, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, -1, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, -1, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), + DEF_BUTTON_BITMAP, -1, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, Tk_Offset(TkButton, borderWidthPtr), - Tk_Offset(TkButton, borderWidth), 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, -1, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), + DEF_BUTTON_CURSOR, -1, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, + -1, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, -1, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_BUTTON_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0}, + DEF_BUTTON_FG, -1, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, Tk_Offset(TkButton, heightPtr), -1, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), -1, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkButton, highlightBorder), 0, + -1, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, -1, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefLabelHighlightWidth, - Tk_Offset(TkButton, highlightWidthPtr), - Tk_Offset(TkButton, highlightWidth), 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, imagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, -1, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, Tk_Offset(TkButton, padXPtr), - Tk_Offset(TkButton, padX), 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, Tk_Offset(TkButton, padYPtr), - Tk_Offset(TkButton, padY), 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, -1, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), + DEF_BUTTON_STATE, -1, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_LABEL_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, + DEF_LABEL_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, Tk_Offset(TkButton, textPtr), -1, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, -1, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, Tk_Offset(TkButton, widthPtr), -1, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr), - Tk_Offset(TkButton, wrapLength), 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, -1, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_BUTTON_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), + DEF_BUTTON_ACTIVE_FG_COLOR, -1, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, -1, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, -1, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), + DEF_BUTTON_BITMAP, -1, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, Tk_Offset(TkButton, borderWidthPtr), - Tk_Offset(TkButton, borderWidth), 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, -1, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), + DEF_BUTTON_CURSOR, -1, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", - DEF_BUTTON_DEFAULT, -1, Tk_Offset(TkButton, defaultState), + DEF_BUTTON_DEFAULT, -1, offsetof(TkButton, defaultState), 0, defaultStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, + -1, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, -1, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_BUTTON_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0}, + DEF_BUTTON_FG, -1, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, Tk_Offset(TkButton, heightPtr), -1, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), -1, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkButton, highlightBorder), 0, + -1, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, -1, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - Tk_Offset(TkButton, highlightWidthPtr), - Tk_Offset(TkButton, highlightWidth), 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, imagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, -1, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, -1, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefButtonPadx, Tk_Offset(TkButton, padXPtr), - Tk_Offset(TkButton, padX), 0, 0, 0}, + tkDefButtonPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefButtonPady, Tk_Offset(TkButton, padYPtr), - Tk_Offset(TkButton, padY), 0, 0, 0}, + tkDefButtonPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, relief), + DEF_BUTTON_RELIEF, -1, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_BUTTON_REPEAT_DELAY, -1, Tk_Offset(TkButton, repeatDelay), + DEF_BUTTON_REPEAT_DELAY, -1, offsetof(TkButton, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_BUTTON_REPEAT_INTERVAL, -1, Tk_Offset(TkButton, repeatInterval), + DEF_BUTTON_REPEAT_INTERVAL, -1, offsetof(TkButton, repeatInterval), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), + DEF_BUTTON_STATE, -1, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, Tk_Offset(TkButton, textPtr), -1, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, -1, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, Tk_Offset(TkButton, widthPtr), -1, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr), - Tk_Offset(TkButton, wrapLength), 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, -1, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_CHKRAD_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), + DEF_CHKRAD_ACTIVE_FG_COLOR, -1, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, -1, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, -1, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), + DEF_BUTTON_BITMAP, -1, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, Tk_Offset(TkButton, borderWidthPtr), - Tk_Offset(TkButton, borderWidth), 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, -1, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), + DEF_BUTTON_CURSOR, -1, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, + -1, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, -1, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_CHKRAD_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0}, + DEF_CHKRAD_FG, -1, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, Tk_Offset(TkButton, heightPtr), -1, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), -1, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkButton, highlightBorder), 0, + -1, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, -1, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - Tk_Offset(TkButton, highlightWidthPtr), - Tk_Offset(TkButton, highlightWidth), 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, imagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_BUTTON_INDICATOR, -1, Tk_Offset(TkButton, indicatorOn), 0, 0, 0}, + DEF_BUTTON_INDICATOR, -1, offsetof(TkButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, -1, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, -1, offsetof(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_STRING, "-offvalue", "offValue", "Value", - DEF_BUTTON_OFF_VALUE, Tk_Offset(TkButton, offValuePtr), -1, 0, 0, 0}, + DEF_BUTTON_OFF_VALUE, offsetof(TkButton, offValuePtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-onvalue", "onValue", "Value", - DEF_BUTTON_ON_VALUE, Tk_Offset(TkButton, onValuePtr), -1, 0, 0, 0}, + DEF_BUTTON_ON_VALUE, offsetof(TkButton, onValuePtr), -1, 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, -1, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, Tk_Offset(TkButton, padXPtr), - Tk_Offset(TkButton, padX), 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, Tk_Offset(TkButton, padYPtr), - Tk_Offset(TkButton, padY), 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, -1, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", - DEF_BUTTON_SELECT_COLOR, -1, Tk_Offset(TkButton, selectBorder), + DEF_BUTTON_SELECT_COLOR, -1, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", - DEF_BUTTON_SELECT_IMAGE, Tk_Offset(TkButton, selectImagePtr), -1, + DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), + DEF_BUTTON_STATE, -1, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, Tk_Offset(TkButton, textPtr), -1, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, tristateImagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue", - DEF_BUTTON_TRISTATE_VALUE, Tk_Offset(TkButton, tristateValuePtr), -1, 0, 0, 0}, + DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), -1, 0, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, -1, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_CHECKBUTTON_VARIABLE, Tk_Offset(TkButton, selVarNamePtr), -1, + DEF_CHECKBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, Tk_Offset(TkButton, widthPtr), -1, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr), - Tk_Offset(TkButton, wrapLength), 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, -1, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", - DEF_CHKRAD_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), + DEF_CHKRAD_ACTIVE_FG_COLOR, -1, offsetof(TkButton, activeFg), TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, + DEF_BUTTON_ANCHOR, -1, offsetof(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), + DEF_BUTTON_BG_COLOR, -1, offsetof(TkButton, normalBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), + DEF_BUTTON_BITMAP, -1, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, Tk_Offset(TkButton, borderWidthPtr), - Tk_Offset(TkButton, borderWidth), 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1, + DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, + DEF_BUTTON_COMPOUND, -1, offsetof(TkButton, compound), 0, compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), + DEF_BUTTON_CURSOR, -1, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, - -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, + -1, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, + DEF_BUTTON_FONT, -1, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_CHKRAD_FG, -1, Tk_Offset(TkButton, normalFg), 0, 0, 0}, + DEF_CHKRAD_FG, -1, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, Tk_Offset(TkButton, heightPtr), -1, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), -1, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkButton, highlightBorder), 0, + -1, offsetof(TkButton, highlightBorder), 0, (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), + DEF_BUTTON_HIGHLIGHT, -1, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - Tk_Offset(TkButton, highlightWidthPtr), - Tk_Offset(TkButton, highlightWidth), 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, imagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_BUTTON_INDICATOR, -1, Tk_Offset(TkButton, indicatorOn), + DEF_BUTTON_INDICATOR, -1, offsetof(TkButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0}, + DEF_BUTTON_JUSTIFY, -1, offsetof(TkButton, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, -1, offsetof(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", - DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief), + DEF_BUTTON_OVER_RELIEF, -1, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, Tk_Offset(TkButton, padXPtr), - Tk_Offset(TkButton, padX), 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, Tk_Offset(TkButton, padYPtr), - Tk_Offset(TkButton, padY), 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, + DEF_LABCHKRAD_RELIEF, -1, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", - DEF_BUTTON_SELECT_COLOR, -1, Tk_Offset(TkButton, selectBorder), + DEF_BUTTON_SELECT_COLOR, -1, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", - DEF_BUTTON_SELECT_IMAGE, Tk_Offset(TkButton, selectImagePtr), -1, + DEF_BUTTON_SELECT_IMAGE, offsetof(TkButton, selectImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), + DEF_BUTTON_STATE, -1, offsetof(TkButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, + DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_BUTTON_TEXT, Tk_Offset(TkButton, textPtr), -1, 0, 0, 0}, + DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1, + DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage", - DEF_BUTTON_IMAGE, Tk_Offset(TkButton, tristateImagePtr), -1, + DEF_BUTTON_IMAGE, offsetof(TkButton, tristateImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue", - DEF_BUTTON_TRISTATE_VALUE, Tk_Offset(TkButton, tristateValuePtr), -1, 0, 0, 0}, + DEF_BUTTON_TRISTATE_VALUE, offsetof(TkButton, tristateValuePtr), -1, 0, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0}, + DEF_BUTTON_UNDERLINE, -1, offsetof(TkButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-value", "value", "Value", - DEF_BUTTON_VALUE, Tk_Offset(TkButton, onValuePtr), -1, 0, 0, 0}, + DEF_BUTTON_VALUE, offsetof(TkButton, onValuePtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_RADIOBUTTON_VARIABLE, Tk_Offset(TkButton, selVarNamePtr), -1, + DEF_RADIOBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), -1, 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, Tk_Offset(TkButton, widthPtr), -1, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr), - Tk_Offset(TkButton, wrapLength), 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; /* * The following table maps from one of the type values defined in tkButton.h, Index: generic/tkCanvArc.c ================================================================== --- generic/tkCanvArc.c +++ generic/tkCanvArc.c @@ -110,71 +110,71 @@ TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.activeDash), + NULL, offsetof(ArcItem, outline.activeDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-activefill", NULL, NULL, - NULL, Tk_Offset(ArcItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-activeoutline", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL, - "0.0", Tk_Offset(ArcItem, outline.activeWidth), + "0.0", offsetof(ArcItem, outline.activeWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.dash), + NULL, offsetof(ArcItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", Tk_Offset(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.disabledDash), + NULL, offsetof(ArcItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, - NULL, Tk_Offset(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL, - "0.0", Tk_Offset(ArcItem, outline.disabledWidth), + "0.0", offsetof(ArcItem, outline.disabledWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_DOUBLE, "-extent", NULL, NULL, - "90", Tk_Offset(ArcItem, extent), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "90", offsetof(ArcItem, extent), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, - NULL, Tk_Offset(ArcItem, fillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, fillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_DOUBLE, "-height", NULL, NULL, - 0, Tk_Offset(ArcItem, height), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + 0, offsetof(ArcItem, height), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL, - "0,0", Tk_Offset(ArcItem, tsoffset), + "0,0", offsetof(ArcItem, tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_COLOR, "-outline", NULL, NULL, - "black", Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK, NULL}, + "black", offsetof(ArcItem, outline.color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL, - "0,0", Tk_Offset(ArcItem, outline.tsoffset), + "0,0", offsetof(ArcItem, outline.tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_DOUBLE, "-start", NULL, NULL, - "0", Tk_Offset(ArcItem, start), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(ArcItem, start), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, - NULL, Tk_Offset(ArcItem, fillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ArcItem, fillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-style", NULL, NULL, - NULL, Tk_Offset(ArcItem, style), TK_CONFIG_DONT_SET_DEFAULT, + NULL, offsetof(ArcItem, style), TK_CONFIG_DONT_SET_DEFAULT, &styleOption}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_CUSTOM, "-width", NULL, NULL, - "1.0", Tk_Offset(ArcItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT, + "1.0", offsetof(ArcItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* Index: generic/tkCanvBmap.c ================================================================== --- generic/tkCanvBmap.c +++ generic/tkCanvBmap.c @@ -47,34 +47,34 @@ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_COLOR, "-activebackground", NULL, NULL, - NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activebitmap", NULL, NULL, - NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-activeforeground", NULL, NULL, - NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL, - "center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "center", offsetof(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_COLOR, "-background", NULL, NULL, - NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapItem, bgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-bitmap", NULL, NULL, - NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapItem, bitmap), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledbackground", NULL, NULL, - NULL, Tk_Offset(BitmapItem, disabledBgColor), + NULL, offsetof(BitmapItem, disabledBgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledbitmap", NULL, NULL, - NULL, Tk_Offset(BitmapItem, disabledBitmap), + NULL, offsetof(BitmapItem, disabledBitmap), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledforeground", NULL, NULL, - NULL, Tk_Offset(BitmapItem, disabledFgColor), + NULL, offsetof(BitmapItem, disabledFgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-foreground", NULL, NULL, - "black", Tk_Offset(BitmapItem, fgColor), 0, NULL}, + "black", offsetof(BitmapItem, fgColor), 0, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; Index: generic/tkCanvImg.c ================================================================== --- generic/tkCanvImg.c +++ generic/tkCanvImg.c @@ -50,19 +50,19 @@ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_STRING, "-activeimage", NULL, NULL, - NULL, Tk_Offset(ImageItem, activeImageString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ImageItem, activeImageString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL, - "center", Tk_Offset(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "center", offsetof(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_STRING, "-disabledimage", NULL, NULL, - NULL, Tk_Offset(ImageItem, disabledImageString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ImageItem, disabledImageString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-image", NULL, NULL, - NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(ImageItem, imageString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; Index: generic/tkCanvLine.c ================================================================== --- generic/tkCanvLine.c +++ generic/tkCanvLine.c @@ -157,62 +157,62 @@ TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.activeDash), + NULL, offsetof(LineItem, outline.activeDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-activefill", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(LineItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(LineItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL, - "0.0", Tk_Offset(LineItem, outline.activeWidth), + "0.0", offsetof(LineItem, outline.activeWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-arrow", NULL, NULL, - "none", Tk_Offset(LineItem, arrow), + "none", offsetof(LineItem, arrow), TK_CONFIG_DONT_SET_DEFAULT, &arrowOption}, {TK_CONFIG_CUSTOM, "-arrowshape", NULL, NULL, - "8 10 3", Tk_Offset(LineItem, arrowShapeA), + "8 10 3", offsetof(LineItem, arrowShapeA), TK_CONFIG_DONT_SET_DEFAULT, &arrowShapeOption}, {TK_CONFIG_CAP_STYLE, "-capstyle", NULL, NULL, - "butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "butt", offsetof(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, - "black", Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL}, + "black", offsetof(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.dash), + NULL, offsetof(LineItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", Tk_Offset(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.disabledDash), + NULL, offsetof(LineItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(LineItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL, - "0.0", Tk_Offset(LineItem, outline.disabledWidth), + "0.0", offsetof(LineItem, outline.disabledWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL, - "round", Tk_Offset(LineItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "round", offsetof(LineItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL, - "0,0", Tk_Offset(LineItem, outline.tsoffset), + "0,0", offsetof(LineItem, outline.tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_CUSTOM, "-smooth", NULL, NULL, - "0", Tk_Offset(LineItem, smooth), + "0", offsetof(LineItem, smooth), TK_CONFIG_DONT_SET_DEFAULT, &smoothOption}, {TK_CONFIG_INT, "-splinesteps", NULL, NULL, - "12", Tk_Offset(LineItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "12", offsetof(LineItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, - NULL, Tk_Offset(LineItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(LineItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_CUSTOM, "-width", NULL, NULL, - "1.0", Tk_Offset(LineItem, outline.width), + "1.0", offsetof(LineItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* @@ -1940,11 +1940,11 @@ LineItem *linePtr = (LineItem *) recordPtr; double a, b, c; int argc; const char **argv = NULL; - if (offset != Tk_Offset(LineItem, arrowShapeA)) { + if ((size_t)offset != offsetof(LineItem, arrowShapeA)) { Tcl_Panic("ParseArrowShape received bogus offset"); } if (Tcl_SplitList(interp, (char *) value, &argc, &argv) != TCL_OK) { goto syntaxError; Index: generic/tkCanvPoly.c ================================================================== --- generic/tkCanvPoly.c +++ generic/tkCanvPoly.c @@ -74,73 +74,73 @@ TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.activeDash), + NULL, offsetof(PolygonItem, outline.activeDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-activefill", NULL, NULL, - NULL, Tk_Offset(PolygonItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-activeoutline", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.activeStipple), + NULL, offsetof(PolygonItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL, - "0.0", Tk_Offset(PolygonItem, outline.activeWidth), + "0.0", offsetof(PolygonItem, outline.activeWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.dash), + NULL, offsetof(PolygonItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", Tk_Offset(PolygonItem, outline.offset), + "0", offsetof(PolygonItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.disabledDash), + NULL, offsetof(PolygonItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, - NULL, Tk_Offset(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.disabledColor), + NULL, offsetof(PolygonItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.disabledStipple), + NULL, offsetof(PolygonItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL, - "0.0", Tk_Offset(PolygonItem, outline.disabledWidth), + "0.0", offsetof(PolygonItem, outline.disabledWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, - "black", Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL}, + "black", offsetof(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL, - "round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "round", offsetof(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL, - "0,0", Tk_Offset(PolygonItem, tsoffset), + "0,0", offsetof(PolygonItem, tsoffset), TK_CONFIG_NULL_OK, &offsetOption}, {TK_CONFIG_COLOR, "-outline", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, outline.color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL, - "0,0", Tk_Offset(PolygonItem, outline.tsoffset), + "0,0", offsetof(PolygonItem, outline.tsoffset), TK_CONFIG_NULL_OK, &offsetOption}, {TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-smooth", NULL, NULL, - "0", Tk_Offset(PolygonItem, smooth), + "0", offsetof(PolygonItem, smooth), TK_CONFIG_DONT_SET_DEFAULT, &smoothOption}, {TK_CONFIG_INT, "-splinesteps", NULL, NULL, - "12", Tk_Offset(PolygonItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "12", offsetof(PolygonItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, - NULL, Tk_Offset(PolygonItem, fillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PolygonItem, fillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_CUSTOM, "-width", NULL, NULL, - "1.0", Tk_Offset(PolygonItem, outline.width), + "1.0", offsetof(PolygonItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* Index: generic/tkCanvPs.c ================================================================== --- generic/tkCanvPs.c +++ generic/tkCanvPs.c @@ -92,41 +92,41 @@ * canvas "postscript" command and fill in TkPostscriptInfo structures. */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_STRING, "-colormap", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, colorVar), 0, NULL}, + "", offsetof(TkPostscriptInfo, colorVar), 0, NULL}, {TK_CONFIG_STRING, "-colormode", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, colorMode), 0, NULL}, + "", offsetof(TkPostscriptInfo, colorMode), 0, NULL}, {TK_CONFIG_STRING, "-file", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, fileName), 0, NULL}, + "", offsetof(TkPostscriptInfo, fileName), 0, NULL}, {TK_CONFIG_STRING, "-channel", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, channelName), 0, NULL}, + "", offsetof(TkPostscriptInfo, channelName), 0, NULL}, {TK_CONFIG_STRING, "-fontmap", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, fontVar), 0, NULL}, + "", offsetof(TkPostscriptInfo, fontVar), 0, NULL}, {TK_CONFIG_PIXELS, "-height", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, height), 0, NULL}, + "", offsetof(TkPostscriptInfo, height), 0, NULL}, {TK_CONFIG_ANCHOR, "-pageanchor", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, pageAnchor), 0, NULL}, + "", offsetof(TkPostscriptInfo, pageAnchor), 0, NULL}, {TK_CONFIG_STRING, "-pageheight", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, pageHeightString), 0, NULL}, + "", offsetof(TkPostscriptInfo, pageHeightString), 0, NULL}, {TK_CONFIG_STRING, "-pagewidth", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, pageWidthString), 0, NULL}, + "", offsetof(TkPostscriptInfo, pageWidthString), 0, NULL}, {TK_CONFIG_STRING, "-pagex", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, pageXString), 0, NULL}, + "", offsetof(TkPostscriptInfo, pageXString), 0, NULL}, {TK_CONFIG_STRING, "-pagey", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, pageYString), 0, NULL}, + "", offsetof(TkPostscriptInfo, pageYString), 0, NULL}, {TK_CONFIG_BOOLEAN, "-prolog", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, prolog), 0, NULL}, + "", offsetof(TkPostscriptInfo, prolog), 0, NULL}, {TK_CONFIG_BOOLEAN, "-rotate", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, rotate), 0, NULL}, + "", offsetof(TkPostscriptInfo, rotate), 0, NULL}, {TK_CONFIG_PIXELS, "-width", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, width), 0, NULL}, + "", offsetof(TkPostscriptInfo, width), 0, NULL}, {TK_CONFIG_PIXELS, "-x", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, x), 0, NULL}, + "", offsetof(TkPostscriptInfo, x), 0, NULL}, {TK_CONFIG_PIXELS, "-y", NULL, NULL, - "", Tk_Offset(TkPostscriptInfo, y), 0, NULL}, + "", offsetof(TkPostscriptInfo, y), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Forward declarations for functions defined later in this file: Index: generic/tkCanvText.c ================================================================== --- generic/tkCanvText.c +++ generic/tkCanvText.c @@ -93,42 +93,42 @@ TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_COLOR, "-activefill", NULL, NULL, - NULL, Tk_Offset(TextItem, activeColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(TextItem, activeColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL, - NULL, Tk_Offset(TextItem, activeStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(TextItem, activeStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL, - "center", Tk_Offset(TextItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "center", offsetof(TextItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_DOUBLE, "-angle", NULL, NULL, - "0.0", Tk_Offset(TextItem, angle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0.0", offsetof(TextItem, angle), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, - NULL, Tk_Offset(TextItem, disabledColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(TextItem, disabledColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, - NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(TextItem, disabledStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, - "black", Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK, NULL}, + "black", offsetof(TextItem, color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_FONT, "-font", NULL, NULL, - DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0, NULL}, + DEF_CANVTEXT_FONT, offsetof(TextItem, tkfont), 0, NULL}, {TK_CONFIG_JUSTIFY, "-justify", NULL, NULL, - "left", Tk_Offset(TextItem, justify), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "left", offsetof(TextItem, justify), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL, - "0,0", Tk_Offset(TextItem, tsoffset), + "0,0", offsetof(TextItem, tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, - NULL, Tk_Offset(TextItem, stipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(TextItem, stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_STRING, "-text", NULL, NULL, - "", Tk_Offset(TextItem, text), 0, NULL}, + "", offsetof(TextItem, text), 0, NULL}, {TK_CONFIG_INT, "-underline", NULL, NULL, - "-1", Tk_Offset(TextItem, underline), 0, NULL}, + "-1", offsetof(TextItem, underline), 0, NULL}, {TK_CONFIG_PIXELS, "-width", NULL, NULL, - "0", Tk_Offset(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Prototypes for functions defined in this file: Index: generic/tkCanvWind.c ================================================================== --- generic/tkCanvWind.c +++ generic/tkCanvWind.c @@ -44,21 +44,21 @@ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL, - "center", Tk_Offset(WindowItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "center", offsetof(WindowItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_PIXELS, "-height", NULL, NULL, - "0", Tk_Offset(WindowItem, height), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(WindowItem, height), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_PIXELS, "-width", NULL, NULL, - "0", Tk_Offset(WindowItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL}, + "0", offsetof(WindowItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_WINDOW, "-window", NULL, NULL, - NULL, Tk_Offset(WindowItem, tkwin), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(WindowItem, tkwin), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Prototypes for functions defined in this file: Index: generic/tkCanvas.c ================================================================== --- generic/tkCanvas.c +++ generic/tkCanvas.c @@ -89,96 +89,96 @@ * Information used for argv parsing. */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_CANVAS_BG_COLOR, Tk_Offset(TkCanvas, bgBorder), + DEF_CANVAS_BG_COLOR, offsetof(TkCanvas, bgBorder), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_CANVAS_BG_MONO, Tk_Offset(TkCanvas, bgBorder), + DEF_CANVAS_BG_MONO, offsetof(TkCanvas, bgBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_CANVAS_BORDER_WIDTH, Tk_Offset(TkCanvas, borderWidth), 0, NULL}, + DEF_CANVAS_BORDER_WIDTH, offsetof(TkCanvas, borderWidth), 0, NULL}, {TK_CONFIG_DOUBLE, "-closeenough", "closeEnough", "CloseEnough", - DEF_CANVAS_CLOSE_ENOUGH, Tk_Offset(TkCanvas, closeEnough), 0, NULL}, + DEF_CANVAS_CLOSE_ENOUGH, offsetof(TkCanvas, closeEnough), 0, NULL}, {TK_CONFIG_BOOLEAN, "-confine", "confine", "Confine", - DEF_CANVAS_CONFINE, Tk_Offset(TkCanvas, confine), 0, NULL}, + DEF_CANVAS_CONFINE, offsetof(TkCanvas, confine), 0, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", - DEF_CANVAS_CURSOR, Tk_Offset(TkCanvas, cursor), TK_CONFIG_NULL_OK, NULL}, + DEF_CANVAS_CURSOR, offsetof(TkCanvas, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-height", "height", "Height", - DEF_CANVAS_HEIGHT, Tk_Offset(TkCanvas, height), 0, NULL}, + DEF_CANVAS_HEIGHT, offsetof(TkCanvas, height), 0, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_CANVAS_HIGHLIGHT_BG, - Tk_Offset(TkCanvas, highlightBgColorPtr), 0, NULL}, + offsetof(TkCanvas, highlightBgColorPtr), 0, NULL}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_CANVAS_HIGHLIGHT, Tk_Offset(TkCanvas, highlightColorPtr), 0, NULL}, + DEF_CANVAS_HIGHLIGHT, offsetof(TkCanvas, highlightColorPtr), 0, NULL}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", - DEF_CANVAS_HIGHLIGHT_WIDTH, Tk_Offset(TkCanvas, highlightWidth), 0, NULL}, + DEF_CANVAS_HIGHLIGHT_WIDTH, offsetof(TkCanvas, highlightWidth), 0, NULL}, {TK_CONFIG_BORDER, "-insertbackground", "insertBackground", "Foreground", - DEF_CANVAS_INSERT_BG, Tk_Offset(TkCanvas, textInfo.insertBorder), 0, NULL}, + DEF_CANVAS_INSERT_BG, offsetof(TkCanvas, textInfo.insertBorder), 0, NULL}, {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_CANVAS_INSERT_BD_COLOR, - Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, + offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_CANVAS_INSERT_BD_MONO, - Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, + offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_CANVAS_INSERT_OFF_TIME, Tk_Offset(TkCanvas, insertOffTime), 0, NULL}, + DEF_CANVAS_INSERT_OFF_TIME, offsetof(TkCanvas, insertOffTime), 0, NULL}, {TK_CONFIG_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_CANVAS_INSERT_ON_TIME, Tk_Offset(TkCanvas, insertOnTime), 0, NULL}, + DEF_CANVAS_INSERT_ON_TIME, offsetof(TkCanvas, insertOnTime), 0, NULL}, {TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_CANVAS_INSERT_WIDTH, Tk_Offset(TkCanvas, textInfo.insertWidth), 0, NULL}, + DEF_CANVAS_INSERT_WIDTH, offsetof(TkCanvas, textInfo.insertWidth), 0, NULL}, {TK_CONFIG_CUSTOM, "-offset", "offset", "Offset", "0,0", - Tk_Offset(TkCanvas, tsoffset),TK_CONFIG_DONT_SET_DEFAULT, + offsetof(TkCanvas, tsoffset),TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", - DEF_CANVAS_RELIEF, Tk_Offset(TkCanvas, relief), 0, NULL}, + DEF_CANVAS_RELIEF, offsetof(TkCanvas, relief), 0, NULL}, {TK_CONFIG_STRING, "-scrollregion", "scrollRegion", "ScrollRegion", - DEF_CANVAS_SCROLL_REGION, Tk_Offset(TkCanvas, regionString), + DEF_CANVAS_SCROLL_REGION, offsetof(TkCanvas, regionString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_CANVAS_SELECT_COLOR, Tk_Offset(TkCanvas, textInfo.selBorder), + DEF_CANVAS_SELECT_COLOR, offsetof(TkCanvas, textInfo.selBorder), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_CANVAS_SELECT_MONO, Tk_Offset(TkCanvas, textInfo.selBorder), + DEF_CANVAS_SELECT_MONO, offsetof(TkCanvas, textInfo.selBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_CANVAS_SELECT_BD_COLOR, - Tk_Offset(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, + offsetof(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", - DEF_CANVAS_SELECT_BD_MONO, Tk_Offset(TkCanvas, textInfo.selBorderWidth), + DEF_CANVAS_SELECT_BD_MONO, offsetof(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_CANVAS_SELECT_FG_COLOR, Tk_Offset(TkCanvas, textInfo.selFgColorPtr), + DEF_CANVAS_SELECT_FG_COLOR, offsetof(TkCanvas, textInfo.selFgColorPtr), TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_CANVAS_SELECT_FG_MONO, Tk_Offset(TkCanvas, textInfo.selFgColorPtr), + DEF_CANVAS_SELECT_FG_MONO, offsetof(TkCanvas, textInfo.selFgColorPtr), TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-state", "state", "State", - "normal", Tk_Offset(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT, + "normal", offsetof(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT, &stateOption}, {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_CANVAS_TAKE_FOCUS, Tk_Offset(TkCanvas, takeFocus), + DEF_CANVAS_TAKE_FOCUS, offsetof(TkCanvas, takeFocus), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_CANVAS_WIDTH, Tk_Offset(TkCanvas, width), 0, NULL}, + DEF_CANVAS_WIDTH, offsetof(TkCanvas, width), 0, NULL}, {TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_CANVAS_X_SCROLL_CMD, Tk_Offset(TkCanvas, xScrollCmd), + DEF_CANVAS_X_SCROLL_CMD, offsetof(TkCanvas, xScrollCmd), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-xscrollincrement", "xScrollIncrement", "ScrollIncrement", - DEF_CANVAS_X_SCROLL_INCREMENT, Tk_Offset(TkCanvas, xScrollIncrement), + DEF_CANVAS_X_SCROLL_INCREMENT, offsetof(TkCanvas, xScrollIncrement), 0, NULL}, {TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_CANVAS_Y_SCROLL_CMD, Tk_Offset(TkCanvas, yScrollCmd), + DEF_CANVAS_Y_SCROLL_CMD, offsetof(TkCanvas, yScrollCmd), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-yscrollincrement", "yScrollIncrement", "ScrollIncrement", - DEF_CANVAS_Y_SCROLL_INCREMENT, Tk_Offset(TkCanvas, yScrollIncrement), + DEF_CANVAS_Y_SCROLL_INCREMENT, offsetof(TkCanvas, yScrollIncrement), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* Index: generic/tkEntry.c ================================================================== --- generic/tkEntry.c +++ generic/tkEntry.c @@ -61,110 +61,110 @@ * Information used for Entry objv parsing. */ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder), + DEF_ENTRY_BG_COLOR, -1, offsetof(Entry, normalBorder), 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, -1, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor), + DEF_ENTRY_CURSOR, -1, offsetof(Entry, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1, - Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK, + offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1, - Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1, - Tk_Offset(Entry, exportSelection), 0, 0, 0}, + offsetof(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0}, + DEF_ENTRY_FONT, -1, offsetof(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0, 0, 0}, + DEF_ENTRY_FG, -1, offsetof(Entry, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, - -1, Tk_Offset(Entry, highlightBgColorPtr), 0, 0, 0}, + -1, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr), 0, 0, 0}, + DEF_ENTRY_HIGHLIGHT, -1, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1, - Tk_Offset(Entry, highlightWidth), 0, 0, 0}, + offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", - DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder), 0, 0, 0}, + DEF_ENTRY_INSERT_BG, -1, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1, - Tk_Offset(Entry, insertBorderWidth), 0, + offsetof(Entry, insertBorderWidth), 0, (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime), + DEF_ENTRY_INSERT_OFF_TIME, -1, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime), 0, 0, 0}, + DEF_ENTRY_INSERT_ON_TIME, -1, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth), 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, -1, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd), + DEF_ENTRY_INVALIDCMD, -1, offsetof(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, -1, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0}, + DEF_ENTRY_JUSTIFY, -1, offsetof(Entry, justify), 0, 0, 0}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - DEF_ENTRY_PLACEHOLDER, -1, Tk_Offset(Entry, placeholderString), + DEF_ENTRY_PLACEHOLDER, -1, offsetof(Entry, placeholderString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, -1, - Tk_Offset(Entry, placeholderColorPtr), 0, 0, 0}, + offsetof(Entry, placeholderColorPtr), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1, - Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK, + offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0}, + DEF_ENTRY_RELIEF, -1, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder), + DEF_ENTRY_SELECT_COLOR, -1, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1, - Tk_Offset(Entry, selBorderWidth), + offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), + DEF_ENTRY_SELECT_FG_COLOR, -1, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", - DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar), + DEF_ENTRY_SHOW, -1, offsetof(Entry, showChar), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), + DEF_ENTRY_STATE, -1, offsetof(Entry, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), + DEF_ENTRY_TAKE_FOCUS, -1, offsetof(Entry, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName), + DEF_ENTRY_TEXT_VARIABLE, -1, offsetof(Entry, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), + DEF_ENTRY_VALIDATE, -1, offsetof(Entry, validate), 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, NULL, 0, -1, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0}, + DEF_ENTRY_WIDTH, -1, offsetof(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd), + DEF_ENTRY_SCROLL_COMMAND, -1, offsetof(Entry, scrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; /* @@ -184,143 +184,143 @@ #define DEF_SPINBOX_VALUES "" #define DEF_SPINBOX_WRAP "0" static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background", - DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(Spinbox, activeBorder), + DEF_BUTTON_ACTIVE_BG_COLOR, -1, offsetof(Spinbox, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder), + DEF_ENTRY_BG_COLOR, -1, offsetof(Entry, normalBorder), 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, -1, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-buttonbackground", "Button.background", "Background", - DEF_BUTTON_BG_COLOR, -1, Tk_Offset(Spinbox, buttonBorder), + DEF_BUTTON_BG_COLOR, -1, offsetof(Spinbox, buttonBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_CURSOR, "-buttoncursor", "Button.cursor", "Cursor", - DEF_BUTTON_CURSOR, -1, Tk_Offset(Spinbox, bCursor), + DEF_BUTTON_CURSOR, -1, offsetof(Spinbox, bCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-buttondownrelief", "Button.relief", "Relief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, bdRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, -1, offsetof(Spinbox, bdRelief), 0, 0, 0}, {TK_OPTION_RELIEF, "-buttonuprelief", "Button.relief", "Relief", - DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, buRelief), 0, 0, 0}, + DEF_BUTTON_RELIEF, -1, offsetof(Spinbox, buRelief), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_SPINBOX_CMD, -1, Tk_Offset(Spinbox, command), + DEF_SPINBOX_CMD, -1, offsetof(Spinbox, command), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor), + DEF_ENTRY_CURSOR, -1, offsetof(Entry, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1, - Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK, + offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1, - Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1, - Tk_Offset(Entry, exportSelection), 0, 0, 0}, + offsetof(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0}, + DEF_ENTRY_FONT, -1, offsetof(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0, 0, 0}, + DEF_ENTRY_FG, -1, offsetof(Entry, fgColorPtr), 0, 0, 0}, {TK_OPTION_STRING, "-format", "format", "Format", - DEF_SPINBOX_FORMAT, -1, Tk_Offset(Spinbox, reqFormat), + DEF_SPINBOX_FORMAT, -1, offsetof(Spinbox, reqFormat), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-from", "from", "From", - DEF_SPINBOX_FROM, -1, Tk_Offset(Spinbox, fromValue), 0, 0, 0}, + DEF_SPINBOX_FROM, -1, offsetof(Spinbox, fromValue), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, - -1, Tk_Offset(Entry, highlightBgColorPtr), 0, 0, 0}, + -1, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr), 0, 0, 0}, + DEF_ENTRY_HIGHLIGHT, -1, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1, - Tk_Offset(Entry, highlightWidth), 0, 0, 0}, + offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", - DEF_SPINBOX_INCREMENT, -1, Tk_Offset(Spinbox, increment), 0, 0, 0}, + DEF_SPINBOX_INCREMENT, -1, offsetof(Spinbox, increment), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", - DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder), 0, 0, 0}, + DEF_ENTRY_INSERT_BG, -1, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1, - Tk_Offset(Entry, insertBorderWidth), 0, + offsetof(Entry, insertBorderWidth), 0, (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime), + DEF_ENTRY_INSERT_OFF_TIME, -1, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime), 0, 0, 0}, + DEF_ENTRY_INSERT_ON_TIME, -1, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth), 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, -1, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd), + DEF_ENTRY_INVALIDCMD, -1, offsetof(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, -1, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0}, + DEF_ENTRY_JUSTIFY, -1, offsetof(Entry, justify), 0, 0, 0}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - DEF_ENTRY_PLACEHOLDER, -1, Tk_Offset(Entry, placeholderString), + DEF_ENTRY_PLACEHOLDER, -1, offsetof(Entry, placeholderString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, -1, - Tk_Offset(Entry, placeholderColorPtr), 0, 0, 0}, + offsetof(Entry, placeholderColorPtr), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0}, + DEF_ENTRY_RELIEF, -1, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1, - Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK, + offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SPINBOX_REPEAT_DELAY, -1, Tk_Offset(Spinbox, repeatDelay), + DEF_SPINBOX_REPEAT_DELAY, -1, offsetof(Spinbox, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SPINBOX_REPEAT_INTERVAL, -1, Tk_Offset(Spinbox, repeatInterval), + DEF_SPINBOX_REPEAT_INTERVAL, -1, offsetof(Spinbox, repeatInterval), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder), + DEF_ENTRY_SELECT_COLOR, -1, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1, - Tk_Offset(Entry, selBorderWidth), + offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), + DEF_ENTRY_SELECT_FG_COLOR, -1, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), + DEF_ENTRY_STATE, -1, offsetof(Entry, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), + DEF_ENTRY_TAKE_FOCUS, -1, offsetof(Entry, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName), + DEF_ENTRY_TEXT_VARIABLE, -1, offsetof(Entry, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", - DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0}, + DEF_SPINBOX_TO, -1, offsetof(Spinbox, toValue), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), + DEF_ENTRY_VALIDATE, -1, offsetof(Entry, validate), 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-values", "values", "Values", - DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr), + DEF_SPINBOX_VALUES, -1, offsetof(Spinbox, valueStr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, NULL, 0, -1, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0}, + DEF_ENTRY_WIDTH, -1, offsetof(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap", - DEF_SPINBOX_WRAP, -1, Tk_Offset(Spinbox, wrap), 0, 0, 0}, + DEF_SPINBOX_WRAP, -1, offsetof(Spinbox, wrap), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd), + DEF_ENTRY_SCROLL_COMMAND, -1, offsetof(Entry, scrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; /* Index: generic/tkFrame.c ================================================================== --- generic/tkFrame.c +++ generic/tkFrame.c @@ -182,126 +182,126 @@ * table used by all and one table for each widget class. */ static const Tk_OptionSpec commonOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_FRAME_BG_COLOR, -1, Tk_Offset(Frame, border), + DEF_FRAME_BG_COLOR, -1, offsetof(Frame, border), TK_OPTION_NULL_OK, DEF_FRAME_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_STRING, "-colormap", "colormap", "Colormap", - DEF_FRAME_COLORMAP, -1, Tk_Offset(Frame, colormapName), + DEF_FRAME_COLORMAP, -1, 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, -1, Tk_Offset(Frame, isContainer), 0, 0, 0}, + DEF_FRAME_CONTAINER, -1, offsetof(Frame, isContainer), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_FRAME_CURSOR, -1, Tk_Offset(Frame, cursor), + DEF_FRAME_CURSOR, -1, offsetof(Frame, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_FRAME_HEIGHT, -1, Tk_Offset(Frame, height), 0, 0, 0}, + DEF_FRAME_HEIGHT, -1, offsetof(Frame, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, -1, - Tk_Offset(Frame, highlightBgColorPtr), 0, 0, 0}, + offsetof(Frame, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_FRAME_HIGHLIGHT, -1, Tk_Offset(Frame, highlightColorPtr), + DEF_FRAME_HIGHLIGHT, -1, offsetof(Frame, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, -1, - Tk_Offset(Frame, highlightWidth), 0, 0, 0}, + offsetof(Frame, highlightWidth), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_FRAME_PADX, Tk_Offset(Frame, padXPtr), - Tk_Offset(Frame, padX), 0, 0, 0}, + DEF_FRAME_PADX, offsetof(Frame, padXPtr), + offsetof(Frame, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_FRAME_PADY, Tk_Offset(Frame, padYPtr), - Tk_Offset(Frame, padY), 0, 0, 0}, + DEF_FRAME_PADY, offsetof(Frame, padYPtr), + offsetof(Frame, padY), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_FRAME_TAKE_FOCUS, -1, Tk_Offset(Frame, takeFocus), + DEF_FRAME_TAKE_FOCUS, -1, offsetof(Frame, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-visual", "visual", "Visual", - DEF_FRAME_VISUAL, -1, Tk_Offset(Frame, visualName), + DEF_FRAME_VISUAL, -1, offsetof(Frame, visualName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_FRAME_WIDTH, -1, Tk_Offset(Frame, width), 0, 0, 0}, + DEF_FRAME_WIDTH, -1, 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, Tk_Offset(Frame, bgimgPtr), -1, + DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, NULL, 0, -1, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, -1, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_FRAME_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0}, + DEF_FRAME_CLASS, -1, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0}, + DEF_FRAME_RELIEF, -1, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile", - DEF_FRAME_BG_TILE, -1, Tk_Offset(Frame, tile), 0, 0, 0}, + DEF_FRAME_BG_TILE, -1, 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, Tk_Offset(Frame, bgimgPtr), -1, + DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, NULL, 0, -1, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, -1, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_TOPLEVEL_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0}, + DEF_TOPLEVEL_CLASS, -1, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", - DEF_TOPLEVEL_MENU, -1, Tk_Offset(Frame, menuName), + DEF_TOPLEVEL_MENU, -1, offsetof(Frame, menuName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0}, + DEF_FRAME_RELIEF, -1, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_STRING, "-screen", "screen", "Screen", - DEF_TOPLEVEL_SCREEN, -1, Tk_Offset(Frame, screenName), + DEF_TOPLEVEL_SCREEN, -1, offsetof(Frame, screenName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile", - DEF_FRAME_BG_TILE, -1, Tk_Offset(Frame, tile), 0, 0, 0}, + DEF_FRAME_BG_TILE, -1, offsetof(Frame, tile), 0, 0, 0}, {TK_OPTION_STRING, "-use", "use", "Use", - DEF_TOPLEVEL_USE, -1, Tk_Offset(Frame, useThis), + DEF_TOPLEVEL_USE, -1, offsetof(Frame, useThis), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, commonOptSpec, 0} }; static const Tk_OptionSpec labelframeOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LABELFRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), + DEF_LABELFRAME_BORDER_WIDTH, -1, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", - DEF_LABELFRAME_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0}, + DEF_LABELFRAME_CLASS, -1, offsetof(Frame, className), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_LABELFRAME_FONT, -1, Tk_Offset(Labelframe, tkfont), 0, 0, 0}, + DEF_LABELFRAME_FONT, -1, offsetof(Labelframe, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_LABELFRAME_FG, -1, Tk_Offset(Labelframe, textColorPtr), 0, 0, 0}, + DEF_LABELFRAME_FG, -1, offsetof(Labelframe, textColorPtr), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor", - DEF_LABELFRAME_LABELANCHOR, -1, Tk_Offset(Labelframe, labelAnchor), + DEF_LABELFRAME_LABELANCHOR, -1, offsetof(Labelframe, labelAnchor), 0, labelAnchorStrings, 0}, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", - NULL, -1, Tk_Offset(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LABELFRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0}, + DEF_LABELFRAME_RELIEF, -1, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_LABELFRAME_TEXT, Tk_Offset(Labelframe, textPtr), -1, + DEF_LABELFRAME_TEXT, offsetof(Labelframe, textPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, commonOptSpec, 0} }; Index: generic/tkImgBmap.c ================================================================== --- generic/tkImgBmap.c +++ generic/tkImgBmap.c @@ -106,21 +106,21 @@ * Information used for parsing configuration specs: */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_UID, "-background", NULL, NULL, - "", Tk_Offset(BitmapMaster, bgUid), 0, NULL}, + "", offsetof(BitmapMaster, bgUid), 0, NULL}, {TK_CONFIG_STRING, "-data", NULL, NULL, - NULL, Tk_Offset(BitmapMaster, dataString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapMaster, dataString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-file", NULL, NULL, - NULL, Tk_Offset(BitmapMaster, fileString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapMaster, fileString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_UID, "-foreground", NULL, NULL, - "#000000", Tk_Offset(BitmapMaster, fgUid), 0, NULL}, + "#000000", offsetof(BitmapMaster, fgUid), 0, NULL}, {TK_CONFIG_STRING, "-maskdata", NULL, NULL, - NULL, Tk_Offset(BitmapMaster, maskDataString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapMaster, maskDataString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-maskfile", NULL, NULL, - NULL, Tk_Offset(BitmapMaster, maskFileString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(BitmapMaster, maskFileString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * The following data structure is used to describe the state of parsing a Index: generic/tkImgPhoto.c ================================================================== --- generic/tkImgPhoto.c +++ generic/tkImgPhoto.c @@ -156,19 +156,19 @@ * Information used for parsing configuration specifications: */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_STRING, "-file", NULL, NULL, - NULL, Tk_Offset(PhotoMaster, fileString), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PhotoMaster, fileString), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_DOUBLE, "-gamma", NULL, NULL, - DEF_PHOTO_GAMMA, Tk_Offset(PhotoMaster, gamma), 0, NULL}, + DEF_PHOTO_GAMMA, offsetof(PhotoMaster, gamma), 0, NULL}, {TK_CONFIG_INT, "-height", NULL, NULL, - DEF_PHOTO_HEIGHT, Tk_Offset(PhotoMaster, userHeight), 0, NULL}, + DEF_PHOTO_HEIGHT, offsetof(PhotoMaster, userHeight), 0, NULL}, {TK_CONFIG_UID, "-palette", NULL, NULL, - DEF_PHOTO_PALETTE, Tk_Offset(PhotoMaster, palette), 0, NULL}, + DEF_PHOTO_PALETTE, offsetof(PhotoMaster, palette), 0, NULL}, {TK_CONFIG_INT, "-width", NULL, NULL, - DEF_PHOTO_WIDTH, Tk_Offset(PhotoMaster, userWidth), 0, NULL}, + DEF_PHOTO_WIDTH, offsetof(PhotoMaster, userWidth), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Forward declarations Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -237,82 +237,82 @@ * listbox widget. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle", - DEF_LISTBOX_ACTIVE_STYLE, -1, Tk_Offset(Listbox, activeStyle), + DEF_LISTBOX_ACTIVE_STYLE, -1, offsetof(Listbox, activeStyle), 0, activeStyleStrings, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_LISTBOX_BG_COLOR, -1, Tk_Offset(Listbox, normalBorder), + DEF_LISTBOX_BG_COLOR, -1, offsetof(Listbox, normalBorder), 0, DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LISTBOX_BORDER_WIDTH, -1, Tk_Offset(Listbox, borderWidth), + DEF_LISTBOX_BORDER_WIDTH, -1, offsetof(Listbox, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_LISTBOX_CURSOR, -1, Tk_Offset(Listbox, cursor), + DEF_LISTBOX_CURSOR, -1, offsetof(Listbox, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_LISTBOX_DISABLED_FG, -1, - Tk_Offset(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, -1, - Tk_Offset(Listbox, exportSelection), 0, 0, 0}, + offsetof(Listbox, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_LISTBOX_FONT, -1, Tk_Offset(Listbox, tkfont), 0, 0, 0}, + DEF_LISTBOX_FONT, -1, offsetof(Listbox, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_LISTBOX_FG, -1, Tk_Offset(Listbox, fgColorPtr), 0, 0, 0}, + DEF_LISTBOX_FG, -1, offsetof(Listbox, fgColorPtr), 0, 0, 0}, {TK_OPTION_INT, "-height", "height", "Height", - DEF_LISTBOX_HEIGHT, -1, Tk_Offset(Listbox, height), 0, 0, 0}, + DEF_LISTBOX_HEIGHT, -1, offsetof(Listbox, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, -1, - Tk_Offset(Listbox, highlightBgColorPtr), 0, 0, 0}, + offsetof(Listbox, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_LISTBOX_HIGHLIGHT, -1, Tk_Offset(Listbox, highlightColorPtr), + DEF_LISTBOX_HIGHLIGHT, -1, offsetof(Listbox, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, -1, - Tk_Offset(Listbox, highlightWidth), 0, 0, 0}, + offsetof(Listbox, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0}, + DEF_LISTBOX_JUSTIFY, -1, offsetof(Listbox, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_LISTBOX_RELIEF, -1, Tk_Offset(Listbox, relief), 0, 0, 0}, + DEF_LISTBOX_RELIEF, -1, offsetof(Listbox, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_LISTBOX_SELECT_COLOR, -1, Tk_Offset(Listbox, selBorder), + DEF_LISTBOX_SELECT_COLOR, -1, offsetof(Listbox, selBorder), 0, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_LISTBOX_SELECT_BD, -1, - Tk_Offset(Listbox, selBorderWidth), 0, 0, 0}, + offsetof(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_LISTBOX_SELECT_FG_COLOR, -1, Tk_Offset(Listbox, selFgColorPtr), + DEF_LISTBOX_SELECT_FG_COLOR, -1, offsetof(Listbox, selFgColorPtr), TK_OPTION_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", - DEF_LISTBOX_SELECT_MODE, -1, Tk_Offset(Listbox, selectMode), + DEF_LISTBOX_SELECT_MODE, -1, offsetof(Listbox, selectMode), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", - DEF_LISTBOX_SET_GRID, -1, Tk_Offset(Listbox, setGrid), 0, 0, 0}, + DEF_LISTBOX_SET_GRID, -1, offsetof(Listbox, setGrid), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_LISTBOX_STATE, -1, Tk_Offset(Listbox, state), + DEF_LISTBOX_STATE, -1, offsetof(Listbox, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_LISTBOX_TAKE_FOCUS, -1, Tk_Offset(Listbox, takeFocus), + DEF_LISTBOX_TAKE_FOCUS, -1, offsetof(Listbox, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_LISTBOX_WIDTH, -1, Tk_Offset(Listbox, width), 0, 0, 0}, + DEF_LISTBOX_WIDTH, -1, offsetof(Listbox, width), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_LISTBOX_SCROLL_COMMAND, -1, Tk_Offset(Listbox, xScrollCmd), + DEF_LISTBOX_SCROLL_COMMAND, -1, offsetof(Listbox, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_LISTBOX_SCROLL_COMMAND, -1, Tk_Offset(Listbox, yScrollCmd), + DEF_LISTBOX_SCROLL_COMMAND, -1, offsetof(Listbox, yScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable", - DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName), + DEF_LISTBOX_LIST_VARIABLE, -1, offsetof(Listbox, listVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; /* @@ -320,26 +320,26 @@ * listbox items. */ static const Tk_OptionSpec itemAttrOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - NULL, -1, Tk_Offset(ItemAttr, border), + NULL, -1, 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, -1, 0, "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - NULL, -1, Tk_Offset(ItemAttr, fgColor), + NULL, -1, offsetof(ItemAttr, fgColor), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - NULL, -1, Tk_Offset(ItemAttr, selBorder), + NULL, -1, offsetof(ItemAttr, selBorder), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - NULL, -1, Tk_Offset(ItemAttr, selFgColor), + NULL, -1, 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, -1, 0, 0, 0} }; Index: generic/tkMenu.c ================================================================== --- generic/tkMenu.c +++ generic/tkMenu.c @@ -116,121 +116,121 @@ "bottom", "center", "left", "none", "right", "top", NULL }; static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", NULL, NULL, - DEF_MENU_ENTRY_ACTIVE_BG, Tk_Offset(TkMenuEntry, activeBorderPtr), -1, + DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", NULL, NULL, DEF_MENU_ENTRY_ACTIVE_FG, - Tk_Offset(TkMenuEntry, activeFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, activeFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-accelerator", NULL, NULL, DEF_MENU_ENTRY_ACCELERATOR, - Tk_Offset(TkMenuEntry, accelPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, accelPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BORDER, "-background", NULL, NULL, DEF_MENU_ENTRY_BG, - Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BITMAP, "-bitmap", NULL, NULL, DEF_MENU_ENTRY_BITMAP, - Tk_Offset(TkMenuEntry, bitmapPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, bitmapPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL, DEF_MENU_ENTRY_COLUMN_BREAK, - -1, Tk_Offset(TkMenuEntry, columnBreak), 0, NULL, 0}, + -1, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0}, {TK_OPTION_STRING, "-command", NULL, NULL, DEF_MENU_ENTRY_COMMAND, - Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0, + DEF_MENU_ENTRY_COMPOUND, -1, offsetof(TkMenuEntry, compound), 0, (ClientData) compoundStrings, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, DEF_MENU_ENTRY_FONT, - Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, DEF_MENU_ENTRY_FG, - Tk_Offset(TkMenuEntry, fgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, fgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL, DEF_MENU_ENTRY_HIDE_MARGIN, - -1, Tk_Offset(TkMenuEntry, hideMargin), 0, NULL, 0}, + -1, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0}, {TK_OPTION_STRING, "-image", NULL, NULL, DEF_MENU_ENTRY_IMAGE, - Tk_Offset(TkMenuEntry, imagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, imagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-label", NULL, NULL, DEF_MENU_ENTRY_LABEL, - Tk_Offset(TkMenuEntry, labelPtr), -1, 0, NULL, 0}, + offsetof(TkMenuEntry, labelPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, DEF_MENU_ENTRY_STATE, - -1, Tk_Offset(TkMenuEntry, state), 0, + -1, offsetof(TkMenuEntry, state), 0, (ClientData) menuStateStrings, 0}, {TK_OPTION_INT, "-underline", NULL, NULL, - DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline), 0, NULL, 0}, + DEF_MENU_ENTRY_UNDERLINE, -1, 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, - Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), -1, 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, - -1, Tk_Offset(TkMenuEntry, indicatorOn), 0, NULL, 0}, + -1, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, {TK_OPTION_STRING, "-offvalue", NULL, NULL, DEF_MENU_ENTRY_OFF_VALUE, - Tk_Offset(TkMenuEntry, offValuePtr), -1, 0, NULL, 0}, + offsetof(TkMenuEntry, offValuePtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-onvalue", NULL, NULL, DEF_MENU_ENTRY_ON_VALUE, - Tk_Offset(TkMenuEntry, onValuePtr), -1, 0, NULL, 0}, + offsetof(TkMenuEntry, onValuePtr), -1, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", NULL, NULL, DEF_MENU_ENTRY_SELECT, - Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-selectimage", NULL, NULL, DEF_MENU_ENTRY_SELECT_IMAGE, - Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-variable", NULL, NULL, DEF_MENU_ENTRY_CHECK_VARIABLE, - Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = { {TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL, DEF_MENU_ENTRY_INDICATOR, - -1, Tk_Offset(TkMenuEntry, indicatorOn), 0, NULL, 0}, + -1, offsetof(TkMenuEntry, indicatorOn), 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", NULL, NULL, DEF_MENU_ENTRY_SELECT, - Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-selectimage", NULL, NULL, DEF_MENU_ENTRY_SELECT_IMAGE, - Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-value", NULL, NULL, DEF_MENU_ENTRY_VALUE, - Tk_Offset(TkMenuEntry, onValuePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, onValuePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-variable", NULL, NULL, DEF_MENU_ENTRY_RADIO_VARIABLE, - Tk_Offset(TkMenuEntry, namePtr), -1, 0, NULL, 0}, + offsetof(TkMenuEntry, namePtr), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = { {TK_OPTION_STRING, "-menu", NULL, NULL, DEF_MENU_ENTRY_MENU, - Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, DEF_MENU_ENTRY_BG, - Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-state", NULL, NULL, - DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0, + DEF_MENU_ENTRY_STATE, -1, offsetof(TkMenuEntry, state), 0, (ClientData) menuStateStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; static const Tk_OptionSpec *specsArray[] = { @@ -248,66 +248,66 @@ }; static const Tk_OptionSpec tkMenuConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENU_ACTIVE_BG_COLOR, - Tk_Offset(TkMenu, activeBorderPtr), -1, 0, + offsetof(TkMenu, activeBorderPtr), -1, 0, (ClientData) DEF_MENU_ACTIVE_BG_MONO, 0}, {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth", "BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH, - Tk_Offset(TkMenu, activeBorderWidthPtr), -1, 0, NULL, 0}, + offsetof(TkMenu, activeBorderWidthPtr), -1, 0, NULL, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENU_ACTIVE_FG_COLOR, - Tk_Offset(TkMenu, activeFgPtr), -1, 0, + offsetof(TkMenu, activeFgPtr), -1, 0, (ClientData) DEF_MENU_ACTIVE_FG_MONO, 0}, {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief", - DEF_MENU_ACTIVE_RELIEF, Tk_Offset(TkMenu, activeReliefPtr), + DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr), -1, 0, NULL, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MENU_BG_COLOR, Tk_Offset(TkMenu, borderPtr), -1, 0, + DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), -1, 0, (ClientData) DEF_MENU_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENU_BORDER_WIDTH, - Tk_Offset(TkMenu, borderWidthPtr), -1, 0, NULL, 0}, + offsetof(TkMenu, borderWidthPtr), -1, 0, NULL, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENU_CURSOR, - Tk_Offset(TkMenu, cursorPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, cursorPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENU_DISABLED_FG_COLOR, - Tk_Offset(TkMenu, disabledFgPtr), -1, TK_OPTION_NULL_OK, + offsetof(TkMenu, disabledFgPtr), -1, TK_OPTION_NULL_OK, (ClientData) DEF_MENU_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MENU_FONT, Tk_Offset(TkMenu, fontPtr), -1, 0, NULL, 0}, + DEF_MENU_FONT, offsetof(TkMenu, fontPtr), -1, 0, NULL, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MENU_FG, Tk_Offset(TkMenu, fgPtr), -1, 0, NULL, 0}, + DEF_MENU_FG, offsetof(TkMenu, fgPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-postcommand", "postCommand", "Command", DEF_MENU_POST_COMMAND, - Tk_Offset(TkMenu, postCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, postCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MENU_RELIEF, Tk_Offset(TkMenu, reliefPtr), -1, 0, NULL, 0}, + DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), -1, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background", - DEF_MENU_SELECT_COLOR, Tk_Offset(TkMenu, indicatorFgPtr), -1, 0, + DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), -1, 0, (ClientData) DEF_MENU_SELECT_MONO, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENU_TAKE_FOCUS, - Tk_Offset(TkMenu, takeFocusPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, takeFocusPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff", - DEF_MENU_TEAROFF, -1, Tk_Offset(TkMenu, tearoff), 0, NULL, 0}, + DEF_MENU_TEAROFF, -1, offsetof(TkMenu, tearoff), 0, NULL, 0}, {TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand", "TearOffCommand", DEF_MENU_TEAROFF_CMD, - Tk_Offset(TkMenu, tearoffCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, + offsetof(TkMenu, tearoffCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING, "-title", "title", "Title", - DEF_MENU_TITLE, Tk_Offset(TkMenu, titlePtr), -1, + DEF_MENU_TITLE, offsetof(TkMenu, titlePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_STRING_TABLE, "-type", "type", "Type", - DEF_MENU_TYPE, Tk_Offset(TkMenu, menuTypePtr), -1, TK_OPTION_NULL_OK, + DEF_MENU_TYPE, offsetof(TkMenu, menuTypePtr), -1, TK_OPTION_NULL_OK, (ClientData) menuTypeStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0} }; /* Index: generic/tkMenubutton.c ================================================================== --- generic/tkMenubutton.c +++ generic/tkMenubutton.c @@ -59,102 +59,102 @@ */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENUBUTTON_ACTIVE_BG_COLOR, -1, - Tk_Offset(TkMenuButton, activeBorder), 0, + offsetof(TkMenuButton, activeBorder), 0, (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_COLOR, -1, - Tk_Offset(TkMenuButton, activeFg), + offsetof(TkMenuButton, activeFg), 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MENUBUTTON_ANCHOR, -1, - Tk_Offset(TkMenuButton, anchor), 0, 0, 0}, + offsetof(TkMenuButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MENUBUTTON_BG_COLOR, -1, Tk_Offset(TkMenuButton, normalBorder), + DEF_MENUBUTTON_BG_COLOR, -1, offsetof(TkMenuButton, normalBorder), 0, DEF_MENUBUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, (ClientData) "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", - DEF_MENUBUTTON_BITMAP, -1, Tk_Offset(TkMenuButton, bitmap), + DEF_MENUBUTTON_BITMAP, -1, offsetof(TkMenuButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENUBUTTON_BORDER_WIDTH, -1, - Tk_Offset(TkMenuButton, borderWidth), 0, 0, 0}, + offsetof(TkMenuButton, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_MENUBUTTON_CURSOR, -1, Tk_Offset(TkMenuButton, cursor), + DEF_MENUBUTTON_CURSOR, -1, offsetof(TkMenuButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", - DEF_MENUBUTTON_DIRECTION, -1, Tk_Offset(TkMenuButton, direction), + DEF_MENUBUTTON_DIRECTION, -1, offsetof(TkMenuButton, direction), 0, directionStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, - -1, Tk_Offset(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, + -1, offsetof(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, (ClientData) "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MENUBUTTON_FONT, -1, Tk_Offset(TkMenuButton, tkfont), 0, 0, 0}, + DEF_MENUBUTTON_FONT, -1, offsetof(TkMenuButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MENUBUTTON_FG, -1, Tk_Offset(TkMenuButton, normalFg), 0, 0, 0}, + DEF_MENUBUTTON_FG, -1, offsetof(TkMenuButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_MENUBUTTON_HEIGHT, -1, Tk_Offset(TkMenuButton, heightString), + DEF_MENUBUTTON_HEIGHT, -1, offsetof(TkMenuButton, heightString), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkMenuButton, highlightBgColorPtr), 0, 0, 0}, + -1, offsetof(TkMenuButton, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_MENUBUTTON_HIGHLIGHT, -1, - Tk_Offset(TkMenuButton, highlightColorPtr), 0, 0, 0}, + offsetof(TkMenuButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH, - -1, Tk_Offset(TkMenuButton, highlightWidth), 0, 0, 0}, + -1, offsetof(TkMenuButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", - DEF_MENUBUTTON_IMAGE, -1, Tk_Offset(TkMenuButton, imageString), + DEF_MENUBUTTON_IMAGE, -1, offsetof(TkMenuButton, imageString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", - DEF_MENUBUTTON_INDICATOR, -1, Tk_Offset(TkMenuButton, indicatorOn), + DEF_MENUBUTTON_INDICATOR, -1, offsetof(TkMenuButton, indicatorOn), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_MENUBUTTON_JUSTIFY, -1, Tk_Offset(TkMenuButton, justify), 0, 0, 0}, + DEF_MENUBUTTON_JUSTIFY, -1, offsetof(TkMenuButton, justify), 0, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", - DEF_MENUBUTTON_MENU, -1, Tk_Offset(TkMenuButton, menuName), + DEF_MENUBUTTON_MENU, -1, offsetof(TkMenuButton, menuName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_MENUBUTTON_PADX, -1, Tk_Offset(TkMenuButton, padX), + DEF_MENUBUTTON_PADX, -1, offsetof(TkMenuButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_MENUBUTTON_PADY, -1, Tk_Offset(TkMenuButton, padY), + DEF_MENUBUTTON_PADY, -1, offsetof(TkMenuButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MENUBUTTON_RELIEF, -1, Tk_Offset(TkMenuButton, relief), + DEF_MENUBUTTON_RELIEF, -1, offsetof(TkMenuButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0, + DEF_BUTTON_COMPOUND, -1, offsetof(TkMenuButton, compound), 0, compoundStrings, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_MENUBUTTON_STATE, -1, Tk_Offset(TkMenuButton, state), + DEF_MENUBUTTON_STATE, -1, offsetof(TkMenuButton, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENUBUTTON_TAKE_FOCUS, -1, - Tk_Offset(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0}, + offsetof(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_MENUBUTTON_TEXT, -1, Tk_Offset(TkMenuButton, text), 0, 0, 0}, + DEF_MENUBUTTON_TEXT, -1, offsetof(TkMenuButton, text), 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", DEF_MENUBUTTON_TEXT_VARIABLE, -1, - Tk_Offset(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0}, + offsetof(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-underline", "underline", "Underline", - DEF_MENUBUTTON_UNDERLINE, -1, Tk_Offset(TkMenuButton, underline), + DEF_MENUBUTTON_UNDERLINE, -1, offsetof(TkMenuButton, underline), 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_MENUBUTTON_WIDTH, -1, Tk_Offset(TkMenuButton, widthString), + DEF_MENUBUTTON_WIDTH, -1, offsetof(TkMenuButton, widthString), 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_MENUBUTTON_WRAP_LENGTH, -1, Tk_Offset(TkMenuButton, wrapLength), + DEF_MENUBUTTON_WRAP_LENGTH, -1, offsetof(TkMenuButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; /* Index: generic/tkMessage.c ================================================================== --- generic/tkMessage.c +++ generic/tkMessage.c @@ -107,61 +107,61 @@ * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, - -1, Tk_Offset(Message, anchor), 0, 0, 0}, + -1, offsetof(Message, anchor), 0, 0, 0}, {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT, - -1, Tk_Offset(Message, aspect), 0, 0, 0}, + -1, offsetof(Message, aspect), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MESSAGE_BG_COLOR, -1, Tk_Offset(Message, border), 0, + DEF_MESSAGE_BG_COLOR, -1, offsetof(Message, border), 0, DEF_MESSAGE_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MESSAGE_BORDER_WIDTH, -1, - Tk_Offset(Message, borderWidth), 0, 0, 0}, + offsetof(Message, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_MESSAGE_CURSOR, -1, Tk_Offset(Message, cursor), + DEF_MESSAGE_CURSOR, -1, offsetof(Message, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_MESSAGE_FONT, -1, Tk_Offset(Message, tkfont), 0, 0, 0}, + DEF_MESSAGE_FONT, -1, offsetof(Message, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_MESSAGE_FG, -1, Tk_Offset(Message, fgColorPtr), 0, 0, 0}, + DEF_MESSAGE_FG, -1, offsetof(Message, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, -1, - Tk_Offset(Message, highlightBgColorPtr), 0, 0, 0}, + offsetof(Message, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_MESSAGE_HIGHLIGHT, -1, Tk_Offset(Message, highlightColorPtr), + DEF_MESSAGE_HIGHLIGHT, -1, offsetof(Message, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, -1, - Tk_Offset(Message, highlightWidth), 0, 0, 0}, + offsetof(Message, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_MESSAGE_JUSTIFY, -1, Tk_Offset(Message, justify), 0, 0, 0}, + DEF_MESSAGE_JUSTIFY, -1, offsetof(Message, justify), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_MESSAGE_PADX, Tk_Offset(Message, padXPtr), - Tk_Offset(Message, padX), 0, 0, 0}, + DEF_MESSAGE_PADX, offsetof(Message, padXPtr), + offsetof(Message, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_MESSAGE_PADY, Tk_Offset(Message, padYPtr), - Tk_Offset(Message, padY), 0, 0, 0}, + DEF_MESSAGE_PADY, offsetof(Message, padYPtr), + offsetof(Message, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MESSAGE_RELIEF, -1, Tk_Offset(Message, relief), 0, 0, 0}, + DEF_MESSAGE_RELIEF, -1, offsetof(Message, relief), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_MESSAGE_TAKE_FOCUS, -1, Tk_Offset(Message, takeFocus), + DEF_MESSAGE_TAKE_FOCUS, -1, offsetof(Message, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-text", "text", "Text", - DEF_MESSAGE_TEXT, -1, Tk_Offset(Message, string), 0, 0, 0}, + DEF_MESSAGE_TEXT, -1, offsetof(Message, string), 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - DEF_MESSAGE_TEXT_VARIABLE, -1, Tk_Offset(Message, textVarName), + DEF_MESSAGE_TEXT_VARIABLE, -1, offsetof(Message, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_MESSAGE_WIDTH, -1, Tk_Offset(Message, width), 0, 0 ,0}, + DEF_MESSAGE_WIDTH, -1, offsetof(Message, width), 0, 0 ,0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* * Forward declarations for functions defined later in this file: Index: generic/tkPanedWindow.c ================================================================== --- generic/tkPanedWindow.c +++ generic/tkPanedWindow.c @@ -234,11 +234,11 @@ static void AdjustForSticky(int sticky, int cavityWidth, int cavityHeight, int *xPtr, int *yPtr, int *slaveWidthPtr, int *slaveHeightPtr); static void MoveSash(PanedWindow *pwPtr, int sash, int diff); static int ObjectIsEmpty(Tcl_Obj *objPtr); -static void * ComputeSlotAddress(void *recordPtr, int offset); +static void * ComputeSlotAddress(void *recordPtr, size_t offset); static int PanedWindowIdentifyCoords(PanedWindow *pwPtr, Tcl_Interp *interp, int x, int y); /* * Sashes are between panes only, so there is one less sash than slaves @@ -273,96 +273,96 @@ 0 }; static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0, + DEF_PANEDWINDOW_BG_COLOR, -1, offsetof(PanedWindow, background), 0, DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth), + DEF_PANEDWINDOW_BORDERWIDTH, -1, offsetof(PanedWindow, borderWidth), 0, 0, GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_PANEDWINDOW_CURSOR, -1, Tk_Offset(PanedWindow, cursor), + DEF_PANEDWINDOW_CURSOR, -1, offsetof(PanedWindow, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", - DEF_PANEDWINDOW_HANDLEPAD, -1, Tk_Offset(PanedWindow, handlePad), + DEF_PANEDWINDOW_HANDLEPAD, -1, offsetof(PanedWindow, handlePad), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", - DEF_PANEDWINDOW_HANDLESIZE, Tk_Offset(PanedWindow, handleSizePtr), - Tk_Offset(PanedWindow, handleSize), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), + offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_PANEDWINDOW_HEIGHT, Tk_Offset(PanedWindow, heightPtr), - Tk_Offset(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, + DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightPtr), + offsetof(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", DEF_PANEDWINDOW_OPAQUERESIZE, -1, - Tk_Offset(PanedWindow, resizeOpaque), 0, 0, 0}, + offsetof(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), + DEF_PANEDWINDOW_ORIENT, -1, offsetof(PanedWindow, orient), 0, orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, + 0, -1, offsetof(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", - DEF_PANEDWINDOW_PROXYBORDER, Tk_Offset(PanedWindow, proxyBorderWidthPtr), - Tk_Offset(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_PROXYBORDER, offsetof(PanedWindow, proxyBorderWidthPtr), + offsetof(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", - 0, -1, Tk_Offset(PanedWindow, proxyRelief), + 0, -1, offsetof(PanedWindow, proxyRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, + DEF_PANEDWINDOW_RELIEF, -1, offsetof(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", - DEF_PANEDWINDOW_SASHCURSOR, -1, Tk_Offset(PanedWindow, sashCursor), + DEF_PANEDWINDOW_SASHCURSOR, -1, offsetof(PanedWindow, sashCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad", - DEF_PANEDWINDOW_SASHPAD, -1, Tk_Offset(PanedWindow, sashPad), + DEF_PANEDWINDOW_SASHPAD, -1, offsetof(PanedWindow, sashPad), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief", - DEF_PANEDWINDOW_SASHRELIEF, -1, Tk_Offset(PanedWindow, sashRelief), + DEF_PANEDWINDOW_SASHRELIEF, -1, offsetof(PanedWindow, sashRelief), 0, 0, 0}, {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", - DEF_PANEDWINDOW_SASHWIDTH, Tk_Offset(PanedWindow, sashWidthPtr), - Tk_Offset(PanedWindow, sashWidth), 0, 0, GEOMETRY}, + DEF_PANEDWINDOW_SASHWIDTH, offsetof(PanedWindow, sashWidthPtr), + offsetof(PanedWindow, sashWidth), 0, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle", - DEF_PANEDWINDOW_SHOWHANDLE, -1, Tk_Offset(PanedWindow, showHandle), + DEF_PANEDWINDOW_SHOWHANDLE, -1, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_PANEDWINDOW_WIDTH, Tk_Offset(PanedWindow, widthPtr), - Tk_Offset(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, + DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthPtr), + offsetof(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec slaveOptionSpecs[] = { {TK_OPTION_WINDOW, "-after", NULL, NULL, - DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Slave, after), + DEF_PANEDWINDOW_PANE_AFTER, -1, offsetof(Slave, after), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-before", NULL, NULL, - DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Slave, before), + DEF_PANEDWINDOW_PANE_BEFORE, -1, offsetof(Slave, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, - DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Slave, heightPtr), - Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0}, + 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, -1, Tk_Offset(Slave, hide), 0,0,GEOMETRY}, + DEF_PANEDWINDOW_PANE_HIDE, -1, offsetof(Slave, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, - DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Slave, minSize), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_MINSIZE, -1, offsetof(Slave, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Slave, padx), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADX, -1, offsetof(Slave, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Slave, pady), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADY, -1, offsetof(Slave, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, - DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Slave, sticky), 0, + DEF_PANEDWINDOW_PANE_STICKY, -1, offsetof(Slave, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", - DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Slave, stretch), 0, + DEF_PANEDWINDOW_PANE_STRETCH, -1, offsetof(Slave, stretch), 0, (ClientData) stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, - DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Slave, widthPtr), - Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0}, + DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Slave, widthPtr), + offsetof(Slave, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* *-------------------------------------------------------------- @@ -3021,13 +3021,13 @@ */ static void * ComputeSlotAddress( void *recordPtr, /* Pointer to the start of a record. */ - int offset) /* Offset of a slot within that record; may be < 0. */ + size_t offset) /* Offset of a slot within that record; may be -1. */ { - if (offset >= 0) { + if (offset != (size_t)-1) { return (char *)recordPtr + offset; } else { return NULL; } } Index: generic/tkPlace.c ================================================================== --- generic/tkPlace.c +++ generic/tkPlace.c @@ -80,33 +80,33 @@ #define IN_MASK 1 static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", -1, - Tk_Offset(Slave, anchor), 0, 0, 0}, + offsetof(Slave, anchor), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", -1, - Tk_Offset(Slave, borderMode), 0, borderModeStrings, 0}, - {TK_OPTION_PIXELS, "-height", NULL, NULL, "", Tk_Offset(Slave, heightPtr), - Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_WINDOW, "-in", NULL, NULL, "", -1, Tk_Offset(Slave, inTkwin), + 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, "", -1, offsetof(Slave, inTkwin), 0, 0, IN_MASK}, {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, "", - Tk_Offset(Slave, relHeightPtr), Tk_Offset(Slave, relHeight), + offsetof(Slave, relHeightPtr), offsetof(Slave, relHeight), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "", - Tk_Offset(Slave, relWidthPtr), Tk_Offset(Slave, relWidth), + offsetof(Slave, relWidthPtr), offsetof(Slave, relWidth), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", -1, - Tk_Offset(Slave, relX), 0, 0, 0}, + offsetof(Slave, relX), 0, 0, 0}, {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", -1, - Tk_Offset(Slave, relY), 0, 0, 0}, - {TK_OPTION_PIXELS, "-width", NULL, NULL, "", Tk_Offset(Slave, widthPtr), - Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", Tk_Offset(Slave, xPtr), - Tk_Offset(Slave, x), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", Tk_Offset(Slave, yPtr), - Tk_Offset(Slave, y), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Slave, relY), 0, 0, 0}, + {TK_OPTION_PIXELS, "-width", NULL, NULL, "", offsetof(Slave, widthPtr), + offsetof(Slave, width), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", offsetof(Slave, xPtr), + 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, -1, 0, 0, 0} }; /* * Flag definitions for Slave structures: Index: generic/tkRectOval.c ================================================================== --- generic/tkRectOval.c +++ generic/tkRectOval.c @@ -58,66 +58,66 @@ TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.activeDash), + NULL, offsetof(RectOvalItem, outline.activeDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-activefill", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, activeFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-activeoutline", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.activeStipple), + NULL, offsetof(RectOvalItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL, - "0.0", Tk_Offset(RectOvalItem, outline.activeWidth), + "0.0", offsetof(RectOvalItem, outline.activeWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.dash), + NULL, offsetof(RectOvalItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", Tk_Offset(RectOvalItem, outline.offset), + "0", offsetof(RectOvalItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.disabledDash), + NULL, offsetof(RectOvalItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.disabledColor), + NULL, offsetof(RectOvalItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.disabledStipple), + NULL, offsetof(RectOvalItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-disabledwidth", NULL, NULL, - "0.0", Tk_Offset(RectOvalItem, outline.disabledWidth), + "0.0", offsetof(RectOvalItem, outline.disabledWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, fillColor), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, fillColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-offset", NULL, NULL, - "0,0", Tk_Offset(RectOvalItem, tsoffset), + "0,0", offsetof(RectOvalItem, tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_COLOR, "-outline", NULL, NULL, - "black", Tk_Offset(RectOvalItem, outline.color), TK_CONFIG_NULL_OK, NULL}, + "black", offsetof(RectOvalItem, outline.color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL, - "0,0", Tk_Offset(RectOvalItem, outline.tsoffset), + "0,0", offsetof(RectOvalItem, outline.tsoffset), TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, outline.stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-state", NULL, NULL, - NULL, Tk_Offset(Tk_Item, state),TK_CONFIG_NULL_OK, &stateOption}, + NULL, offsetof(Tk_Item, state),TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, - NULL, Tk_Offset(RectOvalItem, fillStipple),TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(RectOvalItem, fillStipple),TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_CUSTOM, "-width", NULL, NULL, - "1.0", Tk_Offset(RectOvalItem, outline.width), + "1.0", offsetof(RectOvalItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* Index: generic/tkScale.c ================================================================== --- generic/tkScale.c +++ generic/tkScale.c @@ -43,100 +43,100 @@ "active", "disabled", "normal", NULL }; static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCALE_ACTIVE_BG_COLOR, -1, Tk_Offset(TkScale, activeBorder), + DEF_SCALE_ACTIVE_BG_COLOR, -1, offsetof(TkScale, activeBorder), 0, DEF_SCALE_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_SCALE_BG_COLOR, -1, Tk_Offset(TkScale, bgBorder), + DEF_SCALE_BG_COLOR, -1, offsetof(TkScale, bgBorder), 0, DEF_SCALE_BG_MONO, 0}, {TK_OPTION_DOUBLE, "-bigincrement", "bigIncrement", "BigIncrement", - DEF_SCALE_BIG_INCREMENT, -1, Tk_Offset(TkScale, bigIncrement), + DEF_SCALE_BIG_INCREMENT, -1, offsetof(TkScale, bigIncrement), 0, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCALE_BORDER_WIDTH, -1, Tk_Offset(TkScale, borderWidth), + DEF_SCALE_BORDER_WIDTH, -1, offsetof(TkScale, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", - DEF_SCALE_COMMAND, -1, Tk_Offset(TkScale, command), + DEF_SCALE_COMMAND, -1, offsetof(TkScale, command), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_SCALE_CURSOR, -1, Tk_Offset(TkScale, cursor), + DEF_SCALE_CURSOR, -1, offsetof(TkScale, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-digits", "digits", "Digits", - DEF_SCALE_DIGITS, -1, Tk_Offset(TkScale, digits), + DEF_SCALE_DIGITS, -1, offsetof(TkScale, digits), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_SCALE_FONT, -1, Tk_Offset(TkScale, tkfont), 0, 0, 0}, + DEF_SCALE_FONT, -1, offsetof(TkScale, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_SCALE_FG_COLOR, -1, Tk_Offset(TkScale, textColorPtr), 0, + DEF_SCALE_FG_COLOR, -1, offsetof(TkScale, textColorPtr), 0, (ClientData) DEF_SCALE_FG_MONO, 0}, {TK_OPTION_DOUBLE, "-from", "from", "From", DEF_SCALE_FROM, -1, - Tk_Offset(TkScale, fromValue), 0, 0, 0}, + offsetof(TkScale, fromValue), 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCALE_HIGHLIGHT_BG_COLOR, - -1, Tk_Offset(TkScale, highlightBorder), + -1, offsetof(TkScale, highlightBorder), 0, DEF_SCALE_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_SCALE_HIGHLIGHT, -1, Tk_Offset(TkScale, highlightColorPtr), + DEF_SCALE_HIGHLIGHT, -1, offsetof(TkScale, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_SCALE_HIGHLIGHT_WIDTH, -1, - Tk_Offset(TkScale, highlightWidth), 0, 0, 0}, + offsetof(TkScale, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-label", "label", "Label", - DEF_SCALE_LABEL, -1, Tk_Offset(TkScale, label), + DEF_SCALE_LABEL, -1, offsetof(TkScale, label), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_SCALE_LENGTH, -1, Tk_Offset(TkScale, length), 0, 0, 0}, + DEF_SCALE_LENGTH, -1, offsetof(TkScale, length), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - DEF_SCALE_ORIENT, -1, Tk_Offset(TkScale, orient), + DEF_SCALE_ORIENT, -1, offsetof(TkScale, orient), 0, orientStrings, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_SCALE_RELIEF, -1, Tk_Offset(TkScale, relief), 0, 0, 0}, + DEF_SCALE_RELIEF, -1, offsetof(TkScale, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SCALE_REPEAT_DELAY, -1, Tk_Offset(TkScale, repeatDelay), + DEF_SCALE_REPEAT_DELAY, -1, offsetof(TkScale, repeatDelay), 0, 0, 0}, {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SCALE_REPEAT_INTERVAL, -1, Tk_Offset(TkScale, repeatInterval), + DEF_SCALE_REPEAT_INTERVAL, -1, offsetof(TkScale, repeatInterval), 0, 0, 0}, {TK_OPTION_DOUBLE, "-resolution", "resolution", "Resolution", - DEF_SCALE_RESOLUTION, -1, Tk_Offset(TkScale, resolution), + DEF_SCALE_RESOLUTION, -1, offsetof(TkScale, resolution), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-showvalue", "showValue", "ShowValue", - DEF_SCALE_SHOW_VALUE, -1, Tk_Offset(TkScale, showValue), + DEF_SCALE_SHOW_VALUE, -1, offsetof(TkScale, showValue), 0, 0, 0}, {TK_OPTION_PIXELS, "-sliderlength", "sliderLength", "SliderLength", - DEF_SCALE_SLIDER_LENGTH, -1, Tk_Offset(TkScale, sliderLength), + DEF_SCALE_SLIDER_LENGTH, -1, offsetof(TkScale, sliderLength), 0, 0, 0}, {TK_OPTION_RELIEF, "-sliderrelief", "sliderRelief", "SliderRelief", - DEF_SCALE_SLIDER_RELIEF, -1, Tk_Offset(TkScale, sliderRelief), + DEF_SCALE_SLIDER_RELIEF, -1, offsetof(TkScale, sliderRelief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_SCALE_STATE, -1, Tk_Offset(TkScale, state), + DEF_SCALE_STATE, -1, offsetof(TkScale, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_SCALE_TAKE_FOCUS, Tk_Offset(TkScale, takeFocusPtr), -1, + DEF_SCALE_TAKE_FOCUS, offsetof(TkScale, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-tickinterval", "tickInterval", "TickInterval", - DEF_SCALE_TICK_INTERVAL, -1, Tk_Offset(TkScale, tickInterval), + DEF_SCALE_TICK_INTERVAL, -1, offsetof(TkScale, tickInterval), 0, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", - DEF_SCALE_TO, -1, Tk_Offset(TkScale, toValue), 0, 0, 0}, + DEF_SCALE_TO, -1, offsetof(TkScale, toValue), 0, 0, 0}, {TK_OPTION_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCALE_TROUGH_COLOR, -1, Tk_Offset(TkScale, troughColorPtr), + DEF_SCALE_TROUGH_COLOR, -1, offsetof(TkScale, troughColorPtr), 0, DEF_SCALE_TROUGH_MONO, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", - DEF_SCALE_VARIABLE, Tk_Offset(TkScale, varNamePtr), -1, + DEF_SCALE_VARIABLE, offsetof(TkScale, varNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_SCALE_WIDTH, -1, Tk_Offset(TkScale, width), 0, 0, 0}, + DEF_SCALE_WIDTH, -1, offsetof(TkScale, width), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; /* * The following tables define the scale widget commands and map the indexes Index: generic/tkScrollbar.c ================================================================== --- generic/tkScrollbar.c +++ generic/tkScrollbar.c @@ -31,66 +31,66 @@ * Information used for argv parsing. */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCROLLBAR_ACTIVE_BG_COLOR, Tk_Offset(TkScrollbar, activeBorder), + DEF_SCROLLBAR_ACTIVE_BG_COLOR, offsetof(TkScrollbar, activeBorder), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCROLLBAR_ACTIVE_BG_MONO, Tk_Offset(TkScrollbar, activeBorder), + DEF_SCROLLBAR_ACTIVE_BG_MONO, offsetof(TkScrollbar, activeBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief", - DEF_SCROLLBAR_ACTIVE_RELIEF, Tk_Offset(TkScrollbar, activeRelief), 0, NULL}, + DEF_SCROLLBAR_ACTIVE_RELIEF, offsetof(TkScrollbar, activeRelief), 0, NULL}, {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_SCROLLBAR_BG_COLOR, Tk_Offset(TkScrollbar, bgBorder), + DEF_SCROLLBAR_BG_COLOR, offsetof(TkScrollbar, bgBorder), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_SCROLLBAR_BG_MONO, Tk_Offset(TkScrollbar, bgBorder), + DEF_SCROLLBAR_BG_MONO, offsetof(TkScrollbar, bgBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCROLLBAR_BORDER_WIDTH, Tk_Offset(TkScrollbar, borderWidth), 0, NULL}, + DEF_SCROLLBAR_BORDER_WIDTH, offsetof(TkScrollbar, borderWidth), 0, NULL}, {TK_CONFIG_STRING, "-command", "command", "Command", - DEF_SCROLLBAR_COMMAND, Tk_Offset(TkScrollbar, command), + DEF_SCROLLBAR_COMMAND, offsetof(TkScrollbar, command), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", - DEF_SCROLLBAR_CURSOR, Tk_Offset(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, + DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, - Tk_Offset(TkScrollbar, elementBorderWidth), 0, NULL}, + offsetof(TkScrollbar, elementBorderWidth), 0, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG, - Tk_Offset(TkScrollbar, highlightBgColorPtr), 0, NULL}, + offsetof(TkScrollbar, highlightBgColorPtr), 0, NULL}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_SCROLLBAR_HIGHLIGHT, - Tk_Offset(TkScrollbar, highlightColorPtr), 0, NULL}, + offsetof(TkScrollbar, highlightColorPtr), 0, NULL}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", - DEF_SCROLLBAR_HIGHLIGHT_WIDTH, Tk_Offset(TkScrollbar, highlightWidth), 0, NULL}, + DEF_SCROLLBAR_HIGHLIGHT_WIDTH, offsetof(TkScrollbar, highlightWidth), 0, NULL}, {TK_CONFIG_BOOLEAN, "-jump", "jump", "Jump", - DEF_SCROLLBAR_JUMP, Tk_Offset(TkScrollbar, jump), 0, NULL}, + DEF_SCROLLBAR_JUMP, offsetof(TkScrollbar, jump), 0, NULL}, {TK_CONFIG_CUSTOM, "-orient", "orient", "Orient", - DEF_SCROLLBAR_ORIENT, Tk_Offset(TkScrollbar, vertical), 0, + DEF_SCROLLBAR_ORIENT, offsetof(TkScrollbar, vertical), 0, &orientOption}, {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", - DEF_SCROLLBAR_RELIEF, Tk_Offset(TkScrollbar, relief), 0, NULL}, + DEF_SCROLLBAR_RELIEF, offsetof(TkScrollbar, relief), 0, NULL}, {TK_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SCROLLBAR_REPEAT_DELAY, Tk_Offset(TkScrollbar, repeatDelay), 0, NULL}, + DEF_SCROLLBAR_REPEAT_DELAY, offsetof(TkScrollbar, repeatDelay), 0, NULL}, {TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SCROLLBAR_REPEAT_INTERVAL, Tk_Offset(TkScrollbar, repeatInterval), 0, NULL}, + DEF_SCROLLBAR_REPEAT_INTERVAL, offsetof(TkScrollbar, repeatInterval), 0, NULL}, {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_SCROLLBAR_TAKE_FOCUS, Tk_Offset(TkScrollbar, takeFocus), + DEF_SCROLLBAR_TAKE_FOCUS, offsetof(TkScrollbar, takeFocus), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCROLLBAR_TROUGH_COLOR, Tk_Offset(TkScrollbar, troughColorPtr), + DEF_SCROLLBAR_TROUGH_COLOR, offsetof(TkScrollbar, troughColorPtr), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCROLLBAR_TROUGH_MONO, Tk_Offset(TkScrollbar, troughColorPtr), + DEF_SCROLLBAR_TROUGH_MONO, offsetof(TkScrollbar, troughColorPtr), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_PIXELS, "-width", "width", "Width", - tkDefScrollbarWidth, Tk_Offset(TkScrollbar, width), 0, NULL}, + tkDefScrollbarWidth, offsetof(TkScrollbar, width), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Forward declarations for functions defined later in this file: Index: generic/tkSelect.c ================================================================== --- generic/tkSelect.c +++ generic/tkSelect.c @@ -188,11 +188,11 @@ /* * The clientData is selection controlled memory, so we * should make a copy for this selPtr. */ - size_t cmdInfoLen = Tk_Offset(CommandInfo, command) + 1 + + size_t cmdInfoLen = offsetof(CommandInfo, command) + 1 + ((CommandInfo *)clientData)->cmdLength; selPtr->clientData = ckalloc(cmdInfoLen); memcpy(selPtr->clientData, clientData, cmdInfoLen); } else { @@ -902,11 +902,11 @@ } string = TkGetStringFromObj(objs[1], &cmdLength); if (cmdLength == 0) { Tk_DeleteSelHandler(tkwin, selection, target); } else { - cmdInfoPtr = ckalloc(Tk_Offset(CommandInfo, command) + cmdInfoPtr = ckalloc(offsetof(CommandInfo, command) + 1 + cmdLength); cmdInfoPtr->interp = interp; cmdInfoPtr->charOffset = 0; cmdInfoPtr->byteOffset = 0; cmdInfoPtr->buffer[0] = '\0'; Index: generic/tkSquare.c ================================================================== --- generic/tkSquare.c +++ generic/tkSquare.c @@ -64,33 +64,33 @@ * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", - "#d9d9d9", Tk_Offset(Square, bgBorderPtr), -1, 0, + "#d9d9d9", offsetof(Square, bgBorderPtr), -1, 0, "white", 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - "2", Tk_Offset(Square, borderWidthPtr), -1, 0, NULL, 0}, + "2", offsetof(Square, borderWidthPtr), -1, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", Tk_Offset(Square, doubleBufferPtr), -1, 0 , NULL, 0}, + "1", offsetof(Square, doubleBufferPtr), -1, 0 , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", - "#b03060", Tk_Offset(Square, fgBorderPtr), -1, 0, + "#b03060", offsetof(Square, fgBorderPtr), -1, 0, "black", 0}, {TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0", - Tk_Offset(Square, xPtr), -1, 0, NULL, 0}, + offsetof(Square, xPtr), -1, 0, NULL, 0}, {TK_OPTION_PIXELS, "-posy", "posy", "PosY", "0", - Tk_Offset(Square, yPtr), -1, 0, NULL, 0}, + offsetof(Square, yPtr), -1, 0, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - "raised", Tk_Offset(Square, reliefPtr), -1, 0, NULL, 0}, + "raised", offsetof(Square, reliefPtr), -1, 0, NULL, 0}, {TK_OPTION_PIXELS, "-size", "size", "Size", "20", - Tk_Offset(Square, sizeObjPtr), -1, 0, NULL, 0}, + offsetof(Square, sizeObjPtr), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; /* * Forward declarations for procedures defined later in this file: Index: generic/tkTest.c ================================================================== --- generic/tkTest.c +++ generic/tkTest.c @@ -554,13 +554,13 @@ Tcl_Obj *extension4ObjPtr; Tcl_Obj *extension5ObjPtr; } ExtensionWidgetRecord; static const Tk_OptionSpec baseSpecs[] = { {TK_OPTION_STRING, "-one", "one", "One", "one", - Tk_Offset(ExtensionWidgetRecord, base1ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base1ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-two", "two", "Two", "two", - Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "command"); @@ -598,51 +598,51 @@ static const char *const stringTable[] = { "one", "two", "three", "four", NULL }; static const Tk_OptionSpec typesSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", - Tk_Offset(TypesRecord, booleanPtr), -1, 0, 0, 0x1}, + offsetof(TypesRecord, booleanPtr), -1, 0, 0, 0x1}, {TK_OPTION_INT, "-integer", "integer", "Integer", "7", - Tk_Offset(TypesRecord, integerPtr), -1, 0, 0, 0x2}, + offsetof(TypesRecord, integerPtr), -1, 0, 0, 0x2}, {TK_OPTION_DOUBLE, "-double", "double", "Double", "3.14159", - Tk_Offset(TypesRecord, doublePtr), -1, 0, 0, 0x4}, + offsetof(TypesRecord, doublePtr), -1, 0, 0, 0x4}, {TK_OPTION_STRING, "-string", "string", "String", - "foo", Tk_Offset(TypesRecord, stringPtr), -1, + "foo", offsetof(TypesRecord, stringPtr), -1, TK_CONFIG_NULL_OK, 0, 0x8}, {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", - "one", Tk_Offset(TypesRecord, stringTablePtr), -1, + "one", offsetof(TypesRecord, stringTablePtr), -1, TK_CONFIG_NULL_OK, stringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", - "red", Tk_Offset(TypesRecord, colorPtr), -1, + "red", offsetof(TypesRecord, colorPtr), -1, TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", - Tk_Offset(TypesRecord, fontPtr), -1, + offsetof(TypesRecord, fontPtr), -1, TK_CONFIG_NULL_OK, 0, 0x40}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", "gray50", - Tk_Offset(TypesRecord, bitmapPtr), -1, + offsetof(TypesRecord, bitmapPtr), -1, TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", - "blue", Tk_Offset(TypesRecord, borderPtr), -1, + "blue", offsetof(TypesRecord, borderPtr), -1, TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", - Tk_Offset(TypesRecord, reliefPtr), -1, + offsetof(TypesRecord, reliefPtr), -1, TK_CONFIG_NULL_OK, 0, 0x200}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm", - Tk_Offset(TypesRecord, cursorPtr), -1, + offsetof(TypesRecord, cursorPtr), -1, TK_CONFIG_NULL_OK, 0, 0x400}, {TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left", - Tk_Offset(TypesRecord, justifyPtr), -1, + offsetof(TypesRecord, justifyPtr), -1, TK_CONFIG_NULL_OK, 0, 0x800}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, - Tk_Offset(TypesRecord, anchorPtr), -1, + offsetof(TypesRecord, anchorPtr), -1, TK_CONFIG_NULL_OK, 0, 0x1000}, {TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel", - "1", Tk_Offset(TypesRecord, pixelPtr), -1, + "1", offsetof(TypesRecord, pixelPtr), -1, TK_CONFIG_NULL_OK, 0, 0x2000}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, - "", Tk_Offset(TypesRecord, customPtr), -1, + "", offsetof(TypesRecord, customPtr), -1, TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, NULL, 0, -1, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; @@ -743,18 +743,18 @@ case CHAIN2: case CHAIN3: { ExtensionWidgetRecord *recordPtr; static const Tk_OptionSpec extensionSpecs[] = { {TK_OPTION_STRING, "-three", "three", "Three", "three", - Tk_Offset(ExtensionWidgetRecord, extension3ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, extension3ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-four", "four", "Four", "four", - Tk_Offset(ExtensionWidgetRecord, extension4ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, extension4ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-two", "two", "Two", "two and a half", - Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-oneAgain", "oneAgain", "OneAgain", "one again", - Tk_Offset(ExtensionWidgetRecord, extension5ObjPtr), -1, 0, NULL, 0}, + offsetof(ExtensionWidgetRecord, extension5ObjPtr), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, (ClientData) baseSpecs, 0} }; Tk_Window tkwin; Tk_OptionTable optionTable; @@ -799,11 +799,11 @@ Tcl_Obj *intPtr; } ErrorWidgetRecord; ErrorWidgetRecord widgetRecord; static const Tk_OptionSpec errorSpecs[] = { {TK_OPTION_INT, "-int", "integer", "Integer", "bogus", - Tk_Offset(ErrorWidgetRecord, intPtr), 0, 0, NULL, 0}, + offsetof(ErrorWidgetRecord, intPtr), 0, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_OptionTable optionTable; widgetRecord.intPtr = NULL; @@ -873,54 +873,54 @@ static const char *const internalStringTable[] = { "one", "two", "three", "four", NULL }; static const Tk_OptionSpec internalSpecs[] = { {TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1", - -1, Tk_Offset(InternalRecord, boolean), 0, 0, 0x1}, + -1, offsetof(InternalRecord, boolean), 0, 0, 0x1}, {TK_OPTION_INT, "-integer", "integer", "Integer", "148962237", - -1, Tk_Offset(InternalRecord, integer), 0, 0, 0x2}, + -1, offsetof(InternalRecord, integer), 0, 0, 0x2}, {TK_OPTION_DOUBLE, "-double", "double", "Double", "3.14159", - -1, Tk_Offset(InternalRecord, doubleValue), 0, 0, 0x4}, + -1, offsetof(InternalRecord, doubleValue), 0, 0, 0x4}, {TK_OPTION_STRING, "-string", "string", "String", "foo", - -1, Tk_Offset(InternalRecord, string), + -1, offsetof(InternalRecord, string), TK_CONFIG_NULL_OK, 0, 0x8}, {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", "one", - -1, Tk_Offset(InternalRecord, index), + -1, offsetof(InternalRecord, index), TK_CONFIG_NULL_OK, internalStringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", "red", - -1, Tk_Offset(InternalRecord, colorPtr), + -1, offsetof(InternalRecord, colorPtr), TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", - -1, Tk_Offset(InternalRecord, tkfont), + -1, offsetof(InternalRecord, tkfont), TK_CONFIG_NULL_OK, 0, 0x40}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", "gray50", - -1, Tk_Offset(InternalRecord, bitmap), + -1, offsetof(InternalRecord, bitmap), TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", "blue", - -1, Tk_Offset(InternalRecord, border), + -1, offsetof(InternalRecord, border), TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", - -1, Tk_Offset(InternalRecord, relief), + -1, offsetof(InternalRecord, relief), TK_CONFIG_NULL_OK, 0, 0x200}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", "xterm", - -1, Tk_Offset(InternalRecord, cursor), + -1, offsetof(InternalRecord, cursor), TK_CONFIG_NULL_OK, 0, 0x400}, {TK_OPTION_JUSTIFY, "-justify", NULL, NULL, "left", - -1, Tk_Offset(InternalRecord, justify), + -1, offsetof(InternalRecord, justify), TK_CONFIG_NULL_OK, 0, 0x800}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, - -1, Tk_Offset(InternalRecord, anchor), + -1, offsetof(InternalRecord, anchor), TK_CONFIG_NULL_OK, 0, 0x1000}, {TK_OPTION_PIXELS, "-pixel", "pixel", "Pixel", "1", - -1, Tk_Offset(InternalRecord, pixels), + -1, offsetof(InternalRecord, pixels), TK_CONFIG_NULL_OK, 0, 0x2000}, {TK_OPTION_WINDOW, "-window", "window", "Window", NULL, - -1, Tk_Offset(InternalRecord, tkwin), + -1, offsetof(InternalRecord, tkwin), TK_CONFIG_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, "", - -1, Tk_Offset(InternalRecord, custom), + -1, offsetof(InternalRecord, custom), TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, NULL, -1, -1, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; @@ -990,19 +990,19 @@ Tcl_Obj *five; } FiveRecord; FiveRecord *recordPtr; static const Tk_OptionSpec smallSpecs[] = { {TK_OPTION_INT, "-one", "one", "One", "1", - Tk_Offset(FiveRecord, one), -1, 0, NULL, 0}, + offsetof(FiveRecord, one), -1, 0, NULL, 0}, {TK_OPTION_INT, "-two", "two", "Two", "2", - Tk_Offset(FiveRecord, two), -1, 0, NULL, 0}, + offsetof(FiveRecord, two), -1, 0, NULL, 0}, {TK_OPTION_INT, "-three", "three", "Three", "3", - Tk_Offset(FiveRecord, three), -1, 0, NULL, 0}, + offsetof(FiveRecord, three), -1, 0, NULL, 0}, {TK_OPTION_INT, "-four", "four", "Four", "4", - Tk_Offset(FiveRecord, four), -1, 0, NULL, 0}, + offsetof(FiveRecord, four), -1, 0, NULL, 0}, {TK_OPTION_STRING, "-five", NULL, NULL, NULL, - Tk_Offset(FiveRecord, five), -1, 0, NULL, 0}, + offsetof(FiveRecord, five), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "new name ?-option value ...?"); @@ -1044,11 +1044,11 @@ Tcl_Obj *fooObjPtr; } NotEnoughRecord; NotEnoughRecord record; static const Tk_OptionSpec errorSpecs[] = { {TK_OPTION_INT, "-foo", "foo", "Foo", "0", - Tk_Offset(NotEnoughRecord, fooObjPtr), 0, 0, NULL, 0}, + offsetof(NotEnoughRecord, fooObjPtr), 0, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tcl_Obj *newObjPtr = Tcl_NewStringObj("-foo", -1); Tk_OptionTable optionTable; @@ -1075,11 +1075,11 @@ Tcl_Obj *windowPtr; } SlaveRecord; SlaveRecord *recordPtr; static const Tk_OptionSpec slaveSpecs[] = { {TK_OPTION_WINDOW, "-window", "window", "Window", ".bar", - Tk_Offset(SlaveRecord, windowPtr), -1, TK_CONFIG_NULL_OK, NULL, 0}, + offsetof(SlaveRecord, windowPtr), -1, TK_CONFIG_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_Window tkwin = Tk_CreateWindowFromPath(interp, clientData, Tcl_GetString(objv[2]), NULL); Index: generic/tkText.c ================================================================== --- generic/tkText.c +++ generic/tkText.c @@ -120,142 +120,142 @@ */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BOOLEAN, "-autoseparators", "autoSeparators", "AutoSeparators", DEF_TEXT_AUTO_SEPARATORS, -1, - Tk_Offset(TkText, autoSeparators), + offsetof(TkText, autoSeparators), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_TEXT_BG_COLOR, -1, Tk_Offset(TkText, border), + DEF_TEXT_BG_COLOR, -1, offsetof(TkText, border), 0, DEF_TEXT_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, "-borderwidth", TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BOOLEAN, "-blockcursor", "blockCursor", "BlockCursor", DEF_TEXT_BLOCK_CURSOR, -1, - Tk_Offset(TkText, insertCursorType), 0, 0, 0}, + offsetof(TkText, insertCursorType), 0, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_TEXT_BORDER_WIDTH, -1, Tk_Offset(TkText, borderWidth), + DEF_TEXT_BORDER_WIDTH, -1, offsetof(TkText, borderWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_TEXT_CURSOR, -1, Tk_Offset(TkText, cursor), + DEF_TEXT_CURSOR, -1, offsetof(TkText, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-endline", NULL, NULL, - NULL, -1, Tk_Offset(TkText, end), TK_OPTION_NULL_OK, + NULL, -1, offsetof(TkText, end), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", DEF_TEXT_EXPORT_SELECTION, -1, - Tk_Offset(TkText, exportSelection), 0, 0, 0}, + offsetof(TkText, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_TEXT_FONT, -1, Tk_Offset(TkText, tkfont), 0, 0, + DEF_TEXT_FONT, -1, offsetof(TkText, tkfont), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", - DEF_TEXT_FG, -1, Tk_Offset(TkText, fgColor), 0, + DEF_TEXT_FG, -1, offsetof(TkText, fgColor), 0, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_TEXT_HEIGHT, -1, Tk_Offset(TkText, height), 0, 0, 0}, + DEF_TEXT_HEIGHT, -1, offsetof(TkText, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_TEXT_HIGHLIGHT_BG, - -1, Tk_Offset(TkText, highlightBgColorPtr), + -1, offsetof(TkText, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_TEXT_HIGHLIGHT, -1, Tk_Offset(TkText, highlightColorPtr), + DEF_TEXT_HIGHLIGHT, -1, offsetof(TkText, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_TEXT_HIGHLIGHT_WIDTH, -1, - Tk_Offset(TkText, highlightWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, + offsetof(TkText, highlightWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_BORDER, "-inactiveselectbackground","inactiveSelectBackground", "Foreground", DEF_TEXT_INACTIVE_SELECT_COLOR, - -1, Tk_Offset(TkText, inactiveSelBorder), + -1, offsetof(TkText, inactiveSelBorder), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_TEXT_INSERT_BG, - -1, Tk_Offset(TkText, insertBorder), + -1, offsetof(TkText, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, -1, - Tk_Offset(TkText, insertBorderWidth), 0, + offsetof(TkText, insertBorderWidth), 0, (ClientData) DEF_TEXT_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", - DEF_TEXT_INSERT_OFF_TIME, -1, Tk_Offset(TkText, insertOffTime), + DEF_TEXT_INSERT_OFF_TIME, -1, offsetof(TkText, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", - DEF_TEXT_INSERT_ON_TIME, -1, Tk_Offset(TkText, insertOnTime), + DEF_TEXT_INSERT_ON_TIME, -1, offsetof(TkText, insertOnTime), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed", - DEF_TEXT_INSERT_UNFOCUSSED, -1, Tk_Offset(TkText, insertUnfocussed), + DEF_TEXT_INSERT_UNFOCUSSED, -1, offsetof(TkText, insertUnfocussed), 0, insertUnfocussedStrings, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_TEXT_INSERT_WIDTH, -1, Tk_Offset(TkText, insertWidth), + DEF_TEXT_INSERT_WIDTH, -1, offsetof(TkText, insertWidth), 0, 0, 0}, {TK_OPTION_INT, "-maxundo", "maxUndo", "MaxUndo", - DEF_TEXT_MAX_UNDO, -1, Tk_Offset(TkText, maxUndo), + DEF_TEXT_MAX_UNDO, -1, offsetof(TkText, maxUndo), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_TEXT_PADX, -1, Tk_Offset(TkText, padX), 0, 0, + DEF_TEXT_PADX, -1, offsetof(TkText, padX), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_TEXT_PADY, -1, Tk_Offset(TkText, padY), 0, 0, 0}, + DEF_TEXT_PADY, -1, offsetof(TkText, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_TEXT_RELIEF, -1, Tk_Offset(TkText, relief), 0, 0, 0}, + DEF_TEXT_RELIEF, -1, offsetof(TkText, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", - DEF_TEXT_SELECT_COLOR, -1, Tk_Offset(TkText, selBorder), + DEF_TEXT_SELECT_COLOR, -1, offsetof(TkText, selBorder), 0, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_TEXT_SELECT_BD_COLOR, - Tk_Offset(TkText, selBorderWidthPtr), - Tk_Offset(TkText, selBorderWidth), + offsetof(TkText, selBorderWidthPtr), + offsetof(TkText, selBorderWidth), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", - DEF_TEXT_SELECT_FG_COLOR, -1, Tk_Offset(TkText, selFgColorPtr), + DEF_TEXT_SELECT_FG_COLOR, -1, offsetof(TkText, selFgColorPtr), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", - DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, + DEF_TEXT_SET_GRID, -1, offsetof(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", - DEF_TEXT_SPACING1, -1, Tk_Offset(TkText, spacing1), + DEF_TEXT_SPACING1, -1, offsetof(TkText, spacing1), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", - DEF_TEXT_SPACING2, -1, Tk_Offset(TkText, spacing2), + DEF_TEXT_SPACING2, -1, offsetof(TkText, spacing2), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", - DEF_TEXT_SPACING3, -1, Tk_Offset(TkText, spacing3), + DEF_TEXT_SPACING3, -1, offsetof(TkText, spacing3), 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, - NULL, -1, Tk_Offset(TkText, start), TK_OPTION_NULL_OK, + NULL, -1, offsetof(TkText, start), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", - DEF_TEXT_STATE, -1, Tk_Offset(TkText, state), + DEF_TEXT_STATE, -1, offsetof(TkText, state), 0, stateStrings, 0}, {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", - DEF_TEXT_TABS, Tk_Offset(TkText, tabOptionPtr), -1, + DEF_TEXT_TABS, offsetof(TkText, tabOptionPtr), -1, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", - DEF_TEXT_TABSTYLE, -1, Tk_Offset(TkText, tabStyle), + DEF_TEXT_TABSTYLE, -1, offsetof(TkText, tabStyle), 0, tabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_TEXT_TAKE_FOCUS, -1, Tk_Offset(TkText, takeFocus), + DEF_TEXT_TAKE_FOCUS, -1, offsetof(TkText, takeFocus), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-undo", "undo", "Undo", - DEF_TEXT_UNDO, -1, Tk_Offset(TkText, undo), + DEF_TEXT_UNDO, -1, offsetof(TkText, undo), TK_OPTION_DONT_SET_DEFAULT, 0 , 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_TEXT_WIDTH, -1, Tk_Offset(TkText, width), 0, 0, + DEF_TEXT_WIDTH, -1, offsetof(TkText, width), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-wrap", "wrap", "Wrap", - DEF_TEXT_WRAP, -1, Tk_Offset(TkText, wrapMode), + DEF_TEXT_WRAP, -1, offsetof(TkText, wrapMode), 0, wrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - DEF_TEXT_XSCROLL_COMMAND, -1, Tk_Offset(TkText, xScrollCmd), + DEF_TEXT_XSCROLL_COMMAND, -1, offsetof(TkText, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - DEF_TEXT_YSCROLL_COMMAND, -1, Tk_Offset(TkText, yScrollCmd), + DEF_TEXT_YSCROLL_COMMAND, -1, offsetof(TkText, yScrollCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0} }; /* Index: generic/tkTextBTree.c ================================================================== --- generic/tkTextBTree.c +++ generic/tkTextBTree.c @@ -138,13 +138,13 @@ /* * Macros that determine how much space to allocate for new segments: */ -#define CSEG_SIZE(chars) (Tk_Offset(TkTextSegment, body) \ +#define CSEG_SIZE(chars) (offsetof(TkTextSegment, body) \ + 1 + (chars)) -#define TSEG_SIZE (Tk_Offset(TkTextSegment, body) \ +#define TSEG_SIZE (offsetof(TkTextSegment, body) \ + sizeof(TkTextToggle)) /* * Forward declarations for functions defined in this file: */ Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -7755,11 +7755,11 @@ chunkPtr->minHeight = 0; chunkPtr->width = nextX - chunkPtr->x; chunkPtr->breakIndex = -1; #if !TK_LAYOUT_WITH_BASE_CHUNKS - ciPtr = ckalloc(Tk_Offset(CharInfo, chars) + 1 + bytesThatFit); + ciPtr = ckalloc(offsetof(CharInfo, chars) + 1 + bytesThatFit); chunkPtr->clientData = ciPtr; memcpy(ciPtr->chars, p, bytesThatFit); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ ciPtr->numBytes = bytesThatFit; Index: generic/tkTextImage.c ================================================================== --- generic/tkTextImage.c +++ generic/tkTextImage.c @@ -16,11 +16,11 @@ /* * Macro that determines the size of an embedded image segment: */ #define EI_SEG_SIZE \ - (Tk_Offset(TkTextSegment, body) + sizeof(TkTextEmbImage)) + (offsetof(TkTextSegment, body) + sizeof(TkTextEmbImage)) /* * Prototypes for functions defined in this file: */ @@ -81,21 +81,21 @@ * Information used for parsing image configuration options: */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, - "center", -1, Tk_Offset(TkTextEmbImage, align), + "center", -1, offsetof(TkTextEmbImage, align), 0, alignStrings, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", -1, Tk_Offset(TkTextEmbImage, padX), 0, 0, 0}, + "0", -1, offsetof(TkTextEmbImage, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", -1, Tk_Offset(TkTextEmbImage, padY), 0, 0, 0}, + "0", -1, offsetof(TkTextEmbImage, padY), 0, 0, 0}, {TK_OPTION_STRING, "-image", NULL, NULL, - NULL, -1, Tk_Offset(TkTextEmbImage, imageString), + NULL, -1, offsetof(TkTextEmbImage, imageString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-name", NULL, NULL, - NULL, -1, Tk_Offset(TkTextEmbImage, imageName), + NULL, -1, offsetof(TkTextEmbImage, imageName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* Index: generic/tkTextMark.c ================================================================== --- generic/tkTextMark.c +++ generic/tkTextMark.c @@ -17,11 +17,11 @@ /* * Macro that determines the size of a mark segment: */ -#define MSEG_SIZE (Tk_Offset(TkTextSegment, body) \ +#define MSEG_SIZE (offsetof(TkTextSegment, body) \ + sizeof(TkTextMark)) /* * Forward references for functions defined in this file: */ Index: generic/tkTextTag.c ================================================================== --- generic/tkTextTag.c +++ generic/tkTextTag.c @@ -38,70 +38,70 @@ "tabular", "wordprocessor", "", NULL }; static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, - NULL, Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), + 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, -1, Tk_Offset(TkTextTag, elideString), + NULL, -1, offsetof(TkTextTag, elideString), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-justify", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0}, + NULL, -1, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_STRING, "-lmargin1", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, + NULL, -1, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-lmargin2", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, + NULL, -1, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-offset", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-overstrike", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, overstrikeString), + NULL, -1, offsetof(TkTextTag, overstrikeString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, overstrikeColor), + NULL, -1, offsetof(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-relief", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + NULL, -1, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, + NULL, -1, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing2", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0}, + NULL, -1, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing3", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0}, + NULL, -1, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-tabs", NULL, NULL, - NULL, Tk_Offset(TkTextTag, tabStringPtr), -1, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(TkTextTag, tabStringPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, tabStyle), + NULL, -1, offsetof(TkTextTag, tabStyle), TK_OPTION_NULL_OK, tabStyleStrings, 0}, {TK_OPTION_STRING, "-underline", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, underlineString), + NULL, -1, offsetof(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, underlineColor), + NULL, -1, offsetof(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, wrapMode), + NULL, -1, offsetof(TkTextTag, wrapMode), TK_OPTION_NULL_OK, wrapStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* Index: generic/tkTextWind.c ================================================================== --- generic/tkTextWind.c +++ generic/tkTextWind.c @@ -33,11 +33,11 @@ /* * Macro that determines the size of an embedded window segment: */ -#define EW_SEG_SIZE (Tk_Offset(TkTextSegment, body) \ +#define EW_SEG_SIZE (offsetof(TkTextSegment, body) \ + sizeof(TkTextEmbWindow)) /* * Prototypes for functions defined in this file: */ @@ -97,22 +97,22 @@ * Information used for parsing window configuration options: */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, - "center", -1, Tk_Offset(TkTextEmbWindow, align), + "center", -1, offsetof(TkTextEmbWindow, align), 0, alignStrings, 0}, {TK_OPTION_STRING, "-create", NULL, NULL, - NULL, -1, Tk_Offset(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", -1, Tk_Offset(TkTextEmbWindow, padX), 0, 0, 0}, + "0", -1, offsetof(TkTextEmbWindow, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", -1, Tk_Offset(TkTextEmbWindow, padY), 0, 0, 0}, + "0", -1, offsetof(TkTextEmbWindow, padY), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-stretch", NULL, NULL, - "0", -1, Tk_Offset(TkTextEmbWindow, stretch), 0, 0, 0}, + "0", -1, offsetof(TkTextEmbWindow, stretch), 0, 0, 0}, {TK_OPTION_WINDOW, "-window", NULL, NULL, - NULL, -1, Tk_Offset(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, offsetof(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* *-------------------------------------------------------------- Index: generic/ttk/ttkButton.c ================================================================== --- generic/ttk/ttkButton.c +++ generic/ttk/ttkButton.c @@ -55,48 +55,48 @@ } Base; static Tk_OptionSpec BaseOptionSpecs[] = { {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", Tk_Offset(Base,base.justifyObj), -1, + "left", offsetof(Base,base.justifyObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-text", "text", "Text", "", - Tk_Offset(Base,base.textObj), -1, + offsetof(Base,base.textObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", "", - Tk_Offset(Base,base.textVariableObj), -1, + offsetof(Base,base.textVariableObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", - "-1", Tk_Offset(Base,base.underlineObj), -1, + "-1", offsetof(Base,base.underlineObj), -1, 0,0,0 }, /* SB: OPTION_INT, see <> */ {TK_OPTION_STRING, "-width", "width", "Width", - NULL, Tk_Offset(Base,base.widthObj), -1, + NULL, offsetof(Base,base.widthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, /* * Image options */ {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, - Tk_Offset(Base,base.imageObj), -1, + offsetof(Base,base.imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, /* * Compound base/image options */ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - "none", Tk_Offset(Base,base.compoundObj), -1, + "none", offsetof(Base,base.compoundObj), -1, 0,(ClientData)ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", - NULL, Tk_Offset(Base,base.paddingObj), -1, + NULL, offsetof(Base,base.paddingObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED}, /* * Compatibility/legacy options */ {TK_OPTION_STRING, "-state", "state", "State", - "normal", Tk_Offset(Base,base.stateObj), -1, + "normal", offsetof(Base,base.stateObj), -1, 0,0,STATE_CHANGED }, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -230,32 +230,32 @@ } Label; static Tk_OptionSpec LabelOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "frameColor", "FrameColor", - NULL, Tk_Offset(Label,label.backgroundObj), -1, + NULL, offsetof(Label,label.backgroundObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, Tk_Offset(Label,label.foregroundObj), -1, + NULL, offsetof(Label,label.foregroundObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - NULL, Tk_Offset(Label,label.fontObj), -1, + NULL, offsetof(Label,label.fontObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - NULL, Tk_Offset(Label,label.borderWidthObj), -1, + NULL, offsetof(Label,label.borderWidthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - NULL, Tk_Offset(Label,label.reliefObj), -1, + NULL, offsetof(Label,label.reliefObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, Tk_Offset(Label,label.anchorObj), -1, + NULL, offsetof(Label,label.anchorObj), -1, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - NULL, Tk_Offset(Label, label.justifyObj), -1, + NULL, offsetof(Label, label.justifyObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - NULL, Tk_Offset(Label, label.wrapLengthObj), -1, + NULL, offsetof(Label, label.wrapLengthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -313,13 +313,13 @@ * Option specifications: */ static Tk_OptionSpec ButtonOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", - "", Tk_Offset(Button, button.commandObj), -1, 0,0,0}, + "", offsetof(Button, button.commandObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", - "normal", Tk_Offset(Button, button.defaultStateObj), -1, + "normal", offsetof(Button, button.defaultStateObj), -1, 0, (ClientData) ttkDefaultStrings, DEFAULTSTATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -423,20 +423,20 @@ * Option specifications: */ static Tk_OptionSpec CheckbuttonOptionSpecs[] = { {TK_OPTION_STRING, "-variable", "variable", "Variable", - NULL, Tk_Offset(Checkbutton, checkbutton.variableObj), -1, + NULL, offsetof(Checkbutton, checkbutton.variableObj), -1, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-onvalue", "onValue", "OnValue", - "1", Tk_Offset(Checkbutton, checkbutton.onValueObj), -1, + "1", offsetof(Checkbutton, checkbutton.onValueObj), -1, 0,0,0}, {TK_OPTION_STRING, "-offvalue", "offValue", "OffValue", - "0", Tk_Offset(Checkbutton, checkbutton.offValueObj), -1, + "0", offsetof(Checkbutton, checkbutton.offValueObj), -1, 0,0,0}, {TK_OPTION_STRING, "-command", "command", "Command", - "", Tk_Offset(Checkbutton, checkbutton.commandObj), -1, + "", offsetof(Checkbutton, checkbutton.commandObj), -1, 0,0,0}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -631,17 +631,17 @@ * Option specifications: */ static Tk_OptionSpec RadiobuttonOptionSpecs[] = { {TK_OPTION_STRING, "-variable", "variable", "Variable", - "::selectedButton", Tk_Offset(Radiobutton, radiobutton.variableObj),-1, + "::selectedButton", offsetof(Radiobutton, radiobutton.variableObj),-1, 0,0,0}, {TK_OPTION_STRING, "-value", "Value", "Value", - "1", Tk_Offset(Radiobutton, radiobutton.valueObj), -1, + "1", offsetof(Radiobutton, radiobutton.valueObj), -1, 0,0,0}, {TK_OPTION_STRING, "-command", "command", "Command", - "", Tk_Offset(Radiobutton, radiobutton.commandObj), -1, + "", offsetof(Radiobutton, radiobutton.commandObj), -1, 0,0,0}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -806,13 +806,13 @@ "above", "below", "left", "right", "flush", NULL }; static Tk_OptionSpec MenubuttonOptionSpecs[] = { {TK_OPTION_STRING, "-menu", "menu", "Menu", - "", Tk_Offset(Menubutton, menubutton.menuObj), -1, 0,0,0}, + "", offsetof(Menubutton, menubutton.menuObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", - "below", Tk_Offset(Menubutton, menubutton.directionObj), -1, + "below", offsetof(Menubutton, menubutton.directionObj), -1, 0,(ClientData)directionStrings,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; Index: generic/ttk/ttkClamTheme.c ================================================================== --- generic/ttk/ttkClamTheme.c +++ generic/ttk/ttkClamTheme.c @@ -106,19 +106,19 @@ Tcl_Obj *borderWidthObj; /* See <> */ } BorderElement; static Ttk_ElementOptionSpec BorderElementOptions[] = { { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(BorderElement,borderColorObj), DARKEST_COLOR }, + offsetof(BorderElement,borderColorObj), DARKEST_COLOR }, { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(BorderElement,lightColorObj), LIGHT_COLOR }, + offsetof(BorderElement,lightColorObj), LIGHT_COLOR }, { "-darkcolor", TK_OPTION_COLOR, - Tk_Offset(BorderElement,darkColorObj), DARK_COLOR }, + offsetof(BorderElement,darkColorObj), DARK_COLOR }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(BorderElement,reliefObj), "flat" }, + offsetof(BorderElement,reliefObj), "flat" }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(BorderElement,borderWidthObj), "2" }, + offsetof(BorderElement,borderWidthObj), "2" }, { NULL, 0, 0, NULL } }; /* * <>: -borderwidth is only partially supported: @@ -196,17 +196,17 @@ Tcl_Obj *backgroundObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(FieldElement,borderColorObj), DARKEST_COLOR }, + offsetof(FieldElement,borderColorObj), DARKEST_COLOR }, { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(FieldElement,lightColorObj), LIGHT_COLOR }, + offsetof(FieldElement,lightColorObj), LIGHT_COLOR }, { "-darkcolor", TK_OPTION_COLOR, - Tk_Offset(FieldElement,darkColorObj), DARK_COLOR }, + offsetof(FieldElement,darkColorObj), DARK_COLOR }, { "-fieldbackground", TK_OPTION_BORDER, - Tk_Offset(FieldElement,backgroundObj), "white" }, + offsetof(FieldElement,backgroundObj), "white" }, { NULL, 0, 0, NULL } }; static void FieldElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -278,21 +278,21 @@ Tcl_Obj *lowerColorObj; } IndicatorElement; static Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-indicatorsize", TK_OPTION_PIXELS, - Tk_Offset(IndicatorElement,sizeObj), "10" }, + offsetof(IndicatorElement,sizeObj), "10" }, { "-indicatormargin", TK_OPTION_STRING, - Tk_Offset(IndicatorElement,marginObj), "1" }, + offsetof(IndicatorElement,marginObj), "1" }, { "-indicatorbackground", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,backgroundObj), "white" }, + offsetof(IndicatorElement,backgroundObj), "white" }, { "-indicatorforeground", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,foregroundObj), "black" }, + offsetof(IndicatorElement,foregroundObj), "black" }, { "-upperbordercolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,upperColorObj), DARKEST_COLOR }, + offsetof(IndicatorElement,upperColorObj), DARKEST_COLOR }, { "-lowerbordercolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,lowerColorObj), DARK_COLOR }, + offsetof(IndicatorElement,lowerColorObj), DARK_COLOR }, { NULL, 0, 0, NULL } }; static void IndicatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -400,17 +400,17 @@ } MenuIndicatorElement; static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = { { "-arrowsize", TK_OPTION_PIXELS, - Tk_Offset(MenuIndicatorElement,sizeObj), + offsetof(MenuIndicatorElement,sizeObj), STR(MENUBUTTON_ARROW_SIZE)}, { "-arrowcolor",TK_OPTION_COLOR, - Tk_Offset(MenuIndicatorElement,colorObj), + offsetof(MenuIndicatorElement,colorObj), "black" }, { "-arrowpadding",TK_OPTION_STRING, - Tk_Offset(MenuIndicatorElement,paddingObj), + offsetof(MenuIndicatorElement,paddingObj), "3" }, { NULL, 0, 0, NULL } }; static void MenuIndicatorElementSize( @@ -469,15 +469,15 @@ Tcl_Obj *gripCountObj; } GripElement; static Ttk_ElementOptionSpec GripElementOptions[] = { { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(GripElement,lightColorObj), LIGHT_COLOR }, + offsetof(GripElement,lightColorObj), LIGHT_COLOR }, { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(GripElement,borderColorObj), DARKEST_COLOR }, + offsetof(GripElement,borderColorObj), DARKEST_COLOR }, { "-gripcount", TK_OPTION_INT, - Tk_Offset(GripElement,gripCountObj), "5" }, + offsetof(GripElement,gripCountObj), "5" }, { NULL, 0, 0, NULL } }; static void GripElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -554,29 +554,29 @@ Tcl_Obj *sliderlengthObj; } ScrollbarElement; static Ttk_ElementOptionSpec ScrollbarElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(ScrollbarElement, orientObj), "horizontal" }, + offsetof(ScrollbarElement, orientObj), "horizontal" }, { "-background", TK_OPTION_BORDER, - Tk_Offset(ScrollbarElement,backgroundObj), FRAME_COLOR }, + offsetof(ScrollbarElement,backgroundObj), FRAME_COLOR }, { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(ScrollbarElement,borderColorObj), DARKEST_COLOR }, + offsetof(ScrollbarElement,borderColorObj), DARKEST_COLOR }, { "-troughcolor", TK_OPTION_COLOR, - Tk_Offset(ScrollbarElement,troughColorObj), DARKER_COLOR }, + offsetof(ScrollbarElement,troughColorObj), DARKER_COLOR }, { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(ScrollbarElement,lightColorObj), LIGHT_COLOR }, + offsetof(ScrollbarElement,lightColorObj), LIGHT_COLOR }, { "-darkcolor", TK_OPTION_COLOR, - Tk_Offset(ScrollbarElement,darkColorObj), DARK_COLOR }, + offsetof(ScrollbarElement,darkColorObj), DARK_COLOR }, { "-arrowcolor", TK_OPTION_COLOR, - Tk_Offset(ScrollbarElement,arrowColorObj), "#000000" }, + offsetof(ScrollbarElement,arrowColorObj), "#000000" }, { "-arrowsize", TK_OPTION_PIXELS, - Tk_Offset(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) }, + offsetof(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) }, { "-gripcount", TK_OPTION_INT, - Tk_Offset(ScrollbarElement,gripCountObj), "5" }, + offsetof(ScrollbarElement,gripCountObj), "5" }, { "-sliderlength", TK_OPTION_INT, - Tk_Offset(ScrollbarElement,sliderlengthObj), "30" }, + offsetof(ScrollbarElement,sliderlengthObj), "30" }, { NULL, 0, 0, NULL } }; static void TroughElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -792,17 +792,17 @@ Tcl_Obj *darkColorObj; } NotebookElement; static Ttk_ElementOptionSpec NotebookElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(NotebookElement,backgroundObj), FRAME_COLOR }, + offsetof(NotebookElement,backgroundObj), FRAME_COLOR }, { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(NotebookElement,borderColorObj), DARKEST_COLOR }, + offsetof(NotebookElement,borderColorObj), DARKEST_COLOR }, { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(NotebookElement,lightColorObj), LIGHT_COLOR }, + offsetof(NotebookElement,lightColorObj), LIGHT_COLOR }, { "-darkcolor", TK_OPTION_COLOR, - Tk_Offset(NotebookElement,darkColorObj), DARK_COLOR }, + offsetof(NotebookElement,darkColorObj), DARK_COLOR }, { NULL, 0, 0, NULL } }; static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkClassicTheme.c ================================================================== --- generic/ttk/ttkClassicTheme.c +++ generic/ttk/ttkClassicTheme.c @@ -21,13 +21,13 @@ Tcl_Obj *highlightThicknessObj; } HighlightElement; static Ttk_ElementOptionSpec HighlightElementOptions[] = { { "-highlightcolor",TK_OPTION_COLOR, - Tk_Offset(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND }, + offsetof(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND }, { "-highlightthickness",TK_OPTION_PIXELS, - Tk_Offset(HighlightElement,highlightThicknessObj), "0" }, + offsetof(HighlightElement,highlightThicknessObj), "0" }, { NULL, 0, 0, NULL } }; static void HighlightElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -82,17 +82,17 @@ } ButtonBorderElement; static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(ButtonBorderElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(ButtonBorderElement,borderObj), DEFAULT_BACKGROUND }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(ButtonBorderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(ButtonBorderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(ButtonBorderElement,reliefObj), "flat" }, + offsetof(ButtonBorderElement,reliefObj), "flat" }, { "-default", TK_OPTION_ANY, - Tk_Offset(ButtonBorderElement,defaultStateObj), "disabled" }, + offsetof(ButtonBorderElement,defaultStateObj), "disabled" }, { NULL, 0, 0, NULL } }; static void ButtonBorderElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -195,17 +195,17 @@ Tcl_Obj *reliefObj; } ArrowElement; static Ttk_ElementOptionSpec ArrowElementOptions[] = { - { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,sizeObj), + { "-arrowsize", TK_OPTION_PIXELS, offsetof(ArrowElement,sizeObj), DEFAULT_ARROW_SIZE }, - { "-background", TK_OPTION_BORDER, Tk_Offset(ArrowElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(ArrowElement,borderObj), DEFAULT_BACKGROUND }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,borderWidthObj), + { "-borderwidth", TK_OPTION_PIXELS, offsetof(ArrowElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { "-relief", TK_OPTION_RELIEF, Tk_Offset(ArrowElement,reliefObj),"raised" }, + { "-relief", TK_OPTION_RELIEF, offsetof(ArrowElement,reliefObj),"raised" }, { NULL, 0, 0, NULL } }; static void ArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -303,21 +303,21 @@ Tcl_Obj *handlePadObj; /* handle's distance from edge */ } SashElement; static Ttk_ElementOptionSpec SashOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(SashElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(SashElement,borderObj), DEFAULT_BACKGROUND }, { "-sashrelief", TK_OPTION_RELIEF, - Tk_Offset(SashElement,sashReliefObj), "sunken" }, + offsetof(SashElement,sashReliefObj), "sunken" }, { "-sashthickness", TK_OPTION_PIXELS, - Tk_Offset(SashElement,sashThicknessObj), "6" }, + offsetof(SashElement,sashThicknessObj), "6" }, { "-sashpad", TK_OPTION_PIXELS, - Tk_Offset(SashElement,sashPadObj), "2" }, + offsetof(SashElement,sashPadObj), "2" }, { "-handlesize", TK_OPTION_PIXELS, - Tk_Offset(SashElement,handleSizeObj), "8" }, + offsetof(SashElement,handleSizeObj), "8" }, { "-handlepad", TK_OPTION_PIXELS, - Tk_Offset(SashElement,handlePadObj), "8" }, + offsetof(SashElement,handlePadObj), "8" }, { NULL, 0, 0, NULL } }; static void SashElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkDefaultTheme.c ================================================================== --- generic/ttk/ttkDefaultTheme.c +++ generic/ttk/ttkDefaultTheme.c @@ -243,19 +243,19 @@ Tcl_Obj *reliefObj; Tcl_Obj *defaultStateObj; /* for buttons */ } BorderElement; static Ttk_ElementOptionSpec BorderElementOptions[] = { - { "-background", TK_OPTION_BORDER, Tk_Offset(BorderElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(BorderElement,borderObj), DEFAULT_BACKGROUND }, { "-bordercolor",TK_OPTION_COLOR, - Tk_Offset(BorderElement,borderColorObj), "black" }, - { "-default", TK_OPTION_ANY, Tk_Offset(BorderElement,defaultStateObj), + offsetof(BorderElement,borderColorObj), "black" }, + { "-default", TK_OPTION_ANY, offsetof(BorderElement,defaultStateObj), "disabled" }, - { "-borderwidth",TK_OPTION_PIXELS,Tk_Offset(BorderElement,borderWidthObj), + { "-borderwidth",TK_OPTION_PIXELS, offsetof(BorderElement,borderWidthObj), STRINGIFY(BORDERWIDTH) }, - { "-relief", TK_OPTION_RELIEF, Tk_Offset(BorderElement,reliefObj), + { "-relief", TK_OPTION_RELIEF, offsetof(BorderElement,reliefObj), "flat" }, { NULL, 0, 0, NULL } }; static void BorderElementSize( @@ -323,13 +323,13 @@ Tcl_Obj *borderObj; Tcl_Obj *borderColorObj; /* Extra border color */ } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { - { "-fieldbackground", TK_OPTION_BORDER, Tk_Offset(FieldElement,borderObj), + { "-fieldbackground", TK_OPTION_BORDER, offsetof(FieldElement,borderObj), "white" }, - { "-bordercolor",TK_OPTION_COLOR, Tk_Offset(FieldElement,borderColorObj), + { "-bordercolor",TK_OPTION_COLOR, offsetof(FieldElement,borderColorObj), "black" }, { NULL, 0, 0, NULL } }; static void FieldElementSize( @@ -465,23 +465,23 @@ Tcl_Obj *marginObj; } IndicatorElement; static Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-background", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-foreground", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,foregroundObj), DEFAULT_FOREGROUND }, + offsetof(IndicatorElement,foregroundObj), DEFAULT_FOREGROUND }, { "-indicatorcolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,colorObj), "#FFFFFF" }, + offsetof(IndicatorElement,colorObj), "#FFFFFF" }, { "-lightcolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,lightColorObj), "#DDDDDD" }, + offsetof(IndicatorElement,lightColorObj), "#DDDDDD" }, { "-shadecolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,shadeColorObj), "#888888" }, + offsetof(IndicatorElement,shadeColorObj), "#888888" }, { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(IndicatorElement,borderColorObj), "black" }, + offsetof(IndicatorElement,borderColorObj), "black" }, { "-indicatormargin", TK_OPTION_STRING, - Tk_Offset(IndicatorElement,marginObj), "0 2 4 2" }, + offsetof(IndicatorElement,marginObj), "0 2 4 2" }, { NULL, 0, 0, NULL } }; static void IndicatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -652,19 +652,19 @@ Tcl_Obj *colorObj; /* Arrow color */ } ArrowElement; static Ttk_ElementOptionSpec ArrowElementOptions[] = { { "-arrowsize", TK_OPTION_PIXELS, - Tk_Offset(ArrowElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) }, + offsetof(ArrowElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) }, { "-background", TK_OPTION_BORDER, - Tk_Offset(ArrowElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(ArrowElement,borderObj), DEFAULT_BACKGROUND }, { "-bordercolor", TK_OPTION_COLOR, - Tk_Offset(ArrowElement,borderColorObj), "black" }, + offsetof(ArrowElement,borderColorObj), "black" }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(ArrowElement,reliefObj),"raised"}, + offsetof(ArrowElement,reliefObj),"raised"}, { "-arrowcolor", TK_OPTION_COLOR, - Tk_Offset(ArrowElement,colorObj),"black"}, + offsetof(ArrowElement,colorObj),"black"}, { NULL, 0, 0, NULL } }; /* * Note asymmetric padding: @@ -736,15 +736,15 @@ }; enum { POST_ABOVE, POST_BELOW, POST_LEFT, POST_RIGHT, POST_FLUSH }; static Ttk_ElementOptionSpec MenubuttonArrowElementOptions[] = { { "-direction", TK_OPTION_STRING, - Tk_Offset(MenubuttonArrowElement,directionObj), "below" }, + offsetof(MenubuttonArrowElement,directionObj), "below" }, { "-arrowsize", TK_OPTION_PIXELS, - Tk_Offset(MenubuttonArrowElement,sizeObj), STRINGIFY(MENUBUTTON_ARROW_SIZE)}, + offsetof(MenubuttonArrowElement,sizeObj), STRINGIFY(MENUBUTTON_ARROW_SIZE)}, { "-arrowcolor",TK_OPTION_COLOR, - Tk_Offset(MenubuttonArrowElement,colorObj), "black"}, + offsetof(MenubuttonArrowElement,colorObj), "black"}, { NULL, 0, 0, NULL } }; static Ttk_Padding MenubuttonArrowPadding = { 3, 0, 3, 0 }; @@ -820,19 +820,19 @@ Tcl_Obj *orientObj; } TroughElement; static Ttk_ElementOptionSpec TroughElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(TroughElement, orientObj), "horizontal" }, + offsetof(TroughElement, orientObj), "horizontal" }, { "-troughborderwidth", TK_OPTION_PIXELS, - Tk_Offset(TroughElement,borderWidthObj), "1" }, + offsetof(TroughElement,borderWidthObj), "1" }, { "-troughcolor", TK_OPTION_BORDER, - Tk_Offset(TroughElement,colorObj), DEFAULT_BACKGROUND }, + offsetof(TroughElement,colorObj), DEFAULT_BACKGROUND }, { "-troughrelief",TK_OPTION_RELIEF, - Tk_Offset(TroughElement,reliefObj), "sunken" }, + offsetof(TroughElement,reliefObj), "sunken" }, { "-groovewidth", TK_OPTION_PIXELS, - Tk_Offset(TroughElement,grooveWidthObj), "-1" }, + offsetof(TroughElement,grooveWidthObj), "-1" }, { NULL, 0, 0, NULL } }; static void TroughElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -899,18 +899,18 @@ Tcl_Obj *reliefObj; Tcl_Obj *orientObj; } ThumbElement; static Ttk_ElementOptionSpec ThumbElementOptions[] = { - { "-width", TK_OPTION_PIXELS, Tk_Offset(ThumbElement,sizeObj), + { "-width", TK_OPTION_PIXELS, offsetof(ThumbElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) }, - { "-background", TK_OPTION_BORDER, Tk_Offset(ThumbElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(ThumbElement,borderObj), DEFAULT_BACKGROUND }, - { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(ThumbElement,borderColorObj), + { "-bordercolor", TK_OPTION_COLOR, offsetof(ThumbElement,borderColorObj), "black" }, - { "-relief", TK_OPTION_RELIEF,Tk_Offset(ThumbElement,reliefObj),"raised" }, - { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, + { "-relief", TK_OPTION_RELIEF, offsetof(ThumbElement,reliefObj),"raised" }, + { "-orient", TK_OPTION_ANY, offsetof(ThumbElement,orientObj),"horizontal"}, { NULL, 0, 0, NULL } }; static void ThumbElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -982,23 +982,23 @@ Tcl_Obj *borderWidthObj; Tcl_Obj *orientObj; /* Orientation of overall slider */ } SliderElement; static Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderlength", TK_OPTION_PIXELS, Tk_Offset(SliderElement,lengthObj), + { "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj), "15" }, - { "-sliderthickness",TK_OPTION_PIXELS,Tk_Offset(SliderElement,thicknessObj), + { "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj), "15" }, - { "-sliderrelief", TK_OPTION_RELIEF, Tk_Offset(SliderElement,reliefObj), + { "-sliderrelief", TK_OPTION_RELIEF, offsetof(SliderElement,reliefObj), "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(SliderElement,borderWidthObj), + { "-borderwidth", TK_OPTION_PIXELS, offsetof(SliderElement,borderWidthObj), STRINGIFY(BORDERWIDTH) }, - { "-background", TK_OPTION_BORDER, Tk_Offset(SliderElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(SliderElement,borderObj), DEFAULT_BACKGROUND }, - { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(ThumbElement,borderColorObj), + { "-bordercolor", TK_OPTION_COLOR, offsetof(ThumbElement,borderColorObj), "black" }, - { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), + { "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj), "horizontal" }, { NULL, 0, 0, NULL } }; static void SliderElementSize( @@ -1065,15 +1065,15 @@ Tcl_Obj *diameterObj; } TreeitemIndicator; static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, - Tk_Offset(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, + offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, { "-diameter", TK_OPTION_PIXELS, - Tk_Offset(TreeitemIndicator,diameterObj), "9" }, + offsetof(TreeitemIndicator,diameterObj), "9" }, { "-indicatormargins", TK_OPTION_STRING, - Tk_Offset(TreeitemIndicator,marginObj), "2 2 4 2" }, + offsetof(TreeitemIndicator,marginObj), "2 2 4 2" }, { NULL, 0, 0, NULL } }; static void TreeitemIndicatorSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkElements.c ================================================================== --- generic/ttk/ttkElements.c +++ generic/ttk/ttkElements.c @@ -56,11 +56,11 @@ Tcl_Obj *backgroundObj; } BackgroundElement; static Ttk_ElementOptionSpec BackgroundElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(BackgroundElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(BackgroundElement,backgroundObj), DEFAULT_BACKGROUND }, { NULL, 0, 0, NULL } }; static void FillElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -109,15 +109,15 @@ Tcl_Obj *reliefObj; } BorderElement; static Ttk_ElementOptionSpec BorderElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(BorderElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(BorderElement,borderObj), DEFAULT_BACKGROUND }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(BorderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(BorderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(BorderElement,reliefObj), "flat" }, + offsetof(BorderElement,reliefObj), "flat" }, { NULL, 0, 0, NULL } }; static void BorderElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -164,13 +164,13 @@ Tcl_Obj *borderWidthObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, - Tk_Offset(FieldElement,borderObj), "white" }, + offsetof(FieldElement,borderObj), "white" }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(FieldElement,borderWidthObj), "2" }, + offsetof(FieldElement,borderWidthObj), "2" }, { NULL, 0, 0, NULL } }; static void FieldElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -220,15 +220,15 @@ Tcl_Obj *shiftreliefObj; } PaddingElement; static Ttk_ElementOptionSpec PaddingElementOptions[] = { { "-padding", TK_OPTION_STRING, - Tk_Offset(PaddingElement,paddingObj), "0" }, + offsetof(PaddingElement,paddingObj), "0" }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(PaddingElement,reliefObj), "flat" }, + offsetof(PaddingElement,reliefObj), "flat" }, { "-shiftrelief", TK_OPTION_INT, - Tk_Offset(PaddingElement,shiftreliefObj), "0" }, + offsetof(PaddingElement,shiftreliefObj), "0" }, { NULL, 0, 0, NULL } }; static void PaddingElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -286,13 +286,13 @@ Tk_FreeGC(Tk_Display(tkwin), gc); } static Ttk_ElementOptionSpec FocusElementOptions[] = { { "-focuscolor",TK_OPTION_COLOR, - Tk_Offset(FocusElement,focusColorObj), "black" }, + offsetof(FocusElement,focusColorObj), "black" }, { "-focusthickness",TK_OPTION_PIXELS, - Tk_Offset(FocusElement,focusThicknessObj), "1" }, + offsetof(FocusElement,focusThicknessObj), "1" }, { NULL, 0, 0, NULL } }; static void FocusElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -338,13 +338,13 @@ Tcl_Obj *borderObj; } SeparatorElement; static Ttk_ElementOptionSpec SeparatorElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(SeparatorElement, orientObj), "horizontal" }, + offsetof(SeparatorElement, orientObj), "horizontal" }, { "-background", TK_OPTION_BORDER, - Tk_Offset(SeparatorElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(SeparatorElement,borderObj), DEFAULT_BACKGROUND }, { NULL, 0, 0, NULL } }; static void SeparatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -430,11 +430,11 @@ Tcl_Obj *backgroundObj; } SizegripElement; static Ttk_ElementOptionSpec SizegripOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, {0,0,0,0} }; static void SizegripSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -491,21 +491,21 @@ Tcl_Obj *borderWidthObj; } IndicatorElement; static Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-indicatorcolor", TK_OPTION_BORDER, - Tk_Offset(IndicatorElement,colorObj), DEFAULT_BACKGROUND }, + offsetof(IndicatorElement,colorObj), DEFAULT_BACKGROUND }, { "-indicatorrelief", TK_OPTION_RELIEF, - Tk_Offset(IndicatorElement,reliefObj), "raised" }, + offsetof(IndicatorElement,reliefObj), "raised" }, { "-indicatordiameter", TK_OPTION_PIXELS, - Tk_Offset(IndicatorElement,diameterObj), "12" }, + offsetof(IndicatorElement,diameterObj), "12" }, { "-indicatormargin", TK_OPTION_STRING, - Tk_Offset(IndicatorElement,marginObj), "0 2 4 2" }, + offsetof(IndicatorElement,marginObj), "0 2 4 2" }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(IndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(IndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { NULL, 0, 0, NULL } }; /* * Checkbutton indicators (default): 3-D square. @@ -637,21 +637,21 @@ Tcl_Obj *marginObj; } MenuIndicatorElement; static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(MenuIndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(MenuIndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-indicatorwidth", TK_OPTION_PIXELS, - Tk_Offset(MenuIndicatorElement,widthObj), "4.0m" }, + offsetof(MenuIndicatorElement,widthObj), "4.0m" }, { "-indicatorheight", TK_OPTION_PIXELS, - Tk_Offset(MenuIndicatorElement,heightObj), "1.7m" }, + offsetof(MenuIndicatorElement,heightObj), "1.7m" }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(MenuIndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(MenuIndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-indicatorrelief", TK_OPTION_RELIEF, - Tk_Offset(MenuIndicatorElement,reliefObj),"raised" }, + offsetof(MenuIndicatorElement,reliefObj),"raised" }, { "-indicatormargin", TK_OPTION_STRING, - Tk_Offset(MenuIndicatorElement,marginObj), "5 0" }, + offsetof(MenuIndicatorElement,marginObj), "5 0" }, { NULL, 0, 0, NULL } }; static void MenuIndicatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -706,19 +706,19 @@ Tcl_Obj *colorObj; } ArrowElement; static Ttk_ElementOptionSpec ArrowElementOptions[] = { { "-background", TK_OPTION_BORDER, - Tk_Offset(ArrowElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(ArrowElement,borderObj), DEFAULT_BACKGROUND }, { "-relief",TK_OPTION_RELIEF, - Tk_Offset(ArrowElement,reliefObj),"raised"}, + offsetof(ArrowElement,reliefObj),"raised"}, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(ArrowElement,borderWidthObj), "1" }, + offsetof(ArrowElement,borderWidthObj), "1" }, { "-arrowcolor",TK_OPTION_COLOR, - Tk_Offset(ArrowElement,colorObj),"black"}, + offsetof(ArrowElement,colorObj),"black"}, { "-arrowsize", TK_OPTION_PIXELS, - Tk_Offset(ArrowElement,sizeObj), "14" }, + offsetof(ArrowElement,sizeObj), "14" }, { NULL, 0, 0, NULL } }; static Ttk_Padding ArrowMargins = { 3,3,3,3 }; @@ -777,15 +777,15 @@ Tcl_Obj *reliefObj; } TroughElement; static Ttk_ElementOptionSpec TroughElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(TroughElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(TroughElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-troughcolor", TK_OPTION_BORDER, - Tk_Offset(TroughElement,colorObj), DEFAULT_BACKGROUND }, + offsetof(TroughElement,colorObj), DEFAULT_BACKGROUND }, { "-troughrelief",TK_OPTION_RELIEF, - Tk_Offset(TroughElement,reliefObj), "sunken" }, + offsetof(TroughElement,reliefObj), "sunken" }, { NULL, 0, 0, NULL } }; static void TroughElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -837,19 +837,19 @@ Tcl_Obj *borderWidthObj; } ThumbElement; static Ttk_ElementOptionSpec ThumbElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(ThumbElement, orientObj), "horizontal" }, + offsetof(ThumbElement, orientObj), "horizontal" }, { "-width", TK_OPTION_PIXELS, - Tk_Offset(ThumbElement,thicknessObj), DEFAULT_ARROW_SIZE }, + offsetof(ThumbElement,thicknessObj), DEFAULT_ARROW_SIZE }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(ThumbElement,reliefObj), "raised" }, + offsetof(ThumbElement,reliefObj), "raised" }, { "-background", TK_OPTION_BORDER, - Tk_Offset(ThumbElement,borderObj), DEFAULT_BACKGROUND }, + offsetof(ThumbElement,borderObj), DEFAULT_BACKGROUND }, { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(ThumbElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + offsetof(ThumbElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { NULL, 0, 0, NULL } }; static void ThumbElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -907,21 +907,21 @@ Tcl_Obj *borderObj; /* the background color */ Tcl_Obj *borderWidthObj; /* the size of the border */ } SliderElement; static Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderlength", TK_OPTION_PIXELS, Tk_Offset(SliderElement,lengthObj), + { "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj), "30" }, - { "-sliderthickness",TK_OPTION_PIXELS,Tk_Offset(SliderElement,thicknessObj), + { "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj), "15" }, - { "-sliderrelief", TK_OPTION_RELIEF, Tk_Offset(SliderElement,reliefObj), + { "-sliderrelief", TK_OPTION_RELIEF, offsetof(SliderElement,reliefObj), "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(SliderElement,borderWidthObj), + { "-borderwidth", TK_OPTION_PIXELS, offsetof(SliderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { "-background", TK_OPTION_BORDER, Tk_Offset(SliderElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(SliderElement,borderObj), DEFAULT_BACKGROUND }, - { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), + { "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj), "horizontal" }, { NULL, 0, 0, NULL } }; static void SliderElementSize( @@ -1018,21 +1018,21 @@ Tcl_Obj *borderObj; /* background color */ Tcl_Obj *borderWidthObj; /* thickness of the border */ } PbarElement; static Ttk_ElementOptionSpec PbarElementOptions[] = { - { "-orient", TK_OPTION_ANY, Tk_Offset(PbarElement,orientObj), + { "-orient", TK_OPTION_ANY, offsetof(PbarElement,orientObj), "horizontal" }, - { "-thickness", TK_OPTION_PIXELS, Tk_Offset(PbarElement,thicknessObj), + { "-thickness", TK_OPTION_PIXELS, offsetof(PbarElement,thicknessObj), DEFAULT_PBAR_THICKNESS }, - { "-barsize", TK_OPTION_PIXELS, Tk_Offset(PbarElement,lengthObj), + { "-barsize", TK_OPTION_PIXELS, offsetof(PbarElement,lengthObj), DEFAULT_PBAR_LENGTH }, - { "-pbarrelief", TK_OPTION_RELIEF, Tk_Offset(PbarElement,reliefObj), + { "-pbarrelief", TK_OPTION_RELIEF, offsetof(PbarElement,reliefObj), "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(PbarElement,borderWidthObj), + { "-borderwidth", TK_OPTION_PIXELS, offsetof(PbarElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { "-background", TK_OPTION_BORDER, Tk_Offset(PbarElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(PbarElement,borderObj), DEFAULT_BACKGROUND }, { NULL, 0, 0, NULL } }; static void PbarElementSize( @@ -1092,13 +1092,13 @@ Tcl_Obj *backgroundObj; } TabElement; static Ttk_ElementOptionSpec TabElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(TabElement,borderWidthObj),"1" }, + offsetof(TabElement,borderWidthObj),"1" }, { "-background", TK_OPTION_BORDER, - Tk_Offset(TabElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(TabElement,backgroundObj), DEFAULT_BACKGROUND }, {0,0,0,0} }; static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkEntry.c ================================================================== --- generic/ttk/ttkEntry.c +++ generic/ttk/ttkEntry.c @@ -154,57 +154,57 @@ #define DEF_ENTRY_FONT "TkTextFont" #define DEF_LIST_HEIGHT "10" static Tk_OptionSpec EntryOptionSpecs[] = { {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", - "ExportSelection", "1", -1, Tk_Offset(Entry, entry.exportSelection), + "ExportSelection", "1", -1, offsetof(Entry, entry.exportSelection), 0,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - DEF_ENTRY_FONT, Tk_Offset(Entry, entry.fontObj),-1, + DEF_ENTRY_FONT, offsetof(Entry, entry.fontObj),-1, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", - NULL, -1, Tk_Offset(Entry, entry.invalidCmd), + NULL, -1, offsetof(Entry, entry.invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", -1, Tk_Offset(Entry, entry.justify), + "left", -1, offsetof(Entry, entry.justify), 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder", - NULL, Tk_Offset(Entry, entry.placeholderObj), -1, + NULL, offsetof(Entry, entry.placeholderObj), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-show", "show", "Show", - NULL, -1, Tk_Offset(Entry, entry.showChar), + NULL, -1, offsetof(Entry, entry.showChar), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-state", "state", "State", - "normal", Tk_Offset(Entry, entry.stateObj), -1, + "normal", offsetof(Entry, entry.stateObj), -1, 0,0,STATE_CHANGED}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", - NULL, Tk_Offset(Entry, entry.textVariableObj), -1, + NULL, offsetof(Entry, entry.textVariableObj), -1, TK_OPTION_NULL_OK,0,TEXTVAR_CHANGED}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", - "none", -1, Tk_Offset(Entry, entry.validate), + "none", -1, offsetof(Entry, entry.validate), 0, (ClientData) validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand", - NULL, -1, Tk_Offset(Entry, entry.validateCmd), + NULL, -1, offsetof(Entry, entry.validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INT, "-width", "width", "Width", - DEF_ENTRY_WIDTH, Tk_Offset(Entry, entry.widthObj), -1, + DEF_ENTRY_WIDTH, offsetof(Entry, entry.widthObj), -1, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - NULL, -1, Tk_Offset(Entry, entry.xscroll.scrollCmd), + NULL, -1, offsetof(Entry, entry.xscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, /* EntryStyleData options: */ {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor", - NULL, Tk_Offset(Entry, entry.styleData.backgroundObj), -1, + NULL, offsetof(Entry, entry.styleData.backgroundObj), -1, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, Tk_Offset(Entry, entry.styleData.foregroundObj), -1, + NULL, offsetof(Entry, entry.styleData.foregroundObj), -1, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground", "PlaceholderForeground", NULL, - Tk_Offset(Entry, entry.styleData.placeholderForegroundObj), -1, + offsetof(Entry, entry.styleData.placeholderForegroundObj), -1, TK_OPTION_NULL_OK,0,0}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -1768,17 +1768,17 @@ ComboboxPart combobox; } Combobox; static Tk_OptionSpec ComboboxOptionSpecs[] = { {TK_OPTION_STRING, "-height", "height", "Height", - DEF_LIST_HEIGHT, Tk_Offset(Combobox, combobox.heightObj), -1, + DEF_LIST_HEIGHT, offsetof(Combobox, combobox.heightObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-postcommand", "postCommand", "PostCommand", - "", Tk_Offset(Combobox, combobox.postCommandObj), -1, + "", offsetof(Combobox, combobox.postCommandObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-values", "values", "Values", - "", Tk_Offset(Combobox, combobox.valuesObj), -1, + "", offsetof(Combobox, combobox.valuesObj), -1, 0,0,0 }, WIDGET_INHERIT_OPTIONS(EntryOptionSpecs) }; /* ComboboxInitialize -- @@ -1959,31 +1959,31 @@ SpinboxPart spinbox; } Spinbox; static Tk_OptionSpec SpinboxOptionSpecs[] = { {TK_OPTION_STRING, "-values", "values", "Values", - "", Tk_Offset(Spinbox, spinbox.valuesObj), -1, + "", offsetof(Spinbox, spinbox.valuesObj), -1, 0,0,0 }, {TK_OPTION_DOUBLE, "-from", "from", "From", - "0", Tk_Offset(Spinbox,spinbox.fromObj), -1, + "0", offsetof(Spinbox,spinbox.fromObj), -1, 0,0,0 }, {TK_OPTION_DOUBLE, "-to", "to", "To", - "0", Tk_Offset(Spinbox,spinbox.toObj), -1, + "0", offsetof(Spinbox,spinbox.toObj), -1, 0,0,0 }, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", - "1", Tk_Offset(Spinbox,spinbox.incrementObj), -1, + "1", offsetof(Spinbox,spinbox.incrementObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-format", "format", "Format", - "", Tk_Offset(Spinbox, spinbox.formatObj), -1, + "", offsetof(Spinbox, spinbox.formatObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-command", "command", "Command", - "", Tk_Offset(Spinbox, spinbox.commandObj), -1, + "", offsetof(Spinbox, spinbox.commandObj), -1, 0,0,0 }, {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap", - "0", Tk_Offset(Spinbox,spinbox.wrapObj), -1, + "0", offsetof(Spinbox,spinbox.wrapObj), -1, 0,0,0 }, WIDGET_INHERIT_OPTIONS(EntryOptionSpecs) }; @@ -2061,13 +2061,13 @@ Tcl_Obj *widthObj; } TextareaElement; static Ttk_ElementOptionSpec TextareaElementOptions[] = { { "-font", TK_OPTION_FONT, - Tk_Offset(TextareaElement,fontObj), DEF_ENTRY_FONT }, + offsetof(TextareaElement,fontObj), DEF_ENTRY_FONT }, { "-width", TK_OPTION_INT, - Tk_Offset(TextareaElement,widthObj), "20" }, + offsetof(TextareaElement,widthObj), "20" }, { NULL, 0, 0, NULL } }; static void TextareaElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkFrame.c ================================================================== --- generic/ttk/ttkFrame.c +++ generic/ttk/ttkFrame.c @@ -26,23 +26,23 @@ FramePart frame; } Frame; static Tk_OptionSpec FrameOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", NULL, - Tk_Offset(Frame,frame.borderWidthObj), -1, + offsetof(Frame,frame.borderWidthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, - Tk_Offset(Frame,frame.paddingObj), -1, + offsetof(Frame,frame.paddingObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", NULL, - Tk_Offset(Frame,frame.reliefObj), -1, + offsetof(Frame,frame.reliefObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_PIXELS, "-width", "width", "Width", "0", - Tk_Offset(Frame,frame.widthObj), -1, + offsetof(Frame,frame.widthObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-height", "height", "Height", "0", - Tk_Offset(Frame,frame.heightObj), -1, + offsetof(Frame,frame.heightObj), -1, 0,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -247,20 +247,20 @@ #define LABELWIDGET_CHANGED 0x100 static Tk_OptionSpec LabelframeOptionSpecs[] = { {TK_OPTION_STRING, "-labelanchor", "labelAnchor", "LabelAnchor", - "nw", Tk_Offset(Labelframe, label.labelAnchorObj),-1, + "nw", offsetof(Labelframe, label.labelAnchorObj),-1, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-text", "text", "Text", "", - Tk_Offset(Labelframe,label.textObj), -1, + offsetof(Labelframe,label.textObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", - "-1", Tk_Offset(Labelframe,label.underlineObj), -1, + "-1", offsetof(Labelframe,label.underlineObj), -1, 0,0,0 }, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", NULL, - -1, Tk_Offset(Labelframe,label.labelWidget), + -1, offsetof(Labelframe,label.labelWidget), TK_OPTION_NULL_OK,0,LABELWIDGET_CHANGED|GEOMETRY_CHANGED }, WIDGET_INHERIT_OPTIONS(FrameOptionSpecs) }; Index: generic/ttk/ttkInit.c ================================================================== --- generic/ttk/ttkInit.c +++ generic/ttk/ttkInit.c @@ -176,15 +176,15 @@ /* public */ Tk_OptionSpec ttkCoreOptionSpecs[] = { {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", NULL, - Tk_Offset(WidgetCore, cursorObj), -1, TK_OPTION_NULL_OK,0,0 }, + offsetof(WidgetCore, cursorObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "-style", "style", "Style", "", - Tk_Offset(WidgetCore,styleObj), -1, 0,0,STYLE_CHANGED}, + offsetof(WidgetCore,styleObj), -1, 0,0,STYLE_CHANGED}, {TK_OPTION_STRING, "-class", "", "", NULL, - Tk_Offset(WidgetCore,classObj), -1, 0,0,READONLY_OPTION}, + offsetof(WidgetCore,classObj), -1, 0,0,READONLY_OPTION}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /*------------------------------------------------------------------------ * +++ Initialization: elements and element factories. Index: generic/ttk/ttkLabel.c ================================================================== --- generic/ttk/ttkLabel.c +++ generic/ttk/ttkLabel.c @@ -46,27 +46,27 @@ /* Text element options table. * NB: Keep in sync with label element option table. */ static Ttk_ElementOptionSpec TextElementOptions[] = { { "-text", TK_OPTION_STRING, - Tk_Offset(TextElement,textObj), "" }, + offsetof(TextElement,textObj), "" }, { "-font", TK_OPTION_FONT, - Tk_Offset(TextElement,fontObj), DEFAULT_FONT }, + offsetof(TextElement,fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, - Tk_Offset(TextElement,foregroundObj), "black" }, + offsetof(TextElement,foregroundObj), "black" }, { "-underline", TK_OPTION_INT, - Tk_Offset(TextElement,underlineObj), "-1"}, + offsetof(TextElement,underlineObj), "-1"}, { "-width", TK_OPTION_INT, - Tk_Offset(TextElement,widthObj), "-1"}, + offsetof(TextElement,widthObj), "-1"}, { "-anchor", TK_OPTION_ANCHOR, - Tk_Offset(TextElement,anchorObj), "w"}, + offsetof(TextElement,anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, - Tk_Offset(TextElement,justifyObj), "left" }, + offsetof(TextElement,justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, - Tk_Offset(TextElement,wrapLengthObj), "0" }, + offsetof(TextElement,wrapLengthObj), "0" }, { "-embossed", TK_OPTION_INT, - Tk_Offset(TextElement,embossedObj), "0"}, + offsetof(TextElement,embossedObj), "0"}, { NULL, 0, 0, NULL } }; static int TextSetup(TextElement *text, Tk_Window tkwin) { @@ -246,15 +246,15 @@ /* ===> NB: Keep in sync with label element option table. <=== */ static Ttk_ElementOptionSpec ImageElementOptions[] = { { "-image", TK_OPTION_STRING, - Tk_Offset(ImageElement,imageObj), "" }, + offsetof(ImageElement,imageObj), "" }, { "-stipple", TK_OPTION_STRING, /* Really: TK_OPTION_BITMAP */ - Tk_Offset(ImageElement,stippleObj), "gray50" }, + offsetof(ImageElement,stippleObj), "gray50" }, { "-background", TK_OPTION_COLOR, - Tk_Offset(ImageElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(ImageElement,backgroundObj), DEFAULT_BACKGROUND }, { NULL, 0, 0, NULL } }; /* * ImageSetup() -- @@ -440,45 +440,45 @@ int totalWidth, totalHeight; } LabelElement; static Ttk_ElementOptionSpec LabelElementOptions[] = { { "-compound", TK_OPTION_ANY, - Tk_Offset(LabelElement,compoundObj), "none" }, + offsetof(LabelElement,compoundObj), "none" }, { "-space", TK_OPTION_PIXELS, - Tk_Offset(LabelElement,spaceObj), "4" }, + offsetof(LabelElement,spaceObj), "4" }, /* Text element part: * NB: Keep in sync with TextElementOptions. */ { "-text", TK_OPTION_STRING, - Tk_Offset(LabelElement,text.textObj), "" }, + offsetof(LabelElement,text.textObj), "" }, { "-font", TK_OPTION_FONT, - Tk_Offset(LabelElement,text.fontObj), DEFAULT_FONT }, + offsetof(LabelElement,text.fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, - Tk_Offset(LabelElement,text.foregroundObj), "black" }, + offsetof(LabelElement,text.foregroundObj), "black" }, { "-underline", TK_OPTION_INT, - Tk_Offset(LabelElement,text.underlineObj), "-1"}, + offsetof(LabelElement,text.underlineObj), "-1"}, { "-width", TK_OPTION_INT, - Tk_Offset(LabelElement,text.widthObj), ""}, + offsetof(LabelElement,text.widthObj), ""}, { "-anchor", TK_OPTION_ANCHOR, - Tk_Offset(LabelElement,text.anchorObj), "w"}, + offsetof(LabelElement,text.anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, - Tk_Offset(LabelElement,text.justifyObj), "left" }, + offsetof(LabelElement,text.justifyObj), "left" }, { "-wraplength", TK_OPTION_PIXELS, - Tk_Offset(LabelElement,text.wrapLengthObj), "0" }, + offsetof(LabelElement,text.wrapLengthObj), "0" }, { "-embossed", TK_OPTION_INT, - Tk_Offset(LabelElement,text.embossedObj), "0"}, + offsetof(LabelElement,text.embossedObj), "0"}, /* Image element part: * NB: Keep in sync with ImageElementOptions. */ { "-image", TK_OPTION_STRING, - Tk_Offset(LabelElement,image.imageObj), "" }, + offsetof(LabelElement,image.imageObj), "" }, { "-stipple", TK_OPTION_STRING, /* Really: TK_OPTION_BITMAP */ - Tk_Offset(LabelElement,image.stippleObj), "gray50" }, + offsetof(LabelElement,image.stippleObj), "gray50" }, { "-background", TK_OPTION_COLOR, - Tk_Offset(LabelElement,image.backgroundObj), DEFAULT_BACKGROUND }, + offsetof(LabelElement,image.backgroundObj), DEFAULT_BACKGROUND }, { NULL, 0, 0, NULL } }; /* * LabelSetup -- Index: generic/ttk/ttkNotebook.c ================================================================== --- generic/ttk/ttkNotebook.c +++ generic/ttk/ttkNotebook.c @@ -56,30 +56,30 @@ * and is used to configure the slave. */ static Tk_OptionSpec TabOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-state", "", "", - "normal", -1,Tk_Offset(Tab,state), + "normal", -1, offsetof(Tab,state), 0,(ClientData)TabStateStrings,0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", - Tk_Offset(Tab,textObj), -1, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,textObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, - Tk_Offset(Tab,imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + offsetof(Tab,imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - "none", Tk_Offset(Tab,compoundObj), -1, + "none", offsetof(Tab,compoundObj), -1, 0,(ClientData)ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", "-1", - Tk_Offset(Tab,underlineObj), -1, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,underlineObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } }; static Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_STRING, "-padding", "padding", "Padding", "0", - Tk_Offset(Tab,paddingObj), -1, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,paddingObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-sticky", "sticky", "Sticky", "nsew", - Tk_Offset(Tab,stickyObj), -1, 0,0,GEOMETRY_CHANGED }, + offsetof(Tab,stickyObj), -1, 0,0,GEOMETRY_CHANGED }, WIDGET_INHERIT_OPTIONS(TabOptionSpecs) }; /*------------------------------------------------------------------------ @@ -108,17 +108,17 @@ } Notebook; static Tk_OptionSpec NotebookOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", "0", - Tk_Offset(Notebook,notebook.widthObj),-1, + offsetof(Notebook,notebook.widthObj),-1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-height", "height", "Height", "0", - Tk_Offset(Notebook,notebook.heightObj),-1, + offsetof(Notebook,notebook.heightObj),-1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Padding", NULL, - Tk_Offset(Notebook,notebook.paddingObj),-1, + offsetof(Notebook,notebook.paddingObj),-1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; Index: generic/ttk/ttkPanedwindow.c ================================================================== --- generic/ttk/ttkPanedwindow.c +++ generic/ttk/ttkPanedwindow.c @@ -74,17 +74,17 @@ /* @@@ NOTE: -orient is readonly 'cause dynamic oriention changes NYI */ static Tk_OptionSpec PanedOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", - Tk_Offset(Paned,paned.orientObj), Tk_Offset(Paned,paned.orient), + offsetof(Paned,paned.orientObj), offsetof(Paned,paned.orient), 0,(ClientData)ttkOrientStrings,READONLY_OPTION|STYLE_CHANGED }, {TK_OPTION_INT, "-width", "width", "Width", "0", - -1,Tk_Offset(Paned,paned.width), + -1, offsetof(Paned,paned.width), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-height", "height", "Height", "0", - -1,Tk_Offset(Paned,paned.height), + -1, offsetof(Paned,paned.height), 0,0,GEOMETRY_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -98,11 +98,11 @@ int weight; /* Pane -weight, for resizing */ } Pane; static Tk_OptionSpec PaneOptionSpecs[] = { {TK_OPTION_INT, "-weight", "weight", "Weight", "0", - -1,Tk_Offset(Pane,weight), 0,0,GEOMETRY_CHANGED }, + -1, offsetof(Pane,weight), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; /* CreatePane -- * Create a new pane record. @@ -920,11 +920,11 @@ Tcl_Obj *thicknessObj; } SashElement; static Ttk_ElementOptionSpec SashElementOptions[] = { { "-sashthickness", TK_OPTION_INT, - Tk_Offset(SashElement,thicknessObj), "5" }, + offsetof(SashElement,thicknessObj), "5" }, { NULL, 0, 0, NULL } }; static void SashElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkProgress.c ================================================================== --- generic/ttk/ttkProgress.c +++ generic/ttk/ttkProgress.c @@ -49,48 +49,48 @@ } Progressbar; static Tk_OptionSpec ProgressbarOptionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "w", Tk_Offset(Progressbar,progress.anchorObj), -1, + "w", offsetof(Progressbar,progress.anchorObj), -1, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, {TK_OPTION_FONT, "-font", "font", "Font", - DEFAULT_FONT, Tk_Offset(Progressbar,progress.fontObj), -1, + DEFAULT_FONT, offsetof(Progressbar,progress.fontObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - "black", Tk_Offset(Progressbar,progress.foregroundObj), -1, + "black", offsetof(Progressbar,progress.foregroundObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", Tk_Offset(Progressbar,progress.justifyObj), -1, + "left", offsetof(Progressbar,progress.justifyObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_PROGRESSBAR_LENGTH, Tk_Offset(Progressbar,progress.lengthObj), -1, + DEF_PROGRESSBAR_LENGTH, offsetof(Progressbar,progress.lengthObj), -1, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_DOUBLE, "-maximum", "maximum", "Maximum", - "100", Tk_Offset(Progressbar,progress.maximumObj), -1, + "100", offsetof(Progressbar,progress.maximumObj), -1, 0, 0, 0 }, {TK_OPTION_STRING_TABLE, "-mode", "mode", "ProgressMode", "determinate", - Tk_Offset(Progressbar,progress.modeObj), - Tk_Offset(Progressbar,progress.mode), + offsetof(Progressbar,progress.modeObj), + offsetof(Progressbar,progress.mode), 0, (ClientData)ProgressbarModeStrings, 0 }, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", - "horizontal", Tk_Offset(Progressbar,progress.orientObj), -1, + "horizontal", offsetof(Progressbar,progress.orientObj), -1, 0, (ClientData)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_INT, "-phase", "phase", "Phase", - "0", Tk_Offset(Progressbar,progress.phaseObj), -1, + "0", offsetof(Progressbar,progress.phaseObj), -1, 0, 0, 0 }, {TK_OPTION_STRING, "-text", "text", "Text", "", - Tk_Offset(Progressbar,progress.textObj), -1, + offsetof(Progressbar,progress.textObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_DOUBLE, "-value", "value", "Value", - "0.0", Tk_Offset(Progressbar,progress.valueObj), -1, + "0.0", offsetof(Progressbar,progress.valueObj), -1, 0, 0, 0 }, {TK_OPTION_STRING, "-variable", "variable", "Variable", - NULL, Tk_Offset(Progressbar,progress.variableObj), -1, + NULL, offsetof(Progressbar,progress.variableObj), -1, TK_OPTION_NULL_OK, 0, 0 }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - "0", Tk_Offset(Progressbar, progress.wrapLengthObj), -1, + "0", offsetof(Progressbar, progress.wrapLengthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED}, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; Index: generic/ttk/ttkScale.c ================================================================== --- generic/ttk/ttkScale.c +++ generic/ttk/ttkScale.c @@ -51,32 +51,32 @@ } Scale; static Tk_OptionSpec ScaleOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - Tk_Offset(Scale,scale.commandObj), -1, + offsetof(Scale,scale.commandObj), -1, TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", "", - Tk_Offset(Scale,scale.variableObj), -1, + offsetof(Scale,scale.variableObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", - Tk_Offset(Scale,scale.orientObj), - Tk_Offset(Scale,scale.orient), 0, + offsetof(Scale,scale.orientObj), + offsetof(Scale,scale.orient), 0, (ClientData)ttkOrientStrings, STYLE_CHANGED }, {TK_OPTION_DOUBLE, "-from", "from", "From", "0", - Tk_Offset(Scale,scale.fromObj), -1, 0, 0, 0}, + offsetof(Scale,scale.fromObj), -1, 0, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", "1.0", - Tk_Offset(Scale,scale.toObj), -1, 0, 0, 0}, + offsetof(Scale,scale.toObj), -1, 0, 0, 0}, {TK_OPTION_DOUBLE, "-value", "value", "Value", "0", - Tk_Offset(Scale,scale.valueObj), -1, 0, 0, 0}, + offsetof(Scale,scale.valueObj), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_SCALE_LENGTH, Tk_Offset(Scale,scale.lengthObj), -1, 0, 0, + DEF_SCALE_LENGTH, offsetof(Scale,scale.lengthObj), -1, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-state", "state", "State", - "normal", Tk_Offset(Scale,scale.stateObj), -1, + "normal", offsetof(Scale,scale.stateObj), -1, 0,0,STATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; Index: generic/ttk/ttkScrollbar.c ================================================================== --- generic/ttk/ttkScrollbar.c +++ generic/ttk/ttkScrollbar.c @@ -32,15 +32,15 @@ } Scrollbar; static Tk_OptionSpec ScrollbarOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - Tk_Offset(Scrollbar,scrollbar.commandObj), -1, 0,0,0}, + offsetof(Scrollbar,scrollbar.commandObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", - Tk_Offset(Scrollbar,scrollbar.orientObj), - Tk_Offset(Scrollbar,scrollbar.orient), + offsetof(Scrollbar,scrollbar.orientObj), + offsetof(Scrollbar,scrollbar.orient), 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; Index: generic/ttk/ttkSeparator.c ================================================================== --- generic/ttk/ttkSeparator.c +++ generic/ttk/ttkSeparator.c @@ -22,12 +22,12 @@ SeparatorPart separator; } Separator; static Tk_OptionSpec SeparatorOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", - Tk_Offset(Separator,separator.orientObj), - Tk_Offset(Separator,separator.orient), + offsetof(Separator,separator.orientObj), + offsetof(Separator,separator.orient), 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; Index: generic/ttk/ttkSquare.c ================================================================== --- generic/ttk/ttkSquare.c +++ generic/ttk/ttkSquare.c @@ -49,32 +49,32 @@ */ static Tk_OptionSpec SquareOptionSpecs[] = { {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEFAULT_BORDERWIDTH, Tk_Offset(Square,square.borderWidthObj), -1, + DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", - DEFAULT_BACKGROUND, Tk_Offset(Square,square.foregroundObj), + DEFAULT_BACKGROUND, offsetof(Square,square.foregroundObj), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - "50", Tk_Offset(Square,square.widthObj), -1, 0, 0, + "50", offsetof(Square,square.widthObj), -1, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_PIXELS, "-height", "height", "Height", - "50", Tk_Offset(Square,square.heightObj), -1, 0, 0, + "50", offsetof(Square,square.heightObj), -1, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, - Tk_Offset(Square,square.paddingObj), -1, + offsetof(Square,square.paddingObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - NULL, Tk_Offset(Square,square.reliefObj), -1, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(Square,square.reliefObj), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, Tk_Offset(Square,square.anchorObj), -1, TK_OPTION_NULL_OK, 0, 0}, + NULL, offsetof(Square,square.anchorObj), -1, TK_OPTION_NULL_OK, 0, 0}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -176,20 +176,20 @@ Tcl_Obj *heightObj; } SquareElement; static Ttk_ElementOptionSpec SquareElementOptions[] = { - { "-background", TK_OPTION_BORDER, Tk_Offset(SquareElement,borderObj), + { "-background", TK_OPTION_BORDER, offsetof(SquareElement,borderObj), DEFAULT_BACKGROUND }, - { "-foreground", TK_OPTION_BORDER, Tk_Offset(SquareElement,foregroundObj), + { "-foreground", TK_OPTION_BORDER, offsetof(SquareElement,foregroundObj), DEFAULT_BACKGROUND }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(SquareElement,borderWidthObj), + { "-borderwidth", TK_OPTION_PIXELS, offsetof(SquareElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { "-relief", TK_OPTION_RELIEF, Tk_Offset(SquareElement,reliefObj), + { "-relief", TK_OPTION_RELIEF, offsetof(SquareElement,reliefObj), "raised" }, - { "-width", TK_OPTION_PIXELS, Tk_Offset(SquareElement,widthObj), "20"}, - { "-height", TK_OPTION_PIXELS, Tk_Offset(SquareElement,heightObj), "20"}, + { "-width", TK_OPTION_PIXELS, offsetof(SquareElement,widthObj), "20"}, + { "-height", TK_OPTION_PIXELS, offsetof(SquareElement,heightObj), "20"}, { NULL, 0, 0, NULL } }; /* * The element geometry function is called when the layout code wishes to Index: generic/ttk/ttkTreeview.c ================================================================== --- generic/ttk/ttkTreeview.c +++ generic/ttk/ttkTreeview.c @@ -59,23 +59,23 @@ #define ITEM_OPTION_TAGS_CHANGED 0x100 #define ITEM_OPTION_IMAGE_CHANGED 0x200 static Tk_OptionSpec ItemOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - "", Tk_Offset(TreeItem,textObj), -1, + "", offsetof(TreeItem,textObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - NULL, Tk_Offset(TreeItem,imageObj), -1, + NULL, offsetof(TreeItem,imageObj), -1, TK_OPTION_NULL_OK,0,ITEM_OPTION_IMAGE_CHANGED }, {TK_OPTION_STRING, "-values", "values", "Values", - NULL, Tk_Offset(TreeItem,valuesObj), -1, + NULL, offsetof(TreeItem,valuesObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_BOOLEAN, "-open", "open", "Open", - "0", Tk_Offset(TreeItem,openObj), -1, + "0", offsetof(TreeItem,openObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-tags", "tags", "Tags", - NULL, Tk_Offset(TreeItem,tagsObj), -1, + NULL, offsetof(TreeItem,tagsObj), -1, TK_OPTION_NULL_OK,0,ITEM_OPTION_TAGS_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; @@ -187,26 +187,26 @@ Tcl_Obj *fontObj; } DisplayItem; static Tk_OptionSpec TagOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - NULL, Tk_Offset(DisplayItem,textObj), -1, + NULL, offsetof(DisplayItem,textObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - NULL, Tk_Offset(DisplayItem,imageObj), -1, + NULL, offsetof(DisplayItem,imageObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - NULL, Tk_Offset(DisplayItem,anchorObj), -1, + NULL, offsetof(DisplayItem,anchorObj), -1, TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, /* <> */ {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor", - NULL, Tk_Offset(DisplayItem,backgroundObj), -1, + NULL, offsetof(DisplayItem,backgroundObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", - NULL, Tk_Offset(DisplayItem,foregroundObj), -1, + NULL, offsetof(DisplayItem,foregroundObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_FONT, "-font", "font", "Font", - NULL, Tk_Offset(DisplayItem,fontObj), -1, + NULL, offsetof(DisplayItem,fontObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; @@ -271,42 +271,42 @@ /* Don't touch column->data, it's scratch storage */ } static Tk_OptionSpec ColumnOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", - DEF_COLWIDTH, -1, Tk_Offset(TreeColumn,width), + DEF_COLWIDTH, -1, offsetof(TreeColumn,width), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-minwidth", "minWidth", "MinWidth", - DEF_MINWIDTH, -1, Tk_Offset(TreeColumn,minWidth), + DEF_MINWIDTH, -1, offsetof(TreeColumn,minWidth), 0,0,0 }, {TK_OPTION_BOOLEAN, "-stretch", "stretch", "Stretch", - "1", -1, Tk_Offset(TreeColumn,stretch), + "1", -1, offsetof(TreeColumn,stretch), 0,0,GEOMETRY_CHANGED }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "w", Tk_Offset(TreeColumn,anchorObj), -1, /* <> */ + "w", offsetof(TreeColumn,anchorObj), -1, /* <> */ 0,0,0 }, {TK_OPTION_STRING, "-id", "id", "ID", - NULL, Tk_Offset(TreeColumn,idObj), -1, + NULL, offsetof(TreeColumn,idObj), -1, TK_OPTION_NULL_OK,0,READONLY_OPTION }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; static Tk_OptionSpec HeadingOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", - "", Tk_Offset(TreeColumn,headingObj), -1, + "", offsetof(TreeColumn,headingObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", - "", Tk_Offset(TreeColumn,headingImageObj), -1, + "", offsetof(TreeColumn,headingImageObj), -1, 0,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "center", Tk_Offset(TreeColumn,headingAnchorObj), -1, + "center", offsetof(TreeColumn,headingAnchorObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-command", "", "", - "", Tk_Offset(TreeColumn,headingCommandObj), -1, + "", offsetof(TreeColumn,headingCommandObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "state", "", "", - "", Tk_Offset(TreeColumn,headingStateObj), -1, + "", offsetof(TreeColumn,headingStateObj), -1, 0,0,STATE_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; /*------------------------------------------------------------------------ @@ -435,35 +435,35 @@ static const char *const SelectModeStrings[] = { "none", "browse", "extended", NULL }; static Tk_OptionSpec TreeviewOptionSpecs[] = { {TK_OPTION_STRING, "-columns", "columns", "Columns", - "", Tk_Offset(Treeview,tree.columnsObj), -1, + "", offsetof(Treeview,tree.columnsObj), -1, 0,0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ }, {TK_OPTION_STRING, "-displaycolumns","displayColumns","DisplayColumns", - "#all", Tk_Offset(Treeview,tree.displayColumnsObj), -1, + "#all", offsetof(Treeview,tree.displayColumnsObj), -1, 0,0,DCOLUMNS_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-show", "show", "Show", - DEFAULT_SHOW, Tk_Offset(Treeview,tree.showObj), -1, + DEFAULT_SHOW, offsetof(Treeview,tree.showObj), -1, 0,0,SHOW_CHANGED | GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-selectmode", "selectMode", "SelectMode", - "extended", Tk_Offset(Treeview,tree.selectModeObj), -1, + "extended", offsetof(Treeview,tree.selectModeObj), -1, 0,(ClientData)SelectModeStrings,0 }, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_TREE_ROWS, Tk_Offset(Treeview,tree.heightObj), -1, + DEF_TREE_ROWS, offsetof(Treeview,tree.heightObj), -1, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-padding", "padding", "Pad", - NULL, Tk_Offset(Treeview,tree.paddingObj), -1, + NULL, offsetof(Treeview,tree.paddingObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", - NULL, -1, Tk_Offset(Treeview, tree.xscroll.scrollCmd), + NULL, -1, offsetof(Treeview, tree.xscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", - NULL, -1, Tk_Offset(Treeview, tree.yscroll.scrollCmd), + NULL, -1, offsetof(Treeview, tree.yscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -3367,15 +3367,15 @@ Tcl_Obj *marginsObj; } TreeitemIndicator; static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, - Tk_Offset(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, + offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, { "-indicatorsize", TK_OPTION_PIXELS, - Tk_Offset(TreeitemIndicator,sizeObj), "12" }, + offsetof(TreeitemIndicator,sizeObj), "12" }, { "-indicatormargins", TK_OPTION_STRING, - Tk_Offset(TreeitemIndicator,marginsObj), "2 2 4 2" }, + offsetof(TreeitemIndicator,marginsObj), "2 2 4 2" }, { NULL, 0, 0, NULL } }; static void TreeitemIndicatorSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -3436,13 +3436,13 @@ Tcl_Obj *rowNumberObj; } RowElement; static Ttk_ElementOptionSpec RowElementOptions[] = { { "-background", TK_OPTION_COLOR, - Tk_Offset(RowElement,backgroundObj), DEFAULT_BACKGROUND }, + offsetof(RowElement,backgroundObj), DEFAULT_BACKGROUND }, { "-rownumber", TK_OPTION_INT, - Tk_Offset(RowElement,rowNumberObj), "0" }, + offsetof(RowElement,rowNumberObj), "0" }, { NULL, 0, 0, NULL } }; static void RowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Index: generic/ttk/ttkWidget.h ================================================================== --- generic/ttk/ttkWidget.h +++ generic/ttk/ttkWidget.h @@ -115,14 +115,14 @@ * to indicate whether the widget should take focus * during keyboard traversal. */ #define WIDGET_TAKEFOCUS_TRUE \ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ - "ttk::takefocus", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 } + "ttk::takefocus", offsetof(WidgetCore, takeFocusPtr), -1, 0,0,0 } #define WIDGET_TAKEFOCUS_FALSE \ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ - "", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 } + "", offsetof(WidgetCore, takeFocusPtr), -1, 0,0,0 } /* WIDGET_INHERIT_OPTIONS(baseOptionSpecs) -- * Add this at the end of an OptionSpecs table to inherit * the options from 'baseOptionSpecs'. */ Index: macosx/ttkMacOSXTheme.c ================================================================== --- macosx/ttkMacOSXTheme.c +++ macosx/ttkMacOSXTheme.c @@ -1654,13 +1654,13 @@ #define ENTRY_DEFAULT_BACKGROUND "systemTextBackgroundColor" static Ttk_ElementOptionSpec EntryElementOptions[] = { {"-background", TK_OPTION_BORDER, - Tk_Offset(EntryElement, backgroundObj), ENTRY_DEFAULT_BACKGROUND}, + offsetof(EntryElement, backgroundObj), ENTRY_DEFAULT_BACKGROUND}, {"-fieldbackground", TK_OPTION_BORDER, - Tk_Offset(EntryElement, fieldbackgroundObj), ENTRY_DEFAULT_BACKGROUND}, + offsetof(EntryElement, fieldbackgroundObj), ENTRY_DEFAULT_BACKGROUND}, {0} }; static void EntryElementSize( void *clientData, @@ -2014,14 +2014,14 @@ Tcl_Obj *valueObj; /* current value */ Tcl_Obj *orientObj; /* horizontal / vertical */ } TrackElement; static Ttk_ElementOptionSpec TrackElementOptions[] = { - {"-from", TK_OPTION_DOUBLE, Tk_Offset(TrackElement, fromObj)}, - {"-to", TK_OPTION_DOUBLE, Tk_Offset(TrackElement, toObj)}, - {"-value", TK_OPTION_DOUBLE, Tk_Offset(TrackElement, valueObj)}, - {"-orient", TK_OPTION_STRING, Tk_Offset(TrackElement, orientObj)}, + {"-from", TK_OPTION_DOUBLE, offsetof(TrackElement, fromObj)}, + {"-to", TK_OPTION_DOUBLE, offsetof(TrackElement, toObj)}, + {"-value", TK_OPTION_DOUBLE, offsetof(TrackElement, valueObj)}, + {"-orient", TK_OPTION_STRING, offsetof(TrackElement, orientObj)}, {0, 0, 0} }; static void TrackElementSize( void *clientData, void *elementRecord, @@ -2149,19 +2149,19 @@ Tcl_Obj *modeObj; /* progress bar mode */ } PbarElement; static Ttk_ElementOptionSpec PbarElementOptions[] = { {"-orient", TK_OPTION_STRING, - Tk_Offset(PbarElement, orientObj), "horizontal"}, + offsetof(PbarElement, orientObj), "horizontal"}, {"-value", TK_OPTION_DOUBLE, - Tk_Offset(PbarElement, valueObj), "0"}, + offsetof(PbarElement, valueObj), "0"}, {"-maximum", TK_OPTION_DOUBLE, - Tk_Offset(PbarElement, maximumObj), "100"}, + offsetof(PbarElement, maximumObj), "100"}, {"-phase", TK_OPTION_INT, - Tk_Offset(PbarElement, phaseObj), "0"}, + offsetof(PbarElement, phaseObj), "0"}, {"-mode", TK_OPTION_STRING, - Tk_Offset(PbarElement, modeObj), "determinate"}, + offsetof(PbarElement, modeObj), "determinate"}, {0, 0, 0, 0} }; static void PbarElementSize( void *clientData, void *elementRecord, @@ -2246,11 +2246,11 @@ Tcl_Obj *orientObj; } ScrollbarElement; static Ttk_ElementOptionSpec ScrollbarElementOptions[] = { {"-orient", TK_OPTION_STRING, - Tk_Offset(ScrollbarElement, orientObj), "horizontal"}, + offsetof(ScrollbarElement, orientObj), "horizontal"}, {0, 0, 0, 0} }; static void TroughElementSize( void *clientData, void *elementRecord, @@ -2762,11 +2762,11 @@ Tcl_Obj *backgroundObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { {"-fieldbackground", TK_OPTION_BORDER, - Tk_Offset(FieldElement, backgroundObj), "white"}, + offsetof(FieldElement, backgroundObj), "white"}, {NULL, 0, 0, NULL} }; static void FieldElementDraw( void *clientData, Index: unix/tkUnixWm.c ================================================================== --- unix/tkUnixWm.c +++ unix/tkUnixWm.c @@ -34,11 +34,11 @@ * needs of the actual command. THIS MUST BE * THE LAST FIELD OF THE STRUCTURE. */ } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ - (Tk_Offset(ProtocolHandler, command) + 1 + cmdLength) + (offsetof(ProtocolHandler, command) + 1 + cmdLength) /* * Data for [wm attributes] command: */ Index: win/tkWinWm.c ================================================================== --- win/tkWinWm.c +++ win/tkWinWm.c @@ -64,11 +64,11 @@ * needs of the actual command. THIS MUST BE * THE LAST FIELD OF THE STRUCTURE. */ } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ - (Tk_Offset(ProtocolHandler, command) + 1 + cmdLength) + (offsetof(ProtocolHandler, command) + 1 + cmdLength) /* * Helper type passed via lParam to TkWmStackorderToplevelEnumProc */ Index: win/ttkWinTheme.c ================================================================== --- win/ttkWinTheme.c +++ win/ttkWinTheme.c @@ -186,11 +186,11 @@ typedef struct { Tcl_Obj *reliefObj; } BorderElement; static Ttk_ElementOptionSpec BorderElementOptions[] = { - { "-relief",TK_OPTION_RELIEF,Tk_Offset(BorderElement,reliefObj), "flat" }, + { "-relief",TK_OPTION_RELIEF, offsetof(BorderElement,reliefObj), "flat" }, {NULL, 0, 0, NULL} }; static void BorderElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -237,11 +237,11 @@ Tcl_Obj *backgroundObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, - Tk_Offset(FieldElement,backgroundObj), "white" }, + offsetof(FieldElement,backgroundObj), "white" }, { NULL, 0, 0, NULL } }; static void FieldElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -288,15 +288,15 @@ Tcl_Obj *defaultStateObj; } ButtonBorderElement; static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = { { "-relief",TK_OPTION_RELIEF, - Tk_Offset(ButtonBorderElement,reliefObj), "flat" }, + offsetof(ButtonBorderElement,reliefObj), "flat" }, { "-highlightcolor",TK_OPTION_COLOR, - Tk_Offset(ButtonBorderElement,highlightColorObj), "black" }, + offsetof(ButtonBorderElement,highlightColorObj), "black" }, { "-default", TK_OPTION_ANY, - Tk_Offset(ButtonBorderElement,defaultStateObj), "disabled" }, + offsetof(ButtonBorderElement,defaultStateObj), "disabled" }, {NULL, 0, 0, NULL} }; static void ButtonBorderElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -416,11 +416,11 @@ Tcl_Obj *fillColorObj; } FillFocusElement; static Ttk_ElementOptionSpec FillFocusElementOptions[] = { { "-focusfill", TK_OPTION_COLOR, - Tk_Offset(FillFocusElement,fillColorObj), "white" }, + offsetof(FillFocusElement,fillColorObj), "white" }, {NULL, 0, 0, NULL} }; /* @@@ FIX THIS */ static void FillFocusElementDraw( @@ -540,11 +540,11 @@ typedef struct { Tcl_Obj *orientObj; } ThumbElement; static Ttk_ElementOptionSpec ThumbElementOptions[] = { - { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, + { "-orient", TK_OPTION_ANY, offsetof(ThumbElement,orientObj),"horizontal"}, { NULL, 0, 0, NULL } }; static void ThumbElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -596,11 +596,11 @@ typedef struct { Tcl_Obj *orientObj; /* orientation of the slider widget */ } SliderElement; static Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), + { "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj), "horizontal" }, { NULL, 0, 0, NULL } }; static void SliderElementSize( Index: win/ttkWinXPTheme.c ================================================================== --- win/ttkWinXPTheme.c +++ win/ttkWinXPTheme.c @@ -809,13 +809,13 @@ } TextElement; static Ttk_ElementOptionSpec TextElementOptions[] = { { "-text", TK_OPTION_STRING, - Tk_Offset(TextElement,textObj), "" }, + offsetof(TextElement,textObj), "" }, { "-font", TK_OPTION_FONT, - Tk_Offset(TextElement,fontObj), DEFAULT_FONT }, + offsetof(TextElement,fontObj), DEFAULT_FONT }, { NULL } }; static void TextElementSize( void *clientData, void *elementRecord, Tk_Window tkwin,