XkbFreeGeomShapes(3)

πŸ’… XkbFreeGeomShapes β€” free geometry shapes (yes, the XKB one, in the XKB FUNCTIONS section of the manual, bestie)

okay so picture this: you're deep in the XKB geometry game, and it's time to let some shapes go. That's literally this function. She's a libX11 girlie and she's here to clean up. 🧹✨


✨ SYNOPSIS ✨

void XkbFreeGeomShapes (XkbGeometryPtr geom, int first, int count, Bool
       free_all);

no cap, that's the whole signature. she takes four things and returns void, so don't go looking for a return value from the function itself β€” the Success / BadAlloc / BadValue chatter below is about the family of XKB geometry allocation functions, iykyk. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • geom β€” the geometry where the shapes should be freed. this is the main character of the operation, the place the freeing happens.
  • first β€” the first shape to be freed. your starting point, your opening act. ⭐
  • count β€” how many shapes we're freeing. the number, the quantity, the vibe check.
  • free_all β€” a Bool. True => all shapes are freed. it's giving "select all" energy. πŸ’€

🌸 DESCRIPTION 🌸

Xkb provides a number of functions to allocate and free subcomponents of a keyboard geometry. so like, use these functions to create or modify keyboard geometries β€” that's the whole point, that's the assignment. πŸ‘‘

⚠️ important caveat, and I need you to hear me on this one: these functions merely allocate space for the new element(s), and it is up to you to fill in the values explicitly in your code. they do not fill anything in for you. no hand-holding. no auto-magic. you're on your own with the values, bestie. 😭

these allocation functions increase sz_* but never touch num_* (unless there is an allocation failure, in which case they reset both sz_* and num_* to zero). yes, both. to zero. keep that in mind.

and they return Success if they succeed, BadAlloc if they are not able to allocate space, or BadValue if a parameter is not as expected. very demure, very predictable. ✨

now, the actual freeing logic β€” two paths, pick your fighter:

  • if free_all is True, all shapes in the geometry are freed regardless of the values of first and count. those two just get ignored, don't even worry about them. πŸ’…
  • otherwise, count shapes are freed, beginning with the shape specified by first. tidy, surgical, precise. 🎯

🌈 RETURN VALUES 🌈

  • Success β€” The XkbFreeGeomShapes function returns Success when there are no allocation or argument errors. clean run, no drama, we love to see it. πŸ¦‹

πŸ’œ DIAGNOSTICS πŸ’œ

  • BadAlloc β€” Unable to allocate storage. the allocator said no. πŸ™ˆ
  • BadValue β€” An argument is out of range. somebody passed something sus. πŸ’€

fr fr, free your shapes responsibly β€” check that free_all, mind your first and count, and don't forget that the filling-in-the-values part is your job, not hers. 🫢

kisses and X Version 11, libX11 1.8.14, mwah πŸ’‹ β€” that's the version and date info from the footer, delivered with love. πŸŽ€βœ¨

πŸ“¦ where this page comes from