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