xcb_poly_segment(3)
π xcb_poly_segment β draw lines
okay bestie, so this is a page from the XCB Requests manual (that's the xcb_poly_segment(3) one, in case the tab title was being mysterious). sit down, grab a strawberry π, we're drawing lines.
β¨ NAME β¨
xcb_poly_segment β draw lines. that's it. that's the whole job. iconic behavior honestly.
π¦ SYNOPSIS π¦
#include <xcb/xproto.h>
πΈ Request function πΈ
xcb_void_cookie_t xcb_poly_segment(xcb_connection_t *conn,
xcb_drawable_t drawable, xcb_gcontext_t gc,
uint32_t segments_len, const xcb_segment_t *segments);
π REQUEST ARGUMENTS π
connβ your XCB connection to X11. the group chat you're sending stuff through, basically.drawableβ a drawable (WindoworPixmap) to draw on. pick your canvas, bestie.gcβ the graphics context to use.
TODO: document which attributes of a gc are used β yes, the original literally says this. not me being lazy, it's canon. π
segments_lenβ the number ofxcb_segment_tstructures insegments. count 'em.segmentsβ an array ofxcb_segment_tstructures. the whole lineup.
π DESCRIPTION π
Draws multiple, unconnected lines. for each segment, a line is drawn between (x1, y1) and (x2, y2). the lines are drawn in the order listed in the array of xcb_segment_t structures, and it does not perform joining at coincident endpoints β no cute little corner rounding, no merge, they're strangers passing in the night. π¦
for any given line, a pixel is not drawn more than once. but if lines intersect? the intersecting pixels are drawn multiple times. so overlapping is real and it stacks. π
TODO: include the xcb_segment_t data structure
TODO: an example
(these are the original's own TODOs, i'm just holding them up to the light. the manpage said it, not me. π)
π RETURN VALUE π
Returns an xcb_void_cookie_t. errors (if any) have to be handled in the event loop. so no, you don't get to just peek at the return value and know β the tea arrives later, in the loop.
if you want to handle errors directly with xcb_request_check instead, use xcb_poly_segment_checked. see xcb-requests(3) for details. β¨
π ERRORS π
xcb_drawable_error_tβ the specified drawable does not exist. it's giving nothing, because it isn't there. πxcb_g_context_error_tβ the specified gc does not exist. same energy.xcb_match_error_tβ TODO: reasons? (the manpage genuinely does not know. relatable honestly.)
π₯ SEE ALSO π₯
xcb-requests(3)β go read it, it's the loredump for how requests and errors work. iykyk.
π«Ά AUTHOR π«Ά
Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
and that's the whole page, bestie. no cap, we kept every flag, every argument, every TODO, every error, every SEE ALSO. slay. π
β¨
sign-off time: this was X Version 11, libxcb 1.17.0, and the page was xcb_poly_segment(3). mwah. πππ§
π¦ 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