xref: /minix/external/mit/xorg/lib/libxcb/files/damage.c (revision 0a6a1f1d)
1 /*
2  * This file generated automatically from damage.xml by c_client.py.
3  * Edit at your peril.
4  */
5 
6 #ifdef HAVE_CONFIG_H
7 #include "config.h"
8 #endif
9 #include <stdlib.h>
10 #include <string.h>
11 #include <assert.h>
12 #include <stddef.h>  /* for offsetof() */
13 #include "xcbext.h"
14 #include "damage.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 #include "xfixes.h"
19 
20 xcb_extension_t xcb_damage_id = { "DAMAGE", 0 };
21 
22 void
xcb_damage_damage_next(xcb_damage_damage_iterator_t * i)23 xcb_damage_damage_next (xcb_damage_damage_iterator_t *i  /**< */)
24 {
25     --i->rem;
26     ++i->data;
27     i->index += sizeof(xcb_damage_damage_t);
28 }
29 
30 xcb_generic_iterator_t
xcb_damage_damage_end(xcb_damage_damage_iterator_t i)31 xcb_damage_damage_end (xcb_damage_damage_iterator_t i  /**< */)
32 {
33     xcb_generic_iterator_t ret;
34     ret.data = i.data + i.rem;
35     ret.index = i.index + ((char *) ret.data - (char *) i.data);
36     ret.rem = 0;
37     return ret;
38 }
39 
40 xcb_damage_query_version_cookie_t
xcb_damage_query_version(xcb_connection_t * c,uint32_t client_major_version,uint32_t client_minor_version)41 xcb_damage_query_version (xcb_connection_t *c  /**< */,
42                           uint32_t          client_major_version  /**< */,
43                           uint32_t          client_minor_version  /**< */)
44 {
45     static const xcb_protocol_request_t xcb_req = {
46         /* count */ 2,
47         /* ext */ &xcb_damage_id,
48         /* opcode */ XCB_DAMAGE_QUERY_VERSION,
49         /* isvoid */ 0
50     };
51 
52     struct iovec xcb_parts[4];
53     xcb_damage_query_version_cookie_t xcb_ret;
54     xcb_damage_query_version_request_t xcb_out;
55 
56     xcb_out.client_major_version = client_major_version;
57     xcb_out.client_minor_version = client_minor_version;
58 
59     xcb_parts[2].iov_base = (char *) &xcb_out;
60     xcb_parts[2].iov_len = sizeof(xcb_out);
61     xcb_parts[3].iov_base = 0;
62     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
63 
64     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
65     return xcb_ret;
66 }
67 
68 xcb_damage_query_version_cookie_t
xcb_damage_query_version_unchecked(xcb_connection_t * c,uint32_t client_major_version,uint32_t client_minor_version)69 xcb_damage_query_version_unchecked (xcb_connection_t *c  /**< */,
70                                     uint32_t          client_major_version  /**< */,
71                                     uint32_t          client_minor_version  /**< */)
72 {
73     static const xcb_protocol_request_t xcb_req = {
74         /* count */ 2,
75         /* ext */ &xcb_damage_id,
76         /* opcode */ XCB_DAMAGE_QUERY_VERSION,
77         /* isvoid */ 0
78     };
79 
80     struct iovec xcb_parts[4];
81     xcb_damage_query_version_cookie_t xcb_ret;
82     xcb_damage_query_version_request_t xcb_out;
83 
84     xcb_out.client_major_version = client_major_version;
85     xcb_out.client_minor_version = client_minor_version;
86 
87     xcb_parts[2].iov_base = (char *) &xcb_out;
88     xcb_parts[2].iov_len = sizeof(xcb_out);
89     xcb_parts[3].iov_base = 0;
90     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
91 
92     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
93     return xcb_ret;
94 }
95 
96 xcb_damage_query_version_reply_t *
xcb_damage_query_version_reply(xcb_connection_t * c,xcb_damage_query_version_cookie_t cookie,xcb_generic_error_t ** e)97 xcb_damage_query_version_reply (xcb_connection_t                   *c  /**< */,
98                                 xcb_damage_query_version_cookie_t   cookie  /**< */,
99                                 xcb_generic_error_t               **e  /**< */)
100 {
101     return (xcb_damage_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
102 }
103 
104 xcb_void_cookie_t
xcb_damage_create_checked(xcb_connection_t * c,xcb_damage_damage_t damage,xcb_drawable_t drawable,uint8_t level)105 xcb_damage_create_checked (xcb_connection_t    *c  /**< */,
106                            xcb_damage_damage_t  damage  /**< */,
107                            xcb_drawable_t       drawable  /**< */,
108                            uint8_t              level  /**< */)
109 {
110     static const xcb_protocol_request_t xcb_req = {
111         /* count */ 2,
112         /* ext */ &xcb_damage_id,
113         /* opcode */ XCB_DAMAGE_CREATE,
114         /* isvoid */ 1
115     };
116 
117     struct iovec xcb_parts[4];
118     xcb_void_cookie_t xcb_ret;
119     xcb_damage_create_request_t xcb_out;
120 
121     xcb_out.damage = damage;
122     xcb_out.drawable = drawable;
123     xcb_out.level = level;
124     memset(xcb_out.pad0, 0, 3);
125 
126     xcb_parts[2].iov_base = (char *) &xcb_out;
127     xcb_parts[2].iov_len = sizeof(xcb_out);
128     xcb_parts[3].iov_base = 0;
129     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
130 
131     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
132     return xcb_ret;
133 }
134 
135 xcb_void_cookie_t
xcb_damage_create(xcb_connection_t * c,xcb_damage_damage_t damage,xcb_drawable_t drawable,uint8_t level)136 xcb_damage_create (xcb_connection_t    *c  /**< */,
137                    xcb_damage_damage_t  damage  /**< */,
138                    xcb_drawable_t       drawable  /**< */,
139                    uint8_t              level  /**< */)
140 {
141     static const xcb_protocol_request_t xcb_req = {
142         /* count */ 2,
143         /* ext */ &xcb_damage_id,
144         /* opcode */ XCB_DAMAGE_CREATE,
145         /* isvoid */ 1
146     };
147 
148     struct iovec xcb_parts[4];
149     xcb_void_cookie_t xcb_ret;
150     xcb_damage_create_request_t xcb_out;
151 
152     xcb_out.damage = damage;
153     xcb_out.drawable = drawable;
154     xcb_out.level = level;
155     memset(xcb_out.pad0, 0, 3);
156 
157     xcb_parts[2].iov_base = (char *) &xcb_out;
158     xcb_parts[2].iov_len = sizeof(xcb_out);
159     xcb_parts[3].iov_base = 0;
160     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
161 
162     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
163     return xcb_ret;
164 }
165 
166 xcb_void_cookie_t
xcb_damage_destroy_checked(xcb_connection_t * c,xcb_damage_damage_t damage)167 xcb_damage_destroy_checked (xcb_connection_t    *c  /**< */,
168                             xcb_damage_damage_t  damage  /**< */)
169 {
170     static const xcb_protocol_request_t xcb_req = {
171         /* count */ 2,
172         /* ext */ &xcb_damage_id,
173         /* opcode */ XCB_DAMAGE_DESTROY,
174         /* isvoid */ 1
175     };
176 
177     struct iovec xcb_parts[4];
178     xcb_void_cookie_t xcb_ret;
179     xcb_damage_destroy_request_t xcb_out;
180 
181     xcb_out.damage = damage;
182 
183     xcb_parts[2].iov_base = (char *) &xcb_out;
184     xcb_parts[2].iov_len = sizeof(xcb_out);
185     xcb_parts[3].iov_base = 0;
186     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
187 
188     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
189     return xcb_ret;
190 }
191 
192 xcb_void_cookie_t
xcb_damage_destroy(xcb_connection_t * c,xcb_damage_damage_t damage)193 xcb_damage_destroy (xcb_connection_t    *c  /**< */,
194                     xcb_damage_damage_t  damage  /**< */)
195 {
196     static const xcb_protocol_request_t xcb_req = {
197         /* count */ 2,
198         /* ext */ &xcb_damage_id,
199         /* opcode */ XCB_DAMAGE_DESTROY,
200         /* isvoid */ 1
201     };
202 
203     struct iovec xcb_parts[4];
204     xcb_void_cookie_t xcb_ret;
205     xcb_damage_destroy_request_t xcb_out;
206 
207     xcb_out.damage = damage;
208 
209     xcb_parts[2].iov_base = (char *) &xcb_out;
210     xcb_parts[2].iov_len = sizeof(xcb_out);
211     xcb_parts[3].iov_base = 0;
212     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
213 
214     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
215     return xcb_ret;
216 }
217 
218 xcb_void_cookie_t
xcb_damage_subtract_checked(xcb_connection_t * c,xcb_damage_damage_t damage,xcb_xfixes_region_t repair,xcb_xfixes_region_t parts)219 xcb_damage_subtract_checked (xcb_connection_t    *c  /**< */,
220                              xcb_damage_damage_t  damage  /**< */,
221                              xcb_xfixes_region_t  repair  /**< */,
222                              xcb_xfixes_region_t  parts  /**< */)
223 {
224     static const xcb_protocol_request_t xcb_req = {
225         /* count */ 2,
226         /* ext */ &xcb_damage_id,
227         /* opcode */ XCB_DAMAGE_SUBTRACT,
228         /* isvoid */ 1
229     };
230 
231     struct iovec xcb_parts[4];
232     xcb_void_cookie_t xcb_ret;
233     xcb_damage_subtract_request_t xcb_out;
234 
235     xcb_out.damage = damage;
236     xcb_out.repair = repair;
237     xcb_out.parts = parts;
238 
239     xcb_parts[2].iov_base = (char *) &xcb_out;
240     xcb_parts[2].iov_len = sizeof(xcb_out);
241     xcb_parts[3].iov_base = 0;
242     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
243 
244     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
245     return xcb_ret;
246 }
247 
248 xcb_void_cookie_t
xcb_damage_subtract(xcb_connection_t * c,xcb_damage_damage_t damage,xcb_xfixes_region_t repair,xcb_xfixes_region_t parts)249 xcb_damage_subtract (xcb_connection_t    *c  /**< */,
250                      xcb_damage_damage_t  damage  /**< */,
251                      xcb_xfixes_region_t  repair  /**< */,
252                      xcb_xfixes_region_t  parts  /**< */)
253 {
254     static const xcb_protocol_request_t xcb_req = {
255         /* count */ 2,
256         /* ext */ &xcb_damage_id,
257         /* opcode */ XCB_DAMAGE_SUBTRACT,
258         /* isvoid */ 1
259     };
260 
261     struct iovec xcb_parts[4];
262     xcb_void_cookie_t xcb_ret;
263     xcb_damage_subtract_request_t xcb_out;
264 
265     xcb_out.damage = damage;
266     xcb_out.repair = repair;
267     xcb_out.parts = parts;
268 
269     xcb_parts[2].iov_base = (char *) &xcb_out;
270     xcb_parts[2].iov_len = sizeof(xcb_out);
271     xcb_parts[3].iov_base = 0;
272     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
273 
274     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
275     return xcb_ret;
276 }
277 
278 xcb_void_cookie_t
xcb_damage_add_checked(xcb_connection_t * c,xcb_drawable_t drawable,xcb_xfixes_region_t region)279 xcb_damage_add_checked (xcb_connection_t    *c  /**< */,
280                         xcb_drawable_t       drawable  /**< */,
281                         xcb_xfixes_region_t  region  /**< */)
282 {
283     static const xcb_protocol_request_t xcb_req = {
284         /* count */ 2,
285         /* ext */ &xcb_damage_id,
286         /* opcode */ XCB_DAMAGE_ADD,
287         /* isvoid */ 1
288     };
289 
290     struct iovec xcb_parts[4];
291     xcb_void_cookie_t xcb_ret;
292     xcb_damage_add_request_t xcb_out;
293 
294     xcb_out.drawable = drawable;
295     xcb_out.region = region;
296 
297     xcb_parts[2].iov_base = (char *) &xcb_out;
298     xcb_parts[2].iov_len = sizeof(xcb_out);
299     xcb_parts[3].iov_base = 0;
300     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
301 
302     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
303     return xcb_ret;
304 }
305 
306 xcb_void_cookie_t
xcb_damage_add(xcb_connection_t * c,xcb_drawable_t drawable,xcb_xfixes_region_t region)307 xcb_damage_add (xcb_connection_t    *c  /**< */,
308                 xcb_drawable_t       drawable  /**< */,
309                 xcb_xfixes_region_t  region  /**< */)
310 {
311     static const xcb_protocol_request_t xcb_req = {
312         /* count */ 2,
313         /* ext */ &xcb_damage_id,
314         /* opcode */ XCB_DAMAGE_ADD,
315         /* isvoid */ 1
316     };
317 
318     struct iovec xcb_parts[4];
319     xcb_void_cookie_t xcb_ret;
320     xcb_damage_add_request_t xcb_out;
321 
322     xcb_out.drawable = drawable;
323     xcb_out.region = region;
324 
325     xcb_parts[2].iov_base = (char *) &xcb_out;
326     xcb_parts[2].iov_len = sizeof(xcb_out);
327     xcb_parts[3].iov_base = 0;
328     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
329 
330     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
331     return xcb_ret;
332 }
333 
334