1XAllocSizeHints(3)              XLIB FUNCTIONS              XAllocSizeHints(3)
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,
126                                            height */
127       #define   PPosition    (1L << 2)     /* program specified posi‐
128                                            tion */
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   PWinGrav‐    (1L << 9)
141                 ity
142       #define   PAllHints    (PPosition|
143                               PSize|
144                               PMinSize|
145                               PMaxSize|
146                               PRe‐
147                              sizeInc|
148                               PAspect)
149       /* Values */
150
151       typedef struct {
152               long flags;     /* marks which fields in this structure are defined */
153               int x, y;       /* Obsolete */
154               int width, height;      /* Obsolete */
155               int min_width, min_height;
156               int max_width, max_height;
157               int width_inc, height_inc;
158               struct {
159                      int x;   /* numerator */
160                      int y;   /* denominator */
161               } min_aspect, max_aspect;
162               int base_width, base_height;
163               int win_gravity;
164               /* this structure may be extended in the future */
165       } XSizeHints;
166
167       The x, y, width, and height members  are  now  obsolete  and  are  left
168       solely for compatibility reasons.  The min_width and min_height members
169       specify the minimum window size that still allows the application to be
170       useful.   The max_width and max_height members specify the maximum win‐
171       dow size.  The width_inc and height_inc members  define  an  arithmetic
172       progression of sizes (minimum to maximum) into which the window prefers
173       to be resized.  The min_aspect and max_aspect members are expressed  as
174       ratios  of  x and y, and they allow an application to specify the range
175       of aspect ratios it prefers.  The base_width  and  base_height  members
176       define  the desired size of the window.  The window manager will inter‐
177       pret the position of the window and its border width  to  position  the
178       point  of  the  outer  rectangle of the overall window specified by the
179       win_gravity member.  The outer rectangle of  the  window  includes  any
180       borders or decorations supplied by the window manager.  In other words,
181       if the window manager decides to place  the  window  where  the  client
182       asked,  the  position  on  the  parent  window's  border  named  by the
183       win_gravity will be placed where the  client  window  would  have  been
184       placed in the absence of a window manager.
185
186       Note that use of the PAllHints macro is highly discouraged.
187

DIAGNOSTICS

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

SEE ALSO

197       XAllocClassHint(3),  XAllocIconSize(3),   XAllocWMHints(3),   XFree(3),
198       XSetCommand(3),  XSetTransientForHint(3),  XSetTextProperty(3), XSetWM‐
199       ClientMachine(3), XSetWMColormapWindows(3), XSetWMIconName(3),  XSetWM‐
200       Name(3),    XSetWMProperties(3),   XSetWMProtocols(3),   XStringListTo‐
201       TextProperty(3)
202       Xlib - C Language X Interface, O'Reilly and Associates,
203
204
205
206X Version 11                     libX11 1.6.12              XAllocSizeHints(3)
Impressum