xcb_create_glyph_cursor(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_glyph_cursor β€” create cursor

okay bestie, welcome to the xcb_create_glyph_cursor page, straight out of the XCB Requests corner of the manual πŸ’– this one's a libxcb classic and we're gonna make a whole entire cursor out of a font glyph. iconic behavior honestly ✨


🌸 SYNOPSIS 🌸

#include <xcb/xproto.h>

✨ Request function ✨

xcb_void_cookie_t xcb_create_glyph_cursor(xcb_connection_t *conn,
       xcb_cursor_t cid, xcb_font_t source_font, xcb_font_t mask_font,
       uint16_t source_char, uint16_t mask_char, uint16_t fore_red,
       uint16_t fore_green, uint16_t fore_blue, uint16_t back_red,
       uint16_t back_green, uint16_t back_blue);

πŸŽ€ REQUEST ARGUMENTS πŸŽ€

  • conn β€” the XCB connection to X11, your lil hotline to the server 🫢
  • cid β€” the ID you're gonna use to refer to this cursor later, and you make it with xcb_generate_id. no cap, generate it first.
  • source_font β€” which font we're digging through to find the actual cursor glyph πŸ”
  • mask_font β€” which font we're digging through to find the mask glyph
  • source_char β€” the glyph of source_font that you're using
  • mask_char β€” the glyph of mask_font you're using as a mask: pixels set to 1 define which source pixels get shown, and every pixel set to 0 does not get displayed. literally the vibe filter πŸ’…
  • fore_red β€” the red value of the foreground color
  • fore_green β€” the green value of the foreground color
  • fore_blue β€” the blue value of the foreground color
  • back_red β€” the red value of the background color
  • back_green β€” the green value of the background color
  • back_blue β€” the blue value of the background color

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this does is it creates a cursor from a font glyph 🌈 X ships a set of standard cursor shapes in a special font named cursor, and applications are encouraged to use this interface for their cursors, because the font can be customized for the individual display type. it's giving adaptable, it's giving flexible, we love that for you πŸ’–

Every pixel set to 1 in the source uses the foreground color (that's fore_red, fore_green and fore_blue). Every pixel set to 0 uses the background color (that's back_red, back_green and back_blue). that's it, that's the whole look 🌸


⭐ RETURN VALUE ⭐

It returns an xcb_void_cookie_t. Errors (if there are any, and bestie there might be) have to be handled in the event loop πŸ‘€

If you'd rather handle errors directly with xcb_request_check instead, use xcb_create_glyph_cursor_checked. See xcb-requests(3) for the details πŸŽ€


πŸ’€ ERRORS πŸ’€

  • xcb_alloc_error_t β€” the X server could not allocate the requested resources (no memory?? 😭)
  • xcb_font_error_t β€” the source_font or mask_font you specified does not exist. rip to that font fr fr πŸ™ˆ
  • xcb_value_error_t β€” either source_char or mask_char are not defined in source_font or mask_font, respectively. check your glyphs bestie, they gotta actually live in that font πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

xcb-requests(3)


🌈 AUTHOR 🌈

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


okay that's the whole page, you ate that πŸ’… this was X Version 11, libxcb 1.17.0, and it's the xcb_create_glyph_cursor(3) manual page β€” go make something cute with your cursor, periodt βœ¨πŸŽ€πŸ¦‹