1444c061aSmrg/*********************************************************** 2fdf6a26fSmrgCopyright (c) 1993, Oracle and/or its affiliates. 31477040fSmrg 41477040fSmrgPermission is hereby granted, free of charge, to any person obtaining a 51477040fSmrgcopy of this software and associated documentation files (the "Software"), 61477040fSmrgto deal in the Software without restriction, including without limitation 71477040fSmrgthe rights to use, copy, modify, merge, publish, distribute, sublicense, 81477040fSmrgand/or sell copies of the Software, and to permit persons to whom the 91477040fSmrgSoftware is furnished to do so, subject to the following conditions: 101477040fSmrg 111477040fSmrgThe above copyright notice and this permission notice (including the next 121477040fSmrgparagraph) shall be included in all copies or substantial portions of the 131477040fSmrgSoftware. 141477040fSmrg 151477040fSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 161477040fSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 171477040fSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 181477040fSmrgTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 191477040fSmrgLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 201477040fSmrgFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 211477040fSmrgDEALINGS IN THE SOFTWARE. 221477040fSmrg 231477040fSmrgCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. 24444c061aSmrg 25444c061aSmrg All Rights Reserved 26444c061aSmrg 27444c061aSmrgPermission to use, copy, modify, and distribute this software and its 28444c061aSmrgdocumentation for any purpose and without fee is hereby granted, 29444c061aSmrgprovided that the above copyright notice appear in all copies and that 30444c061aSmrgboth that copyright notice and this permission notice appear in 311477040fSmrgsupporting documentation, and that the name of Digital not be 32444c061aSmrgused in advertising or publicity pertaining to distribution of the 33444c061aSmrgsoftware without specific, written prior permission. 34444c061aSmrg 35444c061aSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 36444c061aSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 37444c061aSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 38444c061aSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 39444c061aSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 40444c061aSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 41444c061aSmrgSOFTWARE. 42444c061aSmrg 43444c061aSmrg******************************************************************/ 44444c061aSmrg 45444c061aSmrg/* 46444c061aSmrg 47444c061aSmrgCopyright 1987, 1988, 1994, 1998 The Open Group 48444c061aSmrg 49444c061aSmrgPermission to use, copy, modify, distribute, and sell this software and its 50444c061aSmrgdocumentation for any purpose is hereby granted without fee, provided that 51444c061aSmrgthe above copyright notice appear in all copies and that both that 52444c061aSmrgcopyright notice and this permission notice appear in supporting 53444c061aSmrgdocumentation. 54444c061aSmrg 55444c061aSmrgThe above copyright notice and this permission notice shall be included in 56444c061aSmrgall copies or substantial portions of the Software. 57444c061aSmrg 58444c061aSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59444c061aSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60444c061aSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61444c061aSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 62444c061aSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 63444c061aSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64444c061aSmrg 65444c061aSmrgExcept as contained in this notice, the name of The Open Group shall not be 66444c061aSmrgused in advertising or otherwise to promote the sale, use or other dealings 67444c061aSmrgin this Software without prior written authorization from The Open Group. 68444c061aSmrg 69444c061aSmrg*/ 70444c061aSmrg 71444c061aSmrg#ifdef HAVE_CONFIG_H 72444c061aSmrg#include <config.h> 73444c061aSmrg#endif 74444c061aSmrg#include "IntrinsicI.h" 75444c061aSmrg#include "ShellP.h" 76444c061aSmrg#include "ShellI.h" 77444c061aSmrg 78a3bd7f05Smrgstatic void 79a3bd7f05SmrgClearRectObjAreas(RectObj r, XWindowChanges *old) 80444c061aSmrg{ 81a3bd7f05Smrg Widget pw = _XtWindowedAncestor((Widget) r); 82444c061aSmrg int bw2; 83444c061aSmrg 84444c061aSmrg bw2 = old->border_width << 1; 85a3bd7f05Smrg XClearArea(XtDisplay(pw), XtWindow(pw), 86a3bd7f05Smrg old->x, old->y, 87a3bd7f05Smrg (unsigned) (old->width + bw2), (unsigned) (old->height + bw2), 88a3bd7f05Smrg TRUE); 89444c061aSmrg 90444c061aSmrg bw2 = r->rectangle.border_width << 1; 91a3bd7f05Smrg XClearArea(XtDisplay(pw), XtWindow(pw), 92a3bd7f05Smrg (int) r->rectangle.x, (int) r->rectangle.y, 93a3bd7f05Smrg (unsigned int) (r->rectangle.width + bw2), 94a3bd7f05Smrg (unsigned int) (r->rectangle.height + bw2), TRUE); 95444c061aSmrg} 96444c061aSmrg 97444c061aSmrg/* 98444c061aSmrg * Internal function used by XtMakeGeometryRequest and XtSetValues. 99444c061aSmrg * Returns more data than the public interface. Does not convert 100444c061aSmrg * XtGeometryDone to XtGeometryYes. 101444c061aSmrg * 102444c061aSmrg * clear_rect_obj - *** RETURNED *** 103a3bd7f05Smrg * TRUE if the rect obj has been cleared, false otherwise. 104444c061aSmrg */ 105444c061aSmrg 106444c061aSmrgXtGeometryResult 107a3bd7f05Smrg_XtMakeGeometryRequest(Widget widget, 108a3bd7f05Smrg XtWidgetGeometry *request, 109a3bd7f05Smrg XtWidgetGeometry *reply, 110a3bd7f05Smrg Boolean *clear_rect_obj) 111444c061aSmrg{ 112a3bd7f05Smrg XtWidgetGeometry junk; 113444c061aSmrg XtGeometryHandler manager = (XtGeometryHandler) NULL; 114444c061aSmrg XtGeometryResult returnCode; 115444c061aSmrg Widget parent = widget->core.parent; 1160568f49bSmrg Boolean managed; 1170568f49bSmrg Boolean parentRealized = False; 1180568f49bSmrg Boolean rgm = False; 119444c061aSmrg XtConfigureHookDataRec req; 120444c061aSmrg Widget hookobj; 121444c061aSmrg 122444c061aSmrg *clear_rect_obj = FALSE; 123444c061aSmrg 124444c061aSmrg CALLGEOTAT(_XtGeoTrace(widget, 125a3bd7f05Smrg "\"%s\" is making a %sgeometry request to its parent \"%s\".\n", 126a3bd7f05Smrg XtName(widget), 127a3bd7f05Smrg ((request->request_mode & XtCWQueryOnly)) ? 128a3bd7f05Smrg "query only " : "", 129a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) : 130a3bd7f05Smrg "Root")); 131444c061aSmrg CALLGEOTAT(_XtGeoTab(1)); 132444c061aSmrg 133444c061aSmrg if (XtIsShell(widget)) { 134a3bd7f05Smrg ShellClassExtension ext; 135a3bd7f05Smrg 136a3bd7f05Smrg LOCK_PROCESS; 137a3bd7f05Smrg for (ext = (ShellClassExtension) ((ShellWidgetClass) XtClass(widget)) 138a3bd7f05Smrg ->shell_class.extension; 139a3bd7f05Smrg ext != NULL && ext->record_type != NULLQUARK; 140a3bd7f05Smrg ext = (ShellClassExtension) ext->next_extension); 141a3bd7f05Smrg 142a3bd7f05Smrg if (ext != NULL) { 143a3bd7f05Smrg if (ext->version == XtShellExtensionVersion 144a3bd7f05Smrg && ext->record_size == sizeof(ShellClassExtensionRec)) { 145a3bd7f05Smrg manager = ext->root_geometry_manager; 146a3bd7f05Smrg rgm = True; 147a3bd7f05Smrg } 148a3bd7f05Smrg else { 149a3bd7f05Smrg String params[1]; 150a3bd7f05Smrg Cardinal num_params = 1; 151a3bd7f05Smrg 152a3bd7f05Smrg params[0] = XtClass(widget)->core_class.class_name; 153a3bd7f05Smrg XtAppErrorMsg(XtWidgetToApplicationContext(widget), 154a3bd7f05Smrg "invalidExtension", "xtMakeGeometryRequest", 155a3bd7f05Smrg XtCXtToolkitError, 156a3bd7f05Smrg "widget class %s has invalid ShellClassExtension record", 157a3bd7f05Smrg params, &num_params); 158a3bd7f05Smrg } 159a3bd7f05Smrg } 160a3bd7f05Smrg else { 161a3bd7f05Smrg XtAppErrorMsg(XtWidgetToApplicationContext(widget), 162a3bd7f05Smrg "internalError", "xtMakeGeometryRequest", 163a3bd7f05Smrg XtCXtToolkitError, 164a3bd7f05Smrg "internal error; ShellClassExtension is NULL", 165a3bd7f05Smrg NULL, NULL); 166a3bd7f05Smrg } 167a3bd7f05Smrg managed = True; 168a3bd7f05Smrg parentRealized = TRUE; 169a3bd7f05Smrg UNLOCK_PROCESS; 170a3bd7f05Smrg } 171a3bd7f05Smrg else { /* not shell */ 172a3bd7f05Smrg 173a3bd7f05Smrg if (parent == NULL) { 174a3bd7f05Smrg XtAppErrorMsg(XtWidgetToApplicationContext(widget), 175a3bd7f05Smrg "invalidParent", "xtMakeGeometryRequest", 176a3bd7f05Smrg XtCXtToolkitError, 177a3bd7f05Smrg "non-shell has no parent in XtMakeGeometryRequest", 178a3bd7f05Smrg NULL, NULL); 179a3bd7f05Smrg } 180a3bd7f05Smrg else { 181a3bd7f05Smrg managed = XtIsManaged(widget); 182a3bd7f05Smrg parentRealized = XtIsRealized(parent); 183a3bd7f05Smrg if (XtIsComposite(parent)) { 184a3bd7f05Smrg LOCK_PROCESS; 185a3bd7f05Smrg manager = ((CompositeWidgetClass) (parent->core.widget_class)) 186a3bd7f05Smrg ->composite_class.geometry_manager; 187a3bd7f05Smrg UNLOCK_PROCESS; 188a3bd7f05Smrg } 189a3bd7f05Smrg } 190444c061aSmrg } 191444c061aSmrg 192444c061aSmrg#if 0 193444c061aSmrg /* 194444c061aSmrg * The Xt spec says that these conditions must generate 195444c061aSmrg * error messages (not warnings), but many Xt applications 196444c061aSmrg * and toolkits (including parts of Xaw, Motif and Netscape) 197444c061aSmrg * depend on the previous Xt behaviour. Thus, these tests 198444c061aSmrg * should probably remain disabled. 199444c061aSmrg */ 200444c061aSmrg if (parentRealized && managed) { 201a3bd7f05Smrg if (parent && !XtIsComposite(parent)) { 202a3bd7f05Smrg /* 203a3bd7f05Smrg * This shouldn't ever happen, we only test for this to pass 204a3bd7f05Smrg * VSW5. Normally managing the widget will catch this, but VSW5 205a3bd7f05Smrg * does some really screwy stuff to get here. 206a3bd7f05Smrg */ 207a3bd7f05Smrg XtAppErrorMsg(XtWidgetToApplicationContext(widget), 208a3bd7f05Smrg "invalidParent", "xtMakeGeometryRequest", 209a3bd7f05Smrg XtCXtToolkitError, 210a3bd7f05Smrg "XtMakeGeometryRequest - parent not composite", 211a3bd7f05Smrg NULL, NULL); 212a3bd7f05Smrg } 213a3bd7f05Smrg else if (manager == (XtGeometryHandler) NULL) { 214a3bd7f05Smrg XtAppErrorMsg(XtWidgetToApplicationContext(widget), 215a3bd7f05Smrg "invalidGeometryManager", "xtMakeGeometryRequest", 216a3bd7f05Smrg XtCXtToolkitError, 217a3bd7f05Smrg "XtMakeGeometryRequest - parent has no geometry manager", 218a3bd7f05Smrg NULL, NULL); 219a3bd7f05Smrg } 220444c061aSmrg } 221444c061aSmrg#else 222444c061aSmrg if (!manager) 223a3bd7f05Smrg managed = False; 224444c061aSmrg#endif 225444c061aSmrg 226444c061aSmrg if (widget->core.being_destroyed) { 227a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 228a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 229a3bd7f05Smrg "It is being destroyed, just return XtGeometryNo.\n")); 230a3bd7f05Smrg return XtGeometryNo; 231444c061aSmrg } 232444c061aSmrg 233444c061aSmrg /* see if requesting anything to change */ 234444c061aSmrg req.changeMask = 0; 235444c061aSmrg if (request->request_mode & CWStackMode 236a3bd7f05Smrg && request->stack_mode != XtSMDontChange) { 237a3bd7f05Smrg req.changeMask |= CWStackMode; 238a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "Asking for a change in StackMode!\n")); 239a3bd7f05Smrg if (request->request_mode & CWSibling) { 240a3bd7f05Smrg XtCheckSubclass(request->sibling, rectObjClass, 241a3bd7f05Smrg "XtMakeGeometryRequest"); 242a3bd7f05Smrg req.changeMask |= CWSibling; 243a3bd7f05Smrg } 244a3bd7f05Smrg } 245a3bd7f05Smrg if (request->request_mode & CWX && widget->core.x != request->x) { 246a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 247a3bd7f05Smrg "Asking for a change in x: from %d to %d.\n", 248a3bd7f05Smrg widget->core.x, request->x)); 249a3bd7f05Smrg req.changeMask |= CWX; 250a3bd7f05Smrg } 251a3bd7f05Smrg if (request->request_mode & CWY && widget->core.y != request->y) { 252a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 253a3bd7f05Smrg "Asking for a change in y: from %d to %d.\n", 254a3bd7f05Smrg widget->core.y, request->y)); 255a3bd7f05Smrg req.changeMask |= CWY; 256a3bd7f05Smrg } 257a3bd7f05Smrg if (request->request_mode & CWWidth && widget->core.width != request->width) { 258a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace 259a3bd7f05Smrg (widget, "Asking for a change in width: from %d to %d.\n", 260a3bd7f05Smrg widget->core.width, request->width)); 261a3bd7f05Smrg req.changeMask |= CWWidth; 262444c061aSmrg } 263444c061aSmrg if (request->request_mode & CWHeight 264a3bd7f05Smrg && widget->core.height != request->height) { 265a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 266a3bd7f05Smrg "Asking for a change in height: from %d to %d.\n", 267a3bd7f05Smrg widget->core.height, request->height)); 268a3bd7f05Smrg req.changeMask |= CWHeight; 269444c061aSmrg } 270444c061aSmrg if (request->request_mode & CWBorderWidth 271a3bd7f05Smrg && widget->core.border_width != request->border_width) { 272a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 273a3bd7f05Smrg "Asking for a change in border_width: from %d to %d.\n", 274a3bd7f05Smrg widget->core.border_width, 275a3bd7f05Smrg request->border_width)); 276a3bd7f05Smrg req.changeMask |= CWBorderWidth; 277a3bd7f05Smrg } 278a3bd7f05Smrg if (!req.changeMask) { 279a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "Asking for nothing new,\n")); 280a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 281a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "just return XtGeometryYes.\n")); 282a3bd7f05Smrg return XtGeometryYes; 283444c061aSmrg } 284444c061aSmrg req.changeMask |= (request->request_mode & XtCWQueryOnly); 285444c061aSmrg 286a3bd7f05Smrg if (!(req.changeMask & XtCWQueryOnly) && XtIsRealized(widget)) { 287a3bd7f05Smrg /* keep record of the current geometry so we know what's changed */ 288a3bd7f05Smrg req.changes.x = widget->core.x; 289a3bd7f05Smrg req.changes.y = widget->core.y; 290a3bd7f05Smrg req.changes.width = widget->core.width; 291a3bd7f05Smrg req.changes.height = widget->core.height; 292a3bd7f05Smrg req.changes.border_width = widget->core.border_width; 293444c061aSmrg } 294444c061aSmrg 295444c061aSmrg if (!managed || !parentRealized) { 296a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 297a3bd7f05Smrg "Not Managed or Parent not realized.\n")); 298a3bd7f05Smrg /* Don't get parent's manager involved--assume the answer is yes */ 299a3bd7f05Smrg if (req.changeMask & XtCWQueryOnly) { 300a3bd7f05Smrg /* He was just asking, don't change anything, just tell him yes */ 301a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "QueryOnly request\n")); 302a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 303a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "just return XtGeometryYes.\n")); 304a3bd7f05Smrg return XtGeometryYes; 305a3bd7f05Smrg } 306a3bd7f05Smrg else { 307a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 308a3bd7f05Smrg "Copy values from request to widget.\n")); 309a3bd7f05Smrg /* copy values from request to widget */ 310a3bd7f05Smrg if (request->request_mode & CWX) 311a3bd7f05Smrg widget->core.x = request->x; 312a3bd7f05Smrg if (request->request_mode & CWY) 313a3bd7f05Smrg widget->core.y = request->y; 314a3bd7f05Smrg if (request->request_mode & CWWidth) 315a3bd7f05Smrg widget->core.width = request->width; 316a3bd7f05Smrg if (request->request_mode & CWHeight) 317a3bd7f05Smrg widget->core.height = request->height; 318a3bd7f05Smrg if (request->request_mode & CWBorderWidth) 319a3bd7f05Smrg widget->core.border_width = request->border_width; 320a3bd7f05Smrg if (!parentRealized) { 321a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 322a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "and return XtGeometryYes.\n")); 323a3bd7f05Smrg return XtGeometryYes; 324a3bd7f05Smrg } 325a3bd7f05Smrg else 326a3bd7f05Smrg returnCode = XtGeometryYes; 327a3bd7f05Smrg } 328a3bd7f05Smrg } 329a3bd7f05Smrg else { 330a3bd7f05Smrg /* go ask the widget's geometry manager */ 331a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 332a3bd7f05Smrg "Go ask the parent geometry manager.\n")); 333a3bd7f05Smrg if (reply == (XtWidgetGeometry *) NULL) { 334a3bd7f05Smrg returnCode = (*manager) (widget, request, &junk); 335a3bd7f05Smrg } 336a3bd7f05Smrg else { 337a3bd7f05Smrg returnCode = (*manager) (widget, request, reply); 338a3bd7f05Smrg } 339444c061aSmrg } 340444c061aSmrg 341444c061aSmrg /* 342444c061aSmrg * If Unrealized, not a XtGeometryYes, or a query-only then we are done. 343444c061aSmrg */ 344444c061aSmrg 345444c061aSmrg if ((returnCode != XtGeometryYes) || 346a3bd7f05Smrg (req.changeMask & XtCWQueryOnly) || !XtIsRealized(widget)) { 347444c061aSmrg 348444c061aSmrg#ifdef XT_GEO_TATTLER 349a3bd7f05Smrg switch (returnCode) { 350a3bd7f05Smrg case XtGeometryNo: 351a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 352a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "\"%s\" returns XtGeometryNo.\n", 353a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) 354a3bd7f05Smrg : "Root")); 355444c061aSmrg /* check for no change */ 356a3bd7f05Smrg break; 357a3bd7f05Smrg case XtGeometryDone: 358a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 359a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "\"%s\" returns XtGeometryDone.\n", 360a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) 361a3bd7f05Smrg : "Root")); 362444c061aSmrg /* check for no change in queryonly */ 363a3bd7f05Smrg break; 364a3bd7f05Smrg case XtGeometryAlmost: 365a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 366a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "\"%s\" returns XtGeometryAlmost.\n", 367a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) 368a3bd7f05Smrg : "Root")); 369a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(1)); 370a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "Proposal: width %d height %d.\n", 371a3bd7f05Smrg (reply) ? reply->width : junk.width, 372a3bd7f05Smrg (reply) ? reply->height : junk.height)); 373a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 374444c061aSmrg 375444c061aSmrg /* check for no change */ 376a3bd7f05Smrg break; 377a3bd7f05Smrg case XtGeometryYes: 378a3bd7f05Smrg if (req.changeMask & XtCWQueryOnly) { 379a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 380a3bd7f05Smrg "QueryOnly specified, no configuration.\n")); 381a3bd7f05Smrg } 382444c061aSmrg if (!XtIsRealized(widget)) { 383a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 384a3bd7f05Smrg "\"%s\" not realized, no configuration.\n", 385a3bd7f05Smrg XtName(widget))); 386a3bd7f05Smrg } 387a3bd7f05Smrg CALLGEOTAT(_XtGeoTab(-1)); 388a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "\"%s\" returns XtGeometryYes.\n", 389a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) 390a3bd7f05Smrg : "Root")); 391a3bd7f05Smrg break; 392a3bd7f05Smrg } 393444c061aSmrg#endif 394a3bd7f05Smrg return returnCode; 395444c061aSmrg } 396444c061aSmrg 397444c061aSmrg CALLGEOTAT(_XtGeoTab(-1)); 398a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "\"%s\" returns XtGeometryYes.\n", 399a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) : 400a3bd7f05Smrg "Root")); 401a3bd7f05Smrg 402a3bd7f05Smrg if (XtIsWidget(widget)) { /* reconfigure the window (if needed) */ 403a3bd7f05Smrg 404a3bd7f05Smrg if (rgm) 405a3bd7f05Smrg return returnCode; 406a3bd7f05Smrg 407a3bd7f05Smrg if (req.changes.x != widget->core.x) { 408a3bd7f05Smrg req.changeMask |= CWX; 409a3bd7f05Smrg req.changes.x = widget->core.x; 410a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 411a3bd7f05Smrg "x changing to %d\n", widget->core.x)); 412a3bd7f05Smrg } 413a3bd7f05Smrg if (req.changes.y != widget->core.y) { 414a3bd7f05Smrg req.changeMask |= CWY; 415a3bd7f05Smrg req.changes.y = widget->core.y; 416a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 417a3bd7f05Smrg "y changing to %d\n", widget->core.y)); 418a3bd7f05Smrg } 419a3bd7f05Smrg if (req.changes.width != widget->core.width) { 420a3bd7f05Smrg req.changeMask |= CWWidth; 421a3bd7f05Smrg req.changes.width = widget->core.width; 422a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 423a3bd7f05Smrg "width changing to %d\n", 424a3bd7f05Smrg widget->core.width)); 425a3bd7f05Smrg } 426a3bd7f05Smrg if (req.changes.height != widget->core.height) { 427a3bd7f05Smrg req.changeMask |= CWHeight; 428a3bd7f05Smrg req.changes.height = widget->core.height; 429a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 430a3bd7f05Smrg "height changing to %d\n", 431a3bd7f05Smrg widget->core.height)); 432a3bd7f05Smrg } 433a3bd7f05Smrg if (req.changes.border_width != widget->core.border_width) { 434a3bd7f05Smrg req.changeMask |= CWBorderWidth; 435a3bd7f05Smrg req.changes.border_width = widget->core.border_width; 436a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 437a3bd7f05Smrg "border_width changing to %d\n", 438a3bd7f05Smrg widget->core.border_width)); 439a3bd7f05Smrg } 440a3bd7f05Smrg if (req.changeMask & CWStackMode) { 441a3bd7f05Smrg req.changes.stack_mode = request->stack_mode; 442a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "stack_mode changing\n")); 443a3bd7f05Smrg if (req.changeMask & CWSibling) { 444a3bd7f05Smrg if (XtIsWidget(request->sibling)) 445a3bd7f05Smrg req.changes.sibling = XtWindow(request->sibling); 446a3bd7f05Smrg else 447a3bd7f05Smrg req.changeMask = 448a3bd7f05Smrg (XtGeometryMask) (req.changeMask & (unsigned long) 449a3bd7f05Smrg (~(CWStackMode | CWSibling))); 450a3bd7f05Smrg } 451a3bd7f05Smrg } 452444c061aSmrg 453444c061aSmrg#ifdef XT_GEO_TATTLER 454444c061aSmrg if (req.changeMask) { 455a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 456a3bd7f05Smrg "XConfigure \"%s\"'s window.\n", 457a3bd7f05Smrg XtName(widget))); 458a3bd7f05Smrg } 459a3bd7f05Smrg else { 460a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 461a3bd7f05Smrg "No window configuration needed for \"%s\".\n", 462a3bd7f05Smrg XtName(widget))); 463a3bd7f05Smrg } 464444c061aSmrg#endif 465444c061aSmrg 466a3bd7f05Smrg XConfigureWindow(XtDisplay(widget), XtWindow(widget), 467a3bd7f05Smrg req.changeMask, &req.changes); 468444c061aSmrg } 469a3bd7f05Smrg else { /* RectObj child of realized Widget */ 470a3bd7f05Smrg *clear_rect_obj = TRUE; 471a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 472a3bd7f05Smrg "ClearRectObj on \"%s\".\n", XtName(widget))); 473444c061aSmrg 474a3bd7f05Smrg ClearRectObjAreas((RectObj) widget, &req.changes); 475444c061aSmrg } 4760568f49bSmrg hookobj = XtHooksOfDisplay(XtDisplayOfObject(widget)); 477444c061aSmrg if (XtHasCallbacks(hookobj, XtNconfigureHook) == XtCallbackHasSome) { 478a3bd7f05Smrg req.type = XtHconfigure; 479a3bd7f05Smrg req.widget = widget; 480a3bd7f05Smrg XtCallCallbackList(hookobj, 481a3bd7f05Smrg ((HookObject) hookobj)->hooks.confighook_callbacks, 482a3bd7f05Smrg (XtPointer) &req); 483444c061aSmrg } 484444c061aSmrg 485444c061aSmrg return returnCode; 486a3bd7f05Smrg} /* _XtMakeGeometryRequest */ 487444c061aSmrg 488444c061aSmrg/* Public routines */ 489444c061aSmrg 490a3bd7f05SmrgXtGeometryResult 491a3bd7f05SmrgXtMakeGeometryRequest(Widget widget, 492a3bd7f05Smrg XtWidgetGeometry *request, 493a3bd7f05Smrg XtWidgetGeometry *reply) 494444c061aSmrg{ 495444c061aSmrg Boolean junk; 496444c061aSmrg XtGeometryResult r; 497444c061aSmrg XtGeometryHookDataRec call_data; 498444c061aSmrg Widget hookobj = XtHooksOfDisplay(XtDisplayOfObject(widget)); 499a3bd7f05Smrg 500444c061aSmrg WIDGET_TO_APPCON(widget); 501444c061aSmrg 502444c061aSmrg LOCK_APP(app); 503444c061aSmrg if (XtHasCallbacks(hookobj, XtNgeometryHook) == XtCallbackHasSome) { 504a3bd7f05Smrg call_data.type = XtHpreGeometry; 505a3bd7f05Smrg call_data.widget = widget; 506a3bd7f05Smrg call_data.request = request; 507a3bd7f05Smrg XtCallCallbackList(hookobj, 508a3bd7f05Smrg ((HookObject) hookobj)->hooks.geometryhook_callbacks, 509a3bd7f05Smrg (XtPointer) &call_data); 510a3bd7f05Smrg call_data.result = r = 511a3bd7f05Smrg _XtMakeGeometryRequest(widget, request, reply, &junk); 512a3bd7f05Smrg call_data.type = XtHpostGeometry; 513a3bd7f05Smrg call_data.reply = reply; 514a3bd7f05Smrg XtCallCallbackList(hookobj, 515a3bd7f05Smrg ((HookObject) hookobj)->hooks.geometryhook_callbacks, 516a3bd7f05Smrg (XtPointer) &call_data); 517a3bd7f05Smrg } 518a3bd7f05Smrg else { 519a3bd7f05Smrg r = _XtMakeGeometryRequest(widget, request, reply, &junk); 520444c061aSmrg } 521444c061aSmrg UNLOCK_APP(app); 522444c061aSmrg 523444c061aSmrg return ((r == XtGeometryDone) ? XtGeometryYes : r); 524444c061aSmrg} 525444c061aSmrg 526444c061aSmrgXtGeometryResult 527a3bd7f05SmrgXtMakeResizeRequest(Widget widget, 528a3bd7f05Smrg _XtDimension width, 529a3bd7f05Smrg _XtDimension height, 530a3bd7f05Smrg Dimension *replyWidth, 531a3bd7f05Smrg Dimension *replyHeight) 532444c061aSmrg{ 533444c061aSmrg XtWidgetGeometry request, reply; 534444c061aSmrg XtGeometryResult r; 535444c061aSmrg XtGeometryHookDataRec call_data; 536444c061aSmrg Boolean junk; 537444c061aSmrg Widget hookobj = XtHooksOfDisplay(XtDisplayOfObject(widget)); 538a3bd7f05Smrg 539444c061aSmrg WIDGET_TO_APPCON(widget); 540444c061aSmrg 541444c061aSmrg LOCK_APP(app); 542fdf6a26fSmrg memset(&request, 0, sizeof(request)); 543444c061aSmrg request.request_mode = CWWidth | CWHeight; 5440568f49bSmrg request.width = (Dimension) width; 5450568f49bSmrg request.height = (Dimension) height; 546444c061aSmrg 547444c061aSmrg if (XtHasCallbacks(hookobj, XtNgeometryHook) == XtCallbackHasSome) { 548a3bd7f05Smrg call_data.type = XtHpreGeometry; 549a3bd7f05Smrg call_data.widget = widget; 550a3bd7f05Smrg call_data.request = &request; 551a3bd7f05Smrg XtCallCallbackList(hookobj, 552a3bd7f05Smrg ((HookObject) hookobj)->hooks.geometryhook_callbacks, 553a3bd7f05Smrg (XtPointer) &call_data); 554a3bd7f05Smrg call_data.result = r = 555a3bd7f05Smrg _XtMakeGeometryRequest(widget, &request, &reply, &junk); 556a3bd7f05Smrg call_data.type = XtHpostGeometry; 557a3bd7f05Smrg call_data.reply = &reply; 558a3bd7f05Smrg XtCallCallbackList(hookobj, 559a3bd7f05Smrg ((HookObject) hookobj)->hooks.geometryhook_callbacks, 560a3bd7f05Smrg (XtPointer) &call_data); 561a3bd7f05Smrg } 562a3bd7f05Smrg else { 563a3bd7f05Smrg r = _XtMakeGeometryRequest(widget, &request, &reply, &junk); 564444c061aSmrg } 565444c061aSmrg if (replyWidth != NULL) { 566a3bd7f05Smrg if (r == XtGeometryAlmost && reply.request_mode & CWWidth) 567a3bd7f05Smrg *replyWidth = reply.width; 568a3bd7f05Smrg else 569a3bd7f05Smrg *replyWidth = (Dimension) width; 570444c061aSmrg } 571444c061aSmrg if (replyHeight != NULL) { 572a3bd7f05Smrg if (r == XtGeometryAlmost && reply.request_mode & CWHeight) 573a3bd7f05Smrg *replyHeight = reply.height; 574a3bd7f05Smrg else 575a3bd7f05Smrg *replyHeight = (Dimension) height; 576444c061aSmrg } 577444c061aSmrg UNLOCK_APP(app); 578444c061aSmrg return ((r == XtGeometryDone) ? XtGeometryYes : r); 579a3bd7f05Smrg} /* XtMakeResizeRequest */ 580444c061aSmrg 581a3bd7f05Smrgvoid 582a3bd7f05SmrgXtResizeWindow(Widget w) 583444c061aSmrg{ 584444c061aSmrg XtConfigureHookDataRec req; 585a3bd7f05Smrg 586444c061aSmrg WIDGET_TO_APPCON(w); 587444c061aSmrg 588444c061aSmrg LOCK_APP(app); 589444c061aSmrg if (XtIsRealized(w)) { 5900568f49bSmrg Widget hookobj; 5910568f49bSmrg 592a3bd7f05Smrg req.changes.width = w->core.width; 593a3bd7f05Smrg req.changes.height = w->core.height; 594a3bd7f05Smrg req.changes.border_width = w->core.border_width; 595a3bd7f05Smrg req.changeMask = CWWidth | CWHeight | CWBorderWidth; 596a3bd7f05Smrg XConfigureWindow(XtDisplay(w), XtWindow(w), 597a3bd7f05Smrg (unsigned) req.changeMask, &req.changes); 598a3bd7f05Smrg hookobj = XtHooksOfDisplay(XtDisplayOfObject(w)); 599a3bd7f05Smrg if (XtHasCallbacks(hookobj, XtNconfigureHook) == XtCallbackHasSome) { 600a3bd7f05Smrg req.type = XtHconfigure; 601a3bd7f05Smrg req.widget = w; 602a3bd7f05Smrg XtCallCallbackList(hookobj, 603a3bd7f05Smrg ((HookObject) hookobj)->hooks. 604a3bd7f05Smrg confighook_callbacks, (XtPointer) &req); 605a3bd7f05Smrg } 606444c061aSmrg } 607444c061aSmrg UNLOCK_APP(app); 608a3bd7f05Smrg} /* XtResizeWindow */ 609444c061aSmrg 610a3bd7f05Smrgvoid 611a3bd7f05SmrgXtResizeWidget(Widget w, 612a3bd7f05Smrg _XtDimension width, 613a3bd7f05Smrg _XtDimension height, 614a3bd7f05Smrg _XtDimension borderWidth) 615444c061aSmrg{ 616444c061aSmrg XtConfigureWidget(w, w->core.x, w->core.y, width, height, borderWidth); 617a3bd7f05Smrg} /* XtResizeWidget */ 618a3bd7f05Smrg 619a3bd7f05Smrgvoid 620a3bd7f05SmrgXtConfigureWidget(Widget w, 621a3bd7f05Smrg _XtPosition x, 622a3bd7f05Smrg _XtPosition y, 623a3bd7f05Smrg _XtDimension width, 624a3bd7f05Smrg _XtDimension height, 625a3bd7f05Smrg _XtDimension borderWidth) 626444c061aSmrg{ 627444c061aSmrg XtConfigureHookDataRec req; 628444c061aSmrg XWindowChanges old; 629a3bd7f05Smrg 630444c061aSmrg WIDGET_TO_APPCON(w); 631444c061aSmrg 632444c061aSmrg CALLGEOTAT(_XtGeoTrace(w, 633a3bd7f05Smrg "\"%s\" is being configured by its parent \"%s\"\n", 634a3bd7f05Smrg XtName(w), 635a3bd7f05Smrg (XtParent(w)) ? XtName(XtParent(w)) : "Root")); 636444c061aSmrg CALLGEOTAT(_XtGeoTab(1)); 637444c061aSmrg 638444c061aSmrg LOCK_APP(app); 639444c061aSmrg req.changeMask = 0; 640444c061aSmrg if ((old.x = w->core.x) != x) { 641a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, "x move from %d to %d\n", w->core.x, x)); 642a3bd7f05Smrg req.changes.x = w->core.x = (Position) x; 643a3bd7f05Smrg req.changeMask |= CWX; 644444c061aSmrg } 645444c061aSmrg 646444c061aSmrg if ((old.y = w->core.y) != y) { 647a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, "y move from %d to %d\n", w->core.y, y)); 648a3bd7f05Smrg req.changes.y = w->core.y = (Position) y; 649a3bd7f05Smrg req.changeMask |= CWY; 650444c061aSmrg } 651444c061aSmrg 652444c061aSmrg if ((old.width = w->core.width) != width) { 653a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, 654a3bd7f05Smrg "width move from %d to %d\n", w->core.width, 655a3bd7f05Smrg width)); 656a3bd7f05Smrg req.changes.width = w->core.width = (Dimension) width; 657a3bd7f05Smrg req.changeMask |= CWWidth; 658444c061aSmrg } 659444c061aSmrg 660444c061aSmrg if ((old.height = w->core.height) != height) { 661a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, 662a3bd7f05Smrg "height move from %d to %d\n", w->core.height, 663a3bd7f05Smrg height)); 664a3bd7f05Smrg req.changes.height = w->core.height = (Dimension) height; 665a3bd7f05Smrg req.changeMask |= CWHeight; 666444c061aSmrg } 667444c061aSmrg 668444c061aSmrg if ((old.border_width = w->core.border_width) != borderWidth) { 669a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, "border_width move from %d to %d\n", 670a3bd7f05Smrg w->core.border_width, borderWidth)); 671a3bd7f05Smrg req.changes.border_width = w->core.border_width = 672a3bd7f05Smrg (Dimension) borderWidth; 673a3bd7f05Smrg req.changeMask |= CWBorderWidth; 674444c061aSmrg } 675444c061aSmrg 676444c061aSmrg if (req.changeMask != 0) { 6770568f49bSmrg Widget hookobj; 6780568f49bSmrg 679a3bd7f05Smrg if (XtIsRealized(w)) { 680a3bd7f05Smrg if (XtIsWidget(w)) { 681a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, 682a3bd7f05Smrg "XConfigure \"%s\"'s window\n", 683a3bd7f05Smrg XtName(w))); 684a3bd7f05Smrg XConfigureWindow(XtDisplay(w), XtWindow(w), req.changeMask, 685a3bd7f05Smrg &req.changes); 686a3bd7f05Smrg } 687a3bd7f05Smrg else { 688a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, 689a3bd7f05Smrg "ClearRectObj called on \"%s\"\n", 690a3bd7f05Smrg XtName(w))); 691a3bd7f05Smrg ClearRectObjAreas((RectObj) w, &old); 692a3bd7f05Smrg } 693a3bd7f05Smrg } 694a3bd7f05Smrg hookobj = XtHooksOfDisplay(XtDisplayOfObject(w)); 695a3bd7f05Smrg if (XtHasCallbacks(hookobj, XtNconfigureHook) == XtCallbackHasSome) { 696a3bd7f05Smrg req.type = XtHconfigure; 697a3bd7f05Smrg req.widget = w; 698a3bd7f05Smrg XtCallCallbackList(hookobj, 699a3bd7f05Smrg ((HookObject) hookobj)->hooks. 700a3bd7f05Smrg confighook_callbacks, (XtPointer) &req); 701a3bd7f05Smrg } 702a3bd7f05Smrg { 703a3bd7f05Smrg XtWidgetProc resize; 704a3bd7f05Smrg 705a3bd7f05Smrg LOCK_PROCESS; 706a3bd7f05Smrg resize = XtClass(w)->core_class.resize; 707a3bd7f05Smrg UNLOCK_PROCESS; 708a3bd7f05Smrg if ((req.changeMask & (CWWidth | CWHeight)) && 709a3bd7f05Smrg resize != (XtWidgetProc) NULL) { 710a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, "Resize proc is called.\n")); 711a3bd7f05Smrg (*resize) (w); 712a3bd7f05Smrg } 713a3bd7f05Smrg } 714a3bd7f05Smrg } 715a3bd7f05Smrg else { 716a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(w, "No change in configuration\n")); 717444c061aSmrg } 718444c061aSmrg 719444c061aSmrg CALLGEOTAT(_XtGeoTab(-1)); 720444c061aSmrg UNLOCK_APP(app); 721a3bd7f05Smrg} /* XtConfigureWidget */ 722444c061aSmrg 723a3bd7f05Smrgvoid 724a3bd7f05SmrgXtMoveWidget(Widget w, _XtPosition x, _XtPosition y) 725444c061aSmrg{ 726444c061aSmrg XtConfigureWidget(w, x, y, w->core.width, w->core.height, 727a3bd7f05Smrg w->core.border_width); 728a3bd7f05Smrg} /* XtMoveWidget */ 729a3bd7f05Smrg 730a3bd7f05Smrgvoid 731a3bd7f05SmrgXtTranslateCoords(register Widget w, 732a3bd7f05Smrg _XtPosition x, 733a3bd7f05Smrg _XtPosition y, 734a3bd7f05Smrg register Position *rootx, /* return */ 735a3bd7f05Smrg register Position *rooty) /* return */ 736444c061aSmrg{ 737444c061aSmrg Position garbagex, garbagey; 738444c061aSmrg XtAppContext app = XtWidgetToApplicationContext(w); 739444c061aSmrg 740444c061aSmrg LOCK_APP(app); 741a3bd7f05Smrg if (rootx == NULL) 742a3bd7f05Smrg rootx = &garbagex; 743a3bd7f05Smrg if (rooty == NULL) 744a3bd7f05Smrg rooty = &garbagey; 745444c061aSmrg 7460568f49bSmrg *rootx = (Position) x; 7470568f49bSmrg *rooty = (Position) y; 748444c061aSmrg 749a3bd7f05Smrg for (; w != NULL && !XtIsShell(w); w = w->core.parent) { 750a3bd7f05Smrg *rootx = (Position) (*rootx + w->core.x + w->core.border_width); 751a3bd7f05Smrg *rooty = (Position) (*rooty + w->core.y + w->core.border_width); 752444c061aSmrg } 753444c061aSmrg 754444c061aSmrg if (w == NULL) 755444c061aSmrg XtAppWarningMsg(app, 756a3bd7f05Smrg "invalidShell", "xtTranslateCoords", XtCXtToolkitError, 757a3bd7f05Smrg "Widget has no shell ancestor", NULL, NULL); 758444c061aSmrg else { 759a3bd7f05Smrg Position x2, y2; 760a3bd7f05Smrg 761a3bd7f05Smrg _XtShellGetCoordinates(w, &x2, &y2); 762a3bd7f05Smrg *rootx = (Position) (*rootx + x2 + w->core.border_width); 763a3bd7f05Smrg *rooty = (Position) (*rooty + y2 + w->core.border_width); 764444c061aSmrg } 765444c061aSmrg UNLOCK_APP(app); 766444c061aSmrg} 767444c061aSmrg 768a3bd7f05SmrgXtGeometryResult XtQueryGeometry(Widget widget, 769a3bd7f05Smrg register XtWidgetGeometry *intended, /* parent's changes; may be NULL */ 770a3bd7f05Smrg XtWidgetGeometry *reply) { /* child's preferred geometry; never NULL */ 771444c061aSmrg XtWidgetGeometry null_intended; 772444c061aSmrg XtGeometryHandler query; 773444c061aSmrg XtGeometryResult result; 774a3bd7f05Smrg 775444c061aSmrg WIDGET_TO_APPCON(widget); 776444c061aSmrg 777444c061aSmrg CALLGEOTAT(_XtGeoTrace(widget, 778a3bd7f05Smrg "\"%s\" is asking its preferred geometry to \"%s\".\n", 779a3bd7f05Smrg (XtParent(widget)) ? XtName(XtParent(widget)) : 780a3bd7f05Smrg "Root", XtName(widget))); 781444c061aSmrg CALLGEOTAT(_XtGeoTab(1)); 782444c061aSmrg 783444c061aSmrg LOCK_APP(app); 784444c061aSmrg LOCK_PROCESS; 785444c061aSmrg query = XtClass(widget)->core_class.query_geometry; 786444c061aSmrg UNLOCK_PROCESS; 787444c061aSmrg reply->request_mode = 0; 788444c061aSmrg if (query != NULL) { 789a3bd7f05Smrg if (intended == NULL) { 790a3bd7f05Smrg null_intended.request_mode = 0; 791a3bd7f05Smrg intended = &null_intended; 792444c061aSmrg#ifdef XT_GEO_TATTLER 793a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, "without any constraint.\n")); 794a3bd7f05Smrg } 795a3bd7f05Smrg else { 796a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 797a3bd7f05Smrg "with the following constraints:\n")); 798a3bd7f05Smrg 799a3bd7f05Smrg if (intended->request_mode & CWX) { 800a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, " x = %d\n", intended->x)); 801a3bd7f05Smrg } 802a3bd7f05Smrg if (intended->request_mode & CWY) { 803a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, " y = %d\n", intended->y)); 804a3bd7f05Smrg } 805a3bd7f05Smrg if (intended->request_mode & CWWidth) { 806a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 807a3bd7f05Smrg " width = %d\n", intended->width)); 808a3bd7f05Smrg } 809a3bd7f05Smrg if (intended->request_mode & CWHeight) { 810a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 811a3bd7f05Smrg " height = %d\n", intended->height)); 812a3bd7f05Smrg } 813a3bd7f05Smrg if (intended->request_mode & CWBorderWidth) { 814a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace(widget, 815a3bd7f05Smrg " border_width = %d\n", 816a3bd7f05Smrg intended->border_width)); 817a3bd7f05Smrg } 818444c061aSmrg#endif 819a3bd7f05Smrg } 820444c061aSmrg 821a3bd7f05Smrg result = (*query) (widget, intended, reply); 822444c061aSmrg } 823444c061aSmrg else { 824a3bd7f05Smrg CALLGEOTAT(_XtGeoTrace 825a3bd7f05Smrg (widget, 826a3bd7f05Smrg "\"%s\" has no QueryGeometry proc, return the current state\n", 827a3bd7f05Smrg XtName(widget))); 828444c061aSmrg 829a3bd7f05Smrg result = XtGeometryYes; 830444c061aSmrg } 831444c061aSmrg 832444c061aSmrg#ifdef XT_GEO_TATTLER 833444c061aSmrg#define FillIn(mask, field) \ 834a3bd7f05Smrg if (!(reply->request_mode & mask)) {\ 835a3bd7f05Smrg reply->field = widget->core.field;\ 836a3bd7f05Smrg _XtGeoTrace(widget," using core %s = %d.\n","field",\ 837a3bd7f05Smrg widget->core.field);\ 838a3bd7f05Smrg } else {\ 839a3bd7f05Smrg _XtGeoTrace(widget," replied %s = %d\n","field",\ 840a3bd7f05Smrg reply->field);\ 841a3bd7f05Smrg } 842444c061aSmrg#else 843444c061aSmrg#define FillIn(mask, field) \ 844a3bd7f05Smrg if (!(reply->request_mode & mask)) reply->field = widget->core.field; 845444c061aSmrg#endif 846444c061aSmrg 847444c061aSmrg FillIn(CWX, x); 848444c061aSmrg FillIn(CWY, y); 849444c061aSmrg FillIn(CWWidth, width); 850444c061aSmrg FillIn(CWHeight, height); 851444c061aSmrg FillIn(CWBorderWidth, border_width); 852444c061aSmrg 853444c061aSmrg CALLGEOTAT(_XtGeoTab(-1)); 854444c061aSmrg#undef FillIn 855444c061aSmrg 856444c061aSmrg if (!(reply->request_mode & CWStackMode)) 857a3bd7f05Smrg reply->stack_mode = XtSMDontChange; 858444c061aSmrg UNLOCK_APP(app); 859444c061aSmrg return result; 860444c061aSmrg} 861