annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/xcb/shm.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /*
jpayne@69 2 * This file generated automatically from shm.xml by c_client.py.
jpayne@69 3 * Edit at your peril.
jpayne@69 4 */
jpayne@69 5
jpayne@69 6 /**
jpayne@69 7 * @defgroup XCB_Shm_API XCB Shm API
jpayne@69 8 * @brief Shm XCB Protocol Implementation.
jpayne@69 9 * @{
jpayne@69 10 **/
jpayne@69 11
jpayne@69 12 #ifndef __SHM_H
jpayne@69 13 #define __SHM_H
jpayne@69 14
jpayne@69 15 #include "xcb.h"
jpayne@69 16 #include "xproto.h"
jpayne@69 17
jpayne@69 18 #ifdef __cplusplus
jpayne@69 19 extern "C" {
jpayne@69 20 #endif
jpayne@69 21
jpayne@69 22 #define XCB_SHM_MAJOR_VERSION 1
jpayne@69 23 #define XCB_SHM_MINOR_VERSION 2
jpayne@69 24
jpayne@69 25 extern xcb_extension_t xcb_shm_id;
jpayne@69 26
jpayne@69 27 typedef uint32_t xcb_shm_seg_t;
jpayne@69 28
jpayne@69 29 /**
jpayne@69 30 * @brief xcb_shm_seg_iterator_t
jpayne@69 31 **/
jpayne@69 32 typedef struct xcb_shm_seg_iterator_t {
jpayne@69 33 xcb_shm_seg_t *data;
jpayne@69 34 int rem;
jpayne@69 35 int index;
jpayne@69 36 } xcb_shm_seg_iterator_t;
jpayne@69 37
jpayne@69 38 /** Opcode for xcb_shm_completion. */
jpayne@69 39 #define XCB_SHM_COMPLETION 0
jpayne@69 40
jpayne@69 41 /**
jpayne@69 42 * @brief xcb_shm_completion_event_t
jpayne@69 43 **/
jpayne@69 44 typedef struct xcb_shm_completion_event_t {
jpayne@69 45 uint8_t response_type;
jpayne@69 46 uint8_t pad0;
jpayne@69 47 uint16_t sequence;
jpayne@69 48 xcb_drawable_t drawable;
jpayne@69 49 uint16_t minor_event;
jpayne@69 50 uint8_t major_event;
jpayne@69 51 uint8_t pad1;
jpayne@69 52 xcb_shm_seg_t shmseg;
jpayne@69 53 uint32_t offset;
jpayne@69 54 } xcb_shm_completion_event_t;
jpayne@69 55
jpayne@69 56 /** Opcode for xcb_shm_bad_seg. */
jpayne@69 57 #define XCB_SHM_BAD_SEG 0
jpayne@69 58
jpayne@69 59 typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
jpayne@69 60
jpayne@69 61 /**
jpayne@69 62 * @brief xcb_shm_query_version_cookie_t
jpayne@69 63 **/
jpayne@69 64 typedef struct xcb_shm_query_version_cookie_t {
jpayne@69 65 unsigned int sequence;
jpayne@69 66 } xcb_shm_query_version_cookie_t;
jpayne@69 67
jpayne@69 68 /** Opcode for xcb_shm_query_version. */
jpayne@69 69 #define XCB_SHM_QUERY_VERSION 0
jpayne@69 70
jpayne@69 71 /**
jpayne@69 72 * @brief xcb_shm_query_version_request_t
jpayne@69 73 **/
jpayne@69 74 typedef struct xcb_shm_query_version_request_t {
jpayne@69 75 uint8_t major_opcode;
jpayne@69 76 uint8_t minor_opcode;
jpayne@69 77 uint16_t length;
jpayne@69 78 } xcb_shm_query_version_request_t;
jpayne@69 79
jpayne@69 80 /**
jpayne@69 81 * @brief xcb_shm_query_version_reply_t
jpayne@69 82 **/
jpayne@69 83 typedef struct xcb_shm_query_version_reply_t {
jpayne@69 84 uint8_t response_type;
jpayne@69 85 uint8_t shared_pixmaps;
jpayne@69 86 uint16_t sequence;
jpayne@69 87 uint32_t length;
jpayne@69 88 uint16_t major_version;
jpayne@69 89 uint16_t minor_version;
jpayne@69 90 uint16_t uid;
jpayne@69 91 uint16_t gid;
jpayne@69 92 uint8_t pixmap_format;
jpayne@69 93 uint8_t pad0[15];
jpayne@69 94 } xcb_shm_query_version_reply_t;
jpayne@69 95
jpayne@69 96 /** Opcode for xcb_shm_attach. */
jpayne@69 97 #define XCB_SHM_ATTACH 1
jpayne@69 98
jpayne@69 99 /**
jpayne@69 100 * @brief xcb_shm_attach_request_t
jpayne@69 101 **/
jpayne@69 102 typedef struct xcb_shm_attach_request_t {
jpayne@69 103 uint8_t major_opcode;
jpayne@69 104 uint8_t minor_opcode;
jpayne@69 105 uint16_t length;
jpayne@69 106 xcb_shm_seg_t shmseg;
jpayne@69 107 uint32_t shmid;
jpayne@69 108 uint8_t read_only;
jpayne@69 109 uint8_t pad0[3];
jpayne@69 110 } xcb_shm_attach_request_t;
jpayne@69 111
jpayne@69 112 /** Opcode for xcb_shm_detach. */
jpayne@69 113 #define XCB_SHM_DETACH 2
jpayne@69 114
jpayne@69 115 /**
jpayne@69 116 * @brief xcb_shm_detach_request_t
jpayne@69 117 **/
jpayne@69 118 typedef struct xcb_shm_detach_request_t {
jpayne@69 119 uint8_t major_opcode;
jpayne@69 120 uint8_t minor_opcode;
jpayne@69 121 uint16_t length;
jpayne@69 122 xcb_shm_seg_t shmseg;
jpayne@69 123 } xcb_shm_detach_request_t;
jpayne@69 124
jpayne@69 125 /** Opcode for xcb_shm_put_image. */
jpayne@69 126 #define XCB_SHM_PUT_IMAGE 3
jpayne@69 127
jpayne@69 128 /**
jpayne@69 129 * @brief xcb_shm_put_image_request_t
jpayne@69 130 **/
jpayne@69 131 typedef struct xcb_shm_put_image_request_t {
jpayne@69 132 uint8_t major_opcode;
jpayne@69 133 uint8_t minor_opcode;
jpayne@69 134 uint16_t length;
jpayne@69 135 xcb_drawable_t drawable;
jpayne@69 136 xcb_gcontext_t gc;
jpayne@69 137 uint16_t total_width;
jpayne@69 138 uint16_t total_height;
jpayne@69 139 uint16_t src_x;
jpayne@69 140 uint16_t src_y;
jpayne@69 141 uint16_t src_width;
jpayne@69 142 uint16_t src_height;
jpayne@69 143 int16_t dst_x;
jpayne@69 144 int16_t dst_y;
jpayne@69 145 uint8_t depth;
jpayne@69 146 uint8_t format;
jpayne@69 147 uint8_t send_event;
jpayne@69 148 uint8_t pad0;
jpayne@69 149 xcb_shm_seg_t shmseg;
jpayne@69 150 uint32_t offset;
jpayne@69 151 } xcb_shm_put_image_request_t;
jpayne@69 152
jpayne@69 153 /**
jpayne@69 154 * @brief xcb_shm_get_image_cookie_t
jpayne@69 155 **/
jpayne@69 156 typedef struct xcb_shm_get_image_cookie_t {
jpayne@69 157 unsigned int sequence;
jpayne@69 158 } xcb_shm_get_image_cookie_t;
jpayne@69 159
jpayne@69 160 /** Opcode for xcb_shm_get_image. */
jpayne@69 161 #define XCB_SHM_GET_IMAGE 4
jpayne@69 162
jpayne@69 163 /**
jpayne@69 164 * @brief xcb_shm_get_image_request_t
jpayne@69 165 **/
jpayne@69 166 typedef struct xcb_shm_get_image_request_t {
jpayne@69 167 uint8_t major_opcode;
jpayne@69 168 uint8_t minor_opcode;
jpayne@69 169 uint16_t length;
jpayne@69 170 xcb_drawable_t drawable;
jpayne@69 171 int16_t x;
jpayne@69 172 int16_t y;
jpayne@69 173 uint16_t width;
jpayne@69 174 uint16_t height;
jpayne@69 175 uint32_t plane_mask;
jpayne@69 176 uint8_t format;
jpayne@69 177 uint8_t pad0[3];
jpayne@69 178 xcb_shm_seg_t shmseg;
jpayne@69 179 uint32_t offset;
jpayne@69 180 } xcb_shm_get_image_request_t;
jpayne@69 181
jpayne@69 182 /**
jpayne@69 183 * @brief xcb_shm_get_image_reply_t
jpayne@69 184 **/
jpayne@69 185 typedef struct xcb_shm_get_image_reply_t {
jpayne@69 186 uint8_t response_type;
jpayne@69 187 uint8_t depth;
jpayne@69 188 uint16_t sequence;
jpayne@69 189 uint32_t length;
jpayne@69 190 xcb_visualid_t visual;
jpayne@69 191 uint32_t size;
jpayne@69 192 } xcb_shm_get_image_reply_t;
jpayne@69 193
jpayne@69 194 /** Opcode for xcb_shm_create_pixmap. */
jpayne@69 195 #define XCB_SHM_CREATE_PIXMAP 5
jpayne@69 196
jpayne@69 197 /**
jpayne@69 198 * @brief xcb_shm_create_pixmap_request_t
jpayne@69 199 **/
jpayne@69 200 typedef struct xcb_shm_create_pixmap_request_t {
jpayne@69 201 uint8_t major_opcode;
jpayne@69 202 uint8_t minor_opcode;
jpayne@69 203 uint16_t length;
jpayne@69 204 xcb_pixmap_t pid;
jpayne@69 205 xcb_drawable_t drawable;
jpayne@69 206 uint16_t width;
jpayne@69 207 uint16_t height;
jpayne@69 208 uint8_t depth;
jpayne@69 209 uint8_t pad0[3];
jpayne@69 210 xcb_shm_seg_t shmseg;
jpayne@69 211 uint32_t offset;
jpayne@69 212 } xcb_shm_create_pixmap_request_t;
jpayne@69 213
jpayne@69 214 /** Opcode for xcb_shm_attach_fd. */
jpayne@69 215 #define XCB_SHM_ATTACH_FD 6
jpayne@69 216
jpayne@69 217 /**
jpayne@69 218 * @brief xcb_shm_attach_fd_request_t
jpayne@69 219 **/
jpayne@69 220 typedef struct xcb_shm_attach_fd_request_t {
jpayne@69 221 uint8_t major_opcode;
jpayne@69 222 uint8_t minor_opcode;
jpayne@69 223 uint16_t length;
jpayne@69 224 xcb_shm_seg_t shmseg;
jpayne@69 225 uint8_t read_only;
jpayne@69 226 uint8_t pad0[3];
jpayne@69 227 } xcb_shm_attach_fd_request_t;
jpayne@69 228
jpayne@69 229 /**
jpayne@69 230 * @brief xcb_shm_create_segment_cookie_t
jpayne@69 231 **/
jpayne@69 232 typedef struct xcb_shm_create_segment_cookie_t {
jpayne@69 233 unsigned int sequence;
jpayne@69 234 } xcb_shm_create_segment_cookie_t;
jpayne@69 235
jpayne@69 236 /** Opcode for xcb_shm_create_segment. */
jpayne@69 237 #define XCB_SHM_CREATE_SEGMENT 7
jpayne@69 238
jpayne@69 239 /**
jpayne@69 240 * @brief xcb_shm_create_segment_request_t
jpayne@69 241 **/
jpayne@69 242 typedef struct xcb_shm_create_segment_request_t {
jpayne@69 243 uint8_t major_opcode;
jpayne@69 244 uint8_t minor_opcode;
jpayne@69 245 uint16_t length;
jpayne@69 246 xcb_shm_seg_t shmseg;
jpayne@69 247 uint32_t size;
jpayne@69 248 uint8_t read_only;
jpayne@69 249 uint8_t pad0[3];
jpayne@69 250 } xcb_shm_create_segment_request_t;
jpayne@69 251
jpayne@69 252 /**
jpayne@69 253 * @brief xcb_shm_create_segment_reply_t
jpayne@69 254 **/
jpayne@69 255 typedef struct xcb_shm_create_segment_reply_t {
jpayne@69 256 uint8_t response_type;
jpayne@69 257 uint8_t nfd;
jpayne@69 258 uint16_t sequence;
jpayne@69 259 uint32_t length;
jpayne@69 260 uint8_t pad0[24];
jpayne@69 261 } xcb_shm_create_segment_reply_t;
jpayne@69 262
jpayne@69 263 /**
jpayne@69 264 * Get the next element of the iterator
jpayne@69 265 * @param i Pointer to a xcb_shm_seg_iterator_t
jpayne@69 266 *
jpayne@69 267 * Get the next element in the iterator. The member rem is
jpayne@69 268 * decreased by one. The member data points to the next
jpayne@69 269 * element. The member index is increased by sizeof(xcb_shm_seg_t)
jpayne@69 270 */
jpayne@69 271 void
jpayne@69 272 xcb_shm_seg_next (xcb_shm_seg_iterator_t *i);
jpayne@69 273
jpayne@69 274 /**
jpayne@69 275 * Return the iterator pointing to the last element
jpayne@69 276 * @param i An xcb_shm_seg_iterator_t
jpayne@69 277 * @return The iterator pointing to the last element
jpayne@69 278 *
jpayne@69 279 * Set the current element in the iterator to the last element.
jpayne@69 280 * The member rem is set to 0. The member data points to the
jpayne@69 281 * last element.
jpayne@69 282 */
jpayne@69 283 xcb_generic_iterator_t
jpayne@69 284 xcb_shm_seg_end (xcb_shm_seg_iterator_t i);
jpayne@69 285
jpayne@69 286 /**
jpayne@69 287 * @brief Query the version of the MIT-SHM extension.
jpayne@69 288 *
jpayne@69 289 * @param c The connection
jpayne@69 290 * @return A cookie
jpayne@69 291 *
jpayne@69 292 * This is used to determine the version of the MIT-SHM extension supported by the
jpayne@69 293 * X server. Clients MUST NOT make other requests in this extension until a reply
jpayne@69 294 * to this requests indicates the X server supports them.
jpayne@69 295 *
jpayne@69 296 */
jpayne@69 297 xcb_shm_query_version_cookie_t
jpayne@69 298 xcb_shm_query_version (xcb_connection_t *c);
jpayne@69 299
jpayne@69 300 /**
jpayne@69 301 * @brief Query the version of the MIT-SHM extension.
jpayne@69 302 *
jpayne@69 303 * @param c The connection
jpayne@69 304 * @return A cookie
jpayne@69 305 *
jpayne@69 306 * This is used to determine the version of the MIT-SHM extension supported by the
jpayne@69 307 * X server. Clients MUST NOT make other requests in this extension until a reply
jpayne@69 308 * to this requests indicates the X server supports them.
jpayne@69 309 *
jpayne@69 310 * This form can be used only if the request will cause
jpayne@69 311 * a reply to be generated. Any returned error will be
jpayne@69 312 * placed in the event queue.
jpayne@69 313 */
jpayne@69 314 xcb_shm_query_version_cookie_t
jpayne@69 315 xcb_shm_query_version_unchecked (xcb_connection_t *c);
jpayne@69 316
jpayne@69 317 /**
jpayne@69 318 * Return the reply
jpayne@69 319 * @param c The connection
jpayne@69 320 * @param cookie The cookie
jpayne@69 321 * @param e The xcb_generic_error_t supplied
jpayne@69 322 *
jpayne@69 323 * Returns the reply of the request asked by
jpayne@69 324 *
jpayne@69 325 * The parameter @p e supplied to this function must be NULL if
jpayne@69 326 * xcb_shm_query_version_unchecked(). is used.
jpayne@69 327 * Otherwise, it stores the error if any.
jpayne@69 328 *
jpayne@69 329 * The returned value must be freed by the caller using free().
jpayne@69 330 */
jpayne@69 331 xcb_shm_query_version_reply_t *
jpayne@69 332 xcb_shm_query_version_reply (xcb_connection_t *c,
jpayne@69 333 xcb_shm_query_version_cookie_t cookie /**< */,
jpayne@69 334 xcb_generic_error_t **e);
jpayne@69 335
jpayne@69 336 /**
jpayne@69 337 * @brief Attach a System V shared memory segment.
jpayne@69 338 *
jpayne@69 339 * @param c The connection
jpayne@69 340 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 341 * @param shmid The System V shared memory segment the server should map.
jpayne@69 342 * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false.
jpayne@69 343 * @return A cookie
jpayne@69 344 *
jpayne@69 345 * Attach a System V shared memory segment to the server. This will fail unless
jpayne@69 346 * the server has permission to map the segment. The client may destroy the segment
jpayne@69 347 * as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this
jpayne@69 348 * request and with the appropriate serial number.
jpayne@69 349 *
jpayne@69 350 * This form can be used only if the request will not cause
jpayne@69 351 * a reply to be generated. Any returned error will be
jpayne@69 352 * saved for handling by xcb_request_check().
jpayne@69 353 */
jpayne@69 354 xcb_void_cookie_t
jpayne@69 355 xcb_shm_attach_checked (xcb_connection_t *c,
jpayne@69 356 xcb_shm_seg_t shmseg,
jpayne@69 357 uint32_t shmid,
jpayne@69 358 uint8_t read_only);
jpayne@69 359
jpayne@69 360 /**
jpayne@69 361 * @brief Attach a System V shared memory segment.
jpayne@69 362 *
jpayne@69 363 * @param c The connection
jpayne@69 364 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 365 * @param shmid The System V shared memory segment the server should map.
jpayne@69 366 * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false.
jpayne@69 367 * @return A cookie
jpayne@69 368 *
jpayne@69 369 * Attach a System V shared memory segment to the server. This will fail unless
jpayne@69 370 * the server has permission to map the segment. The client may destroy the segment
jpayne@69 371 * as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this
jpayne@69 372 * request and with the appropriate serial number.
jpayne@69 373 *
jpayne@69 374 */
jpayne@69 375 xcb_void_cookie_t
jpayne@69 376 xcb_shm_attach (xcb_connection_t *c,
jpayne@69 377 xcb_shm_seg_t shmseg,
jpayne@69 378 uint32_t shmid,
jpayne@69 379 uint8_t read_only);
jpayne@69 380
jpayne@69 381 /**
jpayne@69 382 * @brief Destroys the specified shared memory segment.
jpayne@69 383 *
jpayne@69 384 * @param c The connection
jpayne@69 385 * @param shmseg The segment to be destroyed.
jpayne@69 386 * @return A cookie
jpayne@69 387 *
jpayne@69 388 * Destroys the specified shared memory segment. This will never fail unless the
jpayne@69 389 * segment number is incorrect.
jpayne@69 390 *
jpayne@69 391 * This form can be used only if the request will not cause
jpayne@69 392 * a reply to be generated. Any returned error will be
jpayne@69 393 * saved for handling by xcb_request_check().
jpayne@69 394 */
jpayne@69 395 xcb_void_cookie_t
jpayne@69 396 xcb_shm_detach_checked (xcb_connection_t *c,
jpayne@69 397 xcb_shm_seg_t shmseg);
jpayne@69 398
jpayne@69 399 /**
jpayne@69 400 * @brief Destroys the specified shared memory segment.
jpayne@69 401 *
jpayne@69 402 * @param c The connection
jpayne@69 403 * @param shmseg The segment to be destroyed.
jpayne@69 404 * @return A cookie
jpayne@69 405 *
jpayne@69 406 * Destroys the specified shared memory segment. This will never fail unless the
jpayne@69 407 * segment number is incorrect.
jpayne@69 408 *
jpayne@69 409 */
jpayne@69 410 xcb_void_cookie_t
jpayne@69 411 xcb_shm_detach (xcb_connection_t *c,
jpayne@69 412 xcb_shm_seg_t shmseg);
jpayne@69 413
jpayne@69 414 /**
jpayne@69 415 * @brief Copy data from the shared memory to the specified drawable.
jpayne@69 416 *
jpayne@69 417 * @param c The connection
jpayne@69 418 * @param drawable The drawable to draw to.
jpayne@69 419 * @param gc The graphics context to use.
jpayne@69 420 * @param total_width The total width of the source image.
jpayne@69 421 * @param total_height The total height of the source image.
jpayne@69 422 * @param src_x The source X coordinate of the sub-image to copy.
jpayne@69 423 * @param src_y The source Y coordinate of the sub-image to copy.
jpayne@69 424 * @param src_width The width, in source image coordinates, of the data to copy from the source.
jpayne@69 425 * The X server will use this to determine the amount of data to copy. The amount
jpayne@69 426 * of the destination image that is overwritten is determined automatically.
jpayne@69 427 * @param src_height The height, in source image coordinates, of the data to copy from the source.
jpayne@69 428 * The X server will use this to determine the amount of data to copy. The amount
jpayne@69 429 * of the destination image that is overwritten is determined automatically.
jpayne@69 430 * @param dst_x The X coordinate on the destination drawable to copy to.
jpayne@69 431 * @param dst_y The Y coordinate on the destination drawable to copy to.
jpayne@69 432 * @param depth The depth to use.
jpayne@69 433 * @param format The format of the image being drawn. If it is XYBitmap, depth must be 1, or a
jpayne@69 434 * "BadMatch" error results. The foreground pixel in the GC determines the source
jpayne@69 435 * for the one bits in the image, and the background pixel determines the source
jpayne@69 436 * for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of
jpayne@69 437 * the drawable, or a "BadMatch" error results.
jpayne@69 438 * @param send_event True if the server should send an XCB_SHM_COMPLETION event when the blit
jpayne@69 439 * completes.
jpayne@69 440 * @param offset The offset that the source image starts at.
jpayne@69 441 * @return A cookie
jpayne@69 442 *
jpayne@69 443 * Copy data from the shared memory to the specified drawable. The amount of bytes
jpayne@69 444 * written to the destination image is always equal to the number of bytes read
jpayne@69 445 * from the shared memory segment.
jpayne@69 446 *
jpayne@69 447 * This form can be used only if the request will not cause
jpayne@69 448 * a reply to be generated. Any returned error will be
jpayne@69 449 * saved for handling by xcb_request_check().
jpayne@69 450 */
jpayne@69 451 xcb_void_cookie_t
jpayne@69 452 xcb_shm_put_image_checked (xcb_connection_t *c,
jpayne@69 453 xcb_drawable_t drawable,
jpayne@69 454 xcb_gcontext_t gc,
jpayne@69 455 uint16_t total_width,
jpayne@69 456 uint16_t total_height,
jpayne@69 457 uint16_t src_x,
jpayne@69 458 uint16_t src_y,
jpayne@69 459 uint16_t src_width,
jpayne@69 460 uint16_t src_height,
jpayne@69 461 int16_t dst_x,
jpayne@69 462 int16_t dst_y,
jpayne@69 463 uint8_t depth,
jpayne@69 464 uint8_t format,
jpayne@69 465 uint8_t send_event,
jpayne@69 466 xcb_shm_seg_t shmseg,
jpayne@69 467 uint32_t offset);
jpayne@69 468
jpayne@69 469 /**
jpayne@69 470 * @brief Copy data from the shared memory to the specified drawable.
jpayne@69 471 *
jpayne@69 472 * @param c The connection
jpayne@69 473 * @param drawable The drawable to draw to.
jpayne@69 474 * @param gc The graphics context to use.
jpayne@69 475 * @param total_width The total width of the source image.
jpayne@69 476 * @param total_height The total height of the source image.
jpayne@69 477 * @param src_x The source X coordinate of the sub-image to copy.
jpayne@69 478 * @param src_y The source Y coordinate of the sub-image to copy.
jpayne@69 479 * @param src_width The width, in source image coordinates, of the data to copy from the source.
jpayne@69 480 * The X server will use this to determine the amount of data to copy. The amount
jpayne@69 481 * of the destination image that is overwritten is determined automatically.
jpayne@69 482 * @param src_height The height, in source image coordinates, of the data to copy from the source.
jpayne@69 483 * The X server will use this to determine the amount of data to copy. The amount
jpayne@69 484 * of the destination image that is overwritten is determined automatically.
jpayne@69 485 * @param dst_x The X coordinate on the destination drawable to copy to.
jpayne@69 486 * @param dst_y The Y coordinate on the destination drawable to copy to.
jpayne@69 487 * @param depth The depth to use.
jpayne@69 488 * @param format The format of the image being drawn. If it is XYBitmap, depth must be 1, or a
jpayne@69 489 * "BadMatch" error results. The foreground pixel in the GC determines the source
jpayne@69 490 * for the one bits in the image, and the background pixel determines the source
jpayne@69 491 * for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of
jpayne@69 492 * the drawable, or a "BadMatch" error results.
jpayne@69 493 * @param send_event True if the server should send an XCB_SHM_COMPLETION event when the blit
jpayne@69 494 * completes.
jpayne@69 495 * @param offset The offset that the source image starts at.
jpayne@69 496 * @return A cookie
jpayne@69 497 *
jpayne@69 498 * Copy data from the shared memory to the specified drawable. The amount of bytes
jpayne@69 499 * written to the destination image is always equal to the number of bytes read
jpayne@69 500 * from the shared memory segment.
jpayne@69 501 *
jpayne@69 502 */
jpayne@69 503 xcb_void_cookie_t
jpayne@69 504 xcb_shm_put_image (xcb_connection_t *c,
jpayne@69 505 xcb_drawable_t drawable,
jpayne@69 506 xcb_gcontext_t gc,
jpayne@69 507 uint16_t total_width,
jpayne@69 508 uint16_t total_height,
jpayne@69 509 uint16_t src_x,
jpayne@69 510 uint16_t src_y,
jpayne@69 511 uint16_t src_width,
jpayne@69 512 uint16_t src_height,
jpayne@69 513 int16_t dst_x,
jpayne@69 514 int16_t dst_y,
jpayne@69 515 uint8_t depth,
jpayne@69 516 uint8_t format,
jpayne@69 517 uint8_t send_event,
jpayne@69 518 xcb_shm_seg_t shmseg,
jpayne@69 519 uint32_t offset);
jpayne@69 520
jpayne@69 521 /**
jpayne@69 522 * @brief Copies data from the specified drawable to the shared memory segment.
jpayne@69 523 *
jpayne@69 524 * @param c The connection
jpayne@69 525 * @param drawable The drawable to copy the image out of.
jpayne@69 526 * @param x The X coordinate in the drawable to begin copying at.
jpayne@69 527 * @param y The Y coordinate in the drawable to begin copying at.
jpayne@69 528 * @param width The width of the image to copy.
jpayne@69 529 * @param height The height of the image to copy.
jpayne@69 530 * @param plane_mask A mask that determines which planes are used.
jpayne@69 531 * @param format The format to use for the copy (???).
jpayne@69 532 * @param shmseg The destination shared memory segment.
jpayne@69 533 * @param offset The offset in the shared memory segment to copy data to.
jpayne@69 534 * @return A cookie
jpayne@69 535 *
jpayne@69 536 * Copy data from the specified drawable to the shared memory segment. The amount
jpayne@69 537 * of bytes written to the destination image is always equal to the number of bytes
jpayne@69 538 * read from the shared memory segment.
jpayne@69 539 *
jpayne@69 540 */
jpayne@69 541 xcb_shm_get_image_cookie_t
jpayne@69 542 xcb_shm_get_image (xcb_connection_t *c,
jpayne@69 543 xcb_drawable_t drawable,
jpayne@69 544 int16_t x,
jpayne@69 545 int16_t y,
jpayne@69 546 uint16_t width,
jpayne@69 547 uint16_t height,
jpayne@69 548 uint32_t plane_mask,
jpayne@69 549 uint8_t format,
jpayne@69 550 xcb_shm_seg_t shmseg,
jpayne@69 551 uint32_t offset);
jpayne@69 552
jpayne@69 553 /**
jpayne@69 554 * @brief Copies data from the specified drawable to the shared memory segment.
jpayne@69 555 *
jpayne@69 556 * @param c The connection
jpayne@69 557 * @param drawable The drawable to copy the image out of.
jpayne@69 558 * @param x The X coordinate in the drawable to begin copying at.
jpayne@69 559 * @param y The Y coordinate in the drawable to begin copying at.
jpayne@69 560 * @param width The width of the image to copy.
jpayne@69 561 * @param height The height of the image to copy.
jpayne@69 562 * @param plane_mask A mask that determines which planes are used.
jpayne@69 563 * @param format The format to use for the copy (???).
jpayne@69 564 * @param shmseg The destination shared memory segment.
jpayne@69 565 * @param offset The offset in the shared memory segment to copy data to.
jpayne@69 566 * @return A cookie
jpayne@69 567 *
jpayne@69 568 * Copy data from the specified drawable to the shared memory segment. The amount
jpayne@69 569 * of bytes written to the destination image is always equal to the number of bytes
jpayne@69 570 * read from the shared memory segment.
jpayne@69 571 *
jpayne@69 572 * This form can be used only if the request will cause
jpayne@69 573 * a reply to be generated. Any returned error will be
jpayne@69 574 * placed in the event queue.
jpayne@69 575 */
jpayne@69 576 xcb_shm_get_image_cookie_t
jpayne@69 577 xcb_shm_get_image_unchecked (xcb_connection_t *c,
jpayne@69 578 xcb_drawable_t drawable,
jpayne@69 579 int16_t x,
jpayne@69 580 int16_t y,
jpayne@69 581 uint16_t width,
jpayne@69 582 uint16_t height,
jpayne@69 583 uint32_t plane_mask,
jpayne@69 584 uint8_t format,
jpayne@69 585 xcb_shm_seg_t shmseg,
jpayne@69 586 uint32_t offset);
jpayne@69 587
jpayne@69 588 /**
jpayne@69 589 * Return the reply
jpayne@69 590 * @param c The connection
jpayne@69 591 * @param cookie The cookie
jpayne@69 592 * @param e The xcb_generic_error_t supplied
jpayne@69 593 *
jpayne@69 594 * Returns the reply of the request asked by
jpayne@69 595 *
jpayne@69 596 * The parameter @p e supplied to this function must be NULL if
jpayne@69 597 * xcb_shm_get_image_unchecked(). is used.
jpayne@69 598 * Otherwise, it stores the error if any.
jpayne@69 599 *
jpayne@69 600 * The returned value must be freed by the caller using free().
jpayne@69 601 */
jpayne@69 602 xcb_shm_get_image_reply_t *
jpayne@69 603 xcb_shm_get_image_reply (xcb_connection_t *c,
jpayne@69 604 xcb_shm_get_image_cookie_t cookie /**< */,
jpayne@69 605 xcb_generic_error_t **e);
jpayne@69 606
jpayne@69 607 /**
jpayne@69 608 * @brief Create a pixmap backed by shared memory.
jpayne@69 609 *
jpayne@69 610 * @param c The connection
jpayne@69 611 * @param pid A pixmap ID created with xcb_generate_id().
jpayne@69 612 * @param drawable The drawable to create the pixmap in.
jpayne@69 613 * @param width The width of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 614 * @param height The height of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 615 * @param depth The depth of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 616 * @param shmseg The shared memory segment to use to create the pixmap.
jpayne@69 617 * @param offset The offset in the segment to create the pixmap at.
jpayne@69 618 * @return A cookie
jpayne@69 619 *
jpayne@69 620 * Create a pixmap backed by shared memory. Writes to the shared memory will be
jpayne@69 621 * reflected in the contents of the pixmap, and writes to the pixmap will be
jpayne@69 622 * reflected in the contents of the shared memory.
jpayne@69 623 *
jpayne@69 624 * This form can be used only if the request will not cause
jpayne@69 625 * a reply to be generated. Any returned error will be
jpayne@69 626 * saved for handling by xcb_request_check().
jpayne@69 627 */
jpayne@69 628 xcb_void_cookie_t
jpayne@69 629 xcb_shm_create_pixmap_checked (xcb_connection_t *c,
jpayne@69 630 xcb_pixmap_t pid,
jpayne@69 631 xcb_drawable_t drawable,
jpayne@69 632 uint16_t width,
jpayne@69 633 uint16_t height,
jpayne@69 634 uint8_t depth,
jpayne@69 635 xcb_shm_seg_t shmseg,
jpayne@69 636 uint32_t offset);
jpayne@69 637
jpayne@69 638 /**
jpayne@69 639 * @brief Create a pixmap backed by shared memory.
jpayne@69 640 *
jpayne@69 641 * @param c The connection
jpayne@69 642 * @param pid A pixmap ID created with xcb_generate_id().
jpayne@69 643 * @param drawable The drawable to create the pixmap in.
jpayne@69 644 * @param width The width of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 645 * @param height The height of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 646 * @param depth The depth of the pixmap to create. Must be nonzero, or a Value error results.
jpayne@69 647 * @param shmseg The shared memory segment to use to create the pixmap.
jpayne@69 648 * @param offset The offset in the segment to create the pixmap at.
jpayne@69 649 * @return A cookie
jpayne@69 650 *
jpayne@69 651 * Create a pixmap backed by shared memory. Writes to the shared memory will be
jpayne@69 652 * reflected in the contents of the pixmap, and writes to the pixmap will be
jpayne@69 653 * reflected in the contents of the shared memory.
jpayne@69 654 *
jpayne@69 655 */
jpayne@69 656 xcb_void_cookie_t
jpayne@69 657 xcb_shm_create_pixmap (xcb_connection_t *c,
jpayne@69 658 xcb_pixmap_t pid,
jpayne@69 659 xcb_drawable_t drawable,
jpayne@69 660 uint16_t width,
jpayne@69 661 uint16_t height,
jpayne@69 662 uint8_t depth,
jpayne@69 663 xcb_shm_seg_t shmseg,
jpayne@69 664 uint32_t offset);
jpayne@69 665
jpayne@69 666 /**
jpayne@69 667 * @brief Create a shared memory segment
jpayne@69 668 *
jpayne@69 669 * @param c The connection
jpayne@69 670 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 671 * @param shm_fd The file descriptor the server should mmap().
jpayne@69 672 * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false.
jpayne@69 673 * @return A cookie
jpayne@69 674 *
jpayne@69 675 * Create a shared memory segment. The file descriptor will be mapped at offset
jpayne@69 676 * zero, and the size will be obtained using fstat(). A zero size will result in a
jpayne@69 677 * Value error.
jpayne@69 678 *
jpayne@69 679 * This form can be used only if the request will not cause
jpayne@69 680 * a reply to be generated. Any returned error will be
jpayne@69 681 * saved for handling by xcb_request_check().
jpayne@69 682 */
jpayne@69 683 xcb_void_cookie_t
jpayne@69 684 xcb_shm_attach_fd_checked (xcb_connection_t *c,
jpayne@69 685 xcb_shm_seg_t shmseg,
jpayne@69 686 int32_t shm_fd,
jpayne@69 687 uint8_t read_only);
jpayne@69 688
jpayne@69 689 /**
jpayne@69 690 * @brief Create a shared memory segment
jpayne@69 691 *
jpayne@69 692 * @param c The connection
jpayne@69 693 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 694 * @param shm_fd The file descriptor the server should mmap().
jpayne@69 695 * @param read_only True if the segment shall be mapped read only by the X11 server, otherwise false.
jpayne@69 696 * @return A cookie
jpayne@69 697 *
jpayne@69 698 * Create a shared memory segment. The file descriptor will be mapped at offset
jpayne@69 699 * zero, and the size will be obtained using fstat(). A zero size will result in a
jpayne@69 700 * Value error.
jpayne@69 701 *
jpayne@69 702 */
jpayne@69 703 xcb_void_cookie_t
jpayne@69 704 xcb_shm_attach_fd (xcb_connection_t *c,
jpayne@69 705 xcb_shm_seg_t shmseg,
jpayne@69 706 int32_t shm_fd,
jpayne@69 707 uint8_t read_only);
jpayne@69 708
jpayne@69 709 /**
jpayne@69 710 * @brief Asks the server to allocate a shared memory segment.
jpayne@69 711 *
jpayne@69 712 * @param c The connection
jpayne@69 713 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 714 * @param size The size of the segment to create.
jpayne@69 715 * @param read_only True if the server should map the segment read-only; otherwise false.
jpayne@69 716 * @return A cookie
jpayne@69 717 *
jpayne@69 718 * Asks the server to allocate a shared memory segment. The server’s reply will
jpayne@69 719 * include a file descriptor for the client to pass to mmap().
jpayne@69 720 *
jpayne@69 721 */
jpayne@69 722 xcb_shm_create_segment_cookie_t
jpayne@69 723 xcb_shm_create_segment (xcb_connection_t *c,
jpayne@69 724 xcb_shm_seg_t shmseg,
jpayne@69 725 uint32_t size,
jpayne@69 726 uint8_t read_only);
jpayne@69 727
jpayne@69 728 /**
jpayne@69 729 * @brief Asks the server to allocate a shared memory segment.
jpayne@69 730 *
jpayne@69 731 * @param c The connection
jpayne@69 732 * @param shmseg A shared memory segment ID created with xcb_generate_id().
jpayne@69 733 * @param size The size of the segment to create.
jpayne@69 734 * @param read_only True if the server should map the segment read-only; otherwise false.
jpayne@69 735 * @return A cookie
jpayne@69 736 *
jpayne@69 737 * Asks the server to allocate a shared memory segment. The server’s reply will
jpayne@69 738 * include a file descriptor for the client to pass to mmap().
jpayne@69 739 *
jpayne@69 740 * This form can be used only if the request will cause
jpayne@69 741 * a reply to be generated. Any returned error will be
jpayne@69 742 * placed in the event queue.
jpayne@69 743 */
jpayne@69 744 xcb_shm_create_segment_cookie_t
jpayne@69 745 xcb_shm_create_segment_unchecked (xcb_connection_t *c,
jpayne@69 746 xcb_shm_seg_t shmseg,
jpayne@69 747 uint32_t size,
jpayne@69 748 uint8_t read_only);
jpayne@69 749
jpayne@69 750 /**
jpayne@69 751 * Return the reply
jpayne@69 752 * @param c The connection
jpayne@69 753 * @param cookie The cookie
jpayne@69 754 * @param e The xcb_generic_error_t supplied
jpayne@69 755 *
jpayne@69 756 * Returns the reply of the request asked by
jpayne@69 757 *
jpayne@69 758 * The parameter @p e supplied to this function must be NULL if
jpayne@69 759 * xcb_shm_create_segment_unchecked(). is used.
jpayne@69 760 * Otherwise, it stores the error if any.
jpayne@69 761 *
jpayne@69 762 * The returned value must be freed by the caller using free().
jpayne@69 763 */
jpayne@69 764 xcb_shm_create_segment_reply_t *
jpayne@69 765 xcb_shm_create_segment_reply (xcb_connection_t *c,
jpayne@69 766 xcb_shm_create_segment_cookie_t cookie /**< */,
jpayne@69 767 xcb_generic_error_t **e);
jpayne@69 768
jpayne@69 769 /**
jpayne@69 770 * Return the reply fds
jpayne@69 771 * @param c The connection
jpayne@69 772 * @param reply The reply
jpayne@69 773 *
jpayne@69 774 * Returns a pointer to the array of reply fds of the reply.
jpayne@69 775 *
jpayne@69 776 * The returned value points into the reply and must not be free().
jpayne@69 777 * The fds are not managed by xcb. You must close() them before freeing the reply.
jpayne@69 778 */
jpayne@69 779 int *
jpayne@69 780 xcb_shm_create_segment_reply_fds (xcb_connection_t *c /**< */,
jpayne@69 781 xcb_shm_create_segment_reply_t *reply);
jpayne@69 782
jpayne@69 783
jpayne@69 784 #ifdef __cplusplus
jpayne@69 785 }
jpayne@69 786 #endif
jpayne@69 787
jpayne@69 788 #endif
jpayne@69 789
jpayne@69 790 /**
jpayne@69 791 * @}
jpayne@69 792 */