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β aBool.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_allisTrue, all shapes in the geometry are freed regardless of the values offirstandcount. those two just get ignored, don't even worry about them. π - otherwise,
countshapes are freed, beginning with the shape specified byfirst. tidy, surgical, precise. π―
π RETURN VALUES π
Successβ TheXkbFreeGeomShapesfunction returnsSuccesswhen 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 thatfree_all, mind yourfirstandcount, 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
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms