* 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 ());
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);
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
return true;
}
+ public override void unload () {
+ }
+
public T new_object () {
return Object.new (type);
}