summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index f7ba611..c48132d 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -66,7 +66,7 @@ typedef struct ProtocolHandler {
} ProtocolHandler;
#define HANDLER_SIZE(cmdLength) \
- ((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength)
+ (offsetof(ProtocolHandler, command) + 1 + cmdLength)
/*
* Helper type passed via lParam to TkWmStackorderToplevelEnumProc
@@ -364,7 +364,7 @@ static void RemapWindows(TkWindow *winPtr, HWND parentHWND);
static const Tk_GeomMgr wmMgrType = {
"wm", /* name */
TopLevelReqProc, /* requestProc */
- NULL, /* lostSlaveProc */
+ NULL, /* lostContentProc */
};
typedef struct {
@@ -2798,7 +2798,7 @@ Tk_WmObjCmd(
WMOPT_WITHDRAW
};
int index;
- int length;
+ TkSizeT length;
const char *argv1;
TkWindow *winPtr, **winPtrPtr = &winPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -2809,7 +2809,7 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
- argv1 = Tcl_GetStringFromObj(objv[1], &length);
+ argv1 = TkGetStringFromObj(objv[1], &length);
if ((argv1[0] == 't') && !strncmp(argv1, "tracing", length)
&& (length >= 3)) {
int wmTracing;
@@ -2819,8 +2819,8 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- dispPtr->flags & TK_DISPLAY_WM_TRACING));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (dispPtr->flags & TK_DISPLAY_WM_TRACING) != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
@@ -2965,10 +2965,10 @@ WmAspectCmd(
if (wmPtr->sizeHintsFlags & PAspect) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->minAspect.x);
- results[1] = Tcl_NewIntObj(wmPtr->minAspect.y);
- results[2] = Tcl_NewIntObj(wmPtr->maxAspect.x);
- results[3] = Tcl_NewIntObj(wmPtr->maxAspect.y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minAspect.x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minAspect.y);
+ results[2] = Tcl_NewWideIntObj(wmPtr->maxAspect.x);
+ results[3] = Tcl_NewWideIntObj(wmPtr->maxAspect.y);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -3027,7 +3027,7 @@ WmAttributesCmd(
LONG style, exStyle, styleBit, *stylePtr = NULL;
const char *string;
int i, boolean;
- int length;
+ TkSizeT length;
int config_fullscreen = 0, updatewrapper = 0;
int fullscreen_attr_changed = 0, fullscreen_attr = 0;
@@ -3057,24 +3057,24 @@ WmAttributesCmd(
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-disabled", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((style & WS_DISABLED)));
+ Tcl_NewWideIntObj((style & WS_DISABLED) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-fullscreen", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((wmPtr->flags & WM_FULLSCREEN)));
+ Tcl_NewWideIntObj((wmPtr->flags & WM_FULLSCREEN) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-toolwindow", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((exStyle & WS_EX_TOOLWINDOW)));
+ Tcl_NewWideIntObj((exStyle & WS_EX_TOOLWINDOW) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-topmost", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((exStyle & WS_EX_TOPMOST)));
+ Tcl_NewWideIntObj((exStyle & WS_EX_TOPMOST) != 0));
Tcl_SetObjResult(interp, objPtr);
return TCL_OK;
}
for (i = 3; i < objc; i += 2) {
- string = Tcl_GetStringFromObj(objv[i], &length);
+ string = TkGetStringFromObj(objv[i], &length);
if ((length < 2) || (string[0] != '-')) {
goto configArgs;
}
@@ -3142,7 +3142,7 @@ WmAttributesCmd(
}
wmPtr->alpha = dval;
} else { /* -transparentcolor */
- const char *crefstr = Tcl_GetStringFromObj(objv[i+1], &length);
+ const char *crefstr = TkGetStringFromObj(objv[i+1], &length);
if (length == 0) {
/* reset to no transparent color */
@@ -3205,8 +3205,8 @@ WmAttributesCmd(
}
if (config_fullscreen) {
if (objc == 4) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- wmPtr->flags & WM_FULLSCREEN));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (wmPtr->flags & WM_FULLSCREEN) != 0));
} else {
fullscreen_attr_changed = 1;
fullscreen_attr = boolean;
@@ -3214,7 +3214,7 @@ WmAttributesCmd(
config_fullscreen = 0;
} else if (objc == 4) {
Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj(*stylePtr & styleBit));
+ Tcl_NewWideIntObj((*stylePtr & styleBit) != 0));
} else if (boolean) {
*stylePtr |= styleBit;
} else {
@@ -3321,7 +3321,7 @@ WmClientCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ TkSizeT length;
(void)tkwin;
if ((objc != 3) && (objc != 4)) {
@@ -3335,7 +3335,7 @@ WmClientCmd(
}
return TCL_OK;
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = TkGetStringFromObj(objv[3], &length);
if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
ckfree(wmPtr->clientMachine);
@@ -3408,7 +3408,7 @@ WmColormapwindowsCmd(
break;
}
Tcl_ListObjAppendElement(NULL, resultObj,
- TkNewWindowObj((Tk_Window) wmPtr->cmapList[i]));
+ Tk_NewWindowObj((Tk_Window) wmPtr->cmapList[i]));
}
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
@@ -3844,10 +3844,10 @@ WmGridCmd(
if (wmPtr->sizeHintsFlags & PBaseSize) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->reqGridWidth);
- results[1] = Tcl_NewIntObj(wmPtr->reqGridHeight);
- results[2] = Tcl_NewIntObj(wmPtr->widthInc);
- results[3] = Tcl_NewIntObj(wmPtr->heightInc);
+ results[0] = Tcl_NewWideIntObj(wmPtr->reqGridWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->reqGridHeight);
+ results[2] = Tcl_NewWideIntObj(wmPtr->widthInc);
+ results[3] = Tcl_NewWideIntObj(wmPtr->heightInc);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -3933,7 +3933,7 @@ WmGroupCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
const char *argv3;
- int length;
+ TkSizeT length;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
@@ -3945,7 +3945,7 @@ WmGroupCmd(
}
return TCL_OK;
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = TkGetStringFromObj(objv[3], &length);
if (*argv3 == '\0') {
wmPtr->hints.flags &= ~WindowGroupHint;
if (wmPtr->leaderName != NULL) {
@@ -4140,7 +4140,7 @@ WmIconifyCmd(
if (winPtr->flags & TK_EMBEDDED) {
if (!SendMessageW(wmPtr->wrapper, TK_ICONIFY, 0, 0)) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't iconify %s: the container does not support the request",
+ "can't iconify \"%s\": the container does not support the request",
winPtr->pathName));
Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "EMBEDDED", NULL);
return TCL_ERROR;
@@ -4163,7 +4163,7 @@ WmIconifyCmd(
}
if (wmPtr->iconFor != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't iconify %s: it is an icon for %s",
+ "can't iconify \"%s\": it is an icon for \"%s\"",
winPtr->pathName, Tk_PathName(wmPtr->iconFor)));
Tcl_SetErrorCode(interp, "TK", "WM", "ICONIFY", "ICON", NULL);
return TCL_ERROR;
@@ -4257,7 +4257,7 @@ WmIconnameCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ TkSizeT length;
(void)tkwin;
if (objc > 4) {
@@ -4272,7 +4272,7 @@ WmIconnameCmd(
if (wmPtr->iconName != NULL) {
ckfree(wmPtr->iconName);
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = TkGetStringFromObj(objv[3], &length);
wmPtr->iconName = (char *)ckalloc(length + 1);
memcpy(wmPtr->iconName, argv3, length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -4513,8 +4513,8 @@ WmIconpositionCmd(
if (wmPtr->hints.flags & IconPositionHint) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->hints.icon_x);
- results[1] = Tcl_NewIntObj(wmPtr->hints.icon_y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->hints.icon_x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->hints.icon_y);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
}
return TCL_OK;
@@ -4569,7 +4569,7 @@ WmIconwindowCmd(
}
if (objc == 3) {
if (wmPtr->icon != NULL) {
- Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon));
+ Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon));
}
return TCL_OK;
}
@@ -4737,8 +4737,8 @@ WmMaxsizeCmd(
Tcl_Obj *results[2];
GetMaxSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -4789,8 +4789,8 @@ WmMinsizeCmd(
Tcl_Obj *results[2];
GetMinSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -4850,7 +4850,7 @@ WmOverrideredirectCmd(
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
}
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -4975,7 +4975,7 @@ WmProtocolCmd(
ProtocolHandler *protPtr, *prevPtr;
Atom protocol;
const char *cmd;
- int cmdLength;
+ TkSizeT cmdLength;
Tcl_Obj *resultObj;
(void)tkwin;
@@ -5031,7 +5031,7 @@ WmProtocolCmd(
break;
}
}
- cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ cmd = TkGetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
protPtr = (ProtocolHandler *)ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
@@ -5079,8 +5079,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
+ results[1] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -5222,7 +5222,7 @@ WmStackorderCmd(
resultObj = Tcl_NewObj();
for (windowPtr = windows; *windowPtr ; windowPtr++) {
Tcl_ListObjAppendElement(NULL, resultObj,
- TkNewWindowObj((Tk_Window) *windowPtr));
+ Tk_NewWindowObj((Tk_Window) *windowPtr));
}
Tcl_SetObjResult(interp, resultObj);
ckfree(windows);
@@ -5299,7 +5299,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
return TCL_OK;
}
}
@@ -5472,7 +5472,7 @@ WmTitleCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ TkSizeT length;
HWND wrapper;
(void)tkwin;
@@ -5507,7 +5507,7 @@ WmTitleCmd(
if (wmPtr->title != NULL) {
ckfree(wmPtr->title);
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = TkGetStringFromObj(objv[3], &length);
wmPtr->title = (char *)ckalloc(length + 1);
memcpy(wmPtr->title, argv3, length + 1);
@@ -5553,12 +5553,12 @@ WmTransientCmd(
WmInfo *wmPtr2;
if ((objc != 3) && (objc != 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "window ?master?");
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?window?");
return TCL_ERROR;
}
if (objc == 3) {
if (masterPtr != NULL) {
- Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr));
+ Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) masterPtr));
}
return TCL_OK;
}
@@ -5602,7 +5602,7 @@ WmTransientCmd(
if (wmPtr2->iconFor != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "can't make \"%s\" a master: it is an icon for %s",
+ "can't make \"%s\" a container: it is an icon for %s",
Tcl_GetString(objv[3]), Tk_PathName(wmPtr2->iconFor)));
Tcl_SetErrorCode(interp, "TK", "WM", "TRANSIENT", "ICON", NULL);
return TCL_ERROR;
@@ -5611,7 +5611,7 @@ WmTransientCmd(
w = (TkWindow *)w->wmInfoPtr->masterPtr) {
if (w == winPtr) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "setting \"%s\" as master creates a transient/master cycle",
+ "can't set \"%s\" as container: would cause management loop",
Tk_PathName(masterPtr)));
Tcl_SetErrorCode(interp, "TK", "WM", "TRANSIENT", "SELF", NULL);
return TCL_ERROR;
@@ -6706,7 +6706,7 @@ TkWmStackorderToplevelEnumProc(
/*fprintf(stderr, "Looking up HWND %d\n", hwnd);*/
- hPtr = Tcl_FindHashEntry(pair->table, (char *) hwnd);
+ hPtr = Tcl_FindHashEntry(pair->table, hwnd);
if (hPtr != NULL) {
childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr);
@@ -8125,7 +8125,7 @@ WmProc(
if (message == WM_SETFOCUS) {
SetFocus(child);
result = 0;
- } else if (!Tk_TranslateWinEvent(child, message, wParam, lParam,
+ } else if (!TkTranslateWinEvent(child, message, wParam, lParam,
&result)) {
result = DefWindowProcW(hwnd, message, wParam, lParam);
}