using Gee;
[CCode (has_target = false)]
-public delegate Type Valadoc.DocletRegisterFunction ( );
+public delegate Type Valadoc.DocletRegisterFunction (GLib.TypeModule module);
public interface Valadoc.Doclet : GLib.Object {
public abstract void process (Settings settings, Api.Tree tree);
public delegate void Valadoc.TagletRegisterFunction (ModuleLoader loader);
-public class Valadoc.ModuleLoader : Object {
+public class Valadoc.ModuleLoader : TypeModule {
public Doclet doclet;
public HashMap<string, GLib.Type> taglets = new HashMap<string, Type> (GLib.str_hash, GLib.str_equal);
private Module docletmodule;
private Type doclettype;
- public bool load (string path) {
- bool tmp = this.load_doclet (path);
- if (tmp == false) {
- return false;
- }
+ public override bool load () {
return true;
}
+ public override void unload() {
+ }
+
public Content.Taglet? create_taglet (string keyword) {
return (taglets.has_key (keyword))? (Content.Taglet) GLib.Object.new (taglets.get (keyword)) : null;
}
- private bool load_doclet (string path) {
+ public bool load_doclet (string path) {
void* function;
- docletmodule = Module.open (Module.build_path (path, "libdoclet"), ModuleFlags.BIND_LAZY);
+ docletmodule = Module.open (Module.build_path (path, "libdoclet"), ModuleFlags.BIND_LAZY | ModuleFlags.BIND_LOCAL);
if (docletmodule == null) {
return false;
}
}
Valadoc.DocletRegisterFunction doclet_register_function = (Valadoc.DocletRegisterFunction) function;
- doclettype = doclet_register_function ();
+ doclettype = doclet_register_function (this);
this.doclet = (Doclet)GLib.Object.new (doclettype);
return true;
}
ModuleLoader modules = new ModuleLoader ();
Taglets.init (modules);
- bool tmp = modules.load (fulldirpath);
+ bool tmp = modules.load_doclet (fulldirpath);
if (tmp == false) {
reporter.simple_error ("failed to load plugin");
return quit (reporter);