xcb_alloc_color_planes(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_alloc_color_planes โ€” the libxcb page, but make it make sense

hiii bestie ๐Ÿ’– welcome to xcb_alloc_color_planes(3), a page from the libxcb family (you know, the XCB Requests crew, and yes the manual is literally titled xcb_alloc_color_planes). she's a color-plane allocation request and she's here to be understood, no cap. let's get into it โœจ


๐ŸŽ€ NAME ๐ŸŽ€

xcb_alloc_color_planes โ€” and that's it. that's the whole thing.

no fr, the description after the dash is empty in the original. iconic of her honestly, leaving us on read. ๐Ÿ’€


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

first up, you gotta bring in the header:

#include <xcb/xproto.h>

โœจ Request function โœจ

here's the request itself, in all her main character glory:

xcb_alloc_color_planes_cookie_t
       xcb_alloc_color_planes(xcb_connection_t *conn,
       uint8_t contiguous, xcb_colormap_t cmap, uint16_t colors,
       uint16_t reds, uint16_t greens, uint16_t blues);

she hands you back a cookie ๐Ÿช (a xcb_alloc_color_planes_cookie_t, to be exact) โ€” that's your lil claim ticket for the reply later.

๐Ÿฆ‹ Reply datastructure ๐Ÿฆ‹

this is the shape of the reply when it lands:

typedef struct xcb_alloc_color_planes_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint16_t pixels_len;
    uint8_t  pad1[2];
    uint32_t red_mask;
    uint32_t green_mask;
    uint32_t blue_mask;
    uint8_t  pad2[8];
} xcb_alloc_color_planes_reply_t;

yep, there's pad0, pad1[2] and pad2[8] padding in there โ€” that's just the struct doing her alignment thing, don't worry about it ๐Ÿซถ

๐Ÿ’œ Reply function ๐Ÿ’œ

and here's how you actually go get that reply:

xcb_alloc_color_planes_reply_t
       *xcb_alloc_color_planes_reply(xcb_connection_t *conn,
       xcb_alloc_color_planes_cookie_t cookie, xcb_generic_error_t **e);

pass back the cookie you got, and she'll hand you the reply (or route an error out through e).

๐Ÿงš Reply accessors ๐Ÿงš

three lil helpers so you don't have to hand-roll your pointer math:

uint32_t *xcb_alloc_color_planes_pixels(const
       xcb_alloc_color_planes_request_t *reply);

int xcb_alloc_color_planes_pixels_length(const
       xcb_alloc_color_planes_reply_t *reply);

xcb_generic_iterator_t xcb_alloc_color_planes_pixels_end(const
       xcb_alloc_color_planes_reply_t *reply);

๐ŸŒธ REQUEST ARGUMENTS ๐ŸŒธ

the tea on every parameter you gotta feed her:

  • conn โ€” your XCB connection to X11. the whole reason we're here ๐Ÿ’…
  • contiguous โ€” TODO: NOT YET DOCUMENTED.
  • cmap โ€” TODO: NOT YET DOCUMENTED.
  • colors โ€” TODO: NOT YET DOCUMENTED.
  • reds โ€” TODO: NOT YET DOCUMENTED.
  • greens โ€” TODO: NOT YET DOCUMENTED.
  • blues โ€” TODO: NOT YET DOCUMENTED.
not the manpage leaving a whole stack of TODO: NOT YET DOCUMENTED. like that ๐Ÿ˜ญ we love an unfinished draft. i'm not gonna make stuff up for you bestie โ€” if the page doesn't say it, i'm not saying it either. fr fr.

โญ REPLY FIELDS โญ

what you get back in that xcb_alloc_color_planes_reply_t:

  • response_type โ€” the type of this reply, which in this case is XCB_ALLOC_COLOR_PLANES. this field is also hanging out in the xcb_generic_reply_t, and it's how you tell replies apart from each other.
  • sequence โ€” the sequence number of the last request that the X11 server processed.
  • length โ€” the length of the reply, counted in words (and a word is 4 bytes, so do the math ๐Ÿงฎ).
  • pixels_len โ€” TODO: NOT YET DOCUMENTED.
  • red_mask โ€” TODO: NOT YET DOCUMENTED.
  • green_mask โ€” TODO: NOT YET DOCUMENTED.
  • blue_mask โ€” TODO: NOT YET DOCUMENTED.

๐Ÿ’ซ DESCRIPTION ๐Ÿ’ซ

it's... empty. nothing there. a whole section with zero content. she said "no thoughts, head empty" ๐Ÿ“


๐Ÿ”ฅ RETURN VALUE ๐Ÿ”ฅ

she returns an xcb_alloc_color_planes_cookie_t. and listen โ€” errors have to be handled when you call the reply function, xcb_alloc_color_planes_reply.

if you'd rather handle errors in the event loop instead, use xcb_alloc_color_planes_unchecked. check out xcb-requests(3) for the deets on how that works.


๐Ÿ’€ ERRORS ๐Ÿ’€

this request never generates any errors.

periodt. that's the whole section. she's chill like that ๐Ÿ˜Œ


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

nothing listed here either, bestie. empty. blank. the void. ๐Ÿ™ˆ


๐Ÿซถ AUTHOR ๐Ÿซถ

Generated from xproto.xml. contact xcb@lists.freedesktop.org for corrections and improvements.


and that's the whole page, you ate it ๐Ÿ’… this was X Version 11, libxcb 1.17.0, from the xcb_alloc_color_planes(3) manual. go forth and allocate those color planes, bestie โ€” i'm obsessed with you, mwah ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