XParseGeometry()XParseGeometry()NameXParseGeometry – generate position and size from standard window geome‐
try string.
Synopsis
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 coordinates (offsets) from the string.
width_returnReturn the width and height in pixels from the string.
height_return
Returns
A bit mask composed of the OR of the symbols XValue, YValue, Width‐
Value, HeightValue, XNegative, and/or YNegative.
Description
By convention, X applications provide a geometry command-line option to
indicate window size and placement. XParseGeometry() makes it easy to
conform to this standard because it allows you to parse the standard
window geometry string. Specifically, this function lets you parse
strings of the form:
=<width_return>x<height_return>{+-}<xoffset>{+-}<yoffset>
The items in this string map into the arguments associated with this
function. (Items enclosed in <> are integers and items enclosed in {}
are a set from which one item is allowed. 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-depen‐
dent.
XParseGeometry() returns a bitmask that indicates which of the four
values (width_return, height_return, xoffset, and yoffset) were actu‐
ally found in the string, and whether the x and y values are negative.
The bits are represented by these constants: XValue, YValue, Width‐
Value, HeightValue, XNegative, and YNegative, and are defined in
<X11/Xutil.h>. For each value found, the corresponding argument is
updated and the corresponding bitmask element set; for each value not
found, the argument is left unchanged, and the bitmask element is not
set.
For more information, see Volume One, Chapter 13, Managing User Prefer‐
ences.
See Also
XGeometry, XTranslateCoordinates(), XWMGeometry.
Xlib - Standard Geometry XParseGeometry()