1 module xcb.ewmh;
2 
3 /*
4  * Copyright (C) 2009-2011 Arnaud Fontaine <arnau@debian.org>
5  *
6  * Permission  is  hereby  granted,  free  of charge,  to  any  person
7  * obtaining  a copy  of  this software  and associated  documentation
8  * files   (the  "Software"),   to  deal   in  the   Software  without
9  * restriction, including without limitation  the rights to use, copy,
10  * modify, merge, publish,  distribute, sublicense, and/or sell copies
11  * of  the Software, and  to permit  persons to  whom the  Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The  above copyright  notice and  this permission  notice  shall be
15  * included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE  IS PROVIDED  "AS IS", WITHOUT  WARRANTY OF  ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT  NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY,   FITNESS    FOR   A   PARTICULAR    PURPOSE   AND
20  * NONINFRINGEMENT. IN  NO EVENT SHALL  THE AUTHORS BE LIABLE  FOR ANY
21  * CLAIM,  DAMAGES  OR  OTHER  LIABILITY,  WHETHER  IN  AN  ACTION  OF
22  * CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  * Except as  contained in  this notice, the  names of the  authors or
26  * their institutions shall not be used in advertising or otherwise to
27  * promote the  sale, use or  other dealings in this  Software without
28  * prior written authorization from the authors.
29  */
30 
31 import xcb.xcb;
32 
33 extern (C):
34 
35 /**
36  * @brief Hold EWMH information specific to a screen
37  */
38 struct xcb_ewmh_connection_t {
39 	/** The X connection */
40 	xcb_connection_t* connection;
41 	/** The screens on this connection */
42 	xcb_screen_t** screens;
43 	int nb_screens;
44 	/** _NET_WM_CM_Sn atoms depending on the number of screens */
45 	xcb_atom_t* _NET_WM_CM_Sn;
46 	/** The EWMH atoms of this connection */
47 	xcb_atom_t _NET_SUPPORTED;
48 	xcb_atom_t _NET_CLIENT_LIST;
49 	xcb_atom_t _NET_CLIENT_LIST_STACKING;
50 	xcb_atom_t _NET_NUMBER_OF_DESKTOPS;
51 	xcb_atom_t _NET_DESKTOP_GEOMETRY;
52 	xcb_atom_t _NET_DESKTOP_VIEWPORT;
53 	xcb_atom_t _NET_CURRENT_DESKTOP;
54 	xcb_atom_t _NET_DESKTOP_NAMES;
55 	xcb_atom_t _NET_ACTIVE_WINDOW;
56 	xcb_atom_t _NET_WORKAREA;
57 	xcb_atom_t _NET_SUPPORTING_WM_CHECK;
58 	xcb_atom_t _NET_VIRTUAL_ROOTS;
59 	xcb_atom_t _NET_DESKTOP_LAYOUT;
60 	xcb_atom_t _NET_SHOWING_DESKTOP;
61 	xcb_atom_t _NET_CLOSE_WINDOW;
62 	xcb_atom_t _NET_MOVERESIZE_WINDOW;
63 	xcb_atom_t _NET_WM_MOVERESIZE;
64 	xcb_atom_t _NET_RESTACK_WINDOW;
65 	xcb_atom_t _NET_REQUEST_FRAME_EXTENTS;
66 	xcb_atom_t _NET_WM_NAME;
67 	xcb_atom_t _NET_WM_VISIBLE_NAME;
68 	xcb_atom_t _NET_WM_ICON_NAME;
69 	xcb_atom_t _NET_WM_VISIBLE_ICON_NAME;
70 	xcb_atom_t _NET_WM_DESKTOP;
71 	xcb_atom_t _NET_WM_WINDOW_TYPE;
72 	xcb_atom_t _NET_WM_STATE;
73 	xcb_atom_t _NET_WM_ALLOWED_ACTIONS;
74 	xcb_atom_t _NET_WM_STRUT;
75 	xcb_atom_t _NET_WM_STRUT_PARTIAL;
76 	xcb_atom_t _NET_WM_ICON_GEOMETRY;
77 	xcb_atom_t _NET_WM_ICON;
78 	xcb_atom_t _NET_WM_PID;
79 	xcb_atom_t _NET_WM_HANDLED_ICONS;
80 	xcb_atom_t _NET_WM_USER_TIME;
81 	xcb_atom_t _NET_WM_USER_TIME_WINDOW;
82 	xcb_atom_t _NET_FRAME_EXTENTS;
83 	xcb_atom_t _NET_WM_PING;
84 	xcb_atom_t _NET_WM_SYNC_REQUEST;
85 	xcb_atom_t _NET_WM_SYNC_REQUEST_COUNTER;
86 	xcb_atom_t _NET_WM_FULLSCREEN_MONITORS;
87 	xcb_atom_t _NET_WM_FULL_PLACEMENT;
88 	xcb_atom_t UTF8_STRING;
89 	xcb_atom_t WM_PROTOCOLS;
90 	xcb_atom_t MANAGER;
91 	xcb_atom_t _NET_WM_WINDOW_TYPE_DESKTOP;
92 	xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK;
93 	xcb_atom_t _NET_WM_WINDOW_TYPE_TOOLBAR;
94 	xcb_atom_t _NET_WM_WINDOW_TYPE_MENU;
95 	xcb_atom_t _NET_WM_WINDOW_TYPE_UTILITY;
96 	xcb_atom_t _NET_WM_WINDOW_TYPE_SPLASH;
97 	xcb_atom_t _NET_WM_WINDOW_TYPE_DIALOG;
98 	xcb_atom_t _NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
99 	xcb_atom_t _NET_WM_WINDOW_TYPE_POPUP_MENU;
100 	xcb_atom_t _NET_WM_WINDOW_TYPE_TOOLTIP;
101 	xcb_atom_t _NET_WM_WINDOW_TYPE_NOTIFICATION;
102 	xcb_atom_t _NET_WM_WINDOW_TYPE_COMBO;
103 	xcb_atom_t _NET_WM_WINDOW_TYPE_DND;
104 	xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL;
105 	xcb_atom_t _NET_WM_STATE_MODAL;
106 	xcb_atom_t _NET_WM_STATE_STICKY;
107 	xcb_atom_t _NET_WM_STATE_MAXIMIZED_VERT;
108 	xcb_atom_t _NET_WM_STATE_MAXIMIZED_HORZ;
109 	xcb_atom_t _NET_WM_STATE_SHADED;
110 	xcb_atom_t _NET_WM_STATE_SKIP_TASKBAR;
111 	xcb_atom_t _NET_WM_STATE_SKIP_PAGER;
112 	xcb_atom_t _NET_WM_STATE_HIDDEN;
113 	xcb_atom_t _NET_WM_STATE_FULLSCREEN;
114 	xcb_atom_t _NET_WM_STATE_ABOVE;
115 	xcb_atom_t _NET_WM_STATE_BELOW;
116 	xcb_atom_t _NET_WM_STATE_DEMANDS_ATTENTION;
117 	xcb_atom_t _NET_WM_ACTION_MOVE;
118 	xcb_atom_t _NET_WM_ACTION_RESIZE;
119 	xcb_atom_t _NET_WM_ACTION_MINIMIZE;
120 	xcb_atom_t _NET_WM_ACTION_SHADE;
121 	xcb_atom_t _NET_WM_ACTION_STICK;
122 	xcb_atom_t _NET_WM_ACTION_MAXIMIZE_HORZ;
123 	xcb_atom_t _NET_WM_ACTION_MAXIMIZE_VERT;
124 	xcb_atom_t _NET_WM_ACTION_FULLSCREEN;
125 	xcb_atom_t _NET_WM_ACTION_CHANGE_DESKTOP;
126 	xcb_atom_t _NET_WM_ACTION_CLOSE;
127 	xcb_atom_t _NET_WM_ACTION_ABOVE;
128 	xcb_atom_t _NET_WM_ACTION_BELOW;
129 }
130 
131 /**
132  * @brief Hold a GetProperty reply containing a list of Atoms
133  */
134 struct xcb_ewmh_get_atoms_reply_t {
135 	/** The number of Atoms */
136 	uint atoms_len;
137 	/** The list of Atoms */
138 	xcb_atom_t* atoms;
139 	/** The actual GetProperty reply */
140 	xcb_get_property_reply_t* _reply;
141 }
142 
143 /**
144  * @brief Hold a GetProperty reply containing a list of Windows
145  */
146 struct xcb_ewmh_get_windows_reply_t {
147 	/** The number of Windows */
148 	uint windows_len;
149 	/** The list of Windows */
150 	xcb_window_t* windows;
151 	/** The actual GetProperty reply */
152 	xcb_get_property_reply_t* _reply;
153 }
154 
155 /**
156  * @brief Hold a GetProperty reply containg a list of UTF-8 strings
157  */
158 struct xcb_ewmh_get_utf8_strings_reply_t {
159 	/** The number of UTF-8 strings */
160 	uint strings_len;
161 	/** The list of UTF-8 strings */
162 	char* strings;
163 	/** The actual GetProperty reply */
164 	xcb_get_property_reply_t* _reply;
165 }
166 
167 /**
168  * @brief Coordinates Property values
169  */
170 struct xcb_ewmh_coordinates_t {
171 	/** The x coordinate */
172 	uint x;
173 	/** The y coordinate */
174 	uint y;
175 }
176 
177 /**
178  * @brief Hold reply of _NET_DESKTOP_VIEWPORT GetProperty
179  */
180 struct xcb_ewmh_get_desktop_viewport_reply_t {
181 	/** The number of desktop viewports */
182 	uint desktop_viewport_len;
183 	/** The desktop viewports */
184 	xcb_ewmh_coordinates_t* desktop_viewport;
185 	/** The actual GetProperty reply */
186 	xcb_get_property_reply_t* _reply;
187 }
188 
189 /**
190  * @brief Geometry Property values
191  */
192 struct xcb_ewmh_geometry_t {
193 	/** The x coordinate */
194 	uint x;
195 	/** The y coordinate */
196 	uint y;
197 	/** The width */
198 	uint width;
199 	/** The height */
200 	uint height;
201 }
202 
203 /**
204  * @brief Hold reply of a _NET_WORKAREA GetProperty
205  */
206 struct xcb_ewmh_get_workarea_reply_t {
207 	/** The number of desktop workarea */
208 	uint workarea_len;
209 	/** The list of desktop workarea */
210 	xcb_ewmh_geometry_t* workarea;
211 	/** The actual GetProperty reply */
212 	xcb_get_property_reply_t* _reply;
213 }
214 
215 /**
216  * @brief Source indication in requests
217  */
218 enum xcb_ewmh_client_source_type_t {
219 	/** No source at all (for clients supporting an older version of
220       EWMH specification) */
221 	XCB_EWMH_CLIENT_SOURCE_TYPE_NONE = 0,
222 	/** Normal application */
223 		XCB_EWMH_CLIENT_SOURCE_TYPE_NORMAL = 1,/** Pagers and other clients that represent direct user actions */
224 		XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER = 2
225 }
226 
227 alias XCB_EWMH_CLIENT_SOURCE_TYPE_NONE = xcb_ewmh_client_source_type_t.XCB_EWMH_CLIENT_SOURCE_TYPE_NONE;
228 alias XCB_EWMH_CLIENT_SOURCE_TYPE_NORMAL = xcb_ewmh_client_source_type_t.XCB_EWMH_CLIENT_SOURCE_TYPE_NORMAL;
229 alias XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER = xcb_ewmh_client_source_type_t.XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER;
230 
231 /**
232  * @brief _NET_DESKTOP_LAYOUT orientation
233  */
234 enum xcb_ewmh_desktop_layout_orientation_t {
235 	/** Horizontal orientation (desktops laid out in rows) */
236 	XCB_EWMH_WM_ORIENTATION_HORZ = 0,
237 	/** Vertical orientation (desktops laid out in columns) */
238 		XCB_EWMH_WM_ORIENTATION_VERT = 1
239 }
240 
241 alias XCB_EWMH_WM_ORIENTATION_HORZ = xcb_ewmh_desktop_layout_orientation_t.XCB_EWMH_WM_ORIENTATION_HORZ;
242 alias XCB_EWMH_WM_ORIENTATION_VERT = xcb_ewmh_desktop_layout_orientation_t.XCB_EWMH_WM_ORIENTATION_VERT;
243 
244 /**
245  * @brief _NET_DESKTOP_LAYOUT starting corner
246  */
247 enum xcb_ewmh_desktop_layout_starting_corner_t {
248 	/** Starting corner on the top left */
249 	XCB_EWMH_WM_TOPLEFT = 0,
250 	/** Starting corner on the top right */
251 		XCB_EWMH_WM_TOPRIGHT = 1,/** Starting corner on the bottom right */
252 		XCB_EWMH_WM_BOTTOMRIGHT = 2,/** Starting corner on the bottom left */
253 		XCB_EWMH_WM_BOTTOMLEFT = 3
254 }
255 
256 alias XCB_EWMH_WM_TOPLEFT = xcb_ewmh_desktop_layout_starting_corner_t.XCB_EWMH_WM_TOPLEFT;
257 alias XCB_EWMH_WM_TOPRIGHT = xcb_ewmh_desktop_layout_starting_corner_t.XCB_EWMH_WM_TOPRIGHT;
258 alias XCB_EWMH_WM_BOTTOMRIGHT = xcb_ewmh_desktop_layout_starting_corner_t.XCB_EWMH_WM_BOTTOMRIGHT;
259 alias XCB_EWMH_WM_BOTTOMLEFT = xcb_ewmh_desktop_layout_starting_corner_t.XCB_EWMH_WM_BOTTOMLEFT;
260 
261 /**
262  * @brief Hold reply of a _NET_DESKTOP_LAYOUT GetProperty
263  * @see xcb_ewmh_desktop_layout_orientation_t
264  * @see xcb_ewmh_desktop_layout_starting_corner_t
265  */
266 struct xcb_ewmh_get_desktop_layout_reply_t {
267 	/** The desktops orientation */
268 	uint orientation;
269 	/** The number of columns */
270 	uint columns;
271 	/** The number of rows */
272 	uint rows;
273 	/** The desktops starting corner */
274 	uint starting_corner;
275 }
276 
277 /**
278  * @brief _NET_WM_MOVERESIZE value when moving via keyboard
279  * @see xcb_ewmh_moveresize_direction_t
280  */
281 enum xcb_ewmh_moveresize_window_opt_flags_t {
282 	/** The window x coordinate */
283 	XCB_EWMH_MOVERESIZE_WINDOW_X = (1 << 8),
284 	/** The window y coordinate */
285 		XCB_EWMH_MOVERESIZE_WINDOW_Y = (1 << 9),
286 	/** The window width */
287 		XCB_EWMH_MOVERESIZE_WINDOW_WIDTH = (1 << 10),
288 	/** The window height */
289 		XCB_EWMH_MOVERESIZE_WINDOW_HEIGHT = (1 << 11)
290 }
291 
292 alias XCB_EWMH_MOVERESIZE_WINDOW_X = xcb_ewmh_moveresize_window_opt_flags_t.XCB_EWMH_MOVERESIZE_WINDOW_HEIGHT;
293 alias XCB_EWMH_MOVERESIZE_WINDOW_Y = xcb_ewmh_moveresize_window_opt_flags_t.XCB_EWMH_MOVERESIZE_WINDOW_WIDTH;
294 alias XCB_EWMH_MOVERESIZE_WINDOW_WIDTH = xcb_ewmh_moveresize_window_opt_flags_t.XCB_EWMH_MOVERESIZE_WINDOW_Y;
295 alias XCB_EWMH_MOVERESIZE_WINDOW_HEIGHT = xcb_ewmh_moveresize_window_opt_flags_t.XCB_EWMH_MOVERESIZE_WINDOW_X;
296 
297 /**
298  * @brief _NET_WM_MOVERESIZE window movement or resizing
299  */
300 enum xcb_ewmh_moveresize_direction_t {
301 	/** Resizing applied on the top left edge */
302 	XCB_EWMH_WM_MOVERESIZE_SIZE_TOPLEFT = 0,
303 	/** Resizing applied on the top edge */
304 		XCB_EWMH_WM_MOVERESIZE_SIZE_TOP = 1,/** Resizing applied on the top right edge */
305 		XCB_EWMH_WM_MOVERESIZE_SIZE_TOPRIGHT = 2,
306 		/** Resizing applied on the right edge */
307 		XCB_EWMH_WM_MOVERESIZE_SIZE_RIGHT = 3,/** Resizing applied on the bottom right edge */
308 		XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMRIGHT = 4,
309 		/** Resizing applied on the bottom edge */
310 		XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOM = 5,/** Resizing applied on the bottom left edge */
311 		XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6,
312 		/** Resizing applied on the left edge */
313 		XCB_EWMH_WM_MOVERESIZE_SIZE_LEFT = 7,/* Movement only */
314 		XCB_EWMH_WM_MOVERESIZE_MOVE = 8,/* Size via keyboard */
315 		XCB_EWMH_WM_MOVERESIZE_SIZE_KEYBOARD = 9,
316 		/* Move via keyboard */
317 		XCB_EWMH_WM_MOVERESIZE_MOVE_KEYBOARD = 10,/* Cancel operation */
318 		XCB_EWMH_WM_MOVERESIZE_CANCEL = 11
319 }
320 
321 alias XCB_EWMH_WM_MOVERESIZE_SIZE_TOPLEFT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_CANCEL;
322 alias XCB_EWMH_WM_MOVERESIZE_SIZE_TOP = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_MOVE_KEYBOARD;
323 alias XCB_EWMH_WM_MOVERESIZE_SIZE_TOPRIGHT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_KEYBOARD;
324 alias XCB_EWMH_WM_MOVERESIZE_SIZE_RIGHT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_MOVE;
325 alias XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMRIGHT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_LEFT;
326 alias XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOM = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
327 alias XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMLEFT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOM;
328 alias XCB_EWMH_WM_MOVERESIZE_SIZE_LEFT = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMRIGHT;
329 alias XCB_EWMH_WM_MOVERESIZE_MOVE = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_RIGHT;
330 alias XCB_EWMH_WM_MOVERESIZE_SIZE_KEYBOARD = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_TOPRIGHT;
331 alias XCB_EWMH_WM_MOVERESIZE_MOVE_KEYBOARD = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_TOP;
332 alias XCB_EWMH_WM_MOVERESIZE_CANCEL = xcb_ewmh_moveresize_direction_t.XCB_EWMH_WM_MOVERESIZE_SIZE_TOPLEFT;
333 
334 /**
335  * @brief Action on the _NET_WM_STATE property
336  */
337 enum xcb_ewmh_wm_state_action_t {
338 	/* Remove/unset property */
339 	XCB_EWMH_WM_STATE_REMOVE = 0,
340 	/* Add/set property */
341 		XCB_EWMH_WM_STATE_ADD = 1,/* Toggle property  */
342 		XCB_EWMH_WM_STATE_TOGGLE = 2
343 }
344 
345 alias XCB_EWMH_WM_STATE_REMOVE = xcb_ewmh_wm_state_action_t.XCB_EWMH_WM_STATE_TOGGLE;
346 alias XCB_EWMH_WM_STATE_ADD = xcb_ewmh_wm_state_action_t.XCB_EWMH_WM_STATE_ADD;
347 alias XCB_EWMH_WM_STATE_TOGGLE = xcb_ewmh_wm_state_action_t.XCB_EWMH_WM_STATE_REMOVE;
348 
349 /**
350  * @brief Hold reply of _NET_WM_STRUT_PARTIAL GetProperty
351  */
352 struct xcb_ewmh_wm_strut_partial_t {
353 	/** Reserved space on the left border of the screen */
354 	uint left;
355 	/** Reserved space on the right border of the screen */
356 	uint right;
357 	/** Reserved space on the top border of the screen */
358 	uint top;
359 	/** Reserved space on the bottom border of the screen */
360 	uint bottom;
361 	/** Beginning y coordinate of the left strut */
362 	uint left_start_y;
363 	/** Ending y coordinate of the left strut */
364 	uint left_end_y;
365 	/** Beginning y coordinate of the right strut */
366 	uint right_start_y;
367 	/** Ending y coordinate of the right strut */
368 	uint right_end_y;
369 	/** Beginning x coordinate of the top strut */
370 	uint top_start_x;
371 	/** Ending x coordinate of the top strut */
372 	uint top_end_x;
373 	/** Beginning x coordinate of the bottom strut */
374 	uint bottom_start_x;
375 	/** Ending x coordinate of the bottom strut */
376 	uint bottom_end_x;
377 }
378 
379 /**
380  * @brief Hold a single icon from reply of _NET_WM_ICON GetProperty
381  */
382 struct xcb_ewmh_wm_icon_iterator_t {
383 	/** Icon width */
384 	uint width;
385 	/** Icon height */
386 	uint height;
387 	/** Rows, left to right and top to bottom of the CARDINAL ARGB */
388 	uint* data;
389 	/** Number of icons remaining */
390 	uint rem;
391 	/** Index of the current icon in the array of icons */
392 	uint index;
393 }
394 
395 /**
396  * @brief Hold reply of _NET_WM_ICON GetProperty
397  */
398 struct xcb_ewmh_get_wm_icon_reply_t {
399 	/** Number of icons */
400 	uint num_icons;
401 	/** The actual GetProperty reply */
402 	xcb_get_property_reply_t* _reply;
403 }
404 
405 /**
406  * @brief Hold reply of _NET_REQUEST_FRAME_EXTENTS GetProperty
407  */
408 struct xcb_ewmh_get_extents_reply_t {
409 	/** Width of the left border */
410 	uint left;
411 	/** Width of the right border */
412 	uint right;
413 	/** Width of the top border */
414 	uint top;
415 	/** Width of the bottom border */
416 	uint bottom;
417 }
418 
419 /**
420  * @brief Hold reply of _NET_WM_FULLSCREEN_MONITORS GetProperty
421  */
422 struct xcb_ewmh_get_wm_fullscreen_monitors_reply_t {
423 	/** Monitor whose top edge defines the top edge of the fullscreen
424       window */
425 	uint top;
426 	/** Monitor whose bottom edge defines the bottom edge of the
427       fullscreen window */
428 	uint bottom;
429 	/** Monitor whose left edge defines the left edge of the fullscreen
430       window */
431 	uint left;
432 	/** Monitor whose right edge defines the right edge of the
433       fullscreen window */
434 	uint right;
435 }
436 
437 /**
438  * @brief Send InternAtom requests for the EWMH atoms and its required atoms
439  *
440  * @param c The connection to the X server
441  * @param ewmh The information relative to EWMH
442  * @param screen_nbr The screen number
443  * @return The cookies corresponding to EWMH atoms
444  */
445 xcb_intern_atom_cookie_t* xcb_ewmh_init_atoms(xcb_connection_t* c, xcb_ewmh_connection_t* ewmh);
446 
447 /**
448  * @brief Process  the replies  to the screen  initialisation requests
449  * previously sent
450  *
451  * @param emwh The information relative to EWMH
452  * @param ewmh_cookies The cookies corresponding to EWMH atoms
453  * @param e Error if any
454  * @return Return 1 on success, 0 otherwise
455  */
456 ubyte xcb_ewmh_init_atoms_replies(xcb_ewmh_connection_t* ewmh, xcb_intern_atom_cookie_t* ewmh_cookies, xcb_generic_error_t** e);
457 
458 pragma(inline, true) static void xcb_ewmh_connection_wipe(xcb_ewmh_connection_t* ewmh) {
459 	import core.stdc.stdlib : free;
460 
461 	free(ewmh.screens);
462 	free(ewmh._NET_WM_CM_Sn);
463 }
464 
465 /**
466  * @brief Send a SendEvent request containing a ClientMessage event
467  *
468  * This  function is  called  by all  the xcb_ewmh_request*  functions
469  * whose should be used instead of calling directly this function
470  *
471  * @param c The X connection
472  * @param window The window where the action will be applied
473  * @param dest The destination window (usually the root window)
474  * @param atom The type of the message
475  * @param data_len The length of data to be sent
476  * @param data The data to be sent
477  * @return The cookie associated with the SendEvent request
478  */
479 xcb_void_cookie_t xcb_ewmh_send_client_message(xcb_connection_t* c, xcb_window_t window, xcb_window_t dest,
480 	xcb_atom_t atom, uint data_len, const uint* data);
481 
482 ubyte xcb_ewmh_get_window_from_reply(xcb_window_t* window, xcb_get_property_reply_t* r);
483 
484 ubyte xcb_ewmh_get_window_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie, xcb_window_t* window,
485 	xcb_generic_error_t** e);
486 
487 ubyte xcb_ewmh_get_cardinal_from_reply(uint* cardinal, xcb_get_property_reply_t* r);
488 
489 ubyte xcb_ewmh_get_cardinal_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie, uint* cardinal, xcb_generic_error_t** e);
490 
491 /**
492  * @brief Get  a list  of atoms from  a given GetProperty  reply whose
493  * type is ATOM
494  *
495  * This  function  is  called  by  all  the  xcb_ewmh_get_*_from_reply
496  * functions  whose should  be used  instead of  calling  it directly.
497  * Indeed,  The GetProperty request  has been  previously sent  by the
498  * corresponding xcb_ewmh_get_*.
499  *
500  * @param atoms The atoms list
501  * @param r The reply to get the atoms list from
502  * @return Return 1 on success, 0 otherwise
503  */
504 ubyte xcb_ewmh_get_atoms_from_reply(xcb_ewmh_get_atoms_reply_t* atoms, xcb_get_property_reply_t* r);
505 
506 /**
507  * @brief Get a list of atoms  from the reply of a GetProperty request
508  * whose type is ATOM
509  *
510  * This function  is called by all  the xcb_ewmh_get_*_reply functions
511  * whose  should   be  used  instead  of  calling   it  directly.  The
512  * GetProperty request  has been previously sent  by the corresponding
513  * xcb_ewmh_get_*.
514  *
515  * @param ewmh The per-screen EWMH specific information
516  * @param cookie The GetProperty cookie
517  * @param atoms The atoms list
518  * @param e The error if any
519  * @return Return 1 on success, 0 otherwise
520  */
521 ubyte xcb_ewmh_get_atoms_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
522 	xcb_ewmh_get_atoms_reply_t* atoms, xcb_generic_error_t** e);
523 
524 /**
525  * @brief Wipe the Atoms list reply
526  *
527  * This function must be called to free the memory allocated for atoms
528  * when the reply is requested in *_reply functions.
529  *
530  * @param data The X reply to be freed
531  */
532 void xcb_ewmh_get_atoms_reply_wipe(xcb_ewmh_get_atoms_reply_t* data);
533 
534 /**
535  * @brief Get  a list  of atoms from  a given GetProperty  reply whose
536  * type is WINDOW
537  *
538  * This  function  is  called  by  all  the  xcb_ewmh_get_*_from_reply
539  * functions  whose should  be used  instead of  calling  it directly.
540  * Indeed,  The GetProperty request  has been  previously sent  by the
541  * corresponding xcb_ewmh_get_*.
542  *
543  * @param atoms The atoms list
544  * @param r The reply to get the atoms list from
545  * @return Return 1 on success, 0 otherwise
546  */
547 ubyte xcb_ewmh_get_windows_from_reply(xcb_ewmh_get_windows_reply_t* atoms, xcb_get_property_reply_t* r);
548 
549 ubyte xcb_ewmh_get_utf8_strings_from_reply(xcb_ewmh_connection_t* ewmh, xcb_ewmh_get_utf8_strings_reply_t* data,
550 	xcb_get_property_reply_t* r);
551 
552 ubyte xcb_ewmh_get_utf8_strings_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
553 	xcb_ewmh_get_utf8_strings_reply_t* data, xcb_generic_error_t** e);
554 
555 /**
556  * @brief Get a list of atoms  from the reply of a GetProperty request
557  * whose type is WINDOW
558  *
559  * This function  is called by all  the xcb_ewmh_get_*_reply functions
560  * whose  should   be  used  instead  of  calling   it  directly.  The
561  * GetProperty request  has been previously sent  by the corresponding
562  * xcb_ewmh_get_*.
563  *
564  * @param ewmh The per-screen EWMH specific information
565  * @param cookie The GetProperty cookie
566  * @param atoms The atoms list
567  * @param e The error if any
568  * @return Return 1 on success, 0 otherwise
569  */
570 ubyte xcb_ewmh_get_windows_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
571 	xcb_ewmh_get_windows_reply_t* atoms, xcb_generic_error_t** e);
572 
573 /**
574  * @brief Wipe the windows list reply
575  *
576  * This function must  be called to the free  the memory allocated for
577  * windows when the reply is requested in '_reply' functions.
578  *
579  * @param data The X reply to be freed
580  */
581 void xcb_ewmh_get_windows_reply_wipe(xcb_ewmh_get_windows_reply_t* data);
582 
583 /**
584  * @brief Wipe the UTF-8 strings list reply
585  *
586  * This function must  be called to the free  the memory allocated for
587  * UTF-8 strings when the reply is requested in '_reply' functions.
588  *
589  * @param data The X reply to be freed
590  */
591 void xcb_ewmh_get_utf8_strings_reply_wipe(xcb_ewmh_get_utf8_strings_reply_t* data);
592 
593 /**
594  * @brief Send a ChangeProperty request for _NET_SUPPORTED
595  *
596  * _NET_SUPPORTED, ATOM[]/32
597  *
598  * @param ewmh The per-screen EWMH information
599  * @param screen_nbr The screen number
600  * @param list_len The number of Atoms supported by the WM
601  * @param list The Atoms supported by the WM
602  * @return Cookie associated with the ChangeProperty _NET_SUPPORTED request
603  */
604 xcb_void_cookie_t xcb_ewmh_set_supported(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_atom_t* list);
605 
606 /**
607  * @see xcb_ewmh_set_supported
608  */
609 xcb_void_cookie_t xcb_ewmh_set_supported_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_atom_t* list);
610 
611 /**
612  * @brief Send  GetProperty request to get  _NET_SUPPORTED root window
613  *        property
614  *
615  * _NET_SUPPORTED, ATOM[]/32
616  *
617  * This property MUST  be set by the Window  Manager to indicate which
618  * hints it supports. For example: considering _NET_WM_STATE both this
619  * atom   and   all   supported  states   e.g.    _NET_WM_STATE_MODAL,
620  * _NET_WM_STATE_STICKY, would be  listed. This assumes that backwards
621  * incompatible changes will  not be made to the  hints (without being
622  * renamed).
623  *
624  * This form can be used only if  the request will cause a reply to be
625  * generated. Any returned error will be placed in the event queue.
626  *
627  * @param ewmh The information relative to EWMH
628  * @param screen_nbr The screen number
629  * @return The _NET_SUPPORTED cookie of the GetProperty request
630  */
631 xcb_get_property_cookie_t xcb_ewmh_get_supported_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
632 
633 /**
634  * @see xcb_ewmh_get_supported_unchecked
635  */
636 xcb_get_property_cookie_t xcb_ewmh_get_supported(xcb_ewmh_connection_t* ewmh, int screen_nbr);
637 
638 /**
639  * @brief Get the list of supported atoms
640  *
641  * @param supported The list of atoms contained in the reply
642  * @param r GetProperty _NET_SUPPORTED reply
643  */
644 pragma(inline, true) static ubyte xcb_ewmh_get_supported_from_reply(xcb_ewmh_get_atoms_reply_t* supported, xcb_get_property_reply_t* r) {
645 	return xcb_ewmh_get_atoms_from_reply(supported, r);
646 }
647 
648 /**
649  * @brief Get reply from the GetProperty _NET_SUPPORTED cookie
650  *
651  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
652  * xcb_get_window_supported_unchecked() is used.  Otherwise, it stores
653  * the error if any.
654  *
655  * @param ewmh The information relative to EWMH
656  * @param cookie The _NET_SUPPORTED GetProperty request cookie
657  * @param supported The reply to be filled
658  * @param The xcb_generic_error_t supplied
659  * @return Return 1 on success, 0 otherwise
660  */
661 pragma(inline, true) static ubyte xcb_ewmh_get_supported_reply(xcb_ewmh_connection_t* ewmh,
662 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_atoms_reply_t* supported, xcb_generic_error_t** e) {
663 	return xcb_ewmh_get_atoms_reply(ewmh, cookie, supported, e);
664 }
665 
666 /**
667  * @brief Send a ChangeProperty request for _NET_CLIENT_LIST
668  *
669  * _NET_CLIENT_LIST, WINDOW[]/32
670  *
671  * @param ewmh The per-screen EWMH information
672  * @param screen_nbr The screen number
673  * @param list_len The number of Atoms supported by the WM
674  * @param list The Atoms supported by the WM
675  * @return Cookie associated with the ChangeProperty _NET_CLIENT_LIST request
676  */
677 xcb_void_cookie_t xcb_ewmh_set_client_list(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
678 
679 /**
680  * @see xcb_ewmh_set_client_list
681  */
682 xcb_void_cookie_t xcb_ewmh_set_client_list_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
683 
684 /**
685  * @brief Send GetProperty request to get _NET_CLIENT_LIST root window
686  *        property
687  *
688  * This  array   contains  all  X   Windows  managed  by   the  Window
689  * Manager. _NET_CLIENT_LIST has  initial mapping order, starting with
690  * the oldest window.  This property SHOULD be set  and updated by the
691  * Window Manager.
692  *
693  * @param ewmh The information relative to EWMH.
694  * @return The _NET_CLIENT_LIST cookie of the GetProperty request.
695  */
696 xcb_get_property_cookie_t xcb_ewmh_get_client_list_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
697 
698 /**
699  * @brief Send GetProperty request to get _NET_CLIENT_LIST root window
700  *        property
701  *
702  * @see xcb_ewmh_get_client_list_unchecked
703  * @param ewmh The information relative to EWMH.
704  * @return The _NET_CLIENT_LIST cookie of the GetProperty request.
705  */
706 xcb_get_property_cookie_t xcb_ewmh_get_client_list(xcb_ewmh_connection_t* ewmh, int screen_nbr);
707 
708 /**
709  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
710  * _NET_CLIENT_LIST reply
711  *
712  * @param clients The list of clients contained in the reply
713  * @param r GetProperty _NET_CLIENT_LIST reply
714  */
715 pragma(inline, true) static ubyte xcb_ewmh_get_client_list_from_reply(xcb_ewmh_get_windows_reply_t* clients, xcb_get_property_reply_t* r) {
716 	return xcb_ewmh_get_windows_from_reply(clients, r);
717 }
718 
719 /**
720  * @brief Get reply from the GetProperty _NET_CLIENT_LIST cookie
721  *
722  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
723  * xcb_get_window_client_list_unchecked()  is   used.   Otherwise,  it
724  * stores the error if any.
725  *
726  * @param ewmh The information relative to EWMH
727  * @param cookie The _NET_CLIENT_LIST GetProperty request cookie
728  * @param clients The list of clients to be filled
729  * @param The xcb_generic_error_t supplied
730  * @return Return 1 on success, 0 otherwise
731  */
732 pragma(inline, true) static ubyte xcb_ewmh_get_client_list_reply(xcb_ewmh_connection_t* ewmh,
733 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_windows_reply_t* clients, xcb_generic_error_t** e) {
734 	return xcb_ewmh_get_windows_reply(ewmh, cookie, clients, e);
735 }
736 
737 /**
738  * @brief Send a ChangeProperty request for _NET_CLIENT_LIST_STACKING
739  *
740  * _NET_CLIENT_LIST_STACKING, WINDOW[]/32
741  *
742  * @param ewmh The per-screen EWMH information
743  * @param screen_nbr The screen number
744  * @param list_len The number of Atoms supported by the WM
745  * @param list The Atoms supported by the WM
746  * @return Cookie associated with the ChangeProperty _NET_CLIENT_LIST_STACKING request
747  */
748 xcb_void_cookie_t xcb_ewmh_set_client_list_stacking(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
749 
750 /**
751  * @see xcb_ewmh_set_client_list_stacking
752  */
753 xcb_void_cookie_t xcb_ewmh_set_client_list_stacking_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
754 
755 /**
756  * @brief  Send GetProperty  request to  get _NET_CLIENT_LIST_STACKING
757  *        root window property
758  *
759  * This  array   contains  all  X   Windows  managed  by   the  Window
760  * Manager.  _NET_CLIENT_LIST_STACKING   has  initial  mapping  order,
761  * starting with the  oldest window.  This property SHOULD  be set and
762  * updated by the Window Manager.
763  *
764  * @param ewmh The information relative to EWMH
765  * @return The _NET_CLIENT_LIST_STACKING cookie of the GetProperty request
766  */
767 xcb_get_property_cookie_t xcb_ewmh_get_client_list_stacking_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
768 
769 /**
770  * @see xcb_ewmh_get_client_list_unchecked
771  */
772 xcb_get_property_cookie_t xcb_ewmh_get_client_list_stacking(xcb_ewmh_connection_t* ewmh, int screen_nbr);
773 
774 /**
775  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
776  * _NET_CLIENT_LIST_STACKING reply
777  *
778  * @param clients The list of clients contained in the reply
779  * @param r GetProperty _NET_CLIENT_LIST_STACKING reply
780  */
781 pragma(inline, true) static ubyte xcb_ewmh_get_client_list_stacking_from_reply(xcb_ewmh_get_windows_reply_t* clients,
782 	xcb_get_property_reply_t* r) {
783 	return xcb_ewmh_get_windows_from_reply(clients, r);
784 }
785 
786 /**
787  * @brief  Get reply  from  the GetProperty  _NET_CLIENT_LIST_STACKING
788  * cookie
789  *
790  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
791  * xcb_get_window_client_list_stacking_unchecked()       is      used.
792  * Otherwise, it stores the error if any.
793  *
794  * @param ewmh The information relative to EWMH
795  * @param cookie The _NET_CLIENT_LIST_STACKING GetProperty request cookie
796  * @param clients The list of clients to be filled
797  * @param The xcb_generic_error_t supplied
798  * @return Return 1 on success, 0 otherwise
799  */
800 pragma(inline, true) static ubyte xcb_ewmh_get_client_list_stacking_reply(xcb_ewmh_connection_t* ewmh,
801 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_windows_reply_t* clients, xcb_generic_error_t** e) {
802 	return xcb_ewmh_get_windows_reply(ewmh, cookie, clients, e);
803 }
804 
805 /**
806  * @brief Send a ChangeProperty request for _NET_NUMBER_OF_DESKTOPS
807  *
808  * _NET_NUMBER_OF_DESKTOPS? CARDINAL/32
809  *
810  * @param ewmh The per-screen EWMH information
811  * @param screen_nbr The screen number
812  * @param number_of_desktops The number of desktops
813  * @return Cookie associated with the ChangeProperty _NET_NUMBER_OF_DESKTOPS request
814  */
815 xcb_void_cookie_t xcb_ewmh_set_number_of_desktops(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint number_of_desktops);
816 
817 /**
818  * @see xcb_ewmh_set_number_of_desktops
819  */
820 xcb_void_cookie_t xcb_ewmh_set_number_of_desktops_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint number_of_desktops);
821 
822 /**
823  * @brief Send GetProperty request to get _NET_NUMBER_OF_DESKTOPS root
824  *        window property
825  *
826  * @param ewmh The information relative to EWMH
827  * @param screen_nbr The screen number
828  * @return The _NET_NUMBER_OF_DESKTOPS cookie of the GetProperty request.
829  */
830 xcb_get_property_cookie_t xcb_ewmh_get_number_of_desktops_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
831 
832 /**
833  * @see xcb_ewmh_get_number_of_desktops_unchecked
834  */
835 xcb_get_property_cookie_t xcb_ewmh_get_number_of_desktops(xcb_ewmh_connection_t* ewmh, int screen_nbr);
836 
837 /**
838  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
839  * _NET_NUMBER_OF_DESKTOPS reply
840  *
841  * @param clients The list of clients contained in the reply
842  * @param r GetProperty _NET_NUMBER_OF_DESKTOPS reply
843  * @return Return 1 on success, 0 otherwise
844  */
845 pragma(inline, true) static ubyte xcb_ewmh_get_number_of_desktops_from_reply(uint* number_of_desktops, xcb_get_property_reply_t* r) {
846 	return xcb_ewmh_get_cardinal_from_reply(number_of_desktops, r);
847 }
848 
849 /**
850  * @brief Get reply from the GetProperty _NET_NUMBER_OF_DESKTOPS cookie
851  *
852  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
853  * xcb_get_window_number_of_desktops_unchecked()  is used.  Otherwise,
854  * it stores the error if any.
855  *
856  * @param ewmh The information relative to EWMH
857  * @param cookie The _NET_NUMBER_OF_DESKTOPS GetProperty request cookie
858  * @param supported The reply to be filled
859  * @param The xcb_generic_error_t supplied
860  * @return Return 1 on success, 0 otherwise
861  */
862 pragma(inline, true) static ubyte xcb_ewmh_get_number_of_desktops_reply(xcb_ewmh_connection_t* ewmh,
863 	xcb_get_property_cookie_t cookie, uint* number_of_desktops, xcb_generic_error_t** e) {
864 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, number_of_desktops, e);
865 }
866 
867 pragma(inline, true) static xcb_void_cookie_t xcb_ewmh_request_change_number_of_desktops(xcb_ewmh_connection_t* ewmh,
868 	int screen_nbr, uint new_number_of_desktops) {
869 	return xcb_ewmh_send_client_message(ewmh.connection, XCB_NONE, ewmh.screens[screen_nbr].root,
870 		ewmh._NET_NUMBER_OF_DESKTOPS, new_number_of_desktops.sizeof, &new_number_of_desktops);
871 }
872 
873 /**
874  * @brief Send a ChangeProperty request for _NET_DESKTOP_GEOMETRY
875  *
876  * _NET_DESKTOP_GEOMETRY width, height, CARDINAL[2]/32
877  *
878  * @param ewmh The per-screen EWMH information
879  * @param screen_nbr The screen number
880  * @param new_width The new desktop width
881  * @param new_height The new desktop height
882  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_GEOMETRY request
883  */
884 xcb_void_cookie_t xcb_ewmh_set_desktop_geometry(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_width, uint new_height);
885 
886 /**
887  * @see xcb_ewmh_set_desktop_geometry
888  */
889 xcb_void_cookie_t xcb_ewmh_set_desktop_geometry_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_width, uint new_height);
890 
891 /**
892  * @brief Send  GetProperty request to  get _NET_DESKTOP_GEOMETRY root
893  *        window property
894  *
895  * @param ewmh The information relative to EWMH
896  * @param screen_nbr The screen number
897  * @return The _NET_DESKTOP_GEOMETRY cookie of the GetProperty request
898  */
899 xcb_get_property_cookie_t xcb_ewmh_get_desktop_geometry_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
900 
901 /**
902  * @see xcb_ewmh_get_desktop_geometry_unchecked
903  */
904 xcb_get_property_cookie_t xcb_ewmh_get_desktop_geometry(xcb_ewmh_connection_t* ewmh, int screen_nbr);
905 
906 /**
907  * @brief Send ClientMessage requesting to change the _NET_DESKTOP_GEOMETRY
908  *
909  * @param ewmh The per-screen EWMH information
910  * @param screen_nbr The screen number
911  * @param new_width The new desktop width
912  * @param new_height The new desktop height
913  * @return The SendEvent cookie
914  */
915 xcb_void_cookie_t xcb_ewmh_request_change_desktop_geometry(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_width, uint new_height);
916 
917 /**
918  * @brief    Get   the   desktop    geometry   from    a   GetProperty
919  * _NET_DESKTOP_GEOMETRY reply
920  *
921  * @param width The current desktop width
922  * @param height The current desktop height
923  * @param r GetProperty _NET_DESKTOP_GEOMETRY reply
924  * @return Return 1 on success, 0 otherwise
925  */
926 ubyte xcb_ewmh_get_desktop_geometry_from_reply(uint* width, uint* height, xcb_get_property_reply_t* r);
927 
928 /**
929  * @brief Get reply from the GetProperty _NET_DESKTOP_GEOMETRY cookie
930  *
931  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
932  * xcb_get_desktop_geometry_unchecked() is used.  Otherwise, it stores
933  * the error if any.
934  *
935  * @param ewmh The information relative to EWMH
936  * @param cookie The _NET_DESKTOP_GEOMETRY GetProperty request cookie
937  * @param width The current desktop width
938  * @param width The current desktop height
939  * @param The xcb_generic_error_t supplied
940  * @return Return 1 on success, 0 otherwise
941  */
942 ubyte xcb_ewmh_get_desktop_geometry_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie, uint* width,
943 	uint* height, xcb_generic_error_t** e);
944 
945 /**
946  * @brief Send a ChangeProperty request for _NET_DESKTOP_VIEWPORT
947  *
948  * _NET_DESKTOP_VIEWPORT x, y, CARDINAL[][2]/32
949  *
950  * @param ewmh The per-screen EWMH information
951  * @param screen_nbr The screen number
952  * @param list_len The number of desktop viewports
953  * @param list The desktop viewports
954  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_VIEWPORT request
955  */
956 xcb_void_cookie_t xcb_ewmh_set_desktop_viewport(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_ewmh_coordinates_t* list);
957 
958 /**
959  * @see xcb_ewmh_set_desktop_viewport
960  */
961 xcb_void_cookie_t xcb_ewmh_set_desktop_viewport_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len,
962 	xcb_ewmh_coordinates_t* list);
963 
964 /**
965  * @brief Send  GetProperty request to  get _NET_DESKTOP_VIEWPORT root
966  *        window property
967  *
968  * @param ewmh The information relative to EWMH
969  * @param screen_nbr The screen number
970  * @return The _NET_DESKTOP_VIEWPORT cookie of the GetProperty request
971  */
972 xcb_get_property_cookie_t xcb_ewmh_get_desktop_viewport_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
973 
974 /**
975  * @see xcb_ewmh_get_desktop_viewport_unchecked
976  */
977 xcb_get_property_cookie_t xcb_ewmh_get_desktop_viewport(xcb_ewmh_connection_t* ewmh, int screen_nbr);
978 
979 /**
980  * @brief Send ClientMessage requesting to change the _NET_DESKTOP_VIEWPORT
981  *
982  * @param ewmh The per-screen EWMH information
983  * @param screen_nbr The screen number
984  * @param new_x The new x coordinate
985  * @param new_y The new y coordinate
986  * @return The SendEvent cookie
987  */
988 xcb_void_cookie_t xcb_ewmh_request_change_desktop_viewport(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint x, uint y);
989 
990 /**
991  * @brief    Get   the   desktop    geometry   from    a   GetProperty
992  * _NET_DESKTOP_VIEWPORT reply
993  *
994  * @param vp The  current desktop viewports
995  * @param r GetProperty _NET_DESKTOP_VIEWPORT reply
996  * @return Return 1 on success, 0 otherwise
997  */
998 ubyte xcb_ewmh_get_desktop_viewport_from_reply(xcb_ewmh_get_desktop_viewport_reply_t* vp, xcb_get_property_reply_t* r);
999 
1000 /**
1001  * @brief Get reply from the GetProperty _NET_DESKTOP_VIEWPORT cookie
1002  *
1003  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1004  * xcb_get_desktop_viewport_unchecked() is used.  Otherwise, it stores
1005  * the error if any.
1006  *
1007  * @param ewmh The information relative to EWMH
1008  * @param cookie The _NET_DESKTOP_VIEWPORT GetProperty request cookie
1009  * @param vp The current desktop viewports
1010  * @param The xcb_generic_error_t supplied
1011  * @return Return 1 on success, 0 otherwise
1012  */
1013 ubyte xcb_ewmh_get_desktop_viewport_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1014 	xcb_ewmh_get_desktop_viewport_reply_t* vp, xcb_generic_error_t** e);
1015 
1016 /**
1017  * @brief Wipe the desktop viewports list reply
1018  *
1019  * This function must be called to free the memory allocated for atoms
1020  * when the reply  is requested in xcb_ewmh_get_desktop_viewport_reply
1021  * function.
1022  *
1023  * @param r The X reply to be freed
1024  */
1025 void xcb_ewmh_get_desktop_viewport_reply_wipe(xcb_ewmh_get_desktop_viewport_reply_t* r);
1026 
1027 /**
1028  * @brief Send a ChangeProperty request for _NET_CURRENT_DESKTOP
1029  *
1030  * _NET_CURRENT_DESKTOP desktop, CARDINAL/32
1031  *
1032  * @param ewmh The per-screen EWMH information
1033  * @param screen_nbr The screen number
1034  * @param new_current_desktop The new current desktop
1035  * @return Cookie associated with the ChangeProperty _NET_CURRENT_DESKTOP request
1036  */
1037 xcb_void_cookie_t xcb_ewmh_set_current_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_current_desktop);
1038 
1039 /**
1040  * @see xcb_ewmh_set_current_desktop
1041  */
1042 xcb_void_cookie_t xcb_ewmh_set_current_desktop_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_current_desktop);
1043 
1044 /**
1045  * @brief  Send GetProperty request  to get  _NET_CURRENT_DESKTOP root
1046  *        window property
1047  *
1048  * @param ewmh The information relative to EWMH
1049  * @param screen_nbr The screen number
1050  * @return The _NET_CURRENT_DESKTOP cookie of the GetProperty request
1051  */
1052 xcb_get_property_cookie_t xcb_ewmh_get_current_desktop_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1053 
1054 /**
1055  * @see xcb_ewmh_get_current_desktop_unchecked
1056  */
1057 xcb_get_property_cookie_t xcb_ewmh_get_current_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1058 
1059 /**
1060  * @brief Send ClientMessage requesting to change the _NET_CURRENT_DESKTOP
1061  *
1062  * @param ewmh The per-screen EWMH information
1063  * @param screen_nbr The screen number
1064  * @param new_desktop The new current desktop
1065  * @param timestamp The request timestamp
1066  * @return The SendEvent cookie
1067  */
1068 xcb_void_cookie_t xcb_ewmh_request_change_current_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint new_desktop,
1069 	xcb_timestamp_t timestamp);
1070 
1071 /**
1072  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1073  * _NET_CURRENT_DESKTOP reply
1074  *
1075  * @param current_desktop The  current desktop
1076  * @param r GetProperty _NET_CURRENT_DESKTOP reply
1077  * @return Return 1 on success, 0 otherwise
1078  */
1079 pragma(inline, true) static ubyte xcb_ewmh_get_current_desktop_from_reply(uint* current_desktop, xcb_get_property_reply_t* r) {
1080 	return xcb_ewmh_get_cardinal_from_reply(current_desktop, r);
1081 }
1082 
1083 /**
1084  * @brief Get reply from the GetProperty _NET_CURRENT_DESKTOP cookie
1085  *
1086  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1087  * xcb_get_current_desktop_unchecked() is  used.  Otherwise, it stores
1088  * the error if any.
1089  *
1090  * @param ewmh The information relative to EWMH
1091  * @param cookie The _NET_CURRENT_DESKTOP GetProperty request cookie
1092  * @param vp The current desktop
1093  * @param The xcb_generic_error_t supplied
1094  * @return Return 1 on success, 0 otherwise
1095  */
1096 pragma(inline, true) static ubyte xcb_ewmh_get_current_desktop_reply(xcb_ewmh_connection_t* ewmh,
1097 	xcb_get_property_cookie_t cookie, uint* current_desktop, xcb_generic_error_t** e) {
1098 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, current_desktop, e);
1099 }
1100 
1101 /**
1102  * @brief Send a ChangeProperty request for _NET_DESKTOP_NAMES
1103  *
1104  * _NET_DESKTOP_NAMES, UTF8_STRING[]
1105  *
1106  * @param ewmh The per-screen EWMH information
1107  * @param screen_nbr The screen number
1108  * @param strings_len The number of desktop names
1109  * @param strings The desktop names
1110  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_NAMES request
1111  */
1112 xcb_void_cookie_t xcb_ewmh_set_desktop_names(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint strings_len, const char* strings);
1113 
1114 /**
1115  * @see xcb_ewmh_set_desktop_names
1116  */
1117 xcb_void_cookie_t xcb_ewmh_set_desktop_names_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint strings_len, const char* strings);
1118 
1119 /**
1120  * @brief  Send  GetProperty request  to  get _NET_DESKTOP_NAMES  root
1121  *        window property
1122  *
1123  * @param ewmh The information relative to EWMH
1124  * @return The _NET_DESKTOP_NAMES cookie of the GetProperty request
1125  */
1126 xcb_get_property_cookie_t xcb_ewmh_get_desktop_names_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1127 
1128 /**
1129  * @see xcb_ewmh_get_desktop_names_unchecked
1130  */
1131 xcb_get_property_cookie_t xcb_ewmh_get_desktop_names(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1132 
1133 /**
1134  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1135  * _NET_DESKTOP_NAMES reply
1136  *
1137  * @param ewmh The information relative to EWMH
1138  * @param names The desktop names
1139  * @param r GetProperty _NET_DESKTOP_NAMES reply
1140  * @return Return 1 on success, 0 otherwise
1141  */
1142 pragma(inline, true) static ubyte xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t* ewmh,
1143 	xcb_ewmh_get_utf8_strings_reply_t* names, xcb_get_property_reply_t* r) {
1144 	return xcb_ewmh_get_utf8_strings_from_reply(ewmh, names, r);
1145 }
1146 
1147 /**
1148  * @brief Get reply from the GetProperty _NET_DESKTOP_NAMES cookie
1149  *
1150  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1151  * xcb_get_desktop_names_unchecked()  is used.   Otherwise,  it stores
1152  * the error if any.
1153  *
1154  * @param ewmh The information relative to EWMH
1155  * @param cookie The _NET_DESKTOP_NAMES GetProperty request cookie
1156  * @param names The desktop names
1157  * @param The xcb_generic_error_t supplied
1158  * @return Return 1 on success, 0 otherwise
1159  */
1160 pragma(inline, true) static ubyte xcb_ewmh_get_desktop_names_reply(xcb_ewmh_connection_t* ewmh,
1161 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t* names, xcb_generic_error_t** e) {
1162 	return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, names, e);
1163 }
1164 
1165 /**
1166  * @brief Send a ChangeProperty request for _NET_ACTIVE_WINDOW
1167  *
1168  * _NET_ACTIVE_WINDOW, WINDOW/32
1169  *
1170  * @param ewmh The per-screen EWMH information
1171  * @param screen_nbr The screen number
1172  * @param new_active_window The window to make active
1173  * @return Cookie associated with the ChangeProperty _NET_ACTIVE_WINDOW request
1174  */
1175 xcb_void_cookie_t xcb_ewmh_set_active_window(xcb_ewmh_connection_t* ewmh, int screen_nbr, xcb_window_t new_active_window);
1176 
1177 /**
1178  * @see xcb_ewmh_set_active_window
1179  */
1180 xcb_void_cookie_t xcb_ewmh_set_active_window_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, xcb_window_t new_active_window);
1181 
1182 /**
1183  * @brief Send ClientMessage requesting to change the _NET_ACTIVE_WINDOW
1184  *
1185  * The window ID  of the currently active window or  None if no window
1186  * has  the focus.  This  is a  read-only property  set by  the Window
1187  * Manager. If a Client wants to activate another window, it MUST send
1188  * a  _NET_ACTIVE_WINDOW  client  message  to  the  root  window.  The
1189  * timestamp is Client's  last user activity timestamp at  the time of
1190  * the request, and the currently active window is the Client's active
1191  * toplevel window, if any (the Window Manager may be e.g. more likely
1192  * to obey  the request  if it will  mean transferring focus  from one
1193  * active window to another).
1194  *
1195  * @see xcb_ewmh_client_source_type_t
1196  * @param ewmh The information relative to EWMH
1197  * @param screen_nbr The screen number
1198  * @param window_to_active The window ID to activate
1199  * @param source_indication The source indication
1200  * @param timestamp The client's last user activity timestamp
1201  * @param current_active_window The currently active window or None
1202  */
1203 xcb_void_cookie_t xcb_ewmh_request_change_active_window(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1204 	xcb_window_t window_to_activate, xcb_ewmh_client_source_type_t source_indication, xcb_timestamp_t timestamp,
1205 	xcb_window_t current_active_window);
1206 
1207 /**
1208  * @brief  Send  GetProperty request  to  get _NET_ACTIVE_WINDOW  root
1209  *        window property
1210  *
1211  * The window ID  of the currently active window or  None if no window
1212  * has  the focus.  This is  a read-only  property set  by  the Window
1213  * Manager.  This property  SHOULD be  set and  updated by  the Window
1214  * Manager.
1215  *
1216  * This form can be used only if  the request will cause a reply to be
1217  * generated. Any returned error will be placed in the event queue.
1218  *
1219  * @param ewmh The information relative to EWMH
1220  * @param screen_nbr The screen number
1221  * @return The _NET_ACTIVE_WINDOW cookie of the GetProperty request
1222  */
1223 xcb_get_property_cookie_t xcb_ewmh_get_active_window_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1224 
1225 /**
1226  * @brief  Send  GetProperty request  to  get _NET_ACTIVE_WINDOW  root
1227  *        window property
1228  *
1229  * @see xcb_ewmh_get_active_window_unchecked
1230  * @param ewmh The information relative to EWMH
1231  * @param screen_nbr The screen number
1232  * @return The _NET_ACTIVE_WINDOW cookie of the GetProperty request
1233  */
1234 xcb_get_property_cookie_t xcb_ewmh_get_active_window(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1235 
1236 /**
1237  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
1238  * _NET_ACTIVE_WINDOW reply
1239  *
1240  * @param active_window The current active window
1241  * @param r GetProperty _NET_ACTIVE_WINDOW_OF_DESKTOPS reply
1242  * @return Return 1 on success, 0 otherwise
1243  */
1244 pragma(inline, true) static ubyte xcb_ewmh_get_active_window_from_reply(xcb_window_t* active_window, xcb_get_property_reply_t* r) {
1245 	return xcb_ewmh_get_window_from_reply(active_window, r);
1246 }
1247 
1248 /**
1249  * @brief Get reply from the GetProperty _NET_ACTIVE_WINDOW cookie
1250  *
1251  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1252  * xcb_get_active_window_unchecked()  is used.   Otherwise,  it stores
1253  * the error if any.
1254  *
1255  * @param ewmh The information relative to EWMH.
1256  * @param cookie The _NET_ACTIVE_WINDOW GetProperty request cookie.
1257  * @param active_window The reply to be filled.
1258  * @param The xcb_generic_error_t supplied.
1259  * @return Return 1 on success, 0 otherwise.
1260  */
1261 pragma(inline, true) static ubyte xcb_ewmh_get_active_window_reply(xcb_ewmh_connection_t* ewmh,
1262 	xcb_get_property_cookie_t cookie, xcb_window_t* active_window, xcb_generic_error_t** e) {
1263 	return xcb_ewmh_get_window_reply(ewmh, cookie, active_window, e);
1264 }
1265 
1266 /**
1267  * @brief Send a ChangeProperty request for _NET_WORKAREA
1268  *
1269  * _NET_WORKAREA, x, y, width, height CARDINAL[][4]/32
1270  *
1271  * @param ewmh The per-screen EWMH information
1272  * @param screen_nbr The screen number
1273  * @param list_len The number of desktops workareas
1274  * @param list The desktops workareas
1275  * @return Cookie associated with the ChangeProperty _NET_WORKAREA request
1276  */
1277 xcb_void_cookie_t xcb_ewmh_set_workarea(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_ewmh_geometry_t* list);
1278 
1279 /**
1280  * @see xcb_ewmh_set_workarea
1281  */
1282 xcb_void_cookie_t xcb_ewmh_set_workarea_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_ewmh_geometry_t* list);
1283 
1284 /**
1285  * @brief  Send  GetProperty request  to  get _NET_WORKAREA  root
1286  *        window property
1287  *
1288  * @param ewmh The information relative to EWMH
1289  * @param screen_nbr The screen number
1290  * @return The _NET_WORKAREA cookie of the GetProperty request
1291  */
1292 xcb_get_property_cookie_t xcb_ewmh_get_workarea_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1293 
1294 /**
1295  * @see xcb_ewmh_get_virtual_roots_unchecked
1296  */
1297 xcb_get_property_cookie_t xcb_ewmh_get_workarea(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1298 
1299 /**
1300  * @brief Get  the desktop  geometry from a  GetProperty _NET_WORKAREA
1301  * reply
1302  *
1303  * @param wa The  current workarea
1304  * @param r GetProperty _NET_WORKAREA reply
1305  * @return Return 1 on success, 0 otherwise
1306  */
1307 ubyte xcb_ewmh_get_workarea_from_reply(xcb_ewmh_get_workarea_reply_t* wa, xcb_get_property_reply_t* r);
1308 
1309 /**
1310  * @brief Get reply from the GetProperty _NET_WORKAREA cookie
1311  *
1312  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1313  * xcb_get_workarea_unchecked()  is used.   Otherwise,  it stores  the
1314  * error if any.
1315  *
1316  * @param ewmh The information relative to EWMH
1317  * @param cookie The _NET_WORKAREA GetProperty request cookie
1318  * @param wa The current workareas of desktops
1319  * @param The xcb_generic_error_t supplied
1320  * @return Return 1 on success, 0 otherwise
1321  */
1322 ubyte xcb_ewmh_get_workarea_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1323 	xcb_ewmh_get_workarea_reply_t* wa, xcb_generic_error_t** e);
1324 
1325 /**
1326  * @brief Wipe the workarea list reply
1327  *
1328  * This function must be called to free the memory allocated for atoms
1329  * when   the  reply   is  requested   in  xcb_ewmh_get_workarea_reply
1330  * function.
1331  *
1332  * @param r The X reply to be freed
1333  */
1334 void xcb_ewmh_get_workarea_reply_wipe(xcb_ewmh_get_workarea_reply_t* r);
1335 
1336 /**
1337  * @brief Send a ChangeProperty request for _NET_SUPPORTING_WM_CHECK
1338  *
1339  * _NET_SUPPORTING_WM_CHECK, WINDOW/32
1340  *
1341  * @param ewmh The per-screen EWMH information
1342  * @param parent_window The root window or child window created by the WM
1343  * @param child_window The child window created by the WM
1344  * @return Cookie associated with the ChangeProperty _NET_SUPPORTING_WM_CHECK request
1345  */
1346 xcb_void_cookie_t xcb_ewmh_set_supporting_wm_check(xcb_ewmh_connection_t* ewmh, xcb_window_t parent_window, xcb_window_t child_window);
1347 
1348 /**
1349  * @see xcb_ewmh_set_supporting_wm_check
1350  */
1351 xcb_void_cookie_t xcb_ewmh_set_supporting_wm_check_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t parent_window,
1352 	xcb_window_t child_window);
1353 
1354 /**
1355  * @brief  Send GetProperty  request  to get  _NET_SUPPORTING_WM_CHECK
1356  *        root window property
1357  *
1358  * @param ewmh The information relative to EWMH
1359  * @param screen_nbr The screen number
1360  * @return The _NET_SUPPORTING_WM_CHECK cookie of the GetProperty request
1361  */
1362 xcb_get_property_cookie_t xcb_ewmh_get_supporting_wm_check_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1363 
1364 /**
1365  * @see xcb_ewmh_get_supporting_wm_check_unchecked
1366  */
1367 xcb_get_property_cookie_t xcb_ewmh_get_supporting_wm_check(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1368 
1369 /**
1370  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
1371  * _NET_SUPPORTING_WM_CHECK reply
1372  *
1373  * @param window The child window created by the WM
1374  * @param r GetProperty _NET_SUPPORTING_WM_CHECK reply
1375  * @return Return 1 on success, 0 otherwise
1376  */
1377 pragma(inline, true) static ubyte xcb_ewmh_get_supporting_wm_check_from_reply(xcb_window_t* window, xcb_get_property_reply_t* r) {
1378 	return xcb_ewmh_get_window_from_reply(window, r);
1379 }
1380 
1381 /**
1382  * @brief  Get  reply  from the  GetProperty  _NET_SUPPORTING_WM_CHECK
1383  * cookie
1384  *
1385  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1386  * xcb_get_supporting_wm_check_unchecked()  is  used.   Otherwise,  it
1387  * stores the error if any.
1388  *
1389  * @param ewmh The information relative to EWMH
1390  * @param cookie The _NET_SUPPORTING_WM_CHECK GetProperty request cookie
1391  * @param window The reply to be filled
1392  * @param The xcb_generic_error_t supplied
1393  * @return Return 1 on success, 0 otherwise
1394  */
1395 pragma(inline, true) static ubyte xcb_ewmh_get_supporting_wm_check_reply(xcb_ewmh_connection_t* ewmh,
1396 	xcb_get_property_cookie_t cookie, xcb_window_t* window, xcb_generic_error_t** e) {
1397 	return xcb_ewmh_get_window_reply(ewmh, cookie, window, e);
1398 }
1399 
1400 /**
1401  * @brief Send a ChangeProperty request for _NET_VIRTUAL_ROOTS
1402  *
1403  * _NET_VIRTUAL_ROOTS, WINDOW[]/32
1404  *
1405  * @param ewmh The per-screen EWMH information
1406  * @param screen_nbr The screen number
1407  * @param list_len The number of virtual root windows
1408  * @param list The virtual root windows
1409  * @return Cookie associated with the ChangeProperty _NET_VIRTUAL_ROOTS request
1410  */
1411 xcb_void_cookie_t xcb_ewmh_set_virtual_roots(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
1412 
1413 /**
1414  * @see xcb_ewmh_set_virtual_roots
1415  */
1416 xcb_void_cookie_t xcb_ewmh_set_virtual_roots_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint list_len, xcb_window_t* list);
1417 
1418 /**
1419  * @brief  Send  GetProperty request  to  get _NET_VIRTUAL_ROOTS  root
1420  *        window property
1421  *
1422  * @param ewmh The information relative to EWMH
1423  * @param screen_nbr The screen number
1424  * @return The _NET_VIRTUAL_ROOTS cookie of the GetProperty request
1425  */
1426 xcb_get_property_cookie_t xcb_ewmh_get_virtual_roots_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1427 
1428 /**
1429  * @see xcb_ewmh_get_virtual_roots_unchecked
1430  */
1431 xcb_get_property_cookie_t xcb_ewmh_get_virtual_roots(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1432 
1433 /**
1434  * @brief Get  the desktop  geometry from a  GetProperty _NET_WORKAREA
1435  * reply
1436  *
1437  * @param virtual_roots The current virtual root windows
1438  * @param r GetProperty _NET_VIRTUAL_ROOTS reply
1439  * @return Return 1 on success, 0 otherwise
1440  */
1441 pragma(inline, true) static ubyte xcb_ewmh_get_virtual_roots_from_reply(xcb_ewmh_get_windows_reply_t* virtual_roots,
1442 	xcb_get_property_reply_t* r) {
1443 	return xcb_ewmh_get_windows_from_reply(virtual_roots, r);
1444 }
1445 
1446 /**
1447  * @brief Get reply from the GetProperty _NET_VIRTUAL_ROOTS cookie
1448  *
1449  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1450  * xcb_get_virtual_roots_unchecked()  is used.   Otherwise,  it stores
1451  * the error if any.
1452  *
1453  * @param ewmh The information relative to EWMH
1454  * @param cookie The _NET_VIRTUAL_ROOTS GetProperty request cookie
1455  * @param virtual_roots The current virtual root windows
1456  * @param The xcb_generic_error_t supplied
1457  * @return Return 1 on success, 0 otherwise
1458  */
1459 pragma(inline, true) static ubyte xcb_ewmh_get_virtual_roots_reply(xcb_ewmh_connection_t* ewmh,
1460 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_windows_reply_t* virtual_roots, xcb_generic_error_t** e) {
1461 	return xcb_ewmh_get_windows_reply(ewmh, cookie, virtual_roots, e);
1462 }
1463 
1464 xcb_void_cookie_t xcb_ewmh_set_desktop_layout(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1465 	xcb_ewmh_desktop_layout_orientation_t orientation, uint columns, uint rows, xcb_ewmh_desktop_layout_starting_corner_t starting_corner);
1466 
1467 xcb_void_cookie_t xcb_ewmh_set_desktop_layout_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1468 	xcb_ewmh_desktop_layout_orientation_t orientation, uint columns, uint rows, xcb_ewmh_desktop_layout_starting_corner_t starting_corner);
1469 
1470 /**
1471  * @brief  Send GetProperty  request to  get  _NET_DESKTOP_LAYOUT root
1472  *        window property
1473  *
1474  * @param ewmh The information relative to EWMH
1475  * @param screen_nbr The screen number
1476  * @return The _NET_DESKTOP_LAYOUT cookie of the GetProperty request
1477  */
1478 xcb_get_property_cookie_t xcb_ewmh_get_desktop_layout_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1479 
1480 /**
1481  * @see xcb_ewmh_get_desktop_layout_unchecked
1482  */
1483 xcb_get_property_cookie_t xcb_ewmh_get_desktop_layout(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1484 
1485 ubyte xcb_ewmh_get_desktop_layout_from_reply(xcb_ewmh_get_desktop_layout_reply_t* desktop_layouts, xcb_get_property_reply_t* r);
1486 
1487 ubyte xcb_ewmh_get_desktop_layout_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1488 	xcb_ewmh_get_desktop_layout_reply_t* desktop_layouts, xcb_generic_error_t** e);
1489 
1490 xcb_void_cookie_t xcb_ewmh_set_showing_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint desktop);
1491 
1492 xcb_void_cookie_t xcb_ewmh_set_showing_desktop_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, uint desktop);
1493 
1494 xcb_get_property_cookie_t xcb_ewmh_get_showing_desktop_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1495 
1496 xcb_get_property_cookie_t xcb_ewmh_get_showing_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1497 
1498 pragma(inline, true) static ubyte xcb_ewmh_get_showing_desktop_from_reply(uint* desktop, xcb_get_property_reply_t* r) {
1499 	return xcb_ewmh_get_cardinal_from_reply(desktop, r);
1500 }
1501 
1502 pragma(inline, true) static ubyte xcb_ewmh_get_showing_desktop_reply(xcb_ewmh_connection_t* ewmh,
1503 	xcb_get_property_cookie_t cookie, uint* desktop, xcb_generic_error_t** e) {
1504 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, desktop, e);
1505 }
1506 
1507 pragma(inline, true) static xcb_void_cookie_t xcb_ewmh_request_change_showing_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1508 	uint enter) {
1509 	return xcb_ewmh_send_client_message(ewmh.connection, XCB_NONE, ewmh.screens[screen_nbr].root,
1510 		ewmh._NET_SHOWING_DESKTOP, enter.sizeof, &enter);
1511 }
1512 
1513 xcb_void_cookie_t xcb_ewmh_request_close_window(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1514 	xcb_window_t window_to_close, xcb_timestamp_t timestamp, xcb_ewmh_client_source_type_t source_indication);
1515 
1516 xcb_void_cookie_t xcb_ewmh_request_moveresize_window(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1517 	xcb_window_t moveresize_window, xcb_gravity_t gravity, xcb_ewmh_client_source_type_t source_indication,
1518 	xcb_ewmh_moveresize_window_opt_flags_t flags, uint x, uint y, uint width, uint height);
1519 
1520 xcb_void_cookie_t xcb_ewmh_request_wm_moveresize(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1521 	xcb_window_t moveresize_window, uint x_root, uint y_root, xcb_ewmh_moveresize_direction_t direction,
1522 	xcb_button_index_t button, xcb_ewmh_client_source_type_t source_indication);
1523 
1524 xcb_void_cookie_t xcb_ewmh_request_restack_window(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1525 	xcb_window_t window_to_restack, xcb_window_t sibling_window, xcb_stack_mode_t detail);
1526 
1527 pragma(inline, true) static xcb_void_cookie_t xcb_ewmh_request_frame_extents(xcb_ewmh_connection_t* ewmh,
1528 	int screen_nbr, xcb_window_t client_window) {
1529 	return xcb_ewmh_send_client_message(ewmh.connection, client_window, ewmh.screens[screen_nbr].root,
1530 		ewmh._NET_REQUEST_FRAME_EXTENTS, 0, null);
1531 }
1532 
1533 xcb_void_cookie_t xcb_ewmh_set_wm_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1534 
1535 xcb_void_cookie_t xcb_ewmh_set_wm_name_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1536 
1537 xcb_get_property_cookie_t xcb_ewmh_get_wm_name_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1538 
1539 xcb_get_property_cookie_t xcb_ewmh_get_wm_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1540 
1541 pragma(inline, true) static ubyte xcb_ewmh_get_wm_name_from_reply(xcb_ewmh_connection_t* ewmh,
1542 	xcb_ewmh_get_utf8_strings_reply_t* data, xcb_get_property_reply_t* r) {
1543 	return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1544 }
1545 
1546 pragma(inline, true) static ubyte xcb_ewmh_get_wm_name_reply(xcb_ewmh_connection_t* ewmh,
1547 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t* data, xcb_generic_error_t** e) {
1548 	return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1549 }
1550 
1551 xcb_void_cookie_t xcb_ewmh_set_wm_visible_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1552 
1553 xcb_void_cookie_t xcb_ewmh_set_wm_visible_name_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1554 	uint strings_len, const char* strings);
1555 
1556 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1557 
1558 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1559 
1560 pragma(inline, true) static ubyte xcb_ewmh_get_wm_visible_name_from_reply(xcb_ewmh_connection_t* ewmh,
1561 	xcb_ewmh_get_utf8_strings_reply_t* data, xcb_get_property_reply_t* r) {
1562 	return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1563 }
1564 
1565 pragma(inline, true) static ubyte xcb_ewmh_get_wm_visible_name_reply(xcb_ewmh_connection_t* ewmh,
1566 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t* data, xcb_generic_error_t** e) {
1567 	return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1568 }
1569 
1570 xcb_void_cookie_t xcb_ewmh_set_wm_icon_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1571 
1572 xcb_void_cookie_t xcb_ewmh_set_wm_icon_name_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1573 
1574 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1575 
1576 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1577 
1578 pragma(inline, true) static ubyte xcb_ewmh_get_wm_icon_name_from_reply(xcb_ewmh_connection_t* ewmh,
1579 	xcb_ewmh_get_utf8_strings_reply_t* data, xcb_get_property_reply_t* r) {
1580 	return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1581 }
1582 
1583 pragma(inline, true) static ubyte xcb_ewmh_get_wm_icon_name_reply(xcb_ewmh_connection_t* ewmh,
1584 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t* data, xcb_generic_error_t** e) {
1585 	return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1586 }
1587 
1588 xcb_void_cookie_t xcb_ewmh_set_wm_visible_icon_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint strings_len, const char* strings);
1589 
1590 xcb_void_cookie_t xcb_ewmh_set_wm_visible_icon_name_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1591 	uint strings_len, const char* strings);
1592 
1593 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1594 
1595 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1596 
1597 pragma(inline, true) static ubyte xcb_ewmh_get_wm_visible_icon_name_from_reply(xcb_ewmh_connection_t* ewmh,
1598 	xcb_ewmh_get_utf8_strings_reply_t* data, xcb_get_property_reply_t* r) {
1599 	return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1600 }
1601 
1602 pragma(inline, true) static ubyte xcb_ewmh_get_wm_visible_icon_name_reply(xcb_ewmh_connection_t* ewmh,
1603 	xcb_get_property_cookie_t cookie, xcb_ewmh_get_utf8_strings_reply_t* data, xcb_generic_error_t** e) {
1604 	return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1605 }
1606 
1607 xcb_void_cookie_t xcb_ewmh_set_wm_desktop(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint desktop);
1608 
1609 xcb_void_cookie_t xcb_ewmh_set_wm_desktop_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint desktop);
1610 
1611 xcb_get_property_cookie_t xcb_ewmh_get_wm_desktop_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1612 
1613 xcb_get_property_cookie_t xcb_ewmh_get_wm_desktop(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1614 
1615 pragma(inline, true) static ubyte xcb_ewmh_get_wm_desktop_from_reply(uint* desktop, xcb_get_property_reply_t* r) {
1616 	return xcb_ewmh_get_cardinal_from_reply(desktop, r);
1617 }
1618 
1619 pragma(inline, true) static ubyte xcb_ewmh_get_wm_desktop_reply(xcb_ewmh_connection_t* ewmh,
1620 	xcb_get_property_cookie_t cookie, uint* desktop, xcb_generic_error_t** e) {
1621 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, desktop, e);
1622 }
1623 
1624 xcb_void_cookie_t xcb_ewmh_request_change_wm_desktop(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1625 	xcb_window_t client_window, uint new_desktop, xcb_ewmh_client_source_type_t source_indication);
1626 
1627 xcb_void_cookie_t xcb_ewmh_set_wm_window_type(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len, xcb_atom_t* list);
1628 
1629 xcb_void_cookie_t xcb_ewmh_set_wm_window_type_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len, xcb_atom_t* list);
1630 
1631 xcb_get_property_cookie_t xcb_ewmh_get_wm_window_type_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1632 
1633 xcb_get_property_cookie_t xcb_ewmh_get_wm_window_type(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1634 
1635 ubyte xcb_ewmh_get_wm_window_type_from_reply(xcb_ewmh_get_atoms_reply_t* wtypes, xcb_get_property_reply_t* r);
1636 
1637 ubyte xcb_ewmh_get_wm_window_type_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1638 	xcb_ewmh_get_atoms_reply_t* name, xcb_generic_error_t** e);
1639 
1640 xcb_void_cookie_t xcb_ewmh_set_wm_state(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len, xcb_atom_t* list);
1641 
1642 xcb_void_cookie_t xcb_ewmh_set_wm_state_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len, xcb_atom_t* list);
1643 
1644 xcb_get_property_cookie_t xcb_ewmh_get_wm_state_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1645 
1646 xcb_get_property_cookie_t xcb_ewmh_get_wm_state(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1647 
1648 ubyte xcb_ewmh_get_wm_state_from_reply(xcb_ewmh_get_atoms_reply_t* wtypes, xcb_get_property_reply_t* r);
1649 
1650 ubyte xcb_ewmh_get_wm_state_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1651 	xcb_ewmh_get_atoms_reply_t* name, xcb_generic_error_t** e);
1652 
1653 xcb_void_cookie_t xcb_ewmh_request_change_wm_state(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1654 	xcb_window_t client_window, xcb_ewmh_wm_state_action_t action, xcb_atom_t first_property, xcb_atom_t second_property,
1655 	xcb_ewmh_client_source_type_t source_indication);
1656 
1657 xcb_void_cookie_t xcb_ewmh_set_wm_allowed_actions(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len, xcb_atom_t* list);
1658 
1659 xcb_void_cookie_t xcb_ewmh_set_wm_allowed_actions_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint list_len,
1660 	xcb_atom_t* list);
1661 
1662 xcb_get_property_cookie_t xcb_ewmh_get_wm_allowed_actions_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1663 
1664 xcb_get_property_cookie_t xcb_ewmh_get_wm_allowed_actions(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1665 
1666 ubyte xcb_ewmh_get_wm_allowed_actions_from_reply(xcb_ewmh_get_atoms_reply_t* wtypes, xcb_get_property_reply_t* r);
1667 
1668 ubyte xcb_ewmh_get_wm_allowed_actions_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1669 	xcb_ewmh_get_atoms_reply_t* name, xcb_generic_error_t** e);
1670 
1671 xcb_void_cookie_t xcb_ewmh_set_wm_strut(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left, uint right, uint top,
1672 	uint bottom);
1673 
1674 xcb_void_cookie_t xcb_ewmh_set_wm_strut_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left,
1675 	uint right, uint top, uint bottom);
1676 
1677 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1678 
1679 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1680 
1681 ubyte xcb_ewmh_get_wm_strut_from_reply(xcb_ewmh_get_extents_reply_t* struts, xcb_get_property_reply_t* r);
1682 
1683 ubyte xcb_ewmh_get_wm_strut_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1684 	xcb_ewmh_get_extents_reply_t* struts, xcb_generic_error_t** e);
1685 
1686 xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial(xcb_ewmh_connection_t* ewmh, xcb_window_t window, xcb_ewmh_wm_strut_partial_t wm_strut);
1687 
1688 xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1689 	xcb_ewmh_wm_strut_partial_t wm_strut);
1690 
1691 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1692 
1693 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1694 
1695 ubyte xcb_ewmh_get_wm_strut_partial_from_reply(xcb_ewmh_wm_strut_partial_t* struts, xcb_get_property_reply_t* r);
1696 
1697 ubyte xcb_ewmh_get_wm_strut_partial_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1698 	xcb_ewmh_wm_strut_partial_t* struts, xcb_generic_error_t** e);
1699 
1700 xcb_void_cookie_t xcb_ewmh_set_wm_icon_geometry(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left,
1701 	uint right, uint top, uint bottom);
1702 
1703 xcb_void_cookie_t xcb_ewmh_set_wm_icon_geometry_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left,
1704 	uint right, uint top, uint bottom);
1705 
1706 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_geometry_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1707 
1708 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_geometry(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1709 
1710 ubyte xcb_ewmh_get_wm_icon_geometry_from_reply(xcb_ewmh_geometry_t* icons, xcb_get_property_reply_t* r);
1711 
1712 ubyte xcb_ewmh_get_wm_icon_geometry_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1713 	xcb_ewmh_geometry_t* icons, xcb_generic_error_t** e);
1714 
1715 /**
1716  * @brief Send ChangeProperty request to set _NET_WM_ICON window
1717  *        property. The given data is considered to be already
1718  *        prepared, namely that it is an array such as: WIDTH1,
1719  *        HEIGHT1, IMG1, WIDTH2, HEIGHT2, IMG2.
1720  *
1721  *        If you only want to add or append a single icon, you may
1722  *        consider using xcb_ewmh_append_wm_icon_checked which is far
1723  *        easier to use.
1724  *
1725  * _NET_WM_ICON CARDINAL[][2+n]/32
1726  *
1727  * @param ewmh The information relative to EWMH
1728  * @param mode ChangeProperty mode (xcb_prop_mode_t)
1729  * @param window The window to set the property on
1730  * @param data_len Length of the data
1731  * @param data The data
1732  */
1733 pragma(inline, true) static xcb_void_cookie_t xcb_ewmh_set_wm_icon_checked(xcb_ewmh_connection_t* ewmh, ubyte mode,
1734 	xcb_window_t window, uint data_len, uint* data) {
1735 	return xcb_change_property_checked(ewmh.connection, mode, window, ewmh._NET_WM_ICON, XCB_ATOM_CARDINAL, 32, data_len, data);
1736 }
1737 
1738 /**
1739  * @see xcb_ewmh_set_wm_icon_checked
1740  */
1741 pragma(inline, true) static xcb_void_cookie_t xcb_ewmh_set_wm_icon(xcb_ewmh_connection_t* ewmh, ubyte mode,
1742 	xcb_window_t window, uint data_len, uint* data) {
1743 	return xcb_change_property(ewmh.connection, mode, window, ewmh._NET_WM_ICON, XCB_ATOM_CARDINAL, 32, data_len, data);
1744 }
1745 
1746 xcb_void_cookie_t xcb_ewmh_append_wm_icon_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint width,
1747 	uint height, uint img_len, uint* img);
1748 
1749 xcb_void_cookie_t xcb_ewmh_append_wm_icon(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint width, uint height,
1750 	uint img_len, uint* img);
1751 
1752 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1753 
1754 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1755 
1756 ubyte xcb_ewmh_get_wm_icon_from_reply(xcb_ewmh_get_wm_icon_reply_t* wm_icon, xcb_get_property_reply_t* r);
1757 
1758 ubyte xcb_ewmh_get_wm_icon_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1759 	xcb_ewmh_get_wm_icon_reply_t* wm_icon, xcb_generic_error_t** e);
1760 
1761 xcb_ewmh_wm_icon_iterator_t xcb_ewmh_get_wm_icon_iterator(const xcb_ewmh_get_wm_icon_reply_t* wm_icon);
1762 
1763 uint xcb_ewmh_get_wm_icon_length(const xcb_ewmh_get_wm_icon_reply_t* wm_icon);
1764 
1765 void xcb_ewmh_get_wm_icon_next(xcb_ewmh_wm_icon_iterator_t* iterator);
1766 
1767 void xcb_ewmh_get_wm_icon_reply_wipe(xcb_ewmh_get_wm_icon_reply_t* wm_icon);
1768 
1769 xcb_void_cookie_t xcb_ewmh_set_wm_pid(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint pid);
1770 
1771 xcb_void_cookie_t xcb_ewmh_set_wm_pid_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint pid);
1772 
1773 xcb_get_property_cookie_t xcb_ewmh_get_wm_pid_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1774 
1775 xcb_get_property_cookie_t xcb_ewmh_get_wm_pid(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1776 
1777 pragma(inline, true) static ubyte xcb_ewmh_get_wm_pid_from_reply(uint* pid, xcb_get_property_reply_t* r) {
1778 	return xcb_ewmh_get_cardinal_from_reply(pid, r);
1779 }
1780 
1781 pragma(inline, true) static ubyte xcb_ewmh_get_wm_pid_reply(xcb_ewmh_connection_t* ewmh,
1782 	xcb_get_property_cookie_t cookie, uint* pid, xcb_generic_error_t** e) {
1783 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, pid, e);
1784 }
1785 
1786 xcb_void_cookie_t xcb_ewmh_set_wm_handled_icons(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint handled_icons);
1787 
1788 xcb_void_cookie_t xcb_ewmh_set_wm_handled_icons_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint handled_icons);
1789 
1790 xcb_get_property_cookie_t xcb_ewmh_get_wm_handled_icons_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1791 
1792 xcb_get_property_cookie_t xcb_ewmh_get_wm_handled_icons(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1793 
1794 pragma(inline, true) static ubyte xcb_ewmh_get_wm_handled_icons_from_reply(uint* handled_icons, xcb_get_property_reply_t* r) {
1795 	return xcb_ewmh_get_cardinal_from_reply(handled_icons, r);
1796 }
1797 
1798 pragma(inline, true) static ubyte xcb_ewmh_get_wm_handled_icons_reply(xcb_ewmh_connection_t* ewmh,
1799 	xcb_get_property_cookie_t cookie, uint* handled_icons, xcb_generic_error_t** e) {
1800 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, handled_icons, e);
1801 }
1802 
1803 xcb_void_cookie_t xcb_ewmh_set_wm_user_time(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint xtime);
1804 
1805 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint pid);
1806 
1807 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1808 
1809 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1810 
1811 pragma(inline, true) static ubyte xcb_ewmh_get_wm_user_time_from_reply(uint* xtime, xcb_get_property_reply_t* r) {
1812 	return xcb_ewmh_get_cardinal_from_reply(xtime, r);
1813 }
1814 
1815 pragma(inline, true) static ubyte xcb_ewmh_get_wm_user_time_reply(xcb_ewmh_connection_t* ewmh,
1816 	xcb_get_property_cookie_t cookie, uint* xtime, xcb_generic_error_t** e) {
1817 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, xtime, e);
1818 }
1819 
1820 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_window(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint xtime);
1821 
1822 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_window_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint pid);
1823 
1824 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_window_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1825 
1826 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_window(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1827 
1828 pragma(inline, true) static ubyte xcb_ewmh_get_wm_user_time_window_from_reply(uint* xtime, xcb_get_property_reply_t* r) {
1829 	return xcb_ewmh_get_cardinal_from_reply(xtime, r);
1830 }
1831 
1832 pragma(inline, true) static ubyte xcb_ewmh_get_wm_user_time_window_reply(xcb_ewmh_connection_t* ewmh,
1833 	xcb_get_property_cookie_t cookie, uint* xtime, xcb_generic_error_t** e) {
1834 	return xcb_ewmh_get_cardinal_reply(ewmh, cookie, xtime, e);
1835 }
1836 
1837 xcb_void_cookie_t xcb_ewmh_set_frame_extents(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left, uint right, uint top,
1838 	uint bottom);
1839 
1840 xcb_void_cookie_t xcb_ewmh_set_frame_extents_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint left,
1841 	uint right, uint top, uint bottom);
1842 
1843 xcb_get_property_cookie_t xcb_ewmh_get_frame_extents_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1844 
1845 xcb_get_property_cookie_t xcb_ewmh_get_frame_extents(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1846 
1847 ubyte xcb_ewmh_get_frame_extents_from_reply(xcb_ewmh_get_extents_reply_t* frame_extents, xcb_get_property_reply_t* r);
1848 
1849 ubyte xcb_ewmh_get_frame_extents_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1850 	xcb_ewmh_get_extents_reply_t* frame_extents, xcb_generic_error_t** e);
1851 
1852 xcb_void_cookie_t xcb_ewmh_send_wm_ping(xcb_ewmh_connection_t* ewmh, xcb_window_t window, xcb_timestamp_t timestamp);
1853 
1854 xcb_void_cookie_t xcb_ewmh_set_wm_sync_request_counter(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1855 	xcb_atom_t wm_sync_request_counter_atom, uint low, uint high);
1856 
1857 xcb_void_cookie_t xcb_ewmh_set_wm_sync_request_counter_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1858 	xcb_atom_t wm_sync_request_counter_atom, uint low, uint high);
1859 
1860 xcb_get_property_cookie_t xcb_ewmh_get_wm_sync_request_counter_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1861 
1862 xcb_get_property_cookie_t xcb_ewmh_get_wm_sync_request_counter(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1863 
1864 ubyte xcb_ewmh_get_wm_sync_request_counter_from_reply(ulong* counter, xcb_get_property_reply_t* r);
1865 
1866 ubyte xcb_ewmh_get_wm_sync_request_counter_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1867 	ulong* counter, xcb_generic_error_t** e);
1868 
1869 xcb_void_cookie_t xcb_ewmh_send_wm_sync_request(xcb_ewmh_connection_t* ewmh, xcb_window_t window,
1870 	xcb_atom_t wm_protocols_atom, xcb_atom_t wm_sync_request_atom, xcb_timestamp_t timestamp, ulong counter);
1871 
1872 xcb_void_cookie_t xcb_ewmh_set_wm_fullscreen_monitors(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint top,
1873 	uint bottom, uint left, uint right);
1874 
1875 xcb_void_cookie_t xcb_ewmh_set_wm_fullscreen_monitors_checked(xcb_ewmh_connection_t* ewmh, xcb_window_t window, uint top,
1876 	uint bottom, uint left, uint right);
1877 
1878 xcb_get_property_cookie_t xcb_ewmh_get_wm_fullscreen_monitors_unchecked(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1879 
1880 xcb_get_property_cookie_t xcb_ewmh_get_wm_fullscreen_monitors(xcb_ewmh_connection_t* ewmh, xcb_window_t window);
1881 
1882 ubyte xcb_ewmh_get_wm_fullscreen_monitors_from_reply(xcb_ewmh_get_wm_fullscreen_monitors_reply_t* monitors, xcb_get_property_reply_t* r);
1883 
1884 ubyte xcb_ewmh_get_wm_fullscreen_monitors_reply(xcb_ewmh_connection_t* ewmh, xcb_get_property_cookie_t cookie,
1885 	xcb_ewmh_get_wm_fullscreen_monitors_reply_t* monitors, xcb_generic_error_t** e);
1886 
1887 xcb_void_cookie_t xcb_ewmh_request_change_wm_fullscreen_monitors(xcb_ewmh_connection_t* ewmh, int screen_nbr,
1888 	xcb_window_t window, uint top, uint bottom, uint left, uint right, xcb_ewmh_client_source_type_t source_indication);
1889 
1890 /**
1891  * @brief Set _NET_WM_CM_Sn ownership to the given window
1892  *
1893  * For  each  screen they  manage,  compositing  manager MUST  acquire
1894  * ownership of a selection named _NET_WM_CM_Sn, where n is the screen
1895  * number.
1896  *
1897  * @param ewmh The information relative to EWMH
1898  * @param screen_nbr The screen number
1899  * @param owner The new owner of _NET_WM_CM_Sn selection
1900  * @param timestamp The client's last user activity timestamp
1901  * @param selection_data1 Optional data described by ICCCM
1902  * @param selection_data2 Optional data described by ICCCM
1903  */
1904 xcb_void_cookie_t xcb_ewmh_set_wm_cm_owner(xcb_ewmh_connection_t* ewmh, int screen_nbr, xcb_window_t owner,
1905 	xcb_timestamp_t timestamp, uint selection_data1, uint selection_data2);
1906 
1907 /**
1908  * @see xcb_ewmh_set_wm_cm_owner
1909  */
1910 xcb_void_cookie_t xcb_ewmh_set_wm_cm_owner_checked(xcb_ewmh_connection_t* ewmh, int screen_nbr, xcb_window_t owner,
1911 	xcb_timestamp_t timestamp, uint selection_data1, uint selection_data2);
1912 
1913 /**
1914  * @brief   Send  GetSelectOwner   request   to  get   the  owner   of
1915  *        _NET_WM_CM_Sn root window property
1916  *
1917  * @param ewmh The information relative to EWMH
1918  * @param screen_nbr The screen number
1919  * @return The _NET_WM_CM_Sn cookie of the GetSelectionOwner request
1920  */
1921 xcb_get_selection_owner_cookie_t xcb_ewmh_get_wm_cm_owner_unchecked(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1922 
1923 /**
1924  * @see xcb_ewmh_get_wm_cm_owner_unchecked
1925  */
1926 xcb_get_selection_owner_cookie_t xcb_ewmh_get_wm_cm_owner(xcb_ewmh_connection_t* ewmh, int screen_nbr);
1927 
1928 ubyte xcb_ewmh_get_wm_cm_owner_from_reply(xcb_window_t* owner, xcb_get_selection_owner_reply_t* r);
1929 
1930 /**
1931  * @brief Get reply from the GetProperty _NET_CLIENT_LIST cookie
1932  *
1933  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1934  * xcb_get_window_client_list_unchecked()  is   used.   Otherwise,  it
1935  * stores the error if any.
1936  *
1937  * @param ewmh The information relative to EWMH.
1938  * @param cookie The _NET_WM_CM_Sn GetSelectionOwner request cookie.
1939  * @param owner The window ID which owns the selection or None.
1940  * @param The xcb_generic_error_t supplied.
1941  * @return Return 1 on success, 0 otherwise.
1942  */
1943 ubyte xcb_ewmh_get_wm_cm_owner_reply(xcb_ewmh_connection_t* ewmh, xcb_get_selection_owner_cookie_t cookie,
1944 	xcb_window_t* owner, xcb_generic_error_t** e);