Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:41

0001 #ifndef __XCB_EWMH_H__
0002 #define __XCB_EWMH_H__
0003 
0004 /*
0005  * Copyright (C) 2009-2011 Arnaud Fontaine <arnau@debian.org>
0006  *
0007  * Permission  is  hereby  granted,  free  of charge,  to  any  person
0008  * obtaining  a copy  of  this software  and associated  documentation
0009  * files   (the  "Software"),   to  deal   in  the   Software  without
0010  * restriction, including without limitation  the rights to use, copy,
0011  * modify, merge, publish,  distribute, sublicense, and/or sell copies
0012  * of  the Software, and  to permit  persons to  whom the  Software is
0013  * furnished to do so, subject to the following conditions:
0014  *
0015  * The  above copyright  notice and  this permission  notice  shall be
0016  * included in all copies or substantial portions of the Software.
0017  *
0018  * THE SOFTWARE  IS PROVIDED  "AS IS", WITHOUT  WARRANTY OF  ANY KIND,
0019  * EXPRESS OR IMPLIED, INCLUDING BUT  NOT LIMITED TO THE WARRANTIES OF
0020  * MERCHANTABILITY,   FITNESS    FOR   A   PARTICULAR    PURPOSE   AND
0021  * NONINFRINGEMENT. IN  NO EVENT SHALL  THE AUTHORS BE LIABLE  FOR ANY
0022  * CLAIM,  DAMAGES  OR  OTHER  LIABILITY,  WHETHER  IN  AN  ACTION  OF
0023  * CONTRACT, TORT OR OTHERWISE, ARISING  FROM, OUT OF OR IN CONNECTION
0024  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0025  *
0026  * Except as  contained in  this notice, the  names of the  authors or
0027  * their institutions shall not be used in advertising or otherwise to
0028  * promote the  sale, use or  other dealings in this  Software without
0029  * prior written authorization from the authors.
0030  */
0031 
0032 /**
0033  * @defgroup xcb__ewmh_t XCB EWMH Functions
0034  *
0035  * These functions  allow easy handling  of the protocol  described in
0036  * the Extended Window Manager  Hints specification. The list of Atoms
0037  * is stored as an M4 file  (atomlist.m4) where each Atom is stored as
0038  * a variable defined in the header.
0039  *
0040  * Replies of requests generating a  list of pointers (such as list of
0041  * windows, atoms and UTF-8 strings)  are simply stored as a structure
0042  * holding  the XCB  reply which  should (usually)  never  be accessed
0043  * directly and has  to be wipe afterwards. This  structure provides a
0044  * convenient access to the list given in the reply itself.
0045  *
0046  * @{
0047  */
0048 
0049 #include <xcb/xcb.h>
0050 #include <stdlib.h>
0051 
0052 #ifdef __cplusplus
0053 extern "C" {
0054 #endif
0055 
0056 /**
0057  * @brief Hold EWMH information specific to a screen
0058  */
0059 typedef struct {
0060   /** The X connection */
0061   xcb_connection_t *connection;
0062   /** The screens on this connection */
0063   xcb_screen_t **screens;
0064   int nb_screens;
0065   /** _NET_WM_CM_Sn atoms depending on the number of screens */
0066   xcb_atom_t *_NET_WM_CM_Sn;
0067   /** The EWMH atoms of this connection */    
0068   xcb_atom_t _NET_SUPPORTED;
0069   xcb_atom_t _NET_CLIENT_LIST;
0070   xcb_atom_t _NET_CLIENT_LIST_STACKING;
0071   xcb_atom_t _NET_NUMBER_OF_DESKTOPS;
0072   xcb_atom_t _NET_DESKTOP_GEOMETRY;
0073   xcb_atom_t _NET_DESKTOP_VIEWPORT;
0074   xcb_atom_t _NET_CURRENT_DESKTOP;
0075   xcb_atom_t _NET_DESKTOP_NAMES;
0076   xcb_atom_t _NET_ACTIVE_WINDOW;
0077   xcb_atom_t _NET_WORKAREA;
0078   xcb_atom_t _NET_SUPPORTING_WM_CHECK;
0079   xcb_atom_t _NET_VIRTUAL_ROOTS;
0080   xcb_atom_t _NET_DESKTOP_LAYOUT;
0081   xcb_atom_t _NET_SHOWING_DESKTOP;
0082   xcb_atom_t _NET_CLOSE_WINDOW;
0083   xcb_atom_t _NET_MOVERESIZE_WINDOW;
0084   xcb_atom_t _NET_WM_MOVERESIZE;
0085   xcb_atom_t _NET_RESTACK_WINDOW;
0086   xcb_atom_t _NET_REQUEST_FRAME_EXTENTS;
0087   xcb_atom_t _NET_WM_NAME;
0088   xcb_atom_t _NET_WM_VISIBLE_NAME;
0089   xcb_atom_t _NET_WM_ICON_NAME;
0090   xcb_atom_t _NET_WM_VISIBLE_ICON_NAME;
0091   xcb_atom_t _NET_WM_DESKTOP;
0092   xcb_atom_t _NET_WM_WINDOW_TYPE;
0093   xcb_atom_t _NET_WM_STATE;
0094   xcb_atom_t _NET_WM_ALLOWED_ACTIONS;
0095   xcb_atom_t _NET_WM_STRUT;
0096   xcb_atom_t _NET_WM_STRUT_PARTIAL;
0097   xcb_atom_t _NET_WM_ICON_GEOMETRY;
0098   xcb_atom_t _NET_WM_ICON;
0099   xcb_atom_t _NET_WM_PID;
0100   xcb_atom_t _NET_WM_HANDLED_ICONS;
0101   xcb_atom_t _NET_WM_USER_TIME;
0102   xcb_atom_t _NET_WM_USER_TIME_WINDOW;
0103   xcb_atom_t _NET_FRAME_EXTENTS;
0104   xcb_atom_t _NET_WM_PING;
0105   xcb_atom_t _NET_WM_SYNC_REQUEST;
0106   xcb_atom_t _NET_WM_SYNC_REQUEST_COUNTER;
0107   xcb_atom_t _NET_WM_FULLSCREEN_MONITORS;
0108   xcb_atom_t _NET_WM_FULL_PLACEMENT;
0109   xcb_atom_t UTF8_STRING;
0110   xcb_atom_t WM_PROTOCOLS;
0111   xcb_atom_t MANAGER;
0112   xcb_atom_t _NET_WM_WINDOW_TYPE_DESKTOP;
0113   xcb_atom_t _NET_WM_WINDOW_TYPE_DOCK;
0114   xcb_atom_t _NET_WM_WINDOW_TYPE_TOOLBAR;
0115   xcb_atom_t _NET_WM_WINDOW_TYPE_MENU;
0116   xcb_atom_t _NET_WM_WINDOW_TYPE_UTILITY;
0117   xcb_atom_t _NET_WM_WINDOW_TYPE_SPLASH;
0118   xcb_atom_t _NET_WM_WINDOW_TYPE_DIALOG;
0119   xcb_atom_t _NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
0120   xcb_atom_t _NET_WM_WINDOW_TYPE_POPUP_MENU;
0121   xcb_atom_t _NET_WM_WINDOW_TYPE_TOOLTIP;
0122   xcb_atom_t _NET_WM_WINDOW_TYPE_NOTIFICATION;
0123   xcb_atom_t _NET_WM_WINDOW_TYPE_COMBO;
0124   xcb_atom_t _NET_WM_WINDOW_TYPE_DND;
0125   xcb_atom_t _NET_WM_WINDOW_TYPE_NORMAL;
0126   xcb_atom_t _NET_WM_STATE_MODAL;
0127   xcb_atom_t _NET_WM_STATE_STICKY;
0128   xcb_atom_t _NET_WM_STATE_MAXIMIZED_VERT;
0129   xcb_atom_t _NET_WM_STATE_MAXIMIZED_HORZ;
0130   xcb_atom_t _NET_WM_STATE_SHADED;
0131   xcb_atom_t _NET_WM_STATE_SKIP_TASKBAR;
0132   xcb_atom_t _NET_WM_STATE_SKIP_PAGER;
0133   xcb_atom_t _NET_WM_STATE_HIDDEN;
0134   xcb_atom_t _NET_WM_STATE_FULLSCREEN;
0135   xcb_atom_t _NET_WM_STATE_ABOVE;
0136   xcb_atom_t _NET_WM_STATE_BELOW;
0137   xcb_atom_t _NET_WM_STATE_DEMANDS_ATTENTION;
0138   xcb_atom_t _NET_WM_ACTION_MOVE;
0139   xcb_atom_t _NET_WM_ACTION_RESIZE;
0140   xcb_atom_t _NET_WM_ACTION_MINIMIZE;
0141   xcb_atom_t _NET_WM_ACTION_SHADE;
0142   xcb_atom_t _NET_WM_ACTION_STICK;
0143   xcb_atom_t _NET_WM_ACTION_MAXIMIZE_HORZ;
0144   xcb_atom_t _NET_WM_ACTION_MAXIMIZE_VERT;
0145   xcb_atom_t _NET_WM_ACTION_FULLSCREEN;
0146   xcb_atom_t _NET_WM_ACTION_CHANGE_DESKTOP;
0147   xcb_atom_t _NET_WM_ACTION_CLOSE;
0148   xcb_atom_t _NET_WM_ACTION_ABOVE;
0149   xcb_atom_t _NET_WM_ACTION_BELOW;
0150 } xcb_ewmh_connection_t;
0151 
0152 /**
0153  * @brief Hold a GetProperty reply containing a list of Atoms
0154  */
0155 typedef struct {
0156   /** The number of Atoms */
0157   uint32_t atoms_len;
0158   /** The list of Atoms */
0159   xcb_atom_t *atoms;
0160   /** The actual GetProperty reply */
0161   xcb_get_property_reply_t *_reply;
0162 } xcb_ewmh_get_atoms_reply_t;
0163 
0164 /**
0165  * @brief Hold a GetProperty reply containing a list of Windows
0166  */
0167 typedef struct {
0168   /** The number of Windows */
0169   uint32_t windows_len;
0170   /** The list of Windows */
0171   xcb_window_t *windows;
0172   /** The actual GetProperty reply */
0173   xcb_get_property_reply_t *_reply;
0174 } xcb_ewmh_get_windows_reply_t;
0175 
0176 /**
0177  * @brief Hold a GetProperty reply containg a list of UTF-8 strings
0178  */
0179 typedef struct {
0180   /** The number of UTF-8 strings */
0181   uint32_t strings_len;
0182   /** The list of UTF-8 strings */
0183   char *strings;
0184   /** The actual GetProperty reply */
0185   xcb_get_property_reply_t *_reply;
0186 } xcb_ewmh_get_utf8_strings_reply_t;
0187 
0188 /**
0189  * @brief Coordinates Property values
0190  */
0191 typedef struct {
0192   /** The x coordinate */
0193   uint32_t x;
0194   /** The y coordinate */
0195   uint32_t y;
0196 } xcb_ewmh_coordinates_t;
0197 
0198 /**
0199  * @brief Hold reply of _NET_DESKTOP_VIEWPORT GetProperty
0200  */
0201 typedef struct {
0202   /** The number of desktop viewports */
0203   uint32_t desktop_viewport_len;
0204   /** The desktop viewports */
0205   xcb_ewmh_coordinates_t *desktop_viewport;
0206   /** The actual GetProperty reply */
0207   xcb_get_property_reply_t *_reply;
0208 } xcb_ewmh_get_desktop_viewport_reply_t;
0209 
0210 /**
0211  * @brief Geometry Property values
0212  */
0213 typedef struct {
0214   /** The x coordinate */
0215   uint32_t x;
0216   /** The y coordinate */
0217   uint32_t y;
0218   /** The width */
0219   uint32_t width;
0220   /** The height */
0221   uint32_t height;
0222 } xcb_ewmh_geometry_t;
0223 
0224 /**
0225  * @brief Hold reply of a _NET_WORKAREA GetProperty
0226  */
0227 typedef struct {
0228   /** The number of desktop workarea */
0229   uint32_t workarea_len;
0230   /** The list of desktop workarea */
0231   xcb_ewmh_geometry_t *workarea;
0232   /** The actual GetProperty reply */
0233   xcb_get_property_reply_t *_reply;
0234 } xcb_ewmh_get_workarea_reply_t;
0235 
0236 /**
0237  * @brief Source indication in requests
0238  */
0239 typedef enum {
0240   /** No source at all (for clients supporting an older version of
0241       EWMH specification) */
0242   XCB_EWMH_CLIENT_SOURCE_TYPE_NONE = 0,
0243   /** Normal application */
0244   XCB_EWMH_CLIENT_SOURCE_TYPE_NORMAL = 1,
0245   /** Pagers and other clients that represent direct user actions */
0246   XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER = 2
0247 } xcb_ewmh_client_source_type_t;
0248 
0249 /**
0250  * @brief _NET_DESKTOP_LAYOUT orientation
0251  */
0252 typedef enum {
0253   /** Horizontal orientation (desktops laid out in rows) */
0254   XCB_EWMH_WM_ORIENTATION_HORZ = 0,
0255   /** Vertical orientation (desktops laid out in columns) */
0256   XCB_EWMH_WM_ORIENTATION_VERT = 1
0257 } xcb_ewmh_desktop_layout_orientation_t;
0258 
0259 /**
0260  * @brief _NET_DESKTOP_LAYOUT starting corner
0261  */
0262 typedef enum {
0263   /** Starting corner on the top left */
0264   XCB_EWMH_WM_TOPLEFT = 0,
0265   /** Starting corner on the top right */
0266   XCB_EWMH_WM_TOPRIGHT = 1,
0267   /** Starting corner on the bottom right */
0268   XCB_EWMH_WM_BOTTOMRIGHT = 2,
0269   /** Starting corner on the bottom left */
0270   XCB_EWMH_WM_BOTTOMLEFT = 3
0271 } xcb_ewmh_desktop_layout_starting_corner_t;
0272 
0273 /**
0274  * @brief Hold reply of a _NET_DESKTOP_LAYOUT GetProperty
0275  * @see xcb_ewmh_desktop_layout_orientation_t
0276  * @see xcb_ewmh_desktop_layout_starting_corner_t
0277  */
0278 typedef struct {
0279   /** The desktops orientation */
0280   uint32_t orientation;
0281   /** The number of columns */
0282   uint32_t columns;
0283   /** The number of rows */
0284   uint32_t rows;
0285   /** The desktops starting corner */
0286   uint32_t starting_corner;
0287 } xcb_ewmh_get_desktop_layout_reply_t;
0288 
0289 /**
0290  * @brief _NET_WM_MOVERESIZE value when moving via keyboard
0291  * @see xcb_ewmh_moveresize_direction_t
0292  */
0293 typedef enum {
0294   /** The window x coordinate */
0295   XCB_EWMH_MOVERESIZE_WINDOW_X = (1 << 8),
0296   /** The window y coordinate */
0297   XCB_EWMH_MOVERESIZE_WINDOW_Y = (1 << 9),
0298   /** The window width */
0299   XCB_EWMH_MOVERESIZE_WINDOW_WIDTH = (1 << 10),
0300   /** The window height */
0301   XCB_EWMH_MOVERESIZE_WINDOW_HEIGHT = (1 << 11)
0302 } xcb_ewmh_moveresize_window_opt_flags_t;
0303 
0304 /**
0305  * @brief _NET_WM_MOVERESIZE window movement or resizing
0306  */
0307 typedef enum {
0308   /** Resizing applied on the top left edge */
0309   XCB_EWMH_WM_MOVERESIZE_SIZE_TOPLEFT = 0,
0310   /** Resizing applied on the top edge */
0311   XCB_EWMH_WM_MOVERESIZE_SIZE_TOP = 1,
0312   /** Resizing applied on the top right edge */
0313   XCB_EWMH_WM_MOVERESIZE_SIZE_TOPRIGHT = 2,
0314   /** Resizing applied on the right edge */
0315   XCB_EWMH_WM_MOVERESIZE_SIZE_RIGHT = 3,
0316   /** Resizing applied on the bottom right edge */
0317   XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMRIGHT = 4,
0318   /** Resizing applied on the bottom edge */
0319   XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOM = 5,
0320   /** Resizing applied on the bottom left edge */
0321   XCB_EWMH_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6,
0322   /** Resizing applied on the left edge */
0323   XCB_EWMH_WM_MOVERESIZE_SIZE_LEFT = 7,
0324   /* Movement only */
0325   XCB_EWMH_WM_MOVERESIZE_MOVE = 8,
0326   /* Size via keyboard */
0327   XCB_EWMH_WM_MOVERESIZE_SIZE_KEYBOARD = 9,
0328   /* Move via keyboard */
0329   XCB_EWMH_WM_MOVERESIZE_MOVE_KEYBOARD = 10,
0330   /* Cancel operation */
0331   XCB_EWMH_WM_MOVERESIZE_CANCEL = 11
0332 } xcb_ewmh_moveresize_direction_t;
0333 
0334 /**
0335  * @brief Action on the _NET_WM_STATE property
0336  */
0337 typedef enum {
0338   /* Remove/unset property */
0339   XCB_EWMH_WM_STATE_REMOVE = 0,
0340   /* Add/set property */
0341   XCB_EWMH_WM_STATE_ADD = 1,
0342   /* Toggle property  */
0343   XCB_EWMH_WM_STATE_TOGGLE = 2
0344 } xcb_ewmh_wm_state_action_t;
0345 
0346 /**
0347  * @brief Hold reply of _NET_WM_STRUT_PARTIAL GetProperty
0348  */
0349 typedef struct {
0350   /** Reserved space on the left border of the screen */
0351   uint32_t left;
0352   /** Reserved space on the right border of the screen */
0353   uint32_t right;
0354   /** Reserved space on the top border of the screen */
0355   uint32_t top;
0356   /** Reserved space on the bottom border of the screen */
0357   uint32_t bottom;
0358   /** Beginning y coordinate of the left strut */
0359   uint32_t left_start_y;
0360   /** Ending y coordinate of the left strut */
0361   uint32_t left_end_y;
0362   /** Beginning y coordinate of the right strut */
0363   uint32_t right_start_y;
0364   /** Ending y coordinate of the right strut */
0365   uint32_t right_end_y;
0366   /** Beginning x coordinate of the top strut */
0367   uint32_t top_start_x;
0368   /** Ending x coordinate of the top strut */
0369   uint32_t top_end_x;
0370   /** Beginning x coordinate of the bottom strut */
0371   uint32_t bottom_start_x;
0372   /** Ending x coordinate of the bottom strut */
0373   uint32_t bottom_end_x;
0374 } xcb_ewmh_wm_strut_partial_t;
0375 
0376 /**
0377  * @brief Hold a single icon from reply of _NET_WM_ICON GetProperty
0378  */
0379 typedef struct {
0380   /** Icon width */
0381   uint32_t width;
0382   /** Icon height */
0383   uint32_t height;
0384   /** Rows, left to right and top to bottom of the CARDINAL ARGB */
0385   uint32_t *data;
0386   /** Number of icons remaining */
0387   unsigned int rem;
0388   /** Index of the current icon in the array of icons */
0389   unsigned int index;
0390 } xcb_ewmh_wm_icon_iterator_t;
0391 
0392 /**
0393  * @brief Hold reply of _NET_WM_ICON GetProperty
0394  */
0395 typedef struct {
0396   /** Number of icons */
0397   unsigned int num_icons;
0398   /** The actual GetProperty reply */
0399   xcb_get_property_reply_t *_reply;
0400 } xcb_ewmh_get_wm_icon_reply_t;
0401 
0402 /**
0403  * @brief Hold reply of _NET_REQUEST_FRAME_EXTENTS GetProperty
0404  */
0405 typedef struct {
0406   /** Width of the left border */
0407   uint32_t left;
0408   /** Width of the right border */
0409   uint32_t right;
0410   /** Width of the top border */
0411   uint32_t top;
0412   /** Width of the bottom border */
0413   uint32_t bottom;
0414 } xcb_ewmh_get_extents_reply_t;
0415 
0416 /**
0417  * @brief Hold reply of _NET_WM_FULLSCREEN_MONITORS GetProperty
0418  */
0419 typedef struct {
0420   /** Monitor whose top edge defines the top edge of the fullscreen
0421       window */
0422   uint32_t top;
0423   /** Monitor whose bottom edge defines the bottom edge of the
0424       fullscreen window */
0425   uint32_t bottom;
0426   /** Monitor whose left edge defines the left edge of the fullscreen
0427       window */
0428   uint32_t left;
0429   /** Monitor whose right edge defines the right edge of the
0430       fullscreen window */
0431   uint32_t right;
0432 } xcb_ewmh_get_wm_fullscreen_monitors_reply_t;
0433 
0434 /**
0435  * @brief Send InternAtom requests for the EWMH atoms and its required atoms
0436  *
0437  * @param c The connection to the X server
0438  * @param ewmh The information relative to EWMH
0439  * @param screen_nbr The screen number
0440  * @return The cookies corresponding to EWMH atoms
0441  */
0442 xcb_intern_atom_cookie_t *xcb_ewmh_init_atoms(xcb_connection_t *c,
0443                                               xcb_ewmh_connection_t *ewmh);
0444 
0445 /**
0446  * @brief Process  the replies  to the screen  initialisation requests
0447  * previously sent
0448  *
0449  * @param emwh The information relative to EWMH
0450  * @param ewmh_cookies The cookies corresponding to EWMH atoms
0451  * @param e Error if any
0452  * @return Return 1 on success, 0 otherwise
0453  */
0454 uint8_t xcb_ewmh_init_atoms_replies(xcb_ewmh_connection_t *ewmh,
0455                                     xcb_intern_atom_cookie_t *ewmh_cookies,
0456                                     xcb_generic_error_t **e);
0457 
0458 static inline void
0459 xcb_ewmh_connection_wipe(xcb_ewmh_connection_t *ewmh)
0460 {
0461   free(ewmh->screens);
0462   free(ewmh->_NET_WM_CM_Sn);
0463 }
0464 
0465 /**
0466  * @brief Send a SendEvent request containing a ClientMessage event
0467  *
0468  * This  function is  called  by all  the xcb_ewmh_request*  functions
0469  * whose should be used instead of calling directly this function
0470  *
0471  * @param c The X connection
0472  * @param window The window where the action will be applied
0473  * @param dest The destination window (usually the root window)
0474  * @param atom The type of the message
0475  * @param data_len The length of data to be sent
0476  * @param data The data to be sent
0477  * @return The cookie associated with the SendEvent request
0478  */
0479 xcb_void_cookie_t xcb_ewmh_send_client_message(xcb_connection_t *c,
0480                                                xcb_window_t window,
0481                                                xcb_window_t dest,
0482                                                xcb_atom_t atom,
0483                                                uint32_t data_len,
0484                                                const uint32_t *data);
0485 
0486 uint8_t xcb_ewmh_get_window_from_reply(xcb_window_t *window,
0487                                        xcb_get_property_reply_t *r);
0488 
0489 uint8_t xcb_ewmh_get_window_reply(xcb_ewmh_connection_t *ewmh,
0490                                   xcb_get_property_cookie_t cookie,
0491                                   xcb_window_t *window,
0492                                   xcb_generic_error_t **e);
0493 
0494 uint8_t xcb_ewmh_get_cardinal_from_reply(uint32_t *cardinal,
0495                                          xcb_get_property_reply_t *r);
0496 
0497 uint8_t xcb_ewmh_get_cardinal_reply(xcb_ewmh_connection_t *ewmh,
0498                                     xcb_get_property_cookie_t cookie,
0499                                     uint32_t *cardinal,
0500                                     xcb_generic_error_t **e);
0501 
0502 /**
0503  * @brief Get  a list  of atoms from  a given GetProperty  reply whose
0504  * type is ATOM
0505  *
0506  * This  function  is  called  by  all  the  xcb_ewmh_get_*_from_reply
0507  * functions  whose should  be used  instead of  calling  it directly.
0508  * Indeed,  The GetProperty request  has been  previously sent  by the
0509  * corresponding xcb_ewmh_get_*.
0510  *
0511  * @param atoms The atoms list
0512  * @param r The reply to get the atoms list from
0513  * @return Return 1 on success, 0 otherwise
0514  */
0515 uint8_t xcb_ewmh_get_atoms_from_reply(xcb_ewmh_get_atoms_reply_t *atoms,
0516                                       xcb_get_property_reply_t *r);
0517 
0518 /**
0519  * @brief Get a list of atoms  from the reply of a GetProperty request
0520  * whose type is ATOM
0521  *
0522  * This function  is called by all  the xcb_ewmh_get_*_reply functions
0523  * whose  should   be  used  instead  of  calling   it  directly.  The
0524  * GetProperty request  has been previously sent  by the corresponding
0525  * xcb_ewmh_get_*.
0526  *
0527  * @param ewmh The per-screen EWMH specific information
0528  * @param cookie The GetProperty cookie
0529  * @param atoms The atoms list
0530  * @param e The error if any
0531  * @return Return 1 on success, 0 otherwise
0532  */
0533 uint8_t xcb_ewmh_get_atoms_reply(xcb_ewmh_connection_t *ewmh,
0534                                  xcb_get_property_cookie_t cookie,
0535                                  xcb_ewmh_get_atoms_reply_t *atoms,
0536                                  xcb_generic_error_t **e);
0537 
0538 /**
0539  * @brief Wipe the Atoms list reply
0540  *
0541  * This function must be called to free the memory allocated for atoms
0542  * when the reply is requested in *_reply functions.
0543  *
0544  * @param data The X reply to be freed
0545  */
0546 void xcb_ewmh_get_atoms_reply_wipe(xcb_ewmh_get_atoms_reply_t *data);
0547 
0548 /**
0549  * @brief Get  a list  of atoms from  a given GetProperty  reply whose
0550  * type is WINDOW
0551  *
0552  * This  function  is  called  by  all  the  xcb_ewmh_get_*_from_reply
0553  * functions  whose should  be used  instead of  calling  it directly.
0554  * Indeed,  The GetProperty request  has been  previously sent  by the
0555  * corresponding xcb_ewmh_get_*.
0556  *
0557  * @param atoms The atoms list
0558  * @param r The reply to get the atoms list from
0559  * @return Return 1 on success, 0 otherwise
0560  */
0561 uint8_t xcb_ewmh_get_windows_from_reply(xcb_ewmh_get_windows_reply_t *atoms,
0562                                         xcb_get_property_reply_t *r);
0563 
0564 uint8_t xcb_ewmh_get_utf8_strings_from_reply(xcb_ewmh_connection_t *ewmh,
0565                                              xcb_ewmh_get_utf8_strings_reply_t *data,
0566                                              xcb_get_property_reply_t *r);
0567 
0568 uint8_t xcb_ewmh_get_utf8_strings_reply(xcb_ewmh_connection_t *ewmh,
0569                                         xcb_get_property_cookie_t cookie,
0570                                         xcb_ewmh_get_utf8_strings_reply_t *data,
0571                                         xcb_generic_error_t **e);
0572 
0573 /**
0574  * @brief Get a list of atoms  from the reply of a GetProperty request
0575  * whose type is WINDOW
0576  *
0577  * This function  is called by all  the xcb_ewmh_get_*_reply functions
0578  * whose  should   be  used  instead  of  calling   it  directly.  The
0579  * GetProperty request  has been previously sent  by the corresponding
0580  * xcb_ewmh_get_*.
0581  *
0582  * @param ewmh The per-screen EWMH specific information
0583  * @param cookie The GetProperty cookie
0584  * @param atoms The atoms list
0585  * @param e The error if any
0586  * @return Return 1 on success, 0 otherwise
0587  */
0588 uint8_t xcb_ewmh_get_windows_reply(xcb_ewmh_connection_t *ewmh,
0589                                    xcb_get_property_cookie_t cookie,
0590                                    xcb_ewmh_get_windows_reply_t *atoms,
0591                                    xcb_generic_error_t **e);
0592 
0593 /**
0594  * @brief Wipe the windows list reply
0595  *
0596  * This function must  be called to the free  the memory allocated for
0597  * windows when the reply is requested in '_reply' functions.
0598  *
0599  * @param data The X reply to be freed
0600  */
0601 void xcb_ewmh_get_windows_reply_wipe(xcb_ewmh_get_windows_reply_t *data);
0602 
0603 /**
0604  * @brief Wipe the UTF-8 strings list reply
0605  *
0606  * This function must  be called to the free  the memory allocated for
0607  * UTF-8 strings when the reply is requested in '_reply' functions.
0608  *
0609  * @param data The X reply to be freed
0610  */
0611 void xcb_ewmh_get_utf8_strings_reply_wipe(xcb_ewmh_get_utf8_strings_reply_t *data);
0612 
0613 /**
0614  * @brief Send a ChangeProperty request for _NET_SUPPORTED
0615  *
0616  * _NET_SUPPORTED, ATOM[]/32
0617  *
0618  * @param ewmh The per-screen EWMH information
0619  * @param screen_nbr The screen number
0620  * @param list_len The number of Atoms supported by the WM
0621  * @param list The Atoms supported by the WM
0622  * @return Cookie associated with the ChangeProperty _NET_SUPPORTED request
0623  */
0624 xcb_void_cookie_t xcb_ewmh_set_supported(xcb_ewmh_connection_t *ewmh,
0625                                          int screen_nbr,
0626                                          uint32_t list_len,
0627                                          xcb_atom_t *list);
0628 
0629 /**
0630  * @see xcb_ewmh_set_supported
0631  */
0632 xcb_void_cookie_t xcb_ewmh_set_supported_checked(xcb_ewmh_connection_t *ewmh,
0633                                                  int screen_nbr,
0634                                                  uint32_t list_len,
0635                                                  xcb_atom_t *list);
0636 
0637 /**
0638  * @brief Send  GetProperty request to get  _NET_SUPPORTED root window
0639  *        property
0640  *
0641  * _NET_SUPPORTED, ATOM[]/32
0642  *
0643  * This property MUST  be set by the Window  Manager to indicate which
0644  * hints it supports. For example: considering _NET_WM_STATE both this
0645  * atom   and   all   supported  states   e.g.    _NET_WM_STATE_MODAL,
0646  * _NET_WM_STATE_STICKY, would be  listed. This assumes that backwards
0647  * incompatible changes will  not be made to the  hints (without being
0648  * renamed).
0649  *
0650  * This form can be used only if  the request will cause a reply to be
0651  * generated. Any returned error will be placed in the event queue.
0652  *
0653  * @param ewmh The information relative to EWMH
0654  * @param screen_nbr The screen number
0655  * @return The _NET_SUPPORTED cookie of the GetProperty request
0656  */
0657 xcb_get_property_cookie_t xcb_ewmh_get_supported_unchecked(xcb_ewmh_connection_t *ewmh,
0658                                                            int screen_nbr);
0659 
0660 /**
0661  * @see xcb_ewmh_get_supported_unchecked
0662  */
0663 xcb_get_property_cookie_t xcb_ewmh_get_supported(xcb_ewmh_connection_t *ewmh,
0664                                                  int screen_nbr);
0665 
0666 /**
0667  * @brief Get the list of supported atoms
0668  *
0669  * @param supported The list of atoms contained in the reply
0670  * @param r GetProperty _NET_SUPPORTED reply
0671  */
0672 static inline uint8_t
0673 xcb_ewmh_get_supported_from_reply(xcb_ewmh_get_atoms_reply_t *supported,
0674                                   xcb_get_property_reply_t *r)
0675 {
0676   return xcb_ewmh_get_atoms_from_reply(supported, r);
0677 }
0678 
0679 /**
0680  * @brief Get reply from the GetProperty _NET_SUPPORTED cookie
0681  *
0682  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
0683  * xcb_get_window_supported_unchecked() is used.  Otherwise, it stores
0684  * the error if any.
0685  *
0686  * @param ewmh The information relative to EWMH
0687  * @param cookie The _NET_SUPPORTED GetProperty request cookie
0688  * @param supported The reply to be filled
0689  * @param The xcb_generic_error_t supplied
0690  * @return Return 1 on success, 0 otherwise
0691  */
0692 static inline uint8_t
0693 xcb_ewmh_get_supported_reply(xcb_ewmh_connection_t *ewmh,
0694                              xcb_get_property_cookie_t cookie,
0695                              xcb_ewmh_get_atoms_reply_t *supported,
0696                              xcb_generic_error_t **e)
0697 {
0698   return xcb_ewmh_get_atoms_reply(ewmh, cookie, supported, e);
0699 }
0700 
0701 /**
0702  * @brief Send a ChangeProperty request for _NET_CLIENT_LIST
0703  *
0704  * _NET_CLIENT_LIST, WINDOW[]/32
0705  *
0706  * @param ewmh The per-screen EWMH information
0707  * @param screen_nbr The screen number
0708  * @param list_len The number of Atoms supported by the WM
0709  * @param list The Atoms supported by the WM
0710  * @return Cookie associated with the ChangeProperty _NET_CLIENT_LIST request
0711  */
0712 xcb_void_cookie_t xcb_ewmh_set_client_list(xcb_ewmh_connection_t *ewmh,
0713                                            int screen_nbr,
0714                                            uint32_t list_len,
0715                                            xcb_window_t *list);
0716 
0717 /**
0718  * @see xcb_ewmh_set_client_list
0719  */
0720 xcb_void_cookie_t xcb_ewmh_set_client_list_checked(xcb_ewmh_connection_t *ewmh,
0721                                                    int screen_nbr,
0722                                                    uint32_t list_len,
0723                                                    xcb_window_t *list);
0724 
0725 /**
0726  * @brief Send GetProperty request to get _NET_CLIENT_LIST root window
0727  *        property
0728  *
0729  * This  array   contains  all  X   Windows  managed  by   the  Window
0730  * Manager. _NET_CLIENT_LIST has  initial mapping order, starting with
0731  * the oldest window.  This property SHOULD be set  and updated by the
0732  * Window Manager.
0733  *
0734  * @param ewmh The information relative to EWMH.
0735  * @return The _NET_CLIENT_LIST cookie of the GetProperty request.
0736  */
0737 xcb_get_property_cookie_t xcb_ewmh_get_client_list_unchecked(xcb_ewmh_connection_t *ewmh,
0738                                                              int screen_nbr);
0739 
0740 /**
0741  * @brief Send GetProperty request to get _NET_CLIENT_LIST root window
0742  *        property
0743  *
0744  * @see xcb_ewmh_get_client_list_unchecked
0745  * @param ewmh The information relative to EWMH.
0746  * @return The _NET_CLIENT_LIST cookie of the GetProperty request.
0747  */
0748 xcb_get_property_cookie_t xcb_ewmh_get_client_list(xcb_ewmh_connection_t *ewmh,
0749                                                    int screen_nbr);
0750 
0751 /**
0752  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
0753  * _NET_CLIENT_LIST reply
0754  *
0755  * @param clients The list of clients contained in the reply
0756  * @param r GetProperty _NET_CLIENT_LIST reply
0757  */
0758 static inline uint8_t
0759 xcb_ewmh_get_client_list_from_reply(xcb_ewmh_get_windows_reply_t *clients,
0760                                     xcb_get_property_reply_t *r)
0761 {
0762   return xcb_ewmh_get_windows_from_reply(clients, r);
0763 }
0764 
0765 /**
0766  * @brief Get reply from the GetProperty _NET_CLIENT_LIST cookie
0767  *
0768  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
0769  * xcb_get_window_client_list_unchecked()  is   used.   Otherwise,  it
0770  * stores the error if any.
0771  *
0772  * @param ewmh The information relative to EWMH
0773  * @param cookie The _NET_CLIENT_LIST GetProperty request cookie
0774  * @param clients The list of clients to be filled
0775  * @param The xcb_generic_error_t supplied
0776  * @return Return 1 on success, 0 otherwise
0777  */
0778 static inline uint8_t
0779 xcb_ewmh_get_client_list_reply(xcb_ewmh_connection_t *ewmh,
0780                                xcb_get_property_cookie_t cookie,
0781                                xcb_ewmh_get_windows_reply_t *clients,
0782                                xcb_generic_error_t **e)
0783 {
0784   return xcb_ewmh_get_windows_reply(ewmh, cookie, clients, e);
0785 }
0786 
0787 /**
0788  * @brief Send a ChangeProperty request for _NET_CLIENT_LIST_STACKING
0789  *
0790  * _NET_CLIENT_LIST_STACKING, WINDOW[]/32
0791  *
0792  * @param ewmh The per-screen EWMH information
0793  * @param screen_nbr The screen number
0794  * @param list_len The number of Atoms supported by the WM
0795  * @param list The Atoms supported by the WM
0796  * @return Cookie associated with the ChangeProperty _NET_CLIENT_LIST_STACKING request
0797  */
0798 xcb_void_cookie_t xcb_ewmh_set_client_list_stacking(xcb_ewmh_connection_t *ewmh,
0799                                                     int screen_nbr,
0800                                                     uint32_t list_len,
0801                                                     xcb_window_t *list);
0802 
0803 /**
0804  * @see xcb_ewmh_set_client_list_stacking
0805  */
0806 xcb_void_cookie_t xcb_ewmh_set_client_list_stacking_checked(xcb_ewmh_connection_t *ewmh,
0807                                                             int screen_nbr,
0808                                                             uint32_t list_len,
0809                                                             xcb_window_t *list);
0810 
0811 /**
0812  * @brief  Send GetProperty  request to  get _NET_CLIENT_LIST_STACKING
0813  *        root window property
0814  *
0815  * This  array   contains  all  X   Windows  managed  by   the  Window
0816  * Manager.  _NET_CLIENT_LIST_STACKING   has  initial  mapping  order,
0817  * starting with the  oldest window.  This property SHOULD  be set and
0818  * updated by the Window Manager.
0819  *
0820  * @param ewmh The information relative to EWMH
0821  * @return The _NET_CLIENT_LIST_STACKING cookie of the GetProperty request
0822  */
0823 xcb_get_property_cookie_t xcb_ewmh_get_client_list_stacking_unchecked(xcb_ewmh_connection_t *ewmh,
0824                                                                       int screen_nbr);
0825 
0826 /**
0827  * @see xcb_ewmh_get_client_list_unchecked
0828  */
0829 xcb_get_property_cookie_t xcb_ewmh_get_client_list_stacking(xcb_ewmh_connection_t *ewmh,
0830                                                             int screen_nbr);
0831 
0832 /**
0833  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
0834  * _NET_CLIENT_LIST_STACKING reply
0835  *
0836  * @param clients The list of clients contained in the reply
0837  * @param r GetProperty _NET_CLIENT_LIST_STACKING reply
0838  */
0839 static inline uint8_t
0840 xcb_ewmh_get_client_list_stacking_from_reply(xcb_ewmh_get_windows_reply_t *clients,
0841                                              xcb_get_property_reply_t *r)
0842 {
0843   return xcb_ewmh_get_windows_from_reply(clients, r);
0844 }
0845 
0846 /**
0847  * @brief  Get reply  from  the GetProperty  _NET_CLIENT_LIST_STACKING
0848  * cookie
0849  *
0850  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
0851  * xcb_get_window_client_list_stacking_unchecked()       is      used.
0852  * Otherwise, it stores the error if any.
0853  *
0854  * @param ewmh The information relative to EWMH
0855  * @param cookie The _NET_CLIENT_LIST_STACKING GetProperty request cookie
0856  * @param clients The list of clients to be filled
0857  * @param The xcb_generic_error_t supplied
0858  * @return Return 1 on success, 0 otherwise
0859  */
0860 static inline uint8_t
0861 xcb_ewmh_get_client_list_stacking_reply(xcb_ewmh_connection_t *ewmh,
0862                                         xcb_get_property_cookie_t cookie,
0863                                         xcb_ewmh_get_windows_reply_t *clients,
0864                                         xcb_generic_error_t **e)
0865 {
0866   return xcb_ewmh_get_windows_reply(ewmh, cookie, clients, e);
0867 }
0868 
0869 /**
0870  * @brief Send a ChangeProperty request for _NET_NUMBER_OF_DESKTOPS
0871  *
0872  * _NET_NUMBER_OF_DESKTOPS? CARDINAL/32
0873  *
0874  * @param ewmh The per-screen EWMH information
0875  * @param screen_nbr The screen number
0876  * @param number_of_desktops The number of desktops
0877  * @return Cookie associated with the ChangeProperty _NET_NUMBER_OF_DESKTOPS request
0878  */
0879 xcb_void_cookie_t xcb_ewmh_set_number_of_desktops(xcb_ewmh_connection_t *ewmh,
0880                                                   int screen_nbr,
0881                                                   uint32_t number_of_desktops);
0882 
0883 /**
0884  * @see xcb_ewmh_set_number_of_desktops
0885  */
0886 xcb_void_cookie_t xcb_ewmh_set_number_of_desktops_checked(xcb_ewmh_connection_t *ewmh,
0887                                                           int screen_nbr,
0888                                                           uint32_t number_of_desktops);
0889 
0890 /**
0891  * @brief Send GetProperty request to get _NET_NUMBER_OF_DESKTOPS root
0892  *        window property
0893  *
0894  * @param ewmh The information relative to EWMH
0895  * @param screen_nbr The screen number
0896  * @return The _NET_NUMBER_OF_DESKTOPS cookie of the GetProperty request.
0897  */
0898 xcb_get_property_cookie_t xcb_ewmh_get_number_of_desktops_unchecked(xcb_ewmh_connection_t *ewmh,
0899                                                                     int screen_nbr);
0900 
0901 /**
0902  * @see xcb_ewmh_get_number_of_desktops_unchecked
0903  */
0904 xcb_get_property_cookie_t xcb_ewmh_get_number_of_desktops(xcb_ewmh_connection_t *ewmh,
0905                                                           int screen_nbr);
0906 
0907 /**
0908  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
0909  * _NET_NUMBER_OF_DESKTOPS reply
0910  *
0911  * @param clients The list of clients contained in the reply
0912  * @param r GetProperty _NET_NUMBER_OF_DESKTOPS reply
0913  * @return Return 1 on success, 0 otherwise
0914  */
0915 static inline uint8_t
0916 xcb_ewmh_get_number_of_desktops_from_reply(uint32_t *number_of_desktops,
0917                                            xcb_get_property_reply_t *r)
0918 {
0919   return xcb_ewmh_get_cardinal_from_reply(number_of_desktops, r);
0920 }
0921 
0922 /**
0923  * @brief Get reply from the GetProperty _NET_NUMBER_OF_DESKTOPS cookie
0924  *
0925  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
0926  * xcb_get_window_number_of_desktops_unchecked()  is used.  Otherwise,
0927  * it stores the error if any.
0928  *
0929  * @param ewmh The information relative to EWMH
0930  * @param cookie The _NET_NUMBER_OF_DESKTOPS GetProperty request cookie
0931  * @param supported The reply to be filled
0932  * @param The xcb_generic_error_t supplied
0933  * @return Return 1 on success, 0 otherwise
0934  */
0935 static inline uint8_t
0936 xcb_ewmh_get_number_of_desktops_reply(xcb_ewmh_connection_t *ewmh,
0937                                       xcb_get_property_cookie_t cookie,
0938                                       uint32_t *number_of_desktops,
0939                                       xcb_generic_error_t **e)
0940 {
0941   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, number_of_desktops, e);
0942 }
0943 
0944 static inline xcb_void_cookie_t
0945 xcb_ewmh_request_change_number_of_desktops(xcb_ewmh_connection_t *ewmh,
0946                                            int screen_nbr,
0947                                            uint32_t new_number_of_desktops)
0948 {
0949   return xcb_ewmh_send_client_message(ewmh->connection, XCB_NONE,
0950                                       ewmh->screens[screen_nbr]->root,
0951                                       ewmh->_NET_NUMBER_OF_DESKTOPS,
0952                                       sizeof(new_number_of_desktops),
0953                                       &new_number_of_desktops);
0954 }
0955 
0956 /**
0957  * @brief Send a ChangeProperty request for _NET_DESKTOP_GEOMETRY
0958  *
0959  * _NET_DESKTOP_GEOMETRY width, height, CARDINAL[2]/32
0960  *
0961  * @param ewmh The per-screen EWMH information
0962  * @param screen_nbr The screen number
0963  * @param new_width The new desktop width
0964  * @param new_height The new desktop height
0965  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_GEOMETRY request
0966  */
0967 xcb_void_cookie_t xcb_ewmh_set_desktop_geometry(xcb_ewmh_connection_t *ewmh,
0968                                                 int screen_nbr,
0969                                                 uint32_t new_width,
0970                                                 uint32_t new_height);
0971 
0972 /**
0973  * @see xcb_ewmh_set_desktop_geometry
0974  */
0975 xcb_void_cookie_t xcb_ewmh_set_desktop_geometry_checked(xcb_ewmh_connection_t *ewmh,
0976                                                         int screen_nbr,
0977                                                         uint32_t new_width,
0978                                                         uint32_t new_height);
0979 
0980 /**
0981  * @brief Send  GetProperty request to  get _NET_DESKTOP_GEOMETRY root
0982  *        window property
0983  *
0984  * @param ewmh The information relative to EWMH
0985  * @param screen_nbr The screen number
0986  * @return The _NET_DESKTOP_GEOMETRY cookie of the GetProperty request
0987  */
0988 xcb_get_property_cookie_t xcb_ewmh_get_desktop_geometry_unchecked(xcb_ewmh_connection_t *ewmh,
0989                                                                   int screen_nbr);
0990 
0991 /**
0992  * @see xcb_ewmh_get_desktop_geometry_unchecked
0993  */
0994 xcb_get_property_cookie_t xcb_ewmh_get_desktop_geometry(xcb_ewmh_connection_t *ewmh,
0995                                                         int screen_nbr);
0996 
0997 /**
0998  * @brief Send ClientMessage requesting to change the _NET_DESKTOP_GEOMETRY
0999  *
1000  * @param ewmh The per-screen EWMH information
1001  * @param screen_nbr The screen number
1002  * @param new_width The new desktop width
1003  * @param new_height The new desktop height
1004  * @return The SendEvent cookie
1005  */
1006 xcb_void_cookie_t xcb_ewmh_request_change_desktop_geometry(xcb_ewmh_connection_t *ewmh,
1007                                                            int screen_nbr,
1008                                                            uint32_t new_width,
1009                                                            uint32_t new_height);
1010 
1011 /**
1012  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1013  * _NET_DESKTOP_GEOMETRY reply
1014  *
1015  * @param width The current desktop width
1016  * @param height The current desktop height
1017  * @param r GetProperty _NET_DESKTOP_GEOMETRY reply
1018  * @return Return 1 on success, 0 otherwise
1019  */
1020 uint8_t xcb_ewmh_get_desktop_geometry_from_reply(uint32_t *width,
1021                                                  uint32_t *height,
1022                                                  xcb_get_property_reply_t *r);
1023 
1024 /**
1025  * @brief Get reply from the GetProperty _NET_DESKTOP_GEOMETRY cookie
1026  *
1027  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1028  * xcb_get_desktop_geometry_unchecked() is used.  Otherwise, it stores
1029  * the error if any.
1030  *
1031  * @param ewmh The information relative to EWMH
1032  * @param cookie The _NET_DESKTOP_GEOMETRY GetProperty request cookie
1033  * @param width The current desktop width
1034  * @param width The current desktop height
1035  * @param The xcb_generic_error_t supplied
1036  * @return Return 1 on success, 0 otherwise
1037  */
1038 uint8_t xcb_ewmh_get_desktop_geometry_reply(xcb_ewmh_connection_t *ewmh,
1039                                             xcb_get_property_cookie_t cookie,
1040                                             uint32_t *width, uint32_t *height,
1041                                             xcb_generic_error_t **e);
1042 
1043 /**
1044  * @brief Send a ChangeProperty request for _NET_DESKTOP_VIEWPORT
1045  *
1046  * _NET_DESKTOP_VIEWPORT x, y, CARDINAL[][2]/32
1047  *
1048  * @param ewmh The per-screen EWMH information
1049  * @param screen_nbr The screen number
1050  * @param list_len The number of desktop viewports
1051  * @param list The desktop viewports
1052  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_VIEWPORT request
1053  */
1054 xcb_void_cookie_t xcb_ewmh_set_desktop_viewport(xcb_ewmh_connection_t *ewmh,
1055                                                 int screen_nbr,
1056                                                 uint32_t list_len,
1057                                                 xcb_ewmh_coordinates_t *list);
1058 
1059 /**
1060  * @see xcb_ewmh_set_desktop_viewport
1061  */
1062 xcb_void_cookie_t xcb_ewmh_set_desktop_viewport_checked(xcb_ewmh_connection_t *ewmh,
1063                                                         int screen_nbr,
1064                                                         uint32_t list_len,
1065                                                         xcb_ewmh_coordinates_t *list);
1066 
1067 /**
1068  * @brief Send  GetProperty request to  get _NET_DESKTOP_VIEWPORT root
1069  *        window property
1070  *
1071  * @param ewmh The information relative to EWMH
1072  * @param screen_nbr The screen number
1073  * @return The _NET_DESKTOP_VIEWPORT cookie of the GetProperty request
1074  */
1075 xcb_get_property_cookie_t xcb_ewmh_get_desktop_viewport_unchecked(xcb_ewmh_connection_t *ewmh,
1076                                                                   int screen_nbr);
1077 
1078 /**
1079  * @see xcb_ewmh_get_desktop_viewport_unchecked
1080  */
1081 xcb_get_property_cookie_t xcb_ewmh_get_desktop_viewport(xcb_ewmh_connection_t *ewmh,
1082                                                         int screen_nbr);
1083 
1084 /**
1085  * @brief Send ClientMessage requesting to change the _NET_DESKTOP_VIEWPORT
1086  *
1087  * @param ewmh The per-screen EWMH information
1088  * @param screen_nbr The screen number
1089  * @param new_x The new x coordinate
1090  * @param new_y The new y coordinate
1091  * @return The SendEvent cookie
1092  */
1093 xcb_void_cookie_t xcb_ewmh_request_change_desktop_viewport(xcb_ewmh_connection_t *ewmh,
1094                                                            int screen_nbr,
1095                                                            uint32_t x, uint32_t y);
1096 
1097 /**
1098  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1099  * _NET_DESKTOP_VIEWPORT reply
1100  *
1101  * @param vp The  current desktop viewports
1102  * @param r GetProperty _NET_DESKTOP_VIEWPORT reply
1103  * @return Return 1 on success, 0 otherwise
1104  */
1105 uint8_t xcb_ewmh_get_desktop_viewport_from_reply(xcb_ewmh_get_desktop_viewport_reply_t *vp,
1106                                                  xcb_get_property_reply_t *r);
1107 
1108 /**
1109  * @brief Get reply from the GetProperty _NET_DESKTOP_VIEWPORT cookie
1110  *
1111  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1112  * xcb_get_desktop_viewport_unchecked() is used.  Otherwise, it stores
1113  * the error if any.
1114  *
1115  * @param ewmh The information relative to EWMH
1116  * @param cookie The _NET_DESKTOP_VIEWPORT GetProperty request cookie
1117  * @param vp The current desktop viewports
1118  * @param The xcb_generic_error_t supplied
1119  * @return Return 1 on success, 0 otherwise
1120  */
1121 uint8_t xcb_ewmh_get_desktop_viewport_reply(xcb_ewmh_connection_t *ewmh,
1122                                             xcb_get_property_cookie_t cookie,
1123                                             xcb_ewmh_get_desktop_viewport_reply_t *vp,
1124                                             xcb_generic_error_t **e);
1125 
1126 /**
1127  * @brief Wipe the desktop viewports list reply
1128  *
1129  * This function must be called to free the memory allocated for atoms
1130  * when the reply  is requested in xcb_ewmh_get_desktop_viewport_reply
1131  * function.
1132  *
1133  * @param r The X reply to be freed
1134  */
1135 void xcb_ewmh_get_desktop_viewport_reply_wipe(xcb_ewmh_get_desktop_viewport_reply_t *r);
1136 
1137 /**
1138  * @brief Send a ChangeProperty request for _NET_CURRENT_DESKTOP
1139  *
1140  * _NET_CURRENT_DESKTOP desktop, CARDINAL/32
1141  *
1142  * @param ewmh The per-screen EWMH information
1143  * @param screen_nbr The screen number
1144  * @param new_current_desktop The new current desktop
1145  * @return Cookie associated with the ChangeProperty _NET_CURRENT_DESKTOP request
1146  */
1147 xcb_void_cookie_t xcb_ewmh_set_current_desktop(xcb_ewmh_connection_t *ewmh,
1148                                                int screen_nbr,
1149                                                uint32_t new_current_desktop);
1150 
1151 /**
1152  * @see xcb_ewmh_set_current_desktop
1153  */
1154 xcb_void_cookie_t xcb_ewmh_set_current_desktop_checked(xcb_ewmh_connection_t *ewmh,
1155                                                        int screen_nbr,
1156                                                        uint32_t new_current_desktop);
1157 
1158 /**
1159  * @brief  Send GetProperty request  to get  _NET_CURRENT_DESKTOP root
1160  *        window property
1161  *
1162  * @param ewmh The information relative to EWMH
1163  * @param screen_nbr The screen number
1164  * @return The _NET_CURRENT_DESKTOP cookie of the GetProperty request
1165  */
1166 xcb_get_property_cookie_t xcb_ewmh_get_current_desktop_unchecked(xcb_ewmh_connection_t *ewmh,
1167                                                                  int screen_nbr);
1168 
1169 /**
1170  * @see xcb_ewmh_get_current_desktop_unchecked
1171  */
1172 xcb_get_property_cookie_t xcb_ewmh_get_current_desktop(xcb_ewmh_connection_t *ewmh,
1173                                                        int screen_nbr);
1174 
1175 /**
1176  * @brief Send ClientMessage requesting to change the _NET_CURRENT_DESKTOP
1177  *
1178  * @param ewmh The per-screen EWMH information
1179  * @param screen_nbr The screen number
1180  * @param new_desktop The new current desktop
1181  * @param timestamp The request timestamp
1182  * @return The SendEvent cookie
1183  */
1184 xcb_void_cookie_t xcb_ewmh_request_change_current_desktop(xcb_ewmh_connection_t *ewmh,
1185                                                           int screen_nbr,
1186                                                           uint32_t new_desktop,
1187                                                           xcb_timestamp_t timestamp);
1188 
1189 /**
1190  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1191  * _NET_CURRENT_DESKTOP reply
1192  *
1193  * @param current_desktop The  current desktop
1194  * @param r GetProperty _NET_CURRENT_DESKTOP reply
1195  * @return Return 1 on success, 0 otherwise
1196  */
1197 static inline uint8_t
1198 xcb_ewmh_get_current_desktop_from_reply(uint32_t *current_desktop,
1199                                         xcb_get_property_reply_t *r)
1200 {
1201   return xcb_ewmh_get_cardinal_from_reply(current_desktop, r);
1202 }
1203 
1204 /**
1205  * @brief Get reply from the GetProperty _NET_CURRENT_DESKTOP cookie
1206  *
1207  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1208  * xcb_get_current_desktop_unchecked() is  used.  Otherwise, it stores
1209  * the error if any.
1210  *
1211  * @param ewmh The information relative to EWMH
1212  * @param cookie The _NET_CURRENT_DESKTOP GetProperty request cookie
1213  * @param vp The current desktop
1214  * @param The xcb_generic_error_t supplied
1215  * @return Return 1 on success, 0 otherwise
1216  */
1217 static inline uint8_t
1218 xcb_ewmh_get_current_desktop_reply(xcb_ewmh_connection_t *ewmh,
1219                                    xcb_get_property_cookie_t cookie,
1220                                    uint32_t *current_desktop,
1221                                    xcb_generic_error_t **e)
1222 {
1223   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, current_desktop, e);
1224 }
1225 
1226 /**
1227  * @brief Send a ChangeProperty request for _NET_DESKTOP_NAMES
1228  *
1229  * _NET_DESKTOP_NAMES, UTF8_STRING[]
1230  *
1231  * @param ewmh The per-screen EWMH information
1232  * @param screen_nbr The screen number
1233  * @param strings_len The number of desktop names
1234  * @param strings The desktop names
1235  * @return Cookie associated with the ChangeProperty _NET_DESKTOP_NAMES request
1236  */
1237 xcb_void_cookie_t xcb_ewmh_set_desktop_names(xcb_ewmh_connection_t *ewmh,
1238                                              int screen_nbr,
1239                                              uint32_t strings_len,
1240                                              const char *strings);
1241 
1242 /**
1243  * @see xcb_ewmh_set_desktop_names
1244  */
1245 xcb_void_cookie_t xcb_ewmh_set_desktop_names_checked(xcb_ewmh_connection_t *ewmh,
1246                                                      int screen_nbr,
1247                                                      uint32_t strings_len,
1248                                                      const char *strings);
1249 
1250 /**
1251  * @brief  Send  GetProperty request  to  get _NET_DESKTOP_NAMES  root
1252  *        window property
1253  *
1254  * @param ewmh The information relative to EWMH
1255  * @return The _NET_DESKTOP_NAMES cookie of the GetProperty request
1256  */
1257 xcb_get_property_cookie_t xcb_ewmh_get_desktop_names_unchecked(xcb_ewmh_connection_t *ewmh,
1258                                                                int screen_nbr);
1259 
1260 /**
1261  * @see xcb_ewmh_get_desktop_names_unchecked
1262  */
1263 xcb_get_property_cookie_t xcb_ewmh_get_desktop_names(xcb_ewmh_connection_t *ewmh,
1264                                                      int screen_nbr);
1265 
1266 /**
1267  * @brief    Get   the   desktop    geometry   from    a   GetProperty
1268  * _NET_DESKTOP_NAMES reply
1269  *
1270  * @param ewmh The information relative to EWMH
1271  * @param names The desktop names
1272  * @param r GetProperty _NET_DESKTOP_NAMES reply
1273  * @return Return 1 on success, 0 otherwise
1274  */
1275 static inline uint8_t
1276 xcb_ewmh_get_desktop_names_from_reply(xcb_ewmh_connection_t *ewmh,
1277                                       xcb_ewmh_get_utf8_strings_reply_t *names,
1278                                       xcb_get_property_reply_t *r)
1279 {
1280   return xcb_ewmh_get_utf8_strings_from_reply(ewmh, names, r);
1281 }
1282 
1283 /**
1284  * @brief Get reply from the GetProperty _NET_DESKTOP_NAMES cookie
1285  *
1286  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1287  * xcb_get_desktop_names_unchecked()  is used.   Otherwise,  it stores
1288  * the error if any.
1289  *
1290  * @param ewmh The information relative to EWMH
1291  * @param cookie The _NET_DESKTOP_NAMES GetProperty request cookie
1292  * @param names The desktop names
1293  * @param The xcb_generic_error_t supplied
1294  * @return Return 1 on success, 0 otherwise
1295  */
1296 static inline uint8_t
1297 xcb_ewmh_get_desktop_names_reply(xcb_ewmh_connection_t *ewmh,
1298                                  xcb_get_property_cookie_t cookie,
1299                                  xcb_ewmh_get_utf8_strings_reply_t *names,
1300                                  xcb_generic_error_t **e)
1301 {
1302   return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, names, e);
1303 }
1304 
1305 /**
1306  * @brief Send a ChangeProperty request for _NET_ACTIVE_WINDOW
1307  *
1308  * _NET_ACTIVE_WINDOW, WINDOW/32
1309  *
1310  * @param ewmh The per-screen EWMH information
1311  * @param screen_nbr The screen number
1312  * @param new_active_window The window to make active
1313  * @return Cookie associated with the ChangeProperty _NET_ACTIVE_WINDOW request
1314  */
1315 xcb_void_cookie_t xcb_ewmh_set_active_window(xcb_ewmh_connection_t *ewmh,
1316                                              int screen_nbr,
1317                                              xcb_window_t new_active_window);
1318 
1319 /**
1320  * @see xcb_ewmh_set_active_window
1321  */
1322 xcb_void_cookie_t xcb_ewmh_set_active_window_checked(xcb_ewmh_connection_t *ewmh,
1323                                                      int screen_nbr,
1324                                                      xcb_window_t new_active_window);
1325 
1326 /**
1327  * @brief Send ClientMessage requesting to change the _NET_ACTIVE_WINDOW
1328  *
1329  * The window ID  of the currently active window or  None if no window
1330  * has  the focus.  This  is a  read-only property  set by  the Window
1331  * Manager. If a Client wants to activate another window, it MUST send
1332  * a  _NET_ACTIVE_WINDOW  client  message  to  the  root  window.  The
1333  * timestamp is Client's  last user activity timestamp at  the time of
1334  * the request, and the currently active window is the Client's active
1335  * toplevel window, if any (the Window Manager may be e.g. more likely
1336  * to obey  the request  if it will  mean transferring focus  from one
1337  * active window to another).
1338  *
1339  * @see xcb_ewmh_client_source_type_t
1340  * @param ewmh The information relative to EWMH
1341  * @param screen_nbr The screen number
1342  * @param window_to_active The window ID to activate
1343  * @param source_indication The source indication
1344  * @param timestamp The client's last user activity timestamp
1345  * @param current_active_window The currently active window or None
1346  */
1347 xcb_void_cookie_t xcb_ewmh_request_change_active_window(xcb_ewmh_connection_t *ewmh,
1348                                                         int screen_nbr,
1349                                                         xcb_window_t window_to_activate,
1350                                                         xcb_ewmh_client_source_type_t source_indication,
1351                                                         xcb_timestamp_t timestamp,
1352                                                         xcb_window_t current_active_window);
1353 
1354 /**
1355  * @brief  Send  GetProperty request  to  get _NET_ACTIVE_WINDOW  root
1356  *        window property
1357  *
1358  * The window ID  of the currently active window or  None if no window
1359  * has  the focus.  This is  a read-only  property set  by  the Window
1360  * Manager.  This property  SHOULD be  set and  updated by  the Window
1361  * Manager.
1362  *
1363  * This form can be used only if  the request will cause a reply to be
1364  * generated. Any returned error will be placed in the event queue.
1365  *
1366  * @param ewmh The information relative to EWMH
1367  * @param screen_nbr The screen number
1368  * @return The _NET_ACTIVE_WINDOW cookie of the GetProperty request
1369  */
1370 xcb_get_property_cookie_t xcb_ewmh_get_active_window_unchecked(xcb_ewmh_connection_t *ewmh,
1371                                                                int screen_nbr);
1372 
1373 /**
1374  * @brief  Send  GetProperty request  to  get _NET_ACTIVE_WINDOW  root
1375  *        window property
1376  *
1377  * @see xcb_ewmh_get_active_window_unchecked
1378  * @param ewmh The information relative to EWMH
1379  * @param screen_nbr The screen number
1380  * @return The _NET_ACTIVE_WINDOW cookie of the GetProperty request
1381  */
1382 xcb_get_property_cookie_t xcb_ewmh_get_active_window(xcb_ewmh_connection_t *ewmh,
1383                                                      int screen_nbr);
1384 
1385 /**
1386  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
1387  * _NET_ACTIVE_WINDOW reply
1388  *
1389  * @param active_window The current active window
1390  * @param r GetProperty _NET_ACTIVE_WINDOW_OF_DESKTOPS reply
1391  * @return Return 1 on success, 0 otherwise
1392  */
1393 static inline uint8_t
1394 xcb_ewmh_get_active_window_from_reply(xcb_window_t *active_window,
1395                                       xcb_get_property_reply_t *r)
1396 {
1397   return xcb_ewmh_get_window_from_reply(active_window, r);
1398 }
1399 
1400 /**
1401  * @brief Get reply from the GetProperty _NET_ACTIVE_WINDOW cookie
1402  *
1403  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1404  * xcb_get_active_window_unchecked()  is used.   Otherwise,  it stores
1405  * the error if any.
1406  *
1407  * @param ewmh The information relative to EWMH.
1408  * @param cookie The _NET_ACTIVE_WINDOW GetProperty request cookie.
1409  * @param active_window The reply to be filled.
1410  * @param The xcb_generic_error_t supplied.
1411  * @return Return 1 on success, 0 otherwise.
1412  */
1413 static inline uint8_t
1414 xcb_ewmh_get_active_window_reply(xcb_ewmh_connection_t *ewmh,
1415                                  xcb_get_property_cookie_t cookie,
1416                                  xcb_window_t *active_window,
1417                                  xcb_generic_error_t **e)
1418 {
1419   return xcb_ewmh_get_window_reply(ewmh, cookie, active_window, e);
1420 }
1421 
1422 /**
1423  * @brief Send a ChangeProperty request for _NET_WORKAREA
1424  *
1425  * _NET_WORKAREA, x, y, width, height CARDINAL[][4]/32
1426  *
1427  * @param ewmh The per-screen EWMH information
1428  * @param screen_nbr The screen number
1429  * @param list_len The number of desktops workareas
1430  * @param list The desktops workareas
1431  * @return Cookie associated with the ChangeProperty _NET_WORKAREA request
1432  */
1433 xcb_void_cookie_t xcb_ewmh_set_workarea(xcb_ewmh_connection_t *ewmh,
1434                                         int screen_nbr,
1435                                         uint32_t list_len,
1436                                         xcb_ewmh_geometry_t *list);
1437 
1438 /**
1439  * @see xcb_ewmh_set_workarea
1440  */
1441 xcb_void_cookie_t xcb_ewmh_set_workarea_checked(xcb_ewmh_connection_t *ewmh,
1442                                                 int screen_nbr,
1443                                                 uint32_t list_len,
1444                                                 xcb_ewmh_geometry_t *list);
1445 
1446 /**
1447  * @brief  Send  GetProperty request  to  get _NET_WORKAREA  root
1448  *        window property
1449  *
1450  * @param ewmh The information relative to EWMH
1451  * @param screen_nbr The screen number
1452  * @return The _NET_WORKAREA cookie of the GetProperty request
1453  */
1454 xcb_get_property_cookie_t xcb_ewmh_get_workarea_unchecked(xcb_ewmh_connection_t *ewmh,
1455                                                           int screen_nbr);
1456 
1457 /**
1458  * @see xcb_ewmh_get_virtual_roots_unchecked
1459  */
1460 xcb_get_property_cookie_t xcb_ewmh_get_workarea(xcb_ewmh_connection_t *ewmh,
1461                                                 int screen_nbr);
1462 
1463 /**
1464  * @brief Get  the desktop  geometry from a  GetProperty _NET_WORKAREA
1465  * reply
1466  *
1467  * @param wa The  current workarea
1468  * @param r GetProperty _NET_WORKAREA reply
1469  * @return Return 1 on success, 0 otherwise
1470  */
1471 uint8_t xcb_ewmh_get_workarea_from_reply(xcb_ewmh_get_workarea_reply_t *wa,
1472                                          xcb_get_property_reply_t *r);
1473 
1474 /**
1475  * @brief Get reply from the GetProperty _NET_WORKAREA cookie
1476  *
1477  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1478  * xcb_get_workarea_unchecked()  is used.   Otherwise,  it stores  the
1479  * error if any.
1480  *
1481  * @param ewmh The information relative to EWMH
1482  * @param cookie The _NET_WORKAREA GetProperty request cookie
1483  * @param wa The current workareas of desktops
1484  * @param The xcb_generic_error_t supplied
1485  * @return Return 1 on success, 0 otherwise
1486  */
1487 uint8_t xcb_ewmh_get_workarea_reply(xcb_ewmh_connection_t *ewmh,
1488                                     xcb_get_property_cookie_t cookie,
1489                                     xcb_ewmh_get_workarea_reply_t *wa,
1490                                     xcb_generic_error_t **e);
1491 
1492 /**
1493  * @brief Wipe the workarea list reply
1494  *
1495  * This function must be called to free the memory allocated for atoms
1496  * when   the  reply   is  requested   in  xcb_ewmh_get_workarea_reply
1497  * function.
1498  *
1499  * @param r The X reply to be freed
1500  */
1501 void xcb_ewmh_get_workarea_reply_wipe(xcb_ewmh_get_workarea_reply_t *r);
1502 
1503 /**
1504  * @brief Send a ChangeProperty request for _NET_SUPPORTING_WM_CHECK
1505  *
1506  * _NET_SUPPORTING_WM_CHECK, WINDOW/32
1507  *
1508  * @param ewmh The per-screen EWMH information
1509  * @param parent_window The root window or child window created by the WM
1510  * @param child_window The child window created by the WM
1511  * @return Cookie associated with the ChangeProperty _NET_SUPPORTING_WM_CHECK request
1512  */
1513 xcb_void_cookie_t xcb_ewmh_set_supporting_wm_check(xcb_ewmh_connection_t *ewmh,
1514                                                    xcb_window_t parent_window,
1515                                                    xcb_window_t child_window);
1516 
1517 /**
1518  * @see xcb_ewmh_set_supporting_wm_check
1519  */
1520 xcb_void_cookie_t xcb_ewmh_set_supporting_wm_check_checked(xcb_ewmh_connection_t *ewmh,
1521                                                            xcb_window_t parent_window,
1522                                                            xcb_window_t child_window);
1523 
1524 /**
1525  * @brief  Send GetProperty  request  to get  _NET_SUPPORTING_WM_CHECK
1526  *        root window property
1527  *
1528  * @param ewmh The information relative to EWMH
1529  * @param screen_nbr The screen number
1530  * @return The _NET_SUPPORTING_WM_CHECK cookie of the GetProperty request
1531  */
1532 xcb_get_property_cookie_t xcb_ewmh_get_supporting_wm_check_unchecked(xcb_ewmh_connection_t *ewmh,
1533                                                                      xcb_window_t window);
1534 
1535 /**
1536  * @see xcb_ewmh_get_supporting_wm_check_unchecked
1537  */
1538 xcb_get_property_cookie_t xcb_ewmh_get_supporting_wm_check(xcb_ewmh_connection_t *ewmh,
1539                                                            xcb_window_t window);
1540 
1541 /**
1542  * @brief  Get   the  list  of  client  windows   from  a  GetProperty
1543  * _NET_SUPPORTING_WM_CHECK reply
1544  *
1545  * @param window The child window created by the WM
1546  * @param r GetProperty _NET_SUPPORTING_WM_CHECK reply
1547  * @return Return 1 on success, 0 otherwise
1548  */
1549 static inline uint8_t
1550 xcb_ewmh_get_supporting_wm_check_from_reply(xcb_window_t *window,
1551                                             xcb_get_property_reply_t *r)
1552 {
1553   return xcb_ewmh_get_window_from_reply(window, r);
1554 }
1555 
1556 /**
1557  * @brief  Get  reply  from the  GetProperty  _NET_SUPPORTING_WM_CHECK
1558  * cookie
1559  *
1560  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1561  * xcb_get_supporting_wm_check_unchecked()  is  used.   Otherwise,  it
1562  * stores the error if any.
1563  *
1564  * @param ewmh The information relative to EWMH
1565  * @param cookie The _NET_SUPPORTING_WM_CHECK GetProperty request cookie
1566  * @param window The reply to be filled
1567  * @param The xcb_generic_error_t supplied
1568  * @return Return 1 on success, 0 otherwise
1569  */
1570 static inline uint8_t
1571 xcb_ewmh_get_supporting_wm_check_reply(xcb_ewmh_connection_t *ewmh,
1572                                        xcb_get_property_cookie_t cookie,
1573                                        xcb_window_t *window,
1574                                        xcb_generic_error_t **e)
1575 {
1576   return xcb_ewmh_get_window_reply(ewmh, cookie, window, e);
1577 }
1578 
1579 /**
1580  * @brief Send a ChangeProperty request for _NET_VIRTUAL_ROOTS
1581  *
1582  * _NET_VIRTUAL_ROOTS, WINDOW[]/32
1583  *
1584  * @param ewmh The per-screen EWMH information
1585  * @param screen_nbr The screen number
1586  * @param list_len The number of virtual root windows
1587  * @param list The virtual root windows
1588  * @return Cookie associated with the ChangeProperty _NET_VIRTUAL_ROOTS request
1589  */
1590 xcb_void_cookie_t xcb_ewmh_set_virtual_roots(xcb_ewmh_connection_t *ewmh,
1591                                              int screen_nbr,
1592                                              uint32_t list_len,
1593                                              xcb_window_t *list);
1594 
1595 /**
1596  * @see xcb_ewmh_set_virtual_roots
1597  */
1598 xcb_void_cookie_t xcb_ewmh_set_virtual_roots_checked(xcb_ewmh_connection_t *ewmh,
1599                                                      int screen_nbr,
1600                                                      uint32_t list_len,
1601                                                      xcb_window_t *list);
1602 
1603 /**
1604  * @brief  Send  GetProperty request  to  get _NET_VIRTUAL_ROOTS  root
1605  *        window property
1606  *
1607  * @param ewmh The information relative to EWMH
1608  * @param screen_nbr The screen number
1609  * @return The _NET_VIRTUAL_ROOTS cookie of the GetProperty request
1610  */
1611 xcb_get_property_cookie_t xcb_ewmh_get_virtual_roots_unchecked(xcb_ewmh_connection_t *ewmh,
1612                                                                int screen_nbr);
1613 
1614 /**
1615  * @see xcb_ewmh_get_virtual_roots_unchecked
1616  */
1617 xcb_get_property_cookie_t xcb_ewmh_get_virtual_roots(xcb_ewmh_connection_t *ewmh,
1618                                                      int screen_nbr);
1619 
1620 /**
1621  * @brief Get  the desktop  geometry from a  GetProperty _NET_WORKAREA
1622  * reply
1623  *
1624  * @param virtual_roots The current virtual root windows
1625  * @param r GetProperty _NET_VIRTUAL_ROOTS reply
1626  * @return Return 1 on success, 0 otherwise
1627  */
1628 static inline uint8_t
1629 xcb_ewmh_get_virtual_roots_from_reply(xcb_ewmh_get_windows_reply_t *virtual_roots,
1630                                       xcb_get_property_reply_t *r)
1631 {
1632   return xcb_ewmh_get_windows_from_reply(virtual_roots, r);
1633 }
1634 
1635 /**
1636  * @brief Get reply from the GetProperty _NET_VIRTUAL_ROOTS cookie
1637  *
1638  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
1639  * xcb_get_virtual_roots_unchecked()  is used.   Otherwise,  it stores
1640  * the error if any.
1641  *
1642  * @param ewmh The information relative to EWMH
1643  * @param cookie The _NET_VIRTUAL_ROOTS GetProperty request cookie
1644  * @param virtual_roots The current virtual root windows
1645  * @param The xcb_generic_error_t supplied
1646  * @return Return 1 on success, 0 otherwise
1647  */
1648 static inline uint8_t
1649 xcb_ewmh_get_virtual_roots_reply(xcb_ewmh_connection_t *ewmh,
1650                                  xcb_get_property_cookie_t cookie,
1651                                  xcb_ewmh_get_windows_reply_t *virtual_roots,
1652                                  xcb_generic_error_t **e)
1653 {
1654   return xcb_ewmh_get_windows_reply(ewmh, cookie, virtual_roots, e);
1655 }
1656 
1657 xcb_void_cookie_t xcb_ewmh_set_desktop_layout(xcb_ewmh_connection_t *ewmh,
1658                                               int screen_nbr,
1659                                               xcb_ewmh_desktop_layout_orientation_t orientation,
1660                                               uint32_t columns, uint32_t rows,
1661                                               xcb_ewmh_desktop_layout_starting_corner_t starting_corner);
1662 
1663 xcb_void_cookie_t xcb_ewmh_set_desktop_layout_checked(xcb_ewmh_connection_t *ewmh,
1664                                                       int screen_nbr,
1665                                                       xcb_ewmh_desktop_layout_orientation_t orientation,
1666                                                       uint32_t columns, uint32_t rows,
1667                                                       xcb_ewmh_desktop_layout_starting_corner_t starting_corner);
1668 
1669 /**
1670  * @brief  Send GetProperty  request to  get  _NET_DESKTOP_LAYOUT root
1671  *        window property
1672  *
1673  * @param ewmh The information relative to EWMH
1674  * @param screen_nbr The screen number
1675  * @return The _NET_DESKTOP_LAYOUT cookie of the GetProperty request
1676  */
1677 xcb_get_property_cookie_t xcb_ewmh_get_desktop_layout_unchecked(xcb_ewmh_connection_t *ewmh,
1678                                                                 int screen_nbr);
1679 
1680 /**
1681  * @see xcb_ewmh_get_desktop_layout_unchecked
1682  */
1683 xcb_get_property_cookie_t xcb_ewmh_get_desktop_layout(xcb_ewmh_connection_t *ewmh,
1684                                                       int screen_nbr);
1685 
1686 uint8_t xcb_ewmh_get_desktop_layout_from_reply(xcb_ewmh_get_desktop_layout_reply_t *desktop_layouts,
1687                                                xcb_get_property_reply_t *r);
1688 
1689 uint8_t xcb_ewmh_get_desktop_layout_reply(xcb_ewmh_connection_t *ewmh,
1690                                           xcb_get_property_cookie_t cookie,
1691                                           xcb_ewmh_get_desktop_layout_reply_t *desktop_layouts,
1692                                           xcb_generic_error_t **e);
1693 
1694 xcb_void_cookie_t xcb_ewmh_set_showing_desktop(xcb_ewmh_connection_t *ewmh,
1695                                                int screen_nbr,
1696                                                uint32_t desktop);
1697 
1698 xcb_void_cookie_t xcb_ewmh_set_showing_desktop_checked(xcb_ewmh_connection_t *ewmh,
1699                                                        int screen_nbr,
1700                                                        uint32_t desktop);
1701 
1702 xcb_get_property_cookie_t xcb_ewmh_get_showing_desktop_unchecked(xcb_ewmh_connection_t *ewmh,
1703                                                                  int screen_nbr);
1704 
1705 xcb_get_property_cookie_t xcb_ewmh_get_showing_desktop(xcb_ewmh_connection_t *ewmh,
1706                                                        int screen_nbr);
1707 
1708 static inline uint8_t
1709 xcb_ewmh_get_showing_desktop_from_reply(uint32_t *desktop,
1710                                         xcb_get_property_reply_t *r)
1711 {
1712   return xcb_ewmh_get_cardinal_from_reply(desktop, r);
1713 }
1714 
1715 static inline uint8_t
1716 xcb_ewmh_get_showing_desktop_reply(xcb_ewmh_connection_t *ewmh,
1717                                    xcb_get_property_cookie_t cookie,
1718                                    uint32_t *desktop,
1719                                    xcb_generic_error_t **e)
1720 {
1721   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, desktop, e);
1722 }
1723 
1724 static inline xcb_void_cookie_t
1725 xcb_ewmh_request_change_showing_desktop(xcb_ewmh_connection_t *ewmh,
1726                                         int screen_nbr,
1727                                         uint32_t enter)
1728 {
1729   return xcb_ewmh_send_client_message(ewmh->connection, XCB_NONE,
1730                                       ewmh->screens[screen_nbr]->root,
1731                                       ewmh->_NET_SHOWING_DESKTOP,
1732                                       sizeof(enter), &enter);
1733 }
1734 
1735 xcb_void_cookie_t xcb_ewmh_request_close_window(xcb_ewmh_connection_t *ewmh,
1736                                                 int screen_nbr,
1737                                                 xcb_window_t window_to_close,
1738                                                 xcb_timestamp_t timestamp,
1739                                                 xcb_ewmh_client_source_type_t source_indication);
1740 
1741 xcb_void_cookie_t xcb_ewmh_request_moveresize_window(xcb_ewmh_connection_t *ewmh,
1742                                                      int screen_nbr,
1743                                                      xcb_window_t moveresize_window,
1744                                                      xcb_gravity_t gravity,
1745                                                      xcb_ewmh_client_source_type_t source_indication,
1746                                                      xcb_ewmh_moveresize_window_opt_flags_t flags,
1747                                                      uint32_t x, uint32_t y,
1748                                                      uint32_t width, uint32_t height);
1749 
1750 xcb_void_cookie_t xcb_ewmh_request_wm_moveresize(xcb_ewmh_connection_t *ewmh,
1751                                                  int screen_nbr,
1752                                                  xcb_window_t moveresize_window,
1753                                                  uint32_t x_root, uint32_t y_root,
1754                                                  xcb_ewmh_moveresize_direction_t direction,
1755                                                  xcb_button_index_t button,
1756                                                  xcb_ewmh_client_source_type_t source_indication);
1757 
1758 xcb_void_cookie_t xcb_ewmh_request_restack_window(xcb_ewmh_connection_t *ewmh,
1759                                                   int screen_nbr,
1760                                                   xcb_window_t window_to_restack,
1761                                                   xcb_window_t sibling_window,
1762                                                   xcb_stack_mode_t detail);
1763 
1764 static inline xcb_void_cookie_t
1765 xcb_ewmh_request_frame_extents(xcb_ewmh_connection_t *ewmh,
1766                                int screen_nbr,
1767                                xcb_window_t client_window)
1768 {
1769   return xcb_ewmh_send_client_message(ewmh->connection, client_window,
1770                                       ewmh->screens[screen_nbr]->root,
1771                                       ewmh->_NET_REQUEST_FRAME_EXTENTS, 0, NULL);
1772 }
1773 
1774 xcb_void_cookie_t xcb_ewmh_set_wm_name(xcb_ewmh_connection_t *ewmh,
1775                                        xcb_window_t window,
1776                                        uint32_t strings_len,
1777                                        const char *strings);
1778 
1779 xcb_void_cookie_t xcb_ewmh_set_wm_name_checked(xcb_ewmh_connection_t *ewmh,
1780                                                xcb_window_t window,
1781                                                uint32_t strings_len,
1782                                                const char *strings);
1783 
1784 xcb_get_property_cookie_t xcb_ewmh_get_wm_name_unchecked(xcb_ewmh_connection_t *ewmh,
1785                                                          xcb_window_t window);
1786 
1787 xcb_get_property_cookie_t xcb_ewmh_get_wm_name(xcb_ewmh_connection_t *ewmh,
1788                                                xcb_window_t window);
1789 
1790 static inline uint8_t
1791 xcb_ewmh_get_wm_name_from_reply(xcb_ewmh_connection_t *ewmh,
1792                                 xcb_ewmh_get_utf8_strings_reply_t *data,
1793                                 xcb_get_property_reply_t *r)
1794 {
1795   return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1796 }
1797 
1798 static inline uint8_t
1799 xcb_ewmh_get_wm_name_reply(xcb_ewmh_connection_t *ewmh,
1800                            xcb_get_property_cookie_t cookie,
1801                            xcb_ewmh_get_utf8_strings_reply_t *data,
1802                            xcb_generic_error_t **e)
1803 {
1804   return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1805 }
1806 
1807 xcb_void_cookie_t xcb_ewmh_set_wm_visible_name(xcb_ewmh_connection_t *ewmh,
1808                                                xcb_window_t window,
1809                                                uint32_t strings_len,
1810                                                const char *strings);
1811 
1812 xcb_void_cookie_t xcb_ewmh_set_wm_visible_name_checked(xcb_ewmh_connection_t *ewmh,
1813                                                        xcb_window_t window,
1814                                                        uint32_t strings_len,
1815                                                        const char *strings);
1816 
1817 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name_unchecked(xcb_ewmh_connection_t *ewmh,
1818                                                                  xcb_window_t window);
1819 
1820 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_name(xcb_ewmh_connection_t *ewmh,
1821                                                        xcb_window_t window);
1822 
1823 static inline uint8_t
1824 xcb_ewmh_get_wm_visible_name_from_reply(xcb_ewmh_connection_t *ewmh,
1825                                         xcb_ewmh_get_utf8_strings_reply_t *data,
1826                                         xcb_get_property_reply_t *r)
1827 {
1828   return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1829 }
1830 
1831 static inline uint8_t
1832 xcb_ewmh_get_wm_visible_name_reply(xcb_ewmh_connection_t *ewmh,
1833                                    xcb_get_property_cookie_t cookie,
1834                                    xcb_ewmh_get_utf8_strings_reply_t *data,
1835                                    xcb_generic_error_t **e)
1836 {
1837   return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1838 }
1839 
1840 xcb_void_cookie_t xcb_ewmh_set_wm_icon_name(xcb_ewmh_connection_t *ewmh,
1841                                             xcb_window_t window,
1842                                             uint32_t strings_len,
1843                                             const char *strings);
1844 
1845 xcb_void_cookie_t xcb_ewmh_set_wm_icon_name_checked(xcb_ewmh_connection_t *ewmh,
1846                                                     xcb_window_t window,
1847                                                     uint32_t strings_len,
1848                                                     const char *strings);
1849 
1850 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name_unchecked(xcb_ewmh_connection_t *ewmh,
1851                                                               xcb_window_t window);
1852 
1853 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_name(xcb_ewmh_connection_t *ewmh,
1854                                                     xcb_window_t window);
1855 
1856 static inline uint8_t
1857 xcb_ewmh_get_wm_icon_name_from_reply(xcb_ewmh_connection_t *ewmh,
1858                                      xcb_ewmh_get_utf8_strings_reply_t *data,
1859                                      xcb_get_property_reply_t *r)
1860 {
1861   return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1862 }
1863 
1864 static inline uint8_t
1865 xcb_ewmh_get_wm_icon_name_reply(xcb_ewmh_connection_t *ewmh,
1866                                 xcb_get_property_cookie_t cookie,
1867                                 xcb_ewmh_get_utf8_strings_reply_t *data,
1868                                 xcb_generic_error_t **e)
1869 {
1870   return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1871 }
1872 
1873 xcb_void_cookie_t xcb_ewmh_set_wm_visible_icon_name(xcb_ewmh_connection_t *ewmh,
1874                                                     xcb_window_t window,
1875                                                     uint32_t strings_len,
1876                                                     const char *strings);
1877 
1878 xcb_void_cookie_t xcb_ewmh_set_wm_visible_icon_name_checked(xcb_ewmh_connection_t *ewmh,
1879                                                             xcb_window_t window,
1880                                                             uint32_t strings_len,
1881                                                             const char *strings);
1882 
1883 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name_unchecked(xcb_ewmh_connection_t *ewmh,
1884                                                                       xcb_window_t window);
1885 
1886 xcb_get_property_cookie_t xcb_ewmh_get_wm_visible_icon_name(xcb_ewmh_connection_t *ewmh,
1887                                                             xcb_window_t window);
1888 
1889 static inline uint8_t
1890 xcb_ewmh_get_wm_visible_icon_name_from_reply(xcb_ewmh_connection_t *ewmh,
1891                                              xcb_ewmh_get_utf8_strings_reply_t *data,
1892                                              xcb_get_property_reply_t *r)
1893 {
1894   return xcb_ewmh_get_utf8_strings_from_reply(ewmh, data, r);
1895 }
1896 
1897 static inline uint8_t
1898 xcb_ewmh_get_wm_visible_icon_name_reply(xcb_ewmh_connection_t *ewmh,
1899                                         xcb_get_property_cookie_t cookie,
1900                                         xcb_ewmh_get_utf8_strings_reply_t *data,
1901                                         xcb_generic_error_t **e)
1902 {
1903   return xcb_ewmh_get_utf8_strings_reply(ewmh, cookie, data, e);
1904 }
1905 
1906 xcb_void_cookie_t xcb_ewmh_set_wm_desktop(xcb_ewmh_connection_t *ewmh,
1907                                           xcb_window_t window,
1908                                           uint32_t desktop);
1909 
1910 xcb_void_cookie_t xcb_ewmh_set_wm_desktop_checked(xcb_ewmh_connection_t *ewmh,
1911                                                   xcb_window_t window,
1912                                                   uint32_t desktop);
1913 
1914 
1915 xcb_get_property_cookie_t xcb_ewmh_get_wm_desktop_unchecked(xcb_ewmh_connection_t *ewmh,
1916                                                             xcb_window_t window);
1917 
1918 xcb_get_property_cookie_t xcb_ewmh_get_wm_desktop(xcb_ewmh_connection_t *ewmh,
1919                                                   xcb_window_t window);
1920 
1921 static inline uint8_t
1922 xcb_ewmh_get_wm_desktop_from_reply(uint32_t *desktop,
1923                                    xcb_get_property_reply_t *r)
1924 {
1925   return xcb_ewmh_get_cardinal_from_reply(desktop, r);
1926 }
1927 
1928 static inline uint8_t
1929 xcb_ewmh_get_wm_desktop_reply(xcb_ewmh_connection_t *ewmh,
1930                               xcb_get_property_cookie_t cookie,
1931                               uint32_t *desktop,
1932                               xcb_generic_error_t **e)
1933 {
1934   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, desktop, e);
1935 }
1936 
1937 xcb_void_cookie_t xcb_ewmh_request_change_wm_desktop(xcb_ewmh_connection_t *ewmh,
1938                                                      int screen_nbr,
1939                                                      xcb_window_t client_window,
1940                                                      uint32_t new_desktop,
1941                                                      xcb_ewmh_client_source_type_t source_indication);
1942 
1943 xcb_void_cookie_t xcb_ewmh_set_wm_window_type(xcb_ewmh_connection_t *ewmh,
1944                                               xcb_window_t window,
1945                                               uint32_t list_len,
1946                                               xcb_atom_t *list);
1947 
1948 xcb_void_cookie_t xcb_ewmh_set_wm_window_type_checked(xcb_ewmh_connection_t *ewmh,
1949                                                       xcb_window_t window,
1950                                                       uint32_t list_len,
1951                                                       xcb_atom_t *list);
1952 
1953 xcb_get_property_cookie_t xcb_ewmh_get_wm_window_type_unchecked(xcb_ewmh_connection_t *ewmh,
1954                                                                 xcb_window_t window);
1955 
1956 xcb_get_property_cookie_t xcb_ewmh_get_wm_window_type(xcb_ewmh_connection_t *ewmh,
1957                                                       xcb_window_t window);
1958 
1959 uint8_t xcb_ewmh_get_wm_window_type_from_reply(xcb_ewmh_get_atoms_reply_t *wtypes,
1960                                                xcb_get_property_reply_t *r);
1961 
1962 uint8_t xcb_ewmh_get_wm_window_type_reply(xcb_ewmh_connection_t *ewmh,
1963                                           xcb_get_property_cookie_t cookie,
1964                                           xcb_ewmh_get_atoms_reply_t *name,
1965                                           xcb_generic_error_t **e);
1966 
1967 xcb_void_cookie_t xcb_ewmh_set_wm_state(xcb_ewmh_connection_t *ewmh,
1968                                         xcb_window_t window,
1969                                         uint32_t list_len,
1970                                         xcb_atom_t *list);
1971 
1972 xcb_void_cookie_t xcb_ewmh_set_wm_state_checked(xcb_ewmh_connection_t *ewmh,
1973                                                 xcb_window_t window,
1974                                                 uint32_t list_len,
1975                                                 xcb_atom_t *list);
1976 
1977 xcb_get_property_cookie_t xcb_ewmh_get_wm_state_unchecked(xcb_ewmh_connection_t *ewmh,
1978                                                           xcb_window_t window);
1979 
1980 xcb_get_property_cookie_t xcb_ewmh_get_wm_state(xcb_ewmh_connection_t *ewmh,
1981                                                 xcb_window_t window);
1982 
1983 uint8_t xcb_ewmh_get_wm_state_from_reply(xcb_ewmh_get_atoms_reply_t *wtypes,
1984                                          xcb_get_property_reply_t *r);
1985 
1986 uint8_t xcb_ewmh_get_wm_state_reply(xcb_ewmh_connection_t *ewmh,
1987                                     xcb_get_property_cookie_t cookie,
1988                                     xcb_ewmh_get_atoms_reply_t *name,
1989                                     xcb_generic_error_t **e);
1990 
1991 xcb_void_cookie_t xcb_ewmh_request_change_wm_state(xcb_ewmh_connection_t *ewmh,
1992                                                    int screen_nbr,
1993                                                    xcb_window_t client_window,
1994                                                    xcb_ewmh_wm_state_action_t action,
1995                                                    xcb_atom_t first_property,
1996                                                    xcb_atom_t second_property,
1997                                                    xcb_ewmh_client_source_type_t source_indication);
1998 
1999 xcb_void_cookie_t xcb_ewmh_set_wm_allowed_actions(xcb_ewmh_connection_t *ewmh,
2000                                                   xcb_window_t window,
2001                                                   uint32_t list_len,
2002                                                   xcb_atom_t *list);
2003 
2004 xcb_void_cookie_t xcb_ewmh_set_wm_allowed_actions_checked(xcb_ewmh_connection_t *ewmh,
2005                                                           xcb_window_t window,
2006                                                           uint32_t list_len,
2007                                                           xcb_atom_t *list);
2008 
2009 xcb_get_property_cookie_t xcb_ewmh_get_wm_allowed_actions_unchecked(xcb_ewmh_connection_t *ewmh,
2010                                                                     xcb_window_t window);
2011 
2012 xcb_get_property_cookie_t xcb_ewmh_get_wm_allowed_actions(xcb_ewmh_connection_t *ewmh,
2013                                                           xcb_window_t window);
2014 
2015 uint8_t xcb_ewmh_get_wm_allowed_actions_from_reply(xcb_ewmh_get_atoms_reply_t *wtypes,
2016                                                    xcb_get_property_reply_t *r);
2017 
2018 uint8_t xcb_ewmh_get_wm_allowed_actions_reply(xcb_ewmh_connection_t *ewmh,
2019                                               xcb_get_property_cookie_t cookie,
2020                                               xcb_ewmh_get_atoms_reply_t *name,
2021                                               xcb_generic_error_t **e);
2022 
2023 xcb_void_cookie_t xcb_ewmh_set_wm_strut(xcb_ewmh_connection_t *ewmh,
2024                                         xcb_window_t window,
2025                                         uint32_t left, uint32_t right,
2026                                         uint32_t top, uint32_t bottom);
2027 
2028 xcb_void_cookie_t xcb_ewmh_set_wm_strut_checked(xcb_ewmh_connection_t *ewmh,
2029                                                 xcb_window_t window,
2030                                                 uint32_t left, uint32_t right,
2031                                                 uint32_t top, uint32_t bottom);
2032 
2033 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_unchecked(xcb_ewmh_connection_t *ewmh,
2034                                                           xcb_window_t window);
2035 
2036 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut(xcb_ewmh_connection_t *ewmh,
2037                                                 xcb_window_t window);
2038 
2039 uint8_t xcb_ewmh_get_wm_strut_from_reply(xcb_ewmh_get_extents_reply_t *struts,
2040                                          xcb_get_property_reply_t *r);
2041 
2042 uint8_t xcb_ewmh_get_wm_strut_reply(xcb_ewmh_connection_t *ewmh,
2043                                     xcb_get_property_cookie_t cookie,
2044                                     xcb_ewmh_get_extents_reply_t *struts,
2045                                     xcb_generic_error_t **e);
2046 
2047 xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial(xcb_ewmh_connection_t *ewmh,
2048                                                 xcb_window_t window,
2049                                                 xcb_ewmh_wm_strut_partial_t wm_strut);
2050 
2051 xcb_void_cookie_t xcb_ewmh_set_wm_strut_partial_checked(xcb_ewmh_connection_t *ewmh,
2052                                                         xcb_window_t window,
2053                                                         xcb_ewmh_wm_strut_partial_t wm_strut);
2054 
2055 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial_unchecked(xcb_ewmh_connection_t *ewmh,
2056                                                                   xcb_window_t window);
2057 
2058 xcb_get_property_cookie_t xcb_ewmh_get_wm_strut_partial(xcb_ewmh_connection_t *ewmh,
2059                                                         xcb_window_t window);
2060 
2061 uint8_t xcb_ewmh_get_wm_strut_partial_from_reply(xcb_ewmh_wm_strut_partial_t *struts,
2062                                                  xcb_get_property_reply_t *r);
2063 
2064 uint8_t xcb_ewmh_get_wm_strut_partial_reply(xcb_ewmh_connection_t *ewmh,
2065                                             xcb_get_property_cookie_t cookie,
2066                                             xcb_ewmh_wm_strut_partial_t *struts,
2067                                             xcb_generic_error_t **e);
2068 
2069 xcb_void_cookie_t xcb_ewmh_set_wm_icon_geometry(xcb_ewmh_connection_t *ewmh,
2070                                                 xcb_window_t window,
2071                                                 uint32_t left, uint32_t right,
2072                                                 uint32_t top, uint32_t bottom);
2073 
2074 xcb_void_cookie_t xcb_ewmh_set_wm_icon_geometry_checked(xcb_ewmh_connection_t *ewmh,
2075                                                         xcb_window_t window,
2076                                                         uint32_t left, uint32_t right,
2077                                                         uint32_t top, uint32_t bottom);
2078 
2079 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_geometry_unchecked(xcb_ewmh_connection_t *ewmh,
2080                                                                   xcb_window_t window);
2081 
2082 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_geometry(xcb_ewmh_connection_t *ewmh,
2083                                                         xcb_window_t window);
2084 
2085 uint8_t xcb_ewmh_get_wm_icon_geometry_from_reply(xcb_ewmh_geometry_t *icons,
2086                                                  xcb_get_property_reply_t *r);
2087 
2088 uint8_t xcb_ewmh_get_wm_icon_geometry_reply(xcb_ewmh_connection_t *ewmh,
2089                                             xcb_get_property_cookie_t cookie,
2090                                             xcb_ewmh_geometry_t *icons,
2091                                             xcb_generic_error_t **e);
2092 
2093 /**
2094  * @brief Send ChangeProperty request to set _NET_WM_ICON window
2095  *        property. The given data is considered to be already
2096  *        prepared, namely that it is an array such as: WIDTH1,
2097  *        HEIGHT1, IMG1, WIDTH2, HEIGHT2, IMG2.
2098  *
2099  *        If you only want to add or append a single icon, you may
2100  *        consider using xcb_ewmh_append_wm_icon_checked which is far
2101  *        easier to use.
2102  *
2103  * _NET_WM_ICON CARDINAL[][2+n]/32
2104  *
2105  * @param ewmh The information relative to EWMH
2106  * @param mode ChangeProperty mode (xcb_prop_mode_t)
2107  * @param window The window to set the property on
2108  * @param data_len Length of the data
2109  * @param data The data
2110  */
2111 static inline xcb_void_cookie_t
2112 xcb_ewmh_set_wm_icon_checked(xcb_ewmh_connection_t *ewmh,
2113                              uint8_t mode,
2114                              xcb_window_t window,
2115                              uint32_t data_len, uint32_t *data)
2116 {
2117   return xcb_change_property_checked(ewmh->connection, mode,
2118                                      window, ewmh->_NET_WM_ICON,
2119                                      XCB_ATOM_CARDINAL, 32, data_len, data);
2120 }
2121 
2122 /**
2123  * @see xcb_ewmh_set_wm_icon_checked
2124  */
2125 static inline xcb_void_cookie_t
2126 xcb_ewmh_set_wm_icon(xcb_ewmh_connection_t *ewmh,
2127                      uint8_t mode,
2128                      xcb_window_t window,
2129                      uint32_t data_len, uint32_t *data)
2130 {
2131   return xcb_change_property(ewmh->connection, mode, window,
2132                              ewmh->_NET_WM_ICON, XCB_ATOM_CARDINAL, 32,
2133                              data_len, data);
2134 }
2135 
2136 xcb_void_cookie_t xcb_ewmh_append_wm_icon_checked(xcb_ewmh_connection_t *ewmh,
2137                                                   xcb_window_t window,
2138                                                   uint32_t width, uint32_t height,
2139                                                   uint32_t img_len, uint32_t *img);
2140 
2141 xcb_void_cookie_t xcb_ewmh_append_wm_icon(xcb_ewmh_connection_t *ewmh,
2142                                           xcb_window_t window,
2143                                           uint32_t width, uint32_t height,
2144                                           uint32_t img_len, uint32_t *img);
2145 
2146 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon_unchecked(xcb_ewmh_connection_t *ewmh,
2147                                                          xcb_window_t window);
2148 
2149 xcb_get_property_cookie_t xcb_ewmh_get_wm_icon(xcb_ewmh_connection_t *ewmh,
2150                                                xcb_window_t window);
2151 
2152 uint8_t xcb_ewmh_get_wm_icon_from_reply(xcb_ewmh_get_wm_icon_reply_t *wm_icon,
2153                                         xcb_get_property_reply_t *r);
2154 
2155 uint8_t xcb_ewmh_get_wm_icon_reply(xcb_ewmh_connection_t *ewmh,
2156                                    xcb_get_property_cookie_t cookie,
2157                                    xcb_ewmh_get_wm_icon_reply_t *wm_icon,
2158                                    xcb_generic_error_t **e);
2159 
2160 xcb_ewmh_wm_icon_iterator_t xcb_ewmh_get_wm_icon_iterator(const xcb_ewmh_get_wm_icon_reply_t *wm_icon);
2161 
2162 unsigned int xcb_ewmh_get_wm_icon_length(const xcb_ewmh_get_wm_icon_reply_t *wm_icon);
2163 
2164 void xcb_ewmh_get_wm_icon_next(xcb_ewmh_wm_icon_iterator_t *iterator);
2165 
2166 void xcb_ewmh_get_wm_icon_reply_wipe(xcb_ewmh_get_wm_icon_reply_t *wm_icon);
2167 
2168 xcb_void_cookie_t xcb_ewmh_set_wm_pid(xcb_ewmh_connection_t *ewmh,
2169                                       xcb_window_t window,
2170                                       uint32_t pid);
2171 
2172 xcb_void_cookie_t xcb_ewmh_set_wm_pid_checked(xcb_ewmh_connection_t *ewmh,
2173                                               xcb_window_t window,
2174                                               uint32_t pid);
2175 
2176 xcb_get_property_cookie_t xcb_ewmh_get_wm_pid_unchecked(xcb_ewmh_connection_t *ewmh,
2177                                                         xcb_window_t window);
2178 
2179 xcb_get_property_cookie_t xcb_ewmh_get_wm_pid(xcb_ewmh_connection_t *ewmh,
2180                                               xcb_window_t window);
2181 
2182 static inline uint8_t
2183 xcb_ewmh_get_wm_pid_from_reply(uint32_t *pid,
2184                                xcb_get_property_reply_t *r)
2185 {
2186   return xcb_ewmh_get_cardinal_from_reply(pid, r);
2187 }
2188 
2189 static inline uint8_t
2190 xcb_ewmh_get_wm_pid_reply(xcb_ewmh_connection_t *ewmh,
2191                           xcb_get_property_cookie_t cookie,
2192                           uint32_t *pid,
2193                           xcb_generic_error_t **e)
2194 {
2195   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, pid, e);
2196 }
2197 
2198 xcb_void_cookie_t xcb_ewmh_set_wm_handled_icons(xcb_ewmh_connection_t *ewmh,
2199                                                 xcb_window_t window,
2200                                                 uint32_t handled_icons);
2201 
2202 xcb_void_cookie_t xcb_ewmh_set_wm_handled_icons_checked(xcb_ewmh_connection_t *ewmh,
2203                                                         xcb_window_t window,
2204                                                         uint32_t handled_icons);
2205 
2206 xcb_get_property_cookie_t xcb_ewmh_get_wm_handled_icons_unchecked(xcb_ewmh_connection_t *ewmh,
2207                                                                   xcb_window_t window);
2208 
2209 xcb_get_property_cookie_t xcb_ewmh_get_wm_handled_icons(xcb_ewmh_connection_t *ewmh,
2210                                                         xcb_window_t window);
2211 
2212 static inline uint8_t
2213 xcb_ewmh_get_wm_handled_icons_from_reply(uint32_t *handled_icons,
2214                                          xcb_get_property_reply_t *r)
2215 {
2216   return xcb_ewmh_get_cardinal_from_reply(handled_icons, r);
2217 }
2218 
2219 static inline uint8_t
2220 xcb_ewmh_get_wm_handled_icons_reply(xcb_ewmh_connection_t *ewmh,
2221                                     xcb_get_property_cookie_t cookie,
2222                                     uint32_t *handled_icons,
2223                                     xcb_generic_error_t **e)
2224 {
2225   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, handled_icons, e);
2226 }
2227 
2228 xcb_void_cookie_t xcb_ewmh_set_wm_user_time(xcb_ewmh_connection_t *ewmh,
2229                                             xcb_window_t window,
2230                                             uint32_t xtime);
2231 
2232 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_checked(xcb_ewmh_connection_t *ewmh,
2233                                                     xcb_window_t window,
2234                                                     uint32_t pid);
2235 
2236 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_unchecked(xcb_ewmh_connection_t *ewmh,
2237                                                               xcb_window_t window);
2238 
2239 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time(xcb_ewmh_connection_t *ewmh,
2240                                                     xcb_window_t window);
2241 
2242 static inline uint8_t
2243 xcb_ewmh_get_wm_user_time_from_reply(uint32_t *xtime,
2244                                      xcb_get_property_reply_t *r)
2245 {
2246   return xcb_ewmh_get_cardinal_from_reply(xtime, r);
2247 }
2248 
2249 static inline uint8_t
2250 xcb_ewmh_get_wm_user_time_reply(xcb_ewmh_connection_t *ewmh,
2251                                 xcb_get_property_cookie_t cookie,
2252                                 uint32_t *xtime,
2253                                 xcb_generic_error_t **e)
2254 {
2255   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, xtime, e);
2256 }
2257 
2258 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_window(xcb_ewmh_connection_t *ewmh,
2259                                                    xcb_window_t window,
2260                                                    uint32_t xtime);
2261 
2262 xcb_void_cookie_t xcb_ewmh_set_wm_user_time_window_checked(xcb_ewmh_connection_t *ewmh,
2263                                                            xcb_window_t window,
2264                                                            uint32_t pid);
2265 
2266 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_window_unchecked(xcb_ewmh_connection_t *ewmh,
2267                                                                      xcb_window_t window);
2268 
2269 xcb_get_property_cookie_t xcb_ewmh_get_wm_user_time_window(xcb_ewmh_connection_t *ewmh,
2270                                                            xcb_window_t window);
2271 
2272 static inline uint8_t
2273 xcb_ewmh_get_wm_user_time_window_from_reply(uint32_t *xtime,
2274                                             xcb_get_property_reply_t *r)
2275 {
2276   return xcb_ewmh_get_cardinal_from_reply(xtime, r);
2277 }
2278 
2279 static inline uint8_t
2280 xcb_ewmh_get_wm_user_time_window_reply(xcb_ewmh_connection_t *ewmh,
2281                                        xcb_get_property_cookie_t cookie,
2282                                        uint32_t *xtime,
2283                                        xcb_generic_error_t **e)
2284 {
2285   return xcb_ewmh_get_cardinal_reply(ewmh, cookie, xtime, e);
2286 }
2287 
2288 xcb_void_cookie_t xcb_ewmh_set_frame_extents(xcb_ewmh_connection_t *ewmh,
2289                                              xcb_window_t window,
2290                                              uint32_t left, uint32_t right,
2291                                              uint32_t top, uint32_t bottom);
2292 
2293 xcb_void_cookie_t xcb_ewmh_set_frame_extents_checked(xcb_ewmh_connection_t *ewmh,
2294                                                      xcb_window_t window,
2295                                                      uint32_t left, uint32_t right,
2296                                                      uint32_t top, uint32_t bottom);
2297 
2298 xcb_get_property_cookie_t xcb_ewmh_get_frame_extents_unchecked(xcb_ewmh_connection_t *ewmh,
2299                                                                xcb_window_t window);
2300 
2301 xcb_get_property_cookie_t xcb_ewmh_get_frame_extents(xcb_ewmh_connection_t *ewmh,
2302                                                      xcb_window_t window);
2303 
2304 uint8_t xcb_ewmh_get_frame_extents_from_reply(xcb_ewmh_get_extents_reply_t *frame_extents,
2305                                               xcb_get_property_reply_t *r);
2306 
2307 uint8_t xcb_ewmh_get_frame_extents_reply(xcb_ewmh_connection_t *ewmh,
2308                                          xcb_get_property_cookie_t cookie,
2309                                          xcb_ewmh_get_extents_reply_t *frame_extents,
2310                                          xcb_generic_error_t **e);
2311 
2312 xcb_void_cookie_t xcb_ewmh_send_wm_ping(xcb_ewmh_connection_t *ewmh,
2313                                         xcb_window_t window,
2314                                         xcb_timestamp_t timestamp);
2315 
2316 xcb_void_cookie_t xcb_ewmh_set_wm_sync_request_counter(xcb_ewmh_connection_t *ewmh,
2317                                                        xcb_window_t window,
2318                                                        xcb_atom_t wm_sync_request_counter_atom,
2319                                                        uint32_t low, uint32_t high);
2320 
2321 xcb_void_cookie_t xcb_ewmh_set_wm_sync_request_counter_checked(xcb_ewmh_connection_t *ewmh,
2322                                                                xcb_window_t window,
2323                                                                xcb_atom_t wm_sync_request_counter_atom,
2324                                                                uint32_t low, uint32_t high);
2325 
2326 xcb_get_property_cookie_t xcb_ewmh_get_wm_sync_request_counter_unchecked(xcb_ewmh_connection_t *ewmh,
2327                                                                          xcb_window_t window);
2328 
2329 xcb_get_property_cookie_t xcb_ewmh_get_wm_sync_request_counter(xcb_ewmh_connection_t *ewmh,
2330                                                                xcb_window_t window);
2331 
2332 uint8_t xcb_ewmh_get_wm_sync_request_counter_from_reply(uint64_t *counter,
2333                                                         xcb_get_property_reply_t *r);
2334 
2335 uint8_t xcb_ewmh_get_wm_sync_request_counter_reply(xcb_ewmh_connection_t *ewmh,
2336                                                    xcb_get_property_cookie_t cookie,
2337                                                    uint64_t *counter,
2338                                                    xcb_generic_error_t **e);
2339 
2340 xcb_void_cookie_t xcb_ewmh_send_wm_sync_request(xcb_ewmh_connection_t *ewmh,
2341                                                 xcb_window_t window,
2342                                                 xcb_atom_t wm_protocols_atom,
2343                                                 xcb_atom_t wm_sync_request_atom,
2344                                                 xcb_timestamp_t timestamp,
2345                                                 uint64_t counter);
2346 
2347 xcb_void_cookie_t xcb_ewmh_set_wm_fullscreen_monitors(xcb_ewmh_connection_t *ewmh,
2348                                                       xcb_window_t window,
2349                                                       uint32_t top, uint32_t bottom,
2350                                                       uint32_t left, uint32_t right);
2351 
2352 xcb_void_cookie_t xcb_ewmh_set_wm_fullscreen_monitors_checked(xcb_ewmh_connection_t *ewmh,
2353                                                               xcb_window_t window,
2354                                                               uint32_t top, uint32_t bottom,
2355                                                               uint32_t left, uint32_t right);
2356 
2357 xcb_get_property_cookie_t xcb_ewmh_get_wm_fullscreen_monitors_unchecked(xcb_ewmh_connection_t *ewmh,
2358                                                                         xcb_window_t window);
2359 
2360 xcb_get_property_cookie_t xcb_ewmh_get_wm_fullscreen_monitors(xcb_ewmh_connection_t *ewmh,
2361                                                               xcb_window_t window);
2362 
2363 uint8_t xcb_ewmh_get_wm_fullscreen_monitors_from_reply(xcb_ewmh_get_wm_fullscreen_monitors_reply_t *monitors,
2364                                                        xcb_get_property_reply_t *r);
2365 
2366 uint8_t xcb_ewmh_get_wm_fullscreen_monitors_reply(xcb_ewmh_connection_t *ewmh,
2367                                                   xcb_get_property_cookie_t cookie,
2368                                                   xcb_ewmh_get_wm_fullscreen_monitors_reply_t *monitors,
2369                                                   xcb_generic_error_t **e);
2370 
2371 
2372 xcb_void_cookie_t xcb_ewmh_request_change_wm_fullscreen_monitors(xcb_ewmh_connection_t *ewmh,
2373                                                                  int screen_nbr,
2374                                                                  xcb_window_t window,
2375                                                                  uint32_t top, uint32_t bottom,
2376                                                                  uint32_t left, uint32_t right,
2377                                                                  xcb_ewmh_client_source_type_t source_indication);
2378 
2379 /**
2380  * @brief Set _NET_WM_CM_Sn ownership to the given window
2381  *
2382  * For  each  screen they  manage,  compositing  manager MUST  acquire
2383  * ownership of a selection named _NET_WM_CM_Sn, where n is the screen
2384  * number.
2385  *
2386  * @param ewmh The information relative to EWMH
2387  * @param screen_nbr The screen number
2388  * @param owner The new owner of _NET_WM_CM_Sn selection
2389  * @param timestamp The client's last user activity timestamp
2390  * @param selection_data1 Optional data described by ICCCM
2391  * @param selection_data2 Optional data described by ICCCM
2392  */
2393 xcb_void_cookie_t xcb_ewmh_set_wm_cm_owner(xcb_ewmh_connection_t *ewmh,
2394                                            int screen_nbr,
2395                                            xcb_window_t owner,
2396                                            xcb_timestamp_t timestamp,
2397                                            uint32_t selection_data1,
2398                                            uint32_t selection_data2);
2399 
2400 /**
2401  * @see xcb_ewmh_set_wm_cm_owner
2402  */
2403 xcb_void_cookie_t xcb_ewmh_set_wm_cm_owner_checked(xcb_ewmh_connection_t *ewmh,
2404                                                    int screen_nbr,
2405                                                    xcb_window_t owner,
2406                                                    xcb_timestamp_t timestamp,
2407                                                    uint32_t selection_data1,
2408                                                    uint32_t selection_data2);
2409 
2410 /**
2411  * @brief   Send  GetSelectOwner   request   to  get   the  owner   of
2412  *        _NET_WM_CM_Sn root window property
2413  *
2414  * @param ewmh The information relative to EWMH
2415  * @param screen_nbr The screen number
2416  * @return The _NET_WM_CM_Sn cookie of the GetSelectionOwner request
2417  */
2418 xcb_get_selection_owner_cookie_t xcb_ewmh_get_wm_cm_owner_unchecked(xcb_ewmh_connection_t *ewmh,
2419                                                                     int screen_nbr);
2420 
2421 /**
2422  * @see xcb_ewmh_get_wm_cm_owner_unchecked
2423  */
2424 xcb_get_selection_owner_cookie_t xcb_ewmh_get_wm_cm_owner(xcb_ewmh_connection_t *ewmh,
2425                                                           int screen_nbr);
2426 
2427 uint8_t xcb_ewmh_get_wm_cm_owner_from_reply(xcb_window_t *owner,
2428                                             xcb_get_selection_owner_reply_t *r);
2429 
2430 /**
2431  * @brief Get reply from the GetProperty _NET_CLIENT_LIST cookie
2432  *
2433  * The  parameter  e  supplied  to  this  function  must  be  NULL  if
2434  * xcb_get_window_client_list_unchecked()  is   used.   Otherwise,  it
2435  * stores the error if any.
2436  *
2437  * @param ewmh The information relative to EWMH.
2438  * @param cookie The _NET_WM_CM_Sn GetSelectionOwner request cookie.
2439  * @param owner The window ID which owns the selection or None.
2440  * @param The xcb_generic_error_t supplied.
2441  * @return Return 1 on success, 0 otherwise.
2442  */
2443 uint8_t xcb_ewmh_get_wm_cm_owner_reply(xcb_ewmh_connection_t *ewmh,
2444                                        xcb_get_selection_owner_cookie_t cookie,
2445                                        xcb_window_t *owner,
2446                                        xcb_generic_error_t **e);
2447 
2448 #ifdef __cplusplus
2449 }
2450 #endif
2451 
2452 /**
2453  * @}
2454  */
2455 
2456 #endif /* __XCB_EWMH_H__ */