Allow registering plugins using an API
It's complicated to register plugins from non-C languages. Mainly because the function macro used is G_PLUGIN_DEFINE
, and C function macros aren't exposed as introspected functions. The above issue could be solved by using the properties in GrlPluginDescriptor
as construct-only parameters for GrlPlugin
.
For example, here's how it would work in JavaScript.
const plugin = new Grl.Plugin({
id: "hello.world.com",
name: "MyPlugin",
// ...
});
Grl.Registry.register_plugin(plugin);
Here are the pieces that are currently missing:
- It's not currently possible to directly set the properties of a plugin like
id
,name
,license
, etc... Grilo expects all plugins to be modules. To fix this, I propose that the properties ofGrlPluginDescriptor
be allowed forGrlPlugin
as construct-only properties. This way, plugins can be defined in non-C environments. - There is no way to register a plugin when you've defined it (
Grl.Registry.register_plugin
). Similar toGrl.Registry.load_plugin_from_desc
, but that function is not available for language bindings.