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
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 void
00219 xcb_shm_seg_next (xcb_shm_seg_iterator_t *i );
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 xcb_generic_iterator_t
00232 xcb_shm_seg_end (xcb_shm_seg_iterator_t i );
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 xcb_shm_query_version_cookie_t
00245 xcb_shm_query_version (xcb_connection_t *c );
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 xcb_shm_query_version_cookie_t
00258 xcb_shm_query_version_unchecked (xcb_connection_t *c );
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272 xcb_shm_query_version_reply_t *
00273 xcb_shm_query_version_reply (xcb_connection_t *c ,
00274 xcb_shm_query_version_cookie_t cookie ,
00275 xcb_generic_error_t **e );
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 xcb_void_cookie_t
00291 xcb_shm_attach_checked (xcb_connection_t *c ,
00292 xcb_shm_seg_t shmseg ,
00293 uint32_t shmid ,
00294 uint8_t read_only );
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309 xcb_void_cookie_t
00310 xcb_shm_attach (xcb_connection_t *c ,
00311 xcb_shm_seg_t shmseg ,
00312 uint32_t shmid ,
00313 uint8_t read_only );
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326 xcb_void_cookie_t
00327 xcb_shm_detach_checked (xcb_connection_t *c ,
00328 xcb_shm_seg_t shmseg );
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341 xcb_void_cookie_t
00342 xcb_shm_detach (xcb_connection_t *c ,
00343 xcb_shm_seg_t shmseg );
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370 xcb_void_cookie_t
00371 xcb_shm_put_image_checked (xcb_connection_t *c ,
00372 xcb_drawable_t drawable ,
00373 xcb_gcontext_t gc ,
00374 uint16_t total_width ,
00375 uint16_t total_height ,
00376 uint16_t src_x ,
00377 uint16_t src_y ,
00378 uint16_t src_width ,
00379 uint16_t src_height ,
00380 int16_t dst_x ,
00381 int16_t dst_y ,
00382 uint8_t depth ,
00383 uint8_t format ,
00384 uint8_t send_event ,
00385 xcb_shm_seg_t shmseg ,
00386 uint32_t offset );
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413 xcb_void_cookie_t
00414 xcb_shm_put_image (xcb_connection_t *c ,
00415 xcb_drawable_t drawable ,
00416 xcb_gcontext_t gc ,
00417 uint16_t total_width ,
00418 uint16_t total_height ,
00419 uint16_t src_x ,
00420 uint16_t src_y ,
00421 uint16_t src_width ,
00422 uint16_t src_height ,
00423 int16_t dst_x ,
00424 int16_t dst_y ,
00425 uint8_t depth ,
00426 uint8_t format ,
00427 uint8_t send_event ,
00428 xcb_shm_seg_t shmseg ,
00429 uint32_t offset );
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450 xcb_shm_get_image_cookie_t
00451 xcb_shm_get_image (xcb_connection_t *c ,
00452 xcb_drawable_t drawable ,
00453 int16_t x ,
00454 int16_t y ,
00455 uint16_t width ,
00456 uint16_t height ,
00457 uint32_t plane_mask ,
00458 uint8_t format ,
00459 xcb_shm_seg_t shmseg ,
00460 uint32_t offset );
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481 xcb_shm_get_image_cookie_t
00482 xcb_shm_get_image_unchecked (xcb_connection_t *c ,
00483 xcb_drawable_t drawable ,
00484 int16_t x ,
00485 int16_t y ,
00486 uint16_t width ,
00487 uint16_t height ,
00488 uint32_t plane_mask ,
00489 uint8_t format ,
00490 xcb_shm_seg_t shmseg ,
00491 uint32_t offset );
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505 xcb_shm_get_image_reply_t *
00506 xcb_shm_get_image_reply (xcb_connection_t *c ,
00507 xcb_shm_get_image_cookie_t cookie ,
00508 xcb_generic_error_t **e );
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527 xcb_void_cookie_t
00528 xcb_shm_create_pixmap_checked (xcb_connection_t *c ,
00529 xcb_pixmap_t pid ,
00530 xcb_drawable_t drawable ,
00531 uint16_t width ,
00532 uint16_t height ,
00533 uint8_t depth ,
00534 xcb_shm_seg_t shmseg ,
00535 uint32_t offset );
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554 xcb_void_cookie_t
00555 xcb_shm_create_pixmap (xcb_connection_t *c ,
00556 xcb_pixmap_t pid ,
00557 xcb_drawable_t drawable ,
00558 uint16_t width ,
00559 uint16_t height ,
00560 uint8_t depth ,
00561 xcb_shm_seg_t shmseg ,
00562 uint32_t offset );
00563
00564
00565 #endif
00566