XkbAddGeomColor(3)

🌸 XkbAddGeomColor(3) β€” straight from the XKB FUNCTIONS besties 🌸

πŸ’– NAME πŸ’–

XkbAddGeomColor β€” add one color name to an existing keyboard geometry description. Slay, but make it geometry. ✨


πŸŽ€ SYNOPSIS πŸŽ€

XkbColorPtr XkbAddGeomColor (XkbGeometryPtr geom, _Xconst char *spec,
       unsigned int pixel);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • geom β€” the geometry that's getting updated, bestie.
  • spec β€” the color to be added. Yes, the whole color-name situation.
  • pixel β€” the color to be added. Also literally a pixel value, no cap.

πŸ’… DESCRIPTION πŸ’…

Okay so Xkb gives you functions that add a single new element to the top-level keyboard geometry. In every one of these cases, the num_ * fields of the corresponding structure get incremented by 1. Iconic behavior, honestly.

These functions do not change sz_* unless there's no more room in the array. Like, they're not out here resizing for fun. Some of these functions fill in the values of the element's structure from the arguments. For other functions, you have to explicitly write code to fill the structure's elements yourself. Main character energy: sometimes you gotta do the work. 😭

The top-level geometry description includes a list of geometry properties. A geometry property associates an arbitrary string with an equally arbitrary name. Programs that display images of keyboards can use geometry properties as hints, but they are not interpreted by Xkb. No other geometry structures refer to geometry properties. Periodt.

XkbAddGeomColor adds the specified color name and pixel to the specified geometry geom. The top-level geometry description includes a list of up to MaxColors (32) color names. A color name is a string whose interpretation is not specified by Xkb β€” and neither is the pixel value's interpretation. It's giving "you decide what it means." 🌈

All other geometry data structures refer to colors using their indices in this global list or pointers to colors in this list. XkbAddGeomColor returns NULL if any of the parameters is empty or if it was not able to allocate space for the color. To allocate space for an arbitrary number of colors to a geometry, use the XkbAllocGeomColors function. That's the move. 🫢

Bestie warning: empty parameters or no allocation space means NULL. Not a vibe, but that's the rule. πŸ’€

🧚 STRUCTURES 🧚

typedef struct _XkbColor {
    unsigned int    pixel;      /* color */
    char *          spec;       /* color name */
} XkbColorRec,*XkbColorPtr;

🫢 SEE ALSO 🫢


✨ mwah ✨ This page is serving X Version 11 / libX11 1.8.14 footer energy β€” that's the source/version flex, and XkbAddGeomColor(3) is the manual-page name doing its little bow. πŸ’‹

πŸ“¦ where this page comes from