X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fplugin-registrar.vala;h=6dd314dd3364df6f168052ed17241dc7a3f0bd19;hb=6b44d6b59585418729a261f15ba7664a5733f0ed;hp=29eed01c5a74812ff0c774cc153b745d9bc01187;hpb=538038c103ddc361cdd48d279eeac7c73e871707;p=cinaest
diff --git a/src/plugin-registrar.vala b/src/plugin-registrar.vala
index 29eed01..6dd314d 100644
--- a/src/plugin-registrar.vala
+++ b/src/plugin-registrar.vala
@@ -16,23 +16,23 @@
* along with Cinaest. If not, see .
*/
-public class PluginRegistrar : Object {
+public class PluginRegistrar : GLibFix.TypeModule {
public string path { get; construct; }
private Type type;
private Module module;
- private delegate Type RegisterPluginFunction ();
+ private delegate Type RegisterPluginFunction (GLibFix.TypeModule module);
construct {
assert (Module.supported ());
}
- public PluginRegistrar (string path) {
- this.path = path;
+ public PluginRegistrar (string _path) {
+ Object (path: _path);
}
- public bool load () {
+ public override bool load () {
stdout.printf ("Loading plugin with path: '%s'\n", path);
module = Module.open (path, ModuleFlags.BIND_LAZY);
@@ -46,7 +46,7 @@ public class PluginRegistrar : Object {
module.symbol ("register_plugin", out function);
RegisterPluginFunction register_plugin = (RegisterPluginFunction) function;
- type = register_plugin ();
+ type = register_plugin (this);
stdout.printf ("Plugin type: %s\n\n", type.name ());
// So it doesn't vanish as soon as the registar goes
@@ -55,6 +55,9 @@ public class PluginRegistrar : Object {
return true;
}
+ public override void unload () {
+ }
+
public T new_object () {
return Object.new (type);
}