It's useful to be able to attach arbitrary data to documents, especially for plugins. This PR adds GObject-like keyed data lists to documents so plugins can add stuff similar to g_object_get|set_data()
. The first commit adds a simple wrapper to the document module, the second exposes a safe API for plugins.
In the future if GeanyDocument is ever converted to a GObject, the new document_get|set_data()
functions could become simple wrappers around g_object_get|set_data()
rather than using keyed data lists directly.
Aside from conventional plugins, this will also be useful for planned "filetype plugins" from #1195 and possibly for certain proxy plugin implementations, and could even prove useful in the core.
A made a very simple test plugin to tinker with this in codebrainz@b662ba3.
https://github.com/geany/geany/pull/1203
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.