10568f49bSmrg<?xml version="1.0" encoding="UTF-8" ?> 20568f49bSmrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> 30568f49bSmrg 49e7bcd65Smrg<chapter id='Geometry_Management'> 59e7bcd65Smrg<title>Geometry Management</title> 69e7bcd65Smrg 79e7bcd65Smrg<para> 89e7bcd65SmrgA widget does not directly control its size and location; 99e7bcd65Smrgrather, its parent is responsible for controlling them. 109e7bcd65SmrgAlthough the position of children is usually left up to their parent, 119e7bcd65Smrgthe widgets themselves often have the best idea of their optimal sizes 129e7bcd65Smrgand, possibly, preferred locations. 139e7bcd65Smrg</para> 149e7bcd65Smrg 159e7bcd65Smrg<para> 169e7bcd65SmrgTo resolve physical layout conflicts between sibling widgets and between 179e7bcd65Smrga widget and its parent, the Intrinsics provide the geometry management mechanism. 189e7bcd65SmrgAlmost all 199e7bcd65Smrgcomposite 209e7bcd65Smrgwidgets have a geometry manager specified in the <emphasis remap='I'>geometry_manager</emphasis> field 219e7bcd65Smrgin the widget class record that is responsible for the size, position, and 229e7bcd65Smrgstacking order of the widget's children. 239e7bcd65SmrgThe only exception is fixed boxes, 249e7bcd65Smrgwhich create their children themselves and can ensure that 259e7bcd65Smrgtheir children will never make a geometry request. 269e7bcd65Smrg</para> 279e7bcd65Smrg 289e7bcd65Smrg<sect1 id="Initiating_Geometry_Changes"> 299e7bcd65Smrg<title>Initiating Geometry Changes</title> 309e7bcd65Smrg 319e7bcd65Smrg<para> 329e7bcd65SmrgParents, children, and clients each initiate geometry changes differently. 339e7bcd65SmrgBecause a parent has absolute control of its children's geometry, 349e7bcd65Smrgit changes the geometry directly by calling 350568f49bSmrg<function>XtMoveWidget</function>, 369e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/>, 379e7bcd65Smrgor 389e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>. 399e7bcd65SmrgA child must ask its parent for a geometry change by calling 409e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 419e7bcd65Smrgor 429e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>. 439e7bcd65SmrgAn application or other client code initiates a geometry change by calling 449e7bcd65Smrg<xref linkend='XtSetValues' xrefstyle='select: title'/> 459e7bcd65Smrgon the appropriate geometry fields, 469e7bcd65Smrgthereby giving the widget the opportunity to modify or reject the client 479e7bcd65Smrgrequest before it gets propagated to the parent and the opportunity 489e7bcd65Smrgto respond appropriately to the parent's reply. 499e7bcd65Smrg</para> 509e7bcd65Smrg 519e7bcd65Smrg<para> 529e7bcd65SmrgWhen a widget that needs to change its size, position, border width, 539e7bcd65Smrgor stacking depth asks its parent's geometry manager to make the desired 549e7bcd65Smrgchanges, 559e7bcd65Smrgthe geometry manager can allow the request, disallow the request, or 569e7bcd65Smrgsuggest a compromise. 579e7bcd65Smrg</para> 589e7bcd65Smrg 599e7bcd65Smrg<para> 609e7bcd65SmrgWhen the geometry manager is asked to change the geometry of a child, 619e7bcd65Smrgthe geometry manager may also rearrange and resize any or all 629e7bcd65Smrgof the other children that it controls. 639e7bcd65SmrgThe geometry manager can move children around freely using 649e7bcd65Smrg<xref linkend='XtMoveWidget' xrefstyle='select: title'/>. 659e7bcd65SmrgWhen it resizes a child (that is, changes the width, height, or 669e7bcd65Smrgborder width) other than the one making the request, 679e7bcd65Smrgit should do so by calling 689e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/>. 699e7bcd65SmrgThe requesting child may be given special treatment; see 709e7bcd65Smrg<xref linkend='Child_Geometry_Management_The_geometry_manager_Procedure' />. 719e7bcd65SmrgIt can simultaneously move and resize a child with a single call to 729e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>. 739e7bcd65Smrg</para> 749e7bcd65Smrg 759e7bcd65Smrg<para> 769e7bcd65SmrgOften, geometry managers find that they can satisfy a request only if 779e7bcd65Smrgthey can reconfigure a widget that they are not in control of; in particular, 789e7bcd65Smrgthe 799e7bcd65Smrgcomposite 809e7bcd65Smrgwidget may want to change its own size. 819e7bcd65SmrgIn this case, 829e7bcd65Smrgthe geometry manager makes a request to its parent's geometry manager. 839e7bcd65SmrgGeometry requests can cascade this way to arbitrary depth. 849e7bcd65Smrg</para> 859e7bcd65Smrg 869e7bcd65Smrg<para> 879e7bcd65SmrgBecause such cascaded arbitration of widget geometry can involve extended 889e7bcd65Smrgnegotiation, 899e7bcd65Smrgwindows are not actually allocated to widgets at application 909e7bcd65Smrgstartup until all widgets are satisfied with their geometry; 919e7bcd65Smrgsee <xref linkend='Creating_Widgets' /> and 929e7bcd65Smrg<xref linkend='Realizing_Widgets' />. 939e7bcd65Smrg</para> 949e7bcd65Smrg 959e7bcd65Smrg<note> 969e7bcd65Smrg<orderedlist> 979e7bcd65Smrg <listitem> 989e7bcd65Smrg <para> 999e7bcd65SmrgThe Intrinsics treatment of stacking requests is deficient in several areas. 1009e7bcd65SmrgStacking requests for unrealized widgets are granted but will have no effect. 1019e7bcd65SmrgIn addition, there is no way to do an 1029e7bcd65Smrg<xref linkend='XtSetValues' xrefstyle='select: title'/> 1039e7bcd65Smrgthat will generate a stacking geometry request. 1049e7bcd65Smrg </para> 1059e7bcd65Smrg </listitem> 1069e7bcd65Smrg <listitem> 1079e7bcd65Smrg <para> 1089e7bcd65SmrgAfter a successful geometry request (one that returned 1099e7bcd65Smrg<function>XtGeometryYes</function>), 1109e7bcd65Smrga widget does not know whether its resize procedure has been called. 1119e7bcd65SmrgWidgets should have resize procedures that can be called more than once 1129e7bcd65Smrgwithout ill effects. 1139e7bcd65Smrg </para> 1149e7bcd65Smrg </listitem> 1159e7bcd65Smrg</orderedlist> 1169e7bcd65Smrg</note> 1179e7bcd65Smrg</sect1> 1189e7bcd65Smrg 1199e7bcd65Smrg<sect1 id="General_Geometry_Manager_Requests"> 1209e7bcd65Smrg<title>General Geometry Manager Requests</title> 1219e7bcd65Smrg<para> 1229e7bcd65SmrgWhen making a geometry request, the child specifies an 1239e7bcd65Smrg<function>XtWidgetGeometry</function> 1249e7bcd65Smrgstructure. 1259e7bcd65Smrg</para> 1269e7bcd65Smrg 1270568f49bSmrg<programlisting> 1289e7bcd65Smrgtypedef unsigned long XtGeometryMask; 1299e7bcd65Smrgtypedef struct { 1300568f49bSmrg XtGeometryMask request_mode; 1310568f49bSmrg Position x, y; 1320568f49bSmrg Dimension width, height; 1330568f49bSmrg Dimension border_width; 1340568f49bSmrg Widget sibling; 1350568f49bSmrg int stack_mode; 1369e7bcd65Smrg} XtWidgetGeometry; 1370568f49bSmrg</programlisting> 1389e7bcd65Smrg 1399e7bcd65Smrg<para> 1409e7bcd65SmrgTo make a general geometry manager request from a widget, use 1419e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>. 1429e7bcd65Smrg</para> 1439e7bcd65Smrg 1449e7bcd65Smrg<funcsynopsis id='XtMakeGeometryRequest'> 1459e7bcd65Smrg<funcprototype> 1469e7bcd65Smrg<funcdef>XtGeometryResult <function>XtMakeGeometryRequest</function></funcdef> 1479e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 1489e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef> 1499e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>reply_return</parameter></paramdef> 1509e7bcd65Smrg</funcprototype> 1519e7bcd65Smrg</funcsynopsis> 1529e7bcd65Smrg 1539e7bcd65Smrg<variablelist> 1549e7bcd65Smrg <varlistentry> 1559e7bcd65Smrg <term> 1569e7bcd65Smrg <emphasis remap='I'>w</emphasis> 1579e7bcd65Smrg </term> 1589e7bcd65Smrg <listitem> 1599e7bcd65Smrg <para> 1609e7bcd65SmrgSpecifies the widget making the request. Must be of class RectObj or any subclass thereof. 1619e7bcd65Smrg </para> 1629e7bcd65Smrg </listitem> 1639e7bcd65Smrg </varlistentry> 1649e7bcd65Smrg <varlistentry> 1659e7bcd65Smrg <term> 1669e7bcd65Smrg <emphasis remap='I'>request</emphasis> 1679e7bcd65Smrg </term> 1689e7bcd65Smrg <listitem> 1699e7bcd65Smrg <para> 1709e7bcd65SmrgSpecifies the desired widget geometry (size, position, border width, 1719e7bcd65Smrgand stacking order). 1729e7bcd65Smrg </para> 1739e7bcd65Smrg </listitem> 1749e7bcd65Smrg </varlistentry> 1759e7bcd65Smrg <varlistentry> 1769e7bcd65Smrg <term> 1779e7bcd65Smrg <emphasis remap='I'>reply_return</emphasis> 1789e7bcd65Smrg </term> 1799e7bcd65Smrg <listitem> 1809e7bcd65Smrg <para> 1819e7bcd65SmrgReturns the allowed widget size, or may be NULL 1829e7bcd65Smrgif the requesting widget is not interested in handling 1839e7bcd65Smrg<function>XtGeometryAlmost</function>. 1849e7bcd65Smrg </para> 1859e7bcd65Smrg </listitem> 1869e7bcd65Smrg </varlistentry> 1879e7bcd65Smrg</variablelist> 1889e7bcd65Smrg 1899e7bcd65Smrg 1909e7bcd65Smrg<para> 1919e7bcd65SmrgDepending on the condition, 1929e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 1939e7bcd65Smrgperforms the following: 1949e7bcd65Smrg</para> 1959e7bcd65Smrg 1969e7bcd65Smrg<itemizedlist spacing='compact'> 1979e7bcd65Smrg <listitem> 1989e7bcd65Smrg <para> 1999e7bcd65SmrgIf the widget is unmanaged or the widget's parent is not realized, 2009e7bcd65Smrgit makes the changes and returns 2019e7bcd65Smrg<function>XtGeometryYes</function>. 2029e7bcd65Smrg </para> 2039e7bcd65Smrg </listitem> 2049e7bcd65Smrg <listitem> 2059e7bcd65Smrg <para> 2069e7bcd65SmrgIf the parent's class is not a subclass of 2079e7bcd65Smrg<function>compositeWidgetClass</function> 2089e7bcd65Smrgor the parent's <emphasis remap='I'>geometry_manager</emphasis> field is NULL, 2099e7bcd65Smrgit issues an error. 2109e7bcd65Smrg </para> 2119e7bcd65Smrg </listitem> 2129e7bcd65Smrg <listitem> 2139e7bcd65Smrg <para> 2149e7bcd65SmrgIf the widget's <emphasis remap='I'>being_destroyed</emphasis> field is 2159e7bcd65Smrg<function>True</function>, 2169e7bcd65Smrgit returns 2179e7bcd65Smrg<function>XtGeometryNo</function>. 2189e7bcd65Smrg </para> 2199e7bcd65Smrg </listitem> 2209e7bcd65Smrg <listitem> 2219e7bcd65Smrg <para> 2229e7bcd65SmrgIf the widget <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and 2239e7bcd65Smrg<emphasis remap='I'>border_width</emphasis> fields are 2249e7bcd65Smrgall equal to the requested values, 2259e7bcd65Smrgit returns 2269e7bcd65Smrg<function>XtGeometryYes</function>; 2279e7bcd65Smrgotherwise, it calls the parent's geometry_manager procedure 2289e7bcd65Smrgwith the given parameters. 2299e7bcd65Smrg </para> 2309e7bcd65Smrg </listitem> 2319e7bcd65Smrg <listitem> 2329e7bcd65Smrg <para> 2339e7bcd65SmrgIf the parent's geometry manager returns 2349e7bcd65Smrg<function>XtGeometryYes</function> 2359e7bcd65Smrgand if 2369e7bcd65Smrg<function>XtCWQueryOnly</function> 2379e7bcd65Smrgis not set in <emphasis remap='I'>request->request_mode</emphasis> 2389e7bcd65Smrgand if the widget is realized, 2399e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 2409e7bcd65Smrgcalls the 2419e7bcd65Smrg<function>XConfigureWindow</function> 2429e7bcd65SmrgXlib function to reconfigure the widget's window (set its size, location, 2439e7bcd65Smrgand stacking order as appropriate). 2449e7bcd65Smrg </para> 2459e7bcd65Smrg </listitem> 2469e7bcd65Smrg <listitem> 2479e7bcd65Smrg <para> 2489e7bcd65SmrgIf the geometry manager returns 2499e7bcd65Smrg<function>XtGeometryDone</function>, 2509e7bcd65Smrgthe change has been approved and actually has been done. 2519e7bcd65SmrgIn this case, 2529e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 2539e7bcd65Smrgdoes no configuring and returns 2549e7bcd65Smrg<function>XtGeometryYes</function>. 2559e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 2569e7bcd65Smrgnever returns 2579e7bcd65Smrg<function>XtGeometryDone</function>. 2589e7bcd65Smrg </para> 2599e7bcd65Smrg </listitem> 2609e7bcd65Smrg <listitem> 2619e7bcd65Smrg <para> 2629e7bcd65SmrgOtherwise, 2639e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 2649e7bcd65Smrgjust returns the resulting value from the parent's geometry manager. 2659e7bcd65Smrg </para> 2669e7bcd65Smrg </listitem> 2679e7bcd65Smrg</itemizedlist> 2689e7bcd65Smrg 2699e7bcd65Smrg<para> 2709e7bcd65SmrgChildren of primitive widgets are always unmanaged; therefore, 2719e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 2729e7bcd65Smrgalways returns 2739e7bcd65Smrg<function>XtGeometryYes</function> 2749e7bcd65Smrgwhen called by a child of a primitive widget. 2759e7bcd65Smrg</para> 2769e7bcd65Smrg 2779e7bcd65Smrg<para> 2789e7bcd65SmrgThe return codes from geometry managers are 2799e7bcd65Smrg</para> 2809e7bcd65Smrg 2810568f49bSmrg<programlisting> 2829e7bcd65Smrgtypedef enum { 2830568f49bSmrg XtGeometryYes, 2840568f49bSmrg XtGeometryNo, 2850568f49bSmrg XtGeometryAlmost, 2860568f49bSmrg XtGeometryDone 2879e7bcd65Smrg} XtGeometryResult; 2880568f49bSmrg</programlisting> 2899e7bcd65Smrg 2909e7bcd65Smrg<para> 2919e7bcd65SmrgThe <emphasis remap='I'>request_mode</emphasis> definitions are from 2920568f49bSmrg<filename class="headerfile"><X11/X.h></filename>. 2939e7bcd65Smrg</para> 2949e7bcd65Smrg 2959e7bcd65Smrg<informaltable frame='none'> 2969e7bcd65Smrg <?dbfo keep-together="always" ?> 2979e7bcd65Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 2989e7bcd65Smrg <colspec colwidth='1.0*' colname='c1'/> 2999e7bcd65Smrg <colspec colwidth='1.0*' colname='c2'/> 3009e7bcd65Smrg <colspec colwidth='1.0*' colname='c3'/> 3019e7bcd65Smrg <tbody> 3029e7bcd65Smrg <row> 3039e7bcd65Smrg <entry>#define</entry> 3049e7bcd65Smrg <entry><function>CWX</function></entry> 3059e7bcd65Smrg <entry>(1<<0)</entry> 3069e7bcd65Smrg </row> 3079e7bcd65Smrg <row> 3089e7bcd65Smrg <entry>#define</entry> 3099e7bcd65Smrg <entry><function>CWY</function></entry> 3109e7bcd65Smrg <entry>(1<<1)</entry> 3119e7bcd65Smrg </row> 3129e7bcd65Smrg <row> 3139e7bcd65Smrg <entry>#define</entry> 3149e7bcd65Smrg <entry><function>CWWidth</function></entry> 3159e7bcd65Smrg <entry>(1<<2)</entry> 3169e7bcd65Smrg </row> 3179e7bcd65Smrg <row> 3189e7bcd65Smrg <entry>#define</entry> 3199e7bcd65Smrg <entry><function>CWHeight</function></entry> 3209e7bcd65Smrg <entry>(1<<3)</entry> 3219e7bcd65Smrg </row> 3229e7bcd65Smrg <row> 3239e7bcd65Smrg <entry>#define</entry> 3249e7bcd65Smrg <entry><function>CWBorderWidth</function></entry> 3259e7bcd65Smrg <entry>(1<<4)</entry> 3269e7bcd65Smrg </row> 3279e7bcd65Smrg <row> 3289e7bcd65Smrg <entry>#define</entry> 3299e7bcd65Smrg <entry><function>CWSibling</function></entry> 3309e7bcd65Smrg <entry>(1<<5)</entry> 3319e7bcd65Smrg </row> 3329e7bcd65Smrg <row> 3339e7bcd65Smrg <entry>#define</entry> 3349e7bcd65Smrg <entry><function>CWStackMode</function></entry> 3359e7bcd65Smrg <entry>(1<<6)</entry> 3369e7bcd65Smrg </row> 3379e7bcd65Smrg </tbody> 3389e7bcd65Smrg </tgroup> 3399e7bcd65Smrg</informaltable> 3409e7bcd65Smrg 3419e7bcd65Smrg<para> 3429e7bcd65SmrgThe Intrinsics also support the following value. 3439e7bcd65Smrg</para> 3449e7bcd65Smrg 3459e7bcd65Smrg<informaltable frame='none'> 3469e7bcd65Smrg <?dbfo keep-together="always" ?> 3479e7bcd65Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 3489e7bcd65Smrg <colspec colwidth='1.0*' colname='c1'/> 3499e7bcd65Smrg <colspec colwidth='1.0*' colname='c2'/> 3509e7bcd65Smrg <colspec colwidth='1.0*' colname='c3'/> 3519e7bcd65Smrg <tbody> 3529e7bcd65Smrg <row> 3539e7bcd65Smrg <entry>#define</entry> 3549e7bcd65Smrg <entry><function>XtCWQueryOnly</function></entry> 3559e7bcd65Smrg <entry>(1<<7)</entry> 3569e7bcd65Smrg </row> 3579e7bcd65Smrg </tbody> 3589e7bcd65Smrg </tgroup> 3599e7bcd65Smrg</informaltable> 3609e7bcd65Smrg 3619e7bcd65Smrg<para> 3629e7bcd65Smrg<function>XtCWQueryOnly</function> 3639e7bcd65Smrgindicates that the corresponding geometry request is only a query 3649e7bcd65Smrgas to what would happen if this geometry request were made 3659e7bcd65Smrgand that no widgets should actually be changed. 3669e7bcd65Smrg</para> 3679e7bcd65Smrg 3689e7bcd65Smrg<para> 3699e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>, 3709e7bcd65Smrglike the 3719e7bcd65Smrg<function>XConfigureWindow</function> 3729e7bcd65SmrgXlib function, uses <emphasis remap='I'>request_mode</emphasis> to determine which fields in the 3739e7bcd65Smrg<function>XtWidgetGeometry</function> 3749e7bcd65Smrgstructure the caller wants to specify. 3759e7bcd65Smrg</para> 3769e7bcd65Smrg 3779e7bcd65Smrg<para> 3789e7bcd65SmrgThe <emphasis remap='I'>stack_mode</emphasis> definitions are from 3790568f49bSmrg<filename class="headerfile"><X11/X.h></filename>: 3809e7bcd65Smrg</para> 3819e7bcd65Smrg 3829e7bcd65Smrg<informaltable frame='none'> 3839e7bcd65Smrg <?dbfo keep-together="always" ?> 3849e7bcd65Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 3859e7bcd65Smrg <colspec colwidth='1.0*' colname='c1'/> 3869e7bcd65Smrg <colspec colwidth='1.0*' colname='c2'/> 3879e7bcd65Smrg <colspec colwidth='1.0*' colname='c3'/> 3889e7bcd65Smrg <tbody> 3899e7bcd65Smrg <row> 3909e7bcd65Smrg <entry>#define</entry> 3919e7bcd65Smrg <entry><function>Above</function></entry> 3929e7bcd65Smrg <entry>0</entry> 3939e7bcd65Smrg </row> 3949e7bcd65Smrg <row> 3959e7bcd65Smrg <entry>#define</entry> 3969e7bcd65Smrg <entry><function>Below</function></entry> 3979e7bcd65Smrg <entry>1</entry> 3989e7bcd65Smrg </row> 3999e7bcd65Smrg <row> 4009e7bcd65Smrg <entry>#define</entry> 4019e7bcd65Smrg <entry><function>TopIf</function></entry> 4029e7bcd65Smrg <entry>2</entry> 4039e7bcd65Smrg </row> 4049e7bcd65Smrg <row> 4059e7bcd65Smrg <entry>#define</entry> 4069e7bcd65Smrg <entry><function>BottomIf</function></entry> 4079e7bcd65Smrg <entry>3</entry> 4089e7bcd65Smrg </row> 4099e7bcd65Smrg <row> 4109e7bcd65Smrg <entry>#define</entry> 4119e7bcd65Smrg <entry><function>Opposite</function></entry> 4129e7bcd65Smrg <entry>4</entry> 4139e7bcd65Smrg </row> 4149e7bcd65Smrg </tbody> 4159e7bcd65Smrg </tgroup> 4169e7bcd65Smrg</informaltable> 4179e7bcd65Smrg 4189e7bcd65Smrg<para> 4199e7bcd65SmrgThe Intrinsics also support the following value. 4209e7bcd65Smrg</para> 4219e7bcd65Smrg 4229e7bcd65Smrg<informaltable frame='none'> 4239e7bcd65Smrg <?dbfo keep-together="always" ?> 4249e7bcd65Smrg <tgroup cols='3' align='left' colsep='0' rowsep='0'> 4259e7bcd65Smrg <colspec colwidth='1.0*' colname='c1'/> 4269e7bcd65Smrg <colspec colwidth='1.0*' colname='c2'/> 4279e7bcd65Smrg <colspec colwidth='1.0*' colname='c3'/> 4289e7bcd65Smrg <tbody> 4299e7bcd65Smrg <row> 4309e7bcd65Smrg <entry>#define</entry> 4319e7bcd65Smrg <entry><function>XtSMDontChange</function></entry> 4329e7bcd65Smrg <entry>5</entry> 4339e7bcd65Smrg </row> 4349e7bcd65Smrg </tbody> 4359e7bcd65Smrg </tgroup> 4369e7bcd65Smrg</informaltable> 4379e7bcd65Smrg 4389e7bcd65Smrg<para> 4399e7bcd65SmrgFor definition and behavior of 4409e7bcd65Smrg<function>Above</function>, 4419e7bcd65Smrg<function>Below</function>, 4429e7bcd65Smrg<function>TopIf</function>, 4439e7bcd65Smrg<function>BottomIf</function>, 4449e7bcd65Smrgand 4459e7bcd65Smrg<function>Opposite</function>, 4469e7bcd65Smrg<olink targetdoc='libX11' targetptr='Configuring_Windows' >BLAH</olink> 4470568f49bSmrgin <olink targetptr='libX11' targetdoc='libX11'>Xlib — C Language X Interface</olink>. 4489e7bcd65Smrg<function>XtSMDontChange</function> 4499e7bcd65Smrgindicates that the widget wants its current stacking order preserved. 4509e7bcd65Smrg</para> 4519e7bcd65Smrg</sect1> 4529e7bcd65Smrg 4539e7bcd65Smrg<sect1 id="Resize_Requests"> 4549e7bcd65Smrg<title>Resize Requests</title> 4559e7bcd65Smrg<para> 4569e7bcd65SmrgTo make a simple resize request from a widget, you can use 4579e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/> 4589e7bcd65Smrgas an alternative to 4599e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>. 4609e7bcd65Smrg</para> 4619e7bcd65Smrg 4629e7bcd65Smrg<funcsynopsis id='XtMakeResizeRequest'> 4639e7bcd65Smrg<funcprototype> 4649e7bcd65Smrg<funcdef>typedef XtGeometryResult <function>XtMakeResizeRequest</function></funcdef> 4659e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 4669e7bcd65Smrg <paramdef>Dimension <parameter>width</parameter></paramdef> 4679e7bcd65Smrg <paramdef>Dimension *<parameter>width_return</parameter></paramdef> 4689e7bcd65Smrg</funcprototype> 4699e7bcd65Smrg</funcsynopsis> 4709e7bcd65Smrg 4719e7bcd65Smrg<variablelist> 4729e7bcd65Smrg <varlistentry> 4739e7bcd65Smrg <term> 4749e7bcd65Smrg <emphasis remap='I'>w</emphasis> 4759e7bcd65Smrg </term> 4769e7bcd65Smrg <listitem> 4779e7bcd65Smrg <para> 4789e7bcd65SmrgSpecifies the widget making the request. Must be of class RectObj or any subclass thereof. 4799e7bcd65Smrg </para> 4809e7bcd65Smrg </listitem> 4819e7bcd65Smrg </varlistentry> 4829e7bcd65Smrg <varlistentry> 4839e7bcd65Smrg <term> 4849e7bcd65Smrg <emphasis remap='I'>width</emphasis> 4859e7bcd65Smrg </term> 4869e7bcd65Smrg <listitem> 4879e7bcd65Smrg <para> 4889e7bcd65SmrgSpecify the desired widget width and height. 4899e7bcd65Smrg </para> 4909e7bcd65Smrg </listitem> 4919e7bcd65Smrg </varlistentry> 4929e7bcd65Smrg <varlistentry> 4939e7bcd65Smrg <term> 4949e7bcd65Smrg <emphasis remap='I'>height</emphasis> 4959e7bcd65Smrg </term> 4969e7bcd65Smrg <listitem> 4979e7bcd65Smrg <para></para> 4989e7bcd65Smrg </listitem> 4999e7bcd65Smrg </varlistentry> 5009e7bcd65Smrg <varlistentry> 5019e7bcd65Smrg <term> 5029e7bcd65Smrg <emphasis remap='I'>width_return</emphasis> 5039e7bcd65Smrg </term> 5049e7bcd65Smrg <listitem> 5059e7bcd65Smrg <para> 5069e7bcd65SmrgReturn the allowed widget width and height. 5079e7bcd65Smrg </para> 5089e7bcd65Smrg </listitem> 5099e7bcd65Smrg </varlistentry> 5109e7bcd65Smrg <varlistentry> 5119e7bcd65Smrg <term> 5129e7bcd65Smrg <emphasis remap='I'>height_return</emphasis> 5139e7bcd65Smrg </term> 5149e7bcd65Smrg <listitem> 5159e7bcd65Smrg <para></para> 5169e7bcd65Smrg </listitem> 5179e7bcd65Smrg </varlistentry> 5189e7bcd65Smrg</variablelist> 5199e7bcd65Smrg 5209e7bcd65Smrg 5219e7bcd65Smrg<para> 5229e7bcd65SmrgThe 5239e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/> 5249e7bcd65Smrgfunction, a simple interface to 5259e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>, 5269e7bcd65Smrgcreates an 5279e7bcd65Smrg<function>XtWidgetGeometry</function> 5289e7bcd65Smrgstructure and specifies that width and height should change 5299e7bcd65Smrgby setting <emphasis remap='I'>request_mode</emphasis> to 5309e7bcd65Smrg<function>CWWidth</function> 5319e7bcd65Smrg<function>|</function> 5329e7bcd65Smrg<function>CWHeight</function>. 5339e7bcd65SmrgThe geometry manager is free to modify any of the other window attributes 5349e7bcd65Smrg(position or stacking order) to satisfy the resize request. 5359e7bcd65SmrgIf the return value is 5369e7bcd65Smrg<function>XtGeometryAlmost</function>, 5379e7bcd65Smrg<emphasis remap='I'>width_return</emphasis> and <emphasis remap='I'>height_return</emphasis> contain a compromise width and height. 5389e7bcd65SmrgIf these are acceptable, 5399e7bcd65Smrgthe widget should immediately call 5409e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/> 5419e7bcd65Smrgagain and request that the compromise width and height be applied. 5429e7bcd65SmrgIf the widget is not interested in 5439e7bcd65Smrg<function>XtGeometryAlmost</function> 5449e7bcd65Smrgreplies, 5459e7bcd65Smrgit can pass NULL for <emphasis remap='I'>width_return</emphasis> and <emphasis remap='I'>height_return</emphasis>. 5469e7bcd65Smrg</para> 5479e7bcd65Smrg</sect1> 5489e7bcd65Smrg 5499e7bcd65Smrg<sect1 id="Potential_Geometry_Changes"> 5509e7bcd65Smrg<title>Potential Geometry Changes</title> 5519e7bcd65Smrg<para> 5529e7bcd65SmrgSometimes a geometry manager cannot respond to 5539e7bcd65Smrga geometry request from a child without first making a geometry request 5549e7bcd65Smrgto the widget's own parent (the original requestor's grandparent). 5559e7bcd65SmrgIf the request to the grandparent would allow the parent to satisfy the 5569e7bcd65Smrgoriginal request, 5579e7bcd65Smrgthe geometry manager can make the intermediate geometry request 5589e7bcd65Smrgas if it were the originator. 5599e7bcd65SmrgOn the other hand, 5609e7bcd65Smrgif the geometry manager already has determined that the original request 5619e7bcd65Smrgcannot be completely satisfied (for example, if it always denies 5629e7bcd65Smrgposition changes), 5639e7bcd65Smrgit needs to tell the grandparent to respond to the intermediate request 5649e7bcd65Smrgwithout actually changing the geometry 5659e7bcd65Smrgbecause it does not know if the child will accept the compromise. 5669e7bcd65SmrgTo accomplish this, the geometry manager uses 5679e7bcd65Smrg<function>XtCWQueryOnly</function> 5689e7bcd65Smrgin the intermediate request. 5699e7bcd65Smrg</para> 5709e7bcd65Smrg 5719e7bcd65Smrg<para> 5729e7bcd65SmrgWhen 5739e7bcd65Smrg<function>XtCWQueryOnly</function> 5749e7bcd65Smrgis used, the geometry manager needs to cache 5759e7bcd65Smrgenough information to exactly reconstruct the intermediate request. 5769e7bcd65SmrgIf the grandparent's response to the intermediate query was 5779e7bcd65Smrg<function>XtGeometryAlmost</function>, 5789e7bcd65Smrgthe geometry manager needs to cache the entire 5799e7bcd65Smrgreply geometry in the event the child accepts the parent's compromise. 5809e7bcd65Smrg</para> 5819e7bcd65Smrg 5829e7bcd65Smrg<para> 5839e7bcd65SmrgIf the grandparent's response was 5849e7bcd65Smrg<function>XtGeometryAlmost</function>, 5859e7bcd65Smrgit may also be necessary to cache the entire reply geometry from 5869e7bcd65Smrgthe grandparent when 5879e7bcd65Smrg<function>XtCWQueryOnly</function> 5889e7bcd65Smrgis not used. 5899e7bcd65SmrgIf the geometry manager is still able to satisfy the original request, 5909e7bcd65Smrgit may immediately accept the grandparent's compromise 5919e7bcd65Smrgand then act on the child's request. 5929e7bcd65SmrgIf the grandparent's compromise geometry is insufficient to allow 5939e7bcd65Smrgthe child's request and if the geometry manager is willing to offer 5949e7bcd65Smrga different compromise to the child, 5959e7bcd65Smrgthe grandparent's compromise should not be accepted until the child 5969e7bcd65Smrghas accepted the new compromise. 5979e7bcd65Smrg</para> 5989e7bcd65Smrg 5999e7bcd65Smrg<para> 6009e7bcd65SmrgNote that a compromise geometry returned with 6019e7bcd65Smrg<function>XtGeometryAlmost</function> 6029e7bcd65Smrgis guaranteed only for the next call to the same widget; 6039e7bcd65Smrgtherefore, a cache of size 1 is sufficient. 6049e7bcd65Smrg</para> 6059e7bcd65Smrg</sect1> 6069e7bcd65Smrg 6079e7bcd65Smrg<sect1 id="Child_Geometry_Management_The_geometry_manager_Procedure"> 6089e7bcd65Smrg<title>Child Geometry Management: The geometry_manager Procedure</title> 6099e7bcd65Smrg<para> 6109e7bcd65SmrgThe geometry_manager procedure pointer in a composite widget class is of type 6119e7bcd65Smrg<xref linkend='XtGeometryHandler' xrefstyle='select: title'/>. 6129e7bcd65Smrg</para> 6139e7bcd65Smrg 6149e7bcd65Smrg<funcsynopsis id='XtGeometryHandler'> 6159e7bcd65Smrg<funcprototype> 6160568f49bSmrg<funcdef>typedef XtGeometryResult *<function>XtGeometryHandler</function></funcdef> 6179e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 6189e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef> 6199e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>geometry_return</parameter></paramdef> 6209e7bcd65Smrg</funcprototype> 6219e7bcd65Smrg</funcsynopsis> 6229e7bcd65Smrg 6239e7bcd65Smrg<variablelist> 6249e7bcd65Smrg <varlistentry> 6259e7bcd65Smrg <term> 6269e7bcd65Smrg <emphasis remap='I'>w</emphasis> 6279e7bcd65Smrg </term> 6289e7bcd65Smrg <listitem> 6299e7bcd65Smrg <para> 6309e7bcd65SmrgPasses the widget making the request. 6319e7bcd65Smrg </para> 6329e7bcd65Smrg </listitem> 6339e7bcd65Smrg </varlistentry> 6349e7bcd65Smrg <varlistentry> 6359e7bcd65Smrg <term> 6369e7bcd65Smrg <emphasis remap='I'>request</emphasis> 6379e7bcd65Smrg </term> 6389e7bcd65Smrg <listitem> 6399e7bcd65Smrg <para> 6409e7bcd65SmrgPasses the new geometry the child desires. 6419e7bcd65Smrg </para> 6429e7bcd65Smrg </listitem> 6439e7bcd65Smrg </varlistentry> 6449e7bcd65Smrg <varlistentry> 6459e7bcd65Smrg <term> 6469e7bcd65Smrg <emphasis remap='I'>geometry_return</emphasis> 6479e7bcd65Smrg </term> 6489e7bcd65Smrg <listitem> 6499e7bcd65Smrg <para> 6509e7bcd65SmrgPasses a geometry structure in which the geometry manager may store a 6519e7bcd65Smrgcompromise. 6529e7bcd65Smrg </para> 6539e7bcd65Smrg </listitem> 6549e7bcd65Smrg </varlistentry> 6559e7bcd65Smrg</variablelist> 6569e7bcd65Smrg 6579e7bcd65Smrg<para> 6589e7bcd65SmrgA class can inherit its superclass's geometry manager during class 6599e7bcd65Smrginitialization. 6609e7bcd65Smrg</para> 6619e7bcd65Smrg 6629e7bcd65Smrg<para> 6639e7bcd65SmrgA bit set to zero in the request's <emphasis remap='I'>request_mode</emphasis> 6649e7bcd65Smrgfield means that the child widget 6659e7bcd65Smrgdoes not care about the value of the corresponding field, 6669e7bcd65Smrgso the geometry manager can change this field as it wishes. 6679e7bcd65SmrgA bit set to 1 means that the child wants that geometry element set 6689e7bcd65Smrgto the value in the corresponding field. 6699e7bcd65Smrg</para> 6709e7bcd65Smrg 6719e7bcd65Smrg<para> 6729e7bcd65SmrgIf the geometry manager can satisfy all changes requested 6739e7bcd65Smrgand if 6749e7bcd65Smrg<function>XtCWQueryOnly</function> 6759e7bcd65Smrgis not specified, 6769e7bcd65Smrgit updates the widget's <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, 6779e7bcd65Smrgand <emphasis remap='I'>border_width</emphasis> fields 6789e7bcd65Smrgappropriately. 6799e7bcd65SmrgThen, it returns 6809e7bcd65Smrg<function>XtGeometryYes</function>, 6819e7bcd65Smrgand the values pointed to by the <emphasis remap='I'>geometry_return</emphasis> argument are undefined. 6829e7bcd65SmrgThe widget's window is moved and resized automatically by 6839e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>. 6849e7bcd65Smrg</para> 6859e7bcd65Smrg 6869e7bcd65Smrg<para> 6879e7bcd65SmrgHomogeneous composite widgets often find it convenient to treat the widget 6889e7bcd65Smrgmaking the request the same as any other widget, including reconfiguring 6899e7bcd65Smrgit using 6909e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/> 6919e7bcd65Smrgor 6929e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 6939e7bcd65Smrgas part of its layout process, unless 6949e7bcd65Smrg<function>XtCWQueryOnly</function> 6959e7bcd65Smrgis specified. 6969e7bcd65SmrgIf it does this, 6979e7bcd65Smrgit should return 6989e7bcd65Smrg<function>XtGeometryDone</function> 6999e7bcd65Smrgto inform 7009e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 7019e7bcd65Smrgthat it does not need to do the configuration itself. 7029e7bcd65Smrg</para> 7039e7bcd65Smrg 7049e7bcd65Smrg<note> 7059e7bcd65Smrg<para> 7069e7bcd65SmrgTo remain 7079e7bcd65Smrgcompatible with layout techniques used in older widgets (before 7089e7bcd65Smrg<function>XtGeometryDone</function> 7099e7bcd65Smrgwas added to the Intrinsics), a geometry manager should avoid using 7109e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 7119e7bcd65Smrgor 7129e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/> 7139e7bcd65Smrgon the child making 7149e7bcd65Smrgthe request because the layout process of the child may be in an 7159e7bcd65Smrgintermediate state in which it is not prepared to handle a call to its 7169e7bcd65Smrgresize procedure. A self-contained widget set may choose this 7179e7bcd65Smrgalternative geometry management scheme, however, provided that it 7189e7bcd65Smrgclearly warns widget developers of the compatibility consequences. 7199e7bcd65Smrg</para> 7209e7bcd65Smrg</note> 7219e7bcd65Smrg 7229e7bcd65Smrg<para> 7239e7bcd65SmrgAlthough 7249e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 7259e7bcd65Smrgresizes the widget's window 7269e7bcd65Smrg(if the geometry 7279e7bcd65Smrgmanager returns 7280568f49bSmrg<function>XtGeometryYes</function>), 7299e7bcd65Smrgit does not call the widget class's resize procedure. 7309e7bcd65SmrgThe requesting widget must perform whatever 7319e7bcd65Smrgresizing calculations are needed explicitly. 7329e7bcd65Smrg</para> 7339e7bcd65Smrg 7349e7bcd65Smrg<para> 7359e7bcd65SmrgIf the geometry manager disallows the request, 7369e7bcd65Smrgthe widget cannot change its geometry. 7379e7bcd65SmrgThe values pointed to by <emphasis remap='I'>geometry_return</emphasis> are undefined, 7389e7bcd65Smrgand the geometry manager returns 7399e7bcd65Smrg<function>XtGeometryNo</function>. 7409e7bcd65Smrg</para> 7419e7bcd65Smrg 7429e7bcd65Smrg<para> 7439e7bcd65SmrgSometimes the geometry manager cannot satisfy the request exactly 7449e7bcd65Smrgbut may be able to satisfy a similar request. 7459e7bcd65SmrgThat is, 7469e7bcd65Smrgit could satisfy only a subset of the requests (for example, 7479e7bcd65Smrgsize but not position) or a lesser request 7489e7bcd65Smrg(for example, it cannot make the child as big as the 7499e7bcd65Smrgrequest but it can make the child bigger than its current size). 7509e7bcd65SmrgIn such cases, 7519e7bcd65Smrgthe geometry manager fills in the structure pointed to by 7529e7bcd65Smrg<emphasis remap='I'>geometry_return</emphasis> with the actual changes 7539e7bcd65Smrgit is willing to make, including an appropriate <emphasis remap='I'>request_mode</emphasis> mask, and returns 7549e7bcd65Smrg<function>XtGeometryAlmost</function>. 7559e7bcd65SmrgIf a bit in <emphasis remap='I'>geometry_return->request_mode</emphasis> is zero, 7569e7bcd65Smrgthe geometry manager agrees not to change the corresponding value 7579e7bcd65Smrgif <emphasis remap='I'>geometry_return</emphasis> is used immediately 7589e7bcd65Smrgin a new request. 7599e7bcd65SmrgIf a bit is 1, 7609e7bcd65Smrgthe geometry manager does change that element to the corresponding 7619e7bcd65Smrgvalue in <emphasis remap='I'>geometry_return</emphasis>. 7629e7bcd65SmrgMore bits may be set in <emphasis remap='I'>geometry_return->request_mode</emphasis> 7639e7bcd65Smrgthan in the original request if 7649e7bcd65Smrgthe geometry manager intends to change other fields should the 7659e7bcd65Smrgchild accept the compromise. 7669e7bcd65Smrg</para> 7679e7bcd65Smrg 7689e7bcd65Smrg<para> 7699e7bcd65SmrgWhen 7709e7bcd65Smrg<function>XtGeometryAlmost</function> 7719e7bcd65Smrgis returned, 7729e7bcd65Smrgthe widget must decide if the compromise suggested in <emphasis remap='I'>geometry_return</emphasis> 7739e7bcd65Smrgis acceptable. 7749e7bcd65SmrgIf it is, the widget must not change its geometry directly; 7759e7bcd65Smrgrather, it must make another call to 7769e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/>. 7779e7bcd65Smrg</para> 7789e7bcd65Smrg 7799e7bcd65Smrg<para> 7809e7bcd65SmrgIf the next geometry request from this child uses the 7819e7bcd65Smrg<emphasis remap='I'>geometry_return</emphasis> values filled in by the geometry manager with an 7829e7bcd65Smrg<function>XtGeometryAlmost</function> 7839e7bcd65Smrgreturn and if there have been no intervening geometry requests on 7849e7bcd65Smrgeither its parent or any of its other children, 7859e7bcd65Smrgthe geometry manager must grant the request, if possible. 7869e7bcd65SmrgThat is, if the child asks immediately with the returned geometry, 7879e7bcd65Smrgit should get an answer of 7889e7bcd65Smrg<function>XtGeometryYes</function>. 7899e7bcd65SmrgHowever, 7909e7bcd65Smrgdynamic behavior in 7919e7bcd65Smrgthe user's window manager may affect the final outcome. 7929e7bcd65Smrg</para> 7939e7bcd65Smrg 7949e7bcd65Smrg<para> 7959e7bcd65SmrgTo return 7969e7bcd65Smrg<function>XtGeometryYes</function>, 7979e7bcd65Smrgthe geometry manager frequently rearranges the position of other managed 7989e7bcd65Smrgchildren by calling 7999e7bcd65Smrg<xref linkend='XtMoveWidget' xrefstyle='select: title'/>. 8009e7bcd65SmrgHowever, a few geometry managers may sometimes change the 8019e7bcd65Smrgsize of other managed children by calling 8029e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 8039e7bcd65Smrgor 8049e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>. 8059e7bcd65SmrgIf 8069e7bcd65Smrg<function>XtCWQueryOnly</function> 8079e7bcd65Smrgis specified, 8089e7bcd65Smrgthe geometry manager must return data describing 8099e7bcd65Smrghow it would react to this geometry 8109e7bcd65Smrgrequest without actually moving or resizing any widgets. 8119e7bcd65Smrg</para> 8129e7bcd65Smrg 8139e7bcd65Smrg<para> 8149e7bcd65SmrgGeometry managers must not assume that the <emphasis remap='I'>request</emphasis> 8159e7bcd65Smrgand <emphasis remap='I'>geometry_return</emphasis> arguments point to independent storage. 8169e7bcd65SmrgThe caller is permitted to use the same field for both, 8179e7bcd65Smrgand the geometry manager must allocate its own temporary storage, 8189e7bcd65Smrgif necessary. 8199e7bcd65Smrg</para> 8209e7bcd65Smrg</sect1> 8219e7bcd65Smrg 8229e7bcd65Smrg<sect1 id="Widget_Placement_and_Sizing"> 8239e7bcd65Smrg<title>Widget Placement and Sizing</title> 8249e7bcd65Smrg<para> 8259e7bcd65SmrgTo move a sibling widget of the child making the geometry request, 8269e7bcd65Smrgthe parent uses 8279e7bcd65Smrg<xref linkend='XtMoveWidget' xrefstyle='select: title'/>. 8289e7bcd65Smrg</para> 8299e7bcd65Smrg 8309e7bcd65Smrg<funcsynopsis id='XtMoveWidget'> 8319e7bcd65Smrg<funcprototype> 8329e7bcd65Smrg<funcdef>void <function>XtMoveWidget</function></funcdef> 8339e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 8349e7bcd65Smrg <paramdef>Position <parameter>x</parameter></paramdef> 8359e7bcd65Smrg <paramdef>Position <parameter>y</parameter></paramdef> 8369e7bcd65Smrg</funcprototype> 8379e7bcd65Smrg</funcsynopsis> 8389e7bcd65Smrg 8399e7bcd65Smrg<variablelist> 8409e7bcd65Smrg <varlistentry> 8419e7bcd65Smrg <term> 8429e7bcd65Smrg <emphasis remap='I'>w</emphasis> 8439e7bcd65Smrg </term> 8449e7bcd65Smrg <listitem> 8459e7bcd65Smrg <para> 8469e7bcd65SmrgSpecifies the widget. Must be of class RectObj or any subclass thereof. 8479e7bcd65Smrg </para> 8489e7bcd65Smrg </listitem> 8499e7bcd65Smrg </varlistentry> 8509e7bcd65Smrg <varlistentry> 8519e7bcd65Smrg <term> 8529e7bcd65Smrg <emphasis remap='I'>x</emphasis> 8539e7bcd65Smrg </term> 8549e7bcd65Smrg <listitem> 8559e7bcd65Smrg <para></para> 8569e7bcd65Smrg </listitem> 8579e7bcd65Smrg </varlistentry> 8589e7bcd65Smrg <varlistentry> 8599e7bcd65Smrg <term> 8609e7bcd65Smrg <emphasis remap='I'>y</emphasis> 8619e7bcd65Smrg </term> 8629e7bcd65Smrg <listitem> 8639e7bcd65Smrg <para> 8649e7bcd65SmrgSpecify the new widget x and y coordinates. 8659e7bcd65Smrg </para> 8669e7bcd65Smrg </listitem> 8679e7bcd65Smrg </varlistentry> 8689e7bcd65Smrg</variablelist> 8699e7bcd65Smrg 8709e7bcd65Smrg<para> 8719e7bcd65SmrgThe 8729e7bcd65Smrg<xref linkend='XtMoveWidget' xrefstyle='select: title'/> 8739e7bcd65Smrgfunction returns immediately if the specified geometry fields 8749e7bcd65Smrgare the same as the old values. 8759e7bcd65SmrgOtherwise, 8769e7bcd65Smrg<xref linkend='XtMoveWidget' xrefstyle='select: title'/> 8779e7bcd65Smrgwrites the new <emphasis remap='I'>x</emphasis> and <emphasis remap='I'>y</emphasis> values into the object 8789e7bcd65Smrgand, if the object is a widget and is realized, issues an Xlib 8799e7bcd65Smrg<function>XMoveWindow</function> 8809e7bcd65Smrgcall on the widget's window. 8819e7bcd65Smrg</para> 8829e7bcd65Smrg 8839e7bcd65Smrg<para> 8849e7bcd65SmrgTo resize a sibling widget of the child making the geometry request, 8859e7bcd65Smrgthe parent uses 8869e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/>. 8879e7bcd65Smrg</para> 8889e7bcd65Smrg 8899e7bcd65Smrg<funcsynopsis id='XtResizeWidget'> 8909e7bcd65Smrg<funcprototype> 8919e7bcd65Smrg<funcdef>void <function>XtResizeWidget</function></funcdef> 8929e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 8939e7bcd65Smrg <paramdef>Dimension <parameter>width</parameter></paramdef> 8949e7bcd65Smrg <paramdef>Dimension <parameter>height</parameter></paramdef> 8959e7bcd65Smrg <paramdef>Dimension <parameter>border_width</parameter></paramdef> 8969e7bcd65Smrg</funcprototype> 8979e7bcd65Smrg</funcsynopsis> 8989e7bcd65Smrg 8999e7bcd65Smrg<variablelist> 9009e7bcd65Smrg <varlistentry> 9019e7bcd65Smrg <term> 9029e7bcd65Smrg <emphasis remap='I'>w</emphasis> 9039e7bcd65Smrg </term> 9049e7bcd65Smrg <listitem> 9059e7bcd65Smrg <para> 9069e7bcd65SmrgSpecifies the widget. Must be of class RectObj or any subclass thereof. 9079e7bcd65Smrg </para> 9089e7bcd65Smrg </listitem> 9099e7bcd65Smrg </varlistentry> 9109e7bcd65Smrg <varlistentry> 9119e7bcd65Smrg <term> 9129e7bcd65Smrg <emphasis remap='I'>width</emphasis> 9139e7bcd65Smrg </term> 9149e7bcd65Smrg <listitem> 9159e7bcd65Smrg <para></para> 9169e7bcd65Smrg </listitem> 9179e7bcd65Smrg </varlistentry> 9189e7bcd65Smrg <varlistentry> 9199e7bcd65Smrg <term> 9209e7bcd65Smrg <emphasis remap='I'>height</emphasis> 9219e7bcd65Smrg </term> 9229e7bcd65Smrg <listitem> 9239e7bcd65Smrg <para></para> 9249e7bcd65Smrg </listitem> 9259e7bcd65Smrg </varlistentry> 9269e7bcd65Smrg <varlistentry> 9279e7bcd65Smrg <term> 9289e7bcd65Smrg <emphasis remap='I'>border_width</emphasis> 9299e7bcd65Smrg </term> 9309e7bcd65Smrg <listitem> 9319e7bcd65Smrg <para> 9329e7bcd65SmrgSpecify the new widget size. 9339e7bcd65Smrg </para> 9349e7bcd65Smrg </listitem> 9359e7bcd65Smrg </varlistentry> 9369e7bcd65Smrg</variablelist> 9379e7bcd65Smrg 9389e7bcd65Smrg<para> 9399e7bcd65SmrgThe 9409e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 9419e7bcd65Smrgfunction returns immediately if the specified geometry fields 9429e7bcd65Smrgare the same as the old values. 9439e7bcd65SmrgOtherwise, 9449e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 9459e7bcd65Smrgwrites the new <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, and <emphasis remap='I'>border_width</emphasis> values into 9469e7bcd65Smrgthe object and, if the object is a widget and is realized, issues an 9479e7bcd65Smrg<function>XConfigureWindow</function> 9489e7bcd65Smrgcall on the widget's window. 9499e7bcd65Smrg</para> 9509e7bcd65Smrg 9519e7bcd65Smrg<para> 9529e7bcd65SmrgIf the new width or height is different from the old values, 9539e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/> 9549e7bcd65Smrgcalls the object's resize procedure to notify it of the size change. 9559e7bcd65Smrg</para> 9569e7bcd65Smrg 9579e7bcd65Smrg<para> 9589e7bcd65SmrgTo move and resize the sibling widget of the child making the geometry request, 9599e7bcd65Smrgthe parent uses 9609e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/>. 9619e7bcd65Smrg</para> 9629e7bcd65Smrg 9639e7bcd65Smrg<funcsynopsis id='XtConfigureWidget'> 9649e7bcd65Smrg<funcprototype> 9659e7bcd65Smrg<funcdef>void <function>XtConfigureWidget</function></funcdef> 9669e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 9679e7bcd65Smrg <paramdef>Position <parameter>x</parameter></paramdef> 9689e7bcd65Smrg <paramdef>Position <parameter>y</parameter></paramdef> 9699e7bcd65Smrg <paramdef>Dimension <parameter>width</parameter></paramdef> 9709e7bcd65Smrg <paramdef>Dimension <parameter>height</parameter></paramdef> 9719e7bcd65Smrg <paramdef>Dimension <parameter>border_width</parameter></paramdef> 9729e7bcd65Smrg</funcprototype> 9739e7bcd65Smrg</funcsynopsis> 9749e7bcd65Smrg 9759e7bcd65Smrg<variablelist> 9769e7bcd65Smrg <varlistentry> 9779e7bcd65Smrg <term> 9789e7bcd65Smrg <emphasis remap='I'>w</emphasis> 9799e7bcd65Smrg </term> 9809e7bcd65Smrg <listitem> 9819e7bcd65Smrg <para> 9829e7bcd65SmrgSpecifies the widget. Must be of class RectObj or any subclass thereof. 9839e7bcd65Smrg </para> 9849e7bcd65Smrg </listitem> 9859e7bcd65Smrg </varlistentry> 9869e7bcd65Smrg <varlistentry> 9879e7bcd65Smrg <term> 9889e7bcd65Smrg <emphasis remap='I'>x</emphasis> 9899e7bcd65Smrg </term> 9909e7bcd65Smrg <listitem> 9919e7bcd65Smrg <para></para> 9929e7bcd65Smrg </listitem> 9939e7bcd65Smrg </varlistentry> 9949e7bcd65Smrg <varlistentry> 9959e7bcd65Smrg <term> 9969e7bcd65Smrg <emphasis remap='I'>y</emphasis> 9979e7bcd65Smrg </term> 9989e7bcd65Smrg <listitem> 9999e7bcd65Smrg <para> 10009e7bcd65SmrgSpecify the new widget x and y coordinates. 10019e7bcd65Smrg </para> 10029e7bcd65Smrg </listitem> 10039e7bcd65Smrg </varlistentry> 10049e7bcd65Smrg <varlistentry> 10059e7bcd65Smrg <term> 10069e7bcd65Smrg <emphasis remap='I'>width</emphasis> 10079e7bcd65Smrg </term> 10089e7bcd65Smrg <listitem> 10099e7bcd65Smrg <para></para> 10109e7bcd65Smrg </listitem> 10119e7bcd65Smrg </varlistentry> 10129e7bcd65Smrg <varlistentry> 10139e7bcd65Smrg <term> 10149e7bcd65Smrg <emphasis remap='I'>height</emphasis> 10159e7bcd65Smrg </term> 10169e7bcd65Smrg <listitem> 10179e7bcd65Smrg <para></para> 10189e7bcd65Smrg </listitem> 10199e7bcd65Smrg </varlistentry> 10209e7bcd65Smrg <varlistentry> 10219e7bcd65Smrg <term> 10229e7bcd65Smrg <emphasis remap='I'>border_width</emphasis> 10239e7bcd65Smrg </term> 10249e7bcd65Smrg <listitem> 10259e7bcd65Smrg <para> 10269e7bcd65SmrgSpecify the new widget size. 10279e7bcd65Smrg </para> 10289e7bcd65Smrg </listitem> 10299e7bcd65Smrg </varlistentry> 10309e7bcd65Smrg</variablelist> 10319e7bcd65Smrg 10329e7bcd65Smrg<para> 10339e7bcd65SmrgThe 10349e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/> 10359e7bcd65Smrgfunction returns immediately if the specified new geometry fields 10369e7bcd65Smrgare all equal to the current values. 10379e7bcd65SmrgOtherwise, 10389e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/> 10399e7bcd65Smrgwrites the new <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, 10409e7bcd65Smrgand <emphasis remap='I'>border_width</emphasis> values 10419e7bcd65Smrginto the object and, if the object is a widget and is realized, makes an Xlib 10429e7bcd65Smrg<function>XConfigureWindow</function> 10439e7bcd65Smrgcall on the widget's window. 10449e7bcd65Smrg</para> 10459e7bcd65Smrg 10469e7bcd65Smrg<para> 10479e7bcd65SmrgIf the new width or height is different from its old value, 10489e7bcd65Smrg<xref linkend='XtConfigureWidget' xrefstyle='select: title'/> 10499e7bcd65Smrgcalls the object's resize procedure to notify it of the size change; 10509e7bcd65Smrgotherwise, it simply returns. 10519e7bcd65Smrg</para> 10529e7bcd65Smrg 10539e7bcd65Smrg<para> 10549e7bcd65SmrgTo resize a child widget that already has the new values of its width, 10559e7bcd65Smrgheight, and border width, the parent uses 10569e7bcd65Smrg<xref linkend='XtResizeWindow' xrefstyle='select: title'/>. 10579e7bcd65Smrg</para> 10589e7bcd65Smrg 10599e7bcd65Smrg<funcsynopsis id='XtResizeWindow'> 10609e7bcd65Smrg<funcprototype> 10619e7bcd65Smrg<funcdef>void <function>XtResizeWindow</function></funcdef> 10629e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 10639e7bcd65Smrg</funcprototype> 10649e7bcd65Smrg</funcsynopsis> 10659e7bcd65Smrg 10669e7bcd65Smrg<variablelist> 10679e7bcd65Smrg <varlistentry> 10689e7bcd65Smrg <term> 10699e7bcd65Smrg <emphasis remap='I'>w</emphasis> 10709e7bcd65Smrg </term> 10719e7bcd65Smrg <listitem> 10729e7bcd65Smrg <para> 10739e7bcd65SmrgSpecifies the widget. Must be of class Core or any subclass thereof. 10749e7bcd65Smrg </para> 10759e7bcd65Smrg </listitem> 10769e7bcd65Smrg </varlistentry> 10779e7bcd65Smrg</variablelist> 10789e7bcd65Smrg 10799e7bcd65Smrg<para> 10809e7bcd65SmrgThe 10819e7bcd65Smrg<xref linkend='XtResizeWindow' xrefstyle='select: title'/> 10829e7bcd65Smrgfunction calls the 10839e7bcd65Smrg<function>XConfigureWindow</function> 10849e7bcd65SmrgXlib function to make the window of the specified widget match its width, 10859e7bcd65Smrgheight, and border width. 10869e7bcd65SmrgThis request is done unconditionally because there is no 10879e7bcd65Smrginexpensive way to tell if these 10889e7bcd65Smrgvalues match the current values. 10899e7bcd65SmrgNote that the widget's resize procedure is not called. 10909e7bcd65Smrg</para> 10919e7bcd65Smrg 10929e7bcd65Smrg<para> 10939e7bcd65SmrgThere are very few times to use 10949e7bcd65Smrg<xref linkend='XtResizeWindow' xrefstyle='select: title'/>; 10959e7bcd65Smrginstead, the parent should use 10969e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/>. 10979e7bcd65Smrg</para> 10989e7bcd65Smrg</sect1> 10999e7bcd65Smrg 11009e7bcd65Smrg<sect1 id="Preferred_Geometry"> 11019e7bcd65Smrg<title>Preferred Geometry</title> 11029e7bcd65Smrg<para> 11039e7bcd65SmrgSome parents may be willing to adjust their layouts to accommodate the 11049e7bcd65Smrgpreferred geometries of their children. 11059e7bcd65SmrgThey can use 11069e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 11079e7bcd65Smrgto obtain the preferred geometry 11089e7bcd65Smrgand, as they see fit, can use or ignore any portion of the response. 11099e7bcd65Smrg</para> 11109e7bcd65Smrg 11119e7bcd65Smrg<para> 11129e7bcd65SmrgTo query a child widget's preferred geometry, use 11139e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>. 11149e7bcd65Smrg</para> 11159e7bcd65Smrg 11169e7bcd65Smrg<funcsynopsis id='XtQueryGeometry'> 11179e7bcd65Smrg<funcprototype> 11189e7bcd65Smrg<funcdef>XtGeometryResult <function>XtQueryGeometry</function></funcdef> 11199e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 11209e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>intended</parameter></paramdef> 11219e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>preferred_return</parameter></paramdef> 11229e7bcd65Smrg</funcprototype> 11239e7bcd65Smrg</funcsynopsis> 11249e7bcd65Smrg 11259e7bcd65Smrg<variablelist> 11269e7bcd65Smrg <varlistentry> 11279e7bcd65Smrg <term> 11289e7bcd65Smrg <emphasis remap='I'>w</emphasis> 11299e7bcd65Smrg </term> 11309e7bcd65Smrg <listitem> 11319e7bcd65Smrg <para> 11329e7bcd65SmrgSpecifies the widget. Must be of class RectObj or any subclass thereof. 11339e7bcd65Smrg </para> 11349e7bcd65Smrg </listitem> 11359e7bcd65Smrg </varlistentry> 11369e7bcd65Smrg <varlistentry> 11379e7bcd65Smrg <term> 11389e7bcd65Smrg <emphasis remap='I'>intended</emphasis> 11399e7bcd65Smrg </term> 11409e7bcd65Smrg <listitem> 11419e7bcd65Smrg <para> 11429e7bcd65SmrgSpecifies the new geometry the parent plans to give to the child, or 11439e7bcd65SmrgNULL. 11449e7bcd65Smrg </para> 11459e7bcd65Smrg </listitem> 11469e7bcd65Smrg </varlistentry> 11479e7bcd65Smrg <varlistentry> 11489e7bcd65Smrg <term> 11499e7bcd65Smrg <emphasis remap='I'>preferred_return</emphasis> 11509e7bcd65Smrg </term> 11519e7bcd65Smrg <listitem> 11529e7bcd65Smrg <para> 11539e7bcd65SmrgReturns the child widget's preferred geometry. 11549e7bcd65Smrg </para> 11559e7bcd65Smrg </listitem> 11569e7bcd65Smrg </varlistentry> 11579e7bcd65Smrg</variablelist> 11589e7bcd65Smrg 11599e7bcd65Smrg<para> 11609e7bcd65SmrgTo discover a child's preferred geometry, 11619e7bcd65Smrgthe child's parent stores the new 11629e7bcd65Smrggeometry in the corresponding fields of 11639e7bcd65Smrgthe intended structure, sets the corresponding bits in <emphasis remap='I'>intended.request_mode</emphasis>, 11649e7bcd65Smrgand calls 11659e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>. 11669e7bcd65SmrgThe parent should set only those fields that are important to it so 11679e7bcd65Smrgthat the child can determine whether it may be able to attempt changes to 11689e7bcd65Smrgother fields. 11699e7bcd65Smrg</para> 11709e7bcd65Smrg 11719e7bcd65Smrg<para> 11729e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 11739e7bcd65Smrgclears all bits in the <emphasis remap='I'>preferred_return->request_mode</emphasis> 11749e7bcd65Smrgfield and checks the 11759e7bcd65Smrg<emphasis remap='I'>query_geometry</emphasis> field of the specified widget's class record. 11769e7bcd65SmrgIf <emphasis remap='I'>query_geometry</emphasis> is not NULL, 11779e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 11789e7bcd65Smrgcalls the query_geometry procedure and passes as arguments the 11799e7bcd65Smrgspecified widget, <emphasis remap='I'>intended</emphasis>, and <emphasis remap='I'>preferred_return</emphasis> structures. 11809e7bcd65SmrgIf the <emphasis remap='I'>intended</emphasis> argument is NULL, 11819e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 11829e7bcd65Smrgreplaces it with a pointer to an 11839e7bcd65Smrg<function>XtWidgetGeometry</function> 11849e7bcd65Smrgstructure with <emphasis remap='I'>request_mode</emphasis> equal to zero before calling the 11859e7bcd65Smrgquery_geometry procedure. 11869e7bcd65Smrg</para> 11879e7bcd65Smrg 11889e7bcd65Smrg<note> 11899e7bcd65Smrg<para> 11909e7bcd65SmrgIf 11919e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 11929e7bcd65Smrgis called from within a geometry_manager 11939e7bcd65Smrgprocedure for the widget that issued 11949e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 11959e7bcd65Smrgor 11969e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/>, 11979e7bcd65Smrgthe results 11989e7bcd65Smrgare not guaranteed to be consistent with the requested changes. The 11999e7bcd65Smrgchange request passed to the geometry manager takes precedence over 12009e7bcd65Smrgthe preferred geometry. 12019e7bcd65Smrg</para> 12029e7bcd65Smrg</note> 12039e7bcd65Smrg 12049e7bcd65Smrg<para> 12059e7bcd65SmrgThe query_geometry procedure pointer is of type 12069e7bcd65Smrg<xref linkend='XtGeometryHandler' xrefstyle='select: title'/>. 12079e7bcd65Smrg</para> 12089e7bcd65Smrg 12099e7bcd65Smrg<funcsynopsis id='_XtGeometryHandler'> 12109e7bcd65Smrg<funcprototype> 12119e7bcd65Smrg<funcdef>typedef XtGeometryResult <function>(*XtGeometryHandler)</function></funcdef> 12129e7bcd65Smrg <paramdef>Widget <parameter>w</parameter></paramdef> 12139e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>request</parameter></paramdef> 12149e7bcd65Smrg <paramdef>XtWidgetGeometry *<parameter>preferred_return</parameter></paramdef> 12159e7bcd65Smrg</funcprototype> 12169e7bcd65Smrg</funcsynopsis> 12179e7bcd65Smrg 12189e7bcd65Smrg<variablelist> 12199e7bcd65Smrg <varlistentry> 12209e7bcd65Smrg <term> 12219e7bcd65Smrg <emphasis remap='I'>w</emphasis> 12229e7bcd65Smrg </term> 12239e7bcd65Smrg <listitem> 12249e7bcd65Smrg <para> 12259e7bcd65SmrgPasses the child widget whose preferred geometry is required. 12269e7bcd65Smrg </para> 12279e7bcd65Smrg </listitem> 12289e7bcd65Smrg </varlistentry> 12299e7bcd65Smrg <varlistentry> 12309e7bcd65Smrg <term> 12319e7bcd65Smrg <emphasis remap='I'>request</emphasis> 12329e7bcd65Smrg </term> 12339e7bcd65Smrg <listitem> 12349e7bcd65Smrg <para> 12359e7bcd65SmrgPasses the geometry changes that the parent plans to make. 12369e7bcd65Smrg </para> 12379e7bcd65Smrg </listitem> 12389e7bcd65Smrg </varlistentry> 12399e7bcd65Smrg <varlistentry> 12409e7bcd65Smrg <term> 12419e7bcd65Smrg <emphasis remap='I'>preferred_return</emphasis> 12429e7bcd65Smrg </term> 12439e7bcd65Smrg <listitem> 12449e7bcd65Smrg <para> 12459e7bcd65SmrgPasses a structure in which the child returns its preferred geometry. 12469e7bcd65Smrg </para> 12479e7bcd65Smrg </listitem> 12489e7bcd65Smrg </varlistentry> 12499e7bcd65Smrg</variablelist> 12509e7bcd65Smrg 12519e7bcd65Smrg<para> 12529e7bcd65SmrgThe query_geometry procedure is expected to examine the bits set in 12539e7bcd65Smrg<emphasis remap='I'>request->request_mode</emphasis>, evaluate the preferred geometry of the widget, 12549e7bcd65Smrgand store the result in <emphasis remap='I'>preferred_return</emphasis> 12559e7bcd65Smrg(setting the bits in <emphasis remap='I'>preferred_return->request_mode</emphasis> corresponding 12569e7bcd65Smrgto those geometry fields that it cares about). 12579e7bcd65SmrgIf the proposed geometry change is acceptable without modification, 12589e7bcd65Smrgthe query_geometry procedure should return 12599e7bcd65Smrg<function>XtGeometryYes</function>. 12609e7bcd65SmrgIf at least one field in <emphasis remap='I'>preferred_return</emphasis> 12619e7bcd65Smrgwith a bit set in <emphasis remap='I'>preferred_return->request_mode</emphasis> 12629e7bcd65Smrgis different 12639e7bcd65Smrgfrom the corresponding field in <emphasis remap='I'>request</emphasis> 12649e7bcd65Smrgor if a bit was set in <emphasis remap='I'>preferred_return->request_mode</emphasis> 12659e7bcd65Smrgthat was not set in the request, 12669e7bcd65Smrgthe query_geometry procedure should return 12679e7bcd65Smrg<function>XtGeometryAlmost</function>. 12689e7bcd65SmrgIf the preferred geometry is identical to the current geometry, 12699e7bcd65Smrgthe query_geometry procedure should return 12709e7bcd65Smrg<function>XtGeometryNo</function>. 12719e7bcd65Smrg</para> 12729e7bcd65Smrg 12739e7bcd65Smrg<note><para> 12749e7bcd65SmrgThe query_geometry procedure may assume 12759e7bcd65Smrgthat no 12769e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/> 12779e7bcd65Smrgor 12789e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 12799e7bcd65Smrgis in progress 12809e7bcd65Smrgfor the specified widget; that is, it is not required to construct 12819e7bcd65Smrga reply consistent with the requested geometry if such a request 12829e7bcd65Smrgwere actually outstanding. 12839e7bcd65Smrg</para></note> 12849e7bcd65Smrg 12859e7bcd65Smrg<para> 12869e7bcd65SmrgAfter calling the query_geometry procedure 12879e7bcd65Smrgor if the <emphasis remap='I'>query_geometry</emphasis> field is NULL, 12889e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 12899e7bcd65Smrgexamines all the unset bits in <emphasis remap='I'>preferred_return->request_mode</emphasis> 12909e7bcd65Smrgand sets the corresponding fields in <emphasis remap='I'>preferred_return</emphasis> 12919e7bcd65Smrgto the current values from the widget instance. 12929e7bcd65SmrgIf 12939e7bcd65Smrg<function>CWStackMode</function> 12949e7bcd65Smrgis not set, 12959e7bcd65Smrgthe <emphasis remap='I'>stack_mode</emphasis> field is set to 12969e7bcd65Smrg<function>XtSMDontChange</function>. 12979e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 12989e7bcd65Smrgreturns the value returned by the query_geometry procedure or 12999e7bcd65Smrg<function>XtGeometryYes</function> 13009e7bcd65Smrgif the <emphasis remap='I'>query_geometry</emphasis> field is NULL. 13019e7bcd65Smrg</para> 13029e7bcd65Smrg 13039e7bcd65Smrg<para> 13049e7bcd65SmrgTherefore, the caller can interpret a return of 13059e7bcd65Smrg<function>XtGeometryYes</function> 13069e7bcd65Smrgas not needing to evaluate the contents of the reply and, more important, 13079e7bcd65Smrgnot needing to modify its layout plans. 13089e7bcd65SmrgA return of 13099e7bcd65Smrg<function>XtGeometryAlmost</function> 13109e7bcd65Smrgmeans either that both the parent and the child expressed interest 13119e7bcd65Smrgin at least one common field and the child's preference does not match 13129e7bcd65Smrgthe parent's intentions or that the child expressed interest in a field that 13139e7bcd65Smrgthe parent might need to consider. 13149e7bcd65SmrgA return value of 13159e7bcd65Smrg<function>XtGeometryNo</function> 13169e7bcd65Smrgmeans that both the parent and the child expressed interest in a field and 13179e7bcd65Smrgthat the child suggests that the field's current value in the widget instance 13189e7bcd65Smrgis its preferred value. 13199e7bcd65SmrgIn addition, whether or not the caller ignores the return value or the 13209e7bcd65Smrgreply mask, it is guaranteed that the <emphasis remap='I'>preferred_return</emphasis> structure contains complete 13219e7bcd65Smrggeometry information for the child. 13229e7bcd65Smrg</para> 13239e7bcd65Smrg 13249e7bcd65Smrg<para> 13259e7bcd65SmrgParents are expected to call 13269e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/> 13279e7bcd65Smrgin their layout routine and wherever else the information is significant 13289e7bcd65Smrgafter change_managed has been called. 13299e7bcd65SmrgThe first time it is invoked, 13309e7bcd65Smrgthe changed_managed procedure may assume that the child's current geometry 13319e7bcd65Smrgis its preferred geometry. 13329e7bcd65SmrgThus, the child is still responsible for storing values 13339e7bcd65Smrginto its own geometry during its initialize procedure. 13349e7bcd65Smrg</para> 13359e7bcd65Smrg</sect1> 13369e7bcd65Smrg 13379e7bcd65Smrg<sect1 id="Size_Change_Management_The_resize_Procedure"> 13389e7bcd65Smrg<title>Size Change Management: The resize Procedure</title> 13399e7bcd65Smrg<para> 13409e7bcd65SmrgA child can be resized by its parent at any time. 13419e7bcd65SmrgWidgets usually need to know when they have changed size 13429e7bcd65Smrgso that they can lay out their displayed data again to match the new size. 13439e7bcd65SmrgWhen a parent resizes a child, it calls 13449e7bcd65Smrg<xref linkend='XtResizeWidget' xrefstyle='select: title'/>, 13459e7bcd65Smrgwhich updates the geometry fields in the widget, 13469e7bcd65Smrgconfigures the window if the widget is realized, 13479e7bcd65Smrgand calls the child's resize procedure to notify the child. 13489e7bcd65SmrgThe resize procedure pointer is of type 13499e7bcd65Smrg<xref linkend='XtWidgetProc' xrefstyle='select: title'/>. 13509e7bcd65Smrg</para> 13519e7bcd65Smrg 13529e7bcd65Smrg<para> 13539e7bcd65SmrgIf a class need not recalculate anything when a widget is resized, 13549e7bcd65Smrgit can specify NULL for the <emphasis remap='I'>resize</emphasis> field in its class record. 13559e7bcd65SmrgThis is an unusual case and should occur only for widgets 13569e7bcd65Smrgwith very trivial display semantics. 13579e7bcd65SmrgThe resize procedure takes a widget as its only argument. 13589e7bcd65SmrgThe <emphasis remap='I'>x</emphasis>, <emphasis remap='I'>y</emphasis>, <emphasis remap='I'>width</emphasis>, <emphasis remap='I'>height</emphasis>, 13599e7bcd65Smrgand <emphasis remap='I'>border_width</emphasis> fields of the widget contain the new values. 13609e7bcd65SmrgThe resize procedure should recalculate the layout of internal data 13619e7bcd65Smrgas needed. 13629e7bcd65Smrg(For example, a centered Label in a window that changes size 13639e7bcd65Smrgshould recalculate the starting position of the text.) 13649e7bcd65SmrgThe widget must obey resize as a command and must not treat it as a request. 13659e7bcd65SmrgA widget must not issue an 13669e7bcd65Smrg<xref linkend='XtMakeGeometryRequest' xrefstyle='select: title'/> 13679e7bcd65Smrgor 13689e7bcd65Smrg<xref linkend='XtMakeResizeRequest' xrefstyle='select: title'/> 13699e7bcd65Smrgcall from its resize procedure. 13709e7bcd65Smrg</para> 13719e7bcd65Smrg</sect1> 13729e7bcd65Smrg</chapter> 1373