1XParseGeometry(3) XLIB FUNCTIONS XParseGeometry(3)
2
3
4
6 XParseGeometry, XWMGeometry - parse window geometry
7
9 int XParseGeometry(_Xconst char *parsestring, int *x_return, int *y_re‐
10 turn, unsigned int *width_return, unsigned int *height_return);
11
12 int XWMGeometry(Display *display, int screen, _Xconst char *user_geom,
13 _Xconst char *def_geom, unsigned int bwidth, XSizeHints *hints,
14 int *x_return, int *y_return, int *width_return, int *height_re‐
15 turn, 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 should
64 not appear in the actual string.) If the string is not in the Host
65 Portable Character Encoding, the result is implementation-dependent.
66
67 The XParseGeometry function returns a bitmask that indicates which of
68 the four values (width, height, xoffset, and yoffset) were actually
69 found in the string and whether the x and y values are negative. By
70 convention, -0 is not equal to +0, because the user needs to be able to
71 say “position the window relative to the right or bottom edge.” For
72 each value found, the corresponding argument is updated. For each
73 value not found, the argument is left unchanged. The bits are repre‐
74 sented by XValue, YValue, WidthValue, HeightValue, XNegative, or YNega‐
75 tive and are defined in They will be set whenever one of the values is
76 defined or one of the signs is set.
77
78 If the function returns either the XValue or YValue flag, you should
79 place the window at the requested position.
80
81 The XWMGeometry function combines any geometry information (given in
82 the format used by XParseGeometry) specified by the user and by the
83 calling program with size hints (usually the ones to be stored in
84 WM_NORMAL_HINTS) and returns the position, size, and gravity NorthEast‐
85 Gravity, SouthEastGravity, or SouthWestGravity) that describe the win‐
86 dow. If the base size is not set in the XSizeHints structure, the min‐
87 imum size is used if set. Otherwise, a base size of zero is assumed.
88 If no minimum size is set in the hints structure, the base size is
89 used. A mask (in the form returned by XParseGeometry) that describes
90 which values came from the user specification and whether or not the
91 position coordinates are relative to the right and bottom edges is re‐
92 turned. Note that these coordinates will have already been accounted
93 for in the x_return and y_return values.
94
95 Note that invalid geometry specifications can cause a width or height
96 of zero to be returned. The caller may pass the address of the hints
97 win_gravity field as gravity_return to update the hints directly.
98
100 XSetWMProperties(3)
101 Xlib - C Language X Interface
102
103
104
105X Version 11 libX11 1.7.0 XParseGeometry(3)