XCB_RANDR_GET_SCREEN_RESOURCES_MODES_ITERATOR(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_randr_get_screen_resources(3) β€” XCB Requests πŸ’–

okay bestie, gather round, because we are reading an XCB Requests manual page together and honestly? it's giving "under-documented but iconic." the title is xcb_randr_get_screen_resources, it lives in the XCB Requests fam, and we're gonna go through every single line of it. no skimming. πŸ’…


✨ NAME ✨

xcb_randr_get_screen_resources β€”

that's it. that's the whole name section. there's a dash and then... nothing. the description after the dash is literally empty. not me getting ghosted by the man page itself 😭. the function name is xcb_randr_get_screen_resources and we move on with our lives.


✨ SYNOPSIS ✨

first things first, you gotta pull in the header, periodt:

#include <xcb/randr.h>

🌸 Request function 🌸

xcb_randr_get_screen_resources_cookie_t
xcb_randr_get_screen_resources(xcb_connection_t *conn,
                               xcb_window_t window);

πŸ¦‹ Reply datastructure πŸ¦‹

this is the lil struct that comes back at you, and every field is load-bearing so don't touch anything:

typedef struct xcb_randr_get_screen_resources_reply_t {
    uint8_t         response_type;
    uint8_t         pad0;
    uint16_t        sequence;
    uint32_t        length;
    xcb_timestamp_t timestamp;
    xcb_timestamp_t config_timestamp;
    uint16_t        num_crtcs;
    uint16_t        num_outputs;
    uint16_t        num_modes;
    uint16_t        names_len;
    uint8_t         pad1[8];
} xcb_randr_get_screen_resources_reply_t;

πŸŽ€ Reply function πŸŽ€

xcb_randr_get_screen_resources_reply_t
*xcb_randr_get_screen_resources_reply(xcb_connection_t *conn,
                                      xcb_randr_get_screen_resources_cookie_t cookie,
                                      xcb_generic_error_t **e);

πŸ’œ Reply accessors πŸ’œ

these are your little helpers for getting at the good stuff inside the reply:

xcb_randr_crtc_t *xcb_randr_get_screen_resources_crtcs(const
       xcb_randr_get_screen_resources_request_t *reply);

int xcb_randr_get_screen_resources_crtcs_length(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_generic_iterator_t xcb_randr_get_screen_resources_crtcs_end(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_randr_output_t *xcb_randr_get_screen_resources_outputs(const
       xcb_randr_get_screen_resources_request_t *reply);

int xcb_randr_get_screen_resources_outputs_length(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_generic_iterator_t xcb_randr_get_screen_resources_outputs_end(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_randr_mode_info_t *xcb_randr_get_screen_resources_modes(const
       xcb_randr_get_screen_resources_request_t *reply);

int xcb_randr_get_screen_resources_modes_length(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_randr_mode_info_iterator_t
       xcb_randr_get_screen_resources_modes_iterator(const
       xcb_randr_get_screen_resources_reply_t *reply);

uint8_t *xcb_randr_get_screen_resources_names(const
       xcb_randr_get_screen_resources_request_t *reply);

int xcb_randr_get_screen_resources_names_length(const
       xcb_randr_get_screen_resources_reply_t *reply);

xcb_generic_iterator_t xcb_randr_get_screen_resources_names_end(const
       xcb_randr_get_screen_resources_reply_t *reply);
πŸ‘€ yes, the _crtcs, _outputs, _modes and _names accessors really do take a xcb_randr_get_screen_resources_request_t *reply while their _length and _end siblings take a xcb_randr_get_screen_resources_reply_t *reply. that's just how it is. we don't ask questions, we copy the signature exactly. fr fr.

✨ REQUEST ARGUMENTS ✨

  • conn β€” your XCB connection to X11. the whole hotline to the server, babe.
  • window β€” TODO: NOT YET DOCUMENTED. yeah. the docs said "we'll get to it" and then never got to it. πŸ™ˆ

✨ REPLY FIELDS ✨

  • response_type β€” the type of this reply, which in this case is XCB_RANDR_GET_SCREEN_RESOURCES. this field also shows up in the xcb_generic_reply_t, and it's how you tell your replies apart from each other when they're all piled up in the group chat.
  • sequence β€” the sequence number of the last request processed by the X11 server. it's the receipts. 🧾
  • length β€” the length of the reply, in words (and a word is 4 bytes, in case you were about to guess).
  • timestamp β€” TODO: NOT YET DOCUMENTED.
  • config_timestamp β€” TODO: NOT YET DOCUMENTED.
  • num_crtcs β€” TODO: NOT YET DOCUMENTED.
  • num_outputs β€” TODO: NOT YET DOCUMENTED.
  • num_modes β€” TODO: NOT YET DOCUMENTED.
  • names_len β€” TODO: NOT YET DOCUMENTED.
😭 five whole fields of pure TODO energy. the vibes are immaculate, the documentation is not.

✨ DESCRIPTION ✨

there is no description. the section exists, and then it's just... silence. the void. an empty room. it's giving minimalism, it's giving mystery, it's giving "we ran out of time before the release." we respect it and we move on. πŸ’€


✨ RETURN VALUE ✨

so what do you actually get back? you get an xcb_randr_get_screen_resources_cookie_t. cute lil cookie. πŸͺ

and the important part, bestie: errors have to be handled when you call the reply function xcb_randr_get_screen_resources_reply.

but if you'd rather handle your errors in the event loop instead, use xcb_randr_get_screen_resources_unchecked. the details of all that live in xcb-requests(3) β€” go read it, it's the lore.


✨ ERRORS ✨

this request does never generate any errors.

never. zero. none. she simply doesn't miss. πŸ”₯


✨ SEE ALSO ✨

nothing listed here. empty. a blank little shelf. (the SEE ALSO section is out here living its truth.) πŸ¦‹


✨ AUTHOR ✨

Generated from randr.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

so if you spot something wrong, don't @ me, @ the mailing list. they're the main characters here. πŸ‘‘


and that's the whole page, bestie! you just read the entirety of xcb_randr_get_screen_resources(3), no skips, no cap. this one shipped as part of X Version 11, from libxcb 1.17.0 β€” go forth and query those screen resources. slay, and remember: a word is 4 bytes. πŸ’…βœ¨πŸ«Ά