1XAllocSizeHints(3X11)           XLIB FUNCTIONS           XAllocSizeHints(3X11)
2
3
4

NAME

6       XAllocSizeHints, XSetWMNormalHints, XGetWMNormalHints, XSetWMSizeHints,
7       XGetWMSizeHints, XSizeHints - allocate size hints structure and set or
8       read a window's WM_NORMAL_HINTS property
9

SYNTAX

11       XSizeHints *XAllocSizeHints(void);
12
13       void XSetWMNormalHints(Display *display, Window w, XSizeHints *hints);
14
15       Status XGetWMNormalHints(Display *display, Window w, XSizeHints
16              *hints_return, long *supplied_return);
17
18       void XSetWMSizeHints(Display *display, Window w, XSizeHints *hints,
19              Atom property);
20
21       Status XGetWMSizeHints(Display *display, Window w, XSizeHints
22              *hints_return, long *supplied_return, Atom property);
23

ARGUMENTS

25       display   Specifies the connection to the X server.
26
27       hints     Specifies the size hints for the window in its normal state.
28
29       hints     Specifies the XSizeHints structure to be used.
30
31       hints_return
32                 Returns the size hints for the window in its normal state.
33
34       property  Specifies the property name.
35
36       supplied_return
37                 Returns the hints that were supplied by the user.
38
39       w         Specifies the window.
40

DESCRIPTION

42       The XAllocSizeHints function allocates and returns a pointer to a
43       XSizeHints structure.  Note that all fields in the XSizeHints structure
44       are initially set to zero.  If insufficient memory is available, XAl‐
45       locSizeHints returns NULL.  To free the memory allocated to this struc‐
46       ture, use XFree.
47
48       The XSetWMNormalHints function replaces the size hints for the WM_NOR‐
49       MAL_HINTS property on the specified window.  If the property does not
50       already exist, XSetWMNormalHints sets the size hints for the WM_NOR‐
51       MAL_HINTS property on the specified window.  The property is stored
52       with a type of WM_SIZE_HINTS and a format of 32.
53
54       XSetWMNormalHints can generate BadAlloc and BadWindow errors.
55
56       The XGetWMNormalHints function returns the size hints stored in the
57       WM_NORMAL_HINTS property on the specified window.  If the property is
58       of type WM_SIZE_HINTS, is of format 32, and is long enough to contain
59       either an old (pre-ICCCM) or new size hints structure, XGetWMNormal‐
60       Hints sets the various fields of the XSizeHints structure, sets the
61       supplied_return argument to the list of fields that were supplied by
62       the user (whether or not they contained defined values), and returns a
63       nonzero status.  Otherwise, it returns a zero status.
64
65       If XGetWMNormalHints returns successfully and a pre-ICCCM size hints
66       property is read, the supplied_return argument will contain the follow‐
67       ing bits:
68
69       (USPosition|USSize|PPosition|PSize|PMinSize|
70        PMaxSize|PResizeInc|PAspect)
71
72       If the property is large enough to contain the base size and window
73       gravity fields as well, the supplied_return argument will also contain
74       the following bits:
75
76       PBaseSize|PWinGravity
77
78       XGetWMNormalHints can generate a PN BadWindow error.
79
80       The XSetWMSizeHints function replaces the size hints for the specified
81       property on the named window.  If the specified property does not
82       already exist, XSetWMSizeHints sets the size hints for the specified
83       property on the named window.  The property is stored with a type of
84       WM_SIZE_HINTS and a format of 32.  To set a window's normal size hints,
85       you can use the XSetWMNormalHints function.
86
87       XSetWMSizeHints can generate BadAlloc, BadAtom, and BadWindow errors.
88
89       The XGetWMSizeHints function returns the size hints stored in the spec‐
90       ified property on the named window.  If the property is of type
91       WM_SIZE_HINTS, is of format 32, and is long enough to contain either an
92       old (pre-ICCCM) or new size hints structure, XGetWMSizeHints sets the
93       various fields of the XSizeHints structure, sets the supplied_return
94       argument to the list of fields that were supplied by the user (whether
95       or not they contained defined values), and returns a nonzero status.
96       Otherwise, it returns a zero status.  To get a window's normal size
97       hints, you can use the XGetWMNormalHints function.
98
99       If XGetWMSizeHints returns successfully and a pre-ICCCM size hints
100       property is read, the supplied_return argument will contain the follow‐
101       ing bits:
102
103       (USPosition|USSize|PPosition|PSize|PMinSize|
104        PMaxSize|PResizeInc|PAspect)
105
106       If the property is large enough to contain the base size and window
107       gravity fields as well, the supplied_return argument will also contain
108       the following bits:
109
110       PBaseSize|PWinGravity
111
112       XGetWMSizeHints can generate BadAtom and BadWindow errors.
113

