xcb_create_pixmap(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_create_pixmap β€” bestie, we're making a pixmap πŸ’–

okay so. you're in the XCB part of the man pages (xcb_create_pixmap(3), she's from the XCB Requests collection, very demure) and you want to know how to conjure a pixmap out of thin air. sit down, grab a strawberry πŸ“, let's go.


✨ NAME ✨

xcb_create_pixmap β€” Creates a pixmap πŸŽ€


✨ SYNOPSIS ✨

#include <xcb/xproto.h>

🌸 Request function 🌸

xcb_void_cookie_t xcb_create_pixmap(xcb_connection_t *conn,
       uint8_t depth, xcb_pixmap_t pid, xcb_drawable_t drawable,
       uint16_t width, uint16_t height);

✨ REQUEST ARGUMENTS ✨

  • conn β€” your XCB connection to X11, the whole vibe pipeline 🫢
  • depth β€” TODO πŸ’€ bestie the docs literally just say TODO, I cannot make it up for you, that would be lying and lying is not slay
  • pid β€” the ID you'll use to refer to your brand new pixmap later. you gotta make it with xcb_generate_id first, no freelancing πŸ‘‘
  • drawable β€” the drawable we're stealing the screen from
  • width β€” how wide the new pixmap is gonna be
  • height β€” and how tall. width and height, iconic duo, no notes

✨ DESCRIPTION ✨

Creates a pixmap. periodt. ✨

but here's the lore: that pixmap can only be used on the same screen that drawable lives on, and only with drawables of the same depth. it's giving exclusive friend group, iykyk. no crossing screens, no mixing depths, the pixmap does not fraternize outside its lane πŸ¦‹


✨ RETURN VALUE ✨

Returns an xcb_void_cookie_t. so if errors happen, you don't get them handed to you here β€” you have to go handle them in the event loop, bestie. that's just the deal 😭

but wait, there's an option: if you'd rather handle errors directly with xcb_request_check, then use xcb_create_pixmap_checked instead. pick your fighter. see xcb-requests(3) for the full details πŸ’…


✨ ERRORS ✨

  • xcb_alloc_error_t β€” the X server could not allocate the resources you asked for. (no memory? πŸ‘€ that's the vibe it's giving)
  • xcb_drawable_error_t β€” the drawable you named (a Window or a Pixmap) does not exist. it's not there. it ghosted you πŸ’€
  • xcb_value_error_t β€” TODO: reasons? and honestly? the man page itself is asking. we don't know either πŸ™ˆ

✨ SEE ALSO ✨

xcb-requests(3), xcb_generate_id(3) 🌈


✨ AUTHOR ✨

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. (so if something's off, tell the humans, not me πŸŽ€)


lowkey important reminder: that depth field being TODO and that xcb_value_error_t reason being TODO: reasons? are literally in the original docs. I'm not hiding anything from you, bestie, that's just how it was shipped. no cap.

okay that's the whole page, you ate that πŸ’– go forth and create pixmaps responsibly. this was xcb_create_pixmap(3) from X Version 11, libxcb 1.17.0, mwah πŸ’…βœ¨πŸ¦‹