Go to the documentation of this file.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 #include <sys/uio.h>
00039 #include <pthread.h>
00040
00041
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045
00057
00058
00060 #define X_PROTOCOL 11
00061
00063 #define X_PROTOCOL_REVISION 0
00064
00066 #define X_TCP_PORT 6000
00067
00068 #define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
00069
00070
00071
00077 typedef struct xcb_connection_t xcb_connection_t;
00080
00081
00087 typedef struct {
00088 void *data;
00089 int rem;
00090 int index;
00091 } xcb_generic_iterator_t;
00092
00098 typedef struct {
00099 uint8_t response_type;
00100 uint8_t pad0;
00101 uint16_t sequence;
00102 uint32_t length;
00103 } xcb_generic_reply_t;
00104
00110 typedef struct {
00111 uint8_t response_type;
00112 uint8_t pad0;
00113 uint16_t sequence;
00114 uint32_t pad[7];
00115 uint32_t full_sequence;
00116 } xcb_generic_event_t;
00117
00124 typedef struct {
00125 uint8_t response_type;
00126 uint8_t pad0;
00127 uint16_t sequence;
00128 uint32_t length;
00129 uint16_t event_type;
00130 uint16_t pad1;
00131 uint32_t pad[5];
00132 uint32_t full_sequence;
00133 } xcb_ge_event_t;
00134
00140 typedef struct {
00141 uint8_t response_type;
00142 uint8_t error_code;
00143 uint16_t sequence;
00144 uint32_t resource_id;
00145 uint16_t minor_code;
00146 uint8_t major_code;
00147 uint8_t pad0;
00148 uint32_t pad[5];
00149 uint32_t full_sequence;
00150 } xcb_generic_error_t;
00151
00157 typedef struct {
00158 unsigned int sequence;
00159 } xcb_void_cookie_t;
00160
00161
00162
00163 #include "xproto.h"
00164
00165
00167 #define XCB_NONE 0L
00168
00170 #define XCB_COPY_FROM_PARENT 0L
00171
00173 #define XCB_CURRENT_TIME 0L
00174
00176 #define XCB_NO_SYMBOL 0L
00177
00178
00179
00180
00186 typedef struct xcb_auth_info_t {
00187 int namelen;
00188 char *name;
00189 int datalen;
00190 char *data;
00191 } xcb_auth_info_t;
00192
00193
00194
00195
00204 int xcb_flush(xcb_connection_t *c);
00205
00221 uint32_t xcb_get_maximum_request_length(xcb_connection_t *c);
00222
00240 void xcb_prefetch_maximum_request_length(xcb_connection_t *c);
00241
00242
00243
00244
00254 xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c);
00255
00268 xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
00269
00286 xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
00287
00302 void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
00303
00304
00305
00306
00310 typedef struct xcb_extension_t xcb_extension_t;
00328 const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00329
00341 void xcb_prefetch_extension_data(xcb_connection_t *c, xcb_extension_t *ext);
00342
00343
00344
00345
00364 const xcb_setup_t *xcb_get_setup(xcb_connection_t *c);
00365
00374 int xcb_get_file_descriptor(xcb_connection_t *c);
00375
00389 int xcb_connection_has_error(xcb_connection_t *c);
00390
00403 xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info);
00404
00412 void xcb_disconnect(xcb_connection_t *c);
00413
00414
00415
00416
00434 int xcb_parse_display(const char *name, char **host, int *display, int *screen);
00435
00448 xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
00449
00462 xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
00463
00464
00465
00466
00475 uint32_t xcb_generate_id(xcb_connection_t *c);
00476
00477
00482 #ifdef __cplusplus
00483 }
00484 #endif
00485
00486
00487 #endif