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