This first version of this API only returns the default screenshot.
Further improvements should allow to return all the available extension
screenshots.
Removing an extension means just unloading it and temporarily move it to
an "uninstalled" list. The actual files will only be deleted when
cleanly exiting the program, hence finalizing the extension manager.
This will allow undoing an extension removal easily.
AppStream spec says it can only contain <p>, <ol> and <ul> markups.
Unfortunately these are not pango markups (nor is there any equivalent).
So I just use newlines and spaces until I figure out anything fancier.
That's all still quite ugly, but whatever, I'm still in the start.
Not the most useful type of extensions per-se, but a lot of people seem
to appreciate creating and installing new splashes. Let's make it easy
to install as extensions.
Note that extension splashes are cumulative. So if you enabled several
splash extensions at once, an image would be chosen in random amongst
all of them.
We only save the active state of extensions so that we can reload all
extensions same as they were at previous exit. All other data are saved
as per-extension metadata and should not be saved in the rc file.
If an extension is not listed in extensionrc, we run it by default if
this is a system extension (so that new core extensions by the GIMP team
are run when installed after an updated), but not when they are
user-installed extensions.
To be used in the next commit.
I keep the GUI and core changes well separated in different commits so
that the core is easy to cherry-pick even though I will have to have
different GUI code.
Extensions work for brushes, dynamics, MyPaint brushes, patterns,
gradients, palettes and tool presets.
More to come, but this is a first and working proof-of-concept.
Right now it only loads AppStream data, which is completely useless, yet
is a base of a managed extension system. Having proper metadata is what
will allow to actually know what is installed.
This is only the first draft.
Note that I am not adding the extension path into GimpCoreConfig on
purpose, since the point is not to have people manage their extension
directories manually anymore.
The extensions will be loaded from the build-time system path or the
config directory, and that's all.
What will probably be stored in the config though will be the remote
repositories URLs (allowing third-party extension repositories).