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 uint16_t minor_event;
00050 uint8_t major_event;
00051 uint8_t pad1;
00052 xcb_shm_seg_t shmseg;
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 uint8_t pad0[15];
00094 } xcb_shm_query_version_reply_t;
00095
00097 #define XCB_SHM_ATTACH 1
00098
00102 typedef struct xcb_shm_attach_request_t {
00103 uint8_t major_opcode;
00104 uint8_t minor_opcode;
00105 uint16_t length;
00106 xcb_shm_seg_t shmseg;
00107 uint32_t shmid;
00108 uint8_t read_only;
00109 uint8_t pad0[3];
00110 } xcb_shm_attach_request_t;
00111
00113 #define XCB_SHM_DETACH 2
00114
00118 typedef struct xcb_shm_detach_request_t {
00119 uint8_t major_opcode;
00120 uint8_t minor_opcode;
00121 uint16_t length;
00122 xcb_shm_seg_t shmseg;
00123 } xcb_shm_detach_request_t;
00124
00126 #define XCB_SHM_PUT_IMAGE 3
00127
00131 typedef struct xcb_shm_put_image_request_t {
00132 uint8_t major_opcode;
00133 uint8_t minor_opcode;
00134 uint16_t length;
00135 xcb_drawable_t drawable;
00136 xcb_gcontext_t gc;
00137 uint16_t total_width;
00138 uint16_t total_height;
00139 uint16_t src_x;
00140 uint16_t src_y;
00141 uint16_t src_width;
00142 uint16_t src_height;
00143 int16_t dst_x;
00144 int16_t dst_y;
00145 uint8_t depth;
00146 uint8_t format;
00147 uint8_t send_event;
00148 uint8_t pad0;
00149 xcb_shm_seg_t shmseg;
00150 uint32_t offset;
00151 } xcb_shm_put_image_request_t;
00152
00156 typedef struct xcb_shm_get_image_cookie_t {
00157 unsigned int sequence;
00158 } xcb_shm_get_image_cookie_t;
00159
00161 #define XCB_SHM_GET_IMAGE 4
00162
00166 typedef struct xcb_shm_get_image_request_t {
00167 uint8_t major_opcode;
00168 uint8_t minor_opcode;
00169 uint16_t length;
00170 xcb_drawable_t drawable;
00171 int16_t x;
00172 int16_t y;
00173 uint16_t width;
00174 uint16_t height;
00175 uint32_t plane_mask;
00176 uint8_t format;
00177 uint8_t pad0[3];
00178 xcb_shm_seg_t shmseg;
00179 uint32_t offset;
00180 } xcb_shm_get_image_request_t;
00181
00185 typedef struct xcb_shm_get_image_reply_t {
00186 uint8_t response_type;
00187 uint8_t depth;
00188 uint16_t sequence;
00189 uint32_t length;
00190 xcb_visualid_t visual;
00191 uint32_t size;
00192 } xcb_shm_get_image_reply_t;
00193
00195 #define XCB_SHM_CREATE_PIXMAP 5
00196
00200 typedef struct xcb_shm_create_pixmap_request_t {
00201 uint8_t major_opcode;
00202 uint8_t minor_opcode;
00203 uint16_t length;
00204 xcb_pixmap_t pid;
00205 xcb_drawable_t drawable;
00206 uint16_t width;
00207 uint16_t height;
00208 uint8_t depth;
00209 uint8_t pad0[3];
00210 xcb_shm_seg_t shmseg;
00211 uint32_t offset;
00212 } xcb_shm_create_pixmap_request_t;
00213
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 void
00233 xcb_shm_seg_next (xcb_shm_seg_iterator_t *i );
00234
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 xcb_generic_iterator_t
00255 xcb_shm_seg_end (xcb_shm_seg_iterator_t i );
00256
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275 xcb_shm_query_version_cookie_t
00276 xcb_shm_query_version (xcb_connection_t *c );
00277
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299 xcb_shm_query_version_cookie_t
00300 xcb_shm_query_version_unchecked (xcb_connection_t *c );
00301
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328 xcb_shm_query_version_reply_t *
00329 xcb_shm_query_version_reply (xcb_connection_t *c ,
00330 xcb_shm_query_version_cookie_t cookie ,
00331 xcb_generic_error_t **e );
00332
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357 xcb_void_cookie_t
00358 xcb_shm_attach_checked (xcb_connection_t *c ,
00359 xcb_shm_seg_t shmseg ,
00360 uint32_t shmid ,
00361 uint8_t read_only );
00362
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 xcb_void_cookie_t
00385 xcb_shm_attach (xcb_connection_t *c ,
00386 xcb_shm_seg_t shmseg ,
00387 uint32_t shmid ,
00388 uint8_t read_only );
00389
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412 xcb_void_cookie_t
00413 xcb_shm_detach_checked (xcb_connection_t *c ,
00414 xcb_shm_seg_t shmseg );
00415
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435 xcb_void_cookie_t
00436 xcb_shm_detach (xcb_connection_t *c ,
00437 xcb_shm_seg_t shmseg );
00438
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475 xcb_void_cookie_t
00476 xcb_shm_put_image_checked (xcb_connection_t *c ,
00477 xcb_drawable_t drawable ,
00478 xcb_gcontext_t gc ,
00479 uint16_t total_width ,
00480 uint16_t total_height ,
00481 uint16_t src_x ,
00482 uint16_t src_y ,
00483 uint16_t src_width ,
00484 uint16_t src_height ,
00485 int16_t dst_x ,
00486 int16_t dst_y ,
00487 uint8_t depth ,
00488 uint8_t format ,
00489 uint8_t send_event ,
00490 xcb_shm_seg_t shmseg ,
00491 uint32_t offset );
00492
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526 xcb_void_cookie_t
00527 xcb_shm_put_image (xcb_connection_t *c ,
00528 xcb_drawable_t drawable ,
00529 xcb_gcontext_t gc ,
00530 uint16_t total_width ,
00531 uint16_t total_height ,
00532 uint16_t src_x ,
00533 uint16_t src_y ,
00534 uint16_t src_width ,
00535 uint16_t src_height ,
00536 int16_t dst_x ,
00537 int16_t dst_y ,
00538 uint8_t depth ,
00539 uint8_t format ,
00540 uint8_t send_event ,
00541 xcb_shm_seg_t shmseg ,
00542 uint32_t offset );
00543
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571 xcb_shm_get_image_cookie_t
00572 xcb_shm_get_image (xcb_connection_t *c ,
00573 xcb_drawable_t drawable ,
00574 int16_t x ,
00575 int16_t y ,
00576 uint16_t width ,
00577 uint16_t height ,
00578 uint32_t plane_mask ,
00579 uint8_t format ,
00580 xcb_shm_seg_t shmseg ,
00581 uint32_t offset );
00582
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613 xcb_shm_get_image_cookie_t
00614 xcb_shm_get_image_unchecked (xcb_connection_t *c ,
00615 xcb_drawable_t drawable ,
00616 int16_t x ,
00617 int16_t y ,
00618 uint16_t width ,
00619 uint16_t height ,
00620 uint32_t plane_mask ,
00621 uint8_t format ,
00622 xcb_shm_seg_t shmseg ,
00623 uint32_t offset );
00624
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651 xcb_shm_get_image_reply_t *
00652 xcb_shm_get_image_reply (xcb_connection_t *c ,
00653 xcb_shm_get_image_cookie_t cookie ,
00654 xcb_generic_error_t **e );
00655
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684 xcb_void_cookie_t
00685 xcb_shm_create_pixmap_checked (xcb_connection_t *c ,
00686 xcb_pixmap_t pid ,
00687 xcb_drawable_t drawable ,
00688 uint16_t width ,
00689 uint16_t height ,
00690 uint8_t depth ,
00691 xcb_shm_seg_t shmseg ,
00692 uint32_t offset );
00693
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719 xcb_void_cookie_t
00720 xcb_shm_create_pixmap (xcb_connection_t *c ,
00721 xcb_pixmap_t pid ,
00722 xcb_drawable_t drawable ,
00723 uint16_t width ,
00724 uint16_t height ,
00725 uint8_t depth ,
00726 xcb_shm_seg_t shmseg ,
00727 uint32_t offset );
00728
00729
00730 #ifdef __cplusplus
00731 }
00732 #endif
00733
00734 #endif
00735