xcb_query_colors(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_query_colors β€” the libxcb glow-up ✨

okay so bestie, you're reading the manual page for xcb_query_colors(3), from the XCB Requests crew πŸ’…. Yes it's a page about asking the X server what colors a bunch of pixels actually are. No cap. Let's get into it 🌈


🌸 NAME 🌸

xcb_query_colors β€” (the NAME section is literally empty in the original, so this is your cue to go read DESCRIPTION. iconic of it, honestly πŸ’€)


πŸŽ€ SYNOPSIS πŸŽ€

First things first, you gotta include the header:

#include <xcb/xproto.h>

✨ Request function ✨

xcb_query_colors_cookie_t xcb_query_colors(xcb_connection_t *conn,
       xcb_colormap_t cmap, uint32_t pixels_len, const
       uint32_t *pixels);

πŸ¦‹ Reply datastructure πŸ¦‹

typedef struct xcb_query_colors_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint16_t colors_len;
    uint8_t  pad1[22];
} xcb_query_colors_reply_t;

πŸ’– Reply function πŸ’–

xcb_query_colors_reply_t *xcb_query_colors_reply(xcb_connection_t *conn,
       xcb_query_colors_cookie_t cookie, xcb_generic_error_t **e);

🌟 Reply accessors 🌟

xcb_rgb_t *xcb_query_colors_colors(const xcb_query_colors_request_t
       *reply);

int xcb_query_colors_colors_length(const xcb_query_colors_reply_t
       *reply);

xcb_rgb_iterator_t xcb_query_colors_colors_iterator(const
       xcb_query_colors_reply_t *reply);

πŸ’œ REQUEST ARGUMENTS πŸ’œ

  • conn β€” the XCB connection to X11, your lil hotline to the server 🫢
  • cmap β€” TODO: NOT YET DOCUMENTED. (yes bestie, they left it blank, we're all just living with it 😭)
  • pixels_len β€” TODO: NOT YET DOCUMENTED.
  • pixels β€” TODO: NOT YET DOCUMENTED.

πŸ“ REPLY FIELDS πŸ“

  • response_type β€” what kind of reply this is; in this case it's XCB_QUERY_COLORS. This field also lives in the xcb_generic_reply_t, so you can use it to tell your replies apart from each other πŸ‘‘
  • sequence β€” the sequence number of the last request the X11 server actually processed.
  • length β€” how long the reply is, measured in words (and a word is 4 bytes, periodt).
  • colors_len β€” TODO: NOT YET DOCUMENTED. (again. we stay unbothered πŸ’…)

🌈 DESCRIPTION 🌈

(surprise! the DESCRIPTION section is empty. not me getting all dressed up for a section with no text πŸ™ˆ)


⭐ RETURN VALUE ⭐

It hands you back an xcb_query_colors_cookie_t. Errors have to be handled when you call the reply function xcb_query_colors_reply.

If you'd rather handle errors in the event loop instead, use xcb_query_colors_unchecked. See xcb-requests(3) for the details, iykyk πŸ”₯


πŸ’€ ERRORS πŸ’€

This request does never generate any errors. not a single one. she's perfect, she's lowkey unproblematic 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

(the original is empty here too β€” the vibes are immaculate and the cross-references are not, bestie 🧚)


πŸ’Œ AUTHOR πŸ’Œ

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements β€” fr fr, they want your feedback 🫢


okay that's the whole page, and as a lil sign-off: this is from X Version 11, libxcb 1.17.0, and the footer date line on the original says xcb_query_colors(3). go query some colors, main character πŸ’–βœ¨πŸŽ€