1 #ifndef __XCB_ICCCM_H__
2 #define __XCB_ICCCM_H__
5 * Copyright (C) 2008 Arnaud Fontaine <arnau@debian.org>
6 * Copyright (C) 2007-2008 Vincent Torri <vtorri@univ-evry.fr>
8 * Permission is hereby granted, free of charge, to any person
9 * obtaining a copy of this software and associated documentation
10 * files (the "Software"), to deal in the Software without
11 * restriction, including without limitation the rights to use, copy,
12 * modify, merge, publish, distribute, sublicense, and/or sell copies
13 * of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
23 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
24 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 * Except as contained in this notice, the names of the authors or
28 * their institutions shall not be used in advertising or otherwise to
29 * promote the sale, use or other dealings in this Software without
30 * prior written authorization from the authors.
34 * @defgroup xcb__icccm_t XCB ICCCM Functions
36 * These functions allow easy handling of the protocol described in the
37 * Inter-Client Communication Conventions Manual.
43 #include "xcb_property.h"
50 * @brief TextProperty reply structure.
53 /** Store reply to avoid memory allocation, should normally not be
55 xcb_get_property_reply_t *_reply;
58 /** Length of the name field above */
62 /** Format, may be 8, 16 or 32 */
64 } xcb_get_text_property_reply_t;
67 * @brief Deliver a GetProperty request to the X server.
68 * @param c The connection to the X server.
69 * @param window Window X identifier.
70 * @param property Property atom to get.
71 * @return The request cookie.
73 * Allow to get a window property, in most case you might want to use
74 * above functions to get an ICCCM property for a given window.
76 xcb_get_property_cookie_t xcb_get_text_property(xcb_connection_t *c,
81 * @see xcb_get_text_property()
83 xcb_get_property_cookie_t xcb_get_text_property_unchecked(xcb_connection_t *c,
88 * @brief Fill given structure with the property value of a window.
89 * @param c The connection to the X server.
90 * @param cookie TextProperty request cookie.
91 * @param prop TextProperty reply which is to be filled.
92 * @param e Error if any.
93 * @return Return 1 on success, 0 otherwise.
95 * If the function return 0 (failure), the content of prop is unmodified and
96 * therefore the structure must not be wiped.
98 * The parameter e supplied to this function must be NULL if
99 * xcb_get_text_property_unchecked() is used. Otherwise, it stores
100 * the error if any. prop structure members should be freed by
101 * xcb_get_text_property_reply_wipe().
103 uint8_t xcb_get_text_property_reply(xcb_connection_t *c,
104 xcb_get_property_cookie_t cookie,
105 xcb_get_text_property_reply_t *prop,
106 xcb_generic_error_t **e);
109 * @brief Wipe prop structure members previously allocated by
110 * xcb_get_text_property_reply().
111 * @param prop prop structure whose members is going to be freed.
113 void xcb_get_text_property_reply_wipe(xcb_get_text_property_reply_t *prop);
118 * @brief Deliver a SetProperty request to set WM_NAME property value.
119 * @param c The connection to the X server.
120 * @param window Window X identifier.
121 * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
122 * @param name_len Length of name value to set.
123 * @param name Name value to set.
125 void xcb_set_wm_name_checked(xcb_connection_t *c,
132 * @see xcb_set_wm_name_checked()
134 void xcb_set_wm_name(xcb_connection_t *c, xcb_window_t window,
135 xcb_atom_t encoding, uint32_t name_len,
139 * @brief Deliver a GetProperty request to the X server for WM_NAME.
140 * @param c The connection to the X server.
141 * @param window Window X identifier.
142 * @return The request cookie.
144 xcb_get_property_cookie_t xcb_get_wm_name(xcb_connection_t *c,
145 xcb_window_t window);
148 * @see xcb_get_wm_name()
150 xcb_get_property_cookie_t xcb_get_wm_name_unchecked(xcb_connection_t *c,
151 xcb_window_t window);
154 * @brief Fill given structure with the WM_NAME property of a window.
155 * @param c The connection to the X server.
156 * @param cookie Request cookie.
157 * @param prop WM_NAME property value.
158 * @param e Error if any.
159 * @see xcb_get_text_property_reply()
160 * @return Return 1 on success, 0 otherwise.
162 uint8_t xcb_get_wm_name_reply(xcb_connection_t *c,
163 xcb_get_property_cookie_t cookie,
164 xcb_get_text_property_reply_t *prop,
165 xcb_generic_error_t **e);
168 * @brief Set a callback on WM_NAME property changes.
169 * @param prophs Property handlers.
170 * @param long_len Length of data.
171 * @param handler The callback.
172 * @param data data given to the callback.
174 void xcb_watch_wm_name(xcb_property_handlers_t *prophs, uint32_t long_len,
175 xcb_generic_property_handler_t handler, void *data);
180 * @brief Deliver a SetProperty request to set WM_ICON_NAME property value.
181 * @param c The connection to the X server.
182 * @param window Window X identifier.
183 * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
184 * @param name_len Length of name value to set.
185 * @param name Name value to set.
187 void xcb_set_wm_icon_name_checked(xcb_connection_t *c, xcb_window_t window,
188 xcb_atom_t encoding, uint32_t name_len,
192 * @see xcb_set_wm_icon_name_checked()
194 void xcb_set_wm_icon_name(xcb_connection_t *c, xcb_window_t window,
195 xcb_atom_t encoding, uint32_t name_len,
199 * @brief Send request to get WM_ICON_NAME property of a window.
200 * @param c The connection to the X server.
201 * @param window Window X identifier.
202 * @return The request cookie.
204 xcb_get_property_cookie_t xcb_get_wm_icon_name(xcb_connection_t *c,
205 xcb_window_t window);
208 * @see xcb_get_wm_icon_name()
210 xcb_get_property_cookie_t xcb_get_wm_icon_name_unchecked(xcb_connection_t *c,
211 xcb_window_t window);
214 * @brief Fill given structure with the WM_ICON_NAME property of a window.
215 * @param c The connection to the X server.
216 * @param cookie Request cookie.
217 * @param prop WM_ICON_NAME property value.
218 * @param e Error if any.
219 * @see xcb_get_text_property_reply()
220 * @return Return 1 on success, 0 otherwise.
222 uint8_t xcb_get_wm_icon_name_reply(xcb_connection_t *c,
223 xcb_get_property_cookie_t cookie,
224 xcb_get_text_property_reply_t *prop,
225 xcb_generic_error_t **e);
228 * @brief Set a callback on WM_ICON_NAME property changes.
229 * @param prophs Property handlers.
230 * @param long_len Length of data.
231 * @param handler The callback.
232 * @param data data given to the callback.
234 void xcb_watch_wm_icon_name(xcb_property_handlers_t *prophs, uint32_t long_len,
235 xcb_generic_property_handler_t handler,
238 /* WM_CLIENT_MACHINE */
241 * @brief Deliver a SetProperty request to set WM_CLIENT_MACHINE property value.
242 * @param c The connection to the X server.
243 * @param window Window X identifier.
244 * @param encoding Encoding used for the data passed in the name parameter, the set property will also have this encoding as its type.
245 * @param name_len Length of name value to set.
246 * @param name Name value to set.
248 void xcb_set_wm_client_machine_checked(xcb_connection_t *c, xcb_window_t window,
249 xcb_atom_t encoding, uint32_t name_len,
253 * @see xcb_set_wm_client_machine_checked()
255 void xcb_set_wm_client_machine(xcb_connection_t *c, xcb_window_t window,
256 xcb_atom_t encoding, uint32_t name_len,
260 * @brief Send request to get WM_CLIENT_MACHINE property of a window.
261 * @param c The connection to the X server.
262 * @param window Window X identifier.
263 * @return The request cookie.
265 xcb_get_property_cookie_t xcb_get_wm_client_machine(xcb_connection_t *c,
266 xcb_window_t window);
269 * @see xcb_get_wm_client_machine()
271 xcb_get_property_cookie_t xcb_get_wm_client_machine_unchecked(xcb_connection_t *c,
272 xcb_window_t window);
275 * @brief Fill given structure with the WM_CLIENT_MACHINE property of a window.
276 * @param c The connection to the X server.
277 * @param cookie Request cookie.
278 * @param prop WM_CLIENT_MACHINE property value.
279 * @param e Error if any.
280 * @see xcb_get_text_property_reply()
281 * @return Return 1 on success, 0 otherwise.
283 uint8_t xcb_get_wm_client_machine_reply(xcb_connection_t *c,
284 xcb_get_property_cookie_t cookie,
285 xcb_get_text_property_reply_t *prop,
286 xcb_generic_error_t **e);
289 * @brief Set a callback on WM_CLIENT_MACHINE property changes.
290 * @param prophs Property handlers.
291 * @param long_len Length of data.
292 * @param handler The callback.
293 * @param data data given to the callback.
295 void xcb_watch_wm_client_machine(xcb_property_handlers_t *prophs,
297 xcb_generic_property_handler_t handler,
303 * @brief WM_CLASS hint structure
308 /** Class of application */
310 /** Store reply to avoid memory allocation, should normally not be
312 xcb_get_property_reply_t *_reply;
313 } xcb_get_wm_class_reply_t;
316 * @brief Deliver a GetProperty request to the X server for WM_CLASS.
317 * @param c The connection to the X server.
318 * @param window Window X identifier.
319 * @return The request cookie.
321 xcb_get_property_cookie_t xcb_get_wm_class(xcb_connection_t *c,
322 xcb_window_t window);
325 * @see xcb_get_wm_class()
327 xcb_get_property_cookie_t xcb_get_wm_class_unchecked(xcb_connection_t *c,
328 xcb_window_t window);
332 * @brief Fill give structure with the WM_CLASS property of a window.
333 * @param prop The property structur to fill.
334 * @param reply The property request reply.
335 * @return Return 1 on success, 0 otherwise.
338 xcb_get_wm_class_from_reply(xcb_get_wm_class_reply_t *prop,
339 xcb_get_property_reply_t *reply);
342 * @brief Fill given structure with the WM_CLASS property of a window.
343 * @param c The connection to the X server.
344 * @param cookie Request cookie.
345 * @param prop WM_CLASS property value.
346 * @param e Error if any.
347 * @return Return 1 on success, 0 otherwise.
349 * The parameter e supplied to this function must be NULL if
350 * xcb_get_wm_class_unchecked() is used. Otherwise, it stores the
351 * error if any. prop structure members should be freed by
352 * xcb_get_wm_class_reply_wipe().
354 uint8_t xcb_get_wm_class_reply(xcb_connection_t *c,
355 xcb_get_property_cookie_t cookie,
356 xcb_get_wm_class_reply_t *prop,
357 xcb_generic_error_t **e);
360 * @brief Wipe prop structure members previously allocated by
361 * xcb_get_wm_class_reply().
362 * @param prop prop structure whose members is going to be freed.
364 void xcb_get_wm_class_reply_wipe(xcb_get_wm_class_reply_t *prop);
366 /* WM_TRANSIENT_FOR */
369 * @brief Send request to get WM_TRANSIENT_FOR property of a window.
370 * @param c The connection to the X server
371 * @param window Window X identifier.
372 * @return The request cookie.
374 xcb_get_property_cookie_t xcb_get_wm_transient_for(xcb_connection_t *c,
375 xcb_window_t window);
378 * @see xcb_get_wm_transient_for_unchecked()
380 xcb_get_property_cookie_t xcb_get_wm_transient_for_unchecked(xcb_connection_t *c,
381 xcb_window_t window);
384 * @brief Fill given window pointer with the WM_TRANSIENT_FOR property of a window.
385 * @param prop WM_TRANSIENT_FOR property value.
386 * @param reply The get property request reply.
387 * @return Return 1 on success, 0 otherwise.
390 xcb_get_wm_transient_for_from_reply(xcb_window_t *prop,
391 xcb_get_property_reply_t *reply);
393 * @brief Fill given structure with the WM_TRANSIENT_FOR property of a window.
394 * @param c The connection to the X server.
395 * @param cookie Request cookie.
396 * @param prop WM_TRANSIENT_FOR property value.
397 * @param e Error if any.
398 * @return Return 1 on success, 0 otherwise.
400 * The parameter e supplied to this function must be NULL if
401 * xcb_get_wm_transient_for_unchecked() is used. Otherwise, it stores
404 uint8_t xcb_get_wm_transient_for_reply(xcb_connection_t *c,
405 xcb_get_property_cookie_t cookie,
407 xcb_generic_error_t **e);
412 XCB_SIZE_HINT_US_POSITION = 1 << 0,
413 XCB_SIZE_HINT_US_SIZE = 1 << 1,
414 XCB_SIZE_HINT_P_POSITION = 1 << 2,
415 XCB_SIZE_HINT_P_SIZE = 1 << 3,
416 XCB_SIZE_HINT_P_MIN_SIZE = 1 << 4,
417 XCB_SIZE_HINT_P_MAX_SIZE = 1 << 5,
418 XCB_SIZE_HINT_P_RESIZE_INC = 1 << 6,
419 XCB_SIZE_HINT_P_ASPECT = 1 << 7,
420 XCB_SIZE_HINT_BASE_SIZE = 1 << 8,
421 XCB_SIZE_HINT_P_WIN_GRAVITY = 1 << 9
422 } xcb_size_hints_flags_t;
425 * @brief Size hints structure.
428 /** User specified flags */
430 /** User-specified position */
432 /** User-specified size */
433 int32_t width, height;
434 /** Program-specified minimum size */
435 int32_t min_width, min_height;
436 /** Program-specified maximum size */
437 int32_t max_width, max_height;
438 /** Program-specified resize increments */
439 int32_t width_inc, height_inc;
440 /** Program-specified minimum aspect ratios */
441 int32_t min_aspect_num, min_aspect_den;
442 /** Program-specified maximum aspect ratios */
443 int32_t max_aspect_num, max_aspect_den;
444 /** Program-specified base size */
445 int32_t base_width, base_height;
446 /** Program-specified window gravity */
447 uint32_t win_gravity;
451 * @brief Set size hints to a given position.
452 * @param hints SIZE_HINTS structure.
453 * @param user_specified Is the size user-specified?
454 * @param x The X position.
455 * @param y The Y position.
457 void xcb_size_hints_set_position(xcb_size_hints_t *hints, int user_specified,
458 int32_t x, int32_t y);
461 * @brief Set size hints to a given size.
462 * @param hints SIZE_HINTS structure.
463 * @param user_specified is the size user-specified?
464 * @param width The width.
465 * @param height The height.
467 void xcb_size_hints_set_size(xcb_size_hints_t *hints, int user_specified,
468 int32_t width, int32_t height);
471 * @brief Set size hints to a given minimum size.
472 * @param hints SIZE_HINTS structure.
473 * @param width The minimum width.
474 * @param height The minimum height.
476 void xcb_size_hints_set_min_size(xcb_size_hints_t *hints, int32_t min_width,
480 * @brief Set size hints to a given maximum size.
481 * @param hints SIZE_HINTS structure.
482 * @param width The maximum width.
483 * @param height The maximum height.
485 void xcb_size_hints_set_max_size(xcb_size_hints_t *hints, int32_t max_width,
489 * @brief Set size hints to a given resize increments.
490 * @param hints SIZE_HINTS structure.
491 * @param width The resize increments width.
492 * @param height The resize increments height.
494 void xcb_size_hints_set_resize_inc(xcb_size_hints_t *hints, int32_t width_inc,
498 * @brief Set size hints to a given aspect ratios.
499 * @param hints SIZE_HINTS structure.
500 * @param min_aspect_num The minimum aspect ratios for the width.
501 * @param min_aspect_den The minimum aspect ratios for the height.
502 * @param max_aspect_num The maximum aspect ratios for the width.
503 * @param max_aspect_den The maximum aspect ratios for the height.
505 void xcb_size_hints_set_aspect(xcb_size_hints_t *hints, int32_t min_aspect_num,
506 int32_t min_aspect_den, int32_t max_aspect_num,
507 int32_t max_aspect_den);
510 * @brief Set size hints to a given base size.
511 * @param hints SIZE_HINTS structure.
512 * @param base_width Base width.
513 * @param base_height Base height.
515 void xcb_size_hints_set_base_size(xcb_size_hints_t *hints, int32_t base_width,
516 int32_t base_height);
519 * @brief Set size hints to a given window gravity.
520 * @param hints SIZE_HINTS structure.
521 * @param win_gravity Window gravity value.
523 void xcb_size_hints_set_win_gravity(xcb_size_hints_t *hints,
524 uint32_t win_gravity);
527 * @brief Deliver a ChangeProperty request to set a value to a given property.
528 * @param c The connection to the X server.
529 * @param window Window X identifier.
530 * @param property Property to set value for.
531 * @param hints Hints value to set.
533 void xcb_set_wm_size_hints_checked(xcb_connection_t *c, xcb_window_t window,
534 xcb_atom_t property, xcb_size_hints_t *hints);
537 * @see xcb_set_wm_size_hints_checked()
539 void xcb_set_wm_size_hints(xcb_connection_t *c, xcb_window_t window,
540 xcb_atom_t property, xcb_size_hints_t *hints);
543 * @brief Send request to get size hints structure for the named property.
544 * @param c The connection to the X server.
545 * @param window Window X identifier.
546 * @param property Specify the property name.
547 * @return The request cookie.
549 xcb_get_property_cookie_t xcb_get_wm_size_hints(xcb_connection_t *c,
551 xcb_atom_t property);
554 * @see xcb_get_wm_size_hints()
556 xcb_get_property_cookie_t xcb_get_wm_size_hints_unchecked(xcb_connection_t *c,
558 xcb_atom_t property);
561 * @brief Fill given structure with the size hints of the named property.
562 * @param c The connection to the X server.
563 * @param cookie Request cookie.
564 * @param hints Size hints structure.
565 * @param e Error if any.
566 * @return Return 1 on success, 0 otherwise.
568 * The parameter e supplied to this function must be NULL if
569 * xcb_get_wm_size_hints_unchecked() is used. Otherwise, it stores
570 * the error if any. The returned pointer should be freed.
572 uint8_t xcb_get_wm_size_hints_reply(xcb_connection_t *c,
573 xcb_get_property_cookie_t cookie,
574 xcb_size_hints_t *hints,
575 xcb_generic_error_t **e);
577 /* WM_NORMAL_HINTS */
580 * @brief Deliver a ChangeProperty request to set WM_NORMAL_HINTS property value.
581 * @param c The connection to the X server.
582 * @param window Window X identifier.
583 * @param hints Hints value to set.
585 void xcb_set_wm_normal_hints_checked(xcb_connection_t *c, xcb_window_t window,
586 xcb_size_hints_t *hints);
589 * @see xcb_set_wm_normal_hints_checked()
591 void xcb_set_wm_normal_hints(xcb_connection_t *c, xcb_window_t window,
592 xcb_size_hints_t *hints);
595 * @brief Send request to get WM_NORMAL_HINTS property of a window.
596 * @param c The connection to the X server.
597 * @param window Window X identifier.
598 * @return The request cookie.
600 xcb_get_property_cookie_t xcb_get_wm_normal_hints(xcb_connection_t *c,
601 xcb_window_t window);
604 * @see xcb_get_wm_normal_hints()
606 xcb_get_property_cookie_t xcb_get_wm_normal_hints_unchecked(xcb_connection_t *c,
607 xcb_window_t window);
610 * @brief Fill given structure with the WM_NORMAL_HINTS property of a window.
611 * @param hints WM_NORMAL_HINTS property value.
612 * @param reply The get property request reply.
613 * @return Return 1 on success, 0 otherwise.
616 xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hints,
617 xcb_get_property_reply_t *reply);
620 * @brief Fill given structure with the WM_NORMAL_HINTS property of a window.
621 * @param c The connection to the X server.
622 * @param cookie Request cookie.
623 * @param hints WM_NORMAL_HINTS property value.
624 * @param e Error if any.
625 * @return Return 1 on success, 0 otherwise.
627 * The parameter e supplied to this function must be NULL if
628 * xcb_get_wm_normal_hints_unchecked() is used. Otherwise, it stores
629 * the error if any. The returned pointer should be freed.
631 uint8_t xcb_get_wm_normal_hints_reply(xcb_connection_t *c,
632 xcb_get_property_cookie_t cookie,
633 xcb_size_hints_t *hints,
634 xcb_generic_error_t **e);
639 * @brief WM hints structure (may be extended in the future).
642 /** Marks which fields in this structure are defined */
644 /** Does this application rely on the window manager to get keyboard
648 int32_t initial_state;
649 /** Pixmap to be used as icon */
650 xcb_pixmap_t icon_pixmap;
651 /** Window to be used as icon */
652 xcb_window_t icon_window;
653 /** Initial position of icon */
654 int32_t icon_x, icon_y;
655 /** Icon mask bitmap */
656 xcb_pixmap_t icon_mask;
657 /* Identifier of related window group */
658 xcb_window_t window_group;
661 /** Number of elements in this structure */
662 #define XCB_NUM_WM_HINTS_ELEMENTS 9
665 * @brief WM_HINTS window states.
668 XCB_WM_STATE_WITHDRAWN = 0,
669 XCB_WM_STATE_NORMAL = 1,
670 XCB_WM_STATE_ICONIC = 3
674 XCB_WM_HINT_INPUT = (1L << 0),
675 XCB_WM_HINT_STATE = (1L << 1),
676 XCB_WM_HINT_ICON_PIXMAP = (1L << 2),
677 XCB_WM_HINT_ICON_WINDOW = (1L << 3),
678 XCB_WM_HINT_ICON_POSITION = (1L << 4),
679 XCB_WM_HINT_ICON_MASK = (1L << 5),
680 XCB_WM_HINT_WINDOW_GROUP = (1L << 6),
681 XCB_WM_HINT_X_URGENCY = (1L << 8)
684 #define XCB_WM_ALL_HINTS (XCB_WM_HINT_INPUT | XCB_WM_HINT_STATE |\
685 XCB_WM_HINT_ICON_PIXMAP | XCB_WM_HINT_ICON_WINDOW |\
686 XCB_WM_HINT_ICON_POSITION | XCB_WM_HINT_ICON_MASK |\
687 XCB_WM_HINT_WINDOW_GROUP)
690 * @brief Get urgency hint.
691 * @param hints WM_HINTS structure.
692 * @return Urgency hint value.
694 uint32_t xcb_wm_hints_get_urgency(xcb_wm_hints_t *hints);
697 * @brief Set input focus.
698 * @param hints WM_HINTS structure.
699 * @param input Input focus.
701 void xcb_wm_hints_set_input(xcb_wm_hints_t *hints, uint8_t input);
704 * @brief Set hints state to 'iconic'.
705 * @param hints WM_HINTS structure.
707 void xcb_wm_hints_set_iconic(xcb_wm_hints_t *hints);
710 * @brief Set hints state to 'normal'.
711 * @param hints WM_HINTS structure.
713 void xcb_wm_hints_set_normal(xcb_wm_hints_t *hints);
716 * @brief Set hints state to 'withdrawn'.
717 * @param hints WM_HINTS structure.
719 void xcb_wm_hints_set_withdrawn(xcb_wm_hints_t *hints);
722 * @brief Set hints state to none.
723 * @param hints WM_HINTS structure.
725 void xcb_wm_hints_set_none(xcb_wm_hints_t *hints);
728 * @brief Set pixmap to be used as icon.
729 * @param hints WM_HINTS structure.
730 * @param icon_pixmap Pixmap.
732 void xcb_wm_hints_set_icon_pixmap(xcb_wm_hints_t *hints,
733 xcb_pixmap_t icon_pixmap);
736 * @brief Set icon mask bitmap.
737 * @param hints WM_HINTS structure.
738 * @param icon_mask Pixmap.
740 void xcb_wm_hints_set_icon_mask(xcb_wm_hints_t *hints, xcb_pixmap_t icon_mask);
743 * @brief Set window identifier to be used as icon.
744 * @param hints WM_HINTS structure.
745 * @param icon_window Window X identifier.
747 void xcb_wm_hints_set_icon_window(xcb_wm_hints_t *hints,
748 xcb_window_t icon_window);
751 * @brief Set identifier of related window group.
752 * @param hints WM_HINTS structure.
753 * @param window_group Window X identifier.
755 void xcb_wm_hints_set_window_group(xcb_wm_hints_t *hints,
756 xcb_window_t window_group);
759 * @brief Set urgency hints flag.
760 * @param hints WM_HINTS structure.
762 void xcb_wm_hints_set_urgency(xcb_wm_hints_t *hints);
765 * @brief Deliver a SetProperty request to set WM_HINTS property value.
766 * @param c The connection to the X server.
767 * @param window Window X identifier.
768 * @param hints Hints value to set.
770 void xcb_set_wm_hints_checked(xcb_connection_t *c, xcb_window_t window,
771 xcb_wm_hints_t *hints);
774 * @see xcb_set_wm_hints_checked()
776 void xcb_set_wm_hints(xcb_connection_t *c, xcb_window_t window,
777 xcb_wm_hints_t *hints);
780 * @brief Send request to get WM_HINTS property of a window.
781 * @param c The connection to the X server.
782 * @param window Window X identifier.
783 * @return The request cookie.
785 xcb_get_property_cookie_t xcb_get_wm_hints(xcb_connection_t *c,
786 xcb_window_t window);
789 * @see xcb_get_wm_hints()
791 xcb_get_property_cookie_t xcb_get_wm_hints_unchecked(xcb_connection_t *c,
792 xcb_window_t window);
795 * @brief Fill given structure with the WM_HINTS property of a window.
796 * @param hints WM_HINTS property value.
797 * @param reply The get property request reply.
798 * @return Return 1 on success, 0 otherwise.
801 xcb_get_wm_hints_from_reply(xcb_wm_hints_t *hints,
802 xcb_get_property_reply_t *reply);
805 * @brief Fill given structure with the WM_HINTS property of a window.
806 * @param c The connection to the X server.
807 * @param cookie Request cookie.
808 * @param hints WM_HINTS property value.
809 * @param e Error if any.
810 * @return Return 1 on success, 0 otherwise.
812 * The parameter e supplied to this function must be NULL if
813 * xcb_get_wm_hints_unchecked() is used. Otherwise, it stores the
814 * error if any. The returned pointer should be freed.
816 uint8_t xcb_get_wm_hints_reply(xcb_connection_t *c,
817 xcb_get_property_cookie_t cookie,
818 xcb_wm_hints_t *hints,
819 xcb_generic_error_t **e);
824 * @brief Deliver a SetProperty request to set WM_PROTOCOLS property value.
825 * @param c The connection to the X server.
826 * @param wm_protocols The WM_PROTOCOLS atom.
827 * @param window Window X identifier.
828 * @param list_len Atom list len.
829 * @param list Atom list.
831 void xcb_set_wm_protocols_checked(xcb_connection_t *c, xcb_atom_t wm_protocols,
832 xcb_window_t window, uint32_t list_len,
836 * @see xcb_set_wm_protocols_checked()
838 void xcb_set_wm_protocols(xcb_connection_t *c, xcb_atom_t wm_protocols,
839 xcb_window_t window, uint32_t list_len,
843 * @brief WM_PROTOCOLS structure.
846 /** Length of the atoms list */
850 /** Store reply to avoid memory allocation, should normally not be
852 xcb_get_property_reply_t *_reply;
853 } xcb_get_wm_protocols_reply_t;
856 * @brief Send request to get WM_PROTOCOLS property of a given window.
857 * @param c The connection to the X server.
858 * @param window Window X identifier.
859 * @return The request cookie.
861 xcb_get_property_cookie_t xcb_get_wm_protocols(xcb_connection_t *c,
863 xcb_atom_t wm_protocol_atom);
866 * @see xcb_get_wm_protocols()
868 xcb_get_property_cookie_t xcb_get_wm_protocols_unchecked(xcb_connection_t *c,
870 xcb_atom_t wm_protocol_atom);
873 * @brief Fill the given structure with the WM_PROTOCOLS property of a window.
874 * @param reply The reply of the GetProperty request.
875 * @param protocols WM_PROTOCOLS property value.
876 * @return Return 1 on success, 0 otherwise.
878 * protocols structure members should be freed by
879 * xcb_get_wm_protocols_reply_wipe().
881 uint8_t xcb_get_wm_protocols_from_reply(xcb_get_property_reply_t *reply,
882 xcb_get_wm_protocols_reply_t *protocols);
884 * @brief Fill the given structure with the WM_PROTOCOLS property of a window.
885 * @param c The connection to the X server.
886 * @param cookie Request cookie.
887 * @param protocols WM_PROTOCOLS property value.
888 * @param e Error if any.
889 * @return Return 1 on success, 0 otherwise.
891 * The parameter e supplied to this function must be NULL if
892 * xcb_get_wm_protocols_unchecked() is used. Otherwise, it stores the
893 * error if any. protocols structure members should be freed by
894 * xcb_get_wm_protocols_reply_wipe().
896 uint8_t xcb_get_wm_protocols_reply(xcb_connection_t *c,
897 xcb_get_property_cookie_t cookie,
898 xcb_get_wm_protocols_reply_t *protocols,
899 xcb_generic_error_t **e);
902 * @brief Wipe protocols structure members previously allocated by
903 * xcb_get_wm_protocols_reply().
904 * @param protocols protocols structure whose members is going to be freed.
906 void xcb_get_wm_protocols_reply_wipe(xcb_get_wm_protocols_reply_t *protocols);
916 #endif /* __XCB_ICCCM_H__ */