1/*
2 * This file generated automatically from xtest.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 "xtest.h"
15
16#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17#include "xproto.h"
18
19xcb_extension_t xcb_test_id = { "XTEST", 0 };
20
21xcb_test_get_version_cookie_t
22xcb_test_get_version (xcb_connection_t *c,
23                      uint8_t           major_version,
24                      uint16_t          minor_version)
25{
26    static const xcb_protocol_request_t xcb_req = {
27        .count = 2,
28        .ext = &xcb_test_id,
29        .opcode = XCB_TEST_GET_VERSION,
30        .isvoid = 0
31    };
32
33    struct iovec xcb_parts[4];
34    xcb_test_get_version_cookie_t xcb_ret;
35    xcb_test_get_version_request_t xcb_out;
36
37    xcb_out.major_version = major_version;
38    xcb_out.pad0 = 0;
39    xcb_out.minor_version = minor_version;
40
41    xcb_parts[2].iov_base = (char *) &xcb_out;
42    xcb_parts[2].iov_len = sizeof(xcb_out);
43    xcb_parts[3].iov_base = 0;
44    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
45
46    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
47    return xcb_ret;
48}
49
50xcb_test_get_version_cookie_t
51xcb_test_get_version_unchecked (xcb_connection_t *c,
52                                uint8_t           major_version,
53                                uint16_t          minor_version)
54{
55    static const xcb_protocol_request_t xcb_req = {
56        .count = 2,
57        .ext = &xcb_test_id,
58        .opcode = XCB_TEST_GET_VERSION,
59        .isvoid = 0
60    };
61
62    struct iovec xcb_parts[4];
63    xcb_test_get_version_cookie_t xcb_ret;
64    xcb_test_get_version_request_t xcb_out;
65
66    xcb_out.major_version = major_version;
67    xcb_out.pad0 = 0;
68    xcb_out.minor_version = minor_version;
69
70    xcb_parts[2].iov_base = (char *) &xcb_out;
71    xcb_parts[2].iov_len = sizeof(xcb_out);
72    xcb_parts[3].iov_base = 0;
73    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
74
75    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
76    return xcb_ret;
77}
78
79xcb_test_get_version_reply_t *
80xcb_test_get_version_reply (xcb_connection_t               *c,
81                            xcb_test_get_version_cookie_t   cookie  /**< */,
82                            xcb_generic_error_t           **e)
83{
84    return (xcb_test_get_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
85}
86
87xcb_test_compare_cursor_cookie_t
88xcb_test_compare_cursor (xcb_connection_t *c,
89                         xcb_window_t      window,
90                         xcb_cursor_t      cursor)
91{
92    static const xcb_protocol_request_t xcb_req = {
93        .count = 2,
94        .ext = &xcb_test_id,
95        .opcode = XCB_TEST_COMPARE_CURSOR,
96        .isvoid = 0
97    };
98
99    struct iovec xcb_parts[4];
100    xcb_test_compare_cursor_cookie_t xcb_ret;
101    xcb_test_compare_cursor_request_t xcb_out;
102
103    xcb_out.window = window;
104    xcb_out.cursor = cursor;
105
106    xcb_parts[2].iov_base = (char *) &xcb_out;
107    xcb_parts[2].iov_len = sizeof(xcb_out);
108    xcb_parts[3].iov_base = 0;
109    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
110
111    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
112    return xcb_ret;
113}
114
115xcb_test_compare_cursor_cookie_t
116xcb_test_compare_cursor_unchecked (xcb_connection_t *c,
117                                   xcb_window_t      window,
118                                   xcb_cursor_t      cursor)
119{
120    static const xcb_protocol_request_t xcb_req = {
121        .count = 2,
122        .ext = &xcb_test_id,
123        .opcode = XCB_TEST_COMPARE_CURSOR,
124        .isvoid = 0
125    };
126
127    struct iovec xcb_parts[4];
128    xcb_test_compare_cursor_cookie_t xcb_ret;
129    xcb_test_compare_cursor_request_t xcb_out;
130
131    xcb_out.window = window;
132    xcb_out.cursor = cursor;
133
134    xcb_parts[2].iov_base = (char *) &xcb_out;
135    xcb_parts[2].iov_len = sizeof(xcb_out);
136    xcb_parts[3].iov_base = 0;
137    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
138
139    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
140    return xcb_ret;
141}
142
143xcb_test_compare_cursor_reply_t *
144xcb_test_compare_cursor_reply (xcb_connection_t                  *c,
145                               xcb_test_compare_cursor_cookie_t   cookie  /**< */,
146                               xcb_generic_error_t              **e)
147{
148    return (xcb_test_compare_cursor_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
149}
150
151xcb_void_cookie_t
152xcb_test_fake_input_checked (xcb_connection_t *c,
153                             uint8_t           type,
154                             uint8_t           detail,
155                             uint32_t          time,
156                             xcb_window_t      root,
157                             int16_t           rootX,
158                             int16_t           rootY,
159                             uint8_t           deviceid)
160{
161    static const xcb_protocol_request_t xcb_req = {
162        .count = 2,
163        .ext = &xcb_test_id,
164        .opcode = XCB_TEST_FAKE_INPUT,
165        .isvoid = 1
166    };
167
168    struct iovec xcb_parts[4];
169    xcb_void_cookie_t xcb_ret;
170    xcb_test_fake_input_request_t xcb_out;
171
172    xcb_out.type = type;
173    xcb_out.detail = detail;
174    memset(xcb_out.pad0, 0, 2);
175    xcb_out.time = time;
176    xcb_out.root = root;
177    memset(xcb_out.pad1, 0, 8);
178    xcb_out.rootX = rootX;
179    xcb_out.rootY = rootY;
180    memset(xcb_out.pad2, 0, 7);
181    xcb_out.deviceid = deviceid;
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
192xcb_void_cookie_t
193xcb_test_fake_input (xcb_connection_t *c,
194                     uint8_t           type,
195                     uint8_t           detail,
196                     uint32_t          time,
197                     xcb_window_t      root,
198                     int16_t           rootX,
199                     int16_t           rootY,
200                     uint8_t           deviceid)
201{
202    static const xcb_protocol_request_t xcb_req = {
203        .count = 2,
204        .ext = &xcb_test_id,
205        .opcode = XCB_TEST_FAKE_INPUT,
206        .isvoid = 1
207    };
208
209    struct iovec xcb_parts[4];
210    xcb_void_cookie_t xcb_ret;
211    xcb_test_fake_input_request_t xcb_out;
212
213    xcb_out.type = type;
214    xcb_out.detail = detail;
215    memset(xcb_out.pad0, 0, 2);
216    xcb_out.time = time;
217    xcb_out.root = root;
218    memset(xcb_out.pad1, 0, 8);
219    xcb_out.rootX = rootX;
220    xcb_out.rootY = rootY;
221    memset(xcb_out.pad2, 0, 7);
222    xcb_out.deviceid = deviceid;
223
224    xcb_parts[2].iov_base = (char *) &xcb_out;
225    xcb_parts[2].iov_len = sizeof(xcb_out);
226    xcb_parts[3].iov_base = 0;
227    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
228
229    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
230    return xcb_ret;
231}
232
233xcb_void_cookie_t
234xcb_test_grab_control_checked (xcb_connection_t *c,
235                               uint8_t           impervious)
236{
237    static const xcb_protocol_request_t xcb_req = {
238        .count = 2,
239        .ext = &xcb_test_id,
240        .opcode = XCB_TEST_GRAB_CONTROL,
241        .isvoid = 1
242    };
243
244    struct iovec xcb_parts[4];
245    xcb_void_cookie_t xcb_ret;
246    xcb_test_grab_control_request_t xcb_out;
247
248    xcb_out.impervious = impervious;
249    memset(xcb_out.pad0, 0, 3);
250
251    xcb_parts[2].iov_base = (char *) &xcb_out;
252    xcb_parts[2].iov_len = sizeof(xcb_out);
253    xcb_parts[3].iov_base = 0;
254    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
255
256    xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
257    return xcb_ret;
258}
259
260xcb_void_cookie_t
261xcb_test_grab_control (xcb_connection_t *c,
262                       uint8_t           impervious)
263{
264    static const xcb_protocol_request_t xcb_req = {
265        .count = 2,
266        .ext = &xcb_test_id,
267        .opcode = XCB_TEST_GRAB_CONTROL,
268        .isvoid = 1
269    };
270
271    struct iovec xcb_parts[4];
272    xcb_void_cookie_t xcb_ret;
273    xcb_test_grab_control_request_t xcb_out;
274
275    xcb_out.impervious = impervious;
276    memset(xcb_out.pad0, 0, 3);
277
278    xcb_parts[2].iov_base = (char *) &xcb_out;
279    xcb_parts[2].iov_len = sizeof(xcb_out);
280    xcb_parts[3].iov_base = 0;
281    xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
282
283    xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
284    return xcb_ret;
285}
286
287