xref: /netbsd-src/external/mit/xorg/lib/libxcb/files/composite.h (revision fea83ee4938f6f630ec4626dba8d28098c73f0cc)
1 /*
2  * This file generated automatically from composite.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
6 /**
7  * @defgroup XCB_Composite_API XCB Composite API
8  * @brief Composite XCB Protocol Implementation.
9  * @{
10  **/
11 
12 #ifndef __COMPOSITE_H
13 #define __COMPOSITE_H
14 
15 #include "xcb.h"
16 #include "xproto.h"
17 #include "xfixes.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define XCB_COMPOSITE_MAJOR_VERSION 0
24 #define XCB_COMPOSITE_MINOR_VERSION 4
25 
26 extern xcb_extension_t xcb_composite_id;
27 
28 typedef enum xcb_composite_redirect_t {
29     XCB_COMPOSITE_REDIRECT_AUTOMATIC = 0,
30     XCB_COMPOSITE_REDIRECT_MANUAL = 1
31 } xcb_composite_redirect_t;
32 
33 /**
34  * @brief xcb_composite_query_version_cookie_t
35  **/
36 typedef struct xcb_composite_query_version_cookie_t {
37     unsigned int sequence;
38 } xcb_composite_query_version_cookie_t;
39 
40 /** Opcode for xcb_composite_query_version. */
41 #define XCB_COMPOSITE_QUERY_VERSION 0
42 
43 /**
44  * @brief xcb_composite_query_version_request_t
45  **/
46 typedef struct xcb_composite_query_version_request_t {
47     uint8_t  major_opcode;
48     uint8_t  minor_opcode;
49     uint16_t length;
50     uint32_t client_major_version;
51     uint32_t client_minor_version;
52 } xcb_composite_query_version_request_t;
53 
54 /**
55  * @brief xcb_composite_query_version_reply_t
56  **/
57 typedef struct xcb_composite_query_version_reply_t {
58     uint8_t  response_type;
59     uint8_t  pad0;
60     uint16_t sequence;
61     uint32_t length;
62     uint32_t major_version;
63     uint32_t minor_version;
64     uint8_t  pad1[16];
65 } xcb_composite_query_version_reply_t;
66 
67 /** Opcode for xcb_composite_redirect_window. */
68 #define XCB_COMPOSITE_REDIRECT_WINDOW 1
69 
70 /**
71  * @brief xcb_composite_redirect_window_request_t
72  **/
73 typedef struct xcb_composite_redirect_window_request_t {
74     uint8_t      major_opcode;
75     uint8_t      minor_opcode;
76     uint16_t     length;
77     xcb_window_t window;
78     uint8_t      update;
79     uint8_t      pad0[3];
80 } xcb_composite_redirect_window_request_t;
81 
82 /** Opcode for xcb_composite_redirect_subwindows. */
83 #define XCB_COMPOSITE_REDIRECT_SUBWINDOWS 2
84 
85 /**
86  * @brief xcb_composite_redirect_subwindows_request_t
87  **/
88 typedef struct xcb_composite_redirect_subwindows_request_t {
89     uint8_t      major_opcode;
90     uint8_t      minor_opcode;
91     uint16_t     length;
92     xcb_window_t window;
93     uint8_t      update;
94     uint8_t      pad0[3];
95 } xcb_composite_redirect_subwindows_request_t;
96 
97 /** Opcode for xcb_composite_unredirect_window. */
98 #define XCB_COMPOSITE_UNREDIRECT_WINDOW 3
99 
100 /**
101  * @brief xcb_composite_unredirect_window_request_t
102  **/
103 typedef struct xcb_composite_unredirect_window_request_t {
104     uint8_t      major_opcode;
105     uint8_t      minor_opcode;
106     uint16_t     length;
107     xcb_window_t window;
108     uint8_t      update;
109     uint8_t      pad0[3];
110 } xcb_composite_unredirect_window_request_t;
111 
112 /** Opcode for xcb_composite_unredirect_subwindows. */
113 #define XCB_COMPOSITE_UNREDIRECT_SUBWINDOWS 4
114 
115 /**
116  * @brief xcb_composite_unredirect_subwindows_request_t
117  **/
118 typedef struct xcb_composite_unredirect_subwindows_request_t {
119     uint8_t      major_opcode;
120     uint8_t      minor_opcode;
121     uint16_t     length;
122     xcb_window_t window;
123     uint8_t      update;
124     uint8_t      pad0[3];
125 } xcb_composite_unredirect_subwindows_request_t;
126 
127 /** Opcode for xcb_composite_create_region_from_border_clip. */
128 #define XCB_COMPOSITE_CREATE_REGION_FROM_BORDER_CLIP 5
129 
130 /**
131  * @brief xcb_composite_create_region_from_border_clip_request_t
132  **/
133 typedef struct xcb_composite_create_region_from_border_clip_request_t {
134     uint8_t             major_opcode;
135     uint8_t             minor_opcode;
136     uint16_t            length;
137     xcb_xfixes_region_t region;
138     xcb_window_t        window;
139 } xcb_composite_create_region_from_border_clip_request_t;
140 
141 /** Opcode for xcb_composite_name_window_pixmap. */
142 #define XCB_COMPOSITE_NAME_WINDOW_PIXMAP 6
143 
144 /**
145  * @brief xcb_composite_name_window_pixmap_request_t
146  **/
147 typedef struct xcb_composite_name_window_pixmap_request_t {
148     uint8_t      major_opcode;
149     uint8_t      minor_opcode;
150     uint16_t     length;
151     xcb_window_t window;
152     xcb_pixmap_t pixmap;
153 } xcb_composite_name_window_pixmap_request_t;
154 
155 /**
156  * @brief xcb_composite_get_overlay_window_cookie_t
157  **/
158 typedef struct xcb_composite_get_overlay_window_cookie_t {
159     unsigned int sequence;
160 } xcb_composite_get_overlay_window_cookie_t;
161 
162 /** Opcode for xcb_composite_get_overlay_window. */
163 #define XCB_COMPOSITE_GET_OVERLAY_WINDOW 7
164 
165 /**
166  * @brief xcb_composite_get_overlay_window_request_t
167  **/
168 typedef struct xcb_composite_get_overlay_window_request_t {
169     uint8_t      major_opcode;
170     uint8_t      minor_opcode;
171     uint16_t     length;
172     xcb_window_t window;
173 } xcb_composite_get_overlay_window_request_t;
174 
175 /**
176  * @brief xcb_composite_get_overlay_window_reply_t
177  **/
178 typedef struct xcb_composite_get_overlay_window_reply_t {
179     uint8_t      response_type;
180     uint8_t      pad0;
181     uint16_t     sequence;
182     uint32_t     length;
183     xcb_window_t overlay_win;
184     uint8_t      pad1[20];
185 } xcb_composite_get_overlay_window_reply_t;
186 
187 /** Opcode for xcb_composite_release_overlay_window. */
188 #define XCB_COMPOSITE_RELEASE_OVERLAY_WINDOW 8
189 
190 /**
191  * @brief xcb_composite_release_overlay_window_request_t
192  **/
193 typedef struct xcb_composite_release_overlay_window_request_t {
194     uint8_t      major_opcode;
195     uint8_t      minor_opcode;
196     uint16_t     length;
197     xcb_window_t window;
198 } xcb_composite_release_overlay_window_request_t;
199 
200 /**
201  * @brief Negotiate the version of Composite
202  *
203  * @param c The connection
204  * @param client_major_version The major version supported by the client.
205  * @param client_minor_version The minor version supported by the client.
206  * @return A cookie
207  *
208  * This negotiates the version of the Composite extension.  It must be precede all
209  * other requests using Composite.  Failure to do so will cause a BadRequest error.
210  *
211  */
212 xcb_composite_query_version_cookie_t
213 xcb_composite_query_version (xcb_connection_t *c,
214                              uint32_t          client_major_version,
215                              uint32_t          client_minor_version);
216 
217 /**
218  * @brief Negotiate the version of Composite
219  *
220  * @param c The connection
221  * @param client_major_version The major version supported by the client.
222  * @param client_minor_version The minor version supported by the client.
223  * @return A cookie
224  *
225  * This negotiates the version of the Composite extension.  It must be precede all
226  * other requests using Composite.  Failure to do so will cause a BadRequest error.
227  *
228  * This form can be used only if the request will cause
229  * a reply to be generated. Any returned error will be
230  * placed in the event queue.
231  */
232 xcb_composite_query_version_cookie_t
233 xcb_composite_query_version_unchecked (xcb_connection_t *c,
234                                        uint32_t          client_major_version,
235                                        uint32_t          client_minor_version);
236 
237 /**
238  * Return the reply
239  * @param c      The connection
240  * @param cookie The cookie
241  * @param e      The xcb_generic_error_t supplied
242  *
243  * Returns the reply of the request asked by
244  *
245  * The parameter @p e supplied to this function must be NULL if
246  * xcb_composite_query_version_unchecked(). is used.
247  * Otherwise, it stores the error if any.
248  *
249  * The returned value must be freed by the caller using free().
250  */
251 xcb_composite_query_version_reply_t *
252 xcb_composite_query_version_reply (xcb_connection_t                      *c,
253                                    xcb_composite_query_version_cookie_t   cookie  /**< */,
254                                    xcb_generic_error_t                  **e);
255 
256 /**
257  * @brief Redirect the hierarchy starting at "window" to off-screen storage.
258  *
259  * @param c The connection
260  * @param window The root of the hierarchy to redirect to off-screen storage.
261  * @param update A bitmask of #xcb_composite_redirect_t values.
262  * @param update Whether contents are automatically mirrored to the parent window.  If one client
263  * 	already specifies an update type of Manual, any attempt by another to specify a
264  * 	mode of Manual so will result in an Access error.
265  * @return A cookie
266  *
267  * The hierarchy starting at 'window' is directed to off-screen
268  * 	storage.  When all clients enabling redirection terminate,
269  * 	the redirection will automatically be disabled.
270  *
271  * 	The root window may not be redirected. Doing so results in a Match
272  * 	error.
273  *
274  * This form can be used only if the request will not cause
275  * a reply to be generated. Any returned error will be
276  * saved for handling by xcb_request_check().
277  */
278 xcb_void_cookie_t
279 xcb_composite_redirect_window_checked (xcb_connection_t *c,
280                                        xcb_window_t      window,
281                                        uint8_t           update);
282 
283 /**
284  * @brief Redirect the hierarchy starting at "window" to off-screen storage.
285  *
286  * @param c The connection
287  * @param window The root of the hierarchy to redirect to off-screen storage.
288  * @param update A bitmask of #xcb_composite_redirect_t values.
289  * @param update Whether contents are automatically mirrored to the parent window.  If one client
290  * 	already specifies an update type of Manual, any attempt by another to specify a
291  * 	mode of Manual so will result in an Access error.
292  * @return A cookie
293  *
294  * The hierarchy starting at 'window' is directed to off-screen
295  * 	storage.  When all clients enabling redirection terminate,
296  * 	the redirection will automatically be disabled.
297  *
298  * 	The root window may not be redirected. Doing so results in a Match
299  * 	error.
300  *
301  */
302 xcb_void_cookie_t
303 xcb_composite_redirect_window (xcb_connection_t *c,
304                                xcb_window_t      window,
305                                uint8_t           update);
306 
307 /**
308  * @brief Redirect all current and future children of ‘window’
309  *
310  * @param c The connection
311  * @param window The root of the hierarchy to redirect to off-screen storage.
312  * @param update A bitmask of #xcb_composite_redirect_t values.
313  * @param update Whether contents are automatically mirrored to the parent window.  If one client
314  * 	already specifies an update type of Manual, any attempt by another to specify a
315  * 	mode of Manual so will result in an Access error.
316  * @return A cookie
317  *
318  * Hierarchies starting at all current and future children of window
319  * 	will be redirected as in RedirectWindow. If update is Manual,
320  * 	then painting of the window background during window manipulation
321  * 	and ClearArea requests is inhibited.
322  *
323  * This form can be used only if the request will not cause
324  * a reply to be generated. Any returned error will be
325  * saved for handling by xcb_request_check().
326  */
327 xcb_void_cookie_t
328 xcb_composite_redirect_subwindows_checked (xcb_connection_t *c,
329                                            xcb_window_t      window,
330                                            uint8_t           update);
331 
332 /**
333  * @brief Redirect all current and future children of ‘window’
334  *
335  * @param c The connection
336  * @param window The root of the hierarchy to redirect to off-screen storage.
337  * @param update A bitmask of #xcb_composite_redirect_t values.
338  * @param update Whether contents are automatically mirrored to the parent window.  If one client
339  * 	already specifies an update type of Manual, any attempt by another to specify a
340  * 	mode of Manual so will result in an Access error.
341  * @return A cookie
342  *
343  * Hierarchies starting at all current and future children of window
344  * 	will be redirected as in RedirectWindow. If update is Manual,
345  * 	then painting of the window background during window manipulation
346  * 	and ClearArea requests is inhibited.
347  *
348  */
349 xcb_void_cookie_t
350 xcb_composite_redirect_subwindows (xcb_connection_t *c,
351                                    xcb_window_t      window,
352                                    uint8_t           update);
353 
354 /**
355  * @brief Terminate redirection of the specified window.
356  *
357  * @param c The connection
358  * @param window The window to terminate redirection of.  Must be redirected by the
359  * 	current client, or a Value error results.
360  * @param update A bitmask of #xcb_composite_redirect_t values.
361  * @param update The update type passed to RedirectWindows.  If this does not match the
362  * 	previously requested update type, a Value error results.
363  * @return A cookie
364  *
365  * Redirection of the specified window will be terminated.  This cannot be
366  * 	used if the window was redirected with RedirectSubwindows.
367  *
368  * This form can be used only if the request will not cause
369  * a reply to be generated. Any returned error will be
370  * saved for handling by xcb_request_check().
371  */
372 xcb_void_cookie_t
373 xcb_composite_unredirect_window_checked (xcb_connection_t *c,
374                                          xcb_window_t      window,
375                                          uint8_t           update);
376 
377 /**
378  * @brief Terminate redirection of the specified window.
379  *
380  * @param c The connection
381  * @param window The window to terminate redirection of.  Must be redirected by the
382  * 	current client, or a Value error results.
383  * @param update A bitmask of #xcb_composite_redirect_t values.
384  * @param update The update type passed to RedirectWindows.  If this does not match the
385  * 	previously requested update type, a Value error results.
386  * @return A cookie
387  *
388  * Redirection of the specified window will be terminated.  This cannot be
389  * 	used if the window was redirected with RedirectSubwindows.
390  *
391  */
392 xcb_void_cookie_t
393 xcb_composite_unredirect_window (xcb_connection_t *c,
394                                  xcb_window_t      window,
395                                  uint8_t           update);
396 
397 /**
398  * @brief Terminate redirection of the specified window’s children
399  *
400  * @param c The connection
401  * @param window The window to terminate redirection of.  Must have previously been
402  * 	selected for sub-redirection by the current client, or a Value error
403  * 	results.
404  * @param update A bitmask of #xcb_composite_redirect_t values.
405  * @param update The update type passed to RedirectSubWindows.  If this does not match
406  * 	the previously requested update type, a Value error results.
407  * @return A cookie
408  *
409  * Redirection of all children of window will be terminated.
410  *
411  * This form can be used only if the request will not cause
412  * a reply to be generated. Any returned error will be
413  * saved for handling by xcb_request_check().
414  */
415 xcb_void_cookie_t
416 xcb_composite_unredirect_subwindows_checked (xcb_connection_t *c,
417                                              xcb_window_t      window,
418                                              uint8_t           update);
419 
420 /**
421  * @brief Terminate redirection of the specified window’s children
422  *
423  * @param c The connection
424  * @param window The window to terminate redirection of.  Must have previously been
425  * 	selected for sub-redirection by the current client, or a Value error
426  * 	results.
427  * @param update A bitmask of #xcb_composite_redirect_t values.
428  * @param update The update type passed to RedirectSubWindows.  If this does not match
429  * 	the previously requested update type, a Value error results.
430  * @return A cookie
431  *
432  * Redirection of all children of window will be terminated.
433  *
434  */
435 xcb_void_cookie_t
436 xcb_composite_unredirect_subwindows (xcb_connection_t *c,
437                                      xcb_window_t      window,
438                                      uint8_t           update);
439 
440 /**
441  *
442  * @param c The connection
443  * @return A cookie
444  *
445  * Delivers a request to the X server.
446  *
447  * This form can be used only if the request will not cause
448  * a reply to be generated. Any returned error will be
449  * saved for handling by xcb_request_check().
450  */
451 xcb_void_cookie_t
452 xcb_composite_create_region_from_border_clip_checked (xcb_connection_t    *c,
453                                                       xcb_xfixes_region_t  region,
454                                                       xcb_window_t         window);
455 
456 /**
457  *
458  * @param c The connection
459  * @return A cookie
460  *
461  * Delivers a request to the X server.
462  *
463  */
464 xcb_void_cookie_t
465 xcb_composite_create_region_from_border_clip (xcb_connection_t    *c,
466                                               xcb_xfixes_region_t  region,
467                                               xcb_window_t         window);
468 
469 /**
470  *
471  * @param c The connection
472  * @return A cookie
473  *
474  * Delivers a request to the X server.
475  *
476  * This form can be used only if the request will not cause
477  * a reply to be generated. Any returned error will be
478  * saved for handling by xcb_request_check().
479  */
480 xcb_void_cookie_t
481 xcb_composite_name_window_pixmap_checked (xcb_connection_t *c,
482                                           xcb_window_t      window,
483                                           xcb_pixmap_t      pixmap);
484 
485 /**
486  *
487  * @param c The connection
488  * @return A cookie
489  *
490  * Delivers a request to the X server.
491  *
492  */
493 xcb_void_cookie_t
494 xcb_composite_name_window_pixmap (xcb_connection_t *c,
495                                   xcb_window_t      window,
496                                   xcb_pixmap_t      pixmap);
497 
498 /**
499  *
500  * @param c The connection
501  * @return A cookie
502  *
503  * Delivers a request to the X server.
504  *
505  */
506 xcb_composite_get_overlay_window_cookie_t
507 xcb_composite_get_overlay_window (xcb_connection_t *c,
508                                   xcb_window_t      window);
509 
510 /**
511  *
512  * @param c The connection
513  * @return A cookie
514  *
515  * Delivers a request to the X server.
516  *
517  * This form can be used only if the request will cause
518  * a reply to be generated. Any returned error will be
519  * placed in the event queue.
520  */
521 xcb_composite_get_overlay_window_cookie_t
522 xcb_composite_get_overlay_window_unchecked (xcb_connection_t *c,
523                                             xcb_window_t      window);
524 
525 /**
526  * Return the reply
527  * @param c      The connection
528  * @param cookie The cookie
529  * @param e      The xcb_generic_error_t supplied
530  *
531  * Returns the reply of the request asked by
532  *
533  * The parameter @p e supplied to this function must be NULL if
534  * xcb_composite_get_overlay_window_unchecked(). is used.
535  * Otherwise, it stores the error if any.
536  *
537  * The returned value must be freed by the caller using free().
538  */
539 xcb_composite_get_overlay_window_reply_t *
540 xcb_composite_get_overlay_window_reply (xcb_connection_t                           *c,
541                                         xcb_composite_get_overlay_window_cookie_t   cookie  /**< */,
542                                         xcb_generic_error_t                       **e);
543 
544 /**
545  *
546  * @param c The connection
547  * @return A cookie
548  *
549  * Delivers a request to the X server.
550  *
551  * This form can be used only if the request will not cause
552  * a reply to be generated. Any returned error will be
553  * saved for handling by xcb_request_check().
554  */
555 xcb_void_cookie_t
556 xcb_composite_release_overlay_window_checked (xcb_connection_t *c,
557                                               xcb_window_t      window);
558 
559 /**
560  *
561  * @param c The connection
562  * @return A cookie
563  *
564  * Delivers a request to the X server.
565  *
566  */
567 xcb_void_cookie_t
568 xcb_composite_release_overlay_window (xcb_connection_t *c,
569                                       xcb_window_t      window);
570 
571 
572 #ifdef __cplusplus
573 }
574 #endif
575 
576 #endif
577 
578 /**
579  * @}
580  */
581