xcb_poly_segment(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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 (Window or Pixmap) 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 of xcb_segment_t structures in segments. count 'em.
  • segments β€” an array of xcb_segment_t structures. 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. πŸ’–πŸŽ€πŸ§š