summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-06 13:12:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-06 13:12:24 (GMT)
commit294e8b450c748fcc35e2f76489d71459df5153cd (patch)
tree9ed39ca23bc6f21b14d68e5864cda089580f4592
parenta57ef2cb5257f38ffa995f9eecd3ecd3a071ee9b (diff)
parentbb451dfa1c09cc91c232cae7df94ecd215ee309b (diff)
downloadtk-294e8b450c748fcc35e2f76489d71459df5153cd.zip
tk-294e8b450c748fcc35e2f76489d71459df5153cd.tar.gz
tk-294e8b450c748fcc35e2f76489d71459df5153cd.tar.bz2
Merge 8.7
-rw-r--r--generic/tkPkgConfig.c2
-rw-r--r--generic/ttk/ttk.decls6
-rw-r--r--generic/ttk/ttkButton.c16
-rw-r--r--generic/ttk/ttkClamTheme.c42
-rw-r--r--generic/ttk/ttkClassicTheme.c16
-rw-r--r--generic/ttk/ttkDecls.h12
-rw-r--r--generic/ttk/ttkDefaultTheme.c44
-rw-r--r--generic/ttk/ttkElements.c72
-rw-r--r--generic/ttk/ttkEntry.c10
-rw-r--r--generic/ttk/ttkFrame.c4
-rw-r--r--generic/ttk/ttkImage.c2
-rw-r--r--generic/ttk/ttkInit.c8
-rw-r--r--generic/ttk/ttkLabel.c12
-rw-r--r--generic/ttk/ttkNotebook.c8
-rw-r--r--generic/ttk/ttkPanedwindow.c8
-rw-r--r--generic/ttk/ttkProgress.c2
-rw-r--r--generic/ttk/ttkScale.c2
-rw-r--r--generic/ttk/ttkScrollbar.c2
-rw-r--r--generic/ttk/ttkSeparator.c4
-rw-r--r--generic/ttk/ttkSquare.c6
-rw-r--r--generic/ttk/ttkState.c2
-rw-r--r--generic/ttk/ttkTagSet.c8
-rw-r--r--generic/ttk/ttkTheme.c16
-rw-r--r--generic/ttk/ttkTheme.h8
-rw-r--r--generic/ttk/ttkTreeview.c18
-rw-r--r--generic/ttk/ttkWidget.h10
-rwxr-xr-xunix/configure2
-rw-r--r--unix/tcl.m42
-rwxr-xr-xwin/configure2
-rw-r--r--win/tcl.m42
-rw-r--r--win/tkWinFont.c4
-rw-r--r--win/tkWinPointer.c2
-rw-r--r--win/ttkWinMonitor.c4
-rw-r--r--win/ttkWinTheme.c46
-rw-r--r--win/ttkWinXPTheme.c72
-rw-r--r--win/winMain.c4
-rw-r--r--xlib/xgc.c6
37 files changed, 245 insertions, 241 deletions
diff --git a/generic/tkPkgConfig.c b/generic/tkPkgConfig.c
index ac0583f..a3666d4 100644
--- a/generic/tkPkgConfig.c
+++ b/generic/tkPkgConfig.c
@@ -94,7 +94,7 @@
# define CFG_FONTSYSTEM "x11"
#endif
-static Tcl_Config const cfg[] = {
+static const Tcl_Config cfg[] = {
{"debug", CFG_DEBUG},
{"threaded", CFG_THREADED},
{"profiled", CFG_PROFILED},
diff --git a/generic/ttk/ttk.decls b/generic/ttk/ttk.decls
index ef2a535..7826c99 100644
--- a/generic/ttk/ttk.decls
+++ b/generic/ttk/ttk.decls
@@ -25,7 +25,7 @@ declare 5 {
int Ttk_RegisterElementSpec(
Ttk_Theme theme,
const char *elementName,
- Ttk_ElementSpec *elementSpec,
+ const Ttk_ElementSpec *elementSpec,
void *clientData)
}
@@ -34,7 +34,7 @@ declare 6 {
Tcl_Interp *interp,
Ttk_Theme theme,
const char *elementName,
- Ttk_ElementSpec *elementSpec,
+ const Ttk_ElementSpec *elementSpec,
void *clientData)
}
@@ -72,7 +72,7 @@ declare 13 {
}
declare 14 {
int Ttk_StateTableLookup(
- Ttk_StateTable map[], Ttk_State state)
+ const Ttk_StateTable *map, Ttk_State state)
}
diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c
index db6e353..431487f 100644
--- a/generic/ttk/ttkButton.c
+++ b/generic/ttk/ttkButton.c
@@ -54,7 +54,7 @@ typedef struct
BasePart base;
} Base;
-static Tk_OptionSpec BaseOptionSpecs[] =
+static const Tk_OptionSpec BaseOptionSpecs[] =
{
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
"left", offsetof(Base,base.justifyObj), -1,
@@ -85,7 +85,7 @@ static Tk_OptionSpec BaseOptionSpecs[] =
*/
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
NULL, offsetof(Base,base.compoundObj), -1,
- TK_OPTION_NULL_OK,(ClientData)ttkCompoundStrings,
+ TK_OPTION_NULL_OK,(void *)ttkCompoundStrings,
GEOMETRY_CHANGED },
{TK_OPTION_STRING, "-padding", "padding", "Pad",
NULL, offsetof(Base,base.paddingObj), -1,
@@ -241,7 +241,7 @@ typedef struct
LabelPart label;
} Label;
-static Tk_OptionSpec LabelOptionSpecs[] =
+static const Tk_OptionSpec LabelOptionSpecs[] =
{
{TK_OPTION_BORDER, "-background", "frameColor", "FrameColor",
NULL, offsetof(Label,label.backgroundObj), -1,
@@ -324,13 +324,13 @@ typedef struct
/*
* Option specifications:
*/
-static Tk_OptionSpec ButtonOptionSpecs[] =
+static const Tk_OptionSpec ButtonOptionSpecs[] =
{
{TK_OPTION_STRING, "-command", "command", "Command",
"", offsetof(Button, button.commandObj), -1, 0,0,0},
{TK_OPTION_STRING_TABLE, "-default", "default", "Default",
"normal", offsetof(Button, button.defaultStateObj), -1,
- 0, (ClientData) ttkDefaultStrings, DEFAULTSTATE_CHANGED},
+ 0, (void *)ttkDefaultStrings, DEFAULTSTATE_CHANGED},
WIDGET_TAKEFOCUS_TRUE,
WIDGET_INHERIT_OPTIONS(BaseOptionSpecs)
@@ -434,7 +434,7 @@ typedef struct
/*
* Option specifications:
*/
-static Tk_OptionSpec CheckbuttonOptionSpecs[] =
+static const Tk_OptionSpec CheckbuttonOptionSpecs[] =
{
{TK_OPTION_STRING, "-variable", "variable", "Variable",
NULL, offsetof(Checkbutton, checkbutton.variableObj), -1,
@@ -642,7 +642,7 @@ typedef struct
/*
* Option specifications:
*/
-static Tk_OptionSpec RadiobuttonOptionSpecs[] =
+static const Tk_OptionSpec RadiobuttonOptionSpecs[] =
{
{TK_OPTION_STRING, "-variable", "variable", "Variable",
"::selectedButton", offsetof(Radiobutton, radiobutton.variableObj),-1,
@@ -817,7 +817,7 @@ typedef struct
static const char *const directionStrings[] = {
"above", "below", "left", "right", "flush", NULL
};
-static Tk_OptionSpec MenubuttonOptionSpecs[] =
+static const Tk_OptionSpec MenubuttonOptionSpecs[] =
{
{TK_OPTION_STRING, "-menu", "menu", "Menu",
"", offsetof(Menubutton, menubutton.menuObj), -1, 0,0,0},
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c
index 1f1b01a..4ade22c 100644
--- a/generic/ttk/ttkClamTheme.c
+++ b/generic/ttk/ttkClamTheme.c
@@ -106,7 +106,7 @@ typedef struct {
Tcl_Obj *borderWidthObj; /* See <<NOTE-BORDERWIDTH>> */
} BorderElement;
-static Ttk_ElementOptionSpec BorderElementOptions[] = {
+static const Ttk_ElementOptionSpec BorderElementOptions[] = {
{ "-bordercolor", TK_OPTION_COLOR,
offsetof(BorderElement,borderColorObj), DARKEST_COLOR },
{ "-lightcolor", TK_OPTION_COLOR,
@@ -183,7 +183,7 @@ static void BorderElementDraw(
DrawSmoothBorder(tkwin, d, b, outer, upper, lower);
}
-static Ttk_ElementSpec BorderElementSpec = {
+static const Ttk_ElementSpec BorderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BorderElement),
BorderElementOptions,
@@ -202,7 +202,7 @@ typedef struct {
Tcl_Obj *backgroundObj;
} FieldElement;
-static Ttk_ElementOptionSpec FieldElementOptions[] = {
+static const Ttk_ElementOptionSpec FieldElementOptions[] = {
{ "-bordercolor", TK_OPTION_COLOR,
offsetof(FieldElement,borderColorObj), DARKEST_COLOR },
{ "-lightcolor", TK_OPTION_COLOR,
@@ -244,7 +244,7 @@ static void FieldElementDraw(
tkwin, d, bg, f.x, f.y, f.width, f.height, 0, TK_RELIEF_SUNKEN);
}
-static Ttk_ElementSpec FieldElementSpec = {
+static const Ttk_ElementSpec FieldElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FieldElement),
FieldElementOptions,
@@ -271,7 +271,7 @@ static void ComboboxFieldElementDraw(
b.x + b.width - 1, b.y + b.height - 1 + WIN32_XDRAWLINE_HACK);
}
-static Ttk_ElementSpec ComboboxFieldElementSpec = {
+static const Ttk_ElementSpec ComboboxFieldElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FieldElement),
FieldElementOptions,
@@ -292,7 +292,7 @@ typedef struct {
Tcl_Obj *lowerColorObj;
} IndicatorElement;
-static Ttk_ElementOptionSpec IndicatorElementOptions[] = {
+static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
{ "-indicatorsize", TK_OPTION_PIXELS,
offsetof(IndicatorElement,sizeObj), "10" },
{ "-indicatormargin", TK_OPTION_STRING,
@@ -395,7 +395,7 @@ static void CheckIndicatorElementDraw(
}
}
-static Ttk_ElementSpec RadioIndicatorElementSpec = {
+static const Ttk_ElementSpec RadioIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(IndicatorElement),
IndicatorElementOptions,
@@ -403,7 +403,7 @@ static Ttk_ElementSpec RadioIndicatorElementSpec = {
RadioIndicatorElementDraw
};
-static Ttk_ElementSpec CheckIndicatorElementSpec = {
+static const Ttk_ElementSpec CheckIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(IndicatorElement),
IndicatorElementOptions,
@@ -419,7 +419,7 @@ typedef struct {
Tcl_Obj *paddingObj;
} MenuIndicatorElement;
-static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] =
+static const Ttk_ElementOptionSpec MenuIndicatorElementOptions[] =
{
{ "-arrowsize", TK_OPTION_PIXELS,
offsetof(MenuIndicatorElement,sizeObj),
@@ -469,7 +469,7 @@ static void MenuIndicatorElementDraw(
TtkFillArrow(Tk_Display(tkwin), d, gc, b, ARROW_DOWN);
}
-static Ttk_ElementSpec MenuIndicatorElementSpec =
+static const Ttk_ElementSpec MenuIndicatorElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(MenuIndicatorElement),
@@ -494,7 +494,7 @@ typedef struct {
Tcl_Obj *gripCountObj;
} GripElement;
-static Ttk_ElementOptionSpec GripElementOptions[] = {
+static const Ttk_ElementOptionSpec GripElementOptions[] = {
{ "-lightcolor", TK_OPTION_COLOR,
offsetof(GripElement,lightColorObj), LIGHT_COLOR },
{ "-bordercolor", TK_OPTION_COLOR,
@@ -554,7 +554,7 @@ static void GripElementDraw(
}
}
-static Ttk_ElementSpec GripElementSpec = {
+static const Ttk_ElementSpec GripElementSpec = {
TK_STYLE_VERSION_2,
sizeof(GripElement),
GripElementOptions,
@@ -582,7 +582,7 @@ typedef struct { /* Common element record for scrollbar elements */
Tcl_Obj *sliderlengthObj;
} ScrollbarElement;
-static Ttk_ElementOptionSpec ScrollbarElementOptions[] = {
+static const Ttk_ElementOptionSpec ScrollbarElementOptions[] = {
{ "-orient", TK_OPTION_ANY,
offsetof(ScrollbarElement, orientObj), "horizontal" },
{ "-background", TK_OPTION_BORDER,
@@ -620,7 +620,7 @@ static void TroughElementDraw(
XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, b.width-1, b.height-1);
}
-static Ttk_ElementSpec TroughElementSpec = {
+static const Ttk_ElementSpec TroughElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ScrollbarElement),
ScrollbarElementOptions,
@@ -689,7 +689,7 @@ static void ThumbElementDraw(
}
}
-static Ttk_ElementSpec ThumbElementSpec = {
+static const Ttk_ElementSpec ThumbElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ScrollbarElement),
ScrollbarElementOptions,
@@ -724,7 +724,7 @@ static void SliderElementSize(
}
-static Ttk_ElementSpec SliderElementSpec = {
+static const Ttk_ElementSpec SliderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ScrollbarElement),
ScrollbarElementOptions,
@@ -764,7 +764,7 @@ static void PbarElementDraw(
}
}
-static Ttk_ElementSpec PbarElementSpec = {
+static const Ttk_ElementSpec PbarElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ScrollbarElement),
ScrollbarElementOptions,
@@ -817,7 +817,7 @@ static void ArrowElementDraw(
TtkFillArrow(Tk_Display(tkwin), d, gc, b, dir);
}
-static Ttk_ElementSpec ArrowElementSpec = {
+static const Ttk_ElementSpec ArrowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ScrollbarElement),
ScrollbarElementOptions,
@@ -840,7 +840,7 @@ typedef struct {
Tcl_Obj *darkColorObj;
} NotebookElement;
-static Ttk_ElementOptionSpec NotebookElementOptions[] = {
+static const Ttk_ElementOptionSpec NotebookElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(NotebookElement,backgroundObj), FRAME_COLOR },
{ "-bordercolor", TK_OPTION_COLOR,
@@ -905,7 +905,7 @@ static void TabElementDraw(
XDrawLine(display,d,gc, x1+1,y1+1, x2-1+w,y1+1);
}
-static Ttk_ElementSpec TabElementSpec =
+static const Ttk_ElementSpec TabElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NotebookElement),
@@ -944,7 +944,7 @@ static void ClientElementDraw(
ce->borderColorObj, ce->lightColorObj, ce->darkColorObj);
}
-static Ttk_ElementSpec ClientElementSpec =
+static const Ttk_ElementSpec ClientElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NotebookElement),
diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c
index 2c49e83..2b1905a 100644
--- a/generic/ttk/ttkClassicTheme.c
+++ b/generic/ttk/ttkClassicTheme.c
@@ -21,7 +21,7 @@ typedef struct {
Tcl_Obj *highlightThicknessObj;
} HighlightElement;
-static Ttk_ElementOptionSpec HighlightElementOptions[] = {
+static const Ttk_ElementOptionSpec HighlightElementOptions[] = {
{ "-highlightcolor",TK_OPTION_COLOR,
offsetof(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND },
{ "-highlightthickness",TK_OPTION_PIXELS,
@@ -62,7 +62,7 @@ static void HighlightElementDraw(
}
}
-static Ttk_ElementSpec HighlightElementSpec =
+static const Ttk_ElementSpec HighlightElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(HighlightElement),
@@ -88,7 +88,7 @@ typedef struct {
Tcl_Obj *defaultStateObj;
} ButtonBorderElement;
-static Ttk_ElementOptionSpec ButtonBorderElementOptions[] =
+static const Ttk_ElementOptionSpec ButtonBorderElementOptions[] =
{
{ "-background", TK_OPTION_BORDER,
offsetof(ButtonBorderElement,borderObj), DEFAULT_BACKGROUND },
@@ -183,7 +183,7 @@ static void ButtonBorderElementDraw(
}
}
-static Ttk_ElementSpec ButtonBorderElementSpec =
+static const Ttk_ElementSpec ButtonBorderElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(ButtonBorderElement),
@@ -208,7 +208,7 @@ typedef struct
Tcl_Obj *reliefObj;
} ArrowElement;
-static Ttk_ElementOptionSpec ArrowElementOptions[] =
+static const Ttk_ElementOptionSpec ArrowElementOptions[] =
{
{ "-arrowsize", TK_OPTION_PIXELS, offsetof(ArrowElement,sizeObj),
DEFAULT_ARROW_SIZE },
@@ -282,7 +282,7 @@ static void ArrowElementDraw(
Tk_Fill3DPolygon(tkwin, d, border, points, 3, borderWidth, relief);
}
-static Ttk_ElementSpec ArrowElementSpec =
+static const Ttk_ElementSpec ArrowElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(ArrowElement),
@@ -319,7 +319,7 @@ typedef struct {
Tcl_Obj *handlePadObj; /* handle's distance from edge */
} SashElement;
-static Ttk_ElementOptionSpec SashOptions[] = {
+static const Ttk_ElementOptionSpec SashOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(SashElement,borderObj), DEFAULT_BACKGROUND },
{ "-sashrelief", TK_OPTION_RELIEF,
@@ -419,7 +419,7 @@ static void SashElementDraw(
}
}
-static Ttk_ElementSpec SashElementSpec = {
+static const Ttk_ElementSpec SashElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SashElement),
SashOptions,
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index 7a742da..c1d75c3 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -47,12 +47,12 @@ TTKAPI void Ttk_RegisterCleanup(Tcl_Interp *interp,
/* 5 */
TTKAPI int Ttk_RegisterElementSpec(Ttk_Theme theme,
const char *elementName,
- Ttk_ElementSpec *elementSpec,
+ const Ttk_ElementSpec *elementSpec,
void *clientData);
/* 6 */
TTKAPI Ttk_ElementClass * Ttk_RegisterElement(Tcl_Interp *interp,
Ttk_Theme theme, const char *elementName,
- Ttk_ElementSpec *elementSpec,
+ const Ttk_ElementSpec *elementSpec,
void *clientData);
/* 7 */
TTKAPI int Ttk_RegisterElementFactory(Tcl_Interp *interp,
@@ -77,7 +77,7 @@ TTKAPI Ttk_StateMap Ttk_GetStateMapFromObj(Tcl_Interp *interp,
TTKAPI Tcl_Obj * Ttk_StateMapLookup(Tcl_Interp *interp,
Ttk_StateMap map, Ttk_State state);
/* 14 */
-TTKAPI int Ttk_StateTableLookup(Ttk_StateTable map[],
+TTKAPI int Ttk_StateTableLookup(const Ttk_StateTable *map,
Ttk_State state);
/* Slot 15 is reserved */
/* Slot 16 is reserved */
@@ -144,8 +144,8 @@ typedef struct TtkStubs {
Ttk_Theme (*ttk_GetCurrentTheme) (Tcl_Interp *interp); /* 2 */
Ttk_Theme (*ttk_CreateTheme) (Tcl_Interp *interp, const char *name, Ttk_Theme parent); /* 3 */
void (*ttk_RegisterCleanup) (Tcl_Interp *interp, void *deleteData, Ttk_CleanupProc *cleanupProc); /* 4 */
- int (*ttk_RegisterElementSpec) (Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 5 */
- Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 6 */
+ int (*ttk_RegisterElementSpec) (Ttk_Theme theme, const char *elementName, const Ttk_ElementSpec *elementSpec, void *clientData); /* 5 */
+ Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, const char *elementName, const Ttk_ElementSpec *elementSpec, void *clientData); /* 6 */
int (*ttk_RegisterElementFactory) (Tcl_Interp *interp, const char *name, Ttk_ElementFactory factoryProc, void *clientData); /* 7 */
void (*ttk_RegisterLayout) (Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec); /* 8 */
void (*reserved9)(void);
@@ -153,7 +153,7 @@ typedef struct TtkStubs {
Tcl_Obj * (*ttk_NewStateSpecObj) (unsigned int onbits, unsigned int offbits); /* 11 */
Ttk_StateMap (*ttk_GetStateMapFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 12 */
Tcl_Obj * (*ttk_StateMapLookup) (Tcl_Interp *interp, Ttk_StateMap map, Ttk_State state); /* 13 */
- int (*ttk_StateTableLookup) (Ttk_StateTable map[], Ttk_State state); /* 14 */
+ int (*ttk_StateTableLookup) (const Ttk_StateTable *map, Ttk_State state); /* 14 */
void (*reserved15)(void);
void (*reserved16)(void);
void (*reserved17)(void);
diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c
index 0fc438b..1560138 100644
--- a/generic/ttk/ttkDefaultTheme.c
+++ b/generic/ttk/ttkDefaultTheme.c
@@ -116,7 +116,7 @@ static void DrawBorder(
/* Alternate shadow colors for entry fields:
* NOTE: FLAT color is normally white, and the LITE color is a darker shade.
*/
-static enum BorderColor fieldShadowColors[4] = { DARK, BRDR, LITE, FLAT };
+static const enum BorderColor fieldShadowColors[4] = { DARK, BRDR, LITE, FLAT };
static void DrawFieldBorder(
Tk_Window tkwin, Drawable d, Tk_3DBorder border, XColor *borderColor,
@@ -244,7 +244,7 @@ typedef struct {
Tcl_Obj *defaultStateObj; /* for buttons */
} BorderElement;
-static Ttk_ElementOptionSpec BorderElementOptions[] = {
+static const Ttk_ElementOptionSpec BorderElementOptions[] = {
{ "-background", TK_OPTION_BORDER, offsetof(BorderElement,borderObj),
DEFAULT_BACKGROUND },
{ "-bordercolor",TK_OPTION_COLOR,
@@ -313,7 +313,7 @@ static void BorderElementDraw(
DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief);
}
-static Ttk_ElementSpec BorderElementSpec = {
+static const Ttk_ElementSpec BorderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BorderElement),
BorderElementOptions,
@@ -330,7 +330,7 @@ typedef struct {
Tcl_Obj *borderColorObj; /* Extra border color */
} FieldElement;
-static Ttk_ElementOptionSpec FieldElementOptions[] = {
+static const Ttk_ElementOptionSpec FieldElementOptions[] = {
{ "-fieldbackground", TK_OPTION_BORDER, offsetof(FieldElement,borderObj),
"white" },
{ "-bordercolor",TK_OPTION_COLOR, offsetof(FieldElement,borderColorObj),
@@ -366,7 +366,7 @@ static void FieldElementDraw(
DrawFieldBorder(tkwin, d, border, borderColor, b);
}
-static Ttk_ElementSpec FieldElementSpec = {
+static const Ttk_ElementSpec FieldElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FieldElement),
FieldElementOptions,
@@ -389,7 +389,7 @@ typedef struct {
int height; /* Height of each image */
int nimages; /* #images / row */
const char *const *pixels; /* array[height] of char[width*nimage] */
- Ttk_StateTable *map;/* used to look up image index by state */
+ const Ttk_StateTable *map;/* used to look up image index by state */
} IndicatorSpec;
#if 0
@@ -409,7 +409,7 @@ static const char *const button_images[] = {
};
#endif
-static Ttk_StateTable checkbutton_states[] = {
+static const Ttk_StateTable checkbutton_states[] = {
{ 0, 0, TTK_STATE_SELECTED|TTK_STATE_DISABLED },
{ 1, TTK_STATE_SELECTED, TTK_STATE_DISABLED },
{ 2, TTK_STATE_DISABLED, TTK_STATE_SELECTED },
@@ -439,7 +439,7 @@ static IndicatorSpec checkbutton_spec = {
checkbutton_states
};
-static Ttk_StateTable radiobutton_states[] = {
+static const Ttk_StateTable radiobutton_states[] = {
{ 0, 0, TTK_STATE_SELECTED|TTK_STATE_DISABLED },
{ 1, TTK_STATE_SELECTED, TTK_STATE_DISABLED },
{ 2, TTK_STATE_DISABLED, TTK_STATE_SELECTED },
@@ -479,7 +479,7 @@ typedef struct {
Tcl_Obj *marginObj;
} IndicatorElement;
-static Ttk_ElementOptionSpec IndicatorElementOptions[] = {
+static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
{ "-background", TK_OPTION_COLOR,
offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND },
{ "-foreground", TK_OPTION_COLOR,
@@ -644,7 +644,7 @@ static void IndicatorElementDraw(
XDestroyImage(img);
}
-static Ttk_ElementSpec IndicatorElementSpec = {
+static const Ttk_ElementSpec IndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(IndicatorElement),
IndicatorElementOptions,
@@ -668,7 +668,7 @@ typedef struct {
Tcl_Obj *colorObj; /* Arrow color */
} ArrowElement;
-static Ttk_ElementOptionSpec ArrowElementOptions[] = {
+static const Ttk_ElementOptionSpec ArrowElementOptions[] = {
{ "-arrowsize", TK_OPTION_PIXELS,
offsetof(ArrowElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) },
{ "-background", TK_OPTION_BORDER,
@@ -728,7 +728,7 @@ static void ArrowElementDraw(
Ttk_PadBox(b, ArrowPadding), direction);
}
-static Ttk_ElementSpec ArrowElementSpec = {
+static const Ttk_ElementSpec ArrowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ArrowElement),
ArrowElementOptions,
@@ -754,7 +754,7 @@ static const char *const directionStrings[] = { /* See also: button.c */
};
enum { POST_ABOVE, POST_BELOW, POST_LEFT, POST_RIGHT, POST_FLUSH };
-static Ttk_ElementOptionSpec MenubuttonArrowElementOptions[] = {
+static const Ttk_ElementOptionSpec MenubuttonArrowElementOptions[] = {
{ "-direction", TK_OPTION_STRING,
offsetof(MenubuttonArrowElement,directionObj), "below" },
{ "-arrowsize", TK_OPTION_PIXELS,
@@ -814,7 +814,7 @@ static void MenubuttonArrowElementDraw(
TtkFillArrow(Tk_Display(tkwin), d, gc, b, arrowDirection);
}
-static Ttk_ElementSpec MenubuttonArrowElementSpec = {
+static const Ttk_ElementSpec MenubuttonArrowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(MenubuttonArrowElement),
MenubuttonArrowElementOptions,
@@ -843,7 +843,7 @@ typedef struct {
Tcl_Obj *orientObj;
} TroughElement;
-static Ttk_ElementOptionSpec TroughElementOptions[] = {
+static const Ttk_ElementOptionSpec TroughElementOptions[] = {
{ "-orient", TK_OPTION_ANY,
offsetof(TroughElement, orientObj), "horizontal" },
{ "-troughborderwidth", TK_OPTION_PIXELS,
@@ -906,7 +906,7 @@ static void TroughElementDraw(
borderWidth, relief);
}
-static Ttk_ElementSpec TroughElementSpec = {
+static const Ttk_ElementSpec TroughElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TroughElement),
TroughElementOptions,
@@ -929,7 +929,7 @@ typedef struct {
Tcl_Obj *orientObj;
} ThumbElement;
-static Ttk_ElementOptionSpec ThumbElementOptions[] = {
+static const Ttk_ElementOptionSpec ThumbElementOptions[] = {
{ "-width", TK_OPTION_PIXELS, offsetof(ThumbElement,sizeObj),
STRINGIFY(SCROLLBAR_WIDTH) },
{ "-background", TK_OPTION_BORDER, offsetof(ThumbElement,borderObj),
@@ -989,7 +989,7 @@ static void ThumbElementDraw(
DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief);
}
-static Ttk_ElementSpec ThumbElementSpec = {
+static const Ttk_ElementSpec ThumbElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ThumbElement),
ThumbElementOptions,
@@ -1018,7 +1018,7 @@ typedef struct {
Tcl_Obj *orientObj; /* Orientation of overall slider */
} SliderElement;
-static Ttk_ElementOptionSpec SliderElementOptions[] = {
+static const Ttk_ElementOptionSpec SliderElementOptions[] = {
{ "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj),
"15" },
{ "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj),
@@ -1084,7 +1084,7 @@ static void SliderElementDraw(
DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief);
}
-static Ttk_ElementSpec SliderElementSpec = {
+static const Ttk_ElementSpec SliderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SliderElement),
SliderElementOptions,
@@ -1105,7 +1105,7 @@ typedef struct {
Tcl_Obj *diameterObj;
} TreeitemIndicator;
-static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
+static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
{ "-foreground", TK_OPTION_COLOR,
offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
{ "-diameter", TK_OPTION_PIXELS,
@@ -1164,7 +1164,7 @@ static void TreeitemIndicatorDraw(
}
}
-static Ttk_ElementSpec TreeitemIndicatorElementSpec = {
+static const Ttk_ElementSpec TreeitemIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TreeitemIndicator),
TreeitemIndicatorOptions,
diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c
index fbdf82e..9d37c79 100644
--- a/generic/ttk/ttkElements.c
+++ b/generic/ttk/ttkElements.c
@@ -19,7 +19,7 @@
* and may be used in other engines.
*/
-/* public */ Ttk_ElementOptionSpec TtkNullElementOptions[] = { { NULL, TK_OPTION_BOOLEAN, 0, NULL } };
+/* public */ const Ttk_ElementOptionSpec TtkNullElementOptions[] = { { NULL, TK_OPTION_BOOLEAN, 0, NULL } };
/* public */ void
TtkNullElementSize(
@@ -68,7 +68,7 @@ typedef struct {
Tcl_Obj *backgroundObj;
} BackgroundElement;
-static Ttk_ElementOptionSpec BackgroundElementOptions[] = {
+static const Ttk_ElementOptionSpec BackgroundElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(BackgroundElement,backgroundObj), DEFAULT_BACKGROUND },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -99,7 +99,7 @@ static void BackgroundElementDraw(
d, Ttk_WinBox(tkwin), state);
}
-static Ttk_ElementSpec FillElementSpec = {
+static const Ttk_ElementSpec FillElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BackgroundElement),
BackgroundElementOptions,
@@ -107,7 +107,7 @@ static Ttk_ElementSpec FillElementSpec = {
FillElementDraw
};
-static Ttk_ElementSpec BackgroundElementSpec = {
+static const Ttk_ElementSpec BackgroundElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BackgroundElement),
BackgroundElementOptions,
@@ -125,7 +125,7 @@ typedef struct {
Tcl_Obj *reliefObj;
} BorderElement;
-static Ttk_ElementOptionSpec BorderElementOptions[] = {
+static const Ttk_ElementOptionSpec BorderElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(BorderElement,borderObj), DEFAULT_BACKGROUND },
{ "-borderwidth", TK_OPTION_PIXELS,
@@ -170,7 +170,7 @@ static void BorderElementDraw(
}
}
-static Ttk_ElementSpec BorderElementSpec = {
+static const Ttk_ElementSpec BorderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BorderElement),
BorderElementOptions,
@@ -187,7 +187,7 @@ typedef struct {
Tcl_Obj *borderWidthObj;
} FieldElement;
-static Ttk_ElementOptionSpec FieldElementOptions[] = {
+static const Ttk_ElementOptionSpec FieldElementOptions[] = {
{ "-fieldbackground", TK_OPTION_BORDER,
offsetof(FieldElement,borderObj), "white" },
{ "-borderwidth", TK_OPTION_PIXELS,
@@ -224,7 +224,7 @@ static void FieldElementDraw(
b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_SUNKEN);
}
-static Ttk_ElementSpec FieldElementSpec = {
+static const Ttk_ElementSpec FieldElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FieldElement),
FieldElementOptions,
@@ -249,7 +249,7 @@ typedef struct {
Tcl_Obj *shiftreliefObj;
} PaddingElement;
-static Ttk_ElementOptionSpec PaddingElementOptions[] = {
+static const Ttk_ElementOptionSpec PaddingElementOptions[] = {
{ "-padding", TK_OPTION_STRING,
offsetof(PaddingElement,paddingObj), "0" },
{ "-relief", TK_OPTION_RELIEF,
@@ -277,7 +277,7 @@ static void PaddingElementSize(
*paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief);
}
-static Ttk_ElementSpec PaddingElementSpec = {
+static const Ttk_ElementSpec PaddingElementSpec = {
TK_STYLE_VERSION_2,
sizeof(PaddingElement),
PaddingElementOptions,
@@ -318,7 +318,7 @@ static void DrawFocusRing(
Tk_FreeGC(Tk_Display(tkwin), gc);
}
-static Ttk_ElementOptionSpec FocusElementOptions[] = {
+static const Ttk_ElementOptionSpec FocusElementOptions[] = {
{ "-focuscolor",TK_OPTION_COLOR,
offsetof(FocusElement,focusColorObj), "black" },
{ "-focusthickness",TK_OPTION_PIXELS,
@@ -355,7 +355,7 @@ static void FocusElementDraw(
}
}
-static Ttk_ElementSpec FocusElementSpec = {
+static const Ttk_ElementSpec FocusElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FocusElement),
FocusElementOptions,
@@ -375,7 +375,7 @@ typedef struct {
Tcl_Obj *borderObj;
} SeparatorElement;
-static Ttk_ElementOptionSpec SeparatorElementOptions[] = {
+static const Ttk_ElementOptionSpec SeparatorElementOptions[] = {
{ "-orient", TK_OPTION_ANY,
offsetof(SeparatorElement, orientObj), "horizontal" },
{ "-background", TK_OPTION_BORDER,
@@ -444,7 +444,7 @@ static void GeneralSeparatorElementDraw(
}
}
-static Ttk_ElementSpec HorizontalSeparatorElementSpec = {
+static const Ttk_ElementSpec HorizontalSeparatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SeparatorElement),
SeparatorElementOptions,
@@ -452,7 +452,7 @@ static Ttk_ElementSpec HorizontalSeparatorElementSpec = {
HorizontalSeparatorElementDraw
};
-static Ttk_ElementSpec VerticalSeparatorElementSpec = {
+static const Ttk_ElementSpec VerticalSeparatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SeparatorElement),
SeparatorElementOptions,
@@ -460,7 +460,7 @@ static Ttk_ElementSpec VerticalSeparatorElementSpec = {
HorizontalSeparatorElementDraw
};
-static Ttk_ElementSpec SeparatorElementSpec = {
+static const Ttk_ElementSpec SeparatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SeparatorElement),
SeparatorElementOptions,
@@ -476,7 +476,7 @@ typedef struct {
Tcl_Obj *backgroundObj;
} SizegripElement;
-static Ttk_ElementOptionSpec SizegripOptions[] = {
+static const Ttk_ElementOptionSpec SizegripOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(SizegripElement,backgroundObj), DEFAULT_BACKGROUND },
{0,TK_OPTION_BOOLEAN,0,0}
@@ -516,7 +516,7 @@ static void SizegripDraw(
}
}
-static Ttk_ElementSpec SizegripElementSpec = {
+static const Ttk_ElementSpec SizegripElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SizegripElement),
SizegripOptions,
@@ -544,7 +544,7 @@ typedef struct {
Tcl_Obj *borderWidthObj;
} IndicatorElement;
-static Ttk_ElementOptionSpec IndicatorElementOptions[] = {
+static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND },
{ "-indicatorcolor", TK_OPTION_BORDER,
@@ -664,7 +664,7 @@ static void DiamondIndicatorElementDraw(
Tk_Draw3DPolygon(tkwin,d,border,points,4,borderWidth,relief);
}
-static Ttk_ElementSpec CheckbuttonIndicatorElementSpec = {
+static const Ttk_ElementSpec CheckbuttonIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(IndicatorElement),
IndicatorElementOptions,
@@ -672,7 +672,7 @@ static Ttk_ElementSpec CheckbuttonIndicatorElementSpec = {
SquareIndicatorElementDraw
};
-static Ttk_ElementSpec RadiobuttonIndicatorElementSpec = {
+static const Ttk_ElementSpec RadiobuttonIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(IndicatorElement),
IndicatorElementOptions,
@@ -700,7 +700,7 @@ typedef struct {
Tcl_Obj *marginObj;
} MenuIndicatorElement;
-static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = {
+static const Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(MenuIndicatorElement,backgroundObj), DEFAULT_BACKGROUND },
{ "-indicatorwidth", TK_OPTION_PIXELS,
@@ -750,7 +750,7 @@ static void MenuIndicatorElementDraw(
borderWidth, TK_RELIEF_RAISED);
}
-static Ttk_ElementSpec MenuIndicatorElementSpec = {
+static const Ttk_ElementSpec MenuIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(MenuIndicatorElement),
MenuIndicatorElementOptions,
@@ -774,7 +774,7 @@ typedef struct {
Tcl_Obj *colorObj;
} ArrowElement;
-static Ttk_ElementOptionSpec ArrowElementOptions[] = {
+static const Ttk_ElementOptionSpec ArrowElementOptions[] = {
{ "-background", TK_OPTION_BORDER,
offsetof(ArrowElement,borderObj), DEFAULT_BACKGROUND },
{ "-relief",TK_OPTION_RELIEF,
@@ -827,7 +827,7 @@ static void ArrowElementDraw(
Ttk_PadBox(b, ArrowMargins), direction);
}
-static Ttk_ElementSpec ArrowElementSpec = {
+static const Ttk_ElementSpec ArrowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ArrowElement),
ArrowElementOptions,
@@ -847,7 +847,7 @@ typedef struct {
Tcl_Obj *reliefObj;
} TroughElement;
-static Ttk_ElementOptionSpec TroughElementOptions[] = {
+static const Ttk_ElementOptionSpec TroughElementOptions[] = {
{ "-borderwidth", TK_OPTION_PIXELS,
offsetof(TroughElement,borderWidthObj), DEFAULT_BORDERWIDTH },
{ "-troughcolor", TK_OPTION_BORDER,
@@ -889,7 +889,7 @@ static void TroughElementDraw(
borderWidth, relief);
}
-static Ttk_ElementSpec TroughElementSpec = {
+static const Ttk_ElementSpec TroughElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TroughElement),
TroughElementOptions,
@@ -912,7 +912,7 @@ typedef struct {
Tcl_Obj *borderWidthObj;
} ThumbElement;
-static Ttk_ElementOptionSpec ThumbElementOptions[] = {
+static const Ttk_ElementOptionSpec ThumbElementOptions[] = {
{ "-orient", TK_OPTION_ANY,
offsetof(ThumbElement, orientObj), "horizontal" },
{ "-width", TK_OPTION_PIXELS,
@@ -964,7 +964,7 @@ static void ThumbElementDraw(
borderWidth, relief);
}
-static Ttk_ElementSpec ThumbElementSpec = {
+static const Ttk_ElementSpec ThumbElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ThumbElement),
ThumbElementOptions,
@@ -988,7 +988,7 @@ typedef struct {
Tcl_Obj *borderWidthObj; /* the size of the border */
} SliderElement;
-static Ttk_ElementOptionSpec SliderElementOptions[] = {
+static const Ttk_ElementOptionSpec SliderElementOptions[] = {
{ "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj),
"30" },
{ "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj),
@@ -1076,7 +1076,7 @@ static void SliderElementDraw(
}
}
-static Ttk_ElementSpec SliderElementSpec = {
+static const Ttk_ElementSpec SliderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SliderElement),
SliderElementOptions,
@@ -1105,7 +1105,7 @@ typedef struct {
Tcl_Obj *borderWidthObj; /* thickness of the border */
} PbarElement;
-static Ttk_ElementOptionSpec PbarElementOptions[] = {
+static const Ttk_ElementOptionSpec PbarElementOptions[] = {
{ "-orient", TK_OPTION_ANY, offsetof(PbarElement,orientObj),
"horizontal" },
{ "-thickness", TK_OPTION_PIXELS, offsetof(PbarElement,thicknessObj),
@@ -1166,7 +1166,7 @@ static void PbarElementDraw(
borderWidth, relief);
}
-static Ttk_ElementSpec PbarElementSpec = {
+static const Ttk_ElementSpec PbarElementSpec = {
TK_STYLE_VERSION_2,
sizeof(PbarElement),
PbarElementOptions,
@@ -1183,7 +1183,7 @@ typedef struct {
Tcl_Obj *backgroundObj;
} TabElement;
-static Ttk_ElementOptionSpec TabElementOptions[] = {
+static const Ttk_ElementOptionSpec TabElementOptions[] = {
{ "-borderwidth", TK_OPTION_PIXELS,
offsetof(TabElement,borderWidthObj),"1" },
{ "-background", TK_OPTION_BORDER,
@@ -1259,7 +1259,7 @@ static void TabElementDraw(
}
-static Ttk_ElementSpec TabElementSpec = {
+static const Ttk_ElementSpec TabElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TabElement),
TabElementOptions,
@@ -1304,7 +1304,7 @@ static void ClientElementSize(
*paddingPtr = Ttk_UniformPadding((short)borderWidth);
}
-static Ttk_ElementSpec ClientElementSpec = {
+static const Ttk_ElementSpec ClientElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ClientElement),
ClientElementOptions,
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 9cc2821..45d1a44 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -154,7 +154,7 @@ typedef struct {
#define DEF_ENTRY_FONT "TkTextFont"
#define DEF_LIST_HEIGHT "10"
-static Tk_OptionSpec EntryOptionSpecs[] = {
+static const Tk_OptionSpec EntryOptionSpecs[] = {
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
"ExportSelection", "1", -1, offsetof(Entry, entry.exportSelection),
0,0,0 },
@@ -1775,7 +1775,7 @@ typedef struct {
ComboboxPart combobox;
} Combobox;
-static Tk_OptionSpec ComboboxOptionSpecs[] = {
+static const Tk_OptionSpec ComboboxOptionSpecs[] = {
{TK_OPTION_STRING, "-height", "height", "Height",
DEF_LIST_HEIGHT, offsetof(Combobox, combobox.heightObj), -1,
0,0,0 },
@@ -1966,7 +1966,7 @@ typedef struct {
SpinboxPart spinbox;
} Spinbox;
-static Tk_OptionSpec SpinboxOptionSpecs[] = {
+static const Tk_OptionSpec SpinboxOptionSpecs[] = {
{TK_OPTION_STRING, "-values", "values", "Values",
"", offsetof(Spinbox, spinbox.valuesObj), -1,
0,0,0 },
@@ -2068,7 +2068,7 @@ typedef struct {
Tcl_Obj *widthObj;
} TextareaElement;
-static Ttk_ElementOptionSpec TextareaElementOptions[] = {
+static const Ttk_ElementOptionSpec TextareaElementOptions[] = {
{ "-font", TK_OPTION_FONT,
offsetof(TextareaElement,fontObj), DEF_ENTRY_FONT },
{ "-width", TK_OPTION_INT,
@@ -2097,7 +2097,7 @@ static void TextareaElementSize(
*widthPtr = prefWidth * avgWidth;
}
-static Ttk_ElementSpec TextareaElementSpec = {
+static const Ttk_ElementSpec TextareaElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TextareaElement),
TextareaElementOptions,
diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c
index 714b16e..bb99a16 100644
--- a/generic/ttk/ttkFrame.c
+++ b/generic/ttk/ttkFrame.c
@@ -26,7 +26,7 @@ typedef struct {
FramePart frame;
} Frame;
-static Tk_OptionSpec FrameOptionSpecs[] = {
+static const Tk_OptionSpec FrameOptionSpecs[] = {
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", NULL,
offsetof(Frame,frame.borderWidthObj), -1,
TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
@@ -250,7 +250,7 @@ typedef struct {
#define LABELWIDGET_CHANGED 0x100
-static Tk_OptionSpec LabelframeOptionSpecs[] = {
+static const Tk_OptionSpec LabelframeOptionSpecs[] = {
{TK_OPTION_STRING, "-labelanchor", "labelAnchor", "LabelAnchor",
"nw", offsetof(Labelframe, label.labelAnchorObj),-1,
0,0,GEOMETRY_CHANGED},
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index e924fd1..e6ad27d 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -336,7 +336,7 @@ static void ImageElementDraw(
Ttk_Tile(tkwin, d, image, src, dst, imageData->border);
}
-static Ttk_ElementSpec ImageElementSpec =
+static const Ttk_ElementSpec ImageElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index 5e20a83..ccfcd46 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -12,7 +12,7 @@
* Legal values for the button -default option.
* See also: enum Ttk_ButtonDefaultState.
*/
-const char *ttkDefaultStrings[] = {
+const char *const ttkDefaultStrings[] = {
"normal", "active", "disabled", NULL
};
@@ -28,7 +28,7 @@ int Ttk_GetButtonDefaultStateFromObj(
* Legal values for the -compound option.
* See also: enum Ttk_Compound.
*/
-const char *ttkCompoundStrings[] = {
+const char *const ttkCompoundStrings[] = {
"none", "text", "image", "center",
"top", "bottom", "left", "right", NULL
};
@@ -45,7 +45,7 @@ int Ttk_GetCompoundFromObj(
* Legal values for the -orient option.
* See also: enum Ttk_Orient.
*/
-const char *ttkOrientStrings[] = {
+const char *const ttkOrientStrings[] = {
"horizontal", "vertical", NULL
};
@@ -175,7 +175,7 @@ int TtkGetOptionValue(
*/
/* public */
-Tk_OptionSpec ttkCoreOptionSpecs[] =
+const Tk_OptionSpec ttkCoreOptionSpecs[] =
{
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", NULL,
offsetof(WidgetCore, cursorObj), -1, TK_OPTION_NULL_OK,0,0 },
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 1004e12..b118352 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -46,7 +46,7 @@ typedef struct {
/* Text element options table.
* NB: Keep in sync with label element option table.
*/
-static Ttk_ElementOptionSpec TextElementOptions[] = {
+static const Ttk_ElementOptionSpec TextElementOptions[] = {
{ "-text", TK_OPTION_STRING,
offsetof(TextElement,textObj), "" },
{ "-font", TK_OPTION_FONT,
@@ -225,7 +225,7 @@ static void TextElementDraw(
}
}
-static Ttk_ElementSpec TextElementSpec = {
+static const Ttk_ElementSpec TextElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TextElement),
TextElementOptions,
@@ -251,7 +251,7 @@ typedef struct {
/* ===> NB: Keep in sync with label element option table. <===
*/
-static Ttk_ElementOptionSpec ImageElementOptions[] = {
+static const Ttk_ElementOptionSpec ImageElementOptions[] = {
{ "-image", TK_OPTION_STRING,
offsetof(ImageElement,imageObj), "" },
{ "-stipple", TK_OPTION_STRING, /* Really: TK_OPTION_BITMAP */
@@ -392,7 +392,7 @@ static void ImageElementDraw(
}
}
-static Ttk_ElementSpec ImageElementSpec = {
+static const Ttk_ElementSpec ImageElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ImageElement),
ImageElementOptions,
@@ -448,7 +448,7 @@ typedef struct {
int totalWidth, totalHeight;
} LabelElement;
-static Ttk_ElementOptionSpec LabelElementOptions[] = {
+static const Ttk_ElementOptionSpec LabelElementOptions[] = {
{ "-compound", TK_OPTION_ANY,
offsetof(LabelElement,compoundObj), "none" },
{ "-space", TK_OPTION_PIXELS,
@@ -684,7 +684,7 @@ static void LabelElementDraw(
LabelCleanup(l);
}
-static Ttk_ElementSpec LabelElementSpec = {
+static const Ttk_ElementSpec LabelElementSpec = {
TK_STYLE_VERSION_2,
sizeof(LabelElement),
LabelElementOptions,
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index 7997f3c..41f1a41 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -55,7 +55,7 @@ typedef struct
* PaneOptionSpecs includes additional options for child window placement
* and is used to configure the slave.
*/
-static Tk_OptionSpec TabOptionSpecs[] =
+static const Tk_OptionSpec TabOptionSpecs[] =
{
{TK_OPTION_STRING_TABLE, "-state", "", "",
"normal", -1, offsetof(Tab,state),
@@ -66,13 +66,13 @@ static Tk_OptionSpec TabOptionSpecs[] =
offsetof(Tab,imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
NULL, offsetof(Tab,compoundObj), -1,
- TK_OPTION_NULL_OK,(ClientData)ttkCompoundStrings,GEOMETRY_CHANGED },
+ TK_OPTION_NULL_OK,(void *)ttkCompoundStrings,GEOMETRY_CHANGED },
{TK_OPTION_INT, "-underline", "underline", "Underline", "-1",
offsetof(Tab,underlineObj), -1, 0,0,GEOMETRY_CHANGED },
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 }
};
-static Tk_OptionSpec PaneOptionSpecs[] =
+static const Tk_OptionSpec PaneOptionSpecs[] =
{
{TK_OPTION_STRING, "-padding", "padding", "Padding", "0",
offsetof(Tab,paddingObj), -1, 0,0,GEOMETRY_CHANGED },
@@ -107,7 +107,7 @@ typedef struct
NotebookPart notebook;
} Notebook;
-static Tk_OptionSpec NotebookOptionSpecs[] =
+static const Tk_OptionSpec NotebookOptionSpecs[] =
{
{TK_OPTION_INT, "-width", "width", "Width", "0",
offsetof(Notebook,notebook.widthObj),-1,
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index 544e0cc..ed3514a 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -74,7 +74,7 @@ typedef struct {
/* @@@ NOTE: -orient is readonly 'cause dynamic oriention changes NYI
*/
-static Tk_OptionSpec PanedOptionSpecs[] = {
+static const Tk_OptionSpec PanedOptionSpecs[] = {
{TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical",
offsetof(Paned,paned.orientObj), offsetof(Paned,paned.orient),
0,(ClientData)ttkOrientStrings,READONLY_OPTION|STYLE_CHANGED },
@@ -98,7 +98,7 @@ typedef struct {
int weight; /* Pane -weight, for resizing */
} Pane;
-static Tk_OptionSpec PaneOptionSpecs[] = {
+static const Tk_OptionSpec PaneOptionSpecs[] = {
{TK_OPTION_INT, "-weight", "weight", "Weight", "0",
-1, offsetof(Pane,weight), 0,0,GEOMETRY_CHANGED },
{TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0}
@@ -921,7 +921,7 @@ typedef struct {
Tcl_Obj *thicknessObj;
} SashElement;
-static Ttk_ElementOptionSpec SashElementOptions[] = {
+static const Ttk_ElementOptionSpec SashElementOptions[] = {
{ "-sashthickness", TK_OPTION_INT,
offsetof(SashElement,thicknessObj), "5" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -941,7 +941,7 @@ static void SashElementSize(
*widthPtr = *heightPtr = thickness;
}
-static Ttk_ElementSpec SashElementSpec = {
+static const Ttk_ElementSpec SashElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SashElement),
SashElementOptions,
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c
index a288c41..2a72424 100644
--- a/generic/ttk/ttkProgress.c
+++ b/generic/ttk/ttkProgress.c
@@ -48,7 +48,7 @@ typedef struct {
ProgressbarPart progress;
} Progressbar;
-static Tk_OptionSpec ProgressbarOptionSpecs[] =
+static const Tk_OptionSpec ProgressbarOptionSpecs[] =
{
{TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
"w", offsetof(Progressbar,progress.anchorObj), -1,
diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c
index b02faa8..8a1e544 100644
--- a/generic/ttk/ttkScale.c
+++ b/generic/ttk/ttkScale.c
@@ -50,7 +50,7 @@ typedef struct
ScalePart scale;
} Scale;
-static Tk_OptionSpec ScaleOptionSpecs[] =
+static const Tk_OptionSpec ScaleOptionSpecs[] =
{
{TK_OPTION_STRING, "-command", "command", "Command", "",
offsetof(Scale,scale.commandObj), -1,
diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c
index e5b33af..c922ef3 100644
--- a/generic/ttk/ttkScrollbar.c
+++ b/generic/ttk/ttkScrollbar.c
@@ -31,7 +31,7 @@ typedef struct
ScrollbarPart scrollbar;
} Scrollbar;
-static Tk_OptionSpec ScrollbarOptionSpecs[] =
+static const Tk_OptionSpec ScrollbarOptionSpecs[] =
{
{TK_OPTION_STRING, "-command", "command", "Command", "",
offsetof(Scrollbar,scrollbar.commandObj), -1, 0,0,0},
diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c
index 2ddf0e7..9214b12 100644
--- a/generic/ttk/ttkSeparator.c
+++ b/generic/ttk/ttkSeparator.c
@@ -22,7 +22,7 @@ typedef struct
SeparatorPart separator;
} Separator;
-static Tk_OptionSpec SeparatorOptionSpecs[] = {
+static const Tk_OptionSpec SeparatorOptionSpecs[] = {
{TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal",
offsetof(Separator,separator.orientObj),
offsetof(Separator,separator.orient),
@@ -83,7 +83,7 @@ TTK_END_LAYOUT
* Has no options or methods other than the standard ones.
*/
-static Tk_OptionSpec SizegripOptionSpecs[] = {
+static const Tk_OptionSpec SizegripOptionSpecs[] = {
WIDGET_TAKEFOCUS_FALSE,
WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs)
};
diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c
index 4cae06d..64c9979 100644
--- a/generic/ttk/ttkSquare.c
+++ b/generic/ttk/ttkSquare.c
@@ -48,7 +48,7 @@ typedef struct
* defined for all widgets.
*/
-static Tk_OptionSpec SquareOptionSpecs[] =
+static const Tk_OptionSpec SquareOptionSpecs[] =
{
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), -1,
@@ -176,7 +176,7 @@ typedef struct
Tcl_Obj *heightObj;
} SquareElement;
-static Ttk_ElementOptionSpec SquareElementOptions[] =
+static const Ttk_ElementOptionSpec SquareElementOptions[] =
{
{ "-background", TK_OPTION_BORDER, offsetof(SquareElement,borderObj),
DEFAULT_BACKGROUND },
@@ -233,7 +233,7 @@ static void SquareElementDraw(
b.x, b.y, b.width, b.height, borderWidth, relief);
}
-static Ttk_ElementSpec SquareElementSpec =
+static const Ttk_ElementSpec SquareElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(SquareElement),
diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c
index ff73ebe..a704fa4 100644
--- a/generic/ttk/ttkState.c
+++ b/generic/ttk/ttkState.c
@@ -261,7 +261,7 @@ Ttk_StateMap Ttk_GetStateMapFromObj(
* Ttk_StateTableLooup --
* Look up an index from a statically allocated state table.
*/
-int Ttk_StateTableLookup(Ttk_StateTable *map, unsigned int state)
+int Ttk_StateTableLookup(const Ttk_StateTable *map, unsigned int state)
{
while ((state & map->onBits) != map->onBits
|| (~state & map->offBits) != map->offBits)
diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c
index 5ad4d1d..e923d77 100644
--- a/generic/ttk/ttkTagSet.c
+++ b/generic/ttk/ttkTagSet.c
@@ -19,7 +19,7 @@ struct TtkTag {
struct TtkTagTable {
Tk_Window tkwin; /* owner window */
- Tk_OptionSpec *optionSpecs; /* ... */
+ const Tk_OptionSpec *optionSpecs; /* ... */
Tk_OptionTable optionTable; /* ... */
int recordSize; /* size of tag record */
int nTags; /* #tags defined so far */
@@ -53,7 +53,7 @@ static void DeleteTag(Ttk_TagTable tagTable, Ttk_Tag tag)
Ttk_TagTable Ttk_CreateTagTable(
Tcl_Interp *interp, Tk_Window tkwin,
- Tk_OptionSpec optionSpecs[], int recordSize)
+ const Tk_OptionSpec *optionSpecs, int recordSize)
{
Ttk_TagTable tagTable = (Ttk_TagTable)ckalloc(sizeof(*tagTable));
tagTable->tkwin = tkwin;
@@ -269,7 +269,7 @@ void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record)
memset(record, 0, tagTable->recordSize);
for (i = 0; tagTable->optionSpecs[i].type != TK_OPTION_END; ++i) {
- Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i;
+ const Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i;
int offset = optionSpec->objOffset;
int prio = LOWEST_PRIORITY;
@@ -286,7 +286,7 @@ void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record)
void Ttk_TagSetApplyStyle(
Ttk_TagTable tagTable, Ttk_Style style, Ttk_State state, void *record)
{
- Tk_OptionSpec *optionSpec = tagTable->optionSpecs;
+ const Tk_OptionSpec *optionSpec = tagTable->optionSpecs;
while (optionSpec->type != TK_OPTION_END) {
int offset = optionSpec->objOffset;
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index a67dd56..9ec34d3 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -117,7 +117,7 @@ typedef const Tk_OptionSpec **OptionMap;
struct Ttk_ElementClass_ {
const char *name; /* Points to hash table key */
- Ttk_ElementSpec *specPtr; /* Template provided during registration. */
+ const Ttk_ElementSpec *specPtr; /* Template provided during registration. */
void *clientData; /* Client data passed in at registration time */
void *elementRecord; /* Scratch buffer for element record storage */
int nResources; /* #Element options */
@@ -181,7 +181,7 @@ BuildOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
int i;
for (i = 0; i < elementClass->nResources; ++i) {
- Ttk_ElementOptionSpec *e = elementClass->specPtr->options+i;
+ const Ttk_ElementOptionSpec *e = elementClass->specPtr->options+i;
optionMap[i] = TTKGetOptionSpec(e->optionName, optionTable, e->type);
}
@@ -216,7 +216,7 @@ GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
* from the specified element specification.
*/
static Ttk_ElementClass *
-NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData)
+NewElementClass(const char *name, const Ttk_ElementSpec *specPtr, void *clientData)
{
Ttk_ElementClass *elementClass = (Ttk_ElementClass *)ckalloc(sizeof(Ttk_ElementClass));
int i;
@@ -876,7 +876,7 @@ Ttk_ElementClass *Ttk_RegisterElement(
Tcl_Interp *interp, /* Where to leave error messages */
Ttk_Theme theme, /* Style engine providing the implementation. */
const char *name, /* Name of new element */
- Ttk_ElementSpec *specPtr, /* Static template information */
+ const Ttk_ElementSpec *specPtr, /* Static template information */
void *clientData) /* application-specific data */
{
Ttk_ElementClass *elementClass;
@@ -917,7 +917,7 @@ Ttk_ElementClass *Ttk_RegisterElement(
* Register a new element.
*/
int Ttk_RegisterElementSpec(Ttk_Theme theme,
- const char *name, Ttk_ElementSpec *specPtr, void *clientData)
+ const char *name, const Ttk_ElementSpec *specPtr, void *clientData)
{
return Ttk_RegisterElement(NULL, theme, name, specPtr, clientData)
? TCL_OK : TCL_ERROR;
@@ -990,7 +990,7 @@ int InitializeElementRecord(
OptionMap optionMap = GetOptionMap(eclass,optionTable);
int nResources = eclass->nResources;
Ttk_ResourceCache cache = style->cache;
- Ttk_ElementOptionSpec *elementOption = eclass->specPtr->options;
+ const Ttk_ElementOptionSpec *elementOption = eclass->specPtr->options;
int i;
for (i=0; i<nResources; ++i, ++elementOption) {
@@ -1557,8 +1557,8 @@ static int StyleElementOptionsCmd(
elementName = Tcl_GetString(objv[3]);
elementClass = Ttk_GetElement(theme, elementName);
if (elementClass) {
- Ttk_ElementSpec *specPtr = elementClass->specPtr;
- Ttk_ElementOptionSpec *option = specPtr->options;
+ const Ttk_ElementSpec *specPtr = elementClass->specPtr;
+ const Ttk_ElementOptionSpec *option = specPtr->options;
Tcl_Obj *result = Tcl_NewListObj(0,0);
while (option->optionName) {
diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h
index e067337..1dc7423 100644
--- a/generic/ttk/ttkTheme.h
+++ b/generic/ttk/ttkTheme.h
@@ -96,7 +96,7 @@ typedef struct
unsigned int offBits; /* Bits which must be cleared */
} Ttk_StateTable;
-TTKAPI int Ttk_StateTableLookup(Ttk_StateTable map[], Ttk_State);
+TTKAPI int Ttk_StateTableLookup(const Ttk_StateTable *map, Ttk_State);
/*------------------------------------------------------------------------
* +++ Padding.
@@ -259,14 +259,14 @@ typedef struct Ttk_ElementOptionSpec
typedef struct Ttk_ElementSpec {
enum TTKStyleVersion2 version; /* Version of the style support. */
size_t elementSize; /* Size of element record */
- Ttk_ElementOptionSpec *options; /* List of options, NULL-terminated */
+ const Ttk_ElementOptionSpec *options; /* List of options, NULL-terminated */
Ttk_ElementSizeProc *size; /* Compute min size and padding */
Ttk_ElementDrawProc *draw; /* Draw the element */
} Ttk_ElementSpec;
TTKAPI Ttk_ElementClass *Ttk_RegisterElement(
Tcl_Interp *interp, Ttk_Theme theme, const char *elementName,
- Ttk_ElementSpec *, void *clientData);
+ const Ttk_ElementSpec *, void *clientData);
typedef int (*Ttk_ElementFactory)
(Tcl_Interp *, void *clientData,
@@ -288,7 +288,7 @@ MODULE_SCOPE void TtkNullElementSize
(void *, void *, Tk_Window, int *, int *, Ttk_Padding *);
MODULE_SCOPE void TtkNullElementDraw
(void *, void *, Tk_Window, Drawable, Ttk_Box, Ttk_State);
-MODULE_SCOPE Ttk_ElementOptionSpec TtkNullElementOptions[];
+MODULE_SCOPE const Ttk_ElementOptionSpec TtkNullElementOptions[];
MODULE_SCOPE Ttk_ElementSpec ttkNullElementSpec;
/*------------------------------------------------------------------------
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index dbed6c0..bd1efa5 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -59,7 +59,7 @@ struct TreeItemRec {
#define ITEM_OPTION_TAGS_CHANGED 0x100
#define ITEM_OPTION_IMAGE_CHANGED 0x200
-static Tk_OptionSpec ItemOptionSpecs[] = {
+static const Tk_OptionSpec ItemOptionSpecs[] = {
{TK_OPTION_STRING, "-text", "text", "Text",
"", offsetof(TreeItem,textObj), -1,
0,0,0 },
@@ -187,7 +187,7 @@ typedef struct {
Tcl_Obj *fontObj;
} DisplayItem;
-static Tk_OptionSpec TagOptionSpecs[] = {
+static const Tk_OptionSpec TagOptionSpecs[] = {
{TK_OPTION_STRING, "-text", "text", "Text",
NULL, offsetof(DisplayItem,textObj), -1,
TK_OPTION_NULL_OK,0,0 },
@@ -271,7 +271,7 @@ static void FreeColumn(TreeColumn *column)
/* Don't touch column->data, it's scratch storage */
}
-static Tk_OptionSpec ColumnOptionSpecs[] = {
+static const Tk_OptionSpec ColumnOptionSpecs[] = {
{TK_OPTION_INT, "-width", "width", "Width",
DEF_COLWIDTH, -1, offsetof(TreeColumn,width),
0,0,GEOMETRY_CHANGED },
@@ -290,7 +290,7 @@ static Tk_OptionSpec ColumnOptionSpecs[] = {
{TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0}
};
-static Tk_OptionSpec HeadingOptionSpecs[] = {
+static const Tk_OptionSpec HeadingOptionSpecs[] = {
{TK_OPTION_STRING, "-text", "text", "Text",
"", offsetof(TreeColumn,headingObj), -1,
0,0,0 },
@@ -435,7 +435,7 @@ typedef struct {
static const char *const SelectModeStrings[] = { "none", "browse", "extended", NULL };
-static Tk_OptionSpec TreeviewOptionSpecs[] = {
+static const Tk_OptionSpec TreeviewOptionSpecs[] = {
{TK_OPTION_STRING, "-columns", "columns", "Columns",
"", offsetof(Treeview,tree.columnsObj), -1,
0,0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ },
@@ -3349,7 +3349,7 @@ typedef struct {
Tcl_Obj *marginsObj;
} TreeitemIndicator;
-static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
+static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
{ "-foreground", TK_OPTION_COLOR,
offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
{ "-indicatorsize", TK_OPTION_PIXELS,
@@ -3404,7 +3404,7 @@ static void TreeitemIndicatorDraw(
Tk_FreeGC(Tk_Display(tkwin), gc);
}
-static Ttk_ElementSpec TreeitemIndicatorElementSpec = {
+static const Ttk_ElementSpec TreeitemIndicatorElementSpec = {
TK_STYLE_VERSION_2,
sizeof(TreeitemIndicator),
TreeitemIndicatorOptions,
@@ -3421,7 +3421,7 @@ typedef struct {
Tcl_Obj *rowNumberObj;
} RowElement;
-static Ttk_ElementOptionSpec RowElementOptions[] = {
+static const Ttk_ElementOptionSpec RowElementOptions[] = {
{ "-background", TK_OPTION_COLOR,
offsetof(RowElement,backgroundObj), DEFAULT_BACKGROUND },
{ "-rownumber", TK_OPTION_INT,
@@ -3443,7 +3443,7 @@ static void RowElementDraw(
b.x, b.y, b.width, b.height);
}
-static Ttk_ElementSpec RowElementSpec = {
+static const Ttk_ElementSpec RowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(RowElement),
RowElementOptions,
diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h
index e764c3a..97a01f8 100644
--- a/generic/ttk/ttkWidget.h
+++ b/generic/ttk/ttkWidget.h
@@ -131,7 +131,7 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd(
/* All widgets should inherit from ttkCoreOptionSpecs[].
*/
-MODULE_SCOPE Tk_OptionSpec ttkCoreOptionSpecs[];
+MODULE_SCOPE const Tk_OptionSpec ttkCoreOptionSpecs[];
/*
* Useful routines for use inside widget implementations:
@@ -212,7 +212,7 @@ typedef struct TtkTagSet { /* TODO: make opaque */
} *Ttk_TagSet;
MODULE_SCOPE Ttk_TagTable Ttk_CreateTagTable(
- Tcl_Interp *, Tk_Window tkwin, Tk_OptionSpec[], int recordSize);
+ Tcl_Interp *, Tk_Window tkwin, const Tk_OptionSpec *, int recordSize);
MODULE_SCOPE void Ttk_DeleteTagTable(Ttk_TagTable);
MODULE_SCOPE Ttk_Tag Ttk_GetTag(Ttk_TagTable, const char *tagName);
@@ -247,9 +247,9 @@ MODULE_SCOPE void Ttk_TagSetApplyStyle(Ttk_TagTable,Ttk_Style,Ttk_State,void*);
* String tables for widget resource specifications:
*/
-MODULE_SCOPE const char *ttkOrientStrings[];
-MODULE_SCOPE const char *ttkCompoundStrings[];
-MODULE_SCOPE const char *ttkDefaultStrings[];
+MODULE_SCOPE const char *const ttkOrientStrings[];
+MODULE_SCOPE const char *const ttkCompoundStrings[];
+MODULE_SCOPE const char *const ttkDefaultStrings[];
/*
* ... other option types...
diff --git a/unix/configure b/unix/configure
index 179273a..a491ead 100755
--- a/unix/configure
+++ b/unix/configure
@@ -4239,7 +4239,7 @@ fi
if test "$GCC" = yes; then :
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
+ CFLAGS_WARNING="-Wextra -Wwrite-strings -Wpointer-arith"
else
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 5cac9cc..63447e9 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -966,7 +966,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
+ CFLAGS_WARNING="-Wextra -Wwrite-strings -Wpointer-arith"
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
diff --git a/win/configure b/win/configure
index af50495..a663274 100755
--- a/win/configure
+++ b/win/configure
@@ -4267,7 +4267,7 @@ $as_echo "using shared flags" >&6; }
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith"
+ CFLAGS_WARNING="-Wextra -Wwrite-strings -Wpointer-arith"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
diff --git a/win/tcl.m4 b/win/tcl.m4
index 565cd67..298b426 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -685,7 +685,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter"
+ CFLAGS_WARNING="-Wextra -Wwrite-strings -Wpointer-arith"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 739d71f..b0013a0 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1766,7 +1766,7 @@ AllocFontFamily(
}
}
- familyPtr = ckalloc(sizeof(FontFamily));
+ familyPtr = (FontFamily *)ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -2190,7 +2190,7 @@ FontMapLoadPage(
USHORT *startCount, *endCount;
char buf[16], src[4];
- subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
+ subFontPtr->fontMap[row] = (char *)ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
familyPtr = subFontPtr->familyPtr;
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index a983ec4..561d90e 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -468,7 +468,7 @@ XGetInputFocus(
{
Tk_Window tkwin = Tk_HWNDToWindow(GetFocus());
- *focus_return = tkwin ? Tk_WindowId(tkwin) : None;
+ *focus_return = tkwin ? Tk_WindowId(tkwin) : 0;
*revert_to_return = RevertToParent;
display->request++;
return Success;
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index dff44e6..1d31c1c 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -22,7 +22,7 @@ typedef struct {
int index;
} SystemColorEntry;
-static SystemColorEntry sysColors[] = {
+static const SystemColorEntry sysColors[] = {
{ "System3dDarkShadow", COLOR_3DDKSHADOW },
{ "System3dLight", COLOR_3DLIGHT },
{ "SystemActiveBorder", COLOR_ACTIVEBORDER },
@@ -55,7 +55,7 @@ static SystemColorEntry sysColors[] = {
static void RegisterSystemColors(Tcl_Interp *interp)
{
Ttk_ResourceCache cache = Ttk_GetResourceCache(interp);
- SystemColorEntry *sysColor;
+ const SystemColorEntry *sysColor;
for (sysColor = sysColors; sysColor->name; ++sysColor) {
DWORD pixel = GetSysColor(sysColor->index);
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index ae88006..3ac93ad 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -54,7 +54,7 @@ static unsigned int ReliefToEdge(int relief)
* +++ State tables for FrameControlElements.
*/
-static Ttk_StateTable checkbutton_statemap[] = { /* see also SF#1865898 */
+static const Ttk_StateTable checkbutton_statemap[] = { /* see also SF#1865898 */
{ DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_INACTIVE,
TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0 },
{ DFCS_BUTTON3STATE|DFCS_CHECKED|DFCS_PUSHED,
@@ -75,14 +75,14 @@ static Ttk_StateTable checkbutton_statemap[] = { /* see also SF#1865898 */
{ 0, 0, 0 },
};
-static Ttk_StateTable pushbutton_statemap[] = {
+static const Ttk_StateTable pushbutton_statemap[] = {
{ DFCS_INACTIVE, TTK_STATE_DISABLED, 0 },
{ DFCS_PUSHED, TTK_STATE_PRESSED, 0 },
{ DFCS_HOT, TTK_STATE_ACTIVE, 0 },
{ 0, 0, 0 }
};
-static Ttk_StateTable arrow_statemap[] = {
+static const Ttk_StateTable arrow_statemap[] = {
{ DFCS_INACTIVE, TTK_STATE_DISABLED, 0 },
{ DFCS_PUSHED | DFCS_FLAT, TTK_STATE_PRESSED, 0 },
{ 0, 0, 0 }
@@ -98,7 +98,7 @@ typedef struct {
int partId; /* part id for DrawFrameControl */
int cxId; /* system metric ids for width/height... */
int cyId; /* ... or size if FIXEDSIZE bit set */
- Ttk_StateTable *stateMap; /* map Tk states to Win32 flags */
+ const Ttk_StateTable *stateMap; /* map Tk states to Win32 flags */
Ttk_Padding margins; /* additional placement padding */
} FrameControlElementData;
@@ -109,7 +109,7 @@ typedef struct {
#define GETMETRIC(m) \
((m) & _FIXEDSIZE ? (int)((m) & ~_FIXEDSIZE) : GetSystemMetrics((m)&0x0fffffff))
-static FrameControlElementData FrameControlElements[] = {
+static const FrameControlElementData FrameControlElements[] = {
{ "Checkbutton.indicator",
DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(13), FIXEDSIZE(13),
checkbutton_statemap, {0,0,4,0} },
@@ -176,7 +176,7 @@ static void FrameControlElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec FrameControlElementSpec = {
+static const Ttk_ElementSpec FrameControlElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -192,7 +192,7 @@ typedef struct {
Tcl_Obj *reliefObj;
} BorderElement;
-static Ttk_ElementOptionSpec BorderElementOptions[] = {
+static const Ttk_ElementOptionSpec BorderElementOptions[] = {
{ "-relief",TK_OPTION_RELIEF, offsetof(BorderElement,reliefObj), "flat" },
{NULL, TK_OPTION_BOOLEAN, 0, NULL}
};
@@ -233,7 +233,7 @@ static void BorderElementDraw(
}
}
-static Ttk_ElementSpec BorderElementSpec = {
+static const Ttk_ElementSpec BorderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(BorderElement),
BorderElementOptions,
@@ -250,7 +250,7 @@ typedef struct {
Tcl_Obj *backgroundObj;
} FieldElement;
-static Ttk_ElementOptionSpec FieldElementOptions[] = {
+static const Ttk_ElementOptionSpec FieldElementOptions[] = {
{ "-fieldbackground", TK_OPTION_BORDER,
offsetof(FieldElement,backgroundObj), "white" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -290,7 +290,7 @@ static void FieldElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec FieldElementSpec = {
+static const Ttk_ElementSpec FieldElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FieldElement),
FieldElementOptions,
@@ -309,7 +309,7 @@ typedef struct {
Tcl_Obj *defaultStateObj;
} ButtonBorderElement;
-static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = {
+static const Ttk_ElementOptionSpec ButtonBorderElementOptions[] = {
{ "-relief",TK_OPTION_RELIEF,
offsetof(ButtonBorderElement,reliefObj), "flat" },
{ "-highlightcolor",TK_OPTION_COLOR,
@@ -393,7 +393,7 @@ static void ButtonBorderElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec ButtonBorderElementSpec = {
+static const Ttk_ElementSpec ButtonBorderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ButtonBorderElement),
ButtonBorderElementOptions,
@@ -435,7 +435,7 @@ static void FocusElementDraw(
}
}
-static Ttk_ElementSpec FocusElementSpec = {
+static const Ttk_ElementSpec FocusElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -451,7 +451,7 @@ typedef struct {
Tcl_Obj *fillColorObj;
} FillFocusElement;
-static Ttk_ElementOptionSpec FillFocusElementOptions[] = {
+static const Ttk_ElementOptionSpec FillFocusElementOptions[] = {
{ "-focusfill", TK_OPTION_COLOR,
offsetof(FillFocusElement,fillColorObj), "white" },
{NULL, TK_OPTION_BOOLEAN, 0, NULL}
@@ -492,7 +492,7 @@ static void ComboboxFocusElementDraw(
}
}
-static Ttk_ElementSpec ComboboxFocusElementSpec = {
+static const Ttk_ElementSpec ComboboxFocusElementSpec = {
TK_STYLE_VERSION_2,
sizeof(FillFocusElement),
FillFocusElementOptions,
@@ -564,7 +564,7 @@ static void TroughElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec TroughElementSpec = {
+static const Ttk_ElementSpec TroughElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -580,7 +580,7 @@ typedef struct {
Tcl_Obj *orientObj;
} ThumbElement;
-static Ttk_ElementOptionSpec ThumbElementOptions[] = {
+static const Ttk_ElementOptionSpec ThumbElementOptions[] = {
{ "-orient", TK_OPTION_ANY, offsetof(ThumbElement,orientObj),"horizontal"},
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
@@ -624,7 +624,7 @@ static void ThumbElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec ThumbElementSpec = {
+static const Ttk_ElementSpec ThumbElementSpec = {
TK_STYLE_VERSION_2,
sizeof(ThumbElement),
ThumbElementOptions,
@@ -641,7 +641,7 @@ typedef struct {
Tcl_Obj *orientObj; /* orientation of the slider widget */
} SliderElement;
-static Ttk_ElementOptionSpec SliderElementOptions[] = {
+static const Ttk_ElementOptionSpec SliderElementOptions[] = {
{ "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj),
"horizontal" },
{ NULL, TK_OPTION_BOOLEAN, 0, NULL }
@@ -683,7 +683,7 @@ static void SliderElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec SliderElementSpec = {
+static const Ttk_ElementSpec SliderElementSpec = {
TK_STYLE_VERSION_2,
sizeof(SliderElement),
SliderElementOptions,
@@ -724,7 +724,7 @@ static void ClientElementDraw(
TkWinReleaseDrawableDC(d, hdc, &dcState);
}
-static Ttk_ElementSpec ClientElementSpec = {
+static const Ttk_ElementSpec ClientElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -758,7 +758,7 @@ MODULE_SCOPE
int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd)
{
Ttk_Theme themePtr, parentPtr;
- FrameControlElementData *fce = FrameControlElements;
+ const FrameControlElementData *fce = FrameControlElements;
(void)hwnd;
parentPtr = Ttk_GetTheme(interp, "alt");
@@ -783,7 +783,7 @@ int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd)
for (fce = FrameControlElements; fce->name != 0; ++fce) {
Ttk_RegisterElementSpec(themePtr, fce->name,
- &FrameControlElementSpec, fce);
+ &FrameControlElementSpec, (void *)fce);
}
Ttk_RegisterLayouts(themePtr, LayoutTable);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index f0ce5ab..c51b5be 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -168,12 +168,12 @@ BoxToRect(Ttk_Box b)
/*
* Map Tk state bitmaps to XP style enumerated values.
*/
-static Ttk_StateTable null_statemap[] = { {0,0,0} };
+static const Ttk_StateTable null_statemap[] = { {0,0,0} };
/*
* Pushbuttons (Tk: "Button")
*/
-static Ttk_StateTable pushbutton_statemap[] =
+static const Ttk_StateTable pushbutton_statemap[] =
{
{ PBS_DISABLED, TTK_STATE_DISABLED, 0 },
{ PBS_PRESSED, TTK_STATE_PRESSED, 0 },
@@ -185,7 +185,7 @@ static Ttk_StateTable pushbutton_statemap[] =
/*
* Checkboxes (Tk: "Checkbutton")
*/
-static Ttk_StateTable checkbox_statemap[] =
+static const Ttk_StateTable checkbox_statemap[] =
{
{CBS_MIXEDDISABLED, TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0},
{CBS_MIXEDPRESSED, TTK_STATE_ALTERNATE|TTK_STATE_PRESSED, 0},
@@ -204,7 +204,7 @@ static Ttk_StateTable checkbox_statemap[] =
/*
* Radiobuttons:
*/
-static Ttk_StateTable radiobutton_statemap[] =
+static const Ttk_StateTable radiobutton_statemap[] =
{
{RBS_UNCHECKEDDISABLED, TTK_STATE_ALTERNATE|TTK_STATE_DISABLED, 0},
{RBS_UNCHECKEDNORMAL, TTK_STATE_ALTERNATE, 0},
@@ -221,7 +221,7 @@ static Ttk_StateTable radiobutton_statemap[] =
/*
* Groupboxes (tk: "frame")
*/
-static Ttk_StateTable groupbox_statemap[] =
+static const Ttk_StateTable groupbox_statemap[] =
{
{GBS_DISABLED, TTK_STATE_DISABLED, 0},
{GBS_NORMAL, 0,0 }
@@ -230,7 +230,7 @@ static Ttk_StateTable groupbox_statemap[] =
/*
* Edit fields (tk: "entry")
*/
-static Ttk_StateTable edittext_statemap[] =
+static const Ttk_StateTable edittext_statemap[] =
{
{ ETS_DISABLED, TTK_STATE_DISABLED, 0 },
{ ETS_READONLY, TTK_STATE_READONLY, 0 },
@@ -245,7 +245,7 @@ static Ttk_StateTable edittext_statemap[] =
* Same as edittext_statemap, but doesn't use ETS_READONLY
* (fixes: #1032409)
*/
-static Ttk_StateTable combotext_statemap[] =
+static const Ttk_StateTable combotext_statemap[] =
{
{ ETS_DISABLED, TTK_STATE_DISABLED, 0 },
{ ETS_FOCUSED, TTK_STATE_FOCUS, 0 },
@@ -256,7 +256,7 @@ static Ttk_StateTable combotext_statemap[] =
/*
* Combobox button: (CBP_DROPDOWNBUTTON)
*/
-static Ttk_StateTable combobox_statemap[] = {
+static const Ttk_StateTable combobox_statemap[] = {
{ CBXS_DISABLED, TTK_STATE_DISABLED, 0 },
{ CBXS_PRESSED, TTK_STATE_PRESSED, 0 },
{ CBXS_HOT, TTK_STATE_ACTIVE, 0 },
@@ -267,7 +267,7 @@ static Ttk_StateTable combobox_statemap[] = {
/*
* Toolbar buttons (TP_BUTTON):
*/
-static Ttk_StateTable toolbutton_statemap[] = {
+static const Ttk_StateTable toolbutton_statemap[] = {
{ TS_DISABLED, TTK_STATE_DISABLED, 0 },
{ TS_PRESSED, TTK_STATE_PRESSED, 0 },
{ TS_HOTCHECKED, TTK_STATE_SELECTED|TTK_STATE_ACTIVE, 0 },
@@ -279,7 +279,7 @@ static Ttk_StateTable toolbutton_statemap[] = {
/*
* Scrollbars (Tk: "Scrollbar.thumb")
*/
-static Ttk_StateTable scrollbar_statemap[] =
+static const Ttk_StateTable scrollbar_statemap[] =
{
{ SCRBS_DISABLED, TTK_STATE_DISABLED, 0 },
{ SCRBS_PRESSED, TTK_STATE_PRESSED, 0 },
@@ -287,7 +287,7 @@ static Ttk_StateTable scrollbar_statemap[] =
{ SCRBS_NORMAL, 0, 0 }
};
-static Ttk_StateTable uparrow_statemap[] =
+static const Ttk_StateTable uparrow_statemap[] =
{
{ ABS_UPDISABLED, TTK_STATE_DISABLED, 0 },
{ ABS_UPPRESSED, TTK_STATE_PRESSED, 0 },
@@ -295,7 +295,7 @@ static Ttk_StateTable uparrow_statemap[] =
{ ABS_UPNORMAL, 0, 0 }
};
-static Ttk_StateTable downarrow_statemap[] =
+static const Ttk_StateTable downarrow_statemap[] =
{
{ ABS_DOWNDISABLED, TTK_STATE_DISABLED, 0 },
{ ABS_DOWNPRESSED, TTK_STATE_PRESSED, 0 },
@@ -303,7 +303,7 @@ static Ttk_StateTable downarrow_statemap[] =
{ ABS_DOWNNORMAL, 0, 0 }
};
-static Ttk_StateTable leftarrow_statemap[] =
+static const Ttk_StateTable leftarrow_statemap[] =
{
{ ABS_LEFTDISABLED, TTK_STATE_DISABLED, 0 },
{ ABS_LEFTPRESSED, TTK_STATE_PRESSED, 0 },
@@ -311,7 +311,7 @@ static Ttk_StateTable leftarrow_statemap[] =
{ ABS_LEFTNORMAL, 0, 0 }
};
-static Ttk_StateTable rightarrow_statemap[] =
+static const Ttk_StateTable rightarrow_statemap[] =
{
{ ABS_RIGHTDISABLED,TTK_STATE_DISABLED, 0 },
{ ABS_RIGHTPRESSED, TTK_STATE_PRESSED, 0 },
@@ -319,7 +319,7 @@ static Ttk_StateTable rightarrow_statemap[] =
{ ABS_RIGHTNORMAL, 0, 0 }
};
-static Ttk_StateTable spinbutton_statemap[] =
+static const Ttk_StateTable spinbutton_statemap[] =
{
{ DNS_DISABLED, TTK_STATE_DISABLED, 0 },
{ DNS_PRESSED, TTK_STATE_PRESSED, 0 },
@@ -330,7 +330,7 @@ static Ttk_StateTable spinbutton_statemap[] =
/*
* Trackbar thumb: (Tk: "scale slider")
*/
-static Ttk_StateTable scale_statemap[] =
+static const Ttk_StateTable scale_statemap[] =
{
{ TUS_DISABLED, TTK_STATE_DISABLED, 0 },
{ TUS_PRESSED, TTK_STATE_PRESSED, 0 },
@@ -339,7 +339,7 @@ static Ttk_StateTable scale_statemap[] =
{ TUS_NORMAL, 0, 0 }
};
-static Ttk_StateTable tabitem_statemap[] =
+static const Ttk_StateTable tabitem_statemap[] =
{
{ TIS_DISABLED, TTK_STATE_DISABLED, 0 },
{ TIS_SELECTED, TTK_STATE_SELECTED, 0 },
@@ -374,11 +374,11 @@ static Ttk_StateTable tabitem_statemap[] =
typedef struct /* XP element specifications */
{
const char *elementName; /* Tk theme engine element name */
- Ttk_ElementSpec *elementSpec;
+ const Ttk_ElementSpec *elementSpec;
/* Element spec (usually GenericElementSpec) */
LPCWSTR className; /* Windows window class name */
int partId; /* BP_PUSHBUTTON, BP_CHECKBUTTON, etc. */
- Ttk_StateTable *statemap; /* Map Tk states to XP states */
+ const Ttk_StateTable *statemap; /* Map Tk states to XP states */
Ttk_Padding padding; /* See NOTE-GetThemeMargins */
int flags;
# define IGNORE_THEMESIZE 0x80000000 /* See NOTE-GetThemePartSize */
@@ -393,7 +393,7 @@ typedef struct
/*
* Static data, initialized when element is registered:
*/
- ElementInfo *info;
+ const ElementInfo *info;
XPThemeProcs *procs; /* Pointer to theme procedure table */
/*
@@ -409,7 +409,7 @@ typedef struct
} ElementData;
static ElementData *
-NewElementData(XPThemeProcs *procs, ElementInfo *info)
+NewElementData(XPThemeProcs *procs, const ElementInfo *info)
{
ElementData *elementData = (ElementData *)ckalloc(sizeof(ElementData));
@@ -556,7 +556,7 @@ static void GenericElementDraw(
FreeElementData(elementData);
}
-static Ttk_ElementSpec GenericElementSpec =
+static const Ttk_ElementSpec GenericElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -596,7 +596,7 @@ GenericSizedElementSize(
*widthPtr /= 2;
}
-static Ttk_ElementSpec GenericSizedElementSpec = {
+static const Ttk_ElementSpec GenericSizedElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -626,7 +626,7 @@ SpinboxArrowElementSize(
*heightPtr /= 2;
}
-static Ttk_ElementSpec SpinboxArrowElementSpec = {
+static const Ttk_ElementSpec SpinboxArrowElementSpec = {
TK_STYLE_VERSION_2,
sizeof(NullElement),
TtkNullElementOptions,
@@ -664,7 +664,7 @@ static void ThumbElementDraw(
FreeElementData(elementData);
}
-static Ttk_ElementSpec ThumbElementSpec =
+static const Ttk_ElementSpec ThumbElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -696,7 +696,7 @@ static void PbarElementSize(
}
}
-static Ttk_ElementSpec PbarElementSpec =
+static const Ttk_ElementSpec PbarElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -738,7 +738,7 @@ static void TabElementDraw(
FreeElementData(elementData);
}
-static Ttk_ElementSpec TabElementSpec =
+static const Ttk_ElementSpec TabElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -756,14 +756,14 @@ static Ttk_ElementSpec TabElementSpec =
#define TTK_STATE_OPEN TTK_STATE_USER1
#define TTK_STATE_LEAF TTK_STATE_USER2
-static Ttk_StateTable header_statemap[] =
+static const Ttk_StateTable header_statemap[] =
{
{ HIS_PRESSED, TTK_STATE_PRESSED, 0 },
{ HIS_HOT, TTK_STATE_ACTIVE, 0 },
{ HIS_NORMAL, 0,0 },
};
-static Ttk_StateTable treeview_statemap[] =
+static const Ttk_StateTable treeview_statemap[] =
{
{ TREIS_DISABLED, TTK_STATE_DISABLED, 0 },
{ TREIS_SELECTED, TTK_STATE_SELECTED, 0},
@@ -771,7 +771,7 @@ static Ttk_StateTable treeview_statemap[] =
{ TREIS_NORMAL, 0,0 },
};
-static Ttk_StateTable tvpglyph_statemap[] =
+static const Ttk_StateTable tvpglyph_statemap[] =
{
{ GLPS_OPENED, TTK_STATE_OPEN, 0 },
{ GLPS_CLOSED, 0,0 },
@@ -786,7 +786,7 @@ static void TreeIndicatorElementDraw(
}
}
-static Ttk_ElementSpec TreeIndicatorElementSpec =
+static const Ttk_ElementSpec TreeIndicatorElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(NullElement),
@@ -814,7 +814,7 @@ typedef struct
Tcl_Obj *fontObj;
} TextElement;
-static Ttk_ElementOptionSpec TextElementOptions[] =
+static const Ttk_ElementOptionSpec TextElementOptions[] =
{
{ "-text", TK_OPTION_STRING,
offsetof(TextElement,textObj), "" },
@@ -894,7 +894,7 @@ static void TextElementDraw(
FreeElementData(elementData);
}
-static Ttk_ElementSpec TextElementSpec =
+static const Ttk_ElementSpec TextElementSpec =
{
TK_STYLE_VERSION_2,
sizeof(TextElement),
@@ -960,7 +960,7 @@ TTK_END_LAYOUT_TABLE
/* name spec className partId statemap padding flags */
-static ElementInfo ElementInfoTable[] = {
+static const ElementInfo ElementInfoTable[] = {
{ "Checkbutton.indicator", &GenericElementSpec, L"BUTTON",
BP_CHECKBOX, checkbox_statemap, PAD(0, 0, 4, 0), PAD_MARGINS },
{ "Radiobutton.indicator", &GenericElementSpec, L"BUTTON",
@@ -1125,7 +1125,7 @@ Ttk_CreateVsapiElement(
TkSizeT length = 0;
char *name;
LPWSTR wname;
- Ttk_ElementSpec *elementSpec = &GenericElementSpec;
+ const Ttk_ElementSpec *elementSpec = &GenericElementSpec;
Tcl_DString classBuf;
static const char *const optionStrings[] =
@@ -1284,7 +1284,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
XPThemeProcs *procs;
HINSTANCE hlibrary;
Ttk_Theme themePtr, parentPtr, vistaPtr;
- ElementInfo *infoPtr;
+ const ElementInfo *infoPtr;
OSVERSIONINFOW os;
os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
diff --git a/win/winMain.c b/win/winMain.c
index a89c899..a21cc34 100644
--- a/win/winMain.c
+++ b/win/winMain.c
@@ -112,6 +112,10 @@ _tWinMain(
TCHAR **argv;
int argc;
TCHAR *p;
+ (void)hInstance;
+ (void)hPrevInstance;
+ (void)lpszCmdLine;
+ (void)nCmdShow;
/*
* Create the console channels and install them as the standard channels.
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 81209e8..ed12f4b 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -142,11 +142,11 @@ XCreateGC(
InitField(fill_style, GCFillStyle, FillSolid);
InitField(fill_rule, GCFillRule, WindingRule);
InitField(arc_mode, GCArcMode, ArcPieSlice);
- InitField(tile, GCTile, None);
- InitField(stipple, GCStipple, None);
+ InitField(tile, GCTile, 0);
+ InitField(stipple, GCStipple, 0);
InitField(ts_x_origin, GCTileStipXOrigin, 0);
InitField(ts_y_origin, GCTileStipYOrigin, 0);
- InitField(font, GCFont, None);
+ InitField(font, GCFont, 0);
InitField(subwindow_mode, GCSubwindowMode, ClipByChildren);
InitField(graphics_exposures, GCGraphicsExposures, True);
InitField(clip_x_origin, GCClipXOrigin, 0);