summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 08:51:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 08:51:16 (GMT)
commit0ee97cbae8a5bf340ef97a929e700ee24c75f716 (patch)
tree61c90727ed8941413bf41b3850ec41a311afd532
parentc9a5779ed8262de2ee55db19ea637ce9d2c19624 (diff)
downloadtk-0ee97cbae8a5bf340ef97a929e700ee24c75f716.zip
tk-0ee97cbae8a5bf340ef97a929e700ee24c75f716.tar.gz
tk-0ee97cbae8a5bf340ef97a929e700ee24c75f716.tar.bz2
Some code cleanup, backported from 8.7 (mainly usage of exact types and type-casts).
-rw-r--r--generic/ttk/ttkButton.c55
-rw-r--r--generic/ttk/ttkClamTheme.c181
-rw-r--r--generic/ttk/ttkClassicTheme.c84
-rw-r--r--generic/ttk/ttkLabel.c59
-rw-r--r--generic/ttk/ttkManager.c18
-rw-r--r--generic/ttk/ttkProgress.c43
-rw-r--r--generic/ttk/ttkScale.c48
-rw-r--r--generic/ttk/ttkScrollbar.c24
-rw-r--r--generic/ttk/ttkSquare.c43
-rw-r--r--generic/ttk/ttkStubLib.c6
-rw-r--r--generic/ttk/ttkTagSet.c16
-rw-r--r--generic/ttk/ttkTrace.c8
12 files changed, 353 insertions, 232 deletions
diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c
index 1be7ee6..43fd95f 100644
--- a/generic/ttk/ttkButton.c
+++ b/generic/ttk/ttkButton.c
@@ -103,7 +103,7 @@ static Tk_OptionSpec BaseOptionSpecs[] =
*/
static void TextVariableChanged(void *clientData, const char *value)
{
- Base *basePtr = clientData;
+ Base *basePtr = (Base *)clientData;
Tcl_Obj *newText;
if (WidgetDestroyed(&basePtr->core)) {
@@ -120,9 +120,11 @@ static void TextVariableChanged(void *clientData, const char *value)
}
static void
-BaseInitialize(Tcl_Interp *interp, void *recordPtr)
+BaseInitialize(Tcl_Interp *dummy, void *recordPtr)
{
- Base *basePtr = recordPtr;
+ Base *basePtr = (Base *)recordPtr;
+ (void)dummy;
+
basePtr->base.textVariableTrace = 0;
basePtr->base.imageSpec = NULL;
}
@@ -130,7 +132,7 @@ BaseInitialize(Tcl_Interp *interp, void *recordPtr)
static void
BaseCleanup(void *recordPtr)
{
- Base *basePtr = recordPtr;
+ Base *basePtr = (Base *)recordPtr;
if (basePtr->base.textVariableTrace)
Ttk_UntraceVariable(basePtr->base.textVariableTrace);
if (basePtr->base.imageSpec)
@@ -143,12 +145,19 @@ BaseImageChanged(
int imageWidth, int imageHeight)
{
Base *basePtr = (Base *)clientData;
+ (void)x;
+ (void)y;
+ (void)width;
+ (void)height;
+ (void)imageWidth;
+ (void)imageHeight;
+
TtkResizeWidget(&basePtr->core);
}
static int BaseConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Base *basePtr = recordPtr;
+ Base *basePtr = (Base *)recordPtr;
Tcl_Obj *textVarName = basePtr->base.textVariableObj;
Ttk_TraceHandle *vt = 0;
Ttk_ImageSpec *imageSpec = NULL;
@@ -191,10 +200,12 @@ error:
}
static int
-BasePostConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
+BasePostConfigure(Tcl_Interp *dummy, void *recordPtr, int mask)
{
- Base *basePtr = recordPtr;
+ Base *basePtr = (Base *)recordPtr;
int status = TCL_OK;
+ (void)dummy;
+ (void)mask;
if (basePtr->base.textVariableTrace) {
status = Ttk_FireTrace(basePtr->base.textVariableTrace);
@@ -316,7 +327,7 @@ static Tk_OptionSpec ButtonOptionSpecs[] =
"", Tk_Offset(Button, button.commandObj), -1, 0,0,0},
{TK_OPTION_STRING_TABLE, "-default", "default", "Default",
"normal", Tk_Offset(Button, button.defaultStateObj), -1,
- 0, (ClientData) ttkDefaultStrings, DEFAULTSTATE_CHANGED},
+ 0, (void *)ttkDefaultStrings, DEFAULTSTATE_CHANGED},
WIDGET_TAKEFOCUS_TRUE,
WIDGET_INHERIT_OPTIONS(BaseOptionSpecs)
@@ -324,7 +335,7 @@ static Tk_OptionSpec ButtonOptionSpecs[] =
static int ButtonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Button *buttonPtr = recordPtr;
+ Button *buttonPtr = (Button *)recordPtr;
if (BaseConfigure(interp, recordPtr, mask) != TCL_OK) {
return TCL_ERROR;
@@ -352,7 +363,7 @@ static int
ButtonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Button *buttonPtr = recordPtr;
+ Button *buttonPtr = (Button *)recordPtr;
if (objc > 2) {
Tcl_WrongNumArgs(interp, 1, objv, "invoke");
return TCL_ERROR;
@@ -444,7 +455,7 @@ static Tk_OptionSpec CheckbuttonOptionSpecs[] =
*/
static void CheckbuttonVariableChanged(void *clientData, const char *value)
{
- Checkbutton *checkPtr = clientData;
+ Checkbutton *checkPtr = (Checkbutton *)clientData;
if (WidgetDestroyed(&checkPtr->core)) {
return;
@@ -466,7 +477,7 @@ static void CheckbuttonVariableChanged(void *clientData, const char *value)
static void
CheckbuttonInitialize(Tcl_Interp *interp, void *recordPtr)
{
- Checkbutton *checkPtr = recordPtr;
+ Checkbutton *checkPtr = (Checkbutton *)recordPtr;
Tcl_Obj *variableObj;
/* default -variable is the widget name:
@@ -480,7 +491,7 @@ CheckbuttonInitialize(Tcl_Interp *interp, void *recordPtr)
static void
CheckbuttonCleanup(void *recordPtr)
{
- Checkbutton *checkPtr = recordPtr;
+ Checkbutton *checkPtr = (Checkbutton *)recordPtr;
Ttk_UntraceVariable(checkPtr->checkbutton.variableTrace);
checkPtr->checkbutton.variableTrace = 0;
BaseCleanup(recordPtr);
@@ -489,10 +500,10 @@ CheckbuttonCleanup(void *recordPtr)
static int
CheckbuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Checkbutton *checkPtr = recordPtr;
+ Checkbutton *checkPtr = (Checkbutton *)recordPtr;
Tcl_Obj *varName = checkPtr->checkbutton.variableObj;
Ttk_TraceHandle *vt = NULL;
-
+
if (varName != NULL && *Tcl_GetString(varName) != '\0') {
vt = Ttk_TraceVariable(interp, varName,
CheckbuttonVariableChanged, checkPtr);
@@ -517,7 +528,7 @@ CheckbuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
static int
CheckbuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Checkbutton *checkPtr = recordPtr;
+ Checkbutton *checkPtr = (Checkbutton *)recordPtr;
int status = TCL_OK;
if (checkPtr->checkbutton.variableTrace)
@@ -535,7 +546,7 @@ static int
CheckbuttonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Checkbutton *checkPtr = recordPtr;
+ Checkbutton *checkPtr = (Checkbutton *)recordPtr;
WidgetCore *corePtr = &checkPtr->core;
Tcl_Obj *newValue;
@@ -650,7 +661,7 @@ static Tk_OptionSpec RadiobuttonOptionSpecs[] =
static void
RadiobuttonVariableChanged(void *clientData, const char *value)
{
- Radiobutton *radioPtr = clientData;
+ Radiobutton *radioPtr = (Radiobutton *)clientData;
if (WidgetDestroyed(&radioPtr->core)) {
return;
@@ -672,7 +683,7 @@ RadiobuttonVariableChanged(void *clientData, const char *value)
static void
RadiobuttonCleanup(void *recordPtr)
{
- Radiobutton *radioPtr = recordPtr;
+ Radiobutton *radioPtr = (Radiobutton *)recordPtr;
Ttk_UntraceVariable(radioPtr->radiobutton.variableTrace);
radioPtr->radiobutton.variableTrace = 0;
BaseCleanup(recordPtr);
@@ -681,7 +692,7 @@ RadiobuttonCleanup(void *recordPtr)
static int
RadiobuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Radiobutton *radioPtr = recordPtr;
+ Radiobutton *radioPtr = (Radiobutton *)recordPtr;
Ttk_TraceHandle *vt = Ttk_TraceVariable(
interp, radioPtr->radiobutton.variableObj,
RadiobuttonVariableChanged, radioPtr);
@@ -704,7 +715,7 @@ RadiobuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
static int
RadiobuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Radiobutton *radioPtr = recordPtr;
+ Radiobutton *radioPtr = (Radiobutton *)recordPtr;
int status = TCL_OK;
if (radioPtr->radiobutton.variableTrace)
@@ -722,7 +733,7 @@ static int
RadiobuttonInvokeCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Radiobutton *radioPtr = recordPtr;
+ Radiobutton *radioPtr = (Radiobutton *)recordPtr;
WidgetCore *corePtr = &radioPtr->core;
if (objc > 2) {
diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c
index 15ebcb7..299b568 100644
--- a/generic/ttk/ttkClamTheme.c
+++ b/generic/ttk/ttkClamTheme.c
@@ -7,8 +7,8 @@
#include <tk.h>
#include "ttkTheme.h"
-/*
- * Under windows, the Tk-provided XDrawLine and XDrawArc have an
+/*
+ * Under windows, the Tk-provided XDrawLine and XDrawArc have an
* off-by-one error in the end point. This is especially apparent with this
* theme. Defining this macro as true handles this case.
*/
@@ -117,36 +117,42 @@ static Ttk_ElementOptionSpec BorderElementOptions[] = {
Tk_Offset(BorderElement,reliefObj), "flat" },
{ "-borderwidth", TK_OPTION_PIXELS,
Tk_Offset(BorderElement,borderWidthObj), "2" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
/*
* <<NOTE-BORDERWIDTH>>: -borderwidth is only partially supported:
* in this theme, borders are always exactly 2 pixels thick.
- * With -borderwidth 0, border is not drawn at all;
- * otherwise a 2-pixel border is used. For -borderwidth > 2,
+ * With -borderwidth 0, border is not drawn at all;
+ * otherwise a 2-pixel border is used. For -borderwidth > 2,
* the excess is used as padding.
*/
static void BorderElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
BorderElement *border = (BorderElement*)elementRecord;
int borderWidth = 2;
+ (void)dummy;
+ (void)widthPtr;
+ (void)heightPtr;
+
Tk_GetPixelsFromObj(NULL, tkwin, border->borderWidthObj, &borderWidth);
if (borderWidth == 1) ++borderWidth;
*paddingPtr = Ttk_UniformPadding((short)borderWidth);
}
static void BorderElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- BorderElement *border = elementRecord;
+ BorderElement *border = (BorderElement *)elementRecord;
int relief = TK_RELIEF_FLAT;
int borderWidth = 2;
Tcl_Obj *outer = 0, *upper = 0, *lower = 0;
+ (void)dummy;
+ (void)state;
Tk_GetReliefFromObj(NULL, border->reliefObj, &relief);
Tk_GetPixelsFromObj(NULL, tkwin, border->borderWidthObj, &borderWidth);
@@ -205,25 +211,33 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = {
Tk_Offset(FieldElement,darkColorObj), DARK_COLOR },
{ "-fieldbackground", TK_OPTION_BORDER,
Tk_Offset(FieldElement,backgroundObj), "white" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void FieldElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
+ (void)dummy;
+ (void)elementRecord;
+ (void)tkwin;
+ (void)widthPtr;
+ (void)heightPtr;
+
*paddingPtr = Ttk_UniformPadding(2);
}
static void FieldElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- FieldElement *field = elementRecord;
+ FieldElement *field = (FieldElement *)elementRecord;
Tk_3DBorder bg = Tk_Get3DBorderFromObj(tkwin, field->backgroundObj);
Ttk_Box f = Ttk_PadBox(b, Ttk_UniformPadding(2));
Tcl_Obj *outer = field->borderColorObj,
*inner = field->lightColorObj;
+ (void)dummy;
+ (void)state;
DrawSmoothBorder(tkwin, d, b, outer, inner, inner);
Tk_Fill3DRectangle(
@@ -246,7 +260,7 @@ static void ComboboxFieldElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- FieldElement *field = elementRecord;
+ FieldElement *field = (FieldElement *)elementRecord;
GC gc = Ttk_GCForColor(tkwin,field->borderColorObj,d);
++b.width;
@@ -291,16 +305,19 @@ static Ttk_ElementOptionSpec IndicatorElementOptions[] = {
Tk_Offset(IndicatorElement,upperColorObj), DARKEST_COLOR },
{ "-lowerbordercolor", TK_OPTION_COLOR,
Tk_Offset(IndicatorElement,lowerColorObj), DARK_COLOR },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void IndicatorElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- IndicatorElement *indicator = elementRecord;
+ IndicatorElement *indicator = (IndicatorElement *)elementRecord;
Ttk_Padding margins;
int size = 10;
+ (void)dummy;
+ (void)paddingPtr;
+
Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins);
Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size);
*widthPtr = size + Ttk_PaddingWidth(margins);
@@ -308,15 +325,16 @@ static void IndicatorElementSize(
}
static void RadioIndicatorElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- IndicatorElement *indicator = elementRecord;
+ IndicatorElement *indicator = (IndicatorElement *)elementRecord;
GC gcb=Ttk_GCForColor(tkwin,indicator->backgroundObj,d);
GC gcf=Ttk_GCForColor(tkwin,indicator->foregroundObj,d);
GC gcu=Ttk_GCForColor(tkwin,indicator->upperColorObj,d);
GC gcl=Ttk_GCForColor(tkwin,indicator->lowerColorObj,d);
Ttk_Padding padding;
+ (void)dummy;
Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding);
b = Ttk_PadBox(b, padding);
@@ -336,17 +354,19 @@ static void RadioIndicatorElementDraw(
}
static void CheckIndicatorElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
Display *display = Tk_Display(tkwin);
- IndicatorElement *indicator = elementRecord;
+ IndicatorElement *indicator = (IndicatorElement *)elementRecord;
+
GC gcb=Ttk_GCForColor(tkwin,indicator->backgroundObj,d);
GC gcf=Ttk_GCForColor(tkwin,indicator->foregroundObj,d);
GC gcu=Ttk_GCForColor(tkwin,indicator->upperColorObj,d);
GC gcl=Ttk_GCForColor(tkwin,indicator->lowerColorObj,d);
Ttk_Padding padding;
const int w = WIN32_XDRAWLINE_HACK;
+ (void)dummy;
Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding);
b = Ttk_PadBox(b, padding);
@@ -402,7 +422,7 @@ typedef struct {
static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] =
{
{ "-arrowsize", TK_OPTION_PIXELS,
- Tk_Offset(MenuIndicatorElement,sizeObj),
+ Tk_Offset(MenuIndicatorElement,sizeObj),
STR(MENUBUTTON_ARROW_SIZE)},
{ "-arrowcolor",TK_OPTION_COLOR,
Tk_Offset(MenuIndicatorElement,colorObj),
@@ -410,16 +430,19 @@ static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] =
{ "-arrowpadding",TK_OPTION_STRING,
Tk_Offset(MenuIndicatorElement,paddingObj),
"3" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void MenuIndicatorElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- MenuIndicatorElement *indicator = elementRecord;
+ MenuIndicatorElement *indicator = (MenuIndicatorElement *)elementRecord;
Ttk_Padding margins;
int size = MENUBUTTON_ARROW_SIZE;
+ (void)dummy;
+ (void)paddingPtr;
+
Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size);
Ttk_GetPaddingFromObj(NULL, tkwin, indicator->paddingObj, &margins);
TtkArrowSize(size, ARROW_DOWN, widthPtr, heightPtr);
@@ -428,14 +451,16 @@ static void MenuIndicatorElementSize(
}
static void MenuIndicatorElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- MenuIndicatorElement *indicator = elementRecord;
+ MenuIndicatorElement *indicator = (MenuIndicatorElement *)elementRecord;
XColor *arrowColor = Tk_GetColorFromObj(tkwin, indicator->colorObj);
GC gc = Tk_GCForColor(arrowColor, d);
int size = MENUBUTTON_ARROW_SIZE;
int width, height;
+ (void)dummy;
+ (void)state;
Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size);
@@ -476,7 +501,7 @@ static Ttk_ElementOptionSpec GripElementOptions[] = {
Tk_Offset(GripElement,borderColorObj), DARKEST_COLOR },
{ "-gripcount", TK_OPTION_INT,
Tk_Offset(GripElement,gripCountObj), "5" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void GripElementSize(
@@ -484,8 +509,10 @@ static void GripElementSize(
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL;
- GripElement *grip = elementRecord;
+ GripElement *grip = (GripElement *)elementRecord;
int gripCount = 0;
+ (void)tkwin;
+ (void)paddingPtr;
Tcl_GetIntFromObj(NULL, grip->gripCountObj, &gripCount);
if (horizontal) {
@@ -501,7 +528,7 @@ static void GripElementDraw(
{
const int w = WIN32_XDRAWLINE_HACK;
int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL;
- GripElement *grip = elementRecord;
+ GripElement *grip = (GripElement *)elementRecord;
GC lightGC = Ttk_GCForColor(tkwin,grip->lightColorObj,d);
GC darkGC = Ttk_GCForColor(tkwin,grip->borderColorObj,d);
int gripPad = 1, gripCount = 0;
@@ -575,16 +602,19 @@ static Ttk_ElementOptionSpec ScrollbarElementOptions[] = {
Tk_Offset(ScrollbarElement,gripCountObj), "5" },
{ "-sliderlength", TK_OPTION_INT,
Tk_Offset(ScrollbarElement,sliderlengthObj), "30" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void TroughElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- ScrollbarElement *sb = elementRecord;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
GC gcb = Ttk_GCForColor(tkwin,sb->borderColorObj,d);
GC gct = Ttk_GCForColor(tkwin,sb->troughColorObj,d);
+ (void)dummy;
+ (void)state;
+
XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, b.width-1, b.height-1);
XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, b.width-1, b.height-1);
}
@@ -598,24 +628,31 @@ static Ttk_ElementSpec TroughElementSpec = {
};
static void ThumbElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ScrollbarElement *sb = elementRecord;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
int size = SCROLLBAR_THICKNESS;
+ (void)dummy;
+ (void)tkwin;
+ (void)paddingPtr;
+
Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size);
*widthPtr = *heightPtr = size;
}
static void ThumbElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- ScrollbarElement *sb = elementRecord;
- int gripCount = 0, orient = TTK_ORIENT_HORIZONTAL;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
+ int gripCount = 0;
+ int orient = TTK_ORIENT_HORIZONTAL;
GC lightGC, darkGC;
int x1, y1, x2, y2, dx, dy, i;
const int w = WIN32_XDRAWLINE_HACK;
+ (void)dummy;
+ (void)state;
DrawSmoothBorder(tkwin, d, b,
sb->borderColorObj, sb->lightColorObj, sb->darkColorObj);
@@ -630,7 +667,7 @@ static void ThumbElementDraw(
Tcl_GetIntFromObj(NULL, sb->gripCountObj, &gripCount);
lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d);
darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d);
-
+
if (orient == TTK_ORIENT_HORIZONTAL) {
dx = 1; dy = 0;
x1 = x2 = b.x + b.width / 2 - gripCount;
@@ -663,11 +700,14 @@ static Ttk_ElementSpec ThumbElementSpec = {
* +++ Slider element.
*/
static void SliderElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ScrollbarElement *sb = elementRecord;
- int length, thickness, orient;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
+ int length, thickness;
+ int orient;
+ (void)dummy;
+ (void)paddingPtr;
length = thickness = SCROLLBAR_THICKNESS;
Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient);
@@ -706,16 +746,18 @@ static void PbarElementSize(
}
static void PbarElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- ScrollbarElement *sb = elementRecord;
-
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
+ (void)dummy;
+ (void)state;
+
b = Ttk_PadBox(b, Ttk_UniformPadding(2));
if (b.width > 4 && b.height > 4) {
DrawSmoothBorder(tkwin, d, b,
sb->borderColorObj, sb->lightColorObj, sb->darkColorObj);
- XFillRectangle(Tk_Display(tkwin), d,
+ XFillRectangle(Tk_Display(tkwin), d,
BackgroundGC(tkwin, sb->backgroundObj),
b.x+2, b.y+2, b.width-4, b.height-4);
}
@@ -736,11 +778,15 @@ static Ttk_ElementSpec PbarElementSpec = {
static int ArrowElements[] = { ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT };
static void ArrowElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ScrollbarElement *sb = elementRecord;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
int size = SCROLLBAR_THICKNESS;
+ (void)dummy;
+ (void)tkwin;
+ (void)paddingPtr;
+
Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size);
*widthPtr = *heightPtr = size;
}
@@ -749,8 +795,8 @@ static void ArrowElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned state)
{
- ArrowDirection dir = *(ArrowDirection*)clientData;
- ScrollbarElement *sb = elementRecord;
+ ArrowDirection direction = *(ArrowDirection*)clientData;
+ ScrollbarElement *sb = (ScrollbarElement *)elementRecord;
GC gc = Ttk_GCForColor(tkwin,sb->arrowColorObj, d);
int h, cx, cy;
@@ -763,10 +809,10 @@ static void ArrowElementDraw(
b = Ttk_PadBox(b, Ttk_UniformPadding(3));
h = b.width < b.height ? b.width : b.height;
- TtkArrowSize(h/2, dir, &cx, &cy);
+ TtkArrowSize(h/2, direction, &cx, &cy);
b = Ttk_AnchorBox(b, cx, cy, TK_ANCHOR_CENTER);
- TtkFillArrow(Tk_Display(tkwin), d, gc, b, dir);
+ TtkFillArrow(Tk_Display(tkwin), d, gc, b, direction);
}
static Ttk_ElementSpec ArrowElementSpec = {
@@ -780,8 +826,8 @@ static Ttk_ElementSpec ArrowElementSpec = {
/*------------------------------------------------------------------------
* +++ Notebook elements.
- *
- * Note: Tabs, except for the rightmost, overlap the neighbor to
+ *
+ * Note: Tabs, except for the rightmost, overlap the neighbor to
* their right by one pixel.
*/
@@ -801,29 +847,36 @@ static Ttk_ElementOptionSpec NotebookElementOptions[] = {
Tk_Offset(NotebookElement,lightColorObj), LIGHT_COLOR },
{ "-darkcolor", TK_OPTION_COLOR,
Tk_Offset(NotebookElement,darkColorObj), DARK_COLOR },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void TabElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
int borderWidth = 2;
+ (void)dummy;
+ (void)elementRecord;
+ (void)tkwin;
+ (void)widthPtr;
+ (void)heightPtr;
+
paddingPtr->top = paddingPtr->left = paddingPtr->right = borderWidth;
paddingPtr->bottom = 0;
}
static void TabElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- NotebookElement *tab = elementRecord;
+ NotebookElement *tab = (NotebookElement *)elementRecord;
Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj);
Display *display = Tk_Display(tkwin);
int borderWidth = 2, dh = 0;
int x1,y1,x2,y2;
GC gc;
const int w = WIN32_XDRAWLINE_HACK;
+ (void)dummy;
if (state & TTK_STATE_SELECTED) {
dh = borderWidth;
@@ -860,20 +913,28 @@ static Ttk_ElementSpec TabElementSpec =
};
static void ClientElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
int borderWidth = 2;
+ (void)dummy;
+ (void)elementRecord;
+ (void)tkwin;
+ (void)widthPtr;
+ (void)heightPtr;
+
*paddingPtr = Ttk_UniformPadding((short)borderWidth);
}
static void ClientElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- NotebookElement *ce = elementRecord;
+ NotebookElement *ce = (NotebookElement *)elementRecord;
Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj);
int borderWidth = 2;
+ (void)dummy;
+ (void)state;
Tk_Fill3DRectangle(tkwin, d, border,
b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_FLAT);
diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c
index e0886f2..4b245c7 100644
--- a/generic/ttk/ttkClassicTheme.c
+++ b/generic/ttk/ttkClassicTheme.c
@@ -26,27 +26,34 @@ static Ttk_ElementOptionSpec HighlightElementOptions[] = {
Tk_Offset(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND },
{ "-highlightthickness",TK_OPTION_PIXELS,
Tk_Offset(HighlightElement,highlightThicknessObj), "0" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void HighlightElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- HighlightElement *hl = elementRecord;
+ HighlightElement *hl = (HighlightElement *)elementRecord;
int highlightThickness = 0;
+ (void)dummy;
+ (void)tkwin;
+ (void)widthPtr;
+ (void)heightPtr;
Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness);
*paddingPtr = Ttk_UniformPadding((short)highlightThickness);
}
static void HighlightElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- HighlightElement *hl = elementRecord;
+ HighlightElement *hl = (HighlightElement *)elementRecord;
int highlightThickness = 0;
XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj);
+ (void)dummy;
+ (void)b;
+ (void)state;
Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness);
if (highlightColor && highlightThickness > 0) {
@@ -66,7 +73,7 @@ static Ttk_ElementSpec HighlightElementSpec =
/*------------------------------------------------------------------------
* +++ Button Border element:
- *
+ *
* The Motif-style button border on X11 consists of (from outside-in):
*
* + focus indicator (controlled by -highlightcolor and -highlightthickness),
@@ -83,24 +90,28 @@ typedef struct {
static Ttk_ElementOptionSpec ButtonBorderElementOptions[] =
{
- { "-background", TK_OPTION_BORDER,
+ { "-background", TK_OPTION_BORDER,
Tk_Offset(ButtonBorderElement,borderObj), DEFAULT_BACKGROUND },
- { "-borderwidth", TK_OPTION_PIXELS,
+ { "-borderwidth", TK_OPTION_PIXELS,
Tk_Offset(ButtonBorderElement,borderWidthObj), DEFAULT_BORDERWIDTH },
- { "-relief", TK_OPTION_RELIEF,
+ { "-relief", TK_OPTION_RELIEF,
Tk_Offset(ButtonBorderElement,reliefObj), "flat" },
- { "-default", TK_OPTION_ANY,
+ { "-default", TK_OPTION_ANY,
Tk_Offset(ButtonBorderElement,defaultStateObj), "disabled" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void ButtonBorderElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ButtonBorderElement *bd = elementRecord;
+ ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord;
int defaultState = TTK_BUTTON_DEFAULT_DISABLED;
int borderWidth = 0;
+ (void)dummy;
+ (void)tkwin;
+ (void)widthPtr;
+ (void)heightPtr;
Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth);
Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);
@@ -113,18 +124,20 @@ static void ButtonBorderElementSize(
/*
* (@@@ Note: ButtonBorderElement still still still buggy:
- * padding for default ring is drawn in the wrong color
+ * padding for default ring is drawn in the wrong color
* when the button is active.)
*/
static void ButtonBorderElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- ButtonBorderElement *bd = elementRecord;
+ ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord;
Tk_3DBorder border = NULL;
int borderWidth = 1, relief = TK_RELIEF_FLAT;
int defaultState = TTK_BUTTON_DEFAULT_DISABLED;
int inset = 0;
+ (void)dummy;
+ (void)state;
/*
* Get option values.
@@ -204,15 +217,17 @@ static Ttk_ElementOptionSpec ArrowElementOptions[] =
{ "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,borderWidthObj),
DEFAULT_BORDERWIDTH },
{ "-relief", TK_OPTION_RELIEF, Tk_Offset(ArrowElement,reliefObj),"raised" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void ArrowElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ArrowElement *arrow = elementRecord;
+ ArrowElement *arrow = (ArrowElement *)elementRecord;
int size = 12;
+ (void)dummy;
+ (void)paddingPtr;
Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &size);
*widthPtr = *heightPtr = size;
@@ -223,12 +238,13 @@ static void ArrowElementDraw(
Drawable d, Ttk_Box b, unsigned int state)
{
int direction = *(int *)clientData;
- ArrowElement *arrow = elementRecord;
+ ArrowElement *arrow = (ArrowElement *)elementRecord;
Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj);
int borderWidth = 2;
int relief = TK_RELIEF_RAISED;
int size = b.width < b.height ? b.width : b.height;
XPoint points[3];
+ (void)state;
Tk_GetPixelsFromObj(NULL, tkwin, arrow->borderWidthObj, &borderWidth);
Tk_GetReliefFromObj(NULL, arrow->reliefObj, &relief);
@@ -279,19 +295,19 @@ static Ttk_ElementSpec ArrowElementSpec =
/*------------------------------------------------------------------------
* +++ Sash element (for ttk::panedwindow)
*
- * NOTES:
+ * NOTES:
*
* panedwindows with -orient horizontal use vertical sashes, and vice versa.
*
* Interpretation of -sashrelief 'groove' and 'ridge' are
* swapped wrt. the core panedwindow, which (I think) has them backwards.
*
- * Default -sashrelief is sunken; the core panedwindow has default
+ * Default -sashrelief is sunken; the core panedwindow has default
* -sashrelief raised, but that looks wrong to me.
*/
static Ttk_Orient SashClientData[] = {
- TTK_ORIENT_HORIZONTAL, TTK_ORIENT_VERTICAL
+ TTK_ORIENT_HORIZONTAL, TTK_ORIENT_VERTICAL
};
typedef struct {
@@ -304,28 +320,29 @@ typedef struct {
} SashElement;
static Ttk_ElementOptionSpec SashOptions[] = {
- { "-background", TK_OPTION_BORDER,
+ { "-background", TK_OPTION_BORDER,
Tk_Offset(SashElement,borderObj), DEFAULT_BACKGROUND },
- { "-sashrelief", TK_OPTION_RELIEF,
+ { "-sashrelief", TK_OPTION_RELIEF,
Tk_Offset(SashElement,sashReliefObj), "sunken" },
{ "-sashthickness", TK_OPTION_PIXELS,
Tk_Offset(SashElement,sashThicknessObj), "6" },
- { "-sashpad", TK_OPTION_PIXELS,
+ { "-sashpad", TK_OPTION_PIXELS,
Tk_Offset(SashElement,sashPadObj), "2" },
{ "-handlesize", TK_OPTION_PIXELS,
Tk_Offset(SashElement,handleSizeObj), "8" },
{ "-handlepad", TK_OPTION_PIXELS,
Tk_Offset(SashElement,handlePadObj), "8" },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static void SashElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- SashElement *sash = elementRecord;
+ SashElement *sash = (SashElement *)elementRecord;
int sashPad = 2, sashThickness = 6, handleSize = 8;
int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL;
+ (void)paddingPtr;
Tk_GetPixelsFromObj(NULL, tkwin, sash->sashThicknessObj, &sashThickness);
Tk_GetPixelsFromObj(NULL, tkwin, sash->handleSizeObj, &handleSize);
@@ -344,13 +361,14 @@ static void SashElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- SashElement *sash = elementRecord;
+ SashElement *sash = (SashElement *)elementRecord;
Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, sash->borderObj);
GC gc1,gc2;
int relief = TK_RELIEF_RAISED;
int handleSize = 8, handlePad = 8;
int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL;
Ttk_Box hb;
+ (void)state;
Tk_GetPixelsFromObj(NULL, tkwin, sash->handleSizeObj, &handleSize);
Tk_GetPixelsFromObj(NULL, tkwin, sash->handlePadObj, &handlePad);
@@ -365,10 +383,10 @@ static void SashElementDraw(
gc1 = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC);
gc2 = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC);
break;
- case TK_RELIEF_SOLID:
+ case TK_RELIEF_SOLID:
gc1 = gc2 = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC);
break;
- case TK_RELIEF_FLAT:
+ case TK_RELIEF_FLAT:
default:
gc1 = gc2 = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC);
break;
@@ -396,7 +414,7 @@ static void SashElementDraw(
hb = Ttk_StickBox(b, handleSize, handleSize, TTK_STICK_N);
hb.y += handlePad;
}
- Tk_Fill3DRectangle(tkwin, d, border,
+ Tk_Fill3DRectangle(tkwin, d, border,
hb.x, hb.y, hb.width, hb.height, 1, TK_RELIEF_RAISED);
}
}
@@ -493,7 +511,7 @@ MODULE_SCOPE int TtkClassicTheme_Init(Tcl_Interp *interp)
Ttk_RegisterElement(interp, theme, "arrow",
&ArrowElementSpec, &ArrowElements[0]);
- Ttk_RegisterElement(interp, theme, "hsash",
+ Ttk_RegisterElement(interp, theme, "hsash",
&SashElementSpec, &SashClientData[0]);
Ttk_RegisterElement(interp, theme, "vsash",
&SashElementSpec, &SashClientData[1]);
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 3cebc14..6f32299 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -65,7 +65,7 @@ static Ttk_ElementOptionSpec TextElementOptions[] = {
Tk_Offset(TextElement,wrapLengthObj), "0" },
{ "-embossed", TK_OPTION_INT,
Tk_Offset(TextElement,embossedObj), "0"},
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
static int TextSetup(TextElement *text, Tk_Window tkwin)
@@ -138,7 +138,7 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b)
gcValues.foreground = WhitePixelOfScreen(Tk_Screen(tkwin));
gc2 = Tk_GetGC(tkwin, GCFont | GCForeground, &gcValues);
- /*
+ /*
* Place text according to -anchor:
*/
Tk_GetAnchorFromObj(NULL, text->anchorObj, &anchor);
@@ -193,10 +193,12 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b)
}
static void TextElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- TextElement *text = elementRecord;
+ TextElement *text = (TextElement *)elementRecord;
+ (void)dummy;
+ (void)paddingPtr;
if (!TextSetup(text, tkwin))
return;
@@ -210,10 +212,13 @@ static void TextElementSize(
}
static void TextElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- TextElement *text = elementRecord;
+ TextElement *text = (TextElement *)elementRecord;
+ (void)dummy;
+ (void)state;
+
if (TextSetup(text, tkwin)) {
TextDraw(text, tkwin, d, b);
TextCleanup(text);
@@ -253,7 +258,7 @@ static Ttk_ElementOptionSpec ImageElementOptions[] = {
Tk_Offset(ImageElement,stippleObj), "gray50" },
{ "-background", TK_OPTION_COLOR,
Tk_Offset(ImageElement,backgroundObj), DEFAULT_BACKGROUND },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
/*
@@ -341,15 +346,15 @@ static void ImageDraw(
Tk_RedrawImage(image->tkimg, 0,0, width, height, d, b.x, b.y);
- /* If we're disabled there's no state-specific 'disabled' image,
+ /* If we're disabled there's no state-specific 'disabled' image,
* stipple the image.
* @@@ Possibly: Don't do disabled-stippling at all;
* @@@ it's ugly and out of fashion.
- * Do not stipple at all under Aqua, just draw the image: it shows up
+ * Do not stipple at all under Aqua, just draw the image: it shows up
* as a white rectangle otherwise.
*/
-
+
if (state & TTK_STATE_DISABLED) {
if (TtkSelectImage(image->imageSpec, 0ul) == image->tkimg) {
#ifndef MAC_OSX_TK
@@ -360,10 +365,12 @@ static void ImageDraw(
}
static void ImageElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ImageElement *image = elementRecord;
+ ImageElement *image = (ImageElement *)elementRecord;
+ (void)dummy;
+ (void)paddingPtr;
if (ImageSetup(image, tkwin, 0)) {
*widthPtr = image->width;
@@ -373,10 +380,11 @@ static void ImageElementSize(
}
static void ImageElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- ImageElement *image = elementRecord;
+ ImageElement *image = (ImageElement *)elementRecord;
+ (void)dummy;
if (ImageSetup(image, tkwin, state)) {
ImageDraw(image, tkwin, d, b, state);
@@ -477,7 +485,7 @@ static Ttk_ElementOptionSpec LabelElementOptions[] = {
Tk_Offset(LabelElement,image.stippleObj), "gray50" },
{ "-background", TK_OPTION_COLOR,
Tk_Offset(LabelElement,image.backgroundObj), DEFAULT_BACKGROUND },
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
/*
@@ -494,8 +502,8 @@ static void LabelSetup(
{
Ttk_Compound *compoundPtr = &c->compound;
- Tk_GetPixelsFromObj(NULL,tkwin,c->spaceObj,&c->space);
- Ttk_GetCompoundFromObj(NULL,c->compoundObj,(int*)compoundPtr);
+ Tk_GetPixelsFromObj(NULL, tkwin, c->spaceObj, &c->space);
+ Ttk_GetCompoundFromObj(NULL, c->compoundObj, (int *)compoundPtr);
/*
* Deal with TTK_COMPOUND_NONE.
@@ -561,11 +569,13 @@ static void LabelCleanup(LabelElement *c)
}
static void LabelElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- LabelElement *label = elementRecord;
+ LabelElement *label = (LabelElement *)elementRecord;
int textReqWidth = 0;
+ (void)dummy;
+ (void)paddingPtr;
LabelSetup(label, tkwin, 0);
@@ -576,7 +586,7 @@ static void LabelElementSize(
if (label->compound != TTK_COMPOUND_IMAGE)
textReqWidth = TextReqWidth(&label->text);
- switch (label->compound)
+ switch (label->compound)
{
case TTK_COMPOUND_TEXT:
*widthPtr = textReqWidth;
@@ -587,11 +597,11 @@ static void LabelElementSize(
case TTK_COMPOUND_TOP:
case TTK_COMPOUND_BOTTOM:
case TTK_COMPOUND_CENTER:
- *widthPtr = MAX(label->image.width, textReqWidth);
+ *widthPtr = MAX(label->image.width, textReqWidth);
break;
case TTK_COMPOUND_LEFT:
case TTK_COMPOUND_RIGHT:
- *widthPtr = label->image.width + textReqWidth + label->space;
+ *widthPtr = label->image.width + textReqWidth + label->space;
break;
case TTK_COMPOUND_NONE:
break; /* Can't happen */
@@ -618,11 +628,12 @@ static void DrawCompound(
}
static void LabelElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- LabelElement *l = elementRecord;
+ LabelElement *l = (LabelElement *)elementRecord;
Tk_Anchor anchor = TK_ANCHOR_CENTER;
+ (void)dummy;
LabelSetup(l, tkwin, state);
diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c
index 24a0fb1..c396f63 100644
--- a/generic/ttk/ttkManager.c
+++ b/generic/ttk/ttkManager.c
@@ -116,7 +116,7 @@ static void RecomputeLayout(Ttk_Manager *mgr)
*/
static void ManagerIdleProc(ClientData clientData)
{
- Ttk_Manager *mgr = clientData;
+ Ttk_Manager *mgr = (Ttk_Manager *)clientData;
mgr->flags &= ~MGR_UPDATE_PENDING;
if (mgr->flags & MGR_RESIZE_REQUIRED) {
@@ -142,7 +142,7 @@ static void ManagerIdleProc(ClientData clientData)
static const int ManagerEventMask = StructureNotifyMask;
static void ManagerEventHandler(ClientData clientData, XEvent *eventPtr)
{
- Ttk_Manager *mgr = clientData;
+ Ttk_Manager *mgr = (Ttk_Manager *)clientData;
int i;
switch (eventPtr->type)
@@ -174,7 +174,7 @@ static void ManagerEventHandler(ClientData clientData, XEvent *eventPtr)
static const unsigned SlaveEventMask = StructureNotifyMask;
static void SlaveEventHandler(ClientData clientData, XEvent *eventPtr)
{
- Ttk_Slave *slave = clientData;
+ Ttk_Slave *slave = (Ttk_Slave *)clientData;
if (eventPtr->type == DestroyNotify) {
slave->manager->managerSpec->tkGeomMgr.lostSlaveProc(
slave->manager, slave->slaveWindow);
@@ -188,7 +188,7 @@ static void SlaveEventHandler(ClientData clientData, XEvent *eventPtr)
static Ttk_Slave *NewSlave(
Ttk_Manager *mgr, Tk_Window slaveWindow, void *slaveData)
{
- Ttk_Slave *slave = ckalloc(sizeof(*slave));
+ Ttk_Slave *slave = (Ttk_Slave *)ckalloc(sizeof(*slave));
slave->slaveWindow = slaveWindow;
slave->manager = mgr;
@@ -210,7 +210,7 @@ static void DeleteSlave(Ttk_Slave *slave)
Ttk_Manager *Ttk_CreateManager(
Ttk_ManagerSpec *managerSpec, void *managerData, Tk_Window masterWindow)
{
- Ttk_Manager *mgr = ckalloc(sizeof(*mgr));
+ Ttk_Manager *mgr = (Ttk_Manager *)ckalloc(sizeof(*mgr));
mgr->managerSpec = managerSpec;
mgr->managerData = managerData;
@@ -252,7 +252,7 @@ void Ttk_DeleteManager(Ttk_Manager *mgr)
static void InsertSlave(Ttk_Manager *mgr, Ttk_Slave *slave, int index)
{
int endIndex = mgr->nSlaves++;
- mgr->slaves = ckrealloc(mgr->slaves, mgr->nSlaves * sizeof(Ttk_Slave *));
+ mgr->slaves = (Ttk_Slave **)ckrealloc(mgr->slaves, mgr->nSlaves * sizeof(Ttk_Slave *));
while (endIndex > index) {
mgr->slaves[endIndex] = mgr->slaves[endIndex - 1];
@@ -314,13 +314,13 @@ static void RemoveSlave(Ttk_Manager *mgr, int index)
void Ttk_GeometryRequestProc(ClientData clientData, Tk_Window slaveWindow)
{
- Ttk_Manager *mgr = clientData;
+ Ttk_Manager *mgr = (Ttk_Manager *)clientData;
int slaveIndex = Ttk_SlaveIndex(mgr, slaveWindow);
int reqWidth = Tk_ReqWidth(slaveWindow);
int reqHeight= Tk_ReqHeight(slaveWindow);
if (mgr->managerSpec->SlaveRequest(
- mgr->managerData, slaveIndex, reqWidth, reqHeight))
+ mgr->managerData, slaveIndex, reqWidth, reqHeight))
{
ScheduleUpdate(mgr, MGR_RESIZE_REQUIRED);
}
@@ -328,7 +328,7 @@ void Ttk_GeometryRequestProc(ClientData clientData, Tk_Window slaveWindow)
void Ttk_LostSlaveProc(ClientData clientData, Tk_Window slaveWindow)
{
- Ttk_Manager *mgr = clientData;
+ Ttk_Manager *mgr = (Ttk_Manager *)clientData;
int index = Ttk_SlaveIndex(mgr, slaveWindow);
/* ASSERT: index >= 0 */
diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c
index 6c13992..eb776ba 100644
--- a/generic/ttk/ttkProgress.c
+++ b/generic/ttk/ttkProgress.c
@@ -100,7 +100,7 @@ static int AnimationEnabled(Progressbar *pb)
*/
static void AnimateProgressProc(ClientData clientData)
{
- Progressbar *pb = clientData;
+ Progressbar *pb = (Progressbar *)clientData;
pb->progress.timer = 0;
@@ -137,7 +137,7 @@ static void CheckAnimation(Progressbar *pb)
if (AnimationEnabled(pb)) {
if (pb->progress.timer == 0) {
pb->progress.timer = Tcl_CreateTimerHandler(
- pb->progress.period, AnimateProgressProc, (ClientData)pb);
+ pb->progress.period, AnimateProgressProc, pb);
}
} else {
if (pb->progress.timer != 0) {
@@ -153,7 +153,7 @@ static void CheckAnimation(Progressbar *pb)
static void VariableChanged(void *recordPtr, const char *value)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
Tcl_Obj *newValue;
double scratch;
@@ -186,16 +186,18 @@ static void VariableChanged(void *recordPtr, const char *value)
* +++ Widget class methods:
*/
-static void ProgressbarInitialize(Tcl_Interp *interp, void *recordPtr)
+static void ProgressbarInitialize(Tcl_Interp *dummy, void *recordPtr)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
+ (void)dummy;
+
pb->progress.variableTrace = 0;
pb->progress.timer = 0;
}
static void ProgressbarCleanup(void *recordPtr)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
if (pb->progress.variableTrace)
Ttk_UntraceVariable(pb->progress.variableTrace);
if (pb->progress.timer)
@@ -209,7 +211,7 @@ static void ProgressbarCleanup(void *recordPtr)
*/
static int ProgressbarConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
Tcl_Obj *varName = pb->progress.variableObj;
Ttk_TraceHandle *vt = 0;
@@ -235,10 +237,12 @@ static int ProgressbarConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
* Post-configuration hook:
*/
static int ProgressbarPostConfigure(
- Tcl_Interp *interp, void *recordPtr, int mask)
+ Tcl_Interp *dummy, void *recordPtr, int mask)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
int status = TCL_OK;
+ (void)dummy;
+ (void)mask;
if (pb->progress.variableTrace) {
status = Ttk_FireTrace(pb->progress.variableTrace);
@@ -266,8 +270,9 @@ static int ProgressbarPostConfigure(
*/
static int ProgressbarSize(void *recordPtr, int *widthPtr, int *heightPtr)
{
- Progressbar *pb = recordPtr;
- int length = 100, orient = TTK_ORIENT_HORIZONTAL;
+ Progressbar *pb = (Progressbar *)recordPtr;
+ int length = 100;
+ int orient = TTK_ORIENT_HORIZONTAL;
TtkWidgetSize(recordPtr, widthPtr, heightPtr);
@@ -334,7 +339,7 @@ static void ProgressbarIndeterminateLayout(
static void ProgressbarDoLayout(void *recordPtr)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
WidgetCore *corePtr = &pb->core;
Ttk_Element pbar = Ttk_FindElement(corePtr->layout, "pbar");
double value = 0.0, maximum = 100.0;
@@ -366,7 +371,7 @@ static void ProgressbarDoLayout(void *recordPtr)
static Ttk_Layout ProgressbarGetLayout(
Tcl_Interp *interp, Ttk_Theme theme, void *recordPtr)
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
Ttk_Layout layout = TtkWidgetGetOrientedLayout(
interp, theme, recordPtr, pb->progress.orientObj);
@@ -396,9 +401,9 @@ static Ttk_Layout ProgressbarGetLayout(
static int ProgressbarStepCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Progressbar *pb = recordPtr;
+ Progressbar *pb = (Progressbar *)recordPtr;
double value = 0.0, stepAmount = 1.0;
- Tcl_Obj *newValueObj;
+ Tcl_Obj *newValueObj;
if (objc == 3) {
if (Tcl_GetDoubleFromObj(interp, objv[2], &stepAmount) != TCL_OK) {
@@ -425,7 +430,7 @@ static int ProgressbarStepCommand(
TtkRedisplayWidget(&pb->core);
- /* Update value by setting the linked -variable, if there is one:
+ /* Update value by setting the linked -variable, if there is one:
*/
if (pb->progress.variableTrace) {
int result = Tcl_ObjSetVar2(
@@ -446,7 +451,7 @@ static int ProgressbarStepCommand(
}
/* $sb start|stop ?args? --
- * Change [$sb $cmd ...] to [ttk::progressbar::$cmd ...]
+ * Change [$sb $cmd ...] to [ttk::progressbar::$cmd ...]
* and pass to interpreter.
*/
static int ProgressbarStartStopCommand(
@@ -472,6 +477,8 @@ static int ProgressbarStartStopCommand(
static int ProgressbarStartCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
+ (void)recordPtr;
+
return ProgressbarStartStopCommand(
interp, "::ttk::progressbar::start", objc, objv);
}
@@ -479,6 +486,8 @@ static int ProgressbarStartCommand(
static int ProgressbarStopCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
+ (void)recordPtr;
+
return ProgressbarStartStopCommand(
interp, "::ttk::progressbar::stop", objc, objv);
}
diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c
index 279fc7a..8348fb5 100644
--- a/generic/ttk/ttkScale.c
+++ b/generic/ttk/ttkScale.c
@@ -55,14 +55,14 @@ typedef struct
static Tk_OptionSpec ScaleOptionSpecs[] =
{
{TK_OPTION_STRING, "-command", "command", "Command", "",
- Tk_Offset(Scale,scale.commandObj), -1,
+ Tk_Offset(Scale,scale.commandObj), -1,
TK_OPTION_NULL_OK,0,0},
{TK_OPTION_STRING, "-variable", "variable", "Variable", "",
- Tk_Offset(Scale,scale.variableObj), -1,
+ Tk_Offset(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,
+ Tk_Offset(Scale,scale.orient), 0,
(ClientData)ttkOrientStrings, STYLE_CHANGED },
{TK_OPTION_DOUBLE, "-from", "from", "From", "0",
@@ -72,7 +72,7 @@ static Tk_OptionSpec ScaleOptionSpecs[] =
{TK_OPTION_DOUBLE, "-value", "value", "Value", "0",
Tk_Offset(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, Tk_Offset(Scale,scale.lengthObj), -1, 0, 0,
GEOMETRY_CHANGED},
{TK_OPTION_STRING, "-state", "state", "State",
@@ -89,12 +89,12 @@ static double PointToValue(Scale *scalePtr, int x, int y);
/* ScaleVariableChanged --
* Variable trace procedure for scale -variable;
* Updates the scale's value.
- * If the linked variable is not a valid double,
+ * If the linked variable is not a valid double,
* sets the 'invalid' state.
*/
static void ScaleVariableChanged(void *recordPtr, const char *value)
{
- Scale *scale = recordPtr;
+ Scale *scale = (Scale *)recordPtr;
double v;
if (value == NULL || Tcl_GetDouble(0, value, &v) != TCL_OK) {
@@ -112,15 +112,17 @@ static void ScaleVariableChanged(void *recordPtr, const char *value)
/* ScaleInitialize --
* Scale widget initialization hook.
*/
-static void ScaleInitialize(Tcl_Interp *interp, void *recordPtr)
+static void ScaleInitialize(Tcl_Interp *dummy, void *recordPtr)
{
- Scale *scalePtr = recordPtr;
+ Scale *scalePtr = (Scale *)recordPtr;
+ (void)dummy;
+
TtkTrackElementState(&scalePtr->core);
}
static void ScaleCleanup(void *recordPtr)
{
- Scale *scale = recordPtr;
+ Scale *scale = (Scale *)recordPtr;
if (scale->scale.variableTrace) {
Ttk_UntraceVariable(scale->scale.variableTrace);
@@ -133,7 +135,7 @@ static void ScaleCleanup(void *recordPtr)
*/
static int ScaleConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
{
- Scale *scale = recordPtr;
+ Scale *scale = (Scale *)recordPtr;
Tcl_Obj *varName = scale->scale.variableObj;
Ttk_TraceHandle *vt = 0;
@@ -163,10 +165,12 @@ static int ScaleConfigure(Tcl_Interp *interp, void *recordPtr, int mask)
* Post-configuration hook.
*/
static int ScalePostConfigure(
- Tcl_Interp *interp, void *recordPtr, int mask)
+ Tcl_Interp *dummy, void *recordPtr, int mask)
{
- Scale *scale = recordPtr;
+ Scale *scale = (Scale *)recordPtr;
int status = TCL_OK;
+ (void)dummy;
+ (void)mask;
if (scale->scale.variableTrace) {
status = Ttk_FireTrace(scale->scale.variableTrace);
@@ -189,10 +193,10 @@ static int ScalePostConfigure(
/* ScaleGetLayout --
* getLayout hook.
*/
-static Ttk_Layout
+static Ttk_Layout
ScaleGetLayout(Tcl_Interp *interp, Ttk_Theme theme, void *recordPtr)
{
- Scale *scalePtr = recordPtr;
+ Scale *scalePtr = (Scale *)recordPtr;
return TtkWidgetGetOrientedLayout(
interp, theme, recordPtr, scalePtr->scale.orientObj);
}
@@ -253,14 +257,14 @@ static double ScaleFraction(Scale *scalePtr, double value)
}
/* $scale get ?x y? --
- * Returns the current value of the scale widget, or if $x and
+ * Returns the current value of the scale widget, or if $x and
* $y are specified, the value represented by point @x,y.
*/
static int
ScaleGetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scale *scalePtr = recordPtr;
+ Scale *scalePtr = (Scale *)recordPtr;
int x, y, r = TCL_OK;
double value = 0;
@@ -288,7 +292,7 @@ static int
ScaleSetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scale *scalePtr = recordPtr;
+ Scale *scalePtr = (Scale *)recordPtr;
double from = 0.0, to = 1.0, value;
int result = TCL_OK;
@@ -356,7 +360,7 @@ static int
ScaleCoordsCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scale *scalePtr = recordPtr;
+ Scale *scalePtr = (Scale *)recordPtr;
double value;
int r = TCL_OK;
@@ -383,7 +387,7 @@ ScaleCoordsCommand(
static void ScaleDoLayout(void *clientData)
{
- WidgetCore *corePtr = clientData;
+ WidgetCore *corePtr = (WidgetCore *)clientData;
Ttk_Element slider = Ttk_FindElement(corePtr->layout, "slider");
Ttk_PlaceLayout(corePtr->layout,corePtr->state,Ttk_WinBox(corePtr->tkwin));
@@ -391,7 +395,7 @@ static void ScaleDoLayout(void *clientData)
/* Adjust the slider position:
*/
if (slider) {
- Scale *scalePtr = clientData;
+ Scale *scalePtr = (Scale *)clientData;
Ttk_Box troughBox = TroughBox(scalePtr);
Ttk_Box sliderBox = Ttk_ElementParcel(slider);
double value = 0.0;
@@ -418,8 +422,8 @@ static void ScaleDoLayout(void *clientData)
*/
static int ScaleSize(void *clientData, int *widthPtr, int *heightPtr)
{
- WidgetCore *corePtr = clientData;
- Scale *scalePtr = clientData;
+ WidgetCore *corePtr = (WidgetCore *)clientData;
+ Scale *scalePtr = (Scale *)clientData;
int length;
Ttk_LayoutSize(corePtr->layout, corePtr->state, widthPtr, heightPtr);
diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c
index 5b0c212..04430ee 100644
--- a/generic/ttk/ttkScrollbar.c
+++ b/generic/ttk/ttkScrollbar.c
@@ -22,7 +22,7 @@ typedef struct
double first; /* top fraction */
double last; /* bottom fraction */
- Ttk_Box troughBox; /* trough parcel */
+ Ttk_Box troughBox; /* trough parcel */
int minSize; /* minimum size of thumb */
} ScrollbarPart;
@@ -50,10 +50,12 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] =
* +++ Widget hooks.
*/
-static void
-ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr)
+static void
+ScrollbarInitialize(Tcl_Interp *dummy, void *recordPtr)
{
- Scrollbar *sb = recordPtr;
+ Scrollbar *sb = (Scrollbar *)recordPtr;
+ (void)dummy;
+
sb->scrollbar.first = 0.0;
sb->scrollbar.last = 1.0;
@@ -63,7 +65,7 @@ ScrollbarInitialize(Tcl_Interp *interp, void *recordPtr)
static Ttk_Layout ScrollbarGetLayout(
Tcl_Interp *interp, Ttk_Theme theme, void *recordPtr)
{
- Scrollbar *sb = recordPtr;
+ Scrollbar *sb = (Scrollbar *)recordPtr;
return TtkWidgetGetOrientedLayout(
interp, theme, recordPtr, sb->scrollbar.orientObj);
}
@@ -77,7 +79,7 @@ static Ttk_Layout ScrollbarGetLayout(
*/
static void ScrollbarDoLayout(void *recordPtr)
{
- Scrollbar *sb = recordPtr;
+ Scrollbar *sb = (Scrollbar *)recordPtr;
WidgetCore *corePtr = &sb->core;
Ttk_Element thumb;
Ttk_Box thumbBox;
@@ -133,7 +135,7 @@ static int
ScrollbarSetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scrollbar *scrollbar = recordPtr;
+ Scrollbar *scrollbar = (Scrollbar *)recordPtr;
Tcl_Obj *firstObj, *lastObj;
double first, last;
@@ -184,7 +186,7 @@ static int
ScrollbarGetCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scrollbar *scrollbar = recordPtr;
+ Scrollbar *scrollbar = (Scrollbar *)recordPtr;
Tcl_Obj *result[2];
if (objc != 2) {
@@ -207,7 +209,7 @@ static int
ScrollbarDeltaCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scrollbar *sb = recordPtr;
+ Scrollbar *sb = (Scrollbar *)recordPtr;
double dx, dy;
double delta = 0.0;
@@ -241,13 +243,13 @@ ScrollbarDeltaCommand(
/* $sb fraction $x $y --
* Returns a real number between 0 and 1 indicating where the
- * point given by x and y lies in the trough area of the scrollbar.
+ * point given by x and y lies in the trough area of the scrollbar.
*/
static int
ScrollbarFractionCommand(
void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
{
- Scrollbar *sb = recordPtr;
+ Scrollbar *sb = (Scrollbar *)recordPtr;
Ttk_Box b = sb->scrollbar.troughBox;
int minSize = sb->scrollbar.minSize;
double x, y;
diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c
index d002f2f..b5bf6f9 100644
--- a/generic/ttk/ttkSquare.c
+++ b/generic/ttk/ttkSquare.c
@@ -56,24 +56,24 @@ static Tk_OptionSpec SquareOptionSpecs[] =
{TK_OPTION_BORDER, "-foreground", "foreground", "Foreground",
DEFAULT_BACKGROUND, Tk_Offset(Square,square.foregroundObj),
-1, 0, 0, 0},
-
+
{TK_OPTION_PIXELS, "-width", "width", "Width",
"50", Tk_Offset(Square,square.widthObj), -1, 0, 0,
GEOMETRY_CHANGED},
{TK_OPTION_PIXELS, "-height", "height", "Height",
"50", Tk_Offset(Square,square.heightObj), -1, 0, 0,
GEOMETRY_CHANGED},
-
+
{TK_OPTION_STRING, "-padding", "padding", "Pad", NULL,
- Tk_Offset(Square,square.paddingObj), -1,
+ Tk_Offset(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},
-
+
{TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
NULL, Tk_Offset(Square,square.anchorObj), -1, TK_OPTION_NULL_OK, 0, 0},
-
+
WIDGET_TAKEFOCUS_TRUE,
WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs)
};
@@ -109,7 +109,7 @@ SquareDoLayout(void *clientData)
*/
if (squareNode) {
- Square *squarePtr = clientData;
+ Square *squarePtr = (Square *)clientData;
Tk_Anchor anchor = TK_ANCHOR_CENTER;
Ttk_Box b;
@@ -138,7 +138,7 @@ static const Ttk_Ensemble SquareCommands[] = {
};
/*
- * The Widget specification structure holds all the implementation
+ * The Widget specification structure holds all the implementation
* information about this widget and this is what must be registered
* with Tk in the package initialization code (see bottom).
*/
@@ -159,7 +159,7 @@ static WidgetSpec SquareWidgetSpec =
TtkWidgetDisplay /* displayProc */
};
-/* ----------------------------------------------------------------------
+/* ----------------------------------------------------------------------
* Square element
*
* In this section we demonstrate what is required to create a new themed
@@ -176,7 +176,7 @@ typedef struct
Tcl_Obj *heightObj;
} SquareElement;
-static Ttk_ElementOptionSpec SquareElementOptions[] =
+static Ttk_ElementOptionSpec SquareElementOptions[] =
{
{ "-background", TK_OPTION_BORDER, Tk_Offset(SquareElement,borderObj),
DEFAULT_BACKGROUND },
@@ -188,7 +188,7 @@ static Ttk_ElementOptionSpec SquareElementOptions[] =
"raised" },
{ "-width", TK_OPTION_PIXELS, Tk_Offset(SquareElement,widthObj), "20"},
{ "-height", TK_OPTION_PIXELS, Tk_Offset(SquareElement,heightObj), "20"},
- { NULL, 0, 0, NULL }
+ { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
/*
@@ -198,11 +198,12 @@ static Ttk_ElementOptionSpec SquareElementOptions[] =
*/
static void SquareElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- SquareElement *square = elementRecord;
+ SquareElement *square = (SquareElement *)elementRecord;
int borderWidth = 0;
+ (void)dummy;
Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth);
*paddingPtr = Ttk_UniformPadding((short)borderWidth);
@@ -215,12 +216,14 @@ static void SquareElementSize(
*/
static void SquareElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
+ void *dummy, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- SquareElement *square = elementRecord;
+ SquareElement *square = (SquareElement *)elementRecord;
Tk_3DBorder foreground = NULL;
int borderWidth = 1, relief = TK_RELIEF_FLAT;
+ (void)dummy;
+ (void)state;
foreground = Tk_Get3DBorderFromObj(tkwin, square->foregroundObj);
Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth);
@@ -248,7 +251,7 @@ static Ttk_ElementSpec SquareElementSpec =
* engine is similar to the Tk pack geometry manager. Read the documentation
* for the details. In this example we just need to have the square element
* that has been defined for this widget placed on a background. We will
- * also need some padding to keep it away from the edges.
+ * also need some padding to keep it away from the edges.
*/
TTK_BEGIN_LAYOUT(SquareLayout)
@@ -257,12 +260,12 @@ TTK_BEGIN_LAYOUT(SquareLayout)
TTK_NODE("Square.square", 0))
TTK_END_LAYOUT
-/* ----------------------------------------------------------------------
+/* ----------------------------------------------------------------------
*
* Widget initialization.
*
* This file defines a new element and a new widget. We need to register
- * the element with the themes that will need it. In this case we will
+ * the element with the themes that will need it. In this case we will
* register with the default theme that is the root of the theme inheritance
* tree. This means all themes will find this element.
* We then need to register the widget class style. This is the layout
@@ -287,10 +290,10 @@ TtkSquareWidget_Init(Tcl_Interp *interp)
/* register the new elements for this theme engine */
Ttk_RegisterElement(interp, theme, "square", &SquareElementSpec, NULL);
-
+
/* register the layout for this theme */
Ttk_RegisterLayout(theme, "TSquare", SquareLayout);
-
+
/* register the widget */
RegisterWidget(interp, "ttk::square", &SquareWidgetSpec);
diff --git a/generic/ttk/ttkStubLib.c b/generic/ttk/ttkStubLib.c
index 2c07b9d..5675416 100644
--- a/generic/ttk/ttkStubLib.c
+++ b/generic/ttk/ttkStubLib.c
@@ -36,10 +36,10 @@ TtkInitializeStubs(
int exact = 0;
const char *packageName = "Ttk";
const char *errMsg = NULL;
- ClientData pkgClientData = NULL;
+ void *pkgClientData = NULL;
const char *actualVersion = Tcl_PkgRequireEx(
interp, packageName, version, exact, &pkgClientData);
- const TtkStubs *stubsPtr = pkgClientData;
+ const TtkStubs *stubsPtr = (const TtkStubs *)pkgClientData;
if (!actualVersion) {
return NULL;
@@ -67,7 +67,7 @@ error:
"Error loading ", packageName, " package",
" (requested version '", version,
"', loaded version '", actualVersion, "'): ",
- errMsg,
+ errMsg,
NULL);
return NULL;
}
diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c
index f2108b9..07aee76 100644
--- a/generic/ttk/ttkTagSet.c
+++ b/generic/ttk/ttkTagSet.c
@@ -34,7 +34,7 @@ struct TtkTagTable {
*/
static Ttk_Tag NewTag(Ttk_TagTable tagTable, const char *tagName)
{
- Ttk_Tag tag = ckalloc(sizeof(*tag));
+ Ttk_Tag tag = (Ttk_Tag)ckalloc(sizeof(*tag));
tag->tagRecord = ckalloc(tagTable->recordSize);
memset(tag->tagRecord, 0, tagTable->recordSize);
/* Don't need Tk_InitOptions() here, all defaults should be NULL. */
@@ -58,7 +58,7 @@ Ttk_TagTable Ttk_CreateTagTable(
Tcl_Interp *interp, Tk_Window tkwin,
Tk_OptionSpec optionSpecs[], int recordSize)
{
- Ttk_TagTable tagTable = ckalloc(sizeof(*tagTable));
+ Ttk_TagTable tagTable = (Ttk_TagTable)ckalloc(sizeof(*tagTable));
tagTable->tkwin = tkwin;
tagTable->optionSpecs = optionSpecs;
tagTable->optionTable = Tk_CreateOptionTable(interp, optionSpecs);
@@ -75,7 +75,7 @@ void Ttk_DeleteTagTable(Ttk_TagTable tagTable)
entryPtr = Tcl_FirstHashEntry(&tagTable->tags, &search);
while (entryPtr != NULL) {
- DeleteTag(tagTable, Tcl_GetHashValue(entryPtr));
+ DeleteTag(tagTable, (Ttk_Tag)Tcl_GetHashValue(entryPtr));
entryPtr = Tcl_NextHashEntry(&search);
}
@@ -90,10 +90,10 @@ Ttk_Tag Ttk_GetTag(Ttk_TagTable tagTable, const char *tagName)
&tagTable->tags, tagName, &isNew);
if (isNew) {
- tagName = Tcl_GetHashKey(&tagTable->tags, entryPtr);
+ tagName = (char *)Tcl_GetHashKey(&tagTable->tags, entryPtr);
Tcl_SetHashValue(entryPtr, NewTag(tagTable,tagName));
}
- return Tcl_GetHashValue(entryPtr);
+ return (Ttk_Tag)Tcl_GetHashValue(entryPtr);
}
Ttk_Tag Ttk_GetTagFromObj(Ttk_TagTable tagTable, Tcl_Obj *objPtr)
@@ -116,7 +116,7 @@ Ttk_Tag Ttk_GetTagFromObj(Ttk_TagTable tagTable, Tcl_Obj *objPtr)
Ttk_TagSet Ttk_GetTagSetFromObj(
Tcl_Interp *interp, Ttk_TagTable tagTable, Tcl_Obj *objPtr)
{
- Ttk_TagSet tagset = ckalloc(sizeof(*tagset));
+ Ttk_TagSet tagset = (Ttk_TagSet)ckalloc(sizeof(*tagset));
Tcl_Obj **objv;
int i, objc;
@@ -131,7 +131,7 @@ Ttk_TagSet Ttk_GetTagSetFromObj(
return NULL;
}
- tagset->tags = ckalloc((objc+1) * sizeof(Ttk_Tag));
+ tagset->tags = (Ttk_Tag *)ckalloc((objc+1) * sizeof(Ttk_Tag));
for (i=0; i<objc; ++i) {
tagset->tags[i] = Ttk_GetTagFromObj(tagTable, objv[i]);
}
@@ -188,7 +188,7 @@ int Ttk_TagSetAdd(Ttk_TagSet tagset, Ttk_Tag tag)
return 0;
}
}
- tagset->tags = ckrealloc(tagset->tags,
+ tagset->tags = (Ttk_Tag *)ckrealloc(tagset->tags,
(tagset->nTags+1)*sizeof(tagset->tags[0]));
tagset->tags[tagset->nTags++] = tag;
return 1;
diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c
index 7c4345d..919f25a 100644
--- a/generic/ttk/ttkTrace.c
+++ b/generic/ttk/ttkTrace.c
@@ -3,7 +3,7 @@
*
* Simplified interface to Tcl_TraceVariable.
*
- * PROBLEM: Can't distinguish "variable does not exist" (which is OK)
+ * PROBLEM: Can't distinguish "variable does not exist" (which is OK)
* from other errors (which are not).
*/
@@ -30,9 +30,11 @@ VarTraceProc(
const char *name2, /* (unused) */
int flags) /* Information about what happened. */
{
- Ttk_TraceHandle *tracePtr = clientData;
+ Ttk_TraceHandle *tracePtr = (Ttk_TraceHandle *)clientData;
const char *name, *value;
Tcl_Obj *valuePtr;
+ (void)name1;
+ (void)name2;
if (Tcl_InterpDeleted(interp)) {
return NULL;
@@ -85,7 +87,7 @@ Ttk_TraceHandle *Ttk_TraceVariable(
Ttk_TraceProc callback,
void *clientData)
{
- Ttk_TraceHandle *h = ckalloc(sizeof(*h));
+ Ttk_TraceHandle *h = (Ttk_TraceHandle *)ckalloc(sizeof(*h));
int status;
h->interp = interp;