This PR exposes the StashPref struct to the plugin API. They can later by looked up by name with `stash_group_get_pref_by_name()`. The caller needs to have a pointer to the StashGroup that contains the desired pref, so this isn't currently very useful. But it is needed to further extend stash settings without changing the existing API. (Key comments, override settings, config/session split.)
* `union Value` is also made public. I don't know how to code it to keep it in `stash.c`. * Is there a better name for `stash_group_get_pref_by_name()`? * Existing code using stash settings should continue to work. * StashGroup will be exposed in a later PR.
Example use of the new lookup function: ```C++ StashPref *pref = stash_group_get_pref_by_name(group, "price"); msgwin_status_add("%s = %f", pref->key_name, *(gdouble *)pref->setting); ``` You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3008
-- Commit Summary --
* Stash Settings: Expose StashPref to plugins, look up by name
-- File Changes --
M src/plugindata.h (2) M src/stash.c (52) M src/stash.h (36)
-- Patch Links --
https://github.com/geany/geany/pull/3008.patch https://github.com/geany/geany/pull/3008.diff