diff options
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 2f00672..324511a 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -57,8 +57,8 @@ typedef struct ProtocolHandler { /* Next in list of protocol handlers for the * same top-level window, or NULL for end of * list. */ - Tcl_Interp *interp; /* Interpreter in which to invoke command. */ - char command[1]; /* Tcl command to invoke when a client message + Tcl_Interp *interp; /* Interpreter in which to invoke command. */ + char command[TKFLEXARRAY]; /* Tcl command to invoke when a client message * for this protocol arrives. The actual size * of the structure varies to accommodate the * needs of the actual command. THIS MUST BE @@ -177,7 +177,7 @@ typedef struct TkWmInfo { * (corresponds to hints.window_group). * Malloc-ed. Note: this field doesn't get * updated if leader is destroyed. */ - TkWindow *masterPtr; /* Master window for TRANSIENT_FOR property, + TkWindow *containerPtr; /* Container window for TRANSIENT_FOR property, * or NULL. */ Tk_Window icon; /* Window to use as icon for this window, or * NULL. */ @@ -315,7 +315,7 @@ typedef struct TkWmInfo { * window (controlled by "wm resizable" command). * WM_WITHDRAWN - Non-zero means that this window has explicitly * been withdrawn. If it's a transient, it should - * not mirror state changes in the master. + * not mirror state changes in the container. * WM_FULLSCREEN - Non-zero means that this window has been placed * in the full screen mode. It should be mapped at * 0,0 and be the width and height of the screen. @@ -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 { @@ -2037,7 +2037,7 @@ UpdateWrapper( * Pick the decorative frame style. Override redirect windows get * created as undecorated popups if they have no transient parent, * otherwise they are children. This allows splash screens to operate - * as an independent window, while having dropdows (like for a + * as an independent window, while having dropdowns (like for a * combobox) not grab focus away from their parent. Transient windows * get a modal dialog frame. Neither override, nor transient windows * appear in the Windows taskbar. Note that a transient window does @@ -2054,7 +2054,7 @@ UpdateWrapper( */ parentHWND = GetDesktopWindow(); - if (wmPtr->masterPtr) { + if (wmPtr->containerPtr) { wmPtr->style |= WS_CHILD; } else { wmPtr->style |= WS_POPUP; @@ -2062,10 +2062,10 @@ UpdateWrapper( } else if (wmPtr->flags & WM_FULLSCREEN) { wmPtr->style = WM_FULLSCREEN_STYLE; wmPtr->exStyle = EX_FULLSCREEN_STYLE; - } else if (wmPtr->masterPtr) { + } else if (wmPtr->containerPtr) { wmPtr->style = WM_TRANSIENT_STYLE; wmPtr->exStyle = EX_TRANSIENT_STYLE; - parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->masterPtr)); + parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->containerPtr)); if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) && (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) { wmPtr->style |= WS_THICKFRAME; @@ -2204,7 +2204,7 @@ UpdateWrapper( if (wmPtr->numTransients > 0) { /* * Unset the current wrapper as the parent for all transient - * children for whom this is the master + * children for whom this is the container */ WmInfo *wmPtr2; @@ -2213,7 +2213,7 @@ UpdateWrapper( state = 0; for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr + if (wmPtr2->containerPtr == winPtr && !(wmPtr2->flags & WM_NEVER_MAPPED)) { childStateInfo[state++] = wmPtr2->hints.initial_state; SetParent(TkWinGetHWND(wmPtr2->winPtr->window), NULL); @@ -2292,7 +2292,7 @@ UpdateWrapper( if (childStateInfo) { if (wmPtr->numTransients > 0) { /* - * Reset all transient children for whom this is the master. + * Reset all transient children for whom this is the container. */ WmInfo *wmPtr2; @@ -2300,7 +2300,7 @@ UpdateWrapper( state = 0; for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr + if (wmPtr2->containerPtr == winPtr && !(wmPtr2->flags & WM_NEVER_MAPPED)) { UpdateWrapper(wmPtr2->winPtr); TkpWmSetState(wmPtr2->winPtr, childStateInfo[state++]); @@ -2365,10 +2365,10 @@ TkWmMapWindow( if (wmPtr->flags & WM_NEVER_MAPPED) { /* - * Don't map a transient if the master is not mapped. + * Don't map a transient if the container is not mapped. */ - if (wmPtr->masterPtr != NULL && !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->containerPtr != NULL && !Tk_IsMapped(wmPtr->containerPtr)) { wmPtr->hints.initial_state = WithdrawnState; return; } @@ -2610,17 +2610,17 @@ TkWmDeadWindow( } /* - * Reset all transient windows whose master is the dead window. + * Reset all transient windows whose container is the dead window. */ for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr) { + if (wmPtr2->containerPtr == winPtr) { wmPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr, + Tk_DeleteEventHandler((Tk_Window) wmPtr2->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, wmPtr2->winPtr); - wmPtr2->masterPtr = NULL; + wmPtr2->containerPtr = NULL; if ((wmPtr2->wrapper != NULL) && !(wmPtr2->flags & (WM_NEVER_MAPPED))) { UpdateWrapper(wmPtr2->winPtr); @@ -2670,20 +2670,20 @@ TkWmDeadWindow( if (wmPtr->flags & WM_UPDATE_PENDING) { Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } - if (wmPtr->masterPtr != NULL) { - wmPtr2 = wmPtr->masterPtr->wmInfoPtr; + if (wmPtr->containerPtr != NULL) { + wmPtr2 = wmPtr->containerPtr->wmInfoPtr; /* - * If we had a master, tell them that we aren't tied to them anymore. + * If we had a container, tell them that we aren't tied to them anymore. */ if (wmPtr2 != NULL) { wmPtr2->numTransients--; } - Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, + Tk_DeleteEventHandler((Tk_Window) wmPtr->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); - wmPtr->masterPtr = NULL; + wmPtr->containerPtr = NULL; } if (wmPtr->crefObj != NULL) { Tcl_DecrRefCount(wmPtr->crefObj); @@ -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; @@ -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; @@ -4154,7 +4154,7 @@ WmIconifyCmd( NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { + if (wmPtr->containerPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); @@ -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; @@ -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; } @@ -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); @@ -5403,7 +5403,7 @@ WmStateCmd( "OVERRIDE_REDIRECT", NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { + if (wmPtr->containerPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); @@ -5549,46 +5549,46 @@ WmTransientCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; - TkWindow *masterPtr = wmPtr->masterPtr, **masterPtrPtr = &masterPtr, *w; + TkWindow *containerPtr = wmPtr->containerPtr, **containerPtrPtr = &containerPtr, *w; 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)); + if (containerPtr != NULL) { + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) containerPtr)); } return TCL_OK; } if (Tcl_GetString(objv[3])[0] == '\0') { - if (masterPtr != NULL) { + if (containerPtr != NULL) { /* - * If we had a master, tell them that we aren't tied to them + * If we had a container, tell them that we aren't tied to them * anymore. */ - masterPtr->wmInfoPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) masterPtr, + containerPtr->wmInfoPtr->numTransients--; + Tk_DeleteEventHandler((Tk_Window) containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); } - wmPtr->masterPtr = NULL; + wmPtr->containerPtr = NULL; } else { if (TkGetWindowFromObj(interp, tkwin, objv[3], - (Tk_Window *) masterPtrPtr) != TCL_OK) { + (Tk_Window *) containerPtrPtr) != TCL_OK) { return TCL_ERROR; } - while (!Tk_TopWinHierarchy(masterPtr)) { + while (!Tk_TopWinHierarchy(containerPtr)) { /* - * Ensure that the master window is actually a Tk toplevel. + * Ensure that the container window is actually a Tk toplevel. */ - masterPtr = masterPtr->parentPtr; + containerPtr = containerPtr->parentPtr; } - Tk_MakeWindowExist((Tk_Window) masterPtr); + Tk_MakeWindowExist((Tk_Window) containerPtr); if (wmPtr->iconFor != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -5598,51 +5598,51 @@ WmTransientCmd( return TCL_ERROR; } - wmPtr2 = masterPtr->wmInfoPtr; + wmPtr2 = containerPtr->wmInfoPtr; 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; } - for (w = masterPtr; w != NULL && w->wmInfoPtr != NULL; - w = (TkWindow *)w->wmInfoPtr->masterPtr) { + for (w = containerPtr; w != NULL && w->wmInfoPtr != NULL; + w = (TkWindow *)w->wmInfoPtr->containerPtr) { if (w == winPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "setting \"%s\" as master creates a transient/master cycle", - Tk_PathName(masterPtr))); + "can't set \"%s\" as container: would cause management loop", + Tk_PathName(containerPtr))); Tcl_SetErrorCode(interp, "TK", "WM", "TRANSIENT", "SELF", NULL); return TCL_ERROR; } } - if (masterPtr != wmPtr->masterPtr) { + if (containerPtr != wmPtr->containerPtr) { /* - * Remove old master map/unmap binding before setting the new - * master. The event handler will ensure that transient states - * reflect the state of the master. + * Remove old container map/unmap binding before setting the new + * container. The event handler will ensure that transient states + * reflect the state of the container. */ - if (wmPtr->masterPtr != NULL) { - wmPtr->masterPtr->wmInfoPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, + if (wmPtr->containerPtr != NULL) { + wmPtr->containerPtr->wmInfoPtr->numTransients--; + Tk_DeleteEventHandler((Tk_Window) wmPtr->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); } - masterPtr->wmInfoPtr->numTransients++; - Tk_CreateEventHandler((Tk_Window) masterPtr, + containerPtr->wmInfoPtr->numTransients++; + Tk_CreateEventHandler((Tk_Window) containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); - wmPtr->masterPtr = masterPtr; + wmPtr->containerPtr = containerPtr; } } if (!((wmPtr->flags & WM_NEVER_MAPPED) && !(winPtr->flags & TK_EMBEDDED))) { - if (wmPtr->masterPtr != NULL - && !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->containerPtr != NULL + && !Tk_IsMapped(wmPtr->containerPtr)) { TkpWmSetState(winPtr, WithdrawnState); } else { UpdateWrapper(winPtr); @@ -5728,9 +5728,9 @@ WmWaitVisibilityOrMapProc( XEvent *eventPtr) /* Information about event. */ { TkWindow *winPtr = (TkWindow *)clientData; - TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr; + TkWindow *containerPtr = winPtr->wmInfoPtr->containerPtr; - if (masterPtr == NULL) + if (containerPtr == NULL) return; if (eventPtr->type == MapNotify) { @@ -5742,7 +5742,7 @@ WmWaitVisibilityOrMapProc( } if (eventPtr->type == VisibilityNotify) { - int state = masterPtr->wmInfoPtr->hints.initial_state; + int state = containerPtr->wmInfoPtr->hints.initial_state; if ((state == NormalState) || (state == ZoomState)) { state = winPtr->wmInfoPtr->hints.initial_state; |