XParseGeometry

Syntax

int XParseGeometry(parsestring, x_return, y_return, width_return, height_return)
      char *parsestring;
      int *x_return, *y_return; 
      unsigned int *width_return, *height_return;

Arguments

parsestring Specifies the string you want to parse.
x_return
y_return
Return the x and y offsets.
width_return
height_return
Return the width and height determined.

Description

By convention, X applications use a standard string to indicate window size and placement. XParseGeometry() makes it easier to conform to this standard because it allows you to parse the standard window geometry. Specifically, this function lets you parse strings of the form:

[=][<width>{xX}<height>][{+-}<xoffset>{+-}<yoffset>]

The fields map into the arguments associated with this function. (Items enclosed in <> are integers, items in [] are optional, and items enclosed in {} indicate ``choose one of.'' Note that the brackets should not appear in the actual string.) If the string is not in the Host Portable Character Encoding, the result is implementation dependent.

The XParseGeometry() function returns a bitmask that indicates which of the four values (width, height, xoffset, and yoffset) were actually found in the string and whether the x and y values are negative. By convention, -0 is not equal to +0, because the user needs to be able to say ``position the window relative to the right or bottom edge.'' For each value found, the corresponding argument is updated. For each value not found, the argument is left unchanged. The bits are represented by XValue, YValue, WidthValue, HeightValue, XNegative, or YNegative and are defined in X11/Xutil.h. They will be set whenever one of the values is defined or one of the signs is set.

If the function returns either the XValue or YValue flag, you should place the window at the requested position.

See also

XWMGeometry(), XSetWMProperties(), "Parsing the Window Geometry".
Christophe Tronche, ch@tronche.com