summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Osgood <iano@quirkster.com>2006-09-24 23:39:01 -0700
committerJamey Sharp <jamey@minilop.net>2006-09-24 23:39:01 -0700
commit87d00207f5a1f25a45a153618739cd6481814f89 (patch)
treec90643a55e3105063cea5361de1bdaa90ee00d5f
parent85a5e98dff9b7752fae157fad9b8c9825cb0efab (diff)
Track XCB's "Great Renaming".
-rw-r--r--include/X11/xcl.h34
-rw-r--r--src/ClDisplay.c2
-rw-r--r--src/OpenDis.c6
-rw-r--r--src/xcl/display.c16
-rw-r--r--src/xcl/io.c32
-rw-r--r--src/xcl/xcblock.c36
-rw-r--r--src/xclint.h2
7 files changed, 64 insertions, 64 deletions
diff --git a/include/X11/xcl.h b/include/X11/xcl.h
index 998916f..59efad6 100644
--- a/include/X11/xcl.h
+++ b/include/X11/xcl.h
@@ -13,37 +13,37 @@
* instructions. */
#define XCLCASTDECL(src_t, dst_t, field) \
- static inline XCB##dst_t XCL##dst_t(src_t src) \
+ static inline xcb_##dst_t xcl_##dst_t(src_t src) \
{ \
- XCB##dst_t dst; \
+ xcb_##dst_t dst; \
dst.field = src; \
return dst; \
}
#define XCLXIDCASTDECL(src_t, dst_t) XCLCASTDECL(src_t, dst_t, xid)
#define XCLIDCASTDECL(src_t, dst_t) XCLCASTDECL(src_t, dst_t, id)
-XCLXIDCASTDECL(Window, WINDOW)
-XCLXIDCASTDECL(Pixmap, PIXMAP)
-XCLXIDCASTDECL(Cursor, CURSOR)
-XCLXIDCASTDECL(Font, FONT)
-XCLXIDCASTDECL(GContext, GCONTEXT)
-XCLXIDCASTDECL(Colormap, COLORMAP)
-XCLXIDCASTDECL(Atom, ATOM)
+XCLXIDCASTDECL(Window, window_t)
+XCLXIDCASTDECL(Pixmap, pixmap_t)
+XCLXIDCASTDECL(Cursor, cursor_t)
+XCLXIDCASTDECL(Font, font_t)
+XCLXIDCASTDECL(GContext, gcontext_t)
+XCLXIDCASTDECL(Colormap, colormap_t)
+XCLXIDCASTDECL(Atom, atom_t)
/* For the union types, pick an arbitrary field of the union to hold the
* Xlib XID. Assumes the bit pattern is the same regardless of the field. */
-XCLCASTDECL(Drawable, DRAWABLE, window.xid)
-XCLCASTDECL(Font, FONTABLE, font.xid)
+XCLCASTDECL(Drawable, drawable_t, window.xid)
+XCLCASTDECL(Font, fontable_t, font.xid)
-XCLIDCASTDECL(VisualID, VISUALID)
-XCLIDCASTDECL(Time, TIMESTAMP)
-XCLIDCASTDECL(KeySym, KEYSYM)
-XCLIDCASTDECL(KeyCode, KEYCODE)
-XCLIDCASTDECL(CARD8, BUTTON)
+XCLIDCASTDECL(VisualID, visualid_t)
+XCLIDCASTDECL(Time, timestamp_t)
+XCLIDCASTDECL(KeySym, keysym_t)
+XCLIDCASTDECL(KeyCode, keycode_t)
+XCLIDCASTDECL(CARD8, button_t)
/* xcl/display.c */
-XCBConnection *XCBConnectionOfDisplay(Display *dpy);
+xcb_connection_t *XGetXCBConnection(Display *dpy);
/* xcl/io.c */
diff --git a/src/ClDisplay.c b/src/ClDisplay.c
index 4ee2bb6..3051d55 100644
--- a/src/ClDisplay.c
+++ b/src/ClDisplay.c
@@ -75,7 +75,7 @@ XCloseDisplay (
XSync(dpy, 1);
}
#if USE_XCB
- XCBDisconnect(XCBConnectionOfDisplay(dpy));
+ xcb_disconnect(XGetXCBConnection(dpy));
#else /* !USE_XCB */
_XDisconnectDisplay(dpy->trans_conn);
#endif /* USE_XCB */
diff --git a/src/OpenDis.c b/src/OpenDis.c
index 1092226..943aa03 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -362,7 +362,7 @@ XOpenDisplay (
#if USE_XCB
{
- const XCBSetup *xcbsetup = XCBGetSetup(XCBConnectionOfDisplay(dpy));
+ const xcb_setup_t *xcbsetup = xcb_get_setup(XGetXCBConnection(dpy));
setuplength = xcbsetup->length << 2;
memcpy(&prefix, xcbsetup, sizeof(prefix));
setup = (char *) xcbsetup;
@@ -672,7 +672,7 @@ XOpenDisplay (
(void) XSynchronize(dpy, _Xdebug);
#if USE_XCB
- dpy->bigreq_size = XCBGetMaximumRequestLength(XCBConnectionOfDisplay(dpy));
+ dpy->bigreq_size = xcb_get_maximum_request_length(XGetXCBConnection(dpy));
if(dpy->bigreq_size <= dpy->max_request_size)
dpy->bigreq_size = 0;
#endif /* USE_XCB */
@@ -920,7 +920,7 @@ static void OutOfMemory (dpy, setup)
char *setup;
{
#if USE_XCB
- XCBDisconnect(XCBConnectionOfDisplay(dpy));
+ xcb_disconnect(XGetXCBConnection(dpy));
#else /* !USE_XCB */
_XDisconnectDisplay (dpy->trans_conn);
#endif /* USE_XCB */
diff --git a/src/xcl/display.c b/src/xcl/display.c
index 9b233b5..93fd15c 100644
--- a/src/xcl/display.c
+++ b/src/xcl/display.c
@@ -10,7 +10,7 @@
void _XFreeDisplayStructure(Display *dpy);
-static XCBAuthInfo xauth;
+static xcb_auth_info_t xauth;
static void *alloc_copy(const void *src, int *dstn, size_t n)
{
@@ -28,7 +28,7 @@ static void *alloc_copy(const void *src, int *dstn, size_t n)
return dst;
}
-XCBConnection *XCBConnectionOfDisplay(Display *dpy)
+xcb_connection_t *XGetXCBConnection(Display *dpy)
{
return dpy->xcl->connection;
}
@@ -62,7 +62,7 @@ int _XConnectXCB(Display *dpy, _Xconst char *display, char **fullnamep, int *scr
char *host;
int n = 0;
int len;
- XCBConnection *c;
+ xcb_connection_t *c;
dpy->fd = -1;
@@ -70,7 +70,7 @@ int _XConnectXCB(Display *dpy, _Xconst char *display, char **fullnamep, int *scr
if(!dpy->xcl)
return 0;
- if(!XCBParseDisplay(display, &host, &n, screenp))
+ if(!xcb_parse_display(display, &host, &n, screenp))
return 0;
len = strlen(host) + (1 + 20 + 1 + 20 + 1);
@@ -80,19 +80,19 @@ int _XConnectXCB(Display *dpy, _Xconst char *display, char **fullnamep, int *scr
_XLockMutex(_Xglobal_lock);
if(xauth.name && xauth.data)
- c = XCBConnectToDisplayWithAuthInfo(display, &xauth, 0);
+ c = xcb_connect_to_display_with_auth_info(display, &xauth, 0);
else
- c = XCBConnect(display, 0);
+ c = xcb_connect(display, 0);
_XUnlockMutex(_Xglobal_lock);
if(!c)
return 0;
- dpy->fd = XCBGetFileDescriptor(c);
+ dpy->fd = xcb_get_file_descriptor(c);
dpy->xcl->connection = c;
dpy->xcl->pending_requests_tail = &dpy->xcl->pending_requests;
- dpy->xcl->next_xid = XCBGenerateID(dpy->xcl->connection);
+ dpy->xcl->next_xid = xcb_generate_id(dpy->xcl->connection);
return 1;
}
diff --git a/src/xcl/io.c b/src/xcl/io.c
index 03cf180..9c3b3f4 100644
--- a/src/xcl/io.c
+++ b/src/xcl/io.c
@@ -67,7 +67,7 @@ static void check_internal_connections(Display *dpy)
}
}
-static void handle_event(Display *dpy, XCBGenericEvent *e)
+static void handle_event(Display *dpy, xcb_generic_event_t *e)
{
if(!e)
_XIOError(dpy);
@@ -86,8 +86,8 @@ void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner)
int _XEventsQueued(Display *dpy, int mode)
{
- XCBConnection *c;
- XCBGenericEvent *e;
+ xcb_connection_t *c;
+ xcb_generic_event_t *e;
int ret;
if(dpy->xcl->event_owner != XlibOwnsEventQueue)
return 0;
@@ -97,7 +97,7 @@ int _XEventsQueued(Display *dpy, int mode)
_XSend(dpy, 0, 0);
else
check_internal_connections(dpy);
- while((e = XCBPollForEvent(c, &ret)))
+ while((e = xcb_poll_for_event(c, &ret)))
handle_event(dpy, e);
if(ret)
_XIOError(dpy);
@@ -112,7 +112,7 @@ void _XReadEvents(Display *dpy)
_XSend(dpy, 0, 0);
if(dpy->xcl->event_owner != XlibOwnsEventQueue)
return;
- handle_event(dpy, XCBWaitForEvent(dpy->xcl->connection));
+ handle_event(dpy, xcb_wait_for_event(dpy->xcl->connection));
_XEventsQueued(dpy, QueuedAfterReading);
}
@@ -125,7 +125,7 @@ void _XReadEvents(Display *dpy)
*/
void _XSend(Display *dpy, const char *data, long size)
{
- XCBConnection *c = dpy->xcl->connection;
+ xcb_connection_t *c = dpy->xcl->connection;
assert(!dpy->xcl->request_extra);
dpy->xcl->request_extra = data;
@@ -134,7 +134,7 @@ void _XSend(Display *dpy, const char *data, long size)
/* give dpy->buffer to XCB */
_XPutXCBBuffer(dpy);
- if(XCBFlush(c) <= 0)
+ if(xcb_flush(c) <= 0)
_XIOError(dpy);
/* get a new dpy->buffer */
@@ -165,7 +165,7 @@ void _XFlush(Display *dpy)
static int
_XIDHandler(Display *dpy)
{
- XID next = XCBGenerateID(dpy->xcl->connection);
+ XID next = xcb_generate_id(dpy->xcl->connection);
LockDisplay(dpy);
dpy->xcl->next_xid = next;
if(dpy->flags & XlibDisplayPrivSync)
@@ -197,7 +197,7 @@ void _XAllocIDs(Display *dpy, XID *ids, int count)
int i;
_XPutXCBBuffer(dpy);
for (i = 0; i < count; i++)
- ids[i] = XCBGenerateID(dpy->xcl->connection);
+ ids[i] = xcb_generate_id(dpy->xcl->connection);
_XGetXCBBuffer(dpy);
}
@@ -217,8 +217,8 @@ static void _XFreeReplyData(Display *dpy, Bool force)
*/
Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
{
- XCBGenericError *error;
- XCBConnection *c = dpy->xcl->connection;
+ xcb_generic_error_t *error;
+ xcb_connection_t *c = dpy->xcl->connection;
unsigned long request = dpy->request;
char *reply;
@@ -227,7 +227,7 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
UnlockDisplay(dpy);
/* release buffer if UnlockDisplay didn't already */
_XPutXCBBufferIf(dpy, _XBufferLocked);
- reply = XCBWaitForReply(c, request, &error);
+ reply = xcb_wait_for_reply(c, request, &error);
/* re-acquire buffer if LockDisplay won't otherwise */
_XGetXCBBufferIf(dpy, _XBufferLocked);
LockDisplay(dpy);
@@ -236,11 +236,11 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
if(dpy->xcl->event_owner == XlibOwnsEventQueue)
{
- XCBGenericEvent *e;
+ xcb_generic_event_t *e;
int ret;
- while((e = XCBPollForEvent(c, &ret)))
+ while((e = xcb_poll_for_event(c, &ret)))
if(e->response_type == 0 && e->full_sequence == request)
- error = (XCBGenericError *) e;
+ error = (xcb_generic_error_t *) e;
else
handle_event(dpy, e);
}
@@ -305,7 +305,7 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
dpy->xcl->reply_consumed = sizeof(xReply) + (extra * 4);
dpy->xcl->reply_length = sizeof(xReply);
if(dpy->xcl->reply_data[0] == 1)
- dpy->xcl->reply_length += (((XCBGenericRep *) dpy->xcl->reply_data)->length * 4);
+ dpy->xcl->reply_length += (((xcb_generic_reply_t *) dpy->xcl->reply_data)->length * 4);
/* error: Xlib asks too much. give them what we can anyway. */
if(dpy->xcl->reply_length < dpy->xcl->reply_consumed)
diff --git a/src/xcl/xcblock.c b/src/xcl/xcblock.c
index f46f607..68ca3c8 100644
--- a/src/xcl/xcblock.c
+++ b/src/xcl/xcblock.c
@@ -20,7 +20,7 @@
static void _XLockDisplay(Display *dpy)
{
- pthread_mutex_lock(XCBGetIOLock(dpy->xcl->connection));
+ pthread_mutex_lock(xcb_get_io_lock(dpy->xcl->connection));
_XGetXCBBufferIf(dpy, _XBufferUnlocked);
++dpy->xcl->lock_count;
}
@@ -47,14 +47,14 @@ static void _XUnlockDisplay(Display *dpy)
if(!dpy->xcl->lock_count)
{
assert(dpy->xcl->partial_request == 0);
- assert(XCBGetRequestSent(dpy->xcl->connection) == dpy->request);
+ assert(xcb_get_request_sent(dpy->xcl->connection) == dpy->request);
/* Traditional Xlib does this in _XSend; see the Xlib/XCB version
* of that function for why we do it here instead. */
_XSetSeqSyncFunction(dpy);
}
- pthread_mutex_unlock(XCBGetIOLock(dpy->xcl->connection));
+ pthread_mutex_unlock(xcb_get_io_lock(dpy->xcl->connection));
}
void XUnlockDisplay(Display* dpy)
@@ -68,12 +68,12 @@ int _XInitDisplayLock(Display *dpy)
{
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
pthread_mutex_t lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
- *XCBGetIOLock(dpy->xcl->connection) = lock;
+ *xcb_get_io_lock(dpy->xcl->connection) = lock;
#else
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(XCBGetIOLock(dpy->xcl->connection), &attr);
+ pthread_mutex_init(xcb_get_io_lock(dpy->xcl->connection), &attr);
pthread_mutexattr_destroy(&attr);
#endif
@@ -97,7 +97,7 @@ void _XFreeDisplayLock(Display *dpy)
}
}
-static void call_handlers(Display *dpy, XCBGenericRep *buf)
+static void call_handlers(Display *dpy, xcb_generic_reply_t *buf)
{
_XAsyncHandler *async, *next;
for(async = dpy->async_handlers; async; async = next)
@@ -115,14 +115,14 @@ void _XGetXCBBuffer(Display *dpy)
static const xReq dummy_request;
unsigned int xcb_req;
void *reply;
- XCBGenericError *error;
+ xcb_generic_error_t *error;
PendingRequest *req;
- XCBConnection *c = dpy->xcl->connection;
+ xcb_connection_t *c = dpy->xcl->connection;
dpy->last_req = (char *) &dummy_request;
- xcb_req = XCBGetRequestSent(c);
+ xcb_req = xcb_get_request_sent(c);
/* if Xlib has a partial request pending then XCB doesn't know about
* the current request yet */
if(dpy->xcl->partial_request)
@@ -133,7 +133,7 @@ void _XGetXCBBuffer(Display *dpy)
while((req = dpy->xcl->pending_requests)
&& dpy->request != req->sequence
- && XCBPollForReply(c, req->sequence, &reply, &error))
+ && xcb_poll_for_reply(c, req->sequence, &reply, &error))
{
dpy->xcl->pending_requests = req->next;
if(!reply)
@@ -159,19 +159,19 @@ static size_t request_length(struct iovec *vec)
* fixed-length request parts. */
size_t len;
assert(vec[0].iov_len >= 4);
- len = ((CARD16 *) vec[0].iov_base)[1];
+ len = ((uint16_t *) vec[0].iov_base)[1];
if(len == 0)
{
/* it's a bigrequest. dig out the *real* length field. */
assert(vec[0].iov_len >= 8);
- len = ((CARD32 *) vec[0].iov_base)[1];
+ len = ((uint32_t *) vec[0].iov_base)[1];
}
return len << 2;
}
static inline int issue_complete_request(Display *dpy, int veclen, struct iovec *vec)
{
- XCBProtocolRequest xcb_req = { 0 };
+ xcb_protocol_request_t xcb_req = { 0 };
unsigned int sequence;
int flags = XCB_REQUEST_RAW;
int i;
@@ -206,7 +206,7 @@ static inline int issue_complete_request(Display *dpy, int veclen, struct iovec
* we actually overshot, or 0 if we're right on.) */
vec[i].iov_len += len;
xcb_req.count = i + 1;
- xcb_req.opcode = ((CARD8 *) vec[0].iov_base)[0];
+ xcb_req.opcode = ((uint8_t *) vec[0].iov_base)[0];
/* if we don't own the event queue, we have to ask XCB to set our
* errors aside for us. */
@@ -214,10 +214,10 @@ static inline int issue_complete_request(Display *dpy, int veclen, struct iovec
flags |= XCB_REQUEST_CHECKED;
/* XCB will always skip request 0; account for that in the Xlib count */
- if (XCBGetRequestSent(dpy->xcl->connection) == 0xffffffff)
+ if (xcb_get_request_sent(dpy->xcl->connection) == 0xffffffff)
dpy->request++;
/* send the accumulated request. */
- sequence = XCBSendRequest(dpy->xcl->connection, flags, vec, &xcb_req);
+ sequence = xcb_send_request(dpy->xcl->connection, flags, vec, &xcb_req);
if(!sequence)
_XIOError(dpy);
@@ -244,12 +244,12 @@ void _XPutXCBBuffer(Display *dpy)
{
static char const pad[3];
const int padsize = -dpy->xcl->request_extra_size & 3;
- XCBConnection *c = dpy->xcl->connection;
+ xcb_connection_t *c = dpy->xcl->connection;
_XExtension *ext;
struct iovec iov[6];
assert_sequence_less(dpy->last_request_read, dpy->request);
- assert_sequence_less(XCBGetRequestSent(c), dpy->request);
+ assert_sequence_less(xcb_get_request_sent(c), dpy->request);
for(ext = dpy->flushes; ext; ext = ext->next_flush)
{
diff --git a/src/xclint.h b/src/xclint.h
index 58171c2..308647e 100644
--- a/src/xclint.h
+++ b/src/xclint.h
@@ -17,7 +17,7 @@ struct PendingRequest {
};
typedef struct XCLPrivate {
- XCBConnection *connection;
+ xcb_connection_t *connection;
PendingRequest *pending_requests;
PendingRequest **pending_requests_tail;
const char *request_extra;