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
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322 xcb_shm_query_version_reply_t *
00323 xcb_shm_query_version_reply (xcb_connection_t *c ,
00324 xcb_shm_query_version_cookie_t cookie ,
00325 xcb_generic_error_t **e );
00326
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 xcb_void_cookie_t
00352 xcb_shm_attach_checked (xcb_connection_t *c ,
00353 xcb_shm_seg_t shmseg ,
00354 uint32_t shmid ,
00355 uint8_t read_only );
00356
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378 xcb_void_cookie_t
00379 xcb_shm_attach (xcb_connection_t *c ,
00380 xcb_shm_seg_t shmseg ,
00381 uint32_t shmid ,
00382 uint8_t read_only );
00383
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406 xcb_void_cookie_t
00407 xcb_shm_detach_checked (xcb_connection_t *c ,
00408 xcb_shm_seg_t shmseg );
00409
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429 xcb_void_cookie_t
00430 xcb_shm_detach (xcb_connection_t *c ,
00431 xcb_shm_seg_t shmseg );
00432
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469 xcb_void_cookie_t
00470 xcb_shm_put_image_checked (xcb_connection_t *c ,
00471 xcb_drawable_t drawable ,
00472 xcb_gcontext_t gc ,
00473 uint16_t total_width ,
00474 uint16_t total_height ,
00475 uint16_t src_x ,
00476 uint16_t src_y ,
00477 uint16_t src_width ,
00478 uint16_t src_height ,
00479 int16_t dst_x ,
00480 int16_t dst_y ,
00481 uint8_t depth ,
00482 uint8_t format ,
00483 uint8_t send_event ,
00484 xcb_shm_seg_t shmseg ,
00485 uint32_t offset );
00486
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520 xcb_void_cookie_t
00521 xcb_shm_put_image (xcb_connection_t *c ,
00522 xcb_drawable_t drawable ,
00523 xcb_gcontext_t gc ,
00524 uint16_t total_width ,
00525 uint16_t total_height ,
00526 uint16_t src_x ,
00527 uint16_t src_y ,
00528 uint16_t src_width ,
00529 uint16_t src_height ,
00530 int16_t dst_x ,
00531 int16_t dst_y ,
00532 uint8_t depth ,
00533 uint8_t format ,
00534 uint8_t send_event ,
00535 xcb_shm_seg_t shmseg ,
00536 uint32_t offset );
00537
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565 xcb_shm_get_image_cookie_t
00566 xcb_shm_get_image (xcb_connection_t *c ,
00567 xcb_drawable_t drawable ,
00568 int16_t x ,
00569 int16_t y ,
00570 uint16_t width ,
00571 uint16_t height ,
00572 uint32_t plane_mask ,
00573 uint8_t format ,
00574 xcb_shm_seg_t shmseg ,
00575 uint32_t offset );
00576
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607 xcb_shm_get_image_cookie_t
00608 xcb_shm_get_image_unchecked (xcb_connection_t *c ,
00609 xcb_drawable_t drawable ,
00610 int16_t x ,
00611 int16_t y ,
00612 uint16_t width ,
00613 uint16_t height ,
00614 uint32_t plane_mask ,
00615 uint8_t format ,
00616 xcb_shm_seg_t shmseg ,
00617 uint32_t offset );
00618
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645 xcb_shm_get_image_reply_t *
00646 xcb_shm_get_image_reply (xcb_connection_t *c ,
00647 xcb_shm_get_image_cookie_t cookie ,
00648 xcb_generic_error_t **e );
00649
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678 xcb_void_cookie_t
00679 xcb_shm_create_pixmap_checked (xcb_connection_t *c ,
00680 xcb_pixmap_t pid ,
00681 xcb_drawable_t drawable ,
00682 uint16_t width ,
00683 uint16_t height ,
00684 uint8_t depth ,
00685 xcb_shm_seg_t shmseg ,
00686 uint32_t offset );
00687
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713 xcb_void_cookie_t
00714 xcb_shm_create_pixmap (xcb_connection_t *c ,
00715 xcb_pixmap_t pid ,
00716 xcb_drawable_t drawable ,
00717 uint16_t width ,
00718 uint16_t height ,
00719 uint8_t depth ,
00720 xcb_shm_seg_t shmseg ,
00721 uint32_t offset );
00722
00723
00724 #endif
00725