summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-11-03 12:58:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-11-03 12:58:16 (GMT)
commitc594f7549d926ba7d3ad0f7ee0ad3638719870dd (patch)
treebcd38dec13f43f75cfe3b20dcfc22a8c27b50be3 /win
parent1e1f629ce1661dec695273cc771f3273bcd1cf22 (diff)
downloadtk-c594f7549d926ba7d3ad0f7ee0ad3638719870dd.zip
tk-c594f7549d926ba7d3ad0f7ee0ad3638719870dd.tar.gz
tk-c594f7549d926ba7d3ad0f7ee0ad3638719870dd.tar.bz2
More usage for Tcl_Size (internal TkEnsemble)
Diffstat (limited to 'win')
-rw-r--r--win/tkWinDialog.c62
-rw-r--r--win/tkWinSend.c21
-rw-r--r--win/tkWinTest.c29
-rw-r--r--win/tkWinX.c22
-rw-r--r--win/ttkWinTheme.c206
-rw-r--r--win/ttkWinXPTheme.c47
6 files changed, 197 insertions, 190 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index e769daf..72766f9 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -568,14 +568,14 @@ static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg,
static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
static void CleanupOFNOptions(OFNOpts *optsPtr);
-static int ParseOFNOptions(ClientData clientData,
+static int ParseOFNOptions(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[], enum OFNOper oper, OFNOpts *optsPtr);
static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr,
enum OFNOper oper);
static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
enum OFNOper oper);
-static int GetFileName(ClientData clientData,
+static int GetFileName(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[], enum OFNOper oper);
static int MakeFilterVista(Tcl_Interp *interp, OFNOpts *optsPtr,
@@ -588,7 +588,7 @@ static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr,
static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam);
-static void SetTkDialog(ClientData clientData);
+static void SetTkDialog(void *clientData);
static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *);
/*
@@ -690,7 +690,7 @@ TkWinDialogDebug(
int
Tk_ChooseColorObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -846,14 +846,13 @@ static UINT CALLBACK
ColorDlgHookProc(
HWND hDlg, /* Handle to the color dialog. */
UINT uMsg, /* Type of message. */
- WPARAM wParam, /* First message parameter. */
+ TCL_UNUSED(WPARAM), /* First message parameter. */
LPARAM lParam) /* Second message parameter. */
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
const char *title;
CHOOSECOLORW *ccPtr;
- (void)wParam;
if (WM_INITDIALOG == uMsg) {
@@ -899,7 +898,7 @@ ColorDlgHookProc(
int
Tk_GetOpenFileObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -926,7 +925,7 @@ Tk_GetOpenFileObjCmd(
int
Tk_GetSaveFileObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -973,7 +972,7 @@ static void CleanupOFNOptions(OFNOpts *optsPtr)
static int
ParseOFNOptions(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
@@ -1811,7 +1810,7 @@ end:
static int
GetFileName(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects. */
@@ -1858,14 +1857,13 @@ static UINT APIENTRY
OFNHookProc(
HWND hdlg, /* Handle to child dialog window. */
UINT uMsg, /* Message identifier */
- WPARAM wParam, /* Message parameter */
+ TCL_UNUSED(WPARAM), /* Message parameter */
LPARAM lParam) /* Message parameter */
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
OPENFILENAME *ofnPtr;
OFNData *ofnData;
- (void)wParam;
if (uMsg == WM_INITDIALOG) {
TkWinSetUserData(hdlg, lParam);
@@ -2369,7 +2367,7 @@ static int MakeFilterVista(
int
Tk_ChooseDirectoryObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2727,7 +2725,7 @@ ChooseDirectoryValidateProc(
int
Tk_MessageBoxObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
+ void *clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
@@ -2961,7 +2959,7 @@ MsgBoxCBTProc(
static void
SetTkDialog(
- ClientData clientData)
+ void *clientData)
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -3232,14 +3230,15 @@ FontchooserCget(
static int
FontchooserConfigureCmd(
- ClientData clientData, /* Main window */
+ void *clientData, /* Main window */
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
Tk_Window tkwin = (Tk_Window)clientData;
HookData *hdPtr = NULL;
- int i, r = TCL_OK;
+ Tcl_Size i;
+ int r = TCL_OK;
static const char *const optionStrings[] = {
"-command", "-font", "-parent", "-title", "-visible", NULL
};
@@ -3375,10 +3374,10 @@ FontchooserConfigureCmd(
static int
FontchooserShowCmd(
- ClientData clientData, /* Main window */
+ void *clientData, /* Main window */
Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const objv[])
+ TCL_UNUSED(Tcl_Size),
+ TCL_UNUSED(Tcl_Obj *const *))
{
Tcl_DString ds;
Tk_Window tkwin = (Tk_Window)clientData, parent;
@@ -3387,8 +3386,6 @@ FontchooserShowCmd(
HDC hdc;
HookData *hdPtr;
int r = TCL_OK, oldMode = 0;
- (void)objc;
- (void)objv;
hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
@@ -3491,15 +3488,12 @@ FontchooserShowCmd(
static int
FontchooserHideCmd(
- ClientData dummy, /* Main window */
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
- int objc,
- Tcl_Obj *const objv[])
+ TCL_UNUSED(Tcl_Size),
+ TCL_UNUSED(Tcl_Obj *const *))
{
HookData *hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
- (void)dummy;
- (void)objc;
- (void)objv;
if (hdPtr->hwnd && IsWindow(hdPtr->hwnd)) {
EndDialog(hdPtr->hwnd, 0);
@@ -3519,10 +3513,11 @@ FontchooserHideCmd(
*/
static void
-DeleteHookData(ClientData clientData, Tcl_Interp *dummy)
+DeleteHookData(
+ void *clientData,
+ TCL_UNUSED(Tcl_Interp *))
{
HookData *hdPtr = (HookData *)clientData;
- (void)dummy;
if (hdPtr->parentObj) {
Tcl_DecrRefCount(hdPtr->parentObj);
@@ -3559,10 +3554,11 @@ const TkEnsemble tkFontchooserEnsemble[] = {
};
int
-TkInitFontchooser(Tcl_Interp *interp, ClientData dummy)
+TkInitFontchooser(
+ Tcl_Interp *interp,
+ TCL_UNUSED(void *))
{
HookData *hdPtr = (HookData *)ckalloc(sizeof(HookData));
- (void)dummy;
memset(hdPtr, 0, sizeof(HookData));
Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteHookData, hdPtr);
diff --git a/win/tkWinSend.c b/win/tkWinSend.c
index f21af01..e3111e6 100644
--- a/win/tkWinSend.c
+++ b/win/tkWinSend.c
@@ -62,8 +62,8 @@ static Tcl_ThreadDataKey dataKey;
*/
#ifdef TK_SEND_ENABLED_ON_WINDOWS
-static void CmdDeleteProc(ClientData clientData);
-static void InterpDeleteProc(ClientData clientData,
+static void CmdDeleteProc(void *clientData);
+static void InterpDeleteProc(void *clientData,
Tcl_Interp *interp);
static void RevokeObjectRegistration(RegisteredInterp *riPtr);
#endif /* TK_SEND_ENABLED_ON_WINDOWS */
@@ -75,7 +75,7 @@ static HRESULT RegisterInterp(const char *name,
static int FindInterpreterObject(Tcl_Interp *interp,
const char *name, LPDISPATCH *ppdisp);
static int Send(LPDISPATCH pdispInterp, Tcl_Interp *interp,
- int async, ClientData clientData, int objc,
+ int async, void *clientData, Tcl_Size objc,
Tcl_Obj *const objv[]);
static void SendTrace(const char *format, ...);
static Tcl_EventProc SendEventProc;
@@ -322,7 +322,7 @@ TkGetInterpNames(
int
Tk_SendObjCmd(
- ClientData clientData, /* Information about sender (only dispPtr
+ void *clientData, /* Information about sender (only dispPtr
* field is used). */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -488,7 +488,7 @@ FindInterpreterObject(
#ifdef TK_SEND_ENABLED_ON_WINDOWS
static void
CmdDeleteProc(
- ClientData clientData)
+ void *clientData)
{
RegisteredInterp *riPtr = (RegisteredInterp *)clientData;
@@ -587,7 +587,7 @@ RevokeObjectRegistration(
#ifdef TK_SEND_ENABLED_ON_WINDOWS
static void
InterpDeleteProc(
- ClientData clientData,
+ void *clientData,
Tcl_Interp *interp)
{
CoUninitialize();
@@ -739,9 +739,8 @@ Send(
* object. */
Tcl_Interp *interp, /* The local interpreter. */
int async, /* Flag for the calling style. */
- ClientData dummy, /* The RegisteredInterp structure for this
- * interp. */
- int objc, /* Number of arguments to be sent. */
+ TCL_UNUSED(void *),
+ Tcl_Size objc, /* Number of arguments to be sent. */
Tcl_Obj *const objv[]) /* The arguments to be sent. */
{
VARIANT vCmd, vResult;
@@ -753,7 +752,6 @@ Send(
DISPID dispid;
Tcl_DString ds;
const char *src;
- (void)dummy;
cmd = Tcl_ConcatObj(objc, objv);
@@ -970,10 +968,9 @@ TkWinSend_QueueCommand(
static int
SendEventProc(
Tcl_Event *eventPtr,
- int flags)
+ TCL_UNUSED(int))
{
SendEvent *evPtr = (SendEvent *)eventPtr;
- (void)flags;
TRACE("SendEventProc\n");
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index 24d5cb1..4ecd114 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -24,19 +24,19 @@ HWND tkWinCurrentDialog;
* Forward declarations of functions defined later in this file:
*/
-static int TestclipboardObjCmd(ClientData clientData,
+static int TestclipboardObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestwineventObjCmd(ClientData clientData,
+static int TestwineventObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestfindwindowObjCmd(ClientData clientData,
+static int TestfindwindowObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestgetwindowinfoObjCmd(ClientData clientData,
+static int TestgetwindowinfoObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-static int TestwinlocaleObjCmd(ClientData clientData,
+static int TestwinlocaleObjCmd(void *clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static Tk_GetSelProc SetSelectionResult;
@@ -227,19 +227,17 @@ AppendSystemError(
static int
SetSelectionResult(
- ClientData dummy,
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
const char *selection)
{
- (void)dummy;
-
Tcl_AppendResult(interp, selection, NULL);
return TCL_OK;
}
static int
TestclipboardObjCmd(
- ClientData clientData, /* Main window for application. */
+ void *clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -273,7 +271,7 @@ TestclipboardObjCmd(
static int
TestwineventObjCmd(
- ClientData dummy, /* Main window for application. */
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
@@ -306,7 +304,6 @@ TestwineventObjCmd(
{WM_COMMAND, "WM_COMMAND"},
{-1, NULL}
};
- (void)dummy;
if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]), "debug") == 0)) {
int b;
@@ -442,7 +439,7 @@ TestwineventObjCmd(
static int
TestfindwindowObjCmd(
- ClientData dummy, /* Main window for application. */
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
@@ -452,7 +449,6 @@ TestfindwindowObjCmd(
HWND hwnd = NULL;
int r = TCL_OK;
DWORD myPid;
- (void)dummy;
Tcl_DStringInit(&classString);
Tcl_DStringInit(&titleString);
@@ -515,7 +511,7 @@ EnumChildrenProc(
static int
TestgetwindowinfoObjCmd(
- ClientData dummy,
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -526,7 +522,6 @@ TestgetwindowinfoObjCmd(
WCHAR buf[512];
int cch, cchBuf = 256;
Tcl_DString ds;
- (void)dummy;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "hwnd");
@@ -573,13 +568,11 @@ TestgetwindowinfoObjCmd(
static int
TestwinlocaleObjCmd(
- ClientData dummy, /* Main window for application. */
+ TCL_UNUSED(void *), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
- (void)dummy;
-
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
diff --git a/win/tkWinX.c b/win/tkWinX.c
index a3cba71..9594cb0 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -119,12 +119,11 @@ void
TkGetServerInfo(
Tcl_Interp *interp, /* The server information is returned in this
* interpreter's result. */
- Tk_Window tkwin) /* Token for window; this selects a particular
+ TCL_UNUSED(Tk_Window)) /* Token for window; this selects a particular
* display and server. */
{
static char buffer[32]; /* Empty string means not initialized yet. */
OSVERSIONINFOW os;
- (void)tkwin;
if (!buffer[0]) {
GetVersionExW(&os);
@@ -282,7 +281,7 @@ TkWinXInit(
void
TkWinXCleanup(
- ClientData clientData)
+ void *clientData)
{
HINSTANCE hInstance = (HINSTANCE)clientData;
@@ -390,11 +389,9 @@ TkWinGetPlatformTheme(void)
const char *
TkGetDefaultScreenName(
- Tcl_Interp *dummy, /* Not used. */
+ TCL_UNUSED(Tcl_Interp *),
const char *screenName) /* If NULL, use default string. */
{
- (void)dummy;
-
if ((screenName == NULL) || (screenName[0] == '\0')) {
screenName = winScreenName;
}
@@ -707,12 +704,9 @@ TkClipCleanup(
int
XBell(
- Display *display,
- int percent)
+ TCL_UNUSED(Display *),
+ TCL_UNUSED(int))
{
- (void)display;
- (void)percent;
-
MessageBeep(MB_OK);
return Success;
}
@@ -1957,10 +1951,9 @@ Tk_SetCaretPos(
long
Tk_GetUserInactiveTime(
- Display *dpy) /* Ignored on Windows */
+ TCL_UNUSED(Display *))
{
LASTINPUTINFO li;
- (void)dpy;
li.cbSize = sizeof(li);
if (!GetLastInputInfo(&li)) {
@@ -1993,10 +1986,9 @@ Tk_GetUserInactiveTime(
void
Tk_ResetUserInactiveTime(
- Display *dpy)
+ TCL_UNUSED(Display *))
{
INPUT inp;
- (void)dpy;
inp.type = INPUT_MOUSE;
inp.mi.dx = 0;
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);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 0d5c06f..0365867 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -140,12 +140,13 @@ XPThemeDeleteProc(void *clientData)
}
static int
-XPThemeEnabled(Ttk_Theme theme, void *clientData)
+XPThemeEnabled(
+ TCL_UNUSED(Ttk_Theme),
+ void *clientData)
{
XPThemeData *themeData = (XPThemeData *)clientData;
int active = themeData->procs->IsThemeActive();
int themed = themeData->procs->IsAppThemed();
- (void)theme;
return (active && themed);
}
@@ -492,13 +493,16 @@ FreeElementData(ElementData *elementData)
*/
static void GenericElementSize(
- void *clientData, void *elementRecord, Tk_Window tkwin,
- int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+ void *clientData,
+ TCL_UNUSED(void *),
+ Tk_Window tkwin,
+ int *widthPtr,
+ int *heightPtr,
+ Ttk_Padding *paddingPtr)
{
ElementData *elementData = (ElementData *)clientData;
HRESULT result;
SIZE size;
- (void)elementRecord;
if (!InitElementData(elementData, tkwin, 0))
return;
@@ -529,12 +533,15 @@ static void GenericElementSize(
}
static void GenericElementDraw(
- 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)
{
ElementData *elementData = (ElementData *)clientData;
RECT rc;
- (void)elementRecord;
if (!InitElementData(elementData, tkwin, d)) {
return;
@@ -640,13 +647,16 @@ static const Ttk_ElementSpec SpinboxArrowElementSpec = {
*/
static void ThumbElementDraw(
- 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)
{
ElementData *elementData = (ElementData *)clientData;
unsigned stateId = Ttk_StateTableLookup(elementData->info->statemap, state);
RECT rc = BoxToRect(b);
- (void)elementRecord;
/*
* Don't draw the thumb if we are disabled.
@@ -720,13 +730,16 @@ static const Ttk_ElementSpec PbarElementSpec =
* we can use the same statemap no matter what the partId.
*/
static void TabElementDraw(
- 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)
{
ElementData *elementData = (ElementData *)clientData;
int partId = elementData->info->partId;
RECT rc = BoxToRect(b);
- (void)elementRecord;
if (!InitElementData(elementData, tkwin, d))
return;
@@ -863,7 +876,7 @@ static void TextElementSize(
}
static void TextElementDraw(
- ClientData clientData, void *elementRecord, Tk_Window tkwin,
+ void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
TextElement *element = elementRecord;
@@ -1114,7 +1127,7 @@ Ttk_CreateVsapiElement(
{
XPThemeData *themeData = (XPThemeData *)clientData;
ElementInfo *elementPtr = NULL;
- ClientData elementData;
+ void *elementData;
LPCWSTR className;
int partId = 0;
Ttk_StateTable *stateTable;
@@ -1327,7 +1340,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
* New elements:
*/
for (infoPtr = ElementInfoTable; infoPtr->elementName != 0; ++infoPtr) {
- ClientData clientData = NewElementData(procs, infoPtr);
+ void *clientData = NewElementData(procs, infoPtr);
Ttk_RegisterElementSpec(
themePtr, infoPtr->elementName, infoPtr->elementSpec, clientData);
Ttk_RegisterCleanup(interp, clientData, DestroyElementData);