Add gobject-2.0 fix to make TypeModule an abstract class
[cinaest] / src / plugin-registrar.vala
index 69eccb7..6dd314d 100644 (file)
  * along with Cinaest. If not, see <http://www.gnu.org/licenses/>.
  */
 
-public class PluginRegistrar<T> : Object {
+public class PluginRegistrar<T> : 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 ());
@@ -32,7 +32,7 @@ public class PluginRegistrar<T> : Object {
                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<T> : 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<T> : Object {
                return true;
        }
 
+       public override void unload () {
+       }
+
        public T new_object () {
                return Object.new (type);
        }