regenerate these for libxcb 1.13.diff -r1.4 -r1.5 src/external/mit/xorg/lib/libxcb/files/config.h
(mrg)
--- src/external/mit/xorg/lib/libxcb/files/config.h 2017/03/05 09:27:53 1.4
+++ src/external/mit/xorg/lib/libxcb/files/config.h 2018/03/14 06:47:28 1.5
@@ -67,42 +67,42 @@ | @@ -67,42 +67,42 @@ | |||
67 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ | 67 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ | |
68 | #define LT_OBJDIR ".libs/" | 68 | #define LT_OBJDIR ".libs/" | |
69 | 69 | |||
70 | /* Name of package */ | 70 | /* Name of package */ | |
71 | #define PACKAGE "libxcb" | 71 | #define PACKAGE "libxcb" | |
72 | 72 | |||
73 | /* Define to the address where bug reports for this package should be sent. */ | 73 | /* Define to the address where bug reports for this package should be sent. */ | |
74 | #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xcb" | 74 | #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xcb" | |
75 | 75 | |||
76 | /* Define to the full name of this package. */ | 76 | /* Define to the full name of this package. */ | |
77 | #define PACKAGE_NAME "libxcb" | 77 | #define PACKAGE_NAME "libxcb" | |
78 | 78 | |||
79 | /* Define to the full name and version of this package. */ | 79 | /* Define to the full name and version of this package. */ | |
80 | #define PACKAGE_STRING "libxcb 1.12" | 80 | #define PACKAGE_STRING "libxcb 1.13" | |
81 | 81 | |||
82 | /* Define to the one symbol short name of this package. */ | 82 | /* Define to the one symbol short name of this package. */ | |
83 | #define PACKAGE_TARNAME "libxcb" | 83 | #define PACKAGE_TARNAME "libxcb" | |
84 | 84 | |||
85 | /* Define to the home page for this package. */ | 85 | /* Define to the home page for this package. */ | |
86 | #define PACKAGE_URL "" | 86 | #define PACKAGE_URL "" | |
87 | 87 | |||
88 | /* Define to the version of this package. */ | 88 | /* Define to the version of this package. */ | |
89 | #define PACKAGE_VERSION "1.12" | 89 | #define PACKAGE_VERSION "1.13" | |
90 | 90 | |||
91 | /* Major version of this package */ | 91 | /* Major version of this package */ | |
92 | #define PACKAGE_VERSION_MAJOR 1 | 92 | #define PACKAGE_VERSION_MAJOR 1 | |
93 | 93 | |||
94 | /* Minor version of this package */ | 94 | /* Minor version of this package */ | |
95 | #define PACKAGE_VERSION_MINOR 12 | 95 | #define PACKAGE_VERSION_MINOR 13 | |
96 | 96 | |||
97 | /* Patch version of this package */ | 97 | /* Patch version of this package */ | |
98 | #define PACKAGE_VERSION_PATCHLEVEL 0 | 98 | #define PACKAGE_VERSION_PATCHLEVEL 0 | |
99 | 99 | |||
100 | /* Define to 1 if you have the ANSI C header files. */ | 100 | /* Define to 1 if you have the ANSI C header files. */ | |
101 | #define STDC_HEADERS 1 | 101 | #define STDC_HEADERS 1 | |
102 | 102 | |||
103 | /* poll() function is available */ | 103 | /* poll() function is available */ | |
104 | #define USE_POLL 1 | 104 | #define USE_POLL 1 | |
105 | 105 | |||
106 | /* Enable extensions on AIX 3, Interix. */ | 106 | /* Enable extensions on AIX 3, Interix. */ | |
107 | #ifndef _ALL_SOURCE | 107 | #ifndef _ALL_SOURCE | |
108 | # define _ALL_SOURCE 1 | 108 | # define _ALL_SOURCE 1 | |
@@ -116,27 +116,27 @@ | @@ -116,27 +116,27 @@ | |||
116 | # define _POSIX_PTHREAD_SEMANTICS 1 | 116 | # define _POSIX_PTHREAD_SEMANTICS 1 | |
117 | #endif | 117 | #endif | |
118 | /* Enable extensions on HP NonStop. */ | 118 | /* Enable extensions on HP NonStop. */ | |
119 | #ifndef _TANDEM_SOURCE | 119 | #ifndef _TANDEM_SOURCE | |
120 | # define _TANDEM_SOURCE 1 | 120 | # define _TANDEM_SOURCE 1 | |
121 | #endif | 121 | #endif | |
122 | /* Enable general extensions on Solaris. */ | 122 | /* Enable general extensions on Solaris. */ | |
123 | #ifndef __EXTENSIONS__ | 123 | #ifndef __EXTENSIONS__ | |
124 | # define __EXTENSIONS__ 1 | 124 | # define __EXTENSIONS__ 1 | |
125 | #endif | 125 | #endif | |
126 | 126 | |||
127 | 127 | |||
128 | /* Version number of package */ | 128 | /* Version number of package */ | |
129 | #define VERSION "1.12" | 129 | #define VERSION "1.13" | |
130 | 130 | |||
131 | /* XCB buffer queue size */ | 131 | /* XCB buffer queue size */ | |
132 | #define XCB_QUEUE_BUFFER_SIZE 16384 | 132 | #define XCB_QUEUE_BUFFER_SIZE 16384 | |
133 | 133 | |||
134 | /* Define to 1 if on MINIX. */ | 134 | /* Define to 1 if on MINIX. */ | |
135 | /* #undef _MINIX */ | 135 | /* #undef _MINIX */ | |
136 | 136 | |||
137 | /* Define to 2 if the system does not provide POSIX.1 features except with | 137 | /* Define to 2 if the system does not provide POSIX.1 features except with | |
138 | this defined. */ | 138 | this defined. */ | |
139 | /* #undef _POSIX_1_SOURCE */ | 139 | /* #undef _POSIX_1_SOURCE */ | |
140 | 140 | |||
141 | /* Define to 1 if you need to in order for `stat' and other things to work. */ | 141 | /* Define to 1 if you need to in order for `stat' and other things to work. */ | |
142 | /* #undef _POSIX_SOURCE */ | 142 | /* #undef _POSIX_SOURCE */ |
--- src/external/mit/xorg/lib/libxcb/files/xkb.c 2017/03/05 09:27:53 1.4
+++ src/external/mit/xorg/lib/libxcb/files/xkb.c 2018/03/14 06:47:28 1.5
@@ -11363,29 +11363,29 @@ xcb_xkb_set_device_info_checked (xcb_con | @@ -11363,29 +11363,29 @@ xcb_xkb_set_device_info_checked (xcb_con | |||
11363 | const xcb_xkb_action_t *btnActions, | 11363 | const xcb_xkb_action_t *btnActions, | |
11364 | const xcb_xkb_device_led_info_t *leds) | 11364 | const xcb_xkb_device_led_info_t *leds) | |
11365 | { | 11365 | { | |
11366 | static const xcb_protocol_request_t xcb_req = { | 11366 | static const xcb_protocol_request_t xcb_req = { | |
11367 | .count = 6, | 11367 | .count = 6, | |
11368 | .ext = &xcb_xkb_id, | 11368 | .ext = &xcb_xkb_id, | |
11369 | .opcode = XCB_XKB_SET_DEVICE_INFO, | 11369 | .opcode = XCB_XKB_SET_DEVICE_INFO, | |
11370 | .isvoid = 1 | 11370 | .isvoid = 1 | |
11371 | }; | 11371 | }; | |
11372 | 11372 | |||
11373 | struct iovec xcb_parts[8]; | 11373 | struct iovec xcb_parts[8]; | |
11374 | xcb_void_cookie_t xcb_ret; | 11374 | xcb_void_cookie_t xcb_ret; | |
11375 | xcb_xkb_set_device_info_request_t xcb_out; | 11375 | xcb_xkb_set_device_info_request_t xcb_out; | |
11376 | unsigned int i; | |||
11377 | unsigned int xcb_tmp_len; | 11376 | unsigned int xcb_tmp_len; | |
11378 | char *xcb_tmp; | 11377 | char *xcb_tmp; | |
11378 | unsigned int i; | |||
11379 | 11379 | |||
11380 | xcb_out.deviceSpec = deviceSpec; | 11380 | xcb_out.deviceSpec = deviceSpec; | |
11381 | xcb_out.firstBtn = firstBtn; | 11381 | xcb_out.firstBtn = firstBtn; | |
11382 | xcb_out.nBtns = nBtns; | 11382 | xcb_out.nBtns = nBtns; | |
11383 | xcb_out.change = change; | 11383 | xcb_out.change = change; | |
11384 | xcb_out.nDeviceLedFBs = nDeviceLedFBs; | 11384 | xcb_out.nDeviceLedFBs = nDeviceLedFBs; | |
11385 | 11385 | |||
11386 | xcb_parts[2].iov_base = (char *) &xcb_out; | 11386 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
11387 | xcb_parts[2].iov_len = sizeof(xcb_out); | 11387 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
11388 | xcb_parts[3].iov_base = 0; | 11388 | xcb_parts[3].iov_base = 0; | |
11389 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 11389 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
11390 | /* xcb_xkb_action_t btnActions */ | 11390 | /* xcb_xkb_action_t btnActions */ | |
11391 | xcb_parts[4].iov_base = (char *) btnActions; | 11391 | xcb_parts[4].iov_base = (char *) btnActions; | |
@@ -11418,29 +11418,29 @@ xcb_xkb_set_device_info (xcb_connection_ | @@ -11418,29 +11418,29 @@ xcb_xkb_set_device_info (xcb_connection_ | |||
11418 | const xcb_xkb_action_t *btnActions, | 11418 | const xcb_xkb_action_t *btnActions, | |
11419 | const xcb_xkb_device_led_info_t *leds) | 11419 | const xcb_xkb_device_led_info_t *leds) | |
11420 | { | 11420 | { | |
11421 | static const xcb_protocol_request_t xcb_req = { | 11421 | static const xcb_protocol_request_t xcb_req = { | |
11422 | .count = 6, | 11422 | .count = 6, | |
11423 | .ext = &xcb_xkb_id, | 11423 | .ext = &xcb_xkb_id, | |
11424 | .opcode = XCB_XKB_SET_DEVICE_INFO, | 11424 | .opcode = XCB_XKB_SET_DEVICE_INFO, | |
11425 | .isvoid = 1 | 11425 | .isvoid = 1 | |
11426 | }; | 11426 | }; | |
11427 | 11427 | |||
11428 | struct iovec xcb_parts[8]; | 11428 | struct iovec xcb_parts[8]; | |
11429 | xcb_void_cookie_t xcb_ret; | 11429 | xcb_void_cookie_t xcb_ret; | |
11430 | xcb_xkb_set_device_info_request_t xcb_out; | 11430 | xcb_xkb_set_device_info_request_t xcb_out; | |
11431 | unsigned int i; | |||
11432 | unsigned int xcb_tmp_len; | 11431 | unsigned int xcb_tmp_len; | |
11433 | char *xcb_tmp; | 11432 | char *xcb_tmp; | |
11433 | unsigned int i; | |||
11434 | 11434 | |||
11435 | xcb_out.deviceSpec = deviceSpec; | 11435 | xcb_out.deviceSpec = deviceSpec; | |
11436 | xcb_out.firstBtn = firstBtn; | 11436 | xcb_out.firstBtn = firstBtn; | |
11437 | xcb_out.nBtns = nBtns; | 11437 | xcb_out.nBtns = nBtns; | |
11438 | xcb_out.change = change; | 11438 | xcb_out.change = change; | |
11439 | xcb_out.nDeviceLedFBs = nDeviceLedFBs; | 11439 | xcb_out.nDeviceLedFBs = nDeviceLedFBs; | |
11440 | 11440 | |||
11441 | xcb_parts[2].iov_base = (char *) &xcb_out; | 11441 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
11442 | xcb_parts[2].iov_len = sizeof(xcb_out); | 11442 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
11443 | xcb_parts[3].iov_base = 0; | 11443 | xcb_parts[3].iov_base = 0; | |
11444 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 11444 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
11445 | /* xcb_xkb_action_t btnActions */ | 11445 | /* xcb_xkb_action_t btnActions */ | |
11446 | xcb_parts[4].iov_base = (char *) btnActions; | 11446 | xcb_parts[4].iov_base = (char *) btnActions; |
--- src/external/mit/xorg/lib/libxcb/files/dri3.c 2017/03/05 09:27:53 1.3
+++ src/external/mit/xorg/lib/libxcb/files/dri3.c 2018/03/14 06:47:28 1.4
@@ -166,42 +166,43 @@ xcb_dri3_pixmap_from_buffer_checked (xcb | @@ -166,42 +166,43 @@ xcb_dri3_pixmap_from_buffer_checked (xcb | |||
166 | int32_t pixmap_fd) | 166 | int32_t pixmap_fd) | |
167 | { | 167 | { | |
168 | static const xcb_protocol_request_t xcb_req = { | 168 | static const xcb_protocol_request_t xcb_req = { | |
169 | .count = 2, | 169 | .count = 2, | |
170 | .ext = &xcb_dri3_id, | 170 | .ext = &xcb_dri3_id, | |
171 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFER, | 171 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFER, | |
172 | .isvoid = 1 | 172 | .isvoid = 1 | |
173 | }; | 173 | }; | |
174 | 174 | |||
175 | struct iovec xcb_parts[4]; | 175 | struct iovec xcb_parts[4]; | |
176 | xcb_void_cookie_t xcb_ret; | 176 | xcb_void_cookie_t xcb_ret; | |
177 | xcb_dri3_pixmap_from_buffer_request_t xcb_out; | 177 | xcb_dri3_pixmap_from_buffer_request_t xcb_out; | |
178 | int fds[1]; | 178 | int fds[1]; | |
179 | int fd_index = 0; | |||
179 | 180 | |||
180 | xcb_out.pixmap = pixmap; | 181 | xcb_out.pixmap = pixmap; | |
181 | xcb_out.drawable = drawable; | 182 | xcb_out.drawable = drawable; | |
182 | xcb_out.size = size; | 183 | xcb_out.size = size; | |
183 | xcb_out.width = width; | 184 | xcb_out.width = width; | |
184 | xcb_out.height = height; | 185 | xcb_out.height = height; | |
185 | xcb_out.stride = stride; | 186 | xcb_out.stride = stride; | |
186 | xcb_out.depth = depth; | 187 | xcb_out.depth = depth; | |
187 | xcb_out.bpp = bpp; | 188 | xcb_out.bpp = bpp; | |
188 | 189 | |||
189 | xcb_parts[2].iov_base = (char *) &xcb_out; | 190 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
190 | xcb_parts[2].iov_len = sizeof(xcb_out); | 191 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
191 | xcb_parts[3].iov_base = 0; | 192 | xcb_parts[3].iov_base = 0; | |
192 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 193 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
193 | 194 | |||
194 | fds[0] = pixmap_fd; | 195 | fds[fd_index++] = pixmap_fd; | |
195 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | 196 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | |
196 | return xcb_ret; | 197 | return xcb_ret; | |
197 | } | 198 | } | |
198 | 199 | |||
199 | xcb_void_cookie_t | 200 | xcb_void_cookie_t | |
200 | xcb_dri3_pixmap_from_buffer (xcb_connection_t *c, | 201 | xcb_dri3_pixmap_from_buffer (xcb_connection_t *c, | |
201 | xcb_pixmap_t pixmap, | 202 | xcb_pixmap_t pixmap, | |
202 | xcb_drawable_t drawable, | 203 | xcb_drawable_t drawable, | |
203 | uint32_t size, | 204 | uint32_t size, | |
204 | uint16_t width, | 205 | uint16_t width, | |
205 | uint16_t height, | 206 | uint16_t height, | |
206 | uint16_t stride, | 207 | uint16_t stride, | |
207 | uint8_t depth, | 208 | uint8_t depth, | |
@@ -209,42 +210,43 @@ xcb_dri3_pixmap_from_buffer (xcb_connect | @@ -209,42 +210,43 @@ xcb_dri3_pixmap_from_buffer (xcb_connect | |||
209 | int32_t pixmap_fd) | 210 | int32_t pixmap_fd) | |
210 | { | 211 | { | |
211 | static const xcb_protocol_request_t xcb_req = { | 212 | static const xcb_protocol_request_t xcb_req = { | |
212 | .count = 2, | 213 | .count = 2, | |
213 | .ext = &xcb_dri3_id, | 214 | .ext = &xcb_dri3_id, | |
214 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFER, | 215 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFER, | |
215 | .isvoid = 1 | 216 | .isvoid = 1 | |
216 | }; | 217 | }; | |
217 | 218 | |||
218 | struct iovec xcb_parts[4]; | 219 | struct iovec xcb_parts[4]; | |
219 | xcb_void_cookie_t xcb_ret; | 220 | xcb_void_cookie_t xcb_ret; | |
220 | xcb_dri3_pixmap_from_buffer_request_t xcb_out; | 221 | xcb_dri3_pixmap_from_buffer_request_t xcb_out; | |
221 | int fds[1]; | 222 | int fds[1]; | |
223 | int fd_index = 0; | |||
222 | 224 | |||
223 | xcb_out.pixmap = pixmap; | 225 | xcb_out.pixmap = pixmap; | |
224 | xcb_out.drawable = drawable; | 226 | xcb_out.drawable = drawable; | |
225 | xcb_out.size = size; | 227 | xcb_out.size = size; | |
226 | xcb_out.width = width; | 228 | xcb_out.width = width; | |
227 | xcb_out.height = height; | 229 | xcb_out.height = height; | |
228 | xcb_out.stride = stride; | 230 | xcb_out.stride = stride; | |
229 | xcb_out.depth = depth; | 231 | xcb_out.depth = depth; | |
230 | xcb_out.bpp = bpp; | 232 | xcb_out.bpp = bpp; | |
231 | 233 | |||
232 | xcb_parts[2].iov_base = (char *) &xcb_out; | 234 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
233 | xcb_parts[2].iov_len = sizeof(xcb_out); | 235 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
234 | xcb_parts[3].iov_base = 0; | 236 | xcb_parts[3].iov_base = 0; | |
235 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 237 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
236 | 238 | |||
237 | fds[0] = pixmap_fd; | 239 | fds[fd_index++] = pixmap_fd; | |
238 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | 240 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | |
239 | return xcb_ret; | 241 | return xcb_ret; | |
240 | } | 242 | } | |
241 | 243 | |||
242 | xcb_dri3_buffer_from_pixmap_cookie_t | 244 | xcb_dri3_buffer_from_pixmap_cookie_t | |
243 | xcb_dri3_buffer_from_pixmap (xcb_connection_t *c, | 245 | xcb_dri3_buffer_from_pixmap (xcb_connection_t *c, | |
244 | xcb_pixmap_t pixmap) | 246 | xcb_pixmap_t pixmap) | |
245 | { | 247 | { | |
246 | static const xcb_protocol_request_t xcb_req = { | 248 | static const xcb_protocol_request_t xcb_req = { | |
247 | .count = 2, | 249 | .count = 2, | |
248 | .ext = &xcb_dri3_id, | 250 | .ext = &xcb_dri3_id, | |
249 | .opcode = XCB_DRI3_BUFFER_FROM_PIXMAP, | 251 | .opcode = XCB_DRI3_BUFFER_FROM_PIXMAP, | |
250 | .isvoid = 0 | 252 | .isvoid = 0 | |
@@ -314,72 +316,74 @@ xcb_dri3_fence_from_fd_checked (xcb_conn | @@ -314,72 +316,74 @@ xcb_dri3_fence_from_fd_checked (xcb_conn | |||
314 | int32_t fence_fd) | 316 | int32_t fence_fd) | |
315 | { | 317 | { | |
316 | static const xcb_protocol_request_t xcb_req = { | 318 | static const xcb_protocol_request_t xcb_req = { | |
317 | .count = 2, | 319 | .count = 2, | |
318 | .ext = &xcb_dri3_id, | 320 | .ext = &xcb_dri3_id, | |
319 | .opcode = XCB_DRI3_FENCE_FROM_FD, | 321 | .opcode = XCB_DRI3_FENCE_FROM_FD, | |
320 | .isvoid = 1 | 322 | .isvoid = 1 | |
321 | }; | 323 | }; | |
322 | 324 | |||
323 | struct iovec xcb_parts[4]; | 325 | struct iovec xcb_parts[4]; | |
324 | xcb_void_cookie_t xcb_ret; | 326 | xcb_void_cookie_t xcb_ret; | |
325 | xcb_dri3_fence_from_fd_request_t xcb_out; | 327 | xcb_dri3_fence_from_fd_request_t xcb_out; | |
326 | int fds[1]; | 328 | int fds[1]; | |
329 | int fd_index = 0; | |||
327 | 330 | |||
328 | xcb_out.drawable = drawable; | 331 | xcb_out.drawable = drawable; | |
329 | xcb_out.fence = fence; | 332 | xcb_out.fence = fence; | |
330 | xcb_out.initially_triggered = initially_triggered; | 333 | xcb_out.initially_triggered = initially_triggered; | |
331 | memset(xcb_out.pad0, 0, 3); | 334 | memset(xcb_out.pad0, 0, 3); | |
332 | 335 | |||
333 | xcb_parts[2].iov_base = (char *) &xcb_out; | 336 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
334 | xcb_parts[2].iov_len = sizeof(xcb_out); | 337 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
335 | xcb_parts[3].iov_base = 0; | 338 | xcb_parts[3].iov_base = 0; | |
336 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 339 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
337 | 340 | |||
338 | fds[0] = fence_fd; | 341 | fds[fd_index++] = fence_fd; | |
339 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | 342 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | |
340 | return xcb_ret; | 343 | return xcb_ret; | |
341 | } | 344 | } | |
342 | 345 | |||
343 | xcb_void_cookie_t | 346 | xcb_void_cookie_t | |
344 | xcb_dri3_fence_from_fd (xcb_connection_t *c, | 347 | xcb_dri3_fence_from_fd (xcb_connection_t *c, | |
345 | xcb_drawable_t drawable, | 348 | xcb_drawable_t drawable, | |
346 | uint32_t fence, | 349 | uint32_t fence, | |
347 | uint8_t initially_triggered, | 350 | uint8_t initially_triggered, | |
348 | int32_t fence_fd) | 351 | int32_t fence_fd) | |
349 | { | 352 | { | |
350 | static const xcb_protocol_request_t xcb_req = { | 353 | static const xcb_protocol_request_t xcb_req = { | |
351 | .count = 2, | 354 | .count = 2, | |
352 | .ext = &xcb_dri3_id, | 355 | .ext = &xcb_dri3_id, | |
353 | .opcode = XCB_DRI3_FENCE_FROM_FD, | 356 | .opcode = XCB_DRI3_FENCE_FROM_FD, | |
354 | .isvoid = 1 | 357 | .isvoid = 1 | |
355 | }; | 358 | }; | |
356 | 359 | |||
357 | struct iovec xcb_parts[4]; | 360 | struct iovec xcb_parts[4]; | |
358 | xcb_void_cookie_t xcb_ret; | 361 | xcb_void_cookie_t xcb_ret; | |
359 | xcb_dri3_fence_from_fd_request_t xcb_out; | 362 | xcb_dri3_fence_from_fd_request_t xcb_out; | |
360 | int fds[1]; | 363 | int fds[1]; | |
364 | int fd_index = 0; | |||
361 | 365 | |||
362 | xcb_out.drawable = drawable; | 366 | xcb_out.drawable = drawable; | |
363 | xcb_out.fence = fence; | 367 | xcb_out.fence = fence; | |
364 | xcb_out.initially_triggered = initially_triggered; | 368 | xcb_out.initially_triggered = initially_triggered; | |
365 | memset(xcb_out.pad0, 0, 3); | 369 | memset(xcb_out.pad0, 0, 3); | |
366 | 370 | |||
367 | xcb_parts[2].iov_base = (char *) &xcb_out; | 371 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
368 | xcb_parts[2].iov_len = sizeof(xcb_out); | 372 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
369 | xcb_parts[3].iov_base = 0; | 373 | xcb_parts[3].iov_base = 0; | |
370 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 374 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
371 | 375 | |||
372 | fds[0] = fence_fd; | 376 | fds[fd_index++] = fence_fd; | |
373 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | 377 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | |
374 | return xcb_ret; | 378 | return xcb_ret; | |
375 | } | 379 | } | |
376 | 380 | |||
377 | xcb_dri3_fd_from_fence_cookie_t | 381 | xcb_dri3_fd_from_fence_cookie_t | |
378 | xcb_dri3_fd_from_fence (xcb_connection_t *c, | 382 | xcb_dri3_fd_from_fence (xcb_connection_t *c, | |
379 | xcb_drawable_t drawable, | 383 | xcb_drawable_t drawable, | |
380 | uint32_t fence) | 384 | uint32_t fence) | |
381 | { | 385 | { | |
382 | static const xcb_protocol_request_t xcb_req = { | 386 | static const xcb_protocol_request_t xcb_req = { | |
383 | .count = 2, | 387 | .count = 2, | |
384 | .ext = &xcb_dri3_id, | 388 | .ext = &xcb_dri3_id, | |
385 | .opcode = XCB_DRI3_FD_FROM_FENCE, | 389 | .opcode = XCB_DRI3_FD_FROM_FENCE, | |
@@ -435,13 +439,481 @@ xcb_dri3_fd_from_fence_reply (xcb_connec | @@ -435,13 +439,481 @@ xcb_dri3_fd_from_fence_reply (xcb_connec | |||
435 | xcb_dri3_fd_from_fence_cookie_t cookie /**< */, | 439 | xcb_dri3_fd_from_fence_cookie_t cookie /**< */, | |
436 | xcb_generic_error_t **e) | 440 | xcb_generic_error_t **e) | |
437 | { | 441 | { | |
438 | return (xcb_dri3_fd_from_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | 442 | return (xcb_dri3_fd_from_fence_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |
439 | } | 443 | } | |
440 | 444 | |||
441 | int * | 445 | int * | |
442 | xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */, | 446 | xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */, | |
443 | xcb_dri3_fd_from_fence_reply_t *reply) | 447 | xcb_dri3_fd_from_fence_reply_t *reply) | |
444 | { | 448 | { | |
445 | return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_fd_from_fence_reply_t) + 4 * reply->length); | 449 | return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_fd_from_fence_reply_t) + 4 * reply->length); | |
446 | } | 450 | } | |
447 | 451 | |||
452 | int | |||
453 | xcb_dri3_get_supported_modifiers_sizeof (const void *_buffer) | |||
454 | { | |||
455 | char *xcb_tmp = (char *)_buffer; | |||
456 | const xcb_dri3_get_supported_modifiers_reply_t *_aux = (xcb_dri3_get_supported_modifiers_reply_t *)_buffer; | |||
457 | unsigned int xcb_buffer_len = 0; | |||
458 | unsigned int xcb_block_len = 0; | |||
459 | unsigned int xcb_pad = 0; | |||
460 | unsigned int xcb_align_to = 0; | |||
461 | ||||
462 | ||||
463 | xcb_block_len += sizeof(xcb_dri3_get_supported_modifiers_reply_t); | |||
464 | xcb_tmp += xcb_block_len; | |||
465 | xcb_buffer_len += xcb_block_len; | |||
466 | xcb_block_len = 0; | |||
467 | /* window_modifiers */ | |||
468 | xcb_block_len += _aux->num_window_modifiers * sizeof(uint64_t); | |||
469 | xcb_tmp += xcb_block_len; | |||
470 | xcb_align_to = ALIGNOF(uint64_t); | |||
471 | /* insert padding */ | |||
472 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
473 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
474 | if (0 != xcb_pad) { | |||
475 | xcb_tmp += xcb_pad; | |||
476 | xcb_pad = 0; | |||
477 | } | |||
478 | xcb_block_len = 0; | |||
479 | /* screen_modifiers */ | |||
480 | xcb_block_len += _aux->num_screen_modifiers * sizeof(uint64_t); | |||
481 | xcb_tmp += xcb_block_len; | |||
482 | xcb_align_to = ALIGNOF(uint64_t); | |||
483 | /* insert padding */ | |||
484 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
485 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
486 | if (0 != xcb_pad) { | |||
487 | xcb_tmp += xcb_pad; | |||
488 | xcb_pad = 0; | |||
489 | } | |||
490 | xcb_block_len = 0; | |||
491 | ||||
492 | return xcb_buffer_len; | |||
493 | } | |||
494 | ||||
495 | xcb_dri3_get_supported_modifiers_cookie_t | |||
496 | xcb_dri3_get_supported_modifiers (xcb_connection_t *c, | |||
497 | uint32_t window, | |||
498 | uint8_t depth, | |||
499 | uint8_t bpp) | |||
500 | { | |||
501 | static const xcb_protocol_request_t xcb_req = { | |||
502 | .count = 2, | |||
503 | .ext = &xcb_dri3_id, | |||
504 | .opcode = XCB_DRI3_GET_SUPPORTED_MODIFIERS, | |||
505 | .isvoid = 0 | |||
506 | }; | |||
507 | ||||
508 | struct iovec xcb_parts[4]; | |||
509 | xcb_dri3_get_supported_modifiers_cookie_t xcb_ret; | |||
510 | xcb_dri3_get_supported_modifiers_request_t xcb_out; | |||
511 | ||||
512 | xcb_out.window = window; | |||
513 | xcb_out.depth = depth; | |||
514 | xcb_out.bpp = bpp; | |||
515 | memset(xcb_out.pad0, 0, 2); | |||
516 | ||||
517 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
518 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
519 | xcb_parts[3].iov_base = 0; | |||
520 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
521 | ||||
522 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); | |||
523 | return xcb_ret; | |||
524 | } | |||
525 | ||||
526 | xcb_dri3_get_supported_modifiers_cookie_t | |||
527 | xcb_dri3_get_supported_modifiers_unchecked (xcb_connection_t *c, | |||
528 | uint32_t window, | |||
529 | uint8_t depth, | |||
530 | uint8_t bpp) | |||
531 | { | |||
532 | static const xcb_protocol_request_t xcb_req = { | |||
533 | .count = 2, | |||
534 | .ext = &xcb_dri3_id, | |||
535 | .opcode = XCB_DRI3_GET_SUPPORTED_MODIFIERS, | |||
536 | .isvoid = 0 | |||
537 | }; | |||
538 | ||||
539 | struct iovec xcb_parts[4]; | |||
540 | xcb_dri3_get_supported_modifiers_cookie_t xcb_ret; | |||
541 | xcb_dri3_get_supported_modifiers_request_t xcb_out; | |||
542 | ||||
543 | xcb_out.window = window; | |||
544 | xcb_out.depth = depth; | |||
545 | xcb_out.bpp = bpp; | |||
546 | memset(xcb_out.pad0, 0, 2); | |||
547 | ||||
548 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
549 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
550 | xcb_parts[3].iov_base = 0; | |||
551 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
552 | ||||
553 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | |||
554 | return xcb_ret; | |||
555 | } | |||
556 | ||||
557 | uint64_t * | |||
558 | xcb_dri3_get_supported_modifiers_window_modifiers (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
559 | { | |||
560 | return (uint64_t *) (R + 1); | |||
561 | } | |||
562 | ||||
563 | int | |||
564 | xcb_dri3_get_supported_modifiers_window_modifiers_length (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
565 | { | |||
566 | return R->num_window_modifiers; | |||
567 | } | |||
568 | ||||
569 | xcb_generic_iterator_t | |||
570 | xcb_dri3_get_supported_modifiers_window_modifiers_end (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
571 | { | |||
572 | xcb_generic_iterator_t i; | |||
573 | i.data = ((uint64_t *) (R + 1)) + (R->num_window_modifiers); | |||
574 | i.rem = 0; | |||
575 | i.index = (char *) i.data - (char *) R; | |||
576 | return i; | |||
577 | } | |||
578 | ||||
579 | uint64_t * | |||
580 | xcb_dri3_get_supported_modifiers_screen_modifiers (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
581 | { | |||
582 | xcb_generic_iterator_t prev = xcb_dri3_get_supported_modifiers_window_modifiers_end(R); | |||
583 | return (uint64_t *) ((char *) prev.data + XCB_TYPE_PAD(uint64_t, prev.index) + 0); | |||
584 | } | |||
585 | ||||
586 | int | |||
587 | xcb_dri3_get_supported_modifiers_screen_modifiers_length (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
588 | { | |||
589 | return R->num_screen_modifiers; | |||
590 | } | |||
591 | ||||
592 | xcb_generic_iterator_t | |||
593 | xcb_dri3_get_supported_modifiers_screen_modifiers_end (const xcb_dri3_get_supported_modifiers_reply_t *R) | |||
594 | { | |||
595 | xcb_generic_iterator_t i; | |||
596 | xcb_generic_iterator_t prev = xcb_dri3_get_supported_modifiers_window_modifiers_end(R); | |||
597 | i.data = ((uint64_t *) ((char*) prev.data + XCB_TYPE_PAD(uint64_t, prev.index))) + (R->num_screen_modifiers); | |||
598 | i.rem = 0; | |||
599 | i.index = (char *) i.data - (char *) R; | |||
600 | return i; | |||
601 | } | |||
602 | ||||
603 | xcb_dri3_get_supported_modifiers_reply_t * | |||
604 | xcb_dri3_get_supported_modifiers_reply (xcb_connection_t *c, | |||
605 | xcb_dri3_get_supported_modifiers_cookie_t cookie /**< */, | |||
606 | xcb_generic_error_t **e) | |||
607 | { | |||
608 | return (xcb_dri3_get_supported_modifiers_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |||
609 | } | |||
610 | ||||
611 | xcb_void_cookie_t | |||
612 | xcb_dri3_pixmap_from_buffers_checked (xcb_connection_t *c, | |||
613 | xcb_pixmap_t pixmap, | |||
614 | xcb_window_t window, | |||
615 | uint8_t num_buffers, | |||
616 | uint16_t width, | |||
617 | uint16_t height, | |||
618 | uint32_t stride0, | |||
619 | uint32_t offset0, | |||
620 | uint32_t stride1, | |||
621 | uint32_t offset1, | |||
622 | uint32_t stride2, | |||
623 | uint32_t offset2, | |||
624 | uint32_t stride3, | |||
625 | uint32_t offset3, | |||
626 | uint8_t depth, | |||
627 | uint8_t bpp, | |||
628 | uint64_t modifier, | |||
629 | const int32_t *buffers) | |||
630 | { | |||
631 | static const xcb_protocol_request_t xcb_req = { | |||
632 | .count = 2, | |||
633 | .ext = &xcb_dri3_id, | |||
634 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFERS, | |||
635 | .isvoid = 1 | |||
636 | }; | |||
637 | ||||
638 | struct iovec xcb_parts[4]; | |||
639 | xcb_void_cookie_t xcb_ret; | |||
640 | xcb_dri3_pixmap_from_buffers_request_t xcb_out; | |||
641 | unsigned int i; | |||
642 | int fds[num_buffers]; | |||
643 | int fd_index = 0; | |||
644 | ||||
645 | xcb_out.pixmap = pixmap; | |||
646 | xcb_out.window = window; | |||
647 | xcb_out.num_buffers = num_buffers; | |||
648 | memset(xcb_out.pad0, 0, 3); | |||
649 | xcb_out.width = width; | |||
650 | xcb_out.height = height; | |||
651 | xcb_out.stride0 = stride0; | |||
652 | xcb_out.offset0 = offset0; | |||
653 | xcb_out.stride1 = stride1; | |||
654 | xcb_out.offset1 = offset1; | |||
655 | xcb_out.stride2 = stride2; | |||
656 | xcb_out.offset2 = offset2; | |||
657 | xcb_out.stride3 = stride3; | |||
658 | xcb_out.offset3 = offset3; | |||
659 | xcb_out.depth = depth; | |||
660 | xcb_out.bpp = bpp; | |||
661 | memset(xcb_out.pad1, 0, 2); | |||
662 | xcb_out.modifier = modifier; | |||
663 | ||||
664 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
665 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
666 | xcb_parts[3].iov_base = 0; | |||
667 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
668 | ||||
669 | for (i = 0; i < num_buffers; i++) | |||
670 | fds[fd_index++] = buffers[i]; | |||
671 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, num_buffers, fds); | |||
672 | return xcb_ret; | |||
673 | } | |||
674 | ||||
675 | xcb_void_cookie_t | |||
676 | xcb_dri3_pixmap_from_buffers (xcb_connection_t *c, | |||
677 | xcb_pixmap_t pixmap, | |||
678 | xcb_window_t window, | |||
679 | uint8_t num_buffers, | |||
680 | uint16_t width, | |||
681 | uint16_t height, | |||
682 | uint32_t stride0, | |||
683 | uint32_t offset0, | |||
684 | uint32_t stride1, | |||
685 | uint32_t offset1, | |||
686 | uint32_t stride2, | |||
687 | uint32_t offset2, | |||
688 | uint32_t stride3, | |||
689 | uint32_t offset3, | |||
690 | uint8_t depth, | |||
691 | uint8_t bpp, | |||
692 | uint64_t modifier, | |||
693 | const int32_t *buffers) | |||
694 | { | |||
695 | static const xcb_protocol_request_t xcb_req = { | |||
696 | .count = 2, | |||
697 | .ext = &xcb_dri3_id, | |||
698 | .opcode = XCB_DRI3_PIXMAP_FROM_BUFFERS, | |||
699 | .isvoid = 1 | |||
700 | }; | |||
701 | ||||
702 | struct iovec xcb_parts[4]; | |||
703 | xcb_void_cookie_t xcb_ret; | |||
704 | xcb_dri3_pixmap_from_buffers_request_t xcb_out; | |||
705 | unsigned int i; | |||
706 | int fds[num_buffers]; | |||
707 | int fd_index = 0; | |||
708 | ||||
709 | xcb_out.pixmap = pixmap; | |||
710 | xcb_out.window = window; | |||
711 | xcb_out.num_buffers = num_buffers; | |||
712 | memset(xcb_out.pad0, 0, 3); | |||
713 | xcb_out.width = width; | |||
714 | xcb_out.height = height; | |||
715 | xcb_out.stride0 = stride0; | |||
716 | xcb_out.offset0 = offset0; | |||
717 | xcb_out.stride1 = stride1; | |||
718 | xcb_out.offset1 = offset1; | |||
719 | xcb_out.stride2 = stride2; | |||
720 | xcb_out.offset2 = offset2; | |||
721 | xcb_out.stride3 = stride3; | |||
722 | xcb_out.offset3 = offset3; | |||
723 | xcb_out.depth = depth; | |||
724 | xcb_out.bpp = bpp; | |||
725 | memset(xcb_out.pad1, 0, 2); | |||
726 | xcb_out.modifier = modifier; | |||
727 | ||||
728 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
729 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
730 | xcb_parts[3].iov_base = 0; | |||
731 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
732 | ||||
733 | for (i = 0; i < num_buffers; i++) | |||
734 | fds[fd_index++] = buffers[i]; | |||
735 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, num_buffers, fds); | |||
736 | return xcb_ret; | |||
737 | } | |||
738 | ||||
739 | int | |||
740 | xcb_dri3_buffers_from_pixmap_sizeof (const void *_buffer, | |||
741 | int32_t buffers) | |||
742 | { | |||
743 | char *xcb_tmp = (char *)_buffer; | |||
744 | const xcb_dri3_buffers_from_pixmap_reply_t *_aux = (xcb_dri3_buffers_from_pixmap_reply_t *)_buffer; | |||
745 | unsigned int xcb_buffer_len = 0; | |||
746 | unsigned int xcb_block_len = 0; | |||
747 | unsigned int xcb_pad = 0; | |||
748 | unsigned int xcb_align_to = 0; | |||
749 | ||||
750 | ||||
751 | xcb_block_len += sizeof(xcb_dri3_buffers_from_pixmap_reply_t); | |||
752 | xcb_tmp += xcb_block_len; | |||
753 | xcb_buffer_len += xcb_block_len; | |||
754 | xcb_block_len = 0; | |||
755 | /* strides */ | |||
756 | xcb_block_len += _aux->nfd * sizeof(uint32_t); | |||
757 | xcb_tmp += xcb_block_len; | |||
758 | xcb_align_to = ALIGNOF(uint32_t); | |||
759 | /* insert padding */ | |||
760 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
761 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
762 | if (0 != xcb_pad) { | |||
763 | xcb_tmp += xcb_pad; | |||
764 | xcb_pad = 0; | |||
765 | } | |||
766 | xcb_block_len = 0; | |||
767 | /* offsets */ | |||
768 | xcb_block_len += _aux->nfd * sizeof(uint32_t); | |||
769 | xcb_tmp += xcb_block_len; | |||
770 | xcb_align_to = ALIGNOF(uint32_t); | |||
771 | /* insert padding */ | |||
772 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
773 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
774 | if (0 != xcb_pad) { | |||
775 | xcb_tmp += xcb_pad; | |||
776 | xcb_pad = 0; | |||
777 | } | |||
778 | xcb_block_len = 0; | |||
779 | ||||
780 | return xcb_buffer_len; | |||
781 | } | |||
782 | ||||
783 | xcb_dri3_buffers_from_pixmap_cookie_t | |||
784 | xcb_dri3_buffers_from_pixmap (xcb_connection_t *c, | |||
785 | xcb_pixmap_t pixmap) | |||
786 | { | |||
787 | static const xcb_protocol_request_t xcb_req = { | |||
788 | .count = 2, | |||
789 | .ext = &xcb_dri3_id, | |||
790 | .opcode = XCB_DRI3_BUFFERS_FROM_PIXMAP, | |||
791 | .isvoid = 0 | |||
792 | }; | |||
793 | ||||
794 | struct iovec xcb_parts[4]; | |||
795 | xcb_dri3_buffers_from_pixmap_cookie_t xcb_ret; | |||
796 | xcb_dri3_buffers_from_pixmap_request_t xcb_out; | |||
797 | ||||
798 | xcb_out.pixmap = pixmap; | |||
799 | ||||
800 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
801 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
802 | xcb_parts[3].iov_base = 0; | |||
803 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
804 | ||||
805 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req); | |||
806 | return xcb_ret; | |||
807 | } | |||
808 | ||||
809 | xcb_dri3_buffers_from_pixmap_cookie_t | |||
810 | xcb_dri3_buffers_from_pixmap_unchecked (xcb_connection_t *c, | |||
811 | xcb_pixmap_t pixmap) | |||
812 | { | |||
813 | static const xcb_protocol_request_t xcb_req = { | |||
814 | .count = 2, | |||
815 | .ext = &xcb_dri3_id, | |||
816 | .opcode = XCB_DRI3_BUFFERS_FROM_PIXMAP, | |||
817 | .isvoid = 0 | |||
818 | }; | |||
819 | ||||
820 | struct iovec xcb_parts[4]; | |||
821 | xcb_dri3_buffers_from_pixmap_cookie_t xcb_ret; | |||
822 | xcb_dri3_buffers_from_pixmap_request_t xcb_out; | |||
823 | ||||
824 | xcb_out.pixmap = pixmap; | |||
825 | ||||
826 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
827 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
828 | xcb_parts[3].iov_base = 0; | |||
829 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
830 | ||||
831 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req); | |||
832 | return xcb_ret; | |||
833 | } | |||
834 | ||||
835 | uint32_t * | |||
836 | xcb_dri3_buffers_from_pixmap_strides (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
837 | { | |||
838 | return (uint32_t *) (R + 1); | |||
839 | } | |||
840 | ||||
841 | int | |||
842 | xcb_dri3_buffers_from_pixmap_strides_length (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
843 | { | |||
844 | return R->nfd; | |||
845 | } | |||
846 | ||||
847 | xcb_generic_iterator_t | |||
848 | xcb_dri3_buffers_from_pixmap_strides_end (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
849 | { | |||
850 | xcb_generic_iterator_t i; | |||
851 | i.data = ((uint32_t *) (R + 1)) + (R->nfd); | |||
852 | i.rem = 0; | |||
853 | i.index = (char *) i.data - (char *) R; | |||
854 | return i; | |||
855 | } | |||
856 | ||||
857 | uint32_t * | |||
858 | xcb_dri3_buffers_from_pixmap_offsets (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
859 | { | |||
860 | xcb_generic_iterator_t prev = xcb_dri3_buffers_from_pixmap_strides_end(R); | |||
861 | return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); | |||
862 | } | |||
863 | ||||
864 | int | |||
865 | xcb_dri3_buffers_from_pixmap_offsets_length (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
866 | { | |||
867 | return R->nfd; | |||
868 | } | |||
869 | ||||
870 | xcb_generic_iterator_t | |||
871 | xcb_dri3_buffers_from_pixmap_offsets_end (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
872 | { | |||
873 | xcb_generic_iterator_t i; | |||
874 | xcb_generic_iterator_t prev = xcb_dri3_buffers_from_pixmap_strides_end(R); | |||
875 | i.data = ((uint32_t *) ((char*) prev.data + XCB_TYPE_PAD(uint32_t, prev.index))) + (R->nfd); | |||
876 | i.rem = 0; | |||
877 | i.index = (char *) i.data - (char *) R; | |||
878 | return i; | |||
879 | } | |||
880 | ||||
881 | int32_t * | |||
882 | xcb_dri3_buffers_from_pixmap_buffers (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
883 | { | |||
884 | xcb_generic_iterator_t prev = xcb_dri3_buffers_from_pixmap_offsets_end(R); | |||
885 | return (int32_t *) ((char *) prev.data + XCB_TYPE_PAD(int32_t, prev.index) + 0); | |||
886 | } | |||
887 | ||||
888 | int | |||
889 | xcb_dri3_buffers_from_pixmap_buffers_length (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
890 | { | |||
891 | return R->nfd; | |||
892 | } | |||
893 | ||||
894 | xcb_generic_iterator_t | |||
895 | xcb_dri3_buffers_from_pixmap_buffers_end (const xcb_dri3_buffers_from_pixmap_reply_t *R) | |||
896 | { | |||
897 | xcb_generic_iterator_t i; | |||
898 | xcb_generic_iterator_t prev = xcb_dri3_buffers_from_pixmap_offsets_end(R); | |||
899 | i.data = ((int32_t *) ((char*) prev.data + XCB_TYPE_PAD(int32_t, prev.index))) + (R->nfd); | |||
900 | i.rem = 0; | |||
901 | i.index = (char *) i.data - (char *) R; | |||
902 | return i; | |||
903 | } | |||
904 | ||||
905 | xcb_dri3_buffers_from_pixmap_reply_t * | |||
906 | xcb_dri3_buffers_from_pixmap_reply (xcb_connection_t *c, | |||
907 | xcb_dri3_buffers_from_pixmap_cookie_t cookie /**< */, | |||
908 | xcb_generic_error_t **e) | |||
909 | { | |||
910 | return (xcb_dri3_buffers_from_pixmap_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |||
911 | } | |||
912 | ||||
913 | int * | |||
914 | xcb_dri3_buffers_from_pixmap_reply_fds (xcb_connection_t *c /**< */, | |||
915 | xcb_dri3_buffers_from_pixmap_reply_t *reply) | |||
916 | { | |||
917 | return xcb_get_reply_fds(c, reply, sizeof(xcb_dri3_buffers_from_pixmap_reply_t) + 4 * reply->length); | |||
918 | } | |||
919 |
--- src/external/mit/xorg/lib/libxcb/files/dri3.h 2017/03/05 09:27:53 1.3
+++ src/external/mit/xorg/lib/libxcb/files/dri3.h 2018/03/14 06:47:28 1.4
@@ -10,27 +10,27 @@ | @@ -10,27 +10,27 @@ | |||
10 | **/ | 10 | **/ | |
11 | 11 | |||
12 | #ifndef __DRI3_H | 12 | #ifndef __DRI3_H | |
13 | #define __DRI3_H | 13 | #define __DRI3_H | |
14 | 14 | |||
15 | #include "xcb.h" | 15 | #include "xcb.h" | |
16 | #include "xproto.h" | 16 | #include "xproto.h" | |
17 | 17 | |||
18 | #ifdef __cplusplus | 18 | #ifdef __cplusplus | |
19 | extern "C" { | 19 | extern "C" { | |
20 | #endif | 20 | #endif | |
21 | 21 | |||
22 | #define XCB_DRI3_MAJOR_VERSION 1 | 22 | #define XCB_DRI3_MAJOR_VERSION 1 | |
23 | #define XCB_DRI3_MINOR_VERSION 0 | 23 | #define XCB_DRI3_MINOR_VERSION 2 | |
24 | 24 | |||
25 | extern xcb_extension_t xcb_dri3_id; | 25 | extern xcb_extension_t xcb_dri3_id; | |
26 | 26 | |||
27 | /** | 27 | /** | |
28 | * @brief xcb_dri3_query_version_cookie_t | 28 | * @brief xcb_dri3_query_version_cookie_t | |
29 | **/ | 29 | **/ | |
30 | typedef struct xcb_dri3_query_version_cookie_t { | 30 | typedef struct xcb_dri3_query_version_cookie_t { | |
31 | unsigned int sequence; | 31 | unsigned int sequence; | |
32 | } xcb_dri3_query_version_cookie_t; | 32 | } xcb_dri3_query_version_cookie_t; | |
33 | 33 | |||
34 | /** Opcode for xcb_dri3_query_version. */ | 34 | /** Opcode for xcb_dri3_query_version. */ | |
35 | #define XCB_DRI3_QUERY_VERSION 0 | 35 | #define XCB_DRI3_QUERY_VERSION 0 | |
36 | 36 | |||
@@ -185,26 +185,129 @@ typedef struct xcb_dri3_fd_from_fence_re | @@ -185,26 +185,129 @@ typedef struct xcb_dri3_fd_from_fence_re | |||
185 | 185 | |||
186 | /** | 186 | /** | |
187 | * @brief xcb_dri3_fd_from_fence_reply_t | 187 | * @brief xcb_dri3_fd_from_fence_reply_t | |
188 | **/ | 188 | **/ | |
189 | typedef struct xcb_dri3_fd_from_fence_reply_t { | 189 | typedef struct xcb_dri3_fd_from_fence_reply_t { | |
190 | uint8_t response_type; | 190 | uint8_t response_type; | |
191 | uint8_t nfd; | 191 | uint8_t nfd; | |
192 | uint16_t sequence; | 192 | uint16_t sequence; | |
193 | uint32_t length; | 193 | uint32_t length; | |
194 | uint8_t pad0[24]; | 194 | uint8_t pad0[24]; | |
195 | } xcb_dri3_fd_from_fence_reply_t; | 195 | } xcb_dri3_fd_from_fence_reply_t; | |
196 | 196 | |||
197 | /** | 197 | /** | |
198 | * @brief xcb_dri3_get_supported_modifiers_cookie_t | |||
199 | **/ | |||
200 | typedef struct xcb_dri3_get_supported_modifiers_cookie_t { | |||
201 | unsigned int sequence; | |||
202 | } xcb_dri3_get_supported_modifiers_cookie_t; | |||
203 | ||||
204 | /** Opcode for xcb_dri3_get_supported_modifiers. */ | |||
205 | #define XCB_DRI3_GET_SUPPORTED_MODIFIERS 6 | |||
206 | ||||
207 | /** | |||
208 | * @brief xcb_dri3_get_supported_modifiers_request_t | |||
209 | **/ | |||
210 | typedef struct xcb_dri3_get_supported_modifiers_request_t { | |||
211 | uint8_t major_opcode; | |||
212 | uint8_t minor_opcode; | |||
213 | uint16_t length; | |||
214 | uint32_t window; | |||
215 | uint8_t depth; | |||
216 | uint8_t bpp; | |||
217 | uint8_t pad0[2]; | |||
218 | } xcb_dri3_get_supported_modifiers_request_t; | |||
219 | ||||
220 | /** | |||
221 | * @brief xcb_dri3_get_supported_modifiers_reply_t | |||
222 | **/ | |||
223 | typedef struct xcb_dri3_get_supported_modifiers_reply_t { | |||
224 | uint8_t response_type; | |||
225 | uint8_t pad0; | |||
226 | uint16_t sequence; | |||
227 | uint32_t length; | |||
228 | uint32_t num_window_modifiers; | |||
229 | uint32_t num_screen_modifiers; | |||
230 | uint8_t pad1[16]; | |||
231 | } xcb_dri3_get_supported_modifiers_reply_t; | |||
232 | ||||
233 | /** Opcode for xcb_dri3_pixmap_from_buffers. */ | |||
234 | #define XCB_DRI3_PIXMAP_FROM_BUFFERS 7 | |||
235 | ||||
236 | /** | |||
237 | * @brief xcb_dri3_pixmap_from_buffers_request_t | |||
238 | **/ | |||
239 | typedef struct xcb_dri3_pixmap_from_buffers_request_t { | |||
240 | uint8_t major_opcode; | |||
241 | uint8_t minor_opcode; | |||
242 | uint16_t length; | |||
243 | xcb_pixmap_t pixmap; | |||
244 | xcb_window_t window; | |||
245 | uint8_t num_buffers; | |||
246 | uint8_t pad0[3]; | |||
247 | uint16_t width; | |||
248 | uint16_t height; | |||
249 | uint32_t stride0; | |||
250 | uint32_t offset0; | |||
251 | uint32_t stride1; | |||
252 | uint32_t offset1; | |||
253 | uint32_t stride2; | |||
254 | uint32_t offset2; | |||
255 | uint32_t stride3; | |||
256 | uint32_t offset3; | |||
257 | uint8_t depth; | |||
258 | uint8_t bpp; | |||
259 | uint8_t pad1[2]; | |||
260 | uint64_t modifier; | |||
261 | } xcb_dri3_pixmap_from_buffers_request_t; | |||
262 | ||||
263 | /** | |||
264 | * @brief xcb_dri3_buffers_from_pixmap_cookie_t | |||
265 | **/ | |||
266 | typedef struct xcb_dri3_buffers_from_pixmap_cookie_t { | |||
267 | unsigned int sequence; | |||
268 | } xcb_dri3_buffers_from_pixmap_cookie_t; | |||
269 | ||||
270 | /** Opcode for xcb_dri3_buffers_from_pixmap. */ | |||
271 | #define XCB_DRI3_BUFFERS_FROM_PIXMAP 8 | |||
272 | ||||
273 | /** | |||
274 | * @brief xcb_dri3_buffers_from_pixmap_request_t | |||
275 | **/ | |||
276 | typedef struct xcb_dri3_buffers_from_pixmap_request_t { | |||
277 | uint8_t major_opcode; | |||
278 | uint8_t minor_opcode; | |||
279 | uint16_t length; | |||
280 | xcb_pixmap_t pixmap; | |||
281 | } xcb_dri3_buffers_from_pixmap_request_t; | |||
282 | ||||
283 | /** | |||
284 | * @brief xcb_dri3_buffers_from_pixmap_reply_t | |||
285 | **/ | |||
286 | typedef struct xcb_dri3_buffers_from_pixmap_reply_t { | |||
287 | uint8_t response_type; | |||
288 | uint8_t nfd; | |||
289 | uint16_t sequence; | |||
290 | uint32_t length; | |||
291 | uint16_t width; | |||
292 | uint16_t height; | |||
293 | uint8_t pad0[4]; | |||
294 | uint64_t modifier; | |||
295 | uint8_t depth; | |||
296 | uint8_t bpp; | |||
297 | uint8_t pad1[6]; | |||
298 | } xcb_dri3_buffers_from_pixmap_reply_t; | |||
299 | ||||
300 | /** | |||
198 | * | 301 | * | |
199 | * @param c The connection | 302 | * @param c The connection | |
200 | * @return A cookie | 303 | * @return A cookie | |
201 | * | 304 | * | |
202 | * Delivers a request to the X server. | 305 | * Delivers a request to the X server. | |
203 | * | 306 | * | |
204 | */ | 307 | */ | |
205 | xcb_dri3_query_version_cookie_t | 308 | xcb_dri3_query_version_cookie_t | |
206 | xcb_dri3_query_version (xcb_connection_t *c, | 309 | xcb_dri3_query_version (xcb_connection_t *c, | |
207 | uint32_t major_version, | 310 | uint32_t major_version, | |
208 | uint32_t minor_version); | 311 | uint32_t minor_version); | |
209 | 312 | |||
210 | /** | 313 | /** | |
@@ -489,23 +592,243 @@ xcb_dri3_fd_from_fence_reply (xcb_connec | @@ -489,23 +592,243 @@ xcb_dri3_fd_from_fence_reply (xcb_connec | |||
489 | /** | 592 | /** | |
490 | * Return the reply fds | 593 | * Return the reply fds | |
491 | * @param c The connection | 594 | * @param c The connection | |
492 | * @param reply The reply | 595 | * @param reply The reply | |
493 | * | 596 | * | |
494 | * Returns the array of reply fds of the request asked by | 597 | * Returns the array of reply fds of the request asked by | |
495 | * | 598 | * | |
496 | * The returned value must be freed by the caller using free(). | 599 | * The returned value must be freed by the caller using free(). | |
497 | */ | 600 | */ | |
498 | int * | 601 | int * | |
499 | xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */, | 602 | xcb_dri3_fd_from_fence_reply_fds (xcb_connection_t *c /**< */, | |
500 | xcb_dri3_fd_from_fence_reply_t *reply); | 603 | xcb_dri3_fd_from_fence_reply_t *reply); | |
501 | 604 | |||
605 | int | |||
606 | xcb_dri3_get_supported_modifiers_sizeof (const void *_buffer); | |||
607 | ||||
608 | /** | |||
609 | * | |||
610 | * @param c The connection | |||
611 | * @return A cookie | |||
612 | * | |||
613 | * Delivers a request to the X server. | |||
614 | * | |||
615 | */ | |||
616 | xcb_dri3_get_supported_modifiers_cookie_t | |||
617 | xcb_dri3_get_supported_modifiers (xcb_connection_t *c, | |||
618 | uint32_t window, | |||
619 | uint8_t depth, | |||
620 | uint8_t bpp); | |||
621 | ||||
622 | /** | |||
623 | * | |||
624 | * @param c The connection | |||
625 | * @return A cookie | |||
626 | * | |||
627 | * Delivers a request to the X server. | |||
628 | * | |||
629 | * This form can be used only if the request will cause | |||
630 | * a reply to be generated. Any returned error will be | |||
631 | * placed in the event queue. | |||
632 | */ | |||
633 | xcb_dri3_get_supported_modifiers_cookie_t | |||
634 | xcb_dri3_get_supported_modifiers_unchecked (xcb_connection_t *c, | |||
635 | uint32_t window, | |||
636 | uint8_t depth, | |||
637 | uint8_t bpp); | |||
638 | ||||
639 | uint64_t * | |||
640 | xcb_dri3_get_supported_modifiers_window_modifiers (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
641 | ||||
642 | int | |||
643 | xcb_dri3_get_supported_modifiers_window_modifiers_length (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
644 | ||||
645 | xcb_generic_iterator_t | |||
646 | xcb_dri3_get_supported_modifiers_window_modifiers_end (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
647 | ||||
648 | uint64_t * | |||
649 | xcb_dri3_get_supported_modifiers_screen_modifiers (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
650 | ||||
651 | int | |||
652 | xcb_dri3_get_supported_modifiers_screen_modifiers_length (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
653 | ||||
654 | xcb_generic_iterator_t | |||
655 | xcb_dri3_get_supported_modifiers_screen_modifiers_end (const xcb_dri3_get_supported_modifiers_reply_t *R); | |||
656 | ||||
657 | /** | |||
658 | * Return the reply | |||
659 | * @param c The connection | |||
660 | * @param cookie The cookie | |||
661 | * @param e The xcb_generic_error_t supplied | |||
662 | * | |||
663 | * Returns the reply of the request asked by | |||
664 | * | |||
665 | * The parameter @p e supplied to this function must be NULL if | |||
666 | * xcb_dri3_get_supported_modifiers_unchecked(). is used. | |||
667 | * Otherwise, it stores the error if any. | |||
668 | * | |||
669 | * The returned value must be freed by the caller using free(). | |||
670 | */ | |||
671 | xcb_dri3_get_supported_modifiers_reply_t * | |||
672 | xcb_dri3_get_supported_modifiers_reply (xcb_connection_t *c, | |||
673 | xcb_dri3_get_supported_modifiers_cookie_t cookie /**< */, | |||
674 | xcb_generic_error_t **e); | |||
675 | ||||
676 | /** | |||
677 | * | |||
678 | * @param c The connection | |||
679 | * @return A cookie | |||
680 | * | |||
681 | * Delivers a request to the X server. | |||
682 | * | |||
683 | * This form can be used only if the request will not cause | |||
684 | * a reply to be generated. Any returned error will be | |||
685 | * saved for handling by xcb_request_check(). | |||
686 | */ | |||
687 | xcb_void_cookie_t | |||
688 | xcb_dri3_pixmap_from_buffers_checked (xcb_connection_t *c, | |||
689 | xcb_pixmap_t pixmap, | |||
690 | xcb_window_t window, | |||
691 | uint8_t num_buffers, | |||
692 | uint16_t width, | |||
693 | uint16_t height, | |||
694 | uint32_t stride0, | |||
695 | uint32_t offset0, | |||
696 | uint32_t stride1, | |||
697 | uint32_t offset1, | |||
698 | uint32_t stride2, | |||
699 | uint32_t offset2, | |||
700 | uint32_t stride3, | |||
701 | uint32_t offset3, | |||
702 | uint8_t depth, | |||
703 | uint8_t bpp, | |||
704 | uint64_t modifier, | |||
705 | const int32_t *buffers); | |||
706 | ||||
707 | /** | |||
708 | * | |||
709 | * @param c The connection | |||
710 | * @return A cookie | |||
711 | * | |||
712 | * Delivers a request to the X server. | |||
713 | * | |||
714 | */ | |||
715 | xcb_void_cookie_t | |||
716 | xcb_dri3_pixmap_from_buffers (xcb_connection_t *c, | |||
717 | xcb_pixmap_t pixmap, | |||
718 | xcb_window_t window, | |||
719 | uint8_t num_buffers, | |||
720 | uint16_t width, | |||
721 | uint16_t height, | |||
722 | uint32_t stride0, | |||
723 | uint32_t offset0, | |||
724 | uint32_t stride1, | |||
725 | uint32_t offset1, | |||
726 | uint32_t stride2, | |||
727 | uint32_t offset2, | |||
728 | uint32_t stride3, | |||
729 | uint32_t offset3, | |||
730 | uint8_t depth, | |||
731 | uint8_t bpp, | |||
732 | uint64_t modifier, | |||
733 | const int32_t *buffers); | |||
734 | ||||
735 | int | |||
736 | xcb_dri3_buffers_from_pixmap_sizeof (const void *_buffer, | |||
737 | int32_t buffers); | |||
738 | ||||
739 | /** | |||
740 | * | |||
741 | * @param c The connection | |||
742 | * @return A cookie | |||
743 | * | |||
744 | * Delivers a request to the X server. | |||
745 | * | |||
746 | */ | |||
747 | xcb_dri3_buffers_from_pixmap_cookie_t | |||
748 | xcb_dri3_buffers_from_pixmap (xcb_connection_t *c, | |||
749 | xcb_pixmap_t pixmap); | |||
750 | ||||
751 | /** | |||
752 | * | |||
753 | * @param c The connection | |||
754 | * @return A cookie | |||
755 | * | |||
756 | * Delivers a request to the X server. | |||
757 | * | |||
758 | * This form can be used only if the request will cause | |||
759 | * a reply to be generated. Any returned error will be | |||
760 | * placed in the event queue. | |||
761 | */ | |||
762 | xcb_dri3_buffers_from_pixmap_cookie_t | |||
763 | xcb_dri3_buffers_from_pixmap_unchecked (xcb_connection_t *c, | |||
764 | xcb_pixmap_t pixmap); | |||
765 | ||||
766 | uint32_t * | |||
767 | xcb_dri3_buffers_from_pixmap_strides (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
768 | ||||
769 | int | |||
770 | xcb_dri3_buffers_from_pixmap_strides_length (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
771 | ||||
772 | xcb_generic_iterator_t | |||
773 | xcb_dri3_buffers_from_pixmap_strides_end (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
774 | ||||
775 | uint32_t * | |||
776 | xcb_dri3_buffers_from_pixmap_offsets (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
777 | ||||
778 | int | |||
779 | xcb_dri3_buffers_from_pixmap_offsets_length (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
780 | ||||
781 | xcb_generic_iterator_t | |||
782 | xcb_dri3_buffers_from_pixmap_offsets_end (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
783 | ||||
784 | int32_t * | |||
785 | xcb_dri3_buffers_from_pixmap_buffers (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
786 | ||||
787 | int | |||
788 | xcb_dri3_buffers_from_pixmap_buffers_length (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
789 | ||||
790 | xcb_generic_iterator_t | |||
791 | xcb_dri3_buffers_from_pixmap_buffers_end (const xcb_dri3_buffers_from_pixmap_reply_t *R); | |||
792 | ||||
793 | /** | |||
794 | * Return the reply | |||
795 | * @param c The connection | |||
796 | * @param cookie The cookie | |||
797 | * @param e The xcb_generic_error_t supplied | |||
798 | * | |||
799 | * Returns the reply of the request asked by | |||
800 | * | |||
801 | * The parameter @p e supplied to this function must be NULL if | |||
802 | * xcb_dri3_buffers_from_pixmap_unchecked(). is used. | |||
803 | * Otherwise, it stores the error if any. | |||
804 | * | |||
805 | * The returned value must be freed by the caller using free(). | |||
806 | */ | |||
807 | xcb_dri3_buffers_from_pixmap_reply_t * | |||
808 | xcb_dri3_buffers_from_pixmap_reply (xcb_connection_t *c, | |||
809 | xcb_dri3_buffers_from_pixmap_cookie_t cookie /**< */, | |||
810 | xcb_generic_error_t **e); | |||
811 | ||||
812 | /** | |||
813 | * Return the reply fds | |||
814 | * @param c The connection | |||
815 | * @param reply The reply | |||
816 | * | |||
817 | * Returns the array of reply fds of the request asked by | |||
818 | * | |||
819 | * The returned value must be freed by the caller using free(). | |||
820 | */ | |||
821 | int * | |||
822 | xcb_dri3_buffers_from_pixmap_reply_fds (xcb_connection_t *c /**< */, | |||
823 | xcb_dri3_buffers_from_pixmap_reply_t *reply); | |||
824 | ||||
502 | 825 | |||
503 | #ifdef __cplusplus | 826 | #ifdef __cplusplus | |
504 | } | 827 | } | |
505 | #endif | 828 | #endif | |
506 | 829 | |||
507 | #endif | 830 | #endif | |
508 | 831 | |||
509 | /** | 832 | /** | |
510 | * @} | 833 | * @} | |
511 | */ | 834 | */ |
--- src/external/mit/xorg/lib/libxcb/files/present.h 2017/03/05 09:27:53 1.3
+++ src/external/mit/xorg/lib/libxcb/files/present.h 2018/03/14 06:47:28 1.4
@@ -13,68 +13,70 @@ | @@ -13,68 +13,70 @@ | |||
13 | #define __PRESENT_H | 13 | #define __PRESENT_H | |
14 | 14 | |||
15 | #include "xcb.h" | 15 | #include "xcb.h" | |
16 | #include "xproto.h" | 16 | #include "xproto.h" | |
17 | #include "randr.h" | 17 | #include "randr.h" | |
18 | #include "xfixes.h" | 18 | #include "xfixes.h" | |
19 | #include "sync.h" | 19 | #include "sync.h" | |
20 | 20 | |||
21 | #ifdef __cplusplus | 21 | #ifdef __cplusplus | |
22 | extern "C" { | 22 | extern "C" { | |
23 | #endif | 23 | #endif | |
24 | 24 | |||
25 | #define XCB_PRESENT_MAJOR_VERSION 1 | 25 | #define XCB_PRESENT_MAJOR_VERSION 1 | |
26 | #define XCB_PRESENT_MINOR_VERSION 0 | 26 | #define XCB_PRESENT_MINOR_VERSION 2 | |
27 | 27 | |||
28 | extern xcb_extension_t xcb_present_id; | 28 | extern xcb_extension_t xcb_present_id; | |
29 | 29 | |||
30 | typedef enum xcb_present_event_enum_t { | 30 | typedef enum xcb_present_event_enum_t { | |
31 | XCB_PRESENT_EVENT_CONFIGURE_NOTIFY = 0, | 31 | XCB_PRESENT_EVENT_CONFIGURE_NOTIFY = 0, | |
32 | XCB_PRESENT_EVENT_COMPLETE_NOTIFY = 1, | 32 | XCB_PRESENT_EVENT_COMPLETE_NOTIFY = 1, | |
33 | XCB_PRESENT_EVENT_IDLE_NOTIFY = 2, | 33 | XCB_PRESENT_EVENT_IDLE_NOTIFY = 2, | |
34 | XCB_PRESENT_EVENT_REDIRECT_NOTIFY = 3 | 34 | XCB_PRESENT_EVENT_REDIRECT_NOTIFY = 3 | |
35 | } xcb_present_event_enum_t; | 35 | } xcb_present_event_enum_t; | |
36 | 36 | |||
37 | typedef enum xcb_present_event_mask_t { | 37 | typedef enum xcb_present_event_mask_t { | |
38 | XCB_PRESENT_EVENT_MASK_NO_EVENT = 0, | 38 | XCB_PRESENT_EVENT_MASK_NO_EVENT = 0, | |
39 | XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY = 1, | 39 | XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY = 1, | |
40 | XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY = 2, | 40 | XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY = 2, | |
41 | XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY = 4, | 41 | XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY = 4, | |
42 | XCB_PRESENT_EVENT_MASK_REDIRECT_NOTIFY = 8 | 42 | XCB_PRESENT_EVENT_MASK_REDIRECT_NOTIFY = 8 | |
43 | } xcb_present_event_mask_t; | 43 | } xcb_present_event_mask_t; | |
44 | 44 | |||
45 | typedef enum xcb_present_option_t { | 45 | typedef enum xcb_present_option_t { | |
46 | XCB_PRESENT_OPTION_NONE = 0, | 46 | XCB_PRESENT_OPTION_NONE = 0, | |
47 | XCB_PRESENT_OPTION_ASYNC = 1, | 47 | XCB_PRESENT_OPTION_ASYNC = 1, | |
48 | XCB_PRESENT_OPTION_COPY = 2, | 48 | XCB_PRESENT_OPTION_COPY = 2, | |
49 | XCB_PRESENT_OPTION_UST = 4 | 49 | XCB_PRESENT_OPTION_UST = 4, | |
50 | XCB_PRESENT_OPTION_SUBOPTIMAL = 8 | |||
50 | } xcb_present_option_t; | 51 | } xcb_present_option_t; | |
51 | 52 | |||
52 | typedef enum xcb_present_capability_t { | 53 | typedef enum xcb_present_capability_t { | |
53 | XCB_PRESENT_CAPABILITY_NONE = 0, | 54 | XCB_PRESENT_CAPABILITY_NONE = 0, | |
54 | XCB_PRESENT_CAPABILITY_ASYNC = 1, | 55 | XCB_PRESENT_CAPABILITY_ASYNC = 1, | |
55 | XCB_PRESENT_CAPABILITY_FENCE = 2, | 56 | XCB_PRESENT_CAPABILITY_FENCE = 2, | |
56 | XCB_PRESENT_CAPABILITY_UST = 4 | 57 | XCB_PRESENT_CAPABILITY_UST = 4 | |
57 | } xcb_present_capability_t; | 58 | } xcb_present_capability_t; | |
58 | 59 | |||
59 | typedef enum xcb_present_complete_kind_t { | 60 | typedef enum xcb_present_complete_kind_t { | |
60 | XCB_PRESENT_COMPLETE_KIND_PIXMAP = 0, | 61 | XCB_PRESENT_COMPLETE_KIND_PIXMAP = 0, | |
61 | XCB_PRESENT_COMPLETE_KIND_NOTIFY_MSC = 1 | 62 | XCB_PRESENT_COMPLETE_KIND_NOTIFY_MSC = 1 | |
62 | } xcb_present_complete_kind_t; | 63 | } xcb_present_complete_kind_t; | |
63 | 64 | |||
64 | typedef enum xcb_present_complete_mode_t { | 65 | typedef enum xcb_present_complete_mode_t { | |
65 | XCB_PRESENT_COMPLETE_MODE_COPY = 0, | 66 | XCB_PRESENT_COMPLETE_MODE_COPY = 0, | |
66 | XCB_PRESENT_COMPLETE_MODE_FLIP = 1, | 67 | XCB_PRESENT_COMPLETE_MODE_FLIP = 1, | |
67 | XCB_PRESENT_COMPLETE_MODE_SKIP = 2 | 68 | XCB_PRESENT_COMPLETE_MODE_SKIP = 2, | |
69 | XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY = 3 | |||
68 | } xcb_present_complete_mode_t; | 70 | } xcb_present_complete_mode_t; | |
69 | 71 | |||
70 | /** | 72 | /** | |
71 | * @brief xcb_present_notify_t | 73 | * @brief xcb_present_notify_t | |
72 | **/ | 74 | **/ | |
73 | typedef struct xcb_present_notify_t { | 75 | typedef struct xcb_present_notify_t { | |
74 | xcb_window_t window; | 76 | xcb_window_t window; | |
75 | uint32_t serial; | 77 | uint32_t serial; | |
76 | } xcb_present_notify_t; | 78 | } xcb_present_notify_t; | |
77 | 79 | |||
78 | /** | 80 | /** | |
79 | * @brief xcb_present_notify_iterator_t | 81 | * @brief xcb_present_notify_iterator_t | |
80 | **/ | 82 | **/ |
--- src/external/mit/xorg/lib/libxcb/files/randr.c 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/randr.c 2018/03/14 06:47:28 1.6
@@ -82,26 +82,44 @@ xcb_randr_provider_next (xcb_randr_provi | @@ -82,26 +82,44 @@ xcb_randr_provider_next (xcb_randr_provi | |||
82 | } | 82 | } | |
83 | 83 | |||
84 | xcb_generic_iterator_t | 84 | xcb_generic_iterator_t | |
85 | xcb_randr_provider_end (xcb_randr_provider_iterator_t i) | 85 | xcb_randr_provider_end (xcb_randr_provider_iterator_t i) | |
86 | { | 86 | { | |
87 | xcb_generic_iterator_t ret; | 87 | xcb_generic_iterator_t ret; | |
88 | ret.data = i.data + i.rem; | 88 | ret.data = i.data + i.rem; | |
89 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | 89 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |
90 | ret.rem = 0; | 90 | ret.rem = 0; | |
91 | return ret; | 91 | return ret; | |
92 | } | 92 | } | |
93 | 93 | |||
94 | void | 94 | void | |
95 | xcb_randr_lease_next (xcb_randr_lease_iterator_t *i) | |||
96 | { | |||
97 | --i->rem; | |||
98 | ++i->data; | |||
99 | i->index += sizeof(xcb_randr_lease_t); | |||
100 | } | |||
101 | ||||
102 | xcb_generic_iterator_t | |||
103 | xcb_randr_lease_end (xcb_randr_lease_iterator_t i) | |||
104 | { | |||
105 | xcb_generic_iterator_t ret; | |||
106 | ret.data = i.data + i.rem; | |||
107 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
108 | ret.rem = 0; | |||
109 | return ret; | |||
110 | } | |||
111 | ||||
112 | void | |||
95 | xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i) | 113 | xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i) | |
96 | { | 114 | { | |
97 | --i->rem; | 115 | --i->rem; | |
98 | ++i->data; | 116 | ++i->data; | |
99 | i->index += sizeof(xcb_randr_screen_size_t); | 117 | i->index += sizeof(xcb_randr_screen_size_t); | |
100 | } | 118 | } | |
101 | 119 | |||
102 | xcb_generic_iterator_t | 120 | xcb_generic_iterator_t | |
103 | xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i) | 121 | xcb_randr_screen_size_end (xcb_randr_screen_size_iterator_t i) | |
104 | { | 122 | { | |
105 | xcb_generic_iterator_t ret; | 123 | xcb_generic_iterator_t ret; | |
106 | ret.data = i.data + i.rem; | 124 | ret.data = i.data + i.rem; | |
107 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | 125 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |
@@ -5070,44 +5088,26 @@ xcb_randr_resource_change_next (xcb_rand | @@ -5070,44 +5088,26 @@ xcb_randr_resource_change_next (xcb_rand | |||
5070 | i->index += sizeof(xcb_randr_resource_change_t); | 5088 | i->index += sizeof(xcb_randr_resource_change_t); | |
5071 | } | 5089 | } | |
5072 | 5090 | |||
5073 | xcb_generic_iterator_t | 5091 | xcb_generic_iterator_t | |
5074 | xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i) | 5092 | xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i) | |
5075 | { | 5093 | { | |
5076 | xcb_generic_iterator_t ret; | 5094 | xcb_generic_iterator_t ret; | |
5077 | ret.data = i.data + i.rem; | 5095 | ret.data = i.data + i.rem; | |
5078 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | 5096 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |
5079 | ret.rem = 0; | 5097 | ret.rem = 0; | |
5080 | return ret; | 5098 | return ret; | |
5081 | } | 5099 | } | |
5082 | 5100 | |||
5083 | void | |||
5084 | xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i) | |||
5085 | { | |||
5086 | --i->rem; | |||
5087 | ++i->data; | |||
5088 | i->index += sizeof(xcb_randr_notify_data_t); | |||
5089 | } | |||
5090 | ||||
5091 | xcb_generic_iterator_t | |||
5092 | xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i) | |||
5093 | { | |||
5094 | xcb_generic_iterator_t ret; | |||
5095 | ret.data = i.data + i.rem; | |||
5096 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
5097 | ret.rem = 0; | |||
5098 | return ret; | |||
5099 | } | |||
5100 | ||||
5101 | int | 5101 | int | |
5102 | xcb_randr_monitor_info_sizeof (const void *_buffer) | 5102 | xcb_randr_monitor_info_sizeof (const void *_buffer) | |
5103 | { | 5103 | { | |
5104 | char *xcb_tmp = (char *)_buffer; | 5104 | char *xcb_tmp = (char *)_buffer; | |
5105 | const xcb_randr_monitor_info_t *_aux = (xcb_randr_monitor_info_t *)_buffer; | 5105 | const xcb_randr_monitor_info_t *_aux = (xcb_randr_monitor_info_t *)_buffer; | |
5106 | unsigned int xcb_buffer_len = 0; | 5106 | unsigned int xcb_buffer_len = 0; | |
5107 | unsigned int xcb_block_len = 0; | 5107 | unsigned int xcb_block_len = 0; | |
5108 | unsigned int xcb_pad = 0; | 5108 | unsigned int xcb_pad = 0; | |
5109 | unsigned int xcb_align_to = 0; | 5109 | unsigned int xcb_align_to = 0; | |
5110 | 5110 | |||
5111 | 5111 | |||
5112 | xcb_block_len += sizeof(xcb_randr_monitor_info_t); | 5112 | xcb_block_len += sizeof(xcb_randr_monitor_info_t); | |
5113 | xcb_tmp += xcb_block_len; | 5113 | xcb_tmp += xcb_block_len; | |
@@ -5434,13 +5434,251 @@ xcb_randr_delete_monitor (xcb_connection | @@ -5434,13 +5434,251 @@ xcb_randr_delete_monitor (xcb_connection | |||
5434 | 5434 | |||
5435 | xcb_out.window = window; | 5435 | xcb_out.window = window; | |
5436 | xcb_out.name = name; | 5436 | xcb_out.name = name; | |
5437 | 5437 | |||
5438 | xcb_parts[2].iov_base = (char *) &xcb_out; | 5438 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
5439 | xcb_parts[2].iov_len = sizeof(xcb_out); | 5439 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
5440 | xcb_parts[3].iov_base = 0; | 5440 | xcb_parts[3].iov_base = 0; | |
5441 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 5441 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
5442 | 5442 | |||
5443 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | 5443 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | |
5444 | return xcb_ret; | 5444 | return xcb_ret; | |
5445 | } | 5445 | } | |
5446 | 5446 | |||
5447 | int | |||
5448 | xcb_randr_create_lease_sizeof (const void *_buffer) | |||
5449 | { | |||
5450 | char *xcb_tmp = (char *)_buffer; | |||
5451 | const xcb_randr_create_lease_request_t *_aux = (xcb_randr_create_lease_request_t *)_buffer; | |||
5452 | unsigned int xcb_buffer_len = 0; | |||
5453 | unsigned int xcb_block_len = 0; | |||
5454 | unsigned int xcb_pad = 0; | |||
5455 | unsigned int xcb_align_to = 0; | |||
5456 | ||||
5457 | ||||
5458 | xcb_block_len += sizeof(xcb_randr_create_lease_request_t); | |||
5459 | xcb_tmp += xcb_block_len; | |||
5460 | xcb_buffer_len += xcb_block_len; | |||
5461 | xcb_block_len = 0; | |||
5462 | /* crtcs */ | |||
5463 | xcb_block_len += _aux->num_crtcs * sizeof(xcb_randr_output_t); | |||
5464 | xcb_tmp += xcb_block_len; | |||
5465 | xcb_align_to = ALIGNOF(xcb_randr_crtc_t); | |||
5466 | /* insert padding */ | |||
5467 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
5468 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
5469 | if (0 != xcb_pad) { | |||
5470 | xcb_tmp += xcb_pad; | |||
5471 | xcb_pad = 0; | |||
5472 | } | |||
5473 | xcb_block_len = 0; | |||
5474 | /* outputs */ | |||
5475 | xcb_block_len += _aux->num_outputs * sizeof(xcb_randr_output_t); | |||
5476 | xcb_tmp += xcb_block_len; | |||
5477 | xcb_align_to = ALIGNOF(xcb_randr_output_t); | |||
5478 | /* insert padding */ | |||
5479 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
5480 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
5481 | if (0 != xcb_pad) { | |||
5482 | xcb_tmp += xcb_pad; | |||
5483 | xcb_pad = 0; | |||
5484 | } | |||
5485 | xcb_block_len = 0; | |||
5486 | ||||
5487 | return xcb_buffer_len; | |||
5488 | } | |||
5489 | ||||
5490 | xcb_randr_create_lease_cookie_t | |||
5491 | xcb_randr_create_lease (xcb_connection_t *c, | |||
5492 | xcb_window_t window, | |||
5493 | xcb_randr_lease_t lid, | |||
5494 | uint16_t num_crtcs, | |||
5495 | uint16_t num_outputs, | |||
5496 | const xcb_randr_crtc_t *crtcs, | |||
5497 | const xcb_randr_output_t *outputs) | |||
5498 | { | |||
5499 | static const xcb_protocol_request_t xcb_req = { | |||
5500 | .count = 6, | |||
5501 | .ext = &xcb_randr_id, | |||
5502 | .opcode = XCB_RANDR_CREATE_LEASE, | |||
5503 | .isvoid = 0 | |||
5504 | }; | |||
5505 | ||||
5506 | struct iovec xcb_parts[8]; | |||
5507 | xcb_randr_create_lease_cookie_t xcb_ret; | |||
5508 | xcb_randr_create_lease_request_t xcb_out; | |||
5509 | ||||
5510 | xcb_out.window = window; | |||
5511 | xcb_out.lid = lid; | |||
5512 | xcb_out.num_crtcs = num_crtcs; | |||
5513 | xcb_out.num_outputs = num_outputs; | |||
5514 | ||||
5515 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5516 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5517 | xcb_parts[3].iov_base = 0; | |||
5518 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5519 | /* xcb_randr_crtc_t crtcs */ | |||
5520 | xcb_parts[4].iov_base = (char *) crtcs; | |||
5521 | xcb_parts[4].iov_len = num_crtcs * sizeof(uint32_t); | |||
5522 | xcb_parts[5].iov_base = 0; | |||
5523 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
5524 | /* xcb_randr_output_t outputs */ | |||
5525 | xcb_parts[6].iov_base = (char *) outputs; | |||
5526 | xcb_parts[6].iov_len = num_outputs * sizeof(uint32_t); | |||
5527 | xcb_parts[7].iov_base = 0; | |||
5528 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
5529 | ||||
5530 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED|XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req); | |||
5531 | return xcb_ret; | |||
5532 | } | |||
5533 | ||||
5534 | xcb_randr_create_lease_cookie_t | |||
5535 | xcb_randr_create_lease_unchecked (xcb_connection_t *c, | |||
5536 | xcb_window_t window, | |||
5537 | xcb_randr_lease_t lid, | |||
5538 | uint16_t num_crtcs, | |||
5539 | uint16_t num_outputs, | |||
5540 | const xcb_randr_crtc_t *crtcs, | |||
5541 | const xcb_randr_output_t *outputs) | |||
5542 | { | |||
5543 | static const xcb_protocol_request_t xcb_req = { | |||
5544 | .count = 6, | |||
5545 | .ext = &xcb_randr_id, | |||
5546 | .opcode = XCB_RANDR_CREATE_LEASE, | |||
5547 | .isvoid = 0 | |||
5548 | }; | |||
5549 | ||||
5550 | struct iovec xcb_parts[8]; | |||
5551 | xcb_randr_create_lease_cookie_t xcb_ret; | |||
5552 | xcb_randr_create_lease_request_t xcb_out; | |||
5553 | ||||
5554 | xcb_out.window = window; | |||
5555 | xcb_out.lid = lid; | |||
5556 | xcb_out.num_crtcs = num_crtcs; | |||
5557 | xcb_out.num_outputs = num_outputs; | |||
5558 | ||||
5559 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5560 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5561 | xcb_parts[3].iov_base = 0; | |||
5562 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5563 | /* xcb_randr_crtc_t crtcs */ | |||
5564 | xcb_parts[4].iov_base = (char *) crtcs; | |||
5565 | xcb_parts[4].iov_len = num_crtcs * sizeof(uint32_t); | |||
5566 | xcb_parts[5].iov_base = 0; | |||
5567 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
5568 | /* xcb_randr_output_t outputs */ | |||
5569 | xcb_parts[6].iov_base = (char *) outputs; | |||
5570 | xcb_parts[6].iov_len = num_outputs * sizeof(uint32_t); | |||
5571 | xcb_parts[7].iov_base = 0; | |||
5572 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
5573 | ||||
5574 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_REPLY_FDS, xcb_parts + 2, &xcb_req); | |||
5575 | return xcb_ret; | |||
5576 | } | |||
5577 | ||||
5578 | xcb_randr_create_lease_reply_t * | |||
5579 | xcb_randr_create_lease_reply (xcb_connection_t *c, | |||
5580 | xcb_randr_create_lease_cookie_t cookie /**< */, | |||
5581 | xcb_generic_error_t **e) | |||
5582 | { | |||
5583 | return (xcb_randr_create_lease_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |||
5584 | } | |||
5585 | ||||
5586 | int * | |||
5587 | xcb_randr_create_lease_reply_fds (xcb_connection_t *c /**< */, | |||
5588 | xcb_randr_create_lease_reply_t *reply) | |||
5589 | { | |||
5590 | return xcb_get_reply_fds(c, reply, sizeof(xcb_randr_create_lease_reply_t) + 4 * reply->length); | |||
5591 | } | |||
5592 | ||||
5593 | xcb_void_cookie_t | |||
5594 | xcb_randr_free_lease_checked (xcb_connection_t *c, | |||
5595 | xcb_randr_lease_t lid, | |||
5596 | uint8_t terminate) | |||
5597 | { | |||
5598 | static const xcb_protocol_request_t xcb_req = { | |||
5599 | .count = 2, | |||
5600 | .ext = &xcb_randr_id, | |||
5601 | .opcode = XCB_RANDR_FREE_LEASE, | |||
5602 | .isvoid = 1 | |||
5603 | }; | |||
5604 | ||||
5605 | struct iovec xcb_parts[4]; | |||
5606 | xcb_void_cookie_t xcb_ret; | |||
5607 | xcb_randr_free_lease_request_t xcb_out; | |||
5608 | ||||
5609 | xcb_out.lid = lid; | |||
5610 | xcb_out.terminate = terminate; | |||
5611 | ||||
5612 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5613 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5614 | xcb_parts[3].iov_base = 0; | |||
5615 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5616 | ||||
5617 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); | |||
5618 | return xcb_ret; | |||
5619 | } | |||
5620 | ||||
5621 | xcb_void_cookie_t | |||
5622 | xcb_randr_free_lease (xcb_connection_t *c, | |||
5623 | xcb_randr_lease_t lid, | |||
5624 | uint8_t terminate) | |||
5625 | { | |||
5626 | static const xcb_protocol_request_t xcb_req = { | |||
5627 | .count = 2, | |||
5628 | .ext = &xcb_randr_id, | |||
5629 | .opcode = XCB_RANDR_FREE_LEASE, | |||
5630 | .isvoid = 1 | |||
5631 | }; | |||
5632 | ||||
5633 | struct iovec xcb_parts[4]; | |||
5634 | xcb_void_cookie_t xcb_ret; | |||
5635 | xcb_randr_free_lease_request_t xcb_out; | |||
5636 | ||||
5637 | xcb_out.lid = lid; | |||
5638 | xcb_out.terminate = terminate; | |||
5639 | ||||
5640 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5641 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5642 | xcb_parts[3].iov_base = 0; | |||
5643 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5644 | ||||
5645 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | |||
5646 | return xcb_ret; | |||
5647 | } | |||
5648 | ||||
5649 | void | |||
5650 | xcb_randr_lease_notify_next (xcb_randr_lease_notify_iterator_t *i) | |||
5651 | { | |||
5652 | --i->rem; | |||
5653 | ++i->data; | |||
5654 | i->index += sizeof(xcb_randr_lease_notify_t); | |||
5655 | } | |||
5656 | ||||
5657 | xcb_generic_iterator_t | |||
5658 | xcb_randr_lease_notify_end (xcb_randr_lease_notify_iterator_t i) | |||
5659 | { | |||
5660 | xcb_generic_iterator_t ret; | |||
5661 | ret.data = i.data + i.rem; | |||
5662 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
5663 | ret.rem = 0; | |||
5664 | return ret; | |||
5665 | } | |||
5666 | ||||
5667 | void | |||
5668 | xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i) | |||
5669 | { | |||
5670 | --i->rem; | |||
5671 | ++i->data; | |||
5672 | i->index += sizeof(xcb_randr_notify_data_t); | |||
5673 | } | |||
5674 | ||||
5675 | xcb_generic_iterator_t | |||
5676 | xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i) | |||
5677 | { | |||
5678 | xcb_generic_iterator_t ret; | |||
5679 | ret.data = i.data + i.rem; | |||
5680 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
5681 | ret.rem = 0; | |||
5682 | return ret; | |||
5683 | } | |||
5684 |
--- src/external/mit/xorg/lib/libxcb/files/randr.h 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/randr.h 2018/03/14 06:47:28 1.6
@@ -11,27 +11,27 @@ | @@ -11,27 +11,27 @@ | |||
11 | 11 | |||
12 | #ifndef __RANDR_H | 12 | #ifndef __RANDR_H | |
13 | #define __RANDR_H | 13 | #define __RANDR_H | |
14 | 14 | |||
15 | #include "xcb.h" | 15 | #include "xcb.h" | |
16 | #include "xproto.h" | 16 | #include "xproto.h" | |
17 | #include "render.h" | 17 | #include "render.h" | |
18 | 18 | |||
19 | #ifdef __cplusplus | 19 | #ifdef __cplusplus | |
20 | extern "C" { | 20 | extern "C" { | |
21 | #endif | 21 | #endif | |
22 | 22 | |||
23 | #define XCB_RANDR_MAJOR_VERSION 1 | 23 | #define XCB_RANDR_MAJOR_VERSION 1 | |
24 | #define XCB_RANDR_MINOR_VERSION 5 | 24 | #define XCB_RANDR_MINOR_VERSION 6 | |
25 | 25 | |||
26 | extern xcb_extension_t xcb_randr_id; | 26 | extern xcb_extension_t xcb_randr_id; | |
27 | 27 | |||
28 | typedef uint32_t xcb_randr_mode_t; | 28 | typedef uint32_t xcb_randr_mode_t; | |
29 | 29 | |||
30 | /** | 30 | /** | |
31 | * @brief xcb_randr_mode_iterator_t | 31 | * @brief xcb_randr_mode_iterator_t | |
32 | **/ | 32 | **/ | |
33 | typedef struct xcb_randr_mode_iterator_t { | 33 | typedef struct xcb_randr_mode_iterator_t { | |
34 | xcb_randr_mode_t *data; | 34 | xcb_randr_mode_t *data; | |
35 | int rem; | 35 | int rem; | |
36 | int index; | 36 | int index; | |
37 | } xcb_randr_mode_iterator_t; | 37 | } xcb_randr_mode_iterator_t; | |
@@ -59,26 +59,37 @@ typedef struct xcb_randr_output_iterator | @@ -59,26 +59,37 @@ typedef struct xcb_randr_output_iterator | |||
59 | } xcb_randr_output_iterator_t; | 59 | } xcb_randr_output_iterator_t; | |
60 | 60 | |||
61 | typedef uint32_t xcb_randr_provider_t; | 61 | typedef uint32_t xcb_randr_provider_t; | |
62 | 62 | |||
63 | /** | 63 | /** | |
64 | * @brief xcb_randr_provider_iterator_t | 64 | * @brief xcb_randr_provider_iterator_t | |
65 | **/ | 65 | **/ | |
66 | typedef struct xcb_randr_provider_iterator_t { | 66 | typedef struct xcb_randr_provider_iterator_t { | |
67 | xcb_randr_provider_t *data; | 67 | xcb_randr_provider_t *data; | |
68 | int rem; | 68 | int rem; | |
69 | int index; | 69 | int index; | |
70 | } xcb_randr_provider_iterator_t; | 70 | } xcb_randr_provider_iterator_t; | |
71 | 71 | |||
72 | typedef uint32_t xcb_randr_lease_t; | |||
73 | ||||
74 | /** | |||
75 | * @brief xcb_randr_lease_iterator_t | |||
76 | **/ | |||
77 | typedef struct xcb_randr_lease_iterator_t { | |||
78 | xcb_randr_lease_t *data; | |||
79 | int rem; | |||
80 | int index; | |||
81 | } xcb_randr_lease_iterator_t; | |||
82 | ||||
72 | /** Opcode for xcb_randr_bad_output. */ | 83 | /** Opcode for xcb_randr_bad_output. */ | |
73 | #define XCB_RANDR_BAD_OUTPUT 0 | 84 | #define XCB_RANDR_BAD_OUTPUT 0 | |
74 | 85 | |||
75 | /** | 86 | /** | |
76 | * @brief xcb_randr_bad_output_error_t | 87 | * @brief xcb_randr_bad_output_error_t | |
77 | **/ | 88 | **/ | |
78 | typedef struct xcb_randr_bad_output_error_t { | 89 | typedef struct xcb_randr_bad_output_error_t { | |
79 | uint8_t response_type; | 90 | uint8_t response_type; | |
80 | uint8_t error_code; | 91 | uint8_t error_code; | |
81 | uint16_t sequence; | 92 | uint16_t sequence; | |
82 | } xcb_randr_bad_output_error_t; | 93 | } xcb_randr_bad_output_error_t; | |
83 | 94 | |||
84 | /** Opcode for xcb_randr_bad_crtc. */ | 95 | /** Opcode for xcb_randr_bad_crtc. */ | |
@@ -240,27 +251,28 @@ typedef struct xcb_randr_set_screen_conf | @@ -240,27 +251,28 @@ typedef struct xcb_randr_set_screen_conf | |||
240 | xcb_timestamp_t config_timestamp; | 251 | xcb_timestamp_t config_timestamp; | |
241 | xcb_window_t root; | 252 | xcb_window_t root; | |
242 | uint16_t subpixel_order; | 253 | uint16_t subpixel_order; | |
243 | uint8_t pad0[10]; | 254 | uint8_t pad0[10]; | |
244 | } xcb_randr_set_screen_config_reply_t; | 255 | } xcb_randr_set_screen_config_reply_t; | |
245 | 256 | |||
246 | typedef enum xcb_randr_notify_mask_t { | 257 | typedef enum xcb_randr_notify_mask_t { | |
247 | XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE = 1, | 258 | XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE = 1, | |
248 | XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE = 2, | 259 | XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE = 2, | |
249 | XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE = 4, | 260 | XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE = 4, | |
250 | XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY = 8, | 261 | XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY = 8, | |
251 | XCB_RANDR_NOTIFY_MASK_PROVIDER_CHANGE = 16, | 262 | XCB_RANDR_NOTIFY_MASK_PROVIDER_CHANGE = 16, | |
252 | XCB_RANDR_NOTIFY_MASK_PROVIDER_PROPERTY = 32, | 263 | XCB_RANDR_NOTIFY_MASK_PROVIDER_PROPERTY = 32, | |
253 | XCB_RANDR_NOTIFY_MASK_RESOURCE_CHANGE = 64 | 264 | XCB_RANDR_NOTIFY_MASK_RESOURCE_CHANGE = 64, | |
265 | XCB_RANDR_NOTIFY_MASK_LEASE = 128 | |||
254 | } xcb_randr_notify_mask_t; | 266 | } xcb_randr_notify_mask_t; | |
255 | 267 | |||
256 | /** Opcode for xcb_randr_select_input. */ | 268 | /** Opcode for xcb_randr_select_input. */ | |
257 | #define XCB_RANDR_SELECT_INPUT 4 | 269 | #define XCB_RANDR_SELECT_INPUT 4 | |
258 | 270 | |||
259 | /** | 271 | /** | |
260 | * @brief xcb_randr_select_input_request_t | 272 | * @brief xcb_randr_select_input_request_t | |
261 | **/ | 273 | **/ | |
262 | typedef struct xcb_randr_select_input_request_t { | 274 | typedef struct xcb_randr_select_input_request_t { | |
263 | uint8_t major_opcode; | 275 | uint8_t major_opcode; | |
264 | uint8_t minor_opcode; | 276 | uint8_t minor_opcode; | |
265 | uint16_t length; | 277 | uint16_t length; | |
266 | xcb_window_t window; | 278 | xcb_window_t window; | |
@@ -1395,27 +1407,28 @@ typedef struct xcb_randr_screen_change_n | @@ -1395,27 +1407,28 @@ typedef struct xcb_randr_screen_change_n | |||
1395 | uint16_t subpixel_order; | 1407 | uint16_t subpixel_order; | |
1396 | uint16_t width; | 1408 | uint16_t width; | |
1397 | uint16_t height; | 1409 | uint16_t height; | |
1398 | uint16_t mwidth; | 1410 | uint16_t mwidth; | |
1399 | uint16_t mheight; | 1411 | uint16_t mheight; | |
1400 | } xcb_randr_screen_change_notify_event_t; | 1412 | } xcb_randr_screen_change_notify_event_t; | |
1401 | 1413 | |||
1402 | typedef enum xcb_randr_notify_t { | 1414 | typedef enum xcb_randr_notify_t { | |
1403 | XCB_RANDR_NOTIFY_CRTC_CHANGE = 0, | 1415 | XCB_RANDR_NOTIFY_CRTC_CHANGE = 0, | |
1404 | XCB_RANDR_NOTIFY_OUTPUT_CHANGE = 1, | 1416 | XCB_RANDR_NOTIFY_OUTPUT_CHANGE = 1, | |
1405 | XCB_RANDR_NOTIFY_OUTPUT_PROPERTY = 2, | 1417 | XCB_RANDR_NOTIFY_OUTPUT_PROPERTY = 2, | |
1406 | XCB_RANDR_NOTIFY_PROVIDER_CHANGE = 3, | 1418 | XCB_RANDR_NOTIFY_PROVIDER_CHANGE = 3, | |
1407 | XCB_RANDR_NOTIFY_PROVIDER_PROPERTY = 4, | 1419 | XCB_RANDR_NOTIFY_PROVIDER_PROPERTY = 4, | |
1408 | XCB_RANDR_NOTIFY_RESOURCE_CHANGE = 5 | 1420 | XCB_RANDR_NOTIFY_RESOURCE_CHANGE = 5, | |
1421 | XCB_RANDR_NOTIFY_LEASE = 6 | |||
1409 | } xcb_randr_notify_t; | 1422 | } xcb_randr_notify_t; | |
1410 | 1423 | |||
1411 | /** | 1424 | /** | |
1412 | * @brief xcb_randr_crtc_change_t | 1425 | * @brief xcb_randr_crtc_change_t | |
1413 | **/ | 1426 | **/ | |
1414 | typedef struct xcb_randr_crtc_change_t { | 1427 | typedef struct xcb_randr_crtc_change_t { | |
1415 | xcb_timestamp_t timestamp; | 1428 | xcb_timestamp_t timestamp; | |
1416 | xcb_window_t window; | 1429 | xcb_window_t window; | |
1417 | xcb_randr_crtc_t crtc; | 1430 | xcb_randr_crtc_t crtc; | |
1418 | xcb_randr_mode_t mode; | 1431 | xcb_randr_mode_t mode; | |
1419 | uint16_t rotation; | 1432 | uint16_t rotation; | |
1420 | uint8_t pad0[2]; | 1433 | uint8_t pad0[2]; | |
1421 | int16_t x; | 1434 | int16_t x; | |
@@ -1527,60 +1540,26 @@ typedef struct xcb_randr_resource_change | @@ -1527,60 +1540,26 @@ typedef struct xcb_randr_resource_change | |||
1527 | uint8_t pad0[20]; | 1540 | uint8_t pad0[20]; | |
1528 | } xcb_randr_resource_change_t; | 1541 | } xcb_randr_resource_change_t; | |
1529 | 1542 | |||
1530 | /** | 1543 | /** | |
1531 | * @brief xcb_randr_resource_change_iterator_t | 1544 | * @brief xcb_randr_resource_change_iterator_t | |
1532 | **/ | 1545 | **/ | |
1533 | typedef struct xcb_randr_resource_change_iterator_t { | 1546 | typedef struct xcb_randr_resource_change_iterator_t { | |
1534 | xcb_randr_resource_change_t *data; | 1547 | xcb_randr_resource_change_t *data; | |
1535 | int rem; | 1548 | int rem; | |
1536 | int index; | 1549 | int index; | |
1537 | } xcb_randr_resource_change_iterator_t; | 1550 | } xcb_randr_resource_change_iterator_t; | |
1538 | 1551 | |||
1539 | /** | 1552 | /** | |
1540 | * @brief xcb_randr_notify_data_t | |||
1541 | **/ | |||
1542 | typedef union xcb_randr_notify_data_t { | |||
1543 | xcb_randr_crtc_change_t cc; | |||
1544 | xcb_randr_output_change_t oc; | |||
1545 | xcb_randr_output_property_t op; | |||
1546 | xcb_randr_provider_change_t pc; | |||
1547 | xcb_randr_provider_property_t pp; | |||
1548 | xcb_randr_resource_change_t rc; | |||
1549 | } xcb_randr_notify_data_t; | |||
1550 | ||||
1551 | /** | |||
1552 | * @brief xcb_randr_notify_data_iterator_t | |||
1553 | **/ | |||
1554 | typedef struct xcb_randr_notify_data_iterator_t { | |||
1555 | xcb_randr_notify_data_t *data; | |||
1556 | int rem; | |||
1557 | int index; | |||
1558 | } xcb_randr_notify_data_iterator_t; | |||
1559 | ||||
1560 | /** Opcode for xcb_randr_notify. */ | |||
1561 | #define XCB_RANDR_NOTIFY 1 | |||
1562 | ||||
1563 | /** | |||
1564 | * @brief xcb_randr_notify_event_t | |||
1565 | **/ | |||
1566 | typedef struct xcb_randr_notify_event_t { | |||
1567 | uint8_t response_type; | |||
1568 | uint8_t subCode; | |||
1569 | uint16_t sequence; | |||
1570 | xcb_randr_notify_data_t u; | |||
1571 | } xcb_randr_notify_event_t; | |||
1572 | ||||
1573 | /** | |||
1574 | * @brief xcb_randr_monitor_info_t | 1553 | * @brief xcb_randr_monitor_info_t | |
1575 | **/ | 1554 | **/ | |
1576 | typedef struct xcb_randr_monitor_info_t { | 1555 | typedef struct xcb_randr_monitor_info_t { | |
1577 | xcb_atom_t name; | 1556 | xcb_atom_t name; | |
1578 | uint8_t primary; | 1557 | uint8_t primary; | |
1579 | uint8_t automatic; | 1558 | uint8_t automatic; | |
1580 | uint16_t nOutput; | 1559 | uint16_t nOutput; | |
1581 | int16_t x; | 1560 | int16_t x; | |
1582 | int16_t y; | 1561 | int16_t y; | |
1583 | uint16_t width; | 1562 | uint16_t width; | |
1584 | uint16_t height; | 1563 | uint16_t height; | |
1585 | uint32_t width_in_millimeters; | 1564 | uint32_t width_in_millimeters; | |
1586 | uint32_t height_in_millimeters; | 1565 | uint32_t height_in_millimeters; | |
@@ -1648,26 +1627,129 @@ typedef struct xcb_randr_set_monitor_req | @@ -1648,26 +1627,129 @@ typedef struct xcb_randr_set_monitor_req | |||
1648 | 1627 | |||
1649 | /** | 1628 | /** | |
1650 | * @brief xcb_randr_delete_monitor_request_t | 1629 | * @brief xcb_randr_delete_monitor_request_t | |
1651 | **/ | 1630 | **/ | |
1652 | typedef struct xcb_randr_delete_monitor_request_t { | 1631 | typedef struct xcb_randr_delete_monitor_request_t { | |
1653 | uint8_t major_opcode; | 1632 | uint8_t major_opcode; | |
1654 | uint8_t minor_opcode; | 1633 | uint8_t minor_opcode; | |
1655 | uint16_t length; | 1634 | uint16_t length; | |
1656 | xcb_window_t window; | 1635 | xcb_window_t window; | |
1657 | xcb_atom_t name; | 1636 | xcb_atom_t name; | |
1658 | } xcb_randr_delete_monitor_request_t; | 1637 | } xcb_randr_delete_monitor_request_t; | |
1659 | 1638 | |||
1660 | /** | 1639 | /** | |
1640 | * @brief xcb_randr_create_lease_cookie_t | |||
1641 | **/ | |||
1642 | typedef struct xcb_randr_create_lease_cookie_t { | |||
1643 | unsigned int sequence; | |||
1644 | } xcb_randr_create_lease_cookie_t; | |||
1645 | ||||
1646 | /** Opcode for xcb_randr_create_lease. */ | |||
1647 | #define XCB_RANDR_CREATE_LEASE 45 | |||
1648 | ||||
1649 | /** | |||
1650 | * @brief xcb_randr_create_lease_request_t | |||
1651 | **/ | |||
1652 | typedef struct xcb_randr_create_lease_request_t { | |||
1653 | uint8_t major_opcode; | |||
1654 | uint8_t minor_opcode; | |||
1655 | uint16_t length; | |||
1656 | xcb_window_t window; | |||
1657 | xcb_randr_lease_t lid; | |||
1658 | uint16_t num_crtcs; | |||
1659 | uint16_t num_outputs; | |||
1660 | } xcb_randr_create_lease_request_t; | |||
1661 | ||||
1662 | /** | |||
1663 | * @brief xcb_randr_create_lease_reply_t | |||
1664 | **/ | |||
1665 | typedef struct xcb_randr_create_lease_reply_t { | |||
1666 | uint8_t response_type; | |||
1667 | uint8_t nfd; | |||
1668 | uint16_t sequence; | |||
1669 | uint32_t length; | |||
1670 | uint8_t pad0[24]; | |||
1671 | } xcb_randr_create_lease_reply_t; | |||
1672 | ||||
1673 | /** Opcode for xcb_randr_free_lease. */ | |||
1674 | #define XCB_RANDR_FREE_LEASE 46 | |||
1675 | ||||
1676 | /** | |||
1677 | * @brief xcb_randr_free_lease_request_t | |||
1678 | **/ | |||
1679 | typedef struct xcb_randr_free_lease_request_t { | |||
1680 | uint8_t major_opcode; | |||
1681 | uint8_t minor_opcode; | |||
1682 | uint16_t length; | |||
1683 | xcb_randr_lease_t lid; | |||
1684 | uint8_t terminate; | |||
1685 | } xcb_randr_free_lease_request_t; | |||
1686 | ||||
1687 | /** | |||
1688 | * @brief xcb_randr_lease_notify_t | |||
1689 | **/ | |||
1690 | typedef struct xcb_randr_lease_notify_t { | |||
1691 | xcb_timestamp_t timestamp; | |||
1692 | xcb_window_t window; | |||
1693 | xcb_randr_lease_t lease; | |||
1694 | uint8_t created; | |||
1695 | uint8_t pad0[15]; | |||
1696 | } xcb_randr_lease_notify_t; | |||
1697 | ||||
1698 | /** | |||
1699 | * @brief xcb_randr_lease_notify_iterator_t | |||
1700 | **/ | |||
1701 | typedef struct xcb_randr_lease_notify_iterator_t { | |||
1702 | xcb_randr_lease_notify_t *data; | |||
1703 | int rem; | |||
1704 | int index; | |||
1705 | } xcb_randr_lease_notify_iterator_t; | |||
1706 | ||||
1707 | /** | |||
1708 | * @brief xcb_randr_notify_data_t | |||
1709 | **/ | |||
1710 | typedef union xcb_randr_notify_data_t { | |||
1711 | xcb_randr_crtc_change_t cc; | |||
1712 | xcb_randr_output_change_t oc; | |||
1713 | xcb_randr_output_property_t op; | |||
1714 | xcb_randr_provider_change_t pc; | |||
1715 | xcb_randr_provider_property_t pp; | |||
1716 | xcb_randr_resource_change_t rc; | |||
1717 | xcb_randr_lease_notify_t lc; | |||
1718 | } xcb_randr_notify_data_t; | |||
1719 | ||||
1720 | /** | |||
1721 | * @brief xcb_randr_notify_data_iterator_t | |||
1722 | **/ | |||
1723 | typedef struct xcb_randr_notify_data_iterator_t { | |||
1724 | xcb_randr_notify_data_t *data; | |||
1725 | int rem; | |||
1726 | int index; | |||
1727 | } xcb_randr_notify_data_iterator_t; | |||
1728 | ||||
1729 | /** Opcode for xcb_randr_notify. */ | |||
1730 | #define XCB_RANDR_NOTIFY 1 | |||
1731 | ||||
1732 | /** | |||
1733 | * @brief xcb_randr_notify_event_t | |||
1734 | **/ | |||
1735 | typedef struct xcb_randr_notify_event_t { | |||
1736 | uint8_t response_type; | |||
1737 | uint8_t subCode; | |||
1738 | uint16_t sequence; | |||
1739 | xcb_randr_notify_data_t u; | |||
1740 | } xcb_randr_notify_event_t; | |||
1741 | ||||
1742 | /** | |||
1661 | * Get the next element of the iterator | 1743 | * Get the next element of the iterator | |
1662 | * @param i Pointer to a xcb_randr_mode_iterator_t | 1744 | * @param i Pointer to a xcb_randr_mode_iterator_t | |
1663 | * | 1745 | * | |
1664 | * Get the next element in the iterator. The member rem is | 1746 | * Get the next element in the iterator. The member rem is | |
1665 | * decreased by one. The member data points to the next | 1747 | * decreased by one. The member data points to the next | |
1666 | * element. The member index is increased by sizeof(xcb_randr_mode_t) | 1748 | * element. The member index is increased by sizeof(xcb_randr_mode_t) | |
1667 | */ | 1749 | */ | |
1668 | void | 1750 | void | |
1669 | xcb_randr_mode_next (xcb_randr_mode_iterator_t *i); | 1751 | xcb_randr_mode_next (xcb_randr_mode_iterator_t *i); | |
1670 | 1752 | |||
1671 | /** | 1753 | /** | |
1672 | * Return the iterator pointing to the last element | 1754 | * Return the iterator pointing to the last element | |
1673 | * @param i An xcb_randr_mode_iterator_t | 1755 | * @param i An xcb_randr_mode_iterator_t | |
@@ -1741,26 +1823,49 @@ xcb_randr_provider_next (xcb_randr_provi | @@ -1741,26 +1823,49 @@ xcb_randr_provider_next (xcb_randr_provi | |||
1741 | * Return the iterator pointing to the last element | 1823 | * Return the iterator pointing to the last element | |
1742 | * @param i An xcb_randr_provider_iterator_t | 1824 | * @param i An xcb_randr_provider_iterator_t | |
1743 | * @return The iterator pointing to the last element | 1825 | * @return The iterator pointing to the last element | |
1744 | * | 1826 | * | |
1745 | * Set the current element in the iterator to the last element. | 1827 | * Set the current element in the iterator to the last element. | |
1746 | * The member rem is set to 0. The member data points to the | 1828 | * The member rem is set to 0. The member data points to the | |
1747 | * last element. | 1829 | * last element. | |
1748 | */ | 1830 | */ | |
1749 | xcb_generic_iterator_t | 1831 | xcb_generic_iterator_t | |
1750 | xcb_randr_provider_end (xcb_randr_provider_iterator_t i); | 1832 | xcb_randr_provider_end (xcb_randr_provider_iterator_t i); | |
1751 | 1833 | |||
1752 | /** | 1834 | /** | |
1753 | * Get the next element of the iterator | 1835 | * Get the next element of the iterator | |
1836 | * @param i Pointer to a xcb_randr_lease_iterator_t | |||
1837 | * | |||
1838 | * Get the next element in the iterator. The member rem is | |||
1839 | * decreased by one. The member data points to the next | |||
1840 | * element. The member index is increased by sizeof(xcb_randr_lease_t) | |||
1841 | */ | |||
1842 | void | |||
1843 | xcb_randr_lease_next (xcb_randr_lease_iterator_t *i); | |||
1844 | ||||
1845 | /** | |||
1846 | * Return the iterator pointing to the last element | |||
1847 | * @param i An xcb_randr_lease_iterator_t | |||
1848 | * @return The iterator pointing to the last element | |||
1849 | * | |||
1850 | * Set the current element in the iterator to the last element. | |||
1851 | * The member rem is set to 0. The member data points to the | |||
1852 | * last element. | |||
1853 | */ | |||
1854 | xcb_generic_iterator_t | |||
1855 | xcb_randr_lease_end (xcb_randr_lease_iterator_t i); | |||
1856 | ||||
1857 | /** | |||
1858 | * Get the next element of the iterator | |||
1754 | * @param i Pointer to a xcb_randr_screen_size_iterator_t | 1859 | * @param i Pointer to a xcb_randr_screen_size_iterator_t | |
1755 | * | 1860 | * | |
1756 | * Get the next element in the iterator. The member rem is | 1861 | * Get the next element in the iterator. The member rem is | |
1757 | * decreased by one. The member data points to the next | 1862 | * decreased by one. The member data points to the next | |
1758 | * element. The member index is increased by sizeof(xcb_randr_screen_size_t) | 1863 | * element. The member index is increased by sizeof(xcb_randr_screen_size_t) | |
1759 | */ | 1864 | */ | |
1760 | void | 1865 | void | |
1761 | xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i); | 1866 | xcb_randr_screen_size_next (xcb_randr_screen_size_iterator_t *i); | |
1762 | 1867 | |||
1763 | /** | 1868 | /** | |
1764 | * Return the iterator pointing to the last element | 1869 | * Return the iterator pointing to the last element | |
1765 | * @param i An xcb_randr_screen_size_iterator_t | 1870 | * @param i An xcb_randr_screen_size_iterator_t | |
1766 | * @return The iterator pointing to the last element | 1871 | * @return The iterator pointing to the last element | |
@@ -4145,49 +4250,26 @@ xcb_randr_resource_change_next (xcb_rand | @@ -4145,49 +4250,26 @@ xcb_randr_resource_change_next (xcb_rand | |||
4145 | 4250 | |||
4146 | /** | 4251 | /** | |
4147 | * Return the iterator pointing to the last element | 4252 | * Return the iterator pointing to the last element | |
4148 | * @param i An xcb_randr_resource_change_iterator_t | 4253 | * @param i An xcb_randr_resource_change_iterator_t | |
4149 | * @return The iterator pointing to the last element | 4254 | * @return The iterator pointing to the last element | |
4150 | * | 4255 | * | |
4151 | * Set the current element in the iterator to the last element. | 4256 | * Set the current element in the iterator to the last element. | |
4152 | * The member rem is set to 0. The member data points to the | 4257 | * The member rem is set to 0. The member data points to the | |
4153 | * last element. | 4258 | * last element. | |
4154 | */ | 4259 | */ | |
4155 | xcb_generic_iterator_t | 4260 | xcb_generic_iterator_t | |
4156 | xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i); | 4261 | xcb_randr_resource_change_end (xcb_randr_resource_change_iterator_t i); | |
4157 | 4262 | |||
4158 | /** | |||
4159 | * Get the next element of the iterator | |||
4160 | * @param i Pointer to a xcb_randr_notify_data_iterator_t | |||
4161 | * | |||
4162 | * Get the next element in the iterator. The member rem is | |||
4163 | * decreased by one. The member data points to the next | |||
4164 | * element. The member index is increased by sizeof(xcb_randr_notify_data_t) | |||
4165 | */ | |||
4166 | void | |||
4167 | xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i); | |||
4168 | ||||
4169 | /** | |||
4170 | * Return the iterator pointing to the last element | |||
4171 | * @param i An xcb_randr_notify_data_iterator_t | |||
4172 | * @return The iterator pointing to the last element | |||
4173 | * | |||
4174 | * Set the current element in the iterator to the last element. | |||
4175 | * The member rem is set to 0. The member data points to the | |||
4176 | * last element. | |||
4177 | */ | |||
4178 | xcb_generic_iterator_t | |||
4179 | xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i); | |||
4180 | ||||
4181 | int | 4263 | int | |
4182 | xcb_randr_monitor_info_sizeof (const void *_buffer); | 4264 | xcb_randr_monitor_info_sizeof (const void *_buffer); | |
4183 | 4265 | |||
4184 | xcb_randr_output_t * | 4266 | xcb_randr_output_t * | |
4185 | xcb_randr_monitor_info_outputs (const xcb_randr_monitor_info_t *R); | 4267 | xcb_randr_monitor_info_outputs (const xcb_randr_monitor_info_t *R); | |
4186 | 4268 | |||
4187 | int | 4269 | int | |
4188 | xcb_randr_monitor_info_outputs_length (const xcb_randr_monitor_info_t *R); | 4270 | xcb_randr_monitor_info_outputs_length (const xcb_randr_monitor_info_t *R); | |
4189 | 4271 | |||
4190 | xcb_generic_iterator_t | 4272 | xcb_generic_iterator_t | |
4191 | xcb_randr_monitor_info_outputs_end (const xcb_randr_monitor_info_t *R); | 4273 | xcb_randr_monitor_info_outputs_end (const xcb_randr_monitor_info_t *R); | |
4192 | 4274 | |||
4193 | /** | 4275 | /** | |
@@ -4324,23 +4406,170 @@ xcb_randr_delete_monitor_checked (xcb_co | @@ -4324,23 +4406,170 @@ xcb_randr_delete_monitor_checked (xcb_co | |||
4324 | /** | 4406 | /** | |
4325 | * | 4407 | * | |
4326 | * @param c The connection | 4408 | * @param c The connection | |
4327 | * @return A cookie | 4409 | * @return A cookie | |
4328 | * | 4410 | * | |
4329 | * Delivers a request to the X server. | 4411 | * Delivers a request to the X server. | |
4330 | * | 4412 | * | |
4331 | */ | 4413 | */ | |
4332 | xcb_void_cookie_t | 4414 | xcb_void_cookie_t | |
4333 | xcb_randr_delete_monitor (xcb_connection_t *c, | 4415 | xcb_randr_delete_monitor (xcb_connection_t *c, | |
4334 | xcb_window_t window, | 4416 | xcb_window_t window, | |
4335 | xcb_atom_t name); | 4417 | xcb_atom_t name); | |
4336 | 4418 | |||
4419 | int | |||
4420 | xcb_randr_create_lease_sizeof (const void *_buffer); | |||
4421 | ||||
4422 | /** | |||
4423 | * | |||
4424 | * @param c The connection | |||
4425 | * @return A cookie | |||
4426 | * | |||
4427 | * Delivers a request to the X server. | |||
4428 | * | |||
4429 | */ | |||
4430 | xcb_randr_create_lease_cookie_t | |||
4431 | xcb_randr_create_lease (xcb_connection_t *c, | |||
4432 | xcb_window_t window, | |||
4433 | xcb_randr_lease_t lid, | |||
4434 | uint16_t num_crtcs, | |||
4435 | uint16_t num_outputs, | |||
4436 | const xcb_randr_crtc_t *crtcs, | |||
4437 | const xcb_randr_output_t *outputs); | |||
4438 | ||||
4439 | /** | |||
4440 | * | |||
4441 | * @param c The connection | |||
4442 | * @return A cookie | |||
4443 | * | |||
4444 | * Delivers a request to the X server. | |||
4445 | * | |||
4446 | * This form can be used only if the request will cause | |||
4447 | * a reply to be generated. Any returned error will be | |||
4448 | * placed in the event queue. | |||
4449 | */ | |||
4450 | xcb_randr_create_lease_cookie_t | |||
4451 | xcb_randr_create_lease_unchecked (xcb_connection_t *c, | |||
4452 | xcb_window_t window, | |||
4453 | xcb_randr_lease_t lid, | |||
4454 | uint16_t num_crtcs, | |||
4455 | uint16_t num_outputs, | |||
4456 | const xcb_randr_crtc_t *crtcs, | |||
4457 | const xcb_randr_output_t *outputs); | |||
4458 | ||||
4459 | /** | |||
4460 | * Return the reply | |||
4461 | * @param c The connection | |||
4462 | * @param cookie The cookie | |||
4463 | * @param e The xcb_generic_error_t supplied | |||
4464 | * | |||
4465 | * Returns the reply of the request asked by | |||
4466 | * | |||
4467 | * The parameter @p e supplied to this function must be NULL if | |||
4468 | * xcb_randr_create_lease_unchecked(). is used. | |||
4469 | * Otherwise, it stores the error if any. | |||
4470 | * | |||
4471 | * The returned value must be freed by the caller using free(). | |||
4472 | */ | |||
4473 | xcb_randr_create_lease_reply_t * | |||
4474 | xcb_randr_create_lease_reply (xcb_connection_t *c, | |||
4475 | xcb_randr_create_lease_cookie_t cookie /**< */, | |||
4476 | xcb_generic_error_t **e); | |||
4477 | ||||
4478 | /** | |||
4479 | * Return the reply fds | |||
4480 | * @param c The connection | |||
4481 | * @param reply The reply | |||
4482 | * | |||
4483 | * Returns the array of reply fds of the request asked by | |||
4484 | * | |||
4485 | * The returned value must be freed by the caller using free(). | |||
4486 | */ | |||
4487 | int * | |||
4488 | xcb_randr_create_lease_reply_fds (xcb_connection_t *c /**< */, | |||
4489 | xcb_randr_create_lease_reply_t *reply); | |||
4490 | ||||
4491 | /** | |||
4492 | * | |||
4493 | * @param c The connection | |||
4494 | * @return A cookie | |||
4495 | * | |||
4496 | * Delivers a request to the X server. | |||
4497 | * | |||
4498 | * This form can be used only if the request will not cause | |||
4499 | * a reply to be generated. Any returned error will be | |||
4500 | * saved for handling by xcb_request_check(). | |||
4501 | */ | |||
4502 | xcb_void_cookie_t | |||
4503 | xcb_randr_free_lease_checked (xcb_connection_t *c, | |||
4504 | xcb_randr_lease_t lid, | |||
4505 | uint8_t terminate); | |||
4506 | ||||
4507 | /** | |||
4508 | * | |||
4509 | * @param c The connection | |||
4510 | * @return A cookie | |||
4511 | * | |||
4512 | * Delivers a request to the X server. | |||
4513 | * | |||
4514 | */ | |||
4515 | xcb_void_cookie_t | |||
4516 | xcb_randr_free_lease (xcb_connection_t *c, | |||
4517 | xcb_randr_lease_t lid, | |||
4518 | uint8_t terminate); | |||
4519 | ||||
4520 | /** | |||
4521 | * Get the next element of the iterator | |||
4522 | * @param i Pointer to a xcb_randr_lease_notify_iterator_t | |||
4523 | * | |||
4524 | * Get the next element in the iterator. The member rem is | |||
4525 | * decreased by one. The member data points to the next | |||
4526 | * element. The member index is increased by sizeof(xcb_randr_lease_notify_t) | |||
4527 | */ | |||
4528 | void | |||
4529 | xcb_randr_lease_notify_next (xcb_randr_lease_notify_iterator_t *i); | |||
4530 | ||||
4531 | /** | |||
4532 | * Return the iterator pointing to the last element | |||
4533 | * @param i An xcb_randr_lease_notify_iterator_t | |||
4534 | * @return The iterator pointing to the last element | |||
4535 | * | |||
4536 | * Set the current element in the iterator to the last element. | |||
4537 | * The member rem is set to 0. The member data points to the | |||
4538 | * last element. | |||
4539 | */ | |||
4540 | xcb_generic_iterator_t | |||
4541 | xcb_randr_lease_notify_end (xcb_randr_lease_notify_iterator_t i); | |||
4542 | ||||
4543 | /** | |||
4544 | * Get the next element of the iterator | |||
4545 | * @param i Pointer to a xcb_randr_notify_data_iterator_t | |||
4546 | * | |||
4547 | * Get the next element in the iterator. The member rem is | |||
4548 | * decreased by one. The member data points to the next | |||
4549 | * element. The member index is increased by sizeof(xcb_randr_notify_data_t) | |||
4550 | */ | |||
4551 | void | |||
4552 | xcb_randr_notify_data_next (xcb_randr_notify_data_iterator_t *i); | |||
4553 | ||||
4554 | /** | |||
4555 | * Return the iterator pointing to the last element | |||
4556 | * @param i An xcb_randr_notify_data_iterator_t | |||
4557 | * @return The iterator pointing to the last element | |||
4558 | * | |||
4559 | * Set the current element in the iterator to the last element. | |||
4560 | * The member rem is set to 0. The member data points to the | |||
4561 | * last element. | |||
4562 | */ | |||
4563 | xcb_generic_iterator_t | |||
4564 | xcb_randr_notify_data_end (xcb_randr_notify_data_iterator_t i); | |||
4565 | ||||
4337 | 4566 | |||
4338 | #ifdef __cplusplus | 4567 | #ifdef __cplusplus | |
4339 | } | 4568 | } | |
4340 | #endif | 4569 | #endif | |
4341 | 4570 | |||
4342 | #endif | 4571 | #endif | |
4343 | 4572 | |||
4344 | /** | 4573 | /** | |
4345 | * @} | 4574 | * @} | |
4346 | */ | 4575 | */ |
--- src/external/mit/xorg/lib/libxcb/files/res.c 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/res.c 2018/03/14 06:47:28 1.6
@@ -78,58 +78,58 @@ xcb_res_client_id_value_sizeof (const vo | @@ -78,58 +78,58 @@ xcb_res_client_id_value_sizeof (const vo | |||
78 | char *xcb_tmp = (char *)_buffer; | 78 | char *xcb_tmp = (char *)_buffer; | |
79 | const xcb_res_client_id_value_t *_aux = (xcb_res_client_id_value_t *)_buffer; | 79 | const xcb_res_client_id_value_t *_aux = (xcb_res_client_id_value_t *)_buffer; | |
80 | unsigned int xcb_buffer_len = 0; | 80 | unsigned int xcb_buffer_len = 0; | |
81 | unsigned int xcb_block_len = 0; | 81 | unsigned int xcb_block_len = 0; | |
82 | unsigned int xcb_pad = 0; | 82 | unsigned int xcb_pad = 0; | |
83 | unsigned int xcb_align_to = 0; | 83 | unsigned int xcb_align_to = 0; | |
84 | 84 | |||
85 | 85 | |||
86 | xcb_block_len += sizeof(xcb_res_client_id_value_t); | 86 | xcb_block_len += sizeof(xcb_res_client_id_value_t); | |
87 | xcb_tmp += xcb_block_len; | 87 | xcb_tmp += xcb_block_len; | |
88 | xcb_buffer_len += xcb_block_len; | 88 | xcb_buffer_len += xcb_block_len; | |
89 | xcb_block_len = 0; | 89 | xcb_block_len = 0; | |
90 | /* value */ | 90 | /* value */ | |
91 | xcb_block_len += _aux->length * sizeof(uint32_t); | 91 | xcb_block_len += (_aux->length / 4) * sizeof(uint32_t); | |
92 | xcb_tmp += xcb_block_len; | 92 | xcb_tmp += xcb_block_len; | |
93 | xcb_align_to = ALIGNOF(uint32_t); | 93 | xcb_align_to = ALIGNOF(uint32_t); | |
94 | /* insert padding */ | 94 | /* insert padding */ | |
95 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | 95 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |
96 | xcb_buffer_len += xcb_block_len + xcb_pad; | 96 | xcb_buffer_len += xcb_block_len + xcb_pad; | |
97 | if (0 != xcb_pad) { | 97 | if (0 != xcb_pad) { | |
98 | xcb_tmp += xcb_pad; | 98 | xcb_tmp += xcb_pad; | |
99 | xcb_pad = 0; | 99 | xcb_pad = 0; | |
100 | } | 100 | } | |
101 | xcb_block_len = 0; | 101 | xcb_block_len = 0; | |
102 | 102 | |||
103 | return xcb_buffer_len; | 103 | return xcb_buffer_len; | |
104 | } | 104 | } | |
105 | 105 | |||
106 | uint32_t * | 106 | uint32_t * | |
107 | xcb_res_client_id_value_value (const xcb_res_client_id_value_t *R) | 107 | xcb_res_client_id_value_value (const xcb_res_client_id_value_t *R) | |
108 | { | 108 | { | |
109 | return (uint32_t *) (R + 1); | 109 | return (uint32_t *) (R + 1); | |
110 | } | 110 | } | |
111 | 111 | |||
112 | int | 112 | int | |
113 | xcb_res_client_id_value_value_length (const xcb_res_client_id_value_t *R) | 113 | xcb_res_client_id_value_value_length (const xcb_res_client_id_value_t *R) | |
114 | { | 114 | { | |
115 | return R->length; | 115 | return (R->length / 4); | |
116 | } | 116 | } | |
117 | 117 | |||
118 | xcb_generic_iterator_t | 118 | xcb_generic_iterator_t | |
119 | xcb_res_client_id_value_value_end (const xcb_res_client_id_value_t *R) | 119 | xcb_res_client_id_value_value_end (const xcb_res_client_id_value_t *R) | |
120 | { | 120 | { | |
121 | xcb_generic_iterator_t i; | 121 | xcb_generic_iterator_t i; | |
122 | i.data = ((uint32_t *) (R + 1)) + (R->length); | 122 | i.data = ((uint32_t *) (R + 1)) + ((R->length / 4)); | |
123 | i.rem = 0; | 123 | i.rem = 0; | |
124 | i.index = (char *) i.data - (char *) R; | 124 | i.index = (char *) i.data - (char *) R; | |
125 | return i; | 125 | return i; | |
126 | } | 126 | } | |
127 | 127 | |||
128 | void | 128 | void | |
129 | xcb_res_client_id_value_next (xcb_res_client_id_value_iterator_t *i) | 129 | xcb_res_client_id_value_next (xcb_res_client_id_value_iterator_t *i) | |
130 | { | 130 | { | |
131 | xcb_res_client_id_value_t *R = i->data; | 131 | xcb_res_client_id_value_t *R = i->data; | |
132 | xcb_generic_iterator_t child; | 132 | xcb_generic_iterator_t child; | |
133 | child.data = (xcb_res_client_id_value_t *)(((char *)R) + xcb_res_client_id_value_sizeof(R)); | 133 | child.data = (xcb_res_client_id_value_t *)(((char *)R) + xcb_res_client_id_value_sizeof(R)); | |
134 | i->index = (char *) child.data - (char *) i->data; | 134 | i->index = (char *) child.data - (char *) i->data; | |
135 | --i->rem; | 135 | --i->rem; |
--- src/external/mit/xorg/lib/libxcb/files/shm.c 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/shm.c 2018/03/14 06:47:28 1.6
@@ -495,69 +495,71 @@ xcb_shm_attach_fd_checked (xcb_connectio | @@ -495,69 +495,71 @@ xcb_shm_attach_fd_checked (xcb_connectio | |||
495 | uint8_t read_only) | 495 | uint8_t read_only) | |
496 | { | 496 | { | |
497 | static const xcb_protocol_request_t xcb_req = { | 497 | static const xcb_protocol_request_t xcb_req = { | |
498 | .count = 2, | 498 | .count = 2, | |
499 | .ext = &xcb_shm_id, | 499 | .ext = &xcb_shm_id, | |
500 | .opcode = XCB_SHM_ATTACH_FD, | 500 | .opcode = XCB_SHM_ATTACH_FD, | |
501 | .isvoid = 1 | 501 | .isvoid = 1 | |
502 | }; | 502 | }; | |
503 | 503 | |||
504 | struct iovec xcb_parts[4]; | 504 | struct iovec xcb_parts[4]; | |
505 | xcb_void_cookie_t xcb_ret; | 505 | xcb_void_cookie_t xcb_ret; | |
506 | xcb_shm_attach_fd_request_t xcb_out; | 506 | xcb_shm_attach_fd_request_t xcb_out; | |
507 | int fds[1]; | 507 | int fds[1]; | |
508 | int fd_index = 0; | |||
508 | 509 | |||
509 | xcb_out.shmseg = shmseg; | 510 | xcb_out.shmseg = shmseg; | |
510 | xcb_out.read_only = read_only; | 511 | xcb_out.read_only = read_only; | |
511 | memset(xcb_out.pad0, 0, 3); | 512 | memset(xcb_out.pad0, 0, 3); | |
512 | 513 | |||
513 | xcb_parts[2].iov_base = (char *) &xcb_out; | 514 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
514 | xcb_parts[2].iov_len = sizeof(xcb_out); | 515 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
515 | xcb_parts[3].iov_base = 0; | 516 | xcb_parts[3].iov_base = 0; | |
516 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 517 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
517 | 518 | |||
518 | fds[0] = shm_fd; | 519 | fds[fd_index++] = shm_fd; | |
519 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | 520 | xcb_ret.sequence = xcb_send_request_with_fds(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req, 1, fds); | |
520 | return xcb_ret; | 521 | return xcb_ret; | |
521 | } | 522 | } | |
522 | 523 | |||
523 | xcb_void_cookie_t | 524 | xcb_void_cookie_t | |
524 | xcb_shm_attach_fd (xcb_connection_t *c, | 525 | xcb_shm_attach_fd (xcb_connection_t *c, | |
525 | xcb_shm_seg_t shmseg, | 526 | xcb_shm_seg_t shmseg, | |
526 | int32_t shm_fd, | 527 | int32_t shm_fd, | |
527 | uint8_t read_only) | 528 | uint8_t read_only) | |
528 | { | 529 | { | |
529 | static const xcb_protocol_request_t xcb_req = { | 530 | static const xcb_protocol_request_t xcb_req = { | |
530 | .count = 2, | 531 | .count = 2, | |
531 | .ext = &xcb_shm_id, | 532 | .ext = &xcb_shm_id, | |
532 | .opcode = XCB_SHM_ATTACH_FD, | 533 | .opcode = XCB_SHM_ATTACH_FD, | |
533 | .isvoid = 1 | 534 | .isvoid = 1 | |
534 | }; | 535 | }; | |
535 | 536 | |||
536 | struct iovec xcb_parts[4]; | 537 | struct iovec xcb_parts[4]; | |
537 | xcb_void_cookie_t xcb_ret; | 538 | xcb_void_cookie_t xcb_ret; | |
538 | xcb_shm_attach_fd_request_t xcb_out; | 539 | xcb_shm_attach_fd_request_t xcb_out; | |
539 | int fds[1]; | 540 | int fds[1]; | |
541 | int fd_index = 0; | |||
540 | 542 | |||
541 | xcb_out.shmseg = shmseg; | 543 | xcb_out.shmseg = shmseg; | |
542 | xcb_out.read_only = read_only; | 544 | xcb_out.read_only = read_only; | |
543 | memset(xcb_out.pad0, 0, 3); | 545 | memset(xcb_out.pad0, 0, 3); | |
544 | 546 | |||
545 | xcb_parts[2].iov_base = (char *) &xcb_out; | 547 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
546 | xcb_parts[2].iov_len = sizeof(xcb_out); | 548 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
547 | xcb_parts[3].iov_base = 0; | 549 | xcb_parts[3].iov_base = 0; | |
548 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 550 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
549 | 551 | |||
550 | fds[0] = shm_fd; | 552 | fds[fd_index++] = shm_fd; | |
551 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | 553 | xcb_ret.sequence = xcb_send_request_with_fds(c, 0, xcb_parts + 2, &xcb_req, 1, fds); | |
552 | return xcb_ret; | 554 | return xcb_ret; | |
553 | } | 555 | } | |
554 | 556 | |||
555 | xcb_shm_create_segment_cookie_t | 557 | xcb_shm_create_segment_cookie_t | |
556 | xcb_shm_create_segment (xcb_connection_t *c, | 558 | xcb_shm_create_segment (xcb_connection_t *c, | |
557 | xcb_shm_seg_t shmseg, | 559 | xcb_shm_seg_t shmseg, | |
558 | uint32_t size, | 560 | uint32_t size, | |
559 | uint8_t read_only) | 561 | uint8_t read_only) | |
560 | { | 562 | { | |
561 | static const xcb_protocol_request_t xcb_req = { | 563 | static const xcb_protocol_request_t xcb_req = { | |
562 | .count = 2, | 564 | .count = 2, | |
563 | .ext = &xcb_shm_id, | 565 | .ext = &xcb_shm_id, |
--- src/external/mit/xorg/lib/libxcb/files/xinput.c 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/xinput.c 2018/03/14 06:47:28 1.6
@@ -948,26 +948,44 @@ xcb_input_list_input_devices_names_itera | @@ -948,26 +948,44 @@ xcb_input_list_input_devices_names_itera | |||
948 | i.index = (char *) i.data - (char *) R; | 948 | i.index = (char *) i.data - (char *) R; | |
949 | return i; | 949 | return i; | |
950 | } | 950 | } | |
951 | 951 | |||
952 | xcb_input_list_input_devices_reply_t * | 952 | xcb_input_list_input_devices_reply_t * | |
953 | xcb_input_list_input_devices_reply (xcb_connection_t *c, | 953 | xcb_input_list_input_devices_reply (xcb_connection_t *c, | |
954 | xcb_input_list_input_devices_cookie_t cookie /**< */, | 954 | xcb_input_list_input_devices_cookie_t cookie /**< */, | |
955 | xcb_generic_error_t **e) | 955 | xcb_generic_error_t **e) | |
956 | { | 956 | { | |
957 | return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | 957 | return (xcb_input_list_input_devices_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |
958 | } | 958 | } | |
959 | 959 | |||
960 | void | 960 | void | |
961 | xcb_input_event_type_base_next (xcb_input_event_type_base_iterator_t *i) | |||
962 | { | |||
963 | --i->rem; | |||
964 | ++i->data; | |||
965 | i->index += sizeof(xcb_input_event_type_base_t); | |||
966 | } | |||
967 | ||||
968 | xcb_generic_iterator_t | |||
969 | xcb_input_event_type_base_end (xcb_input_event_type_base_iterator_t i) | |||
970 | { | |||
971 | xcb_generic_iterator_t ret; | |||
972 | ret.data = i.data + i.rem; | |||
973 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
974 | ret.rem = 0; | |||
975 | return ret; | |||
976 | } | |||
977 | ||||
978 | void | |||
961 | xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i) | 979 | xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i) | |
962 | { | 980 | { | |
963 | --i->rem; | 981 | --i->rem; | |
964 | ++i->data; | 982 | ++i->data; | |
965 | i->index += sizeof(xcb_input_input_class_info_t); | 983 | i->index += sizeof(xcb_input_input_class_info_t); | |
966 | } | 984 | } | |
967 | 985 | |||
968 | xcb_generic_iterator_t | 986 | xcb_generic_iterator_t | |
969 | xcb_input_input_class_info_end (xcb_input_input_class_info_iterator_t i) | 987 | xcb_input_input_class_info_end (xcb_input_input_class_info_iterator_t i) | |
970 | { | 988 | { | |
971 | xcb_generic_iterator_t ret; | 989 | xcb_generic_iterator_t ret; | |
972 | ret.data = i.data + i.rem; | 990 | ret.data = i.data + i.rem; | |
973 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | 991 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |
@@ -5598,209 +5616,26 @@ xcb_input_query_device_state_classes_ite | @@ -5598,209 +5616,26 @@ xcb_input_query_device_state_classes_ite | |||
5598 | i.rem = R->num_classes; | 5616 | i.rem = R->num_classes; | |
5599 | i.index = (char *) i.data - (char *) R; | 5617 | i.index = (char *) i.data - (char *) R; | |
5600 | return i; | 5618 | return i; | |
5601 | } | 5619 | } | |
5602 | 5620 | |||
5603 | xcb_input_query_device_state_reply_t * | 5621 | xcb_input_query_device_state_reply_t * | |
5604 | xcb_input_query_device_state_reply (xcb_connection_t *c, | 5622 | xcb_input_query_device_state_reply (xcb_connection_t *c, | |
5605 | xcb_input_query_device_state_cookie_t cookie /**< */, | 5623 | xcb_input_query_device_state_cookie_t cookie /**< */, | |
5606 | xcb_generic_error_t **e) | 5624 | xcb_generic_error_t **e) | |
5607 | { | 5625 | { | |
5608 | return (xcb_input_query_device_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | 5626 | return (xcb_input_query_device_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); | |
5609 | } | 5627 | } | |
5610 | 5628 | |||
5611 | int | |||
5612 | xcb_input_send_extension_event_sizeof (const void *_buffer) | |||
5613 | { | |||
5614 | char *xcb_tmp = (char *)_buffer; | |||
5615 | const xcb_input_send_extension_event_request_t *_aux = (xcb_input_send_extension_event_request_t *)_buffer; | |||
5616 | unsigned int xcb_buffer_len = 0; | |||
5617 | unsigned int xcb_block_len = 0; | |||
5618 | unsigned int xcb_pad = 0; | |||
5619 | unsigned int xcb_align_to = 0; | |||
5620 | ||||
5621 | ||||
5622 | xcb_block_len += sizeof(xcb_input_send_extension_event_request_t); | |||
5623 | xcb_tmp += xcb_block_len; | |||
5624 | xcb_buffer_len += xcb_block_len; | |||
5625 | xcb_block_len = 0; | |||
5626 | /* events */ | |||
5627 | xcb_block_len += (_aux->num_events * 32) * sizeof(uint8_t); | |||
5628 | xcb_tmp += xcb_block_len; | |||
5629 | xcb_align_to = ALIGNOF(uint8_t); | |||
5630 | /* insert padding */ | |||
5631 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
5632 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
5633 | if (0 != xcb_pad) { | |||
5634 | xcb_tmp += xcb_pad; | |||
5635 | xcb_pad = 0; | |||
5636 | } | |||
5637 | xcb_block_len = 0; | |||
5638 | /* classes */ | |||
5639 | xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); | |||
5640 | xcb_tmp += xcb_block_len; | |||
5641 | xcb_align_to = ALIGNOF(xcb_input_event_class_t); | |||
5642 | /* insert padding */ | |||
5643 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
5644 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
5645 | if (0 != xcb_pad) { | |||
5646 | xcb_tmp += xcb_pad; | |||
5647 | xcb_pad = 0; | |||
5648 | } | |||
5649 | xcb_block_len = 0; | |||
5650 | ||||
5651 | return xcb_buffer_len; | |||
5652 | } | |||
5653 | ||||
5654 | xcb_void_cookie_t | |||
5655 | xcb_input_send_extension_event_checked (xcb_connection_t *c, | |||
5656 | xcb_window_t destination, | |||
5657 | uint8_t device_id, | |||
5658 | uint8_t propagate, | |||
5659 | uint16_t num_classes, | |||
5660 | uint8_t num_events, | |||
5661 | const uint8_t *events, | |||
5662 | const xcb_input_event_class_t *classes) | |||
5663 | { | |||
5664 | static const xcb_protocol_request_t xcb_req = { | |||
5665 | .count = 6, | |||
5666 | .ext = &xcb_input_id, | |||
5667 | .opcode = XCB_INPUT_SEND_EXTENSION_EVENT, | |||
5668 | .isvoid = 1 | |||
5669 | }; | |||
5670 | ||||
5671 | struct iovec xcb_parts[8]; | |||
5672 | xcb_void_cookie_t xcb_ret; | |||
5673 | xcb_input_send_extension_event_request_t xcb_out; | |||
5674 | ||||
5675 | xcb_out.destination = destination; | |||
5676 | xcb_out.device_id = device_id; | |||
5677 | xcb_out.propagate = propagate; | |||
5678 | xcb_out.num_classes = num_classes; | |||
5679 | xcb_out.num_events = num_events; | |||
5680 | memset(xcb_out.pad0, 0, 3); | |||
5681 | ||||
5682 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5683 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5684 | xcb_parts[3].iov_base = 0; | |||
5685 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5686 | /* uint8_t events */ | |||
5687 | xcb_parts[4].iov_base = (char *) events; | |||
5688 | xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t); | |||
5689 | xcb_parts[5].iov_base = 0; | |||
5690 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
5691 | /* xcb_input_event_class_t classes */ | |||
5692 | xcb_parts[6].iov_base = (char *) classes; | |||
5693 | xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); | |||
5694 | xcb_parts[7].iov_base = 0; | |||
5695 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
5696 | ||||
5697 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); | |||
5698 | return xcb_ret; | |||
5699 | } | |||
5700 | ||||
5701 | xcb_void_cookie_t | |||
5702 | xcb_input_send_extension_event (xcb_connection_t *c, | |||
5703 | xcb_window_t destination, | |||
5704 | uint8_t device_id, | |||
5705 | uint8_t propagate, | |||
5706 | uint16_t num_classes, | |||
5707 | uint8_t num_events, | |||
5708 | const uint8_t *events, | |||
5709 | const xcb_input_event_class_t *classes) | |||
5710 | { | |||
5711 | static const xcb_protocol_request_t xcb_req = { | |||
5712 | .count = 6, | |||
5713 | .ext = &xcb_input_id, | |||
5714 | .opcode = XCB_INPUT_SEND_EXTENSION_EVENT, | |||
5715 | .isvoid = 1 | |||
5716 | }; | |||
5717 | ||||
5718 | struct iovec xcb_parts[8]; | |||
5719 | xcb_void_cookie_t xcb_ret; | |||
5720 | xcb_input_send_extension_event_request_t xcb_out; | |||
5721 | ||||
5722 | xcb_out.destination = destination; | |||
5723 | xcb_out.device_id = device_id; | |||
5724 | xcb_out.propagate = propagate; | |||
5725 | xcb_out.num_classes = num_classes; | |||
5726 | xcb_out.num_events = num_events; | |||
5727 | memset(xcb_out.pad0, 0, 3); | |||
5728 | ||||
5729 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
5730 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
5731 | xcb_parts[3].iov_base = 0; | |||
5732 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
5733 | /* uint8_t events */ | |||
5734 | xcb_parts[4].iov_base = (char *) events; | |||
5735 | xcb_parts[4].iov_len = (num_events * 32) * sizeof(uint8_t); | |||
5736 | xcb_parts[5].iov_base = 0; | |||
5737 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
5738 | /* xcb_input_event_class_t classes */ | |||
5739 | xcb_parts[6].iov_base = (char *) classes; | |||
5740 | xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); | |||
5741 | xcb_parts[7].iov_base = 0; | |||
5742 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
5743 | ||||
5744 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | |||
5745 | return xcb_ret; | |||
5746 | } | |||
5747 | ||||
5748 | uint8_t * | |||
5749 | xcb_input_send_extension_event_events (const xcb_input_send_extension_event_request_t *R) | |||
5750 | { | |||
5751 | return (uint8_t *) (R + 1); | |||
5752 | } | |||
5753 | ||||
5754 | int | |||
5755 | xcb_input_send_extension_event_events_length (const xcb_input_send_extension_event_request_t *R) | |||
5756 | { | |||
5757 | return (R->num_events * 32); | |||
5758 | } | |||
5759 | ||||
5760 | xcb_generic_iterator_t | |||
5761 | xcb_input_send_extension_event_events_end (const xcb_input_send_extension_event_request_t *R) | |||
5762 | { | |||
5763 | xcb_generic_iterator_t i; | |||
5764 | i.data = ((uint8_t *) (R + 1)) + ((R->num_events * 32)); | |||
5765 | i.rem = 0; | |||
5766 | i.index = (char *) i.data - (char *) R; | |||
5767 | return i; | |||
5768 | } | |||
5769 | ||||
5770 | xcb_input_event_class_t * | |||
5771 | xcb_input_send_extension_event_classes (const xcb_input_send_extension_event_request_t *R) | |||
5772 | { | |||
5773 | xcb_generic_iterator_t prev = xcb_input_send_extension_event_events_end(R); | |||
5774 | return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0); | |||
5775 | } | |||
5776 | ||||
5777 | int | |||
5778 | xcb_input_send_extension_event_classes_length (const xcb_input_send_extension_event_request_t *R) | |||
5779 | { | |||
5780 | return R->num_classes; | |||
5781 | } | |||
5782 | ||||
5783 | xcb_generic_iterator_t | |||
5784 | xcb_input_send_extension_event_classes_end (const xcb_input_send_extension_event_request_t *R) | |||
5785 | { | |||
5786 | xcb_generic_iterator_t i; | |||
5787 | xcb_generic_iterator_t prev = xcb_input_send_extension_event_events_end(R); | |||
5788 | i.data = ((xcb_input_event_class_t *) ((char*) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index))) + (R->num_classes); | |||
5789 | i.rem = 0; | |||
5790 | i.index = (char *) i.data - (char *) R; | |||
5791 | return i; | |||
5792 | } | |||
5793 | ||||
5794 | xcb_void_cookie_t | 5629 | xcb_void_cookie_t | |
5795 | xcb_input_device_bell_checked (xcb_connection_t *c, | 5630 | xcb_input_device_bell_checked (xcb_connection_t *c, | |
5796 | uint8_t device_id, | 5631 | uint8_t device_id, | |
5797 | uint8_t feedback_id, | 5632 | uint8_t feedback_id, | |
5798 | uint8_t feedback_class, | 5633 | uint8_t feedback_class, | |
5799 | int8_t percent) | 5634 | int8_t percent) | |
5800 | { | 5635 | { | |
5801 | static const xcb_protocol_request_t xcb_req = { | 5636 | static const xcb_protocol_request_t xcb_req = { | |
5802 | .count = 2, | 5637 | .count = 2, | |
5803 | .ext = &xcb_input_id, | 5638 | .ext = &xcb_input_id, | |
5804 | .opcode = XCB_INPUT_DEVICE_BELL, | 5639 | .opcode = XCB_INPUT_DEVICE_BELL, | |
5805 | .isvoid = 1 | 5640 | .isvoid = 1 | |
5806 | }; | 5641 | }; | |
@@ -9506,29 +9341,29 @@ xcb_input_xi_change_hierarchy_checked (x | @@ -9506,29 +9341,29 @@ xcb_input_xi_change_hierarchy_checked (x | |||
9506 | uint8_t num_changes, | 9341 | uint8_t num_changes, | |
9507 | const xcb_input_hierarchy_change_t *changes) | 9342 | const xcb_input_hierarchy_change_t *changes) | |
9508 | { | 9343 | { | |
9509 | static const xcb_protocol_request_t xcb_req = { | 9344 | static const xcb_protocol_request_t xcb_req = { | |
9510 | .count = 4, | 9345 | .count = 4, | |
9511 | .ext = &xcb_input_id, | 9346 | .ext = &xcb_input_id, | |
9512 | .opcode = XCB_INPUT_XI_CHANGE_HIERARCHY, | 9347 | .opcode = XCB_INPUT_XI_CHANGE_HIERARCHY, | |
9513 | .isvoid = 1 | 9348 | .isvoid = 1 | |
9514 | }; | 9349 | }; | |
9515 | 9350 | |||
9516 | struct iovec xcb_parts[6]; | 9351 | struct iovec xcb_parts[6]; | |
9517 | xcb_void_cookie_t xcb_ret; | 9352 | xcb_void_cookie_t xcb_ret; | |
9518 | xcb_input_xi_change_hierarchy_request_t xcb_out; | 9353 | xcb_input_xi_change_hierarchy_request_t xcb_out; | |
9519 | unsigned int i; | |||
9520 | unsigned int xcb_tmp_len; | 9354 | unsigned int xcb_tmp_len; | |
9521 | char *xcb_tmp; | 9355 | char *xcb_tmp; | |
9356 | unsigned int i; | |||
9522 | 9357 | |||
9523 | xcb_out.num_changes = num_changes; | 9358 | xcb_out.num_changes = num_changes; | |
9524 | memset(xcb_out.pad0, 0, 3); | 9359 | memset(xcb_out.pad0, 0, 3); | |
9525 | 9360 | |||
9526 | xcb_parts[2].iov_base = (char *) &xcb_out; | 9361 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
9527 | xcb_parts[2].iov_len = sizeof(xcb_out); | 9362 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
9528 | xcb_parts[3].iov_base = 0; | 9363 | xcb_parts[3].iov_base = 0; | |
9529 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 9364 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
9530 | /* xcb_input_hierarchy_change_t changes */ | 9365 | /* xcb_input_hierarchy_change_t changes */ | |
9531 | xcb_parts[4].iov_base = (char *) changes; | 9366 | xcb_parts[4].iov_base = (char *) changes; | |
9532 | xcb_parts[4].iov_len = 0; | 9367 | xcb_parts[4].iov_len = 0; | |
9533 | xcb_tmp = (char *)changes; | 9368 | xcb_tmp = (char *)changes; | |
9534 | for(i=0; i<num_changes; i++) { | 9369 | for(i=0; i<num_changes; i++) { | |
@@ -9548,29 +9383,29 @@ xcb_input_xi_change_hierarchy (xcb_conne | @@ -9548,29 +9383,29 @@ xcb_input_xi_change_hierarchy (xcb_conne | |||
9548 | uint8_t num_changes, | 9383 | uint8_t num_changes, | |
9549 | const xcb_input_hierarchy_change_t *changes) | 9384 | const xcb_input_hierarchy_change_t *changes) | |
9550 | { | 9385 | { | |
9551 | static const xcb_protocol_request_t xcb_req = { | 9386 | static const xcb_protocol_request_t xcb_req = { | |
9552 | .count = 4, | 9387 | .count = 4, | |
9553 | .ext = &xcb_input_id, | 9388 | .ext = &xcb_input_id, | |
9554 | .opcode = XCB_INPUT_XI_CHANGE_HIERARCHY, | 9389 | .opcode = XCB_INPUT_XI_CHANGE_HIERARCHY, | |
9555 | .isvoid = 1 | 9390 | .isvoid = 1 | |
9556 | }; | 9391 | }; | |
9557 | 9392 | |||
9558 | struct iovec xcb_parts[6]; | 9393 | struct iovec xcb_parts[6]; | |
9559 | xcb_void_cookie_t xcb_ret; | 9394 | xcb_void_cookie_t xcb_ret; | |
9560 | xcb_input_xi_change_hierarchy_request_t xcb_out; | 9395 | xcb_input_xi_change_hierarchy_request_t xcb_out; | |
9561 | unsigned int i; | |||
9562 | unsigned int xcb_tmp_len; | 9396 | unsigned int xcb_tmp_len; | |
9563 | char *xcb_tmp; | 9397 | char *xcb_tmp; | |
9398 | unsigned int i; | |||
9564 | 9399 | |||
9565 | xcb_out.num_changes = num_changes; | 9400 | xcb_out.num_changes = num_changes; | |
9566 | memset(xcb_out.pad0, 0, 3); | 9401 | memset(xcb_out.pad0, 0, 3); | |
9567 | 9402 | |||
9568 | xcb_parts[2].iov_base = (char *) &xcb_out; | 9403 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
9569 | xcb_parts[2].iov_len = sizeof(xcb_out); | 9404 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
9570 | xcb_parts[3].iov_base = 0; | 9405 | xcb_parts[3].iov_base = 0; | |
9571 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 9406 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
9572 | /* xcb_input_hierarchy_change_t changes */ | 9407 | /* xcb_input_hierarchy_change_t changes */ | |
9573 | xcb_parts[4].iov_base = (char *) changes; | 9408 | xcb_parts[4].iov_base = (char *) changes; | |
9574 | xcb_parts[4].iov_len = 0; | 9409 | xcb_parts[4].iov_len = 0; | |
9575 | xcb_tmp = (char *)changes; | 9410 | xcb_tmp = (char *)changes; | |
9576 | for(i=0; i<num_changes; i++) { | 9411 | for(i=0; i<num_changes; i++) { | |
@@ -9837,29 +9672,29 @@ xcb_input_xi_select_events_checked (xcb_ | @@ -9837,29 +9672,29 @@ xcb_input_xi_select_events_checked (xcb_ | |||
9837 | uint16_t num_mask, | 9672 | uint16_t num_mask, | |
9838 | const xcb_input_event_mask_t *masks) | 9673 | const xcb_input_event_mask_t *masks) | |
9839 | { | 9674 | { | |
9840 | static const xcb_protocol_request_t xcb_req = { | 9675 | static const xcb_protocol_request_t xcb_req = { | |
9841 | .count = 4, | 9676 | .count = 4, | |
9842 | .ext = &xcb_input_id, | 9677 | .ext = &xcb_input_id, | |
9843 | .opcode = XCB_INPUT_XI_SELECT_EVENTS, | 9678 | .opcode = XCB_INPUT_XI_SELECT_EVENTS, | |
9844 | .isvoid = 1 | 9679 | .isvoid = 1 | |
9845 | }; | 9680 | }; | |
9846 | 9681 | |||
9847 | struct iovec xcb_parts[6]; | 9682 | struct iovec xcb_parts[6]; | |
9848 | xcb_void_cookie_t xcb_ret; | 9683 | xcb_void_cookie_t xcb_ret; | |
9849 | xcb_input_xi_select_events_request_t xcb_out; | 9684 | xcb_input_xi_select_events_request_t xcb_out; | |
9850 | unsigned int i; | |||
9851 | unsigned int xcb_tmp_len; | 9685 | unsigned int xcb_tmp_len; | |
9852 | char *xcb_tmp; | 9686 | char *xcb_tmp; | |
9687 | unsigned int i; | |||
9853 | 9688 | |||
9854 | xcb_out.window = window; | 9689 | xcb_out.window = window; | |
9855 | xcb_out.num_mask = num_mask; | 9690 | xcb_out.num_mask = num_mask; | |
9856 | memset(xcb_out.pad0, 0, 2); | 9691 | memset(xcb_out.pad0, 0, 2); | |
9857 | 9692 | |||
9858 | xcb_parts[2].iov_base = (char *) &xcb_out; | 9693 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
9859 | xcb_parts[2].iov_len = sizeof(xcb_out); | 9694 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
9860 | xcb_parts[3].iov_base = 0; | 9695 | xcb_parts[3].iov_base = 0; | |
9861 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 9696 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
9862 | /* xcb_input_event_mask_t masks */ | 9697 | /* xcb_input_event_mask_t masks */ | |
9863 | xcb_parts[4].iov_base = (char *) masks; | 9698 | xcb_parts[4].iov_base = (char *) masks; | |
9864 | xcb_parts[4].iov_len = 0; | 9699 | xcb_parts[4].iov_len = 0; | |
9865 | xcb_tmp = (char *)masks; | 9700 | xcb_tmp = (char *)masks; | |
@@ -9881,29 +9716,29 @@ xcb_input_xi_select_events (xcb_connecti | @@ -9881,29 +9716,29 @@ xcb_input_xi_select_events (xcb_connecti | |||
9881 | uint16_t num_mask, | 9716 | uint16_t num_mask, | |
9882 | const xcb_input_event_mask_t *masks) | 9717 | const xcb_input_event_mask_t *masks) | |
9883 | { | 9718 | { | |
9884 | static const xcb_protocol_request_t xcb_req = { | 9719 | static const xcb_protocol_request_t xcb_req = { | |
9885 | .count = 4, | 9720 | .count = 4, | |
9886 | .ext = &xcb_input_id, | 9721 | .ext = &xcb_input_id, | |
9887 | .opcode = XCB_INPUT_XI_SELECT_EVENTS, | 9722 | .opcode = XCB_INPUT_XI_SELECT_EVENTS, | |
9888 | .isvoid = 1 | 9723 | .isvoid = 1 | |
9889 | }; | 9724 | }; | |
9890 | 9725 | |||
9891 | struct iovec xcb_parts[6]; | 9726 | struct iovec xcb_parts[6]; | |
9892 | xcb_void_cookie_t xcb_ret; | 9727 | xcb_void_cookie_t xcb_ret; | |
9893 | xcb_input_xi_select_events_request_t xcb_out; | 9728 | xcb_input_xi_select_events_request_t xcb_out; | |
9894 | unsigned int i; | |||
9895 | unsigned int xcb_tmp_len; | 9729 | unsigned int xcb_tmp_len; | |
9896 | char *xcb_tmp; | 9730 | char *xcb_tmp; | |
9731 | unsigned int i; | |||
9897 | 9732 | |||
9898 | xcb_out.window = window; | 9733 | xcb_out.window = window; | |
9899 | xcb_out.num_mask = num_mask; | 9734 | xcb_out.num_mask = num_mask; | |
9900 | memset(xcb_out.pad0, 0, 2); | 9735 | memset(xcb_out.pad0, 0, 2); | |
9901 | 9736 | |||
9902 | xcb_parts[2].iov_base = (char *) &xcb_out; | 9737 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
9903 | xcb_parts[2].iov_len = sizeof(xcb_out); | 9738 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
9904 | xcb_parts[3].iov_base = 0; | 9739 | xcb_parts[3].iov_base = 0; | |
9905 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 9740 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
9906 | /* xcb_input_event_mask_t masks */ | 9741 | /* xcb_input_event_mask_t masks */ | |
9907 | xcb_parts[4].iov_base = (char *) masks; | 9742 | xcb_parts[4].iov_base = (char *) masks; | |
9908 | xcb_parts[4].iov_len = 0; | 9743 | xcb_parts[4].iov_len = 0; | |
9909 | xcb_tmp = (char *)masks; | 9744 | xcb_tmp = (char *)masks; | |
@@ -14445,13 +14280,214 @@ xcb_input_raw_touch_begin_axisvalues_raw | @@ -14445,13 +14280,214 @@ xcb_input_raw_touch_begin_axisvalues_raw | |||
14445 | 14280 | |||
14446 | int | 14281 | int | |
14447 | xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */) | 14282 | xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */) | |
14448 | { | 14283 | { | |
14449 | return xcb_input_raw_touch_begin_sizeof(_buffer); | 14284 | return xcb_input_raw_touch_begin_sizeof(_buffer); | |
14450 | } | 14285 | } | |
14451 | 14286 | |||
14452 | int | 14287 | int | |
14453 | xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */) | 14288 | xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */) | |
14454 | { | 14289 | { | |
14455 | return xcb_input_raw_touch_begin_sizeof(_buffer); | 14290 | return xcb_input_raw_touch_begin_sizeof(_buffer); | |
14456 | } | 14291 | } | |
14457 | 14292 | |||
14293 | void | |||
14294 | xcb_input_event_for_send_next (xcb_input_event_for_send_iterator_t *i) | |||
14295 | { | |||
14296 | --i->rem; | |||
14297 | ++i->data; | |||
14298 | i->index += sizeof(xcb_input_event_for_send_t); | |||
14299 | } | |||
14300 | ||||
14301 | xcb_generic_iterator_t | |||
14302 | xcb_input_event_for_send_end (xcb_input_event_for_send_iterator_t i) | |||
14303 | { | |||
14304 | xcb_generic_iterator_t ret; | |||
14305 | ret.data = i.data + i.rem; | |||
14306 | ret.index = i.index + ((char *) ret.data - (char *) i.data); | |||
14307 | ret.rem = 0; | |||
14308 | return ret; | |||
14309 | } | |||
14310 | ||||
14311 | int | |||
14312 | xcb_input_send_extension_event_sizeof (const void *_buffer) | |||
14313 | { | |||
14314 | char *xcb_tmp = (char *)_buffer; | |||
14315 | const xcb_input_send_extension_event_request_t *_aux = (xcb_input_send_extension_event_request_t *)_buffer; | |||
14316 | unsigned int xcb_buffer_len = 0; | |||
14317 | unsigned int xcb_block_len = 0; | |||
14318 | unsigned int xcb_pad = 0; | |||
14319 | unsigned int xcb_align_to = 0; | |||
14320 | ||||
14321 | ||||
14322 | xcb_block_len += sizeof(xcb_input_send_extension_event_request_t); | |||
14323 | xcb_tmp += xcb_block_len; | |||
14324 | xcb_buffer_len += xcb_block_len; | |||
14325 | xcb_block_len = 0; | |||
14326 | /* events */ | |||
14327 | xcb_block_len += _aux->num_events * sizeof(xcb_input_event_for_send_t); | |||
14328 | xcb_tmp += xcb_block_len; | |||
14329 | xcb_align_to = ALIGNOF(xcb_input_event_for_send_t); | |||
14330 | /* insert padding */ | |||
14331 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
14332 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
14333 | if (0 != xcb_pad) { | |||
14334 | xcb_tmp += xcb_pad; | |||
14335 | xcb_pad = 0; | |||
14336 | } | |||
14337 | xcb_block_len = 0; | |||
14338 | /* classes */ | |||
14339 | xcb_block_len += _aux->num_classes * sizeof(xcb_input_event_class_t); | |||
14340 | xcb_tmp += xcb_block_len; | |||
14341 | xcb_align_to = ALIGNOF(xcb_input_event_class_t); | |||
14342 | /* insert padding */ | |||
14343 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
14344 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
14345 | if (0 != xcb_pad) { | |||
14346 | xcb_tmp += xcb_pad; | |||
14347 | xcb_pad = 0; | |||
14348 | } | |||
14349 | xcb_block_len = 0; | |||
14350 | ||||
14351 | return xcb_buffer_len; | |||
14352 | } | |||
14353 | ||||
14354 | xcb_void_cookie_t | |||
14355 | xcb_input_send_extension_event_checked (xcb_connection_t *c, | |||
14356 | xcb_window_t destination, | |||
14357 | uint8_t device_id, | |||
14358 | uint8_t propagate, | |||
14359 | uint16_t num_classes, | |||
14360 | uint8_t num_events, | |||
14361 | const xcb_input_event_for_send_t *events, | |||
14362 | const xcb_input_event_class_t *classes) | |||
14363 | { | |||
14364 | static const xcb_protocol_request_t xcb_req = { | |||
14365 | .count = 6, | |||
14366 | .ext = &xcb_input_id, | |||
14367 | .opcode = XCB_INPUT_SEND_EXTENSION_EVENT, | |||
14368 | .isvoid = 1 | |||
14369 | }; | |||
14370 | ||||
14371 | struct iovec xcb_parts[8]; | |||
14372 | xcb_void_cookie_t xcb_ret; | |||
14373 | xcb_input_send_extension_event_request_t xcb_out; | |||
14374 | ||||
14375 | xcb_out.destination = destination; | |||
14376 | xcb_out.device_id = device_id; | |||
14377 | xcb_out.propagate = propagate; | |||
14378 | xcb_out.num_classes = num_classes; | |||
14379 | xcb_out.num_events = num_events; | |||
14380 | memset(xcb_out.pad0, 0, 3); | |||
14381 | ||||
14382 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
14383 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
14384 | xcb_parts[3].iov_base = 0; | |||
14385 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
14386 | /* xcb_input_event_for_send_t events */ | |||
14387 | xcb_parts[4].iov_base = (char *) events; | |||
14388 | xcb_parts[4].iov_len = num_events * sizeof(xcb_input_event_for_send_t); | |||
14389 | xcb_parts[5].iov_base = 0; | |||
14390 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
14391 | /* xcb_input_event_class_t classes */ | |||
14392 | xcb_parts[6].iov_base = (char *) classes; | |||
14393 | xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); | |||
14394 | xcb_parts[7].iov_base = 0; | |||
14395 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
14396 | ||||
14397 | xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); | |||
14398 | return xcb_ret; | |||
14399 | } | |||
14400 | ||||
14401 | xcb_void_cookie_t | |||
14402 | xcb_input_send_extension_event (xcb_connection_t *c, | |||
14403 | xcb_window_t destination, | |||
14404 | uint8_t device_id, | |||
14405 | uint8_t propagate, | |||
14406 | uint16_t num_classes, | |||
14407 | uint8_t num_events, | |||
14408 | const xcb_input_event_for_send_t *events, | |||
14409 | const xcb_input_event_class_t *classes) | |||
14410 | { | |||
14411 | static const xcb_protocol_request_t xcb_req = { | |||
14412 | .count = 6, | |||
14413 | .ext = &xcb_input_id, | |||
14414 | .opcode = XCB_INPUT_SEND_EXTENSION_EVENT, | |||
14415 | .isvoid = 1 | |||
14416 | }; | |||
14417 | ||||
14418 | struct iovec xcb_parts[8]; | |||
14419 | xcb_void_cookie_t xcb_ret; | |||
14420 | xcb_input_send_extension_event_request_t xcb_out; | |||
14421 | ||||
14422 | xcb_out.destination = destination; | |||
14423 | xcb_out.device_id = device_id; | |||
14424 | xcb_out.propagate = propagate; | |||
14425 | xcb_out.num_classes = num_classes; | |||
14426 | xcb_out.num_events = num_events; | |||
14427 | memset(xcb_out.pad0, 0, 3); | |||
14428 | ||||
14429 | xcb_parts[2].iov_base = (char *) &xcb_out; | |||
14430 | xcb_parts[2].iov_len = sizeof(xcb_out); | |||
14431 | xcb_parts[3].iov_base = 0; | |||
14432 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |||
14433 | /* xcb_input_event_for_send_t events */ | |||
14434 | xcb_parts[4].iov_base = (char *) events; | |||
14435 | xcb_parts[4].iov_len = num_events * sizeof(xcb_input_event_for_send_t); | |||
14436 | xcb_parts[5].iov_base = 0; | |||
14437 | xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; | |||
14438 | /* xcb_input_event_class_t classes */ | |||
14439 | xcb_parts[6].iov_base = (char *) classes; | |||
14440 | xcb_parts[6].iov_len = num_classes * sizeof(xcb_input_event_class_t); | |||
14441 | xcb_parts[7].iov_base = 0; | |||
14442 | xcb_parts[7].iov_len = -xcb_parts[6].iov_len & 3; | |||
14443 | ||||
14444 | xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); | |||
14445 | return xcb_ret; | |||
14446 | } | |||
14447 | ||||
14448 | xcb_input_event_for_send_t * | |||
14449 | xcb_input_send_extension_event_events (const xcb_input_send_extension_event_request_t *R) | |||
14450 | { | |||
14451 | return (xcb_input_event_for_send_t *) (R + 1); | |||
14452 | } | |||
14453 | ||||
14454 | int | |||
14455 | xcb_input_send_extension_event_events_length (const xcb_input_send_extension_event_request_t *R) | |||
14456 | { | |||
14457 | return R->num_events; | |||
14458 | } | |||
14459 | ||||
14460 | xcb_input_event_for_send_iterator_t | |||
14461 | xcb_input_send_extension_event_events_iterator (const xcb_input_send_extension_event_request_t *R) | |||
14462 | { | |||
14463 | xcb_input_event_for_send_iterator_t i; | |||
14464 | i.data = (xcb_input_event_for_send_t *) (R + 1); | |||
14465 | i.rem = R->num_events; | |||
14466 | i.index = (char *) i.data - (char *) R; | |||
14467 | return i; | |||
14468 | } | |||
14469 | ||||
14470 | xcb_input_event_class_t * | |||
14471 | xcb_input_send_extension_event_classes (const xcb_input_send_extension_event_request_t *R) | |||
14472 | { | |||
14473 | xcb_generic_iterator_t prev = xcb_input_event_for_send_end(xcb_input_send_extension_event_events_iterator(R)); | |||
14474 | return (xcb_input_event_class_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index) + 0); | |||
14475 | } | |||
14476 | ||||
14477 | int | |||
14478 | xcb_input_send_extension_event_classes_length (const xcb_input_send_extension_event_request_t *R) | |||
14479 | { | |||
14480 | return R->num_classes; | |||
14481 | } | |||
14482 | ||||
14483 | xcb_generic_iterator_t | |||
14484 | xcb_input_send_extension_event_classes_end (const xcb_input_send_extension_event_request_t *R) | |||
14485 | { | |||
14486 | xcb_generic_iterator_t i; | |||
14487 | xcb_generic_iterator_t prev = xcb_input_event_for_send_end(xcb_input_send_extension_event_events_iterator(R)); | |||
14488 | i.data = ((xcb_input_event_class_t *) ((char*) prev.data + XCB_TYPE_PAD(xcb_input_event_class_t, prev.index))) + (R->num_classes); | |||
14489 | i.rem = 0; | |||
14490 | i.index = (char *) i.data - (char *) R; | |||
14491 | return i; | |||
14492 | } | |||
14493 |
--- src/external/mit/xorg/lib/libxcb/files/xinput.h 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/xinput.h 2018/03/14 06:47:28 1.6
@@ -318,32 +318,43 @@ typedef struct xcb_input_list_input_devi | @@ -318,32 +318,43 @@ typedef struct xcb_input_list_input_devi | |||
318 | 318 | |||
319 | /** | 319 | /** | |
320 | * @brief xcb_input_list_input_devices_reply_t | 320 | * @brief xcb_input_list_input_devices_reply_t | |
321 | **/ | 321 | **/ | |
322 | typedef struct xcb_input_list_input_devices_reply_t { | 322 | typedef struct xcb_input_list_input_devices_reply_t { | |
323 | uint8_t response_type; | 323 | uint8_t response_type; | |
324 | uint8_t xi_reply_type; | 324 | uint8_t xi_reply_type; | |
325 | uint16_t sequence; | 325 | uint16_t sequence; | |
326 | uint32_t length; | 326 | uint32_t length; | |
327 | uint8_t devices_len; | 327 | uint8_t devices_len; | |
328 | uint8_t pad0[23]; | 328 | uint8_t pad0[23]; | |
329 | } xcb_input_list_input_devices_reply_t; | 329 | } xcb_input_list_input_devices_reply_t; | |
330 | 330 | |||
331 | typedef uint8_t xcb_input_event_type_base_t; | |||
332 | ||||
333 | /** | |||
334 | * @brief xcb_input_event_type_base_iterator_t | |||
335 | **/ | |||
336 | typedef struct xcb_input_event_type_base_iterator_t { | |||
337 | xcb_input_event_type_base_t *data; | |||
338 | int rem; | |||
339 | int index; | |||
340 | } xcb_input_event_type_base_iterator_t; | |||
341 | ||||
331 | /** | 342 | /** | |
332 | * @brief xcb_input_input_class_info_t | 343 | * @brief xcb_input_input_class_info_t | |
333 | **/ | 344 | **/ | |
334 | typedef struct xcb_input_input_class_info_t { | 345 | typedef struct xcb_input_input_class_info_t { | |
335 | uint8_t class_id; | 346 | uint8_t class_id; | |
336 | uint8_t event_type_base; | 347 | xcb_input_event_type_base_t event_type_base; | |
337 | } xcb_input_input_class_info_t; | 348 | } xcb_input_input_class_info_t; | |
338 | 349 | |||
339 | /** | 350 | /** | |
340 | * @brief xcb_input_input_class_info_iterator_t | 351 | * @brief xcb_input_input_class_info_iterator_t | |
341 | **/ | 352 | **/ | |
342 | typedef struct xcb_input_input_class_info_iterator_t { | 353 | typedef struct xcb_input_input_class_info_iterator_t { | |
343 | xcb_input_input_class_info_t *data; | 354 | xcb_input_input_class_info_t *data; | |
344 | int rem; | 355 | int rem; | |
345 | int index; | 356 | int index; | |
346 | } xcb_input_input_class_info_iterator_t; | 357 | } xcb_input_input_class_info_iterator_t; | |
347 | 358 | |||
348 | /** | 359 | /** | |
349 | * @brief xcb_input_open_device_cookie_t | 360 | * @brief xcb_input_open_device_cookie_t | |
@@ -1636,44 +1647,26 @@ typedef struct xcb_input_query_device_st | @@ -1636,44 +1647,26 @@ typedef struct xcb_input_query_device_st | |||
1636 | 1647 | |||
1637 | /** | 1648 | /** | |
1638 | * @brief xcb_input_query_device_state_reply_t | 1649 | * @brief xcb_input_query_device_state_reply_t | |
1639 | **/ | 1650 | **/ | |
1640 | typedef struct xcb_input_query_device_state_reply_t { | 1651 | typedef struct xcb_input_query_device_state_reply_t { | |
1641 | uint8_t response_type; | 1652 | uint8_t response_type; | |
1642 | uint8_t xi_reply_type; | 1653 | uint8_t xi_reply_type; | |
1643 | uint16_t sequence; | 1654 | uint16_t sequence; | |
1644 | uint32_t length; | 1655 | uint32_t length; | |
1645 | uint8_t num_classes; | 1656 | uint8_t num_classes; | |
1646 | uint8_t pad0[23]; | 1657 | uint8_t pad0[23]; | |
1647 | } xcb_input_query_device_state_reply_t; | 1658 | } xcb_input_query_device_state_reply_t; | |
1648 | 1659 | |||
1649 | /** Opcode for xcb_input_send_extension_event. */ | |||
1650 | #define XCB_INPUT_SEND_EXTENSION_EVENT 31 | |||
1651 | ||||
1652 | /** | |||
1653 | * @brief xcb_input_send_extension_event_request_t | |||
1654 | **/ | |||
1655 | typedef struct xcb_input_send_extension_event_request_t { | |||
1656 | uint8_t major_opcode; | |||
1657 | uint8_t minor_opcode; | |||
1658 | uint16_t length; | |||
1659 | xcb_window_t destination; | |||
1660 | uint8_t device_id; | |||
1661 | uint8_t propagate; | |||
1662 | uint16_t num_classes; | |||
1663 | uint8_t num_events; | |||
1664 | uint8_t pad0[3]; | |||
1665 | } xcb_input_send_extension_event_request_t; | |||
1666 | ||||
1667 | /** Opcode for xcb_input_device_bell. */ | 1660 | /** Opcode for xcb_input_device_bell. */ | |
1668 | #define XCB_INPUT_DEVICE_BELL 32 | 1661 | #define XCB_INPUT_DEVICE_BELL 32 | |
1669 | 1662 | |||
1670 | /** | 1663 | /** | |
1671 | * @brief xcb_input_device_bell_request_t | 1664 | * @brief xcb_input_device_bell_request_t | |
1672 | **/ | 1665 | **/ | |
1673 | typedef struct xcb_input_device_bell_request_t { | 1666 | typedef struct xcb_input_device_bell_request_t { | |
1674 | uint8_t major_opcode; | 1667 | uint8_t major_opcode; | |
1675 | uint8_t minor_opcode; | 1668 | uint8_t minor_opcode; | |
1676 | uint16_t length; | 1669 | uint16_t length; | |
1677 | uint8_t device_id; | 1670 | uint8_t device_id; | |
1678 | uint8_t feedback_id; | 1671 | uint8_t feedback_id; | |
1679 | uint8_t feedback_class; | 1672 | uint8_t feedback_class; | |
@@ -4030,26 +4023,76 @@ typedef struct xcb_input_barrier_hit_eve | @@ -4030,26 +4023,76 @@ typedef struct xcb_input_barrier_hit_eve | |||
4030 | xcb_input_device_id_t sourceid; | 4023 | xcb_input_device_id_t sourceid; | |
4031 | uint8_t pad0[2]; | 4024 | uint8_t pad0[2]; | |
4032 | xcb_input_fp1616_t root_x; | 4025 | xcb_input_fp1616_t root_x; | |
4033 | xcb_input_fp1616_t root_y; | 4026 | xcb_input_fp1616_t root_y; | |
4034 | xcb_input_fp3232_t dx; | 4027 | xcb_input_fp3232_t dx; | |
4035 | xcb_input_fp3232_t dy; | 4028 | xcb_input_fp3232_t dy; | |
4036 | } xcb_input_barrier_hit_event_t; | 4029 | } xcb_input_barrier_hit_event_t; | |
4037 | 4030 | |||
4038 | /** Opcode for xcb_input_barrier_leave. */ | 4031 | /** Opcode for xcb_input_barrier_leave. */ | |
4039 | #define XCB_INPUT_BARRIER_LEAVE 26 | 4032 | #define XCB_INPUT_BARRIER_LEAVE 26 | |
4040 | 4033 | |||
4041 | typedef xcb_input_barrier_hit_event_t xcb_input_barrier_leave_event_t; | 4034 | typedef xcb_input_barrier_hit_event_t xcb_input_barrier_leave_event_t; | |
4042 | 4035 | |||
4036 | /** | |||
4037 | * @brief xcb_input_event_for_send_t | |||
4038 | **/ | |||
4039 | typedef union xcb_input_event_for_send_t { | |||
4040 | xcb_input_device_valuator_event_t device_valuator; | |||
4041 | xcb_input_device_key_press_event_t device_key_press; | |||
4042 | xcb_input_device_key_release_event_t device_key_release; | |||
4043 | xcb_input_device_button_press_event_t device_button_press; | |||
4044 | xcb_input_device_button_release_event_t device_button_release; | |||
4045 | xcb_input_device_motion_notify_event_t device_motion_notify; | |||
4046 | xcb_input_device_focus_in_event_t device_focus_in; | |||
4047 | xcb_input_device_focus_out_event_t device_focus_out; | |||
4048 | xcb_input_proximity_in_event_t proximity_in; | |||
4049 | xcb_input_proximity_out_event_t proximity_out; | |||
4050 | xcb_input_device_state_notify_event_t device_state_notify; | |||
4051 | xcb_input_device_mapping_notify_event_t device_mapping_notify; | |||
4052 | xcb_input_change_device_notify_event_t change_device_notify; | |||
4053 | xcb_input_device_key_state_notify_event_t device_key_state_notify; | |||
4054 | xcb_input_device_button_state_notify_event_t device_button_state_notify; | |||
4055 | xcb_input_device_presence_notify_event_t device_presence_notify; | |||
4056 | xcb_raw_generic_event_t event_header; | |||
4057 | } xcb_input_event_for_send_t; | |||
4058 | ||||
4059 | /** | |||
4060 | * @brief xcb_input_event_for_send_iterator_t | |||
4061 | **/ | |||
4062 | typedef struct xcb_input_event_for_send_iterator_t { | |||
4063 | xcb_input_event_for_send_t *data; | |||
4064 | int rem; | |||
4065 | int index; | |||
4066 | } xcb_input_event_for_send_iterator_t; | |||
4067 | ||||
4068 | /** Opcode for xcb_input_send_extension_event. */ | |||
4069 | #define XCB_INPUT_SEND_EXTENSION_EVENT 31 | |||
4070 | ||||
4071 | /** | |||
4072 | * @brief xcb_input_send_extension_event_request_t | |||
4073 | **/ | |||
4074 | typedef struct xcb_input_send_extension_event_request_t { | |||
4075 | uint8_t major_opcode; | |||
4076 | uint8_t minor_opcode; | |||
4077 | uint16_t length; | |||
4078 | xcb_window_t destination; | |||
4079 | uint8_t device_id; | |||
4080 | uint8_t propagate; | |||
4081 | uint16_t num_classes; | |||
4082 | uint8_t num_events; | |||
4083 | uint8_t pad0[3]; | |||
4084 | } xcb_input_send_extension_event_request_t; | |||
4085 | ||||
4043 | /** Opcode for xcb_input_device. */ | 4086 | /** Opcode for xcb_input_device. */ | |
4044 | #define XCB_INPUT_DEVICE 0 | 4087 | #define XCB_INPUT_DEVICE 0 | |
4045 | 4088 | |||
4046 | /** | 4089 | /** | |
4047 | * @brief xcb_input_device_error_t | 4090 | * @brief xcb_input_device_error_t | |
4048 | **/ | 4091 | **/ | |
4049 | typedef struct xcb_input_device_error_t { | 4092 | typedef struct xcb_input_device_error_t { | |
4050 | uint8_t response_type; | 4093 | uint8_t response_type; | |
4051 | uint8_t error_code; | 4094 | uint8_t error_code; | |
4052 | uint16_t sequence; | 4095 | uint16_t sequence; | |
4053 | } xcb_input_device_error_t; | 4096 | } xcb_input_device_error_t; | |
4054 | 4097 | |||
4055 | /** Opcode for xcb_input_event. */ | 4098 | /** Opcode for xcb_input_event. */ | |
@@ -4539,26 +4582,49 @@ xcb_input_list_input_devices_names_itera | @@ -4539,26 +4582,49 @@ xcb_input_list_input_devices_names_itera | |||
4539 | * The parameter @p e supplied to this function must be NULL if | 4582 | * The parameter @p e supplied to this function must be NULL if | |
4540 | * xcb_input_list_input_devices_unchecked(). is used. | 4583 | * xcb_input_list_input_devices_unchecked(). is used. | |
4541 | * Otherwise, it stores the error if any. | 4584 | * Otherwise, it stores the error if any. | |
4542 | * | 4585 | * | |
4543 | * The returned value must be freed by the caller using free(). | 4586 | * The returned value must be freed by the caller using free(). | |
4544 | */ | 4587 | */ | |
4545 | xcb_input_list_input_devices_reply_t * | 4588 | xcb_input_list_input_devices_reply_t * | |
4546 | xcb_input_list_input_devices_reply (xcb_connection_t *c, | 4589 | xcb_input_list_input_devices_reply (xcb_connection_t *c, | |
4547 | xcb_input_list_input_devices_cookie_t cookie /**< */, | 4590 | xcb_input_list_input_devices_cookie_t cookie /**< */, | |
4548 | xcb_generic_error_t **e); | 4591 | xcb_generic_error_t **e); | |
4549 | 4592 | |||
4550 | /** | 4593 | /** | |
4551 | * Get the next element of the iterator | 4594 | * Get the next element of the iterator | |
4595 | * @param i Pointer to a xcb_input_event_type_base_iterator_t | |||
4596 | * | |||
4597 | * Get the next element in the iterator. The member rem is | |||
4598 | * decreased by one. The member data points to the next | |||
4599 | * element. The member index is increased by sizeof(xcb_input_event_type_base_t) | |||
4600 | */ | |||
4601 | void | |||
4602 | xcb_input_event_type_base_next (xcb_input_event_type_base_iterator_t *i); | |||
4603 | ||||
4604 | /** | |||
4605 | * Return the iterator pointing to the last element | |||
4606 | * @param i An xcb_input_event_type_base_iterator_t | |||
4607 | * @return The iterator pointing to the last element | |||
4608 | * | |||
4609 | * Set the current element in the iterator to the last element. | |||
4610 | * The member rem is set to 0. The member data points to the | |||
4611 | * last element. | |||
4612 | */ | |||
4613 | xcb_generic_iterator_t | |||
4614 | xcb_input_event_type_base_end (xcb_input_event_type_base_iterator_t i); | |||
4615 | ||||
4616 | /** | |||
4617 | * Get the next element of the iterator | |||
4552 | * @param i Pointer to a xcb_input_input_class_info_iterator_t | 4618 | * @param i Pointer to a xcb_input_input_class_info_iterator_t | |
4553 | * | 4619 | * | |
4554 | * Get the next element in the iterator. The member rem is | 4620 | * Get the next element in the iterator. The member rem is | |
4555 | * decreased by one. The member data points to the next | 4621 | * decreased by one. The member data points to the next | |
4556 | * element. The member index is increased by sizeof(xcb_input_input_class_info_t) | 4622 | * element. The member index is increased by sizeof(xcb_input_input_class_info_t) | |
4557 | */ | 4623 | */ | |
4558 | void | 4624 | void | |
4559 | xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i); | 4625 | xcb_input_input_class_info_next (xcb_input_input_class_info_iterator_t *i); | |
4560 | 4626 | |||
4561 | /** | 4627 | /** | |
4562 | * Return the iterator pointing to the last element | 4628 | * Return the iterator pointing to the last element | |
4563 | * @param i An xcb_input_input_class_info_iterator_t | 4629 | * @param i An xcb_input_input_class_info_iterator_t | |
4564 | * @return The iterator pointing to the last element | 4630 | * @return The iterator pointing to the last element | |
@@ -6499,86 +6565,26 @@ xcb_input_query_device_state_classes_ite | @@ -6499,86 +6565,26 @@ xcb_input_query_device_state_classes_ite | |||
6499 | * Returns the reply of the request asked by | 6565 | * Returns the reply of the request asked by | |
6500 | * | 6566 | * | |
6501 | * The parameter @p e supplied to this function must be NULL if | 6567 | * The parameter @p e supplied to this function must be NULL if | |
6502 | * xcb_input_query_device_state_unchecked(). is used. | 6568 | * xcb_input_query_device_state_unchecked(). is used. | |
6503 | * Otherwise, it stores the error if any. | 6569 | * Otherwise, it stores the error if any. | |
6504 | * | 6570 | * | |
6505 | * The returned value must be freed by the caller using free(). | 6571 | * The returned value must be freed by the caller using free(). | |
6506 | */ | 6572 | */ | |
6507 | xcb_input_query_device_state_reply_t * | 6573 | xcb_input_query_device_state_reply_t * | |
6508 | xcb_input_query_device_state_reply (xcb_connection_t *c, | 6574 | xcb_input_query_device_state_reply (xcb_connection_t *c, | |
6509 | xcb_input_query_device_state_cookie_t cookie /**< */, | 6575 | xcb_input_query_device_state_cookie_t cookie /**< */, | |
6510 | xcb_generic_error_t **e); | 6576 | xcb_generic_error_t **e); | |
6511 | 6577 | |||
6512 | int | |||
6513 | xcb_input_send_extension_event_sizeof (const void *_buffer); | |||
6514 | ||||
6515 | /** | |||
6516 | * | |||
6517 | * @param c The connection | |||
6518 | * @return A cookie | |||
6519 | * | |||
6520 | * Delivers a request to the X server. | |||
6521 | * | |||
6522 | * This form can be used only if the request will not cause | |||
6523 | * a reply to be generated. Any returned error will be | |||
6524 | * saved for handling by xcb_request_check(). | |||
6525 | */ | |||
6526 | xcb_void_cookie_t | |||
6527 | xcb_input_send_extension_event_checked (xcb_connection_t *c, | |||
6528 | xcb_window_t destination, | |||
6529 | uint8_t device_id, | |||
6530 | uint8_t propagate, | |||
6531 | uint16_t num_classes, | |||
6532 | uint8_t num_events, | |||
6533 | const uint8_t *events, | |||
6534 | const xcb_input_event_class_t *classes); | |||
6535 | ||||
6536 | /** | |||
6537 | * | |||
6538 | * @param c The connection | |||
6539 | * @return A cookie | |||
6540 | * | |||
6541 | * Delivers a request to the X server. | |||
6542 | * | |||
6543 | */ | |||
6544 | xcb_void_cookie_t | |||
6545 | xcb_input_send_extension_event (xcb_connection_t *c, | |||
6546 | xcb_window_t destination, | |||
6547 | uint8_t device_id, | |||
6548 | uint8_t propagate, | |||
6549 | uint16_t num_classes, | |||
6550 | uint8_t num_events, | |||
6551 | const uint8_t *events, | |||
6552 | const xcb_input_event_class_t *classes); | |||
6553 | ||||
6554 | uint8_t * | |||
6555 | xcb_input_send_extension_event_events (const xcb_input_send_extension_event_request_t *R); | |||
6556 | ||||
6557 | int | |||
6558 | xcb_input_send_extension_event_events_length (const xcb_input_send_extension_event_request_t *R); | |||
6559 | ||||
6560 | xcb_generic_iterator_t | |||
6561 | xcb_input_send_extension_event_events_end (const xcb_input_send_extension_event_request_t *R); | |||
6562 | ||||
6563 | xcb_input_event_class_t * | |||
6564 | xcb_input_send_extension_event_classes (const xcb_input_send_extension_event_request_t *R); | |||
6565 | ||||
6566 | int | |||
6567 | xcb_input_send_extension_event_classes_length (const xcb_input_send_extension_event_request_t *R); | |||
6568 | ||||
6569 | xcb_generic_iterator_t | |||
6570 | xcb_input_send_extension_event_classes_end (const xcb_input_send_extension_event_request_t *R); | |||
6571 | ||||
6572 | /** | 6578 | /** | |
6573 | * | 6579 | * | |
6574 | * @param c The connection | 6580 | * @param c The connection | |
6575 | * @return A cookie | 6581 | * @return A cookie | |
6576 | * | 6582 | * | |
6577 | * Delivers a request to the X server. | 6583 | * Delivers a request to the X server. | |
6578 | * | 6584 | * | |
6579 | * This form can be used only if the request will not cause | 6585 | * This form can be used only if the request will not cause | |
6580 | * a reply to be generated. Any returned error will be | 6586 | * a reply to be generated. Any returned error will be | |
6581 | * saved for handling by xcb_request_check(). | 6587 | * saved for handling by xcb_request_check(). | |
6582 | */ | 6588 | */ | |
6583 | xcb_void_cookie_t | 6589 | xcb_void_cookie_t | |
6584 | xcb_input_device_bell_checked (xcb_connection_t *c, | 6590 | xcb_input_device_bell_checked (xcb_connection_t *c, | |
@@ -9458,23 +9464,106 @@ xcb_input_raw_touch_begin_axisvalues_raw | @@ -9458,23 +9464,106 @@ xcb_input_raw_touch_begin_axisvalues_raw | |||
9458 | 9464 | |||
9459 | int | 9465 | int | |
9460 | xcb_input_raw_touch_begin_axisvalues_raw_length (const xcb_input_raw_touch_begin_event_t *R); | 9466 | xcb_input_raw_touch_begin_axisvalues_raw_length (const xcb_input_raw_touch_begin_event_t *R); | |
9461 | 9467 | |||
9462 | xcb_input_fp3232_iterator_t | 9468 | xcb_input_fp3232_iterator_t | |
9463 | xcb_input_raw_touch_begin_axisvalues_raw_iterator (const xcb_input_raw_touch_begin_event_t *R); | 9469 | xcb_input_raw_touch_begin_axisvalues_raw_iterator (const xcb_input_raw_touch_begin_event_t *R); | |
9464 | 9470 | |||
9465 | int | 9471 | int | |
9466 | xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */); | 9472 | xcb_input_raw_touch_update_sizeof (const void *_buffer /**< */); | |
9467 | 9473 | |||
9468 | int | 9474 | int | |
9469 | xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */); | 9475 | xcb_input_raw_touch_end_sizeof (const void *_buffer /**< */); | |
9470 | 9476 | |||
9477 | /** | |||
9478 | * Get the next element of the iterator | |||
9479 | * @param i Pointer to a xcb_input_event_for_send_iterator_t | |||
9480 | * | |||
9481 | * Get the next element in the iterator. The member rem is | |||
9482 | * decreased by one. The member data points to the next | |||
9483 | * element. The member index is increased by sizeof(xcb_input_event_for_send_t) | |||
9484 | */ | |||
9485 | void | |||
9486 | xcb_input_event_for_send_next (xcb_input_event_for_send_iterator_t *i); | |||
9487 | ||||
9488 | /** | |||
9489 | * Return the iterator pointing to the last element | |||
9490 | * @param i An xcb_input_event_for_send_iterator_t | |||
9491 | * @return The iterator pointing to the last element | |||
9492 | * | |||
9493 | * Set the current element in the iterator to the last element. | |||
9494 | * The member rem is set to 0. The member data points to the | |||
9495 | * last element. | |||
9496 | */ | |||
9497 | xcb_generic_iterator_t | |||
9498 | xcb_input_event_for_send_end (xcb_input_event_for_send_iterator_t i); | |||
9499 | ||||
9500 | int | |||
9501 | xcb_input_send_extension_event_sizeof (const void *_buffer); | |||
9502 | ||||
9503 | /** | |||
9504 | * | |||
9505 | * @param c The connection | |||
9506 | * @return A cookie | |||
9507 | * | |||
9508 | * Delivers a request to the X server. | |||
9509 | * | |||
9510 | * This form can be used only if the request will not cause | |||
9511 | * a reply to be generated. Any returned error will be | |||
9512 | * saved for handling by xcb_request_check(). | |||
9513 | */ | |||
9514 | xcb_void_cookie_t | |||
9515 | xcb_input_send_extension_event_checked (xcb_connection_t *c, | |||
9516 | xcb_window_t destination, | |||
9517 | uint8_t device_id, | |||
9518 | uint8_t propagate, | |||
9519 | uint16_t num_classes, | |||
9520 | uint8_t num_events, | |||
9521 | const xcb_input_event_for_send_t *events, | |||
9522 | const xcb_input_event_class_t *classes); | |||
9523 | ||||
9524 | /** | |||
9525 | * | |||
9526 | * @param c The connection | |||
9527 | * @return A cookie | |||
9528 | * | |||
9529 | * Delivers a request to the X server. | |||
9530 | * | |||
9531 | */ | |||
9532 | xcb_void_cookie_t | |||
9533 | xcb_input_send_extension_event (xcb_connection_t *c, | |||
9534 | xcb_window_t destination, | |||
9535 | uint8_t device_id, | |||
9536 | uint8_t propagate, | |||
9537 | uint16_t num_classes, | |||
9538 | uint8_t num_events, | |||
9539 | const xcb_input_event_for_send_t *events, | |||
9540 | const xcb_input_event_class_t *classes); | |||
9541 | ||||
9542 | xcb_input_event_for_send_t * | |||
9543 | xcb_input_send_extension_event_events (const xcb_input_send_extension_event_request_t *R); | |||
9544 | ||||
9545 | int | |||
9546 | xcb_input_send_extension_event_events_length (const xcb_input_send_extension_event_request_t *R); | |||
9547 | ||||
9548 | xcb_input_event_for_send_iterator_t | |||
9549 | xcb_input_send_extension_event_events_iterator (const xcb_input_send_extension_event_request_t *R); | |||
9550 | ||||
9551 | xcb_input_event_class_t * | |||
9552 | xcb_input_send_extension_event_classes (const xcb_input_send_extension_event_request_t *R); | |||
9553 | ||||
9554 | int | |||
9555 | xcb_input_send_extension_event_classes_length (const xcb_input_send_extension_event_request_t *R); | |||
9556 | ||||
9557 | xcb_generic_iterator_t | |||
9558 | xcb_input_send_extension_event_classes_end (const xcb_input_send_extension_event_request_t *R); | |||
9559 | ||||
9471 | 9560 | |||
9472 | #ifdef __cplusplus | 9561 | #ifdef __cplusplus | |
9473 | } | 9562 | } | |
9474 | #endif | 9563 | #endif | |
9475 | 9564 | |||
9476 | #endif | 9565 | #endif | |
9477 | 9566 | |||
9478 | /** | 9567 | /** | |
9479 | * @} | 9568 | * @} | |
9480 | */ | 9569 | */ |
--- src/external/mit/xorg/lib/libxcb/files/xproto.c 2017/03/05 09:27:53 1.5
+++ src/external/mit/xorg/lib/libxcb/files/xproto.c 2018/03/14 06:47:28 1.6
@@ -571,38 +571,56 @@ xcb_setup_request_sizeof (const void *_ | @@ -571,38 +571,56 @@ xcb_setup_request_sizeof (const void *_ | |||
571 | unsigned int xcb_block_len = 0; | 571 | unsigned int xcb_block_len = 0; | |
572 | unsigned int xcb_pad = 0; | 572 | unsigned int xcb_pad = 0; | |
573 | unsigned int xcb_align_to = 0; | 573 | unsigned int xcb_align_to = 0; | |
574 | 574 | |||
575 | 575 | |||
576 | xcb_block_len += sizeof(xcb_setup_request_t); | 576 | xcb_block_len += sizeof(xcb_setup_request_t); | |
577 | xcb_tmp += xcb_block_len; | 577 | xcb_tmp += xcb_block_len; | |
578 | xcb_buffer_len += xcb_block_len; | 578 | xcb_buffer_len += xcb_block_len; | |
579 | xcb_block_len = 0; | 579 | xcb_block_len = 0; | |
580 | /* authorization_protocol_name */ | 580 | /* authorization_protocol_name */ | |
581 | xcb_block_len += _aux->authorization_protocol_name_len * sizeof(char); | 581 | xcb_block_len += _aux->authorization_protocol_name_len * sizeof(char); | |
582 | xcb_tmp += xcb_block_len; | 582 | xcb_tmp += xcb_block_len; | |
583 | xcb_align_to = ALIGNOF(char); | 583 | xcb_align_to = ALIGNOF(char); | |
584 | xcb_align_to = 4; | |||
585 | /* insert padding */ | |||
586 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
587 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
588 | if (0 != xcb_pad) { | |||
589 | xcb_tmp += xcb_pad; | |||
590 | xcb_pad = 0; | |||
591 | } | |||
592 | xcb_block_len = 0; | |||
584 | /* insert padding */ | 593 | /* insert padding */ | |
585 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | 594 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |
586 | xcb_buffer_len += xcb_block_len + xcb_pad; | 595 | xcb_buffer_len += xcb_block_len + xcb_pad; | |
587 | if (0 != xcb_pad) { | 596 | if (0 != xcb_pad) { | |
588 | xcb_tmp += xcb_pad; | 597 | xcb_tmp += xcb_pad; | |
589 | xcb_pad = 0; | 598 | xcb_pad = 0; | |
590 | } | 599 | } | |
591 | xcb_block_len = 0; | 600 | xcb_block_len = 0; | |
592 | /* authorization_protocol_data */ | 601 | /* authorization_protocol_data */ | |
593 | xcb_block_len += _aux->authorization_protocol_data_len * sizeof(char); | 602 | xcb_block_len += _aux->authorization_protocol_data_len * sizeof(char); | |
594 | xcb_tmp += xcb_block_len; | 603 | xcb_tmp += xcb_block_len; | |
595 | xcb_align_to = ALIGNOF(char); | 604 | xcb_align_to = ALIGNOF(char); | |
605 | xcb_align_to = 4; | |||
606 | /* insert padding */ | |||
607 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |||
608 | xcb_buffer_len += xcb_block_len + xcb_pad; | |||
609 | if (0 != xcb_pad) { | |||
610 | xcb_tmp += xcb_pad; | |||
611 | xcb_pad = 0; | |||
612 | } | |||
613 | xcb_block_len = 0; | |||
596 | /* insert padding */ | 614 | /* insert padding */ | |
597 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | 615 | xcb_pad = -xcb_block_len & (xcb_align_to - 1); | |
598 | xcb_buffer_len += xcb_block_len + xcb_pad; | 616 | xcb_buffer_len += xcb_block_len + xcb_pad; | |
599 | if (0 != xcb_pad) { | 617 | if (0 != xcb_pad) { | |
600 | xcb_tmp += xcb_pad; | 618 | xcb_tmp += xcb_pad; | |
601 | xcb_pad = 0; | 619 | xcb_pad = 0; | |
602 | } | 620 | } | |
603 | xcb_block_len = 0; | 621 | xcb_block_len = 0; | |
604 | 622 | |||
605 | return xcb_buffer_len; | 623 | return xcb_buffer_len; | |
606 | } | 624 | } | |
607 | 625 | |||
608 | char * | 626 | char * | |
@@ -621,41 +639,41 @@ xcb_generic_iterator_t | @@ -621,41 +639,41 @@ xcb_generic_iterator_t | |||
621 | xcb_setup_request_authorization_protocol_name_end (const xcb_setup_request_t *R) | 639 | xcb_setup_request_authorization_protocol_name_end (const xcb_setup_request_t *R) | |
622 | { | 640 | { | |
623 | xcb_generic_iterator_t i; | 641 | xcb_generic_iterator_t i; | |
624 | i.data = ((char *) (R + 1)) + (R->authorization_protocol_name_len); | 642 | i.data = ((char *) (R + 1)) + (R->authorization_protocol_name_len); | |
625 | i.rem = 0; | 643 | i.rem = 0; | |
626 | i.index = (char *) i.data - (char *) R; | 644 | i.index = (char *) i.data - (char *) R; | |
627 | return i; | 645 | return i; | |
628 | } | 646 | } | |
629 | 647 | |||
630 | char * | 648 | char * | |
631 | xcb_setup_request_authorization_protocol_data (const xcb_setup_request_t *R) | 649 | xcb_setup_request_authorization_protocol_data (const xcb_setup_request_t *R) | |
632 | { | 650 | { | |
633 | xcb_generic_iterator_t prev = xcb_setup_request_authorization_protocol_name_end(R); | 651 | xcb_generic_iterator_t prev = xcb_setup_request_authorization_protocol_name_end(R); | |
634 | return (char *) ((char *) prev.data + XCB_TYPE_PAD(char, prev.index) + 0); | 652 | return (char *) ((char *) prev.data + ((-prev.index) & (4 - 1)) + 0); | |
635 | } | 653 | } | |
636 | 654 | |||
637 | int | 655 | int | |
638 | xcb_setup_request_authorization_protocol_data_length (const xcb_setup_request_t *R) | 656 | xcb_setup_request_authorization_protocol_data_length (const xcb_setup_request_t *R) | |
639 | { | 657 | { | |
640 | return R->authorization_protocol_data_len; | 658 | return R->authorization_protocol_data_len; | |
641 | } | 659 | } | |
642 | 660 | |||
643 | xcb_generic_iterator_t | 661 | xcb_generic_iterator_t | |
644 | xcb_setup_request_authorization_protocol_data_end (const xcb_setup_request_t *R) | 662 | xcb_setup_request_authorization_protocol_data_end (const xcb_setup_request_t *R) | |
645 | { | 663 | { | |
646 | xcb_generic_iterator_t i; | 664 | xcb_generic_iterator_t i; | |
647 | xcb_generic_iterator_t prev = xcb_setup_request_authorization_protocol_name_end(R); | 665 | xcb_generic_iterator_t prev = xcb_setup_request_authorization_protocol_name_end(R); | |
648 | i.data = ((char *) ((char*) prev.data + XCB_TYPE_PAD(char, prev.index))) + (R->authorization_protocol_data_len); | 666 | i.data = ((char *) ((char*) prev.data + ((-prev.index) & (4 - 1)))) + (R->authorization_protocol_data_len); | |
649 | i.rem = 0; | 667 | i.rem = 0; | |
650 | i.index = (char *) i.data - (char *) R; | 668 | i.index = (char *) i.data - (char *) R; | |
651 | return i; | 669 | return i; | |
652 | } | 670 | } | |
653 | 671 | |||
654 | void | 672 | void | |
655 | xcb_setup_request_next (xcb_setup_request_iterator_t *i) | 673 | xcb_setup_request_next (xcb_setup_request_iterator_t *i) | |
656 | { | 674 | { | |
657 | xcb_setup_request_t *R = i->data; | 675 | xcb_setup_request_t *R = i->data; | |
658 | xcb_generic_iterator_t child; | 676 | xcb_generic_iterator_t child; | |
659 | child.data = (xcb_setup_request_t *)(((char *)R) + xcb_setup_request_sizeof(R)); | 677 | child.data = (xcb_setup_request_t *)(((char *)R) + xcb_setup_request_sizeof(R)); | |
660 | i->index = (char *) child.data - (char *) i->data; | 678 | i->index = (char *) child.data - (char *) i->data; | |
661 | --i->rem; | 679 | --i->rem; | |
@@ -6251,29 +6269,29 @@ xcb_set_font_path_checked (xcb_connectio | @@ -6251,29 +6269,29 @@ xcb_set_font_path_checked (xcb_connectio | |||
6251 | uint16_t font_qty, | 6269 | uint16_t font_qty, | |
6252 | const xcb_str_t *font) | 6270 | const xcb_str_t *font) | |
6253 | { | 6271 | { | |
6254 | static const xcb_protocol_request_t xcb_req = { | 6272 | static const xcb_protocol_request_t xcb_req = { | |
6255 | .count = 4, | 6273 | .count = 4, | |
6256 | .ext = 0, | 6274 | .ext = 0, | |
6257 | .opcode = XCB_SET_FONT_PATH, | 6275 | .opcode = XCB_SET_FONT_PATH, | |
6258 | .isvoid = 1 | 6276 | .isvoid = 1 | |
6259 | }; | 6277 | }; | |
6260 | 6278 | |||
6261 | struct iovec xcb_parts[6]; | 6279 | struct iovec xcb_parts[6]; | |
6262 | xcb_void_cookie_t xcb_ret; | 6280 | xcb_void_cookie_t xcb_ret; | |
6263 | xcb_set_font_path_request_t xcb_out; | 6281 | xcb_set_font_path_request_t xcb_out; | |
6264 | unsigned int i; | |||
6265 | unsigned int xcb_tmp_len; | 6282 | unsigned int xcb_tmp_len; | |
6266 | char *xcb_tmp; | 6283 | char *xcb_tmp; | |
6284 | unsigned int i; | |||
6267 | 6285 | |||
6268 | xcb_out.pad0 = 0; | 6286 | xcb_out.pad0 = 0; | |
6269 | xcb_out.font_qty = font_qty; | 6287 | xcb_out.font_qty = font_qty; | |
6270 | memset(xcb_out.pad1, 0, 2); | 6288 | memset(xcb_out.pad1, 0, 2); | |
6271 | 6289 | |||
6272 | xcb_parts[2].iov_base = (char *) &xcb_out; | 6290 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
6273 | xcb_parts[2].iov_len = sizeof(xcb_out); | 6291 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
6274 | xcb_parts[3].iov_base = 0; | 6292 | xcb_parts[3].iov_base = 0; | |
6275 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 6293 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
6276 | /* xcb_str_t font */ | 6294 | /* xcb_str_t font */ | |
6277 | xcb_parts[4].iov_base = (char *) font; | 6295 | xcb_parts[4].iov_base = (char *) font; | |
6278 | xcb_parts[4].iov_len = 0; | 6296 | xcb_parts[4].iov_len = 0; | |
6279 | xcb_tmp = (char *)font; | 6297 | xcb_tmp = (char *)font; | |
@@ -6294,29 +6312,29 @@ xcb_set_font_path (xcb_connection_t *c, | @@ -6294,29 +6312,29 @@ xcb_set_font_path (xcb_connection_t *c, | |||
6294 | uint16_t font_qty, | 6312 | uint16_t font_qty, | |
6295 | const xcb_str_t *font) | 6313 | const xcb_str_t *font) | |
6296 | { | 6314 | { | |
6297 | static const xcb_protocol_request_t xcb_req = { | 6315 | static const xcb_protocol_request_t xcb_req = { | |
6298 | .count = 4, | 6316 | .count = 4, | |
6299 | .ext = 0, | 6317 | .ext = 0, | |
6300 | .opcode = XCB_SET_FONT_PATH, | 6318 | .opcode = XCB_SET_FONT_PATH, | |
6301 | .isvoid = 1 | 6319 | .isvoid = 1 | |
6302 | }; | 6320 | }; | |
6303 | 6321 | |||
6304 | struct iovec xcb_parts[6]; | 6322 | struct iovec xcb_parts[6]; | |
6305 | xcb_void_cookie_t xcb_ret; | 6323 | xcb_void_cookie_t xcb_ret; | |
6306 | xcb_set_font_path_request_t xcb_out; | 6324 | xcb_set_font_path_request_t xcb_out; | |
6307 | unsigned int i; | |||
6308 | unsigned int xcb_tmp_len; | 6325 | unsigned int xcb_tmp_len; | |
6309 | char *xcb_tmp; | 6326 | char *xcb_tmp; | |
6327 | unsigned int i; | |||
6310 | 6328 | |||
6311 | xcb_out.pad0 = 0; | 6329 | xcb_out.pad0 = 0; | |
6312 | xcb_out.font_qty = font_qty; | 6330 | xcb_out.font_qty = font_qty; | |
6313 | memset(xcb_out.pad1, 0, 2); | 6331 | memset(xcb_out.pad1, 0, 2); | |
6314 | 6332 | |||
6315 | xcb_parts[2].iov_base = (char *) &xcb_out; | 6333 | xcb_parts[2].iov_base = (char *) &xcb_out; | |
6316 | xcb_parts[2].iov_len = sizeof(xcb_out); | 6334 | xcb_parts[2].iov_len = sizeof(xcb_out); | |
6317 | xcb_parts[3].iov_base = 0; | 6335 | xcb_parts[3].iov_base = 0; | |
6318 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | 6336 | xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; | |
6319 | /* xcb_str_t font */ | 6337 | /* xcb_str_t font */ | |
6320 | xcb_parts[4].iov_base = (char *) font; | 6338 | xcb_parts[4].iov_base = (char *) font; | |
6321 | xcb_parts[4].iov_len = 0; | 6339 | xcb_parts[4].iov_len = 0; | |
6322 | xcb_tmp = (char *)font; | 6340 | xcb_tmp = (char *)font; |