xcb_create_gc(3)
π NAME π
xcb_create_gc β bestie, it creates a graphics context. that's the whole vibe. β¨
π SYNOPSIS π
first things first, you gotta pull in the header:
#include <xcb/xproto.h>
β¨ Request function β¨
xcb_void_cookie_t xcb_create_gc(xcb_connection_t *conn,
xcb_gcontext_t cid, xcb_drawable_t drawable, uint32_t value_mask,
const void *value_list);
π¦ REQUEST ARGUMENTS π¦
connβ your XCB connection to X11. the group chat with the X server, basically.cidβ the ID you'll use to refer to this graphics context later. you make it withxcb_generate_id. so iconic of you.drawableβ the drawable it's gonna grab the root/depth from.value_maskβ TODO: NOT YET DOCUMENTED. π yeah bestie, the docs left us on read.value_listβ TODO: NOT YET DOCUMENTED. π same energy, no cap.
πΈ DESCRIPTION πΈ
so it creates a graphics context. that's it, that's the whole thing. π«Ά
and here's the lil rule you cannot skip: the graphics context can be used with any drawable that has the same root and depth as the specified drawable. same root, same depth, or it's not gonna work. periodt. π
π RETURN VALUE π
it hands you back an xcb_void_cookie_t. so like, if errors pop off (and they might π), you have to deal with them in the event loop. that's just how void cookies work, iykyk.
but if you'd rather handle errors directly with xcb_request_check instead β totally valid β then use xcb_create_gc_checked. see xcb-requests(3) for the details, bestie. β¨
π ERRORS π
these are the ones that can show up, and yes some of them are literally undocumented, we don't make the rules:
xcb_alloc_error_tβ the X server could not allocate the requested resources (no memory? π).xcb_drawable_error_tβ the specified drawable (Window or Pixmap) does not exist. it's giving ghosted.xcb_font_error_tβ TODO: reasons? π€·xcb_match_error_tβ TODO: reasons? π€·xcb_pixmap_error_tβ TODO: reasons? π€·xcb_value_error_tβ TODO: reasons? π€·
π SEE ALSO π
xcb-requests(3)xcb_generate_id(3)
π AUTHOR π
generated from xproto.xml. for corrections and improvements, contact xcb@lists.freedesktop.org. they're the ones to dm, not me. π«Ά
okay and the lil sign-off so you have the receipts: this is X Version 11, libxcb 1.17.0, and this whole page is xcb_create_gc(3). slay, go make some graphics contexts, bestie. πβ¨π¦
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms