diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-07 09:35:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-07 09:35:04 (GMT) |
commit | e82adc446bb013824accb5b95f22129e0a5267a7 (patch) | |
tree | aa57c0894278df797f18d17bdaa56dc4b9381a2d /generic | |
parent | 294e8b450c748fcc35e2f76489d71459df5153cd (diff) | |
parent | 8d6df717b42ddf4ef40167646105da4d5134b824 (diff) | |
download | tk-e82adc446bb013824accb5b95f22129e0a5267a7.zip tk-e82adc446bb013824accb5b95f22129e0a5267a7.tar.gz tk-e82adc446bb013824accb5b95f22129e0a5267a7.tar.bz2 |
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/ttk/ttkButton.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkClassicTheme.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkInit.c | 37 | ||||
-rw-r--r-- | generic/ttk/ttkLabel.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.h | 4 |
6 files changed, 38 insertions, 17 deletions
diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 431487f..a3627fc 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -347,7 +347,7 @@ static int ButtonConfigure(Tcl_Interp *interp, void *recordPtr, int mask) /* Handle "-default" option: */ if (mask & DEFAULTSTATE_CHANGED) { - int defaultState = TTK_BUTTON_DEFAULT_DISABLED; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; Ttk_GetButtonDefaultStateFromObj( NULL, buttonPtr->button.defaultStateObj, &defaultState); if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) { diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 2b1905a..393857c 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -106,7 +106,7 @@ static void ButtonBorderElementSize( int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; - int defaultState = TTK_BUTTON_DEFAULT_DISABLED; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; int borderWidth = 0; (void)dummy; (void)tkwin; @@ -134,7 +134,7 @@ static void ButtonBorderElementDraw( ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; Tk_3DBorder border = NULL; int borderWidth = 1, relief = TK_RELIEF_FLAT; - int defaultState = TTK_BUTTON_DEFAULT_DISABLED; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; int inset = 0; (void)dummy; (void)state; diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 1560138..48f6168 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -264,7 +264,7 @@ static void BorderElementSize( { BorderElement *bd = (BorderElement *)elementRecord; int borderWidth = 0; - int defaultState = TTK_BUTTON_DEFAULT_DISABLED; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; (void)dummy; (void)tkwin; (void)widthPtr; @@ -289,7 +289,7 @@ static void BorderElementDraw( XColor *borderColor = Tk_GetColorFromObj(tkwin, bd->borderColorObj); int borderWidth = 2; int relief = TK_RELIEF_FLAT; - int defaultState = TTK_BUTTON_DEFAULT_DISABLED; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; (void)dummy; (void)state; diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index ccfcd46..fe83f3b 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -17,11 +17,18 @@ const char *const ttkDefaultStrings[] = { }; int Ttk_GetButtonDefaultStateFromObj( - Tcl_Interp *interp, Tcl_Obj *objPtr, int *statePtr) + Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_ButtonDefaultState *statePtr) { + int value; + int result; + *statePtr = TTK_BUTTON_DEFAULT_DISABLED; - return Tcl_GetIndexFromObjStruct(interp, objPtr, ttkDefaultStrings, - sizeof(char *), "default state", 0, statePtr); + result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkDefaultStrings, + sizeof(char *), "default state", 0, &value); + if (result == TCL_OK) { + *statePtr = (Ttk_ButtonDefaultState)value; + } + return result; } /* @@ -34,11 +41,18 @@ const char *const ttkCompoundStrings[] = { }; int Ttk_GetCompoundFromObj( - Tcl_Interp *interp, Tcl_Obj *objPtr, int *statePtr) + Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Compound *statePtr) { + int value; + int result; + *statePtr = TTK_COMPOUND_NONE; - return Tcl_GetIndexFromObjStruct(interp, objPtr, ttkCompoundStrings, - sizeof(char *), "compound layout", 0, statePtr); + result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkCompoundStrings, + sizeof(char *), "compound layout", 0, &value); + if (result == TCL_OK) { + *statePtr = (Ttk_Compound)value; + } + return result; } /* @@ -52,9 +66,16 @@ const char *const ttkOrientStrings[] = { int Ttk_GetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr) { + int value; + int result; + *resultPtr = TTK_ORIENT_HORIZONTAL; - return Tcl_GetIndexFromObjStruct(interp, objPtr, ttkOrientStrings, - sizeof(char *), "orientation", 0, (int *)resultPtr); + result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkOrientStrings, + sizeof(char *), "orientation", 0, &value); + if (result == TCL_OK) { + *resultPtr = (Ttk_Orient)value; + } + return result; } /* diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index b118352..a4dbf96 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -502,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, compoundPtr); /* * Deal with TTK_COMPOUND_NONE. diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index 1dc7423..23334e8 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -400,7 +400,7 @@ typedef enum /* -default option values */ TTK_BUTTON_DEFAULT_DISABLED /* not defaultable */ } Ttk_ButtonDefaultState; -TTKAPI int Ttk_GetButtonDefaultStateFromObj(Tcl_Interp *, Tcl_Obj *, int *); +TTKAPI int Ttk_GetButtonDefaultStateFromObj(Tcl_Interp *, Tcl_Obj *, Ttk_ButtonDefaultState *); typedef enum /* -compound option values */ { @@ -414,7 +414,7 @@ typedef enum /* -compound option values */ TTK_COMPOUND_RIGHT /* image to right of text */ } Ttk_Compound; -TTKAPI int Ttk_GetCompoundFromObj(Tcl_Interp *, Tcl_Obj *, int *); +TTKAPI int Ttk_GetCompoundFromObj(Tcl_Interp *, Tcl_Obj *, Ttk_Compound *); typedef enum { /* -orient option values */ TTK_ORIENT_HORIZONTAL, |