summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c122
1 files changed, 45 insertions, 77 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index ff83ad2..d2602f7 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,
@@ -3075,9 +3072,6 @@ WmAttributesCmd(
}
for (i = 3; i < objc; i += 2) {
string = Tcl_GetStringFromObj(objv[i], &length);
- if ((length < 2) || (string[0] != '-')) {
- goto configArgs;
- }
if (strncmp(string, "-disabled", length) == 0) {
stylePtr = &style;
styleBit = WS_DISABLED;
@@ -3110,6 +3104,12 @@ WmAttributesCmd(
Tcl_SetErrorCode(interp, "TK", "WM", "ATTR", "TOPMOST", NULL);
return TCL_ERROR;
}
+ } else if (i == 3) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "bad attribute \"%s\": must be -alpha, -transparentcolor, -disabled, -fullscreen, -toolwindow, or -topmost",
+ string));
+ Tcl_SetErrorCode(interp, "TK", "WM", "ATTR", "UNRECOGNIZED", NULL);
+ return TCL_ERROR;
} else {
goto configArgs;
}
@@ -3313,7 +3313,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 +3322,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 +3477,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 +3487,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 +3546,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 +3598,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 +3612,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 +3654,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 +3668,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 +3702,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 +3711,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 +3747,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 +3757,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 +3815,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 +3823,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 +3976,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 +3985,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 +4112,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 +4236,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 +4245,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 +4287,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 +4305,6 @@ WmIconphotoCmd(
unsigned size;
BITMAPINFO bmInfo;
ICONINFO iconInfo;
- (void)tkwin;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -4495,7 +4480,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 +4488,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 +4646,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 +4700,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 +4708,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 +4751,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 +4759,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 +4802,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 +4811,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 +4874,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 +4888,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 +4942,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 +4954,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 +5038,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 +5046,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 +5100,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 +5114,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 +5297,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 +5311,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 +5437,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 +5447,6 @@ WmTitleCmd(
const char *argv3;
int length;
HWND wrapper;
- (void)tkwin;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
@@ -5670,14 +5642,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 +5957,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 +6508,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);