PROPERTIES

115       WM_NORMAL_HINTS
116                 Size hints for a window in its normal state.  The C type of
117                 this property is XSizeHints.
118

STRUCTURES

120       The XSizeHints structure contains:
121
122       /∗ Size hints mask bits */
123
124       #define   USPosition    (1L << 0)          /∗ user specified x, y */
125       #define   USSize        (1L << 1)          /∗ user specified width, height
126                                                  */
127       #define   PPosition     (1L << 2)          /∗ program specified position
128                                                  */
129       #define   PSize         (1L << 3)          /∗ program specified size */
130       #define   PMinSize      (1L << 4)          /∗ program specified minimum
131                                                  size */
132
133       #define   PMaxSize      (1L << 5)          /∗ program specified maximum
134                                                  size */
135       #define   PResizeInc    (1L << 6)          /∗ program specified resize
136                                                  increments */
137       #define   PAspect       (1L << 7)          /∗ program specified min and
138                                                  max aspect ratios */
139       #define   PBaseSize     (1L << 8)
140       #define   PWinGravity   (1L << 9)
141       #define   PAllHints     (PPosi‐
142                               tion|PSize|
143                               PMinSize|PMax‐
144                               Size|
145                               PRe‐
146                               sizeInc|PAspect)
147       /∗ Values */
148
149       typedef struct {
150            long flags;         /∗ marks which fields in this structure are defined */
151            int x, y;           /∗ Obsolete */
152            int width, height;  /∗ Obsolete */
153            int min_width, min_height;
154            int max_width, max_height;
155            int width_inc, height_inc;
156            struct {
157                   int x;       /∗ numerator */
158                   int y;       /∗ denominator */
159            } min_aspect, max_aspect;
160            int base_width, base_height;
161            int win_gravity;
162            /∗ this structure may be extended in the future */
163       } XSizeHints;
164
165       The x, y, width, and height members are now obsolete and are left
166       solely for compatibility reasons.  The min_width and min_height members
167       specify the minimum window size that still allows the application to be
168       useful.  The max_width and max_height members specify the maximum win‐
169       dow size.  The width_inc and height_inc members define an arithmetic
170       progression of sizes (minimum to maximum) into which the window prefers
171       to be resized.  The min_aspect and max_aspect members are expressed as
172       ratios of x and y, and they allow an application to specify the range
173       of aspect ratios it prefers.  The base_width and base_height members
174       define the desired size of the window.  The window manager will inter‐
175       pret the position of the window and its border width to position the
176       point of the outer rectangle of the overall window specified by the
177       win_gravity member.  The outer rectangle of the window includes any
178       borders or decorations supplied by the window manager.  In other words,
179       if the window manager decides to place the window where the client
180       asked, the position on the parent window's border named by the
181       win_gravity will be placed where the client window would have been
182       placed in the absence of a window manager.
183
184       Note that use of the PAllHints macro is highly discouraged.
185

DIAGNOSTICS

187       BadAlloc  The server failed to allocate the requested resource or
188                 server memory.
189
190       BadAtom   A value for an Atom argument does not name a defined Atom.
191
192       BadWindow A value for a Window argument does not name a defined Window.
193

SEE ALSO

195       XAllocClassHint(3X11), XAllocIconSize(3X11), XAllocWMHints(3X11),
196       XFree(3X11), XSetCommand(3X11), XSetTransientForHint(3X11), XSet‐
197       TextProperty(3X11), XSetWMClientMachine(3X11), XSetWMColormapWin‐
198       dows(3X11), XSetWMIconName(3X11), XSetWMName(3X11), XSetWMProper‐
199       ties(3X11), XSetWMProtocols(3X11), XStringListToTextProperty(3X11)
200       Xlib - C Language X Interface, O'Reilly and Associates,
201
202
203
204X Version 11                     libX11 1.0.3            XAllocSizeHints(3X11)
Impressum