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
@xiota pushed 1 commit.
eda045625ea4d1a6059d8d301970cd9ed879a595 fix comment typo
@kugel- This is part 2 (Expose StashPref in API). Expected after this...
3. Add Key Comments. 4. Expose StashGroup in API. 5. Enable Pref Overrides. 6. Add Config/Session split.
@xiota pushed 1 commit.
baa732dc4b3b634fe36fee7dec0a1905b79a03cc Stash Settings: Expose StashPref to plugins, look up by name
Force push to rebase to master.
Closed #3008.
github-comments@lists.geany.org