Commit e754b3b0 authored by Josh Triplett's avatar Josh Triplett

Split public Xlib/XCB functions into libX11-xcb

We can never change the libX11 soname, and we don't want to commit to never
changing the public Xlib/XCB functions, so split them into a separate library
libX11-xcb.  This also means that a program linked solely against libX11
should work with either Xlib or Xlib/XCB, which will make life easier for
package maintainers.
Signed-off-by: Josh Triplett's avatarJosh Triplett <josh@freedesktop.org>
Acked-by: Jamey Sharp's avatarJamey Sharp <jamey@minilop.net>
parent ffd367f7
......@@ -16,4 +16,5 @@ MakeOut
missing
mkinstalldirs
x11.pc
x11-xcb.pc
*~
......@@ -442,7 +442,8 @@ AC_OUTPUT([Makefile
nls/zh_TW/Makefile
nls/zh_TW.big5/Makefile
nls/zh_TW.UTF-8/Makefile
x11.pc])
x11.pc
x11-xcb.pc])
echo ""
echo "X11 will be built with the following settings:"
......
......@@ -75,7 +75,7 @@ XCloseDisplay (
XSync(dpy, 1);
}
#if USE_XCB
xcb_disconnect(XGetXCBConnection(dpy));
xcb_disconnect(dpy->xcl->connection);
#else /* !USE_XCB */
_XDisconnectDisplay(dpy->trans_conn);
#endif /* USE_XCB */
......
......@@ -345,6 +345,11 @@ libX11_la_SOURCES += \
xcl/xcblock.c \
xcl/display.c \
xcl/io.c
lib_LTLIBRARIES += libX11-xcb.la
libX11_xcb_la_SOURCES = xcl/x11-xcb.c
libX11_xcb_la_LDFLAGS = -version-info 1:0:0 -no-undefined
libX11_xcb_la_LIBADD = libX11.la
else
libX11_la_SOURCES += \
ConnDis.c \
......
......@@ -363,7 +363,7 @@ XOpenDisplay (
#if USE_XCB
{
const xcb_setup_t *xcbsetup = xcb_get_setup(XGetXCBConnection(dpy));
const xcb_setup_t *xcbsetup = xcb_get_setup(dpy->xcl->connection);
setuplength = xcbsetup->length << 2;
memcpy(&prefix, xcbsetup, sizeof(prefix));
setup = (char *) xcbsetup;
......@@ -673,7 +673,7 @@ XOpenDisplay (
(void) XSynchronize(dpy, _Xdebug);
#if USE_XCB
dpy->bigreq_size = xcb_get_maximum_request_length(XGetXCBConnection(dpy));
dpy->bigreq_size = xcb_get_maximum_request_length(dpy->xcl->connection);
if(dpy->bigreq_size <= dpy->max_request_size)
dpy->bigreq_size = 0;
#endif /* USE_XCB */
......@@ -921,7 +921,7 @@ static void OutOfMemory (dpy, setup)
char *setup;
{
#if USE_XCB
xcb_disconnect(XGetXCBConnection(dpy));
xcb_disconnect(dpy->xcl->connection);
#else /* !USE_XCB */
_XDisconnectDisplay (dpy->trans_conn);
#endif /* USE_XCB */
......
......@@ -28,11 +28,6 @@ static void *alloc_copy(const void *src, int *dstn, size_t n)
return dst;
}
xcb_connection_t *XGetXCBConnection(Display *dpy)
{
return dpy->xcl->connection;
}
void XSetAuthorization(char *name, int namelen, char *data, int datalen)
{
_XLockMutex(_Xglobal_lock);
......
......@@ -79,11 +79,6 @@ static void handle_event(Display *dpy, xcb_generic_event_t *e)
free(e);
}
void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner)
{
dpy->xcl->event_owner = owner;
}
int _XEventsQueued(Display *dpy, int mode)
{
xcb_connection_t *c;
......
/* Copyright (C) 2003,2006 Jamey Sharp, Josh Triplett
* This file is licensed under the MIT license. See the file COPYING. */
#include "Xlibint.h"
#include "xclint.h"
xcb_connection_t *XGetXCBConnection(Display *dpy)
{
return dpy->xcl->connection;
}
void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner)
{
dpy->xcl->event_owner = owner;
}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: X11 XCB
Description: X Library XCB interface
Version: @PACKAGE_VERSION@
Requires: x11 xcb
Cflags: -I${includedir}
Libs: -L${libdir} -lX11-xcb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment