1XParseGeometry(3) XLIB FUNCTIONS XParseGeometry(3)
2
3
4
6 XParseGeometry, XWMGeometry - parse window geometry
7
9 int XParseGeometry(char *parsestring, int *x_return, int *y_return,
10 unsigned int *width_return, unsigned int *height_return);
11
12 int XWMGeometry(Display *display, int screen, char *user_geom, char
13 *def_geom, unsigned int bwidth, XSizeHints *hints, int
14 *x_return, int *y_return, int *width_return, int *height_return,
15 int *gravity_return);
16
18 position
19 default_position
20 Specify the geometry specifications.
21
22 display Specifies the connection to the X server.
23
24 fheight
25 fwidth Specify the font height and width in pixels (increment size).
26
27 parsestring
28 Specifies the string you want to parse.
29
30 screen Specifies the screen.
31
32 width_return
33 height_return
34 Return the width and height determined.
35
36 xadder
37 yadder Specify additional interior padding needed in the window.
38
39 x_return
40 y_return Return the x and y offsets.
41
42 bwidth Specifies the border width.
43
44 hints Specifies the size hints for the window in its normal state.
45
46 def_geom Specifies the application's default geometry or NULL.
47
48 gravity_return
49 Returns the window gravity.
50
51 user_geom Specifies the user-specified geometry or NULL.
52
54 By convention, X applications use a standard string to indicate window
55 size and placement. XParseGeometry makes it easier to conform to this
56 standard because it allows you to parse the standard window geometry.
57 Specifically, this function lets you parse strings of the form:
58
59 [=][<width>{xX}<height>][{+-}<xoffset>{+-}<yoffset>]
60
61 The fields map into the arguments associated with this function.
62 (Items enclosed in <> are integers, items in [] are optional, and items
63 enclosed in {} indicate ``choose one of.'' Note that the brackets
64 should not appear in the actual string.) If the string is not in the
65 Host Portable Character Encoding, the result is implementation-depen‐
66 dent.
67
68 The XParseGeometry function returns a bitmask that indicates which of
69 the four values (width, height, xoffset, and yoffset) were actually
70 found in the string and whether the x and y values are negative. By
71 convention, -0 is not equal to +0, because the user needs to be able to
72 say ``position the window relative to the right or bottom edge.'' For
73 each value found, the corresponding argument is updated. For each
74 value not found, the argument is left unchanged. The bits are repre‐
75 sented by XValue, YValue, WidthValue, HeightValue, XNegative, or YNega‐
76 tive and are defined in <X11/Xutil.h>. They will be set whenever one
77 of the values is defined or one of the signs is set.
78
79 If the function returns either the XValue or YValue flag, you should
80 place the window at the requested position.
81
82 The XWMGeometry function combines any geometry information (given in
83 the format used by XParseGeometry) specified by the user and by the
84 calling program with size hints (usually the ones to be stored in
85 WM_NORMAL_HINTS) and returns the position, size, and gravity (North‐
86 WestGravity, NorthEastGravity, SouthEastGravity, or SouthWestGravity)
87 that describe the window. If the base size is not set in the XSize‐
88 Hints structure, the minimum size is used if set. Otherwise, a base
89 size of zero is assumed. If no minimum size is set in the hints struc‐
90 ture, the base size is used. A mask (in the form returned by XParseGe‐
91 ometry) that describes which values came from the user specification
92 and whether or not the position coordinates are relative to the right
93 and bottom edges is returned. Note that these coordinates will have
94 already been accounted for in the x_return and y_return values.
95
96 Note that invalid geometry specifications can cause a width or height
97 of zero to be returned. The caller may pass the address of the hints
98 win_gravity field as gravity_return to update the hints directly.
99
101 XSetWMProperties(3)
102 Xlib - C Language X Interface
103
104
105
106X Version 11 libX11 1.3.4 XParseGeometry(3)