XCB (X protocol C-language Binding) is a library implementing the client-side of the X11 display server protocol. XCB written in the C programming language and distributed under the MIT License. The project was started in 2001 by Bart Massey and aims to replace Xlib.
Xlib/XCB provides application binary interface compatibility with both Xlib and XCB, providing an incremental porting path. Xlib/XCB uses the protocol layer of Xlib, but replaces the Xlib transport layer with XCB, and provides access to the underlying XCB connection for direct use of XCB. Xlib/XCB allows an application to open a single connection to the X display server and use both XCB and Xlib, possibly through a mixture of libraries designed for one or the other.[2][3]
The main goals of XCB are to
- Reduce library size and complexity;
- Provide direct access to the X11 protocol.
Secondary goals include making the C interface asynchronous, facilitating better multithreading and making it easier to implement extensions (via XML protocol descriptions).
The core and extension protocol descriptions are in XML, with a program written in Python creating the C bindings. (Previous versions used XSLT and M4.)
A further goal is to be able to use these protocol descriptions to create protocol documentation, more language bindings, and server-side stubs.
Massey and others have worked to prove key portions of XCB formally correct using Z notation.[4] (Xlib has long been known to contain errors.[5])
个人理解:XLIB就是libx11.so,XCB是能替换XLIB的一部分Server协议的传输,libxcb.so,两个可以兼容搭配使用,libx11-xcb.so