2.9. General Geometry Manager Requests   

When making a geometry request, the child specifies an XtWidgetGeometry structure.

typedef unsigned long XtGeometryMask;
typedef struct {
XtGeometryMask request_mode;
Position x, y;
Dimension width, height;
Dimension border_width;
Widget sibling;
int stack_mode;
} XtWidgetGeometry;
To make a general geometry manager request from a widget, use XtMakeGeometryRequest.

XtGeometryResult XtMakeGeometryRequest(w, request, reply_return)
Widget w;
XtWidgetGeometry *request;
XtWidgetGeometry *reply_return;
w Specifies the widget making the request. Must be of class RectObj or any subclass thereof.
request Specifies the desired widget geometry (size, position, border width, and stacking order).
reply_return Returns the allowed widget size, or may be NULL
if the requesting widget is not interested in handling XtGeometryAlmost.
Depending on the condition, XtMakeGeometryRequest performs the following:

If the widget is unmanaged or the widget's parent is not realized, it makes the changes and returns XtGeometryYes.

If the parent's class is not a subclass of compositeWidgetClass or the parent's geometry_manager field is NULL, it issues an error.

If the widget's being_destroyed field is True, it returns XtGeometryNo.

If the widget x, y, width, height and, border_width fields are all equal to the requested values, it returns XtGeometryYes; otherwise, it calls the parent's geometry_manager procedure with the given parameters.

If the parent's geometry manager returns XtGeometryYes and if XtCWQueryOnly is not set in request->request_mode and if the widget is realized, XtMakeGeometryRequest calls the XConfigureWindow Xlib function to reconfigure the widget's window (set its size, location, and stacking order as appropriate).

If the geometry manager returns XtGeometryDone, the change has been approved and actually has been done. In this case, XtMakeGeometryRequest does no configuring and returns XtGeometryYes. XtMakeGeometryRequest never returns XtGeometryDone.

Otherwise, XtMakeGeometryRequest just returns the resulting value from the parent's geometry manager.

Children of primitive widgets are always unmanaged; therefore, XtMakeGeometryRequest always returns XtGeometryYes when called by a child of a primitive widget.

The return codes from geometry managers are

    typedef enum _XtGeometryResult {

} XtGeometryResult;
The request_mode definitions are from < X11/X.h >.

#define CWX (1<<0)
#define CWY (1<<1)
#define CWWidth (1<<2)
#define CWHeight (1<<3)
#define CWBorderWidth (1<<4)
#define CWSibling (1<<5)
#define CWStackMode (1<<6)

The Intrinsics also support the following value.

#define XtCWQueryOnly (1<<7)

XtCWQueryOnly indicates that the corresponding geometry request is only a query as to what would happen if this geometry request were made and that no widgets should actually be changed.

XtMakeGeometryRequest, like the XConfigureWindow Xlib function, uses request_mode to determine which fields in the XtWidgetGeometry structure the caller wants to specify.

The stack_mode definitions are from < X11/X.h >:

#define Above 0
#define Below 1
#define TopIf 2
#define BottomIf 3
#define Opposite 4

The Intrinsics also support the following value.

#define XtSMDontChange 5

For definition and behavior of Above, Below, TopIf, BottomIf, and Opposite. XtSMDontChange indicates that the widget wants its current stacking order preserved.