[valadoc] doclets/gtkdoclet: Support documenting delegates and its formal parameters



commit 5423f64bd7e5608b46725674b5509a3e46328053
Author: Luca Bruno <lethalman88 gmail com>
Date:   Tue May 4 21:38:57 2010 +0200

    doclets/gtkdoclet: Support documenting delegates and its formal parameters

 src/doclets/gtkdoc/generator.vala |   14 ++++++++++++--
 src/libvaladoc/api/tree.vala      |    4 ++--
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/doclets/gtkdoc/generator.vala b/src/doclets/gtkdoc/generator.vala
index 9783a36..c87f05c 100644
--- a/src/doclets/gtkdoc/generator.vala
+++ b/src/doclets/gtkdoc/generator.vala
@@ -325,7 +325,12 @@ public class Gtkdoc.Generator : Api.Visitor {
 			return;
 		}
 
-		add_header (f.get_cname (), f.documentation);
+		if (current_headers == null) {
+			// field not in class/struct/interface
+			add_symbol (f.get_filename(), f.get_cname(), f.documentation);
+		} else {
+			add_header (f.get_cname (), f.documentation);
+		}
 		f.accept_all_children (this);
 	}
 
@@ -335,8 +340,13 @@ public class Gtkdoc.Generator : Api.Visitor {
 	}
 
 	public override void visit_delegate (Api.Delegate d) {
-		add_symbol (d.get_filename(), d.get_cname(), d.documentation);
+		var old_headers = current_headers;
+		current_headers = new Gee.LinkedList<Header>();
+
 		d.accept_all_children (this);
+		add_symbol (d.get_filename(), d.get_cname(), d.documentation);
+
+		current_headers = old_headers;
 	}
 
 	public override void visit_signal (Api.Signal sig) {
diff --git a/src/libvaladoc/api/tree.vala b/src/libvaladoc/api/tree.vala
index 9a99f8d..6bbc44a 100644
--- a/src/libvaladoc/api/tree.vala
+++ b/src/libvaladoc/api/tree.vala
@@ -265,11 +265,11 @@ public class Valadoc.Api.Tree {
 
 	// copied from valacodecontext.vala
 	private string? get_external_documentation_path (string pkg) {
-		var path = get_file_path (Path.build_filename (pkg, pkg + ".valadoc"), "vala/vapi/documentation", settings.docu_directories);
+		var path = get_file_path (Path.build_filename (pkg, "documentation.xml"), "vala/vapi/documentation", settings.docu_directories);
 
 		if (path == null) {
 			/* last chance: try the package compiled-in vapi dir */
-			var filename = Path.build_filename (Config.vapi_dir, "vapi", "documentation", pkg, pkg + ".valadoc");
+			var filename = Path.build_filename (Config.vapi_dir, "vapi", "documentation", pkg, "documentation.xml");
 			if (FileUtils.test (filename, FileTest.EXISTS)) {
 				path = filename;
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]