encyclopegia.org

XCB

.[src] graphics stack or FLTK or Qt for their GUI widgets.[src] XCB (X protocol C-language Binding) is a library implementing the client side of the X11 display server protocol.[src] XCB is written in the C programming language and distributed under the MIT License.[src] The project was started in 2001 by Bart Massey and aims to replace Xlib.[1]

.]] graphics stack]] or FLTK or Qt for their GUI widgets.]] XCB (X protocol C-language Binding) is a library implementing the client side of the X11 display server protocol.[src] XCB is written in the C programming language and distributed under the MIT License.[src] The project was started in 2001 by Bart Massey and aims to replace Xlib.[1] ==Overview== XCB was designed as a smaller, modernized replacement for Xlib, previously the primary C library for communicating with the X window system, coinciding with a more complete overhaul of the X implementation that took place during the early 2000s.[1] The main goals of XCB are to: reduce library size and complexity provide direct access to the X11 protocol The required size reduction is achieved primarily by restricting XCB's scope to handling the X protocol and omitting Xlib functionality such as its extensive utility library, much of which saw little use by applications.[1] This results in a factor thirty reduction of the compiled library size (as of 2004).[src] Secondary goals include making the C interface asynchronous, facilitating better multithreading and making it easier to implement extensions (via XML protocol descriptions).[src] The core and extension protocol descriptions are in XML, with a program written in Python creating the C bindings.[src] (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.[src] Massey and others have worked to prove key portions of XCB formally correct using Z notation.[1] (Xlib has long been known to contain errors.[6] ) ===Xlib compatibility=== Xlib/XCB provides application binary interface compatibility with both Xlib and XCB, providing an incremental porting path.[1] 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.[1] 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.[1] ==Example== // Simple XCB application for opening a window and drawing a box in it // To compile it using GNU, use: // gcc x.c -lxcb include include include int main(void) { xcb_connection_t *connection; xcb_screen_t *screen; xcb_window_t window; xcb_gcontext_t context; xcb_generic_event_t *event; uint32_t mask; uint32_t values[2]; int done = 0; xcb_rectangle_t r = { 20, 20, 60, 60 }; // open connection to the server connection = xcb_connect(NULL, NULL); if (xcb_connection_has_error(connection)) { printf("Cannot open display\n"); exit(EXIT_FAILURE); } // get the first screen screen = xcb_setup_roots_iterator( xcb_get_setup(connection) ).data; // create black graphics context context = xcb_generate_id(connection); window = screen->root; mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; values[0] = screen->black_pixel; values[1] = 0; xcb_create_gc(connection, context, window, mask, values); // create window window = xcb_generate_id(connection); mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK; values[0] = screen->white_pixel; values[1] = XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS; xcb_create_window(connection, screen->root_depth, window, screen->root, 10, 10, 100, 100, 1, XCB_WINDOW_CLASS_INPUT_OUTPUT, screen->root_visual, mask, values); // map (show) the window xcb_map_window(connection, window); xcb_flush(connection); // event loop while (!done && (event = xcb_wait_for_event(connection))) { switch (event->response_type & ~0x80) { case XCB_EXPOSE: // draw or redraw the window xcb_poly_fill_rectangle(connection, window, context, 1, &r); xcb_flush(connection); break; case XCB_KEY_PRESS: // exit on key press done = 1; break; } free(event); } // close connection to server xcb_disconnect(connection); exit(EXIT_SUCCESS); } The bitwise and operation a->response_type & ~0x80 removes a bit that indicates where the event came from.[9] XCB has a comparable, but slightly lower-level API than Xlib, as can be seen with this example.[1] ==Protocol description== Creators of XCB have invented a specialized interface description language to model X11 protocol in language-neutral way and facilitate generation of bindings to other programming languages.[src] libxcb itself is implemented as a code generator and a tiny C stub of utility functions.[src] An example: ==Logo== The XCB logo was produced by Gearóid Molloy, author of the web comic Neko the Kitty, and donated to the project.[src] ==Other language bindings== XCB.pm - Perl module implementing bindings to XCB.[src] xpyb - The Python binding to the X Window System using XCB.[3] As of June 2013, it does not support Python 3.[6] Provided by freedesktop.org.[2] xcffib - Another Python binding which supports Python 2 & 3 as well as several more X extensions than xpyb.[src] guile-xcb - Guile module implementing a language to treat the xcb definition as source code.[src] ==Notes== ==References== ==External links== XCB wiki (freedesktop.org) XCB API reference, tutorial libxcb tutorial Further publications The X New Developer’s Guide: Xlib and XCB[2]

31 sentences · 31 cited inline · 11 references stored

