This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

OPluginManager

NicolasTrangez: On this page and subsections I'd like to dump some ideas on OPluginManager's goals and architecture. This is very work-in-progress. Please comment on it if you want features/dislike current solutions/... I really need input :-)

What is it

OPluginManager is a library in the Onion namespace to allow developers to add plugin functionality to their programs easily, and provide a consistent plugin management interface to user.

Current situation

Every project using plugins got its own code to load these, has its own User Interface to allow the user to enable/disable plugins, etc. This involves a lot of code duplication, and lacks a common user interface. For plugin developers it can also be hard to learn all different ways different projects want plugins to be written (ie what functions to export etc). Next to this, most projects only support C plugins.

What OPluginManager should bring

Simply put, these are the goals:

What this is not

I had a little discussion on this with some people in #gnome-hackers yesterday. It looks like I should explicitly say this is not an attempt to unify all possible plugin systems, as obviously all plugin based apps got other requirements (think "vtables"). This is only a unified plugin loader infrastructure.

What it is based on

As most Gnome projects, this one will be mostly based on glib, and on GTK for the UI part. Plugins will essentially be based on gmodules.

Implementation details

I'll try to draw a diagram on this ASAP (exams now so it'll take a while). All possible plugins should have the same structure (the OPluginManager part, not the internal data, of course), whether they're written in C, Python or some other language. After playing around with Python/C interop, this should be possible, nearly trivial.

Modules should export a function (with a fixed name and prototype) which returns a structure with some common fields. These are the fields I got now.

Here's a sample plugin implementation.

This is a sample Python plugin.

Current work

You can find current code in Gnome CVS (help, how to wikify a CVS directory?), including some test cases as samples (Take a look in the tests directory to get a pretty decent overview of how things fir together). It should be working quite well, currently adding new functionality.

This is what's working now (could become outdated):

What should be done:


2024-10-23 10:59