Xxcbint.h 1.2 KB
Newer Older
1
/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett
2 3
 * This file is licensed under the MIT license. See the file COPYING. */

4 5
#ifndef XXCBINT_H
#define XXCBINT_H
6 7

#include <assert.h>
8
#include <stdint.h>
9
#include <X11/Xlibint.h>
10 11 12
#ifdef WIN32
#include <X11/Xwindows.h>
#endif
13
#include <X11/Xlib-xcb.h>
14
#include "locking.h"
15

16
#define XLIB_SEQUENCE_COMPARE(a,op,b)	(((int64_t) (a) - (int64_t) (b)) op 0)
17 18 19 20

typedef struct PendingRequest PendingRequest;
struct PendingRequest {
	PendingRequest *next;
21
	uint64_t sequence;
22
	unsigned reply_waiter;
23 24
};

25
typedef struct _X11XCBPrivate {
26
	xcb_connection_t *connection;
27
	PendingRequest *pending_requests;
28
	PendingRequest *pending_requests_tail;
29
	xcb_generic_event_t *next_event;
30
	char *real_bufmax;
31 32 33
	char *reply_data;
	int reply_length;
	int reply_consumed;
34
	uint64_t last_flushed;
35
	enum XEventQueueOwner event_owner;
36
	XID next_xid;
37

38
	/* handle simultaneous threads waiting for responses */
39 40
	xcondition_t event_notify;
	int event_waiter;
41
	xcondition_t reply_notify;
42
} _X11XCBPrivate;
43

44
/* xcb_disp.c */
45

46
int _XConnectXCB(Display *dpy, _Xconst char *display, int *screenp);
47
void _XFreeX11XCBStructure(Display *dpy);
48

49
_X_HIDDEN
50 51
unsigned long _XNextRequest(Display *dpy);

52
#endif /* XXCBINT_H */