00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __XCB_H__
00029 #define __XCB_H__
00030 #include <sys/types.h>
00031
00032 #if defined(__solaris__)
00033 #include <inttypes.h>
00034 #else
00035 #include <stdint.h>
00036 #endif
00037
00038 #ifndef _WIN32
00039 #include <sys/uio.h>
00040 #else
00041 #include "xcb_windefs.h"
00042 #endif
00043 #include <pthread.h>
00044
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00061
00062
00064 #define X_PROTOCOL 11
00065
00067 #define X_PROTOCOL_REVISION 0
00068
00070 #define X_TCP_PORT 6000
00071
00073 #define XCB_CONN_ERROR 1
00074
00076 #define XCB_CONN_CLOSED_EXT_NOTSUPPORTED 2
00077
00079 #define XCB_CONN_CLOSED_MEM_INSUFFICIENT 3
00080
00082 #define XCB_CONN_CLOSED_REQ_LEN_EXCEED 4
00083
00085 #define XCB_CONN_CLOSED_PARSE_ERR 5
00086
00088 #define XCB_CONN_CLOSED_INVALID_SCREEN 6
00089
00090 #define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
00091
00092
00093
00099 typedef struct xcb_connection_t xcb_connection_t;
00102
00103
00109 typedef struct {
00110 void *data;
00111 int rem;
00112 int index;
00113 } xcb_generic_iterator_t;
00114
00120 typedef struct {
00121 uint8_t response_type;
00122 uint8_t pad0;
00123 uint16_t sequence;
00124 uint32_t length;
00125 } xcb_generic_reply_t;
00126
00132 typedef struct {
00133 uint8_t response_type;
00134 uint8_t pad0;
00135 uint16_t sequence;
00136 uint32_t pad[7];
00137 uint32_t full_sequence;
00138 } xcb_generic_event_t;
00139
00146 typedef struct {
00147 uint8_t response_type;
00148 uint8_t pad0;
00149 uint16_t sequence;
00150 uint32_t length;
00151 uint16_t event_type;
00152 uint16_t pad1;
00153 uint32_t pad[5];
00154 uint32_t full_sequence;
00155 } xcb_ge_event_t;
00156
00162 typedef struct {
00163 uint8_t response_type;
00164 uint8_t error_code;
00165 uint16_t sequence;
00166 uint32_t resource_id;
00167 uint16_t minor_code;
00168 uint8_t major_code;
00169 uint8_t pad0;
00170 uint32_t pad[5];
00171 uint32_t full_sequence;
00172 } xcb_generic_error_t;
00173
00179 typedef struct {
00180 unsigned int sequence;
00181 } xcb_void_cookie_t;
00182
00183
00184
00185 #include "xproto.h"
00186
00187
00189 #define XCB_NONE 0L
00190
00192 #define XCB_COPY_FROM_PARENT 0L
00193
00195 #define XCB_CURRENT_TIME 0L
00196
00198 #define XCB_NO_SYMBOL 0L
00199
00200
00201
00202
00208 typedef struct xcb_auth_info_t {
00209 int namelen;
00210 char *name;
00211 int datalen;
00212 char *data;
00213 } xcb_auth_info_t;
00214
00215
00216
00217
00226 int xcb_flush(xcb_connection_t *c);
00227
00243 uint32_t xcb_get_maximum_request_length(xcb_connection_t *c);
00244
00262 void xcb_prefetch_maximum_request_length(xcb_connection_t *c);
00263
00264
00265
00266
00276 xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
00277
00290 xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
00291
00306 xcb_generic_event_t *xcb_poll_for_queued_event(xcb_connection_t *c);
00307
00324 xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
00325
00340 void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
00341
00361 void xcb_discard_reply64(xcb_connection_t *c, uint64_t sequence);
00362
00363
00364
00368 typedef struct xcb_extension_t xcb_extension_t;
00386 const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00387
00399 void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00400
00401
00402
00403
00422 const xcb_setup_t *xcb_get_setup(xcb_connection_t *c);
00423
00432 int xcb_get_file_descriptor(xcb_connection_t *c);
00433
00451 int xcb_connection_has_error(xcb_connection_t *c);
00452
00465 xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info);
00466
00474 void xcb_disconnect(xcb_connection_t *c);
00475
00476
00477
00478
00496 int xcb_parse_display(const char *name, char **host, int *display, int *screen);
00497
00510 xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
00511
00524 xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
00525
00526
00527
00528
00537 uint32_t xcb_generate_id(xcb_connection_t *c);
00538
00539
00544 #ifdef __cplusplus
00545 }
00546 #endif
00547
00548
00549 #endif