References

  1. Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Freenix Track Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Freenix Track Wikipedia revision 1371336843, retrieved 2026-11-19." Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Fr. 2026-11-18. https://www.usenix.org/legacy/event/usenix02/tech/freenix/full_papers/sharp/sharp_html/. Accessed 25 November 2026.

    Chicago "Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Freenix Track Wikipedia revision 1371336843, retrieved 2026-11-19." Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Fr. 2026-11-18. https://www.usenix.org/legacy/event/usenix02/tech/freenix/full_papers/sharp/sharp_html/.

    APA Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Fr. (2026). Jamey Sharp; Bart Massey (2002), XCL : An Xlib Compatibility Layer For XCB , USENIX 2002 Annual Technical Conference, Freenix Track Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from https://www.usenix.org/legacy/event/usenix02/tech/freenix/full_papers/sharp/sharp_html/

  2. KittyLogo (xcb.freedesktop.org) Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "KittyLogo (xcb.freedesktop.org) Wikipedia revision 1371336843, retrieved 2026-11-19." KittyLogo (xcb. 2026-11-18. http://xcb.freedesktop.org/KittyLogo/. Accessed 25 November 2026.

    Chicago "KittyLogo (xcb.freedesktop.org) Wikipedia revision 1371336843, retrieved 2026-11-19." KittyLogo (xcb. 2026-11-18. http://xcb.freedesktop.org/KittyLogo/.

    APA KittyLogo (xcb. (2026). KittyLogo (xcb.freedesktop.org) Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from http://xcb.freedesktop.org/KittyLogo/

  3. Gettys, James; Packard, Keith (2004). The (Re) Architecture of the X Window System (PDF) . Proc. Linux Symposium. Vol. 1. Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Gettys, James; Packard, Keith (2004). The (Re) Architecture of the X Window System (PDF) . Proc. Linux Symposium. Vol. 1. Wikipedia revision 1371336843, retrieved 2026-11-19." Gettys, James; Packard, Keith (2004). 2026-11-18. https://keithp.com/~keithp/talks/xarch_ols2004/xarch_ols2004.pdf. Accessed 25 November 2026.

    Chicago "Gettys, James; Packard, Keith (2004). The (Re) Architecture of the X Window System (PDF) . Proc. Linux Symposium. Vol. 1. Wikipedia revision 1371336843, retrieved 2026-11-19." Gettys, James; Packard, Keith (2004). 2026-11-18. https://keithp.com/~keithp/talks/xarch_ols2004/xarch_ols2004.pdf.

    APA Gettys, James; Packard, Keith (2004). (2026). Gettys, James; Packard, Keith (2004). The (Re) Architecture of the X Window System (PDF) . Proc. Linux Symposium. Vol. 1. Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from https://keithp.com/~keithp/talks/xarch_ols2004/xarch_ols2004.pdf

  4. Sharp, Jamey (2004). How Xlib is Implemented (And What We're Doing About It) (PDF) . Proc. Usenix Annual Techn. Conf., Freenix Track. Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Sharp, Jamey (2004). How Xlib is Implemented (And What We're Doing About It) (PDF) . Proc. Usenix Annual Techn. Conf., Freenix Track. Wikipedia revision 1371336843, retrieved 2026-11-19." Sharp, Jamey (2004). 2026-11-18. http://www.freedesktop.org/software/xcb/xlib_impl.pdf. Accessed 25 November 2026.

    Chicago "Sharp, Jamey (2004). How Xlib is Implemented (And What We're Doing About It) (PDF) . Proc. Usenix Annual Techn. Conf., Freenix Track. Wikipedia revision 1371336843, retrieved 2026-11-19." Sharp, Jamey (2004). 2026-11-18. http://www.freedesktop.org/software/xcb/xlib_impl.pdf.

    APA Sharp, Jamey (2004). (2026). Sharp, Jamey (2004). How Xlib is Implemented (And What We're Doing About It) (PDF) . Proc. Usenix Annual Techn. Conf., Freenix Track. Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from http://www.freedesktop.org/software/xcb/xlib_impl.pdf

  5. Massey and Bauer, 2002 . Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Massey and Bauer, 2002 . Wikipedia revision 1371336843, retrieved 2026-11-19." Massey and Bauer, 2002. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1371336843. Accessed 25 November 2026.

    Chicago "Massey and Bauer, 2002 . Wikipedia revision 1371336843, retrieved 2026-11-19." Massey and Bauer, 2002. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1371336843.

    APA Massey and Bauer, 2002. (2026). Massey and Bauer, 2002 . Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1371336843

  6. Sharp and Massey, 2002 , §2.4. "While Xlib was designed to support threaded applications, and while that support is not unusable, there are known race conditions that cannot be eliminated without changing the Xlib interface." Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Sharp and Massey, 2002 , §2.4. "While Xlib was designed to support threaded applications, and while that support is not unusable, there are known race conditions that cannot be eliminated without changing the Xlib interface." Wikipedia revision 1371336843, retrieved 2026-11-19." Sharp and Massey, 2002 , §2. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1371336843. Accessed 25 November 2026.

    Chicago "Sharp and Massey, 2002 , §2.4. "While Xlib was designed to support threaded applications, and while that support is not unusable, there are known race conditions that cannot be eliminated without changing the Xlib interface." Wikipedia revision 1371336843, retrieved 2026-11-19." Sharp and Massey, 2002 , §2. 2026-11-18. https://en.wikipedia.org/w/index.php?oldid=1371336843.

    APA Sharp and Massey, 2002 , §2. (2026). Sharp and Massey, 2002 , §2.4. "While Xlib was designed to support threaded applications, and while that support is not unusable, there are known race conditions that cannot be eliminated without changing the Xlib interface." Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1371336843

  7. Xlib/XCB: Xlib with XCB transport · retrieved 2009-09-10 · rev 1371336843
    Cite this reference

    MLA "Xlib/XCB: Xlib with XCB transport." 2009-09-10. http://xcb.freedesktop.org/XlibXcb/. Accessed 25 November 2026.

    Chicago "Xlib/XCB: Xlib with XCB transport." 2009-09-10. http://xcb.freedesktop.org/XlibXcb/.

    APA encyclopegia.org. (2009). Xlib/XCB: Xlib with XCB transport. Retrieved November 25, 2026, from http://xcb.freedesktop.org/XlibXcb/

  8. libx11 with Xlib/XCB now in experimental; please test with your packages · retrieved 2009-09-10 · rev 1371336843
    Cite this reference

    MLA "libx11 with Xlib/XCB now in experimental; please test with your packages." Jamey Sharp and Josh Triplett (2006-11-26). 2009-09-10. http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html. Accessed 25 November 2026.

    Chicago "libx11 with Xlib/XCB now in experimental; please test with your packages." Jamey Sharp and Josh Triplett (2006-11-26). 2009-09-10. http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html.

    APA Jamey Sharp and Josh Triplett (2006-11-26). (2009). libx11 with Xlib/XCB now in experimental; please test with your packages. Retrieved November 25, 2026, from http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html

  9. X Window System Protocol · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "X Window System Protocol." 2026-11-18. https://www.x.org/releases/current/doc/xproto/x11protocol.html#event_format. Accessed 25 November 2026.

    Chicago "X Window System Protocol." 2026-11-18. https://www.x.org/releases/current/doc/xproto/x11protocol.html#event_format.

    APA encyclopegia.org. (2026). X Window System Protocol. Retrieved November 25, 2026, from https://www.x.org/releases/current/doc/xproto/x11protocol.html#event_format

  10. Maloney, Ross J. (31 March 2018). Low Level X Window Programming: An Introduction by Examples . Springer. pp. 225– 244. ISBN 978-3-319-74250-2 . Retrieved 17 May 2022 . Wikipedia revision 1371336843, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "Maloney, Ross J. (31 March 2018). Low Level X Window Programming: An Introduction by Examples . Springer. pp. 225– 244. ISBN 978-3-319-74250-2 . Retrieved 17 May 2022 . Wikipedia revision 1371336843, retrieved 2026-11-19." Maloney, Ross J. 2026-11-18. https://books.google.com/books?id=8r1TDwAAQBAJ&dq=XCB+library&pg=PA225. Accessed 25 November 2026.

    Chicago "Maloney, Ross J. (31 March 2018). Low Level X Window Programming: An Introduction by Examples . Springer. pp. 225– 244. ISBN 978-3-319-74250-2 . Retrieved 17 May 2022 . Wikipedia revision 1371336843, retrieved 2026-11-19." Maloney, Ross J. 2026-11-18. https://books.google.com/books?id=8r1TDwAAQBAJ&dq=XCB+library&pg=PA225.

    APA Maloney, Ross J. (2026). Maloney, Ross J. (31 March 2018). Low Level X Window Programming: An Introduction by Examples . Springer. pp. 225– 244. ISBN 978-3-319-74250-2 . Retrieved 17 May 2022 . Wikipedia revision 1371336843, retrieved 2026-11-19. Retrieved November 25, 2026, from https://books.google.com/books?id=8r1TDwAAQBAJ&dq=XCB+library&pg=PA225

  11. libxcb-1.17.0 · retrieved 2026-11-18 · rev 1371336843
    Cite this reference

    MLA "libxcb-1.17.0." "libxcb-1. 2026-11-18. https://gitlab.freedesktop.org/xorg/lib/libxcb/-/tags/libxcb-1.17.0. Accessed 25 November 2026.

    Chicago "libxcb-1.17.0." "libxcb-1. 2026-11-18. https://gitlab.freedesktop.org/xorg/lib/libxcb/-/tags/libxcb-1.17.0.

    APA "libxcb-1. (2026). libxcb-1.17.0. Retrieved November 25, 2026, from https://gitlab.freedesktop.org/xorg/lib/libxcb/-/tags/libxcb-1.17.0

Cite this article

MLA

"XCB." encyclopegia.org, 2026, https://encyclopegia.org/wiki/xcb. Accessed 25 November 2026.

Chicago

"XCB." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/xcb.

APA

encyclopegia.org. (2026). XCB. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/xcb

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

XCB-01

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371336843 · 0.5 · snapshot enwiki-001371336843

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.