XkbAllocGeomProps(3)

πŸ’… XkbAllocGeomProps(3) β€” the XKB FUNCTIONS corner of the universe ✨

okay bestie, buckle up πŸŽ€ this one lives in XKB FUNCTIONS and it's literally called XkbAllocGeomProps β€” yes it's a mouthful, yes it slays, no we're not renaming it πŸ’–


🌸 NAME 🌸

XkbAllocGeomProps β€” allocate geometry properties 🫢


✨ SYNOPSIS ✨

Status XkbAllocGeomProps (XkbGeometryPtr geom, int num_needed);

that's the whole vibe check right there πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • geom β€” the geometry that the properties should get allocated for, iykyk 🌈
  • num_needed β€” how many new properties you're asking for, aka the count of fresh properties required πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so. Xkb hands you a whole lil collection of functions for allocating and freeing subcomponents of a keyboard geometry β€” think of it as the group chat of geometry-building tools 🧚 and you use these functions to create or modify keyboard geometries. periodt.

⚠️ important caveat, bestie, do NOT skip this: these functions merely allocate space for the new element(s). Actually filling in the values? That's on you, explicitly, in your own code. no cap. the allocator does not do it for you 😭

here's the sz_*/num_* lore, and it's giving main character energy:

  • these allocation functions increase sz_* but never touch num_*
  • unless there's an allocation failure β€” in which case they reset both sz_* and num_* to zero πŸ’€
  • they return Success if they succeed πŸ”₯
  • they return BadAlloc if they can't allocate space πŸ™ˆ
  • they return BadValue if a parameter isn't as expected ⭐

now for the star of the show: XkbAllocGeomProps allocates space for num_needed properties and adds them to the specified geometry geom πŸŽ€ and ngl, no initialization of the properties is done β€” zero, none, nada.

so what even is a geometry property? a geometry property associates an arbitrary string with an equally arbitrary name πŸ’… highkey iconic. geometry properties can be used to provide hints to programs that display images of keyboards πŸ‘‘ but plot twist: they are not interpreted by Xkb. and no other geometry structures refer to geometry properties. it's giving independent queen energy, fr fr 🌸


πŸ”₯ DIAGNOSTICS πŸ”₯

  • BadAlloc β€” unable to allocate storage 😭
  • BadValue β€” an argument is out of range πŸ’€

and that's the whole page, bestie 🫢 mwah πŸ’–

made with love from X Version 11, libX11 1.8.14 ✨ bye slay 🌈
πŸ“¦ where this page comes from