May
29
OPluginManager
I've been working on my OPluginManager lately (not too much, got to study too, and watched the Queen Elisabeth concours of course ;-)).
This is what I got now (it's my first GTK code ever, so I'm quite happy with it):
This is the "plugin" code:
#include "plugins/o-plugin-manager-plugin.h"
#include "plugins/o-plugin-manager-plugin-data.h"
#define TEST_PLUGIN_MSG "[test-plugin] "
static gpointer plugin_init(gpointer d, GError **e) {
g_debug("" TEST_PLUGIN_MSG "Init");
return (gpointer) g_strdup("Test plugin data");
}
static void free_data(gpointer d) {
g_debug("" TEST_PLUGIN_MSG "Freeing data \"%s\"", (gchar *) d);
g_free(d);
}
static OPluginManagerPluginAuthorData author = {
O_PLUGIN_MANAGER_PLUGIN_DATA_AUTHOR_MAGIC,
"ikke",
"eikke eikke com"
};
static OPluginManagerPluginData plugininfo = {
O_PLUGIN_MANAGER_PLUGIN_DATA_MAGIC,
"test-plugin",
"A simple test plugin",
"This is a sample test plugin, to test the OPluginManager functionality",
"0.1",
"http://www.eikke.com",
&author,
NULL,
plugin_init,
free_data
};
O_PLUGIN_MANAGER_PLUGIN_REGISTER(plugininfo);
As you can see it's braindead easy to write a plugin :-)
The code is quite a mess at the moment, the UI is just plain ugly and inaccessible, there's no I18N support, but well, as you can see, one day it might work :-)
Lots of guys I know are in Stuttgart right now, visiting GUADEC. I wish I could be there too :-( Have a great time!!!
Comments:
No Comments for this post yet...