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
00054 #define XCB_PACKED __attribute__((__packed__))
00055
00063
00064
00066 #define X_PROTOCOL 11
00067
00069 #define X_PROTOCOL_REVISION 0
00070
00072 #define X_TCP_PORT 6000
00073
00075 #define XCB_CONN_ERROR 1
00076
00078 #define XCB_CONN_CLOSED_EXT_NOTSUPPORTED 2
00079
00081 #define XCB_CONN_CLOSED_MEM_INSUFFICIENT 3
00082
00084 #define XCB_CONN_CLOSED_REQ_LEN_EXCEED 4
00085
00087 #define XCB_CONN_CLOSED_PARSE_ERR 5
00088
00090 #define XCB_CONN_CLOSED_INVALID_SCREEN 6
00091
00093 #define XCB_CONN_CLOSED_FDPASSING_FAILED 7
00094
00095 #define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
00096
00097
00098
00104 typedef struct xcb_connection_t xcb_connection_t;
00107
00108
00114 typedef struct {
00115 void *data;
00116 int rem;
00117 int index;
00118 } xcb_generic_iterator_t;
00119
00125 typedef struct {
00126 uint8_t response_type;
00127 uint8_t pad0;
00128 uint16_t sequence;
00129 uint32_t length;
00130 } xcb_generic_reply_t;
00131
00137 typedef struct {
00138 uint8_t response_type;
00139 uint8_t pad0;
00140 uint16_t sequence;
00141 uint32_t pad[7];
00142 uint32_t full_sequence;
00143 } xcb_generic_event_t;
00144
00154 typedef struct {
00155 uint8_t response_type;
00156 uint8_t pad0;
00157 uint16_t sequence;
00158 uint32_t length;
00159 uint16_t event_type;
00160 uint16_t pad1;
00161 uint32_t pad[5];
00162 uint32_t full_sequence;
00163 } xcb_ge_event_t;
00164
00170 typedef struct {
00171 uint8_t response_type;
00172 uint8_t error_code;
00173 uint16_t sequence;
00174 uint32_t resource_id;
00175 uint16_t minor_code;
00176 uint8_t major_code;
00177 uint8_t pad0;
00178 uint32_t pad[5];
00179 uint32_t full_sequence;
00180 } xcb_generic_error_t;
00181
00187 typedef struct {
00188 unsigned int sequence;
00189 } xcb_void_cookie_t;
00190
00191
00192
00193 #include "xproto.h"
00194
00195
00197 #define XCB_NONE 0L
00198
00200 #define XCB_COPY_FROM_PARENT 0L
00201
00203 #define XCB_CURRENT_TIME 0L
00204
00206 #define XCB_NO_SYMBOL 0L
00207
00208
00209
00210
00216 typedef struct xcb_auth_info_t {
00217 int namelen;
00218 char *name;
00219 int datalen;
00220 char *data;
00221 } xcb_auth_info_t;
00222
00223
00224
00225
00234 int xcb_flush(xcb_connection_t *c);
00235
00251 uint32_t xcb_get_maximum_request_length(xcb_connection_t *c);
00252
00270 void xcb_prefetch_maximum_request_length(xcb_connection_t *c);
00271
00272
00273
00274
00284 xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
00285
00297 xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
00298
00313 xcb_generic_event_t *xcb_poll_for_queued_event(xcb_connection_t *c);
00314
00315 typedef struct xcb_special_event xcb_special_event_t;
00316
00320 xcb_generic_event_t *xcb_poll_for_special_event(xcb_connection_t *c,
00321 xcb_special_event_t *se);
00322
00326 xcb_generic_event_t *xcb_wait_for_special_event(xcb_connection_t *c,
00327 xcb_special_event_t *se);
00331 typedef struct xcb_extension_t xcb_extension_t;
00336 xcb_special_event_t *xcb_register_for_special_xge(xcb_connection_t *c,
00337 xcb_extension_t *ext,
00338 uint32_t eid,
00339 uint32_t *stamp);
00340
00344 void xcb_unregister_for_special_event(xcb_connection_t *c,
00345 xcb_special_event_t *se);
00346
00363 xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
00364
00379 void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
00380
00400 void xcb_discard_reply64(xcb_connection_t *c, uint64_t sequence);
00401
00402
00403
00420 const struct xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00421
00433 void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00434
00435
00436
00437
00456 const struct xcb_setup_t *xcb_get_setup(xcb_connection_t *c);
00457
00466 int xcb_get_file_descriptor(xcb_connection_t *c);
00467
00486 int xcb_connection_has_error(xcb_connection_t *c);
00487
00505 xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info);
00506
00514 void xcb_disconnect(xcb_connection_t *c);
00515
00516
00517
00518
00536 int xcb_parse_display(const char *name, char **host, int *display, int *screen);
00537
00555 xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
00556
00574 xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
00575
00576
00577
00578
00587 uint32_t xcb_generate_id(xcb_connection_t *c);
00588
00589
00594 #ifdef __cplusplus
00595 }
00596 #endif
00597
00598
00599 #endif