00001
00002
00003
00004
00005
00012 #ifndef __SHM_H
00013 #define __SHM_H
00014
00015 #include "xcb.h"
00016 #include "xproto.h"
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00022 #define XCB_SHM_MAJOR_VERSION 1
00023 #define XCB_SHM_MINOR_VERSION 1
00024
00025 extern xcb_extension_t xcb_shm_id;
00026
00027 typedef uint32_t xcb_shm_seg_t;
00028
00032 typedef struct xcb_shm_seg_iterator_t {
00033 xcb_shm_seg_t *data;
00034 int rem;
00035 int index;
00036 } xcb_shm_seg_iterator_t;
00037
00039 #define XCB_SHM_COMPLETION 0
00040
00044 typedef struct xcb_shm_completion_event_t {
00045 uint8_t response_type;
00046 uint8_t pad0;
00047 uint16_t sequence;
00048 xcb_drawable_t drawable;
00049 xcb_shm_seg_t shmseg;
00050 uint16_t minor_event;
00051 uint8_t major_event;
00052 uint8_t pad1;
00053 uint32_t offset;
00054 } xcb_shm_completion_event_t;
00055
00057 #define XCB_SHM_BAD_SEG 0
00058
00059 typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
00060
00064 typedef struct xcb_shm_query_version_cookie_t {
00065 unsigned int sequence;
00066 } xcb_shm_query_version_cookie_t;
00067
00069 #define XCB_SHM_QUERY_VERSION 0
00070
00074 typedef struct xcb_shm_query_version_request_t {
00075 uint8_t major_opcode;
00076 uint8_t minor_opcode;
00077 uint16_t length;
00078 } xcb_shm_query_version_request_t;
00079
00083 typedef struct xcb_shm_query_version_reply_t {
00084 uint8_t response_type;
00085 uint8_t shared_pixmaps;
00086 uint16_t sequence;
00087 uint32_t length;
00088 uint16_t major_version;
00089 uint16_t minor_version;
00090 uint16_t uid;
00091 uint16_t gid;
00092 uint8_t pixmap_format;
00093 } xcb_shm_query_version_reply_t;
00094
00096 #define XCB_SHM_ATTACH 1
00097
00101 typedef struct xcb_shm_attach_request_t {
00102 uint8_t major_opcode;
00103 uint8_t minor_opcode;
00104 uint16_t length;
00105 xcb_shm_seg_t shmseg;
00106 uint32_t shmid;
00107 uint8_t read_only;
00108 } xcb_shm_attach_request_t;
00109
00111 #define XCB_SHM_DETACH 2
00112
00116 typedef struct xcb_shm_detach_request_t {
00117 uint8_t major_opcode;
00118 uint8_t minor_opcode;
00119 uint16_t length;
00120 xcb_shm_seg_t shmseg;
00121 } xcb_shm_detach_request_t;
00122
00124 #define XCB_SHM_PUT_IMAGE 3
00125
00129 typedef struct xcb_shm_put_image_request_t {
00130 uint8_t major_opcode;
00131 uint8_t minor_opcode;
00132 uint16_t length;
00133 xcb_drawable_t drawable;
00134 xcb_gcontext_t gc;
00135 uint16_t total_width;
00136 uint16_t total_height;
00137 uint16_t src_x;
00138 uint16_t src_y;
00139 uint16_t src_width;
00140 uint16_t src_height;
00141 int16_t dst_x;
00142 int16_t dst_y;
00143 uint8_t depth;
00144 uint8_t format;
00145 uint8_t send_event;
00146 uint8_t pad0;
00147 xcb_shm_seg_t shmseg;
00148 uint32_t offset;
00149 } xcb_shm_put_image_request_t;
00150
00154 typedef struct xcb_shm_get_image_cookie_t {
00155 unsigned int sequence;
00156 } xcb_shm_get_image_cookie_t;
00157
00159 #define XCB_SHM_GET_IMAGE 4
00160
00164 typedef struct xcb_shm_get_image_request_t {
00165 uint8_t major_opcode;
00166 uint8_t minor_opcode;
00167 uint16_t length;
00168 xcb_drawable_t drawable;
00169 int16_t x;
00170 int16_t y;
00171 uint16_t width;
00172 uint16_t height;
00173 uint32_t plane_mask;
00174 uint8_t format;
00175 uint8_t pad0[3];
00176 xcb_shm_seg_t shmseg;
00177 uint32_t offset;
00178 } xcb_shm_get_image_request_t;
00179
00183 typedef struct xcb_shm_get_image_reply_t {
00184 uint8_t response_type;
00185 uint8_t depth;
00186 uint16_t sequence;
00187 uint32_t length;
00188 xcb_visualid_t visual;
00189 uint32_t size;
00190 } xcb_shm_get_image_reply_t;
00191
00193 #define XCB_SHM_CREATE_PIXMAP 5
00194
00198 typedef struct xcb_shm_create_pixmap_request_t {
00199 uint8_t major_opcode;
00200 uint8_t minor_opcode;
00201 uint16_t length;
00202 xcb_pixmap_t pid;
00203 xcb_drawable_t drawable;
00204 uint16_t width;
00205 uint16_t height;
00206 uint8_t depth;
00207 uint8_t pad0[3];
00208 xcb_shm_seg_t shmseg;
00209 uint32_t offset;
00210 } xcb_shm_create_pixmap_request_t;
00211
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230 void
00231 xcb_shm_seg_next (xcb_shm_seg_iterator_t *i );
00232
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 xcb_generic_iterator_t
00253 xcb_shm_seg_end (xcb_shm_seg_iterator_t i );
00254
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273 xcb_shm_query_version_cookie_t
00274 xcb_shm_query_version (xcb_connection_t *c );
00275
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 xcb_shm_query_version_cookie_t
00298 xcb_shm_query_version_unchecked (xcb_connection_t *c );
00299
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326 xcb_shm_query_version_reply_t *
00327 xcb_shm_query_version_reply (xcb_connection_t *c ,
00328 xcb_shm_query_version_cookie_t cookie ,
00329 xcb_generic_error_t **e );
00330
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 xcb_void_cookie_t
00356 xcb_shm_attach_checked (xcb_connection_t *c ,
00357 xcb_shm_seg_t shmseg ,
00358 uint32_t shmid ,
00359 uint8_t read_only );
00360
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382 xcb_void_cookie_t
00383 xcb_shm_attach (xcb_connection_t *c ,
00384 xcb_shm_seg_t shmseg ,
00385 uint32_t shmid ,
00386 uint8_t read_only );
00387
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 xcb_void_cookie_t
00411 xcb_shm_detach_checked (xcb_connection_t *c ,
00412 xcb_shm_seg_t shmseg );
00413
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433 xcb_void_cookie_t
00434 xcb_shm_detach (xcb_connection_t *c ,
00435 xcb_shm_seg_t shmseg );
00436
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473 xcb_void_cookie_t
00474 xcb_shm_put_image_checked (xcb_connection_t *c ,
00475 xcb_drawable_t drawable ,
00476 xcb_gcontext_t gc ,
00477 uint16_t total_width ,
00478 uint16_t total_height ,
00479 uint16_t src_x ,
00480 uint16_t src_y ,
00481 uint16_t src_width ,
00482 uint16_t src_height ,
00483 int16_t dst_x ,
00484 int16_t dst_y ,
00485 uint8_t depth ,
00486 uint8_t format ,
00487 uint8_t send_event ,
00488 xcb_shm_seg_t shmseg ,
00489 uint32_t offset );
00490
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524 xcb_void_cookie_t
00525 xcb_shm_put_image (xcb_connection_t *c ,
00526 xcb_drawable_t drawable ,
00527 xcb_gcontext_t gc ,
00528 uint16_t total_width ,
00529 uint16_t total_height ,
00530 uint16_t src_x ,
00531 uint16_t src_y ,
00532 uint16_t src_width ,
00533 uint16_t src_height ,
00534 int16_t dst_x ,
00535 int16_t dst_y ,
00536 uint8_t depth ,
00537 uint8_t format ,
00538 uint8_t send_event ,
00539 xcb_shm_seg_t shmseg ,
00540 uint32_t offset );
00541
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569 xcb_shm_get_image_cookie_t
00570 xcb_shm_get_image (xcb_connection_t *c ,
00571 xcb_drawable_t drawable ,
00572 int16_t x ,
00573 int16_t y ,
00574 uint16_t width ,
00575 uint16_t height ,
00576 uint32_t plane_mask ,
00577 uint8_t format ,
00578 xcb_shm_seg_t shmseg ,
00579 uint32_t offset );
00580
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611 xcb_shm_get_image_cookie_t
00612 xcb_shm_get_image_unchecked (xcb_connection_t *c ,
00613 xcb_drawable_t drawable ,
00614 int16_t x ,
00615 int16_t y ,
00616 uint16_t width ,
00617 uint16_t height ,
00618 uint32_t plane_mask ,
00619 uint8_t format ,
00620 xcb_shm_seg_t shmseg ,
00621 uint32_t offset );
00622
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649 xcb_shm_get_image_reply_t *
00650 xcb_shm_get_image_reply (xcb_connection_t *c ,
00651 xcb_shm_get_image_cookie_t cookie ,
00652 xcb_generic_error_t **e );
00653
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682 xcb_void_cookie_t
00683 xcb_shm_create_pixmap_checked (xcb_connection_t *c ,
00684 xcb_pixmap_t pid ,
00685 xcb_drawable_t drawable ,
00686 uint16_t width ,
00687 uint16_t height ,
00688 uint8_t depth ,
00689 xcb_shm_seg_t shmseg ,
00690 uint32_t offset );
00691
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717 xcb_void_cookie_t
00718 xcb_shm_create_pixmap (xcb_connection_t *c ,
00719 xcb_pixmap_t pid ,
00720 xcb_drawable_t drawable ,
00721 uint16_t width ,
00722 uint16_t height ,
00723 uint8_t depth ,
00724 xcb_shm_seg_t shmseg ,
00725 uint32_t offset );
00726
00727
00728 #ifdef __cplusplus
00729 }
00730 #endif
00731
00732 #endif
00733