GPlugin Draft
This is an extremely early draft. More like a personal scratch pad for now.
The idea of GPlugin is to provide a flexible framework for loading plugins from various languages an interfaces (dbus).
To Check Out
- GStreamer
- GEdit
- Epiphany
Goals
- Allow single file plugins (ie don't require a separate .desktop for description)
- Allow separate .desktop files for descriptions
- Multiple implementors, Python, Perl, Mono, DBus!
- Configuration of the plugin? We should be able to handle both new dialogs and embeddable widgets
- A plugin manager class perhaps? This would probably need a configuration system and we can't depend on GConf
Details
- We need loaders to handle languages. These should be imported via static factories (as GModules), so that GLib wont depend on Python or what have we.
- The actual Plugin class probably needs to be a GProxy so that we can do dynamic method invocation into fx. Python objects to hook up into custom GInterfaces
Code
In time the ideas outlined here will be implemented in GDX, "GLib Dynamic Extensions".
API
GPluginLoader (GObject):
get_loader (const gchar *name) : GPluginLoader* (static factory for instantiating a loader from a GModule, names could be 'python', 'dbus' etc)
get_available_names () : GSList* (static method)
- load (const GFile *file) : GPlugin*
- get_plugin_info (GFile *plugin) : GPluginInfo*
GPlugin (GObject implements GProxy)
- get_info () : GPluginInfo*
close () : (should also be closed when last ref is dropped, this is a safety)
GPluginInfo (GObject)
- get_loader_name () : const gchar*
- get_name () : const gchar*
- get_description () : const gchar*
- get_website () : const gchar*
- get_copyright () : const gchar*
get_icon_name () : const gchar* (may be NULL in which case get_icon_pixbuf() must return non-NULL)
get_icon_pixbuf () : GdkPixbuf*