diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-10-05 21:26:11 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-10-05 21:26:11 (GMT) |
commit | 944ea0cc0724bcc8ec6376873897663b7c77d6bf (patch) | |
tree | c15d6bf5e708e8b4bba17f4ed07454f4eb6ac316 /macosx/tkMacOSXWm.c | |
parent | e8d773fd302e54d41d6c6e3a15f0b3d0255ba95b (diff) | |
download | tk-944ea0cc0724bcc8ec6376873897663b7c77d6bf.zip tk-944ea0cc0724bcc8ec6376873897663b7c77d6bf.tar.gz tk-944ea0cc0724bcc8ec6376873897663b7c77d6bf.tar.bz2 |
minor improvements in legibility
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 445 |
1 files changed, 247 insertions, 198 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 11519f3..8bbb701 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.67 2008/10/05 18:22:21 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.68 2008/10/05 21:26:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -89,90 +89,128 @@ static int windowHashInit = false; * Forward declarations for procedures defined in this file: */ -static void InitialWindowBounds(TkWindow *winPtr, WindowRef macWindow, - Rect *geometry); -static int ParseGeometry(Tcl_Interp *interp, char *string, TkWindow *winPtr); -static void TopLevelEventProc(ClientData clientData, XEvent *eventPtr); -static void WmStackorderToplevelWrapperMap(TkWindow *winPtr, Display *display, - Tcl_HashTable *table); -static void UpdateGeometryInfo(ClientData clientData); -static void UpdateSizeHints(TkWindow *winPtr); -static void UpdateVRootGeometry(WmInfo *wmPtr); -static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmColormapwindowsCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmOverrideredirectCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr, - Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *const objv[]); -static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr); -static int WmWinStyle(Tcl_Interp *interp, TkWindow *winPtr, int objc, - Tcl_Obj * const objv[]); -static void ApplyWindowClassAttributeChanges(TkWindow *winPtr, - WindowRef macWindow, WindowClass oldClass, - WindowAttributes oldAttributes, int create); -static void ApplyMasterOverrideChanges(TkWindow *winPtr, WindowRef macWindow); -static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr); -static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr); -static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr); -static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); +static void InitialWindowBounds(TkWindow *winPtr, + WindowRef macWindow, Rect *geometry); +static int ParseGeometry(Tcl_Interp *interp, char *string, + TkWindow *winPtr); +static void TopLevelEventProc(ClientData clientData, + XEvent *eventPtr); +static void WmStackorderToplevelWrapperMap(TkWindow *winPtr, + Display *display, Tcl_HashTable *table); +static void UpdateGeometryInfo(ClientData clientData); +static void UpdateSizeHints(TkWindow *winPtr); +static void UpdateVRootGeometry(WmInfo *wmPtr); +static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmColormapwindowsCmd(Tk_Window tkwin, + TkWindow *winPtr, Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmOverrideredirectCmd(Tk_Window tkwin, + TkWindow *winPtr, Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); +static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr); +static int WmWinStyle(Tcl_Interp *interp, TkWindow *winPtr, + int objc, Tcl_Obj *const objv[]); +static void ApplyWindowClassAttributeChanges(TkWindow *winPtr, + WindowRef macWindow, WindowClass oldClass, + WindowAttributes oldAttributes, int create); +static void ApplyMasterOverrideChanges(TkWindow *winPtr, + WindowRef macWindow); +static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr); +static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, + int *minHeightPtr); +static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, + int *maxHeightPtr); +static void RemapWindows(TkWindow *winPtr, + MacDrawable *parentWin); /* *---------------------------------------------------------------------- @@ -314,6 +352,7 @@ TkWmMapWindow( /* * Generate configure event when we first map the window. */ + TkGenWMConfigureEvent((Tk_Window) winPtr, wmPtr->x, wmPtr->y, -1, -1, TK_LOCATION_CHANGED); @@ -1146,7 +1185,7 @@ WmColormapwindowsCmd( return TCL_ERROR; } cmapList = (TkWindow **) ckalloc((unsigned) - ((windowObjc+1) * sizeof(TkWindow*))); + ((windowObjc+1) * sizeof(TkWindow*))); for (i = 0; i < windowObjc; i++) { if (TkGetWindowFromObj(interp, tkwin, windowObjv[i], (Tk_Window *) &winPtr2) != TCL_OK) { @@ -1170,7 +1209,7 @@ WmColormapwindowsCmd( } wmPtr->flags |= WM_COLORMAPS_EXPLICIT; if (wmPtr->cmapList != NULL) { - ckfree((char *)wmPtr->cmapList); + ckfree((char *) wmPtr->cmapList); } wmPtr->cmapList = cmapList; wmPtr->cmapCount = windowObjc; @@ -1188,8 +1227,8 @@ WmColormapwindowsCmd( * * WmCommandCmd -- * - * This procedure is invoked to process the "wm command" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm command" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1442,7 +1481,7 @@ WmFrameCmd( if (window == None) { window = Tk_WindowId((Tk_Window) winPtr); } - sprintf(buf, "0x%x", (unsigned int) window); + sprintf(buf, "0x%x", (unsigned) window); Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_OK; } @@ -1736,8 +1775,8 @@ WmIconbitmapCmd( * * WmIconifyCmd -- * - * This procedure is invoked to process the "wm iconify" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm iconify" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1876,19 +1915,20 @@ WmIconnameCmd( return TCL_ERROR; } if (objc == 3) { - Tcl_SetResult(interp, (char *) ((wmPtr->iconName != NULL) ? - wmPtr->iconName : ""), TCL_STATIC); - return TCL_OK; - } else { if (wmPtr->iconName != NULL) { - ckfree((char *) wmPtr->iconName); - } - argv3 = Tcl_GetStringFromObj(objv[3], &length); - wmPtr->iconName = ckalloc((unsigned) length + 1); - strcpy(wmPtr->iconName, argv3); - if (!(wmPtr->flags & WM_NEVER_MAPPED)) { - XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName); + Tcl_SetObjResult(interp, Tcl_NewStringObj(wmPtr->iconName, -1)); } + return TCL_OK; + } + + if (wmPtr->iconName != NULL) { + ckfree((char *) wmPtr->iconName); + } + argv3 = Tcl_GetStringFromObj(objv[3], &length); + wmPtr->iconName = ckalloc((unsigned) length + 1); + strcpy(wmPtr->iconName, argv3); + if (!(wmPtr->flags & WM_NEVER_MAPPED)) { + XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName); } return TCL_OK; } @@ -1899,7 +1939,7 @@ WmIconnameCmd( * WmIconphotoCmd -- * * This procedure is invoked to process the "wm iconphoto" Tcl command. - * See the user documentation for details on what it does. Not yet + * See the user documentation for details on what it does. Not yet * implemented for OS X. * * Results: @@ -2165,8 +2205,8 @@ WmManageCmd( * * WmMaxsizeCmd -- * - * This procedure is invoked to process the "wm maxsize" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm maxsize" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2216,8 +2256,8 @@ WmMaxsizeCmd( * * WmMinsizeCmd -- * - * This procedure is invoked to process the "wm minsize" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm minsize" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2313,9 +2353,8 @@ WmOverrideredirectCmd( * * WmPositionfromCmd -- * - * This procedure is invoked to process the "wm positionfrom" - * Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm positionfrom" Tcl + * command. See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2687,28 +2726,27 @@ WmStackorderCmd( */ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr); - if (windows == NULL) { Tcl_AppendResult(interp, "TkWmStackorderToplevel failed", NULL); return TCL_ERROR; - } else { - for (window_ptr = windows; *window_ptr ; window_ptr++) { - if (*window_ptr == winPtr) { - index1 = (window_ptr - windows); - } - if (*window_ptr == winPtr2) { - index2 = (window_ptr - windows); - } - } - if (index1 == -1) { - Tcl_Panic("winPtr window not found"); + } + + for (window_ptr = windows; *window_ptr ; window_ptr++) { + if (*window_ptr == winPtr) { + index1 = (window_ptr - windows); } - if (index2 == -1) { - Tcl_Panic("winPtr2 window not found"); + if (*window_ptr == winPtr2) { + index2 = (window_ptr - windows); } - - ckfree((char *) windows); } + if (index1 == -1) { + Tcl_Panic("winPtr window not found"); + } + if (index2 == -1) { + Tcl_Panic("winPtr2 window not found"); + } + + ckfree((char *) windows); if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, &index) != TCL_OK) { @@ -2781,9 +2819,10 @@ WmStateCmd( if (index == OPT_NORMAL) { TkpWmSetState(winPtr, NormalState); + /* - * This varies from 'wm deiconify' because it does not - * force the window to be raised and receive focus + * This varies from 'wm deiconify' because it does not force the + * window to be raised and receive focus */ } else if (index == OPT_ICONIC) { if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) { @@ -2802,29 +2841,27 @@ WmStateCmd( } else { /* OPT_ZOOMED */ TkpWmSetState(winPtr, ZoomState); } + } else if (wmPtr->iconFor != NULL) { + Tcl_SetResult(interp, "icon", TCL_STATIC); } else { - if (wmPtr->iconFor != NULL) { - Tcl_SetResult(interp, "icon", TCL_STATIC); - } else { - if (wmPtr->hints.initial_state == NormalState || - wmPtr->hints.initial_state == ZoomState) { - wmPtr->hints.initial_state = (TkMacOSXIsWindowZoomed(winPtr) ? - ZoomState : NormalState); - } - switch (wmPtr->hints.initial_state) { - case NormalState: - Tcl_SetResult(interp, "normal", TCL_STATIC); - break; - case IconicState: - Tcl_SetResult(interp, "iconic", TCL_STATIC); - break; - case WithdrawnState: - Tcl_SetResult(interp, "withdrawn", TCL_STATIC); - break; - case ZoomState: - Tcl_SetResult(interp, "zoomed", TCL_STATIC); - break; - } + if (wmPtr->hints.initial_state == NormalState || + wmPtr->hints.initial_state == ZoomState) { + wmPtr->hints.initial_state = (TkMacOSXIsWindowZoomed(winPtr) ? + ZoomState : NormalState); + } + switch (wmPtr->hints.initial_state) { + case NormalState: + Tcl_SetResult(interp, "normal", TCL_STATIC); + break; + case IconicState: + Tcl_SetResult(interp, "iconic", TCL_STATIC); + break; + case WithdrawnState: + Tcl_SetResult(interp, "withdrawn", TCL_STATIC); + break; + case ZoomState: + Tcl_SetResult(interp, "zoomed", TCL_STATIC); + break; } } return TCL_OK; @@ -3005,10 +3042,11 @@ WmWithdrawCmd( * Invoked by those wm subcommands that affect geometry. * Schedules a geometry update. */ + static void -WmUpdateGeom(wmPtr, winPtr) -WmInfo *wmPtr; -TkWindow *winPtr; +WmUpdateGeom( + WmInfo *wmPtr, + TkWindow *winPtr) { if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); @@ -3217,6 +3255,7 @@ TopLevelEventProc( Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, NULL, NULL); + Tk_DestroyWindow((Tk_Window) winPtr); Tk_DeleteErrorHandler(handler); } @@ -3689,55 +3728,55 @@ Tk_GetRootCoords( x += winPtr->changes.x + winPtr->changes.border_width; y += winPtr->changes.y + winPtr->changes.border_width; if (winPtr->flags & TK_TOP_LEVEL) { + TkWindow *otherPtr; + if (!(Tk_IsEmbedded(winPtr))) { x += winPtr->wmInfoPtr->xInParent; y += winPtr->wmInfoPtr->yInParent; break; - } else { - TkWindow *otherPtr = TkpGetOtherWindow(winPtr); - - if (otherPtr != NULL) { - /* - * The container window is in the same application. Query - * its coordinates. - */ + } - winPtr = otherPtr; + otherPtr = TkpGetOtherWindow(winPtr); + if (otherPtr == NULL) { + if (tkMacOSXEmbedHandler->getOffsetProc != NULL) { + Point theOffset; /* - * Remember to offset by the container window here, since - * at the end of this if branch, we will pop out to the - * container's parent... + * We do not require that the changes.x & changes.y for a + * non-Tk master window be kept up to date. So we first + * subtract off the possibly bogus values that have been + * added on at the top of this pass through the loop, and + * then call out to the getOffsetProc to give us the + * correct offset. */ - x += winPtr->changes.x + winPtr->changes.border_width; - y += winPtr->changes.y + winPtr->changes.border_width; + x -= winPtr->changes.x + winPtr->changes.border_width; + y -= winPtr->changes.y + winPtr->changes.border_width; - } else { - Point theOffset; + tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr, + &theOffset); - if (tkMacOSXEmbedHandler->getOffsetProc != NULL) { - /* - * We do not require that the changes.x & changes.y - * for a non-Tk master window be kept up to date. So - * we first subtract off the possibly bogus values - * that have been added on at the top of this pass - * through the loop, and then call out to the - * getOffsetProc to give us the correct offset. - */ + x += theOffset.h; + y += theOffset.v; + } + break; + } - x -= winPtr->changes.x + winPtr->changes.border_width; - y -= winPtr->changes.y + winPtr->changes.border_width; + /* + * The container window is in the same application. Query its + * coordinates. + */ - tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr, - &theOffset); + winPtr = otherPtr; - x += theOffset.h; - y += theOffset.v; - } - break; - } - } + /* + * Remember to offset by the container window here, since at the + * end of this if branch, we will pop out to the container's + * parent... + */ + + x += winPtr->changes.x + winPtr->changes.border_width; + y += winPtr->changes.y + winPtr->changes.border_width; } winPtr = winPtr->parentPtr; } @@ -3830,8 +3869,8 @@ Tk_CoordsToWindow( bd = childPtr->changes.border_width; if ((tmpx >= -bd) && (tmpy >= -bd) - && (tmpx < (childPtr->changes.width + bd)) - && (tmpy < (childPtr->changes.height + bd))) { + && (tmpx < (childPtr->changes.width + bd)) + && (tmpy < (childPtr->changes.height + bd))) { nextPtr = childPtr; } } @@ -4881,7 +4920,10 @@ TkMacOSXZoomToplevel( idealSize.v = maxHeight; } - /* Do nothing if already in desired zoom state */ + /* + * Do nothing if already in desired zoom state. + */ + if (!IsWindowInStandardState(whichWindow, &idealSize, NULL) == (zoomPart == inZoomIn)) { return false; @@ -4949,8 +4991,8 @@ TkUnsupported1ObjCmd( return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", - 0, &index) != TCL_OK) { + if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", 0, + &index) != TCL_OK) { return TCL_ERROR; } if (((enum SubCmds) index) == TKMWS_STYLE) { @@ -5259,8 +5301,8 @@ TkMacOSXMakeRealWindowExist( Tcl_Panic("TkMacOSXMakeRealWindowExist could not find container"); } if (tkMacOSXEmbedHandler->containerExistProc && - tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr) != - TCL_OK) { + tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr) + != TCL_OK) { Tcl_Panic("ContainerExistProc could not make container"); } return; @@ -5878,7 +5920,7 @@ TkWmStackorderToplevel( while (frontWindow != NULL) { hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow); if (hPtr != NULL) { - childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr); + childWinPtr = Tcl_GetHashValue(hPtr); *window_ptr-- = childWinPtr; } frontWindow = GetNextWindow(frontWindow); @@ -6432,7 +6474,14 @@ RemapWindows( /* Repeat for all the children */ for (childPtr = winPtr->childList; childPtr != NULL; - childPtr = childPtr->nextPtr) { + childPtr = childPtr->nextPtr) { RemapWindows(childPtr, (MacDrawable *) winPtr->window); } } + +/* + * Local Variables: + * fill-column: 78 + * c-basic-offset: 4 + * End: + */ |