summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-23 13:52:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-23 13:52:05 (GMT)
commitcb689d388a07704cc34424caf91ff48bf6a3953b (patch)
tree3d5a0bd2757831e42bf7c5848f145d40471f6767 /win/tkWinWm.c
parent911e6945bdebb097f23426a01310bbd85891167a (diff)
downloadtk-cb689d388a07704cc34424caf91ff48bf6a3953b.zip
tk-cb689d388a07704cc34424caf91ff48bf6a3953b.tar.gz
tk-cb689d388a07704cc34424caf91ff48bf6a3953b.tar.bz2
Eliminate "register" keyword. Use more TCL_UNUSED()
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c113
1 files changed, 39 insertions, 74 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index ff83ad2..414df3e 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -358,7 +358,7 @@ typedef struct TkWmInfo {
* of top-level windows.
*/
-static void TopLevelReqProc(ClientData dummy, Tk_Window tkwin);
+static void TopLevelReqProc(void *, Tk_Window);
static void RemapWindows(TkWindow *winPtr, HWND parentHWND);
static const Tk_GeomMgr wmMgrType = {
@@ -436,9 +436,9 @@ static BlockOfIconImagesPtr ReadIconOrCursorFromFile(Tcl_Interp *interp,
Tcl_Obj* fileName, BOOL isIcon);
static WinIconPtr ReadIconFromFile(Tcl_Interp *interp,
Tcl_Obj *fileName);
+static BOOL AdjustIconImagePointers(LPICONIMAGE lpImage);
static WinIconPtr GetIconFromPixmap(Display *dsPtr, Pixmap pixmap);
static int ReadICOHeader(Tcl_Channel channel);
-static BOOL AdjustIconImagePointers(LPICONIMAGE lpImage);
static HICON MakeIconOrCursorFromResource(LPICONIMAGE lpIcon,
BOOL isIcon);
static HICON GetIcon(WinIconPtr titlebaricon, int icon_size);
@@ -2740,10 +2740,8 @@ TkWmDeadWindow(
void
TkWmSetClass(
- TkWindow *winPtr) /* Newly-created top-level window. */
+ TCL_UNUSED(TkWindow *)) /* Newly-created top-level window. */
{
- (void)winPtr;
-
/* Do nothing */
return;
}
@@ -2946,7 +2944,7 @@ Tk_WmObjCmd(
static int
WmAspectCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -2954,7 +2952,6 @@ WmAspectCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int numer1, denom1, numer2, denom2;
- (void)tkwin;
if ((objc != 3) && (objc != 7)) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -3313,7 +3310,7 @@ WmAttributesCmd(
static int
WmClientCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3322,7 +3319,6 @@ WmClientCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
int length;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
@@ -3478,7 +3474,7 @@ WmColormapwindowsCmd(
static int
WmCommandCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3488,7 +3484,6 @@ WmCommandCmd(
const char *argv3;
int cmdArgc;
const char **cmdArgv;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
@@ -3548,14 +3543,13 @@ WmCommandCmd(
static int
WmDeiconifyCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -3601,7 +3595,7 @@ WmDeiconifyCmd(
static int
WmFocusmodelCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3615,7 +3609,6 @@ WmFocusmodelCmd(
OPT_ACTIVE, OPT_PASSIVE
};
int index;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
@@ -3658,17 +3651,13 @@ WmFocusmodelCmd(
static int
WmForgetCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel or Frame to work with */
- Tcl_Interp *dummy, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ TCL_UNUSED(int), /* Number of arguments. */
+ TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */
{
Tk_Window frameWin = (Tk_Window) winPtr;
- (void)tkwin;
- (void)dummy;
- (void)objc;
- (void)objv;
if (Tk_IsTopLevel(frameWin)) {
Tk_UnmapWindow(frameWin);
@@ -3676,10 +3665,10 @@ WmForgetCmd(
Tk_MakeWindowExist((Tk_Window)winPtr->parentPtr);
RemapWindows(winPtr, Tk_GetHWND(winPtr->parentPtr->window));
- /*
- * Make sure wm no longer manages this window
- */
- Tk_ManageGeometry(frameWin, NULL, NULL);
+ /*
+ * Make sure wm no longer manages this window
+ */
+ Tk_ManageGeometry(frameWin, NULL, NULL);
TkWmDeadWindow(winPtr);
/* flags (above) must be cleared before calling */
@@ -3710,7 +3699,7 @@ WmForgetCmd(
static int
WmFrameCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3719,7 +3708,6 @@ WmFrameCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
HWND hwnd;
char buf[TCL_INTEGER_SPACE];
- (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -3756,7 +3744,7 @@ WmFrameCmd(
static int
WmGeometryCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3766,7 +3754,6 @@ WmGeometryCmd(
char xSign, ySign;
int width, height;
const char *argv3;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
@@ -3825,7 +3812,7 @@ WmGeometryCmd(
static int
WmGridCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3833,7 +3820,6 @@ WmGridCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int reqWidth, reqHeight, widthInc, heightInc;
- (void)tkwin;
if ((objc != 3) && (objc != 7)) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -3987,7 +3973,7 @@ WmGroupCmd(
static int
WmIconbitmapCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -3996,7 +3982,6 @@ WmIconbitmapCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */
const char *string;
- (void)tkwin;
if ((objc < 3) || (objc > 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?-default? ?image?");
@@ -4124,14 +4109,13 @@ WmIconbitmapCmd(
static int
WmIconifyCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -4249,7 +4233,7 @@ WmIconmaskCmd(
static int
WmIconnameCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4258,7 +4242,6 @@ WmIconnameCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
int length;
- (void)tkwin;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
@@ -4301,7 +4284,7 @@ WmIconnameCmd(
static int
WmIconphotoCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4319,7 +4302,6 @@ WmIconphotoCmd(
unsigned size;
BITMAPINFO bmInfo;
ICONINFO iconInfo;
- (void)tkwin;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -4495,7 +4477,7 @@ WmIconphotoCmd(
static int
WmIconpositionCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4503,7 +4485,6 @@ WmIconpositionCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y;
- (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
@@ -4662,17 +4643,14 @@ WmIconwindowCmd(
static int
WmManageCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel or Frame to work with */
Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ TCL_UNUSED(int), /* Number of arguments. */
+ TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */
{
Tk_Window frameWin = (Tk_Window) winPtr;
WmInfo *wmPtr = winPtr->wmInfoPtr;
- (void)tkwin;
- (void)objc;
- (void)objv;
if (!Tk_IsTopLevel(frameWin)) {
if (!Tk_IsManageable(frameWin)) {
@@ -4719,7 +4697,7 @@ WmManageCmd(
static int
WmMaxsizeCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4727,7 +4705,6 @@ WmMaxsizeCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
- (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -4771,7 +4748,7 @@ WmMaxsizeCmd(
static int
WmMinsizeCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4779,7 +4756,6 @@ WmMinsizeCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
- (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -4823,7 +4799,7 @@ WmMinsizeCmd(
static int
WmOverrideredirectCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4832,7 +4808,6 @@ WmOverrideredirectCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
int boolean, curValue;
XSetWindowAttributes atts;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
@@ -4896,7 +4871,7 @@ WmOverrideredirectCmd(
static int
WmPositionfromCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4910,7 +4885,6 @@ WmPositionfromCmd(
OPT_PROGRAM, OPT_USER
};
int index;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
@@ -4965,7 +4939,7 @@ WmPositionfromCmd(
static int
WmProtocolCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -4977,7 +4951,6 @@ WmProtocolCmd(
const char *cmd;
int cmdLength;
Tcl_Obj *resultObj;
- (void)tkwin;
if ((objc < 3) || (objc > 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
@@ -5062,7 +5035,7 @@ WmProtocolCmd(
static int
WmResizableCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -5070,7 +5043,6 @@ WmResizableCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
- (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -5125,7 +5097,7 @@ WmResizableCmd(
static int
WmSizefromCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -5139,7 +5111,6 @@ WmSizefromCmd(
OPT_PROGRAM, OPT_USER
};
int index;
- (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
@@ -5323,7 +5294,7 @@ WmStackorderCmd(
static int
WmStateCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -5337,7 +5308,6 @@ WmStateCmd(
OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED
};
int index;
- (void)tkwin;
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
@@ -5464,7 +5434,7 @@ WmStateCmd(
static int
WmTitleCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -5474,7 +5444,6 @@ WmTitleCmd(
const char *argv3;
int length;
HWND wrapper;
- (void)tkwin;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
@@ -5670,14 +5639,13 @@ WmTransientCmd(
static int
WmWithdrawCmd(
- Tk_Window tkwin, /* Main window of the application. */
+ TCL_UNUSED(Tk_Window), /* Main window of the application. */
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -5986,12 +5954,11 @@ TopLevelEventProc(
static void
TopLevelReqProc(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(void *),
Tk_Window tkwin) /* Information about window. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
WmInfo *wmPtr;
- (void)dummy;
wmPtr = winPtr->wmInfoPtr;
if (wmPtr) {
@@ -6538,15 +6505,13 @@ Tk_CoordsToWindow(
void
Tk_GetVRootGeometry(
- Tk_Window tkwin, /* Window whose virtual root is to be
+ TCL_UNUSED(Tk_Window), /* Window whose virtual root is to be
* queried. */
int *xPtr, int *yPtr, /* Store x and y offsets of virtual root
* here. */
int *widthPtr, int *heightPtr)
/* Store dimensions of virtual root here. */
{
- (void)tkwin;
-
*xPtr = GetSystemMetrics(SM_XVIRTUALSCREEN);
*yPtr = GetSystemMetrics(SM_YVIRTUALSCREEN);
*widthPtr = GetSystemMetrics(SM_CXVIRTUALSCREEN);