summaryrefslogtreecommitdiffstats
path: root/win/ttkWinTheme.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/ttkWinTheme.c')
-rw-r--r--win/ttkWinTheme.c206
1 files changed, 111 insertions, 95 deletions
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index 56e6882..7a4a908 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -144,15 +144,16 @@ static const FrameControlElementData FrameControlElements[] = {
/* ---------------------------------------------------------------------- */
static void FrameControlElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ void *clientData,
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
+ int *widthPtr,
+ int *heightPtr,
+ TCL_UNUSED(Ttk_Padding *))
{
FrameControlElementData *p = (FrameControlElementData *)clientData;
int cx = GETMETRIC(p->cxId);
int cy = GETMETRIC(p->cyId);
- (void)elementRecord;
- (void)tkwin;
- (void)paddingPtr;
if (p->cxId & _HALFMETRIC) cx /= 2;
if (p->cyId & _HALFMETRIC) cy /= 2;
@@ -161,14 +162,17 @@ static void FrameControlElementSize(
}
static void FrameControlElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ void *clientData,
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
FrameControlElementData *elementData = (FrameControlElementData *)clientData;
RECT rc = BoxToRect(Ttk_PadBox(b, elementData->margins));
TkWinDCState dcState;
HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
- (void)elementRecord;
DrawFrameControl(hdc, &rc,
elementData->classId,
@@ -198,30 +202,30 @@ static const Ttk_ElementOptionSpec BorderElementOptions[] = {
};
static void BorderElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(int *),
+ TCL_UNUSED(int *),
+ Ttk_Padding *paddingPtr)
{
- (void)dummy;
- (void)elementRecord;
- (void)tkwin;
- (void)widthPtr;
- (void)heightPtr;
-
paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE);
paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE);
}
static void BorderElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ TCL_UNUSED(unsigned int))
{
BorderElement *border = (BorderElement *)elementRecord;
RECT rc = BoxToRect(b);
int relief = TK_RELIEF_FLAT;
TkWinDCState dcState;
HDC hdc;
- (void)dummy;
- (void)state;
Tk_GetReliefFromObj(NULL, border->reliefObj, &relief);
@@ -257,30 +261,30 @@ static const Ttk_ElementOptionSpec FieldElementOptions[] = {
};
static void FieldElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(int *),
+ TCL_UNUSED(int *),
+ Ttk_Padding *paddingPtr)
{
- (void)dummy;
- (void)elementRecord;
- (void)tkwin;
- (void)widthPtr;
- (void)heightPtr;
-
paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE);
paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE);
}
static void FieldElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ TCL_UNUSED(unsigned int))
{
FieldElement *field = (FieldElement *)elementRecord;
Tk_3DBorder bg = Tk_Get3DBorderFromObj(tkwin, field->backgroundObj);
RECT rc = BoxToRect(b);
TkWinDCState dcState;
HDC hdc;
- (void)dummy;
- (void)state;
Tk_Fill3DRectangle(
tkwin, d, bg, b.x, b.y, b.width, b.height, 0, TK_RELIEF_FLAT);
@@ -320,17 +324,17 @@ static const Ttk_ElementOptionSpec ButtonBorderElementOptions[] = {
};
static void ButtonBorderElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(int *),
+ TCL_UNUSED(int *),
+ Ttk_Padding *paddingPtr)
{
ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord;
int relief = TK_RELIEF_RAISED;
Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED;
short int cx, cy;
- (void)dummy;
- (void)tkwin;
- (void)widthPtr;
- (void)heightPtr;
Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief);
Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);
@@ -352,8 +356,12 @@ static void ButtonBorderElementSize(
}
static void ButtonBorderElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord;
int relief = TK_RELIEF_FLAT;
@@ -361,7 +369,6 @@ static void ButtonBorderElementDraw(
TkWinDCState dcState;
HDC hdc;
RECT rc;
- (void)dummy;
Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief);
Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);
@@ -407,25 +414,24 @@ static const Ttk_ElementSpec ButtonBorderElementSpec = {
*/
static void FocusElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(int *),
+ TCL_UNUSED(int *),
+ Ttk_Padding *paddingPtr)
{
- (void)dummy;
- (void)elementRecord;
- (void)tkwin;
- (void)widthPtr;
- (void)heightPtr;
-
*paddingPtr = Ttk_UniformPadding(1);
}
static void FocusElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
- (void)dummy;
- (void)elementRecord;
-
if (state & TTK_STATE_FOCUS) {
RECT rc = BoxToRect(b);
TkWinDCState dcState;
@@ -459,11 +465,14 @@ static const Ttk_ElementOptionSpec FillFocusElementOptions[] = {
/* @@@ FIX THIS */
static void FillFocusElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
FillFocusElement *focus = (FillFocusElement *)elementRecord;
- (void)dummy;
if (state & TTK_STATE_FOCUS) {
RECT rc = BoxToRect(b);
@@ -535,16 +544,18 @@ static TroughClientData *TroughClientDataInit(Tcl_Interp *interp)
}
static void TroughElementDraw(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ void *clientData,
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ TCL_UNUSED(unsigned int))
{
TroughClientData *cd = (TroughClientData *)clientData;
TkWinDCState dcState;
HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
HBRUSH hbr;
COLORREF bk, oldbk, oldtxt;
- (void)elementRecord;
- (void)state;
hbr = (HBRUSH)SelectObject(hdc, GetSysColorBrush(COLOR_SCROLLBAR));
bk = GetSysColor(COLOR_3DHIGHLIGHT);
@@ -586,14 +597,15 @@ static const Ttk_ElementOptionSpec ThumbElementOptions[] = {
};
static void ThumbElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ TCL_UNUSED(Tk_Window),
+ int *widthPtr,
+ int *heightPtr,
+ TCL_UNUSED(Ttk_Padding *))
{
ThumbElement *thumbPtr = (ThumbElement *)elementRecord;
Ttk_Orient orient;
- (void)dummy;
- (void)tkwin;
- (void)paddingPtr;
TtkGetOrientFromObj(NULL, thumbPtr->orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL) {
@@ -606,14 +618,16 @@ static void ThumbElementSize(
}
static void ThumbElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ unsigned int state)
{
RECT rc = BoxToRect(b);
TkWinDCState dcState;
HDC hdc;
- (void)dummy;
- (void)elementRecord;
/* Windows doesn't show a thumb when the scrollbar is disabled */
if (state & TTK_STATE_DISABLED)
@@ -648,14 +662,15 @@ static const Ttk_ElementOptionSpec SliderElementOptions[] = {
};
static void SliderElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ void *elementRecord,
+ TCL_UNUSED(Tk_Window),
+ int *widthPtr,
+ int *heightPtr,
+ TCL_UNUSED(Ttk_Padding *))
{
SliderElement *slider = (SliderElement *)elementRecord;
Ttk_Orient orient;
- (void)dummy;
- (void)tkwin;
- (void)paddingPtr;
TtkGetOrientFromObj(NULL, slider->orientObj, &orient);
if (orient == TTK_ORIENT_HORIZONTAL) {
@@ -668,15 +683,16 @@ static void SliderElementSize(
}
static void SliderElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ TCL_UNUSED(unsigned int))
{
RECT rc = BoxToRect(b);
TkWinDCState dcState;
HDC hdc;
- (void)dummy;
- (void)elementRecord;
- (void)state;
hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
DrawEdge(hdc, &rc, EDGE_RAISED, BF_RECT | BF_MIDDLE);
@@ -696,29 +712,28 @@ static const Ttk_ElementSpec SliderElementSpec = {
*/
static void ClientElementSize(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(int *),
+ TCL_UNUSED(int *),
+ Ttk_Padding *paddingPtr)
{
- (void)dummy;
- (void)elementRecord;
- (void)tkwin;
- (void)widthPtr;
- (void)heightPtr;
-
paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE);
paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE);
}
static void ClientElementDraw(
- void *dummy, void *elementRecord, Tk_Window tkwin,
- Drawable d, Ttk_Box b, unsigned int state)
+ TCL_UNUSED(void *),
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ Drawable d,
+ Ttk_Box b,
+ TCL_UNUSED(unsigned int))
{
RECT rc = BoxToRect(b);
TkWinDCState dcState;
HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState);
- (void)dummy;
- (void)elementRecord;
- (void)state;
DrawEdge(hdc, &rc, EDGE_RAISED, BF_RECT | BF_SOFT);
TkWinReleaseDrawableDC(d, hdc, &dcState);
@@ -755,11 +770,12 @@ TTK_END_LAYOUT_TABLE
/* ---------------------------------------------------------------------- */
MODULE_SCOPE
-int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd)
+int TtkWinTheme_Init(
+ Tcl_Interp *interp,
+ TCL_UNUSED(HWND))
{
Ttk_Theme themePtr, parentPtr;
const FrameControlElementData *fce = FrameControlElements;
- (void)hwnd;
parentPtr = Ttk_GetTheme(interp, "alt");
themePtr = Ttk_CreateTheme(interp, "winnative", parentPtr);