XCB  1.10
xcb.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.
3  * All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Except as contained in this notice, the names of the authors or their
23  * institutions shall not be used in advertising or otherwise to promote the
24  * sale, use or other dealings in this Software without prior written
25  * authorization from the authors.
26  */
27 
28 #ifndef __XCB_H__
29 #define __XCB_H__
30 #include <sys/types.h>
31 
32 #if defined(__solaris__)
33 #include <inttypes.h>
34 #else
35 #include <stdint.h>
36 #endif
37 
38 #ifndef _WIN32
39 #include <sys/uio.h>
40 #else
41 #include "xcb_windefs.h"
42 #endif
43 #include <pthread.h>
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
61 /* Pre-defined constants */
62 
64 #define X_PROTOCOL 11
65 
67 #define X_PROTOCOL_REVISION 0
68 
70 #define X_TCP_PORT 6000
71 
73 #define XCB_CONN_ERROR 1
74 
76 #define XCB_CONN_CLOSED_EXT_NOTSUPPORTED 2
77 
79 #define XCB_CONN_CLOSED_MEM_INSUFFICIENT 3
80 
82 #define XCB_CONN_CLOSED_REQ_LEN_EXCEED 4
83 
85 #define XCB_CONN_CLOSED_PARSE_ERR 5
86 
88 #define XCB_CONN_CLOSED_INVALID_SCREEN 6
89 
91 #define XCB_CONN_CLOSED_FDPASSING_FAILED 7
92 
93 #define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
94 
95 /* Opaque structures */
96 
105 /* Other types */
106 
112 typedef struct {
113  void *data;
114  int rem;
115  int index;
117 
123 typedef struct {
124  uint8_t response_type;
125  uint8_t pad0;
126  uint16_t sequence;
127  uint32_t length;
129 
135 typedef struct {
136  uint8_t response_type;
137  uint8_t pad0;
138  uint16_t sequence;
139  uint32_t pad[7];
140  uint32_t full_sequence;
142 
152 typedef struct {
153  uint8_t response_type;
154  uint8_t pad0;
155  uint16_t sequence;
156  uint32_t length;
157  uint16_t event_type;
158  uint16_t pad1;
159  uint32_t pad[5];
160  uint32_t full_sequence;
162 
168 typedef struct {
169  uint8_t response_type;
170  uint8_t error_code;
171  uint16_t sequence;
172  uint32_t resource_id;
173  uint16_t minor_code;
174  uint8_t major_code;
175  uint8_t pad0;
176  uint32_t pad[5];
177  uint32_t full_sequence;
179 
185 typedef struct {
186  unsigned int sequence;
188 
189 
190 /* Include the generated xproto header. */
191 #include "xproto.h"
192 
193 
195 #define XCB_NONE 0L
196 
198 #define XCB_COPY_FROM_PARENT 0L
199 
201 #define XCB_CURRENT_TIME 0L
202 
204 #define XCB_NO_SYMBOL 0L
205 
206 
207 /* xcb_auth.c */
208 
214 typedef struct xcb_auth_info_t {
215  int namelen;
216  char *name;
217  int datalen;
218  char *data;
220 
221 
222 /* xcb_out.c */
223 
233 
250 
269 
270 
271 /* xcb_in.c */
272 
283 
296 
312 
314 
319  xcb_special_event_t *se);
320 
325  xcb_special_event_t *se);
336  xcb_extension_t *ext,
337  uint32_t eid,
338  uint32_t *stamp);
339 
344  xcb_special_event_t *se);
345 
363 
378 void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
379 
380 
381 /* xcb_ext.c */
382 
400 
413 
414 
415 /* xcb_conn.c */
416 
436 
446 
465 
479 
488 
489 
490 /* xcb_util.c */
491 
509 int xcb_parse_display(const char *name, char **host, int *display, int *screen);
510 
523 xcb_connection_t *xcb_connect(const char *displayname, int *screenp);
524 
537 xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen);
538 
539 
540 /* xcb_xid.c */
541 
550 uint32_t xcb_generate_id(xcb_connection_t *c);
551 
552 
557 #ifdef __cplusplus
558 }
559 #endif
560 
561 
562 #endif /* __XCB_H__ */