00001
00002
00003
00004
00005
00012 #ifndef __SHM_H
00013 #define __SHM_H
00014
00015 #include "xcb.h"
00016 #include "xproto.h"
00017
00018 #define XCB_SHM_MAJOR_VERSION 1
00019 #define XCB_SHM_MINOR_VERSION 1
00020
00021 extern xcb_extension_t xcb_shm_id;
00022
00023 typedef uint32_t xcb_shm_seg_t;
00024
00028 typedef struct xcb_shm_seg_iterator_t {
00029 xcb_shm_seg_t *data;
00030 int rem;
00031 int index;
00032 } xcb_shm_seg_iterator_t;
00033
00035 #define XCB_SHM_COMPLETION 0
00036
00040 typedef struct xcb_shm_completion_event_t {
00041 uint8_t response_type;
00042 uint8_t pad0;
00043 uint16_t sequence;
00044 xcb_drawable_t drawable;
00045 xcb_shm_seg_t shmseg;
00046 uint16_t minor_event;
00047 uint8_t major_event;
00048 uint8_t pad1;
00049 uint32_t offset;
00050 } xcb_shm_completion_event_t;
00051
00053 #define XCB_SHM_BAD_SEG 0
00054
00055 typedef xcb_value_error_t xcb_shm_bad_seg_error_t;
00056
00060 typedef struct xcb_shm_query_version_cookie_t {
00061 unsigned int sequence;
00062 } xcb_shm_query_version_cookie_t;
00063
00065 #define XCB_SHM_QUERY_VERSION 0
00066
00070 typedef struct xcb_shm_query_version_request_t {
00071 uint8_t major_opcode;
00072 uint8_t minor_opcode;
00073 uint16_t length;
00074 } xcb_shm_query_version_request_t;
00075
00079 typedef struct xcb_shm_query_version_reply_t {
00080 uint8_t response_type;
00081 uint8_t shared_pixmaps;
00082 uint16_t sequence;
00083 uint32_t length;
00084 uint16_t major_version;
00085 uint16_t minor_version;
00086 uint16_t uid;
00087 uint16_t gid;
00088 uint8_t pixmap_format;
00089 } xcb_shm_query_version_reply_t;
00090
00092 #define XCB_SHM_ATTACH 1
00093
00097 typedef struct xcb_shm_attach_request_t {
00098 uint8_t major_opcode;
00099 uint8_t minor_opcode;
00100 uint16_t length;
00101 xcb_shm_seg_t shmseg;
00102 uint32_t shmid;
00103 uint8_t read_only;
00104 } xcb_shm_attach_request_t;
00105
00107 #define XCB_SHM_DETACH 2
00108
00112 typedef struct xcb_shm_detach_request_t {
00113 uint8_t major_opcode;
00114 uint8_t minor_opcode;
00115 uint16_t length;
00116 xcb_shm_seg_t shmseg;
00117 } xcb_shm_detach_request_t;
00118
00120 #define XCB_SHM_PUT_IMAGE 3
00121
00125 typedef struct xcb_shm_put_image_request_t {
00126 uint8_t major_opcode;
00127 uint8_t minor_opcode;
00128 uint16_t length;
00129 xcb_drawable_t drawable;
00130 xcb_gcontext_t gc;
00131 uint16_t total_width;
00132 uint16_t total_height;
00133 uint16_t src_x;
00134 uint16_t src_y;
00135 uint16_t src_width;
00136 uint16_t src_height;
00137 int16_t dst_x;
00138 int16_t dst_y;
00139 uint8_t depth;
00140 uint8_t format;
00141 uint8_t send_event;
00142 uint8_t pad0;
00143 xcb_shm_seg_t shmseg;
00144 uint32_t offset;
00145 } xcb_shm_put_image_request_t;
00146
00150 typedef struct xcb_shm_get_image_cookie_t {
00151 unsigned int sequence;
00152 } xcb_shm_get_image_cookie_t;
00153
00155 #define XCB_SHM_GET_IMAGE 4
00156
00160 typedef struct xcb_shm_get_image_request_t {
00161 uint8_t major_opcode;
00162 uint8_t minor_opcode;
00163 uint16_t length;
00164 xcb_drawable_t drawable;
00165 int16_t x;
00166 int16_t y;
00167 uint16_t width;
00168 uint16_t height;
00169 uint32_t plane_mask;
00170 uint8_t format;
00171 uint8_t pad0[3];
00172 xcb_shm_seg_t shmseg;
00173 uint32_t offset;
00174 } xcb_shm_get_image_request_t;
00175
00179 typedef struct xcb_shm_get_image_reply_t {
00180 uint8_t response_type;
00181 uint8_t depth;
00182 uint16_t sequence;
00183 uint32_t length;
00184 xcb_visualid_t visual;
00185 uint32_t size;
00186 } xcb_shm_get_image_reply_t;
00187
00189 #define XCB_SHM_CREATE_PIXMAP 5
00190
00194 typedef struct xcb_shm_create_pixmap_request_t {
00195 uint8_t major_opcode;
00196 uint8_t minor_opcode;
00197 uint16_t length;
00198 xcb_pixmap_t pid;
00199 xcb_drawable_t drawable;
00200 uint16_t width;
00201 uint16_t height;
00202 uint8_t depth;
00203 uint8_t pad0[3];
00204 xcb_shm_seg_t shmseg;
00205 uint32_t offset;
00206 } xcb_shm_create_pixmap_request_t;
00207
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226 void
00227 xcb_shm_seg_next (xcb_shm_seg_iterator_t *i );
00228
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248 xcb_generic_iterator_t
00249 xcb_shm_seg_end (xcb_shm_seg_iterator_t i );
00250
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 xcb_shm_query_version_cookie_t
00270 xcb_shm_query_version (xcb_connection_t *c );
00271
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 xcb_shm_query_version_cookie_t
00294 xcb_shm_query_version_unchecked (xcb_connection_t *c );
00295
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320 xcb_shm_query_version_reply_t *
00321 xcb_shm_query_version_reply (xcb_connection_t *c ,
00322 xcb_shm_query_version_cookie_t cookie ,
00323 xcb_generic_error_t **e );
00324
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349 xcb_void_cookie_t
00350 xcb_shm_attach_checked (xcb_connection_t *c ,
00351 xcb_shm_seg_t shmseg ,
00352 uint32_t shmid ,
00353 uint8_t read_only );
00354
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376 xcb_void_cookie_t
00377 xcb_shm_attach (xcb_connection_t *c ,
00378 xcb_shm_seg_t shmseg ,
00379 uint32_t shmid ,
00380 uint8_t read_only );
00381
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404 xcb_void_cookie_t
00405 xcb_shm_detach_checked (xcb_connection_t *c ,
00406 xcb_shm_seg_t shmseg );
00407
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427 xcb_void_cookie_t
00428 xcb_shm_detach (xcb_connection_t *c ,
00429 xcb_shm_seg_t shmseg );
00430
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 xcb_void_cookie_t
00468 xcb_shm_put_image_checked (xcb_connection_t *c ,
00469 xcb_drawable_t drawable ,
00470 xcb_gcontext_t gc ,
00471 uint16_t total_width ,
00472 uint16_t total_height ,
00473 uint16_t src_x ,
00474 uint16_t src_y ,
00475 uint16_t src_width ,
00476 uint16_t src_height ,
00477 int16_t dst_x ,
00478 int16_t dst_y ,
00479 uint8_t depth ,
00480 uint8_t format ,
00481 uint8_t send_event ,
00482 xcb_shm_seg_t shmseg ,
00483 uint32_t offset );
00484
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518 xcb_void_cookie_t
00519 xcb_shm_put_image (xcb_connection_t *c ,
00520 xcb_drawable_t drawable ,
00521 xcb_gcontext_t gc ,
00522 uint16_t total_width ,
00523 uint16_t total_height ,
00524 uint16_t src_x ,
00525 uint16_t src_y ,
00526 uint16_t src_width ,
00527 uint16_t src_height ,
00528 int16_t dst_x ,
00529 int16_t dst_y ,
00530 uint8_t depth ,
00531 uint8_t format ,
00532 uint8_t send_event ,
00533 xcb_shm_seg_t shmseg ,
00534 uint32_t offset );
00535
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563 xcb_shm_get_image_cookie_t
00564 xcb_shm_get_image (xcb_connection_t *c ,
00565 xcb_drawable_t drawable ,
00566 int16_t x ,
00567 int16_t y ,
00568 uint16_t width ,
00569 uint16_t height ,
00570 uint32_t plane_mask ,
00571 uint8_t format ,
00572 xcb_shm_seg_t shmseg ,
00573 uint32_t offset );
00574
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605 xcb_shm_get_image_cookie_t
00606 xcb_shm_get_image_unchecked (xcb_connection_t *c ,
00607 xcb_drawable_t drawable ,
00608 int16_t x ,
00609 int16_t y ,
00610 uint16_t width ,
00611 uint16_t height ,
00612 uint32_t plane_mask ,
00613 uint8_t format ,
00614 xcb_shm_seg_t shmseg ,
00615 uint32_t offset );
00616
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641 xcb_shm_get_image_reply_t *
00642 xcb_shm_get_image_reply (xcb_connection_t *c ,
00643 xcb_shm_get_image_cookie_t cookie ,
00644 xcb_generic_error_t **e );
00645
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674 xcb_void_cookie_t
00675 xcb_shm_create_pixmap_checked (xcb_connection_t *c ,
00676 xcb_pixmap_t pid ,
00677 xcb_drawable_t drawable ,
00678 uint16_t width ,
00679 uint16_t height ,
00680 uint8_t depth ,
00681 xcb_shm_seg_t shmseg ,
00682 uint32_t offset );
00683
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709 xcb_void_cookie_t
00710 xcb_shm_create_pixmap (xcb_connection_t *c ,
00711 xcb_pixmap_t pid ,
00712 xcb_drawable_t drawable ,
00713 uint16_t width ,
00714 uint16_t height ,
00715 uint8_t depth ,
00716 xcb_shm_seg_t shmseg ,
00717 uint32_t offset );
00718
00719
00720 #endif
00721