[valadoc] doclet/*: don't visit thrown exceptions and signal children anymore



commit 5837d2e7b086e66667e72527f9bbb4f88b27d7e7
Author: Florian Brosch <flo brosch gmail com>
Date:   Sat May 22 19:47:45 2010 +0200

    doclet/*: don't visit thrown exceptions and signal children anymore

 src/doclets/devhelp/doclet.vala     |   30 ++++++++++++++++--------------
 src/doclets/htm/doclet.vala         |   33 ++++++++++++++++++---------------
 src/doclets/valadoc.org/doclet.vala |   30 ++++++++++++++----------------
 src/doclets/xml/doclet.vala         |   33 +++++++++++++++++----------------
 4 files changed, 65 insertions(+), 61 deletions(-)
---
diff --git a/src/doclets/devhelp/doclet.vala b/src/doclets/devhelp/doclet.vala
index 2e22455..2496391 100755
--- a/src/doclets/devhelp/doclet.vala
+++ b/src/doclets/devhelp/doclet.vala
@@ -160,7 +160,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 		}
 	}
 
-	private void process_node (Api.Node node) {
+	private void process_node (Api.Node node, bool accept_all_children) {
 		string rpath = this.get_real_path (node);
 		string path = this.get_path (node);
 
@@ -172,9 +172,11 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 		write_file_footer ();
 		file = null;
 
-		_devhelpwriter.start_sub (node.name, path);
-		node.accept_all_children (this);
-		_devhelpwriter.end_sub ();
+		if (accept_all_children) {
+			_devhelpwriter.start_sub (node.name, path);
+			node.accept_all_children (this);
+			_devhelpwriter.end_sub ();
+		}
 	}
 
 	public override void visit_namespace (Namespace item) {
@@ -194,43 +196,43 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 	}
 
 	public override void visit_error_domain (ErrorDomain item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_enum (Api.Enum item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_property (Property item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_constant (Constant item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_field (Field item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_error_code (ErrorCode item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_enum_value (Api.EnumValue item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_delegate (Delegate item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_signal (Api.Signal item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_method (Method item) {
-		process_node (item);
+		process_node (item, false);
 	}
 }
 
diff --git a/src/doclets/htm/doclet.vala b/src/doclets/htm/doclet.vala
index 30a69a3..a93e5a7 100755
--- a/src/doclets/htm/doclet.vala
+++ b/src/doclets/htm/doclet.vala
@@ -109,7 +109,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
 		ns.accept_all_children (this);
 	}
 
-	private void process_node (Api.Node node) {
+	private void process_node (Api.Node node, bool accept_all_children) {
 		string rpath = this.get_real_path (node);
 
 		GLib.FileStream file = GLib.FileStream.open (rpath, "w");
@@ -124,59 +124,62 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
 		write_symbol_content (node);
 		write_file_footer ();
 		file = null;
-		node.accept_all_children (this);
+
+		if (accept_all_children) {
+			node.accept_all_children (this);
+		}
 	}
 
 	public override void visit_interface (Interface item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_class (Api.Class item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_struct (Api.Struct item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_error_domain (Api.ErrorDomain item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_enum (Api.Enum item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_property (Api.Property item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_constant (Api.Constant item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_field (Api.Field item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_error_code (Api.ErrorCode item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_enum_value (Api.EnumValue item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_delegate (Api.Delegate item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_signal (Api.Signal item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_method (Api.Method item) {
-		process_node (item);
+		process_node (item, false);
 	}
 }
 
diff --git a/src/doclets/valadoc.org/doclet.vala b/src/doclets/valadoc.org/doclet.vala
index 8f87ea3..379539a 100755
--- a/src/doclets/valadoc.org/doclet.vala
+++ b/src/doclets/valadoc.org/doclet.vala
@@ -65,10 +65,6 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
 	}
 
 	public override void visit_package (Package package) {
-		if (!package.is_browsable (settings)) {
-			return ;
-		}
-
 		string pkg_name = package.name;
 
 		string path = GLib.Path.build_filename (this.settings.path, pkg_name);
@@ -135,7 +131,7 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
 		node.accept_all_children (this);
 	}
 
-	private void process_node (Api.Node node) {
+	private void process_node (Api.Node node, bool accept_all_children) {
 		// content area:
 		string rpath = this.get_real_path (node, ".content.tpl");
 		GLib.FileStream file = GLib.FileStream.open (rpath, "w");
@@ -158,7 +154,9 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
 		file = null;
 
 
-		node.accept_all_children (this);
+		if (accept_all_children) {
+			node.accept_all_children (this);
+		}
 	}
 
 	protected override void write_wiki_page (WikiPage page, string contentp, string css_path, string js_path, string pkg_name) {
@@ -186,43 +184,43 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
 	}
 
 	public override void visit_error_domain (Api.ErrorDomain item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_enum (Api.Enum item) {
-		process_node (item);
+		process_node (item, true);
 	}
 
 	public override void visit_property (Api.Property item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_constant (Api.Constant item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_field (Api.Field item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_error_code (Api.ErrorCode item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_enum_value (Api.EnumValue item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_delegate (Api.Delegate item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_signal (Api.Signal item) {
-		process_node (item);
+		process_node (item, false);
 	}
 
 	public override void visit_method (Api.Method item) {
-		process_node (item);
+		process_node (item, false);
 	}
 }
 
diff --git a/src/doclets/xml/doclet.vala b/src/doclets/xml/doclet.vala
index 53e8122..418aaa1 100755
--- a/src/doclets/xml/doclet.vala
+++ b/src/doclets/xml/doclet.vala
@@ -41,7 +41,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
 	}
 
 
-	private void process_node (Api.Node node, string tagname) {
+	private void process_node (Api.Node node, string tagname, bool accept_all_children) {
 		_writer.start_tag (tagname, {"name", node.name});
 		var doctree = node.documentation;
 
@@ -54,7 +54,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
 		}
 
 		// avoid exceptions and signal childs
-		if (node is Api.Class || node is Api.Struct || node is Api.Enum || node is Api.ErrorDomain || node is Api.Namespace) {
+		if (accept_all_children) {
 			node.accept_all_children (this);
 		}
 
@@ -84,59 +84,59 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
 	}
 
 	public override void visit_namespace (Api.Namespace ns) {
-		process_node (ns, "namespace");
+		process_node (ns, "namespace", true);
 	}
 
 	public override void visit_interface (Api.Interface item) {
-		process_node (item, "interface");
+		process_node (item, "interface", true);
 	}
 
 	public override void visit_class (Api.Class item) {
-		process_node (item, "class");
+		process_node (item, "class", true);
 	}
 
 	public override void visit_struct (Api.Struct item) {
-		process_node (item, "struct");
+		process_node (item, "struct", true);
 	}
 
 	public override void visit_error_domain (Api.ErrorDomain item) {
-		process_node (item, "error-domain");
+		process_node (item, "error-domain", true);
 	}
 
 	public override void visit_enum (Api.Enum item) {
-		process_node (item, "enum");
+		process_node (item, "enum", true);
 	}
 
 	public override void visit_property (Api.Property item) {
-		process_node (item, "property");
+		process_node (item, "property", false);
 	}
 
 	public override void visit_constant (Api.Constant item) {
-		process_node (item, "constant");
+		process_node (item, "constant", false);
 	}
 
 	public override void visit_field (Api.Field item) {
-		process_node (item, "field");
+		process_node (item, "field", false);
 	}
 
 	public override void visit_error_code (Api.ErrorCode item) {
-		process_node (item, "error-code");
+		process_node (item, "error-code", true);
 	}
 
 	public override void visit_enum_value (Api.EnumValue item) {
-		process_node (item, "enum-value");
+		process_node (item, "enum-value", true);
 	}
 
 	public override void visit_delegate (Api.Delegate item) {
-		process_node (item, "delegate");
+		process_node (item, "delegate", false);
 	}
 
 	public override void visit_signal (Api.Signal item) {
-		process_node (item, "signal");
+		process_node (item, "signal", false);
 	}
 
 	public override void visit_method (Api.Method item) {
-		process_node (item, "method");
+		process_node (item, "method", false);
 	}
 }
 
@@ -144,3 +144,4 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
 public Type register_plugin (GLib.TypeModule module) {
 	return typeof (Valadoc.Xml.Doclet);
 }
+



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