[valadoc] - internal support



commit ad89f193f0d7541d65610873fa01c8ba1d3e4bcd
Author: Florian Brosch <flo brosch gmail com>
Date:   Sat Sep 12 00:56:18 2009 +0200

    - internal support

 src/doclets/htmlhelpers/doclet/langlet.vala |    4 +++
 src/doclets/htmlhelpers/languages/vala.vala |    8 +++++-
 src/libvaladoc/apitree.vala                 |   35 ++++++++++++++++++++------
 src/libvaladoc/settings.vala                |    1 +
 src/valadoc/valadoc.vala                    |    3 ++
 5 files changed, 42 insertions(+), 9 deletions(-)
---
diff --git a/src/doclets/htmlhelpers/doclet/langlet.vala b/src/doclets/htmlhelpers/doclet/langlet.vala
index 0046ce9..8e321de 100755
--- a/src/doclets/htmlhelpers/doclet/langlet.vala
+++ b/src/doclets/htmlhelpers/doclet/langlet.vala
@@ -335,6 +335,8 @@ public class Valadoc.Html.BasicLanglet : Valadoc.Langlet {
 				file.puts ( "protected " );
 			else if ( propac.is_private )
 				file.puts ( "private " );
+			else if ( propac.is_internal )
+				file.puts ( "internal " );
 		}
 
 		if ( propac.is_owned )
@@ -430,6 +432,8 @@ public class Valadoc.Html.BasicLanglet : Valadoc.Langlet {
 			file.printf ( "<span class=\"%s\">protected</span> ", css_keyword );
 		else if ( element.is_private )
 			file.printf ( "<span class=\"%s\">private</span> ", css_keyword );
+		else if ( element.is_internal )
+			file.printf ( "<span class=\"%s\">internal</span> ", css_keyword );
 	}
 
 
diff --git a/src/doclets/htmlhelpers/languages/vala.vala b/src/doclets/htmlhelpers/languages/vala.vala
index ed3c5b4..da84844 100755
--- a/src/doclets/htmlhelpers/languages/vala.vala
+++ b/src/doclets/htmlhelpers/languages/vala.vala
@@ -250,6 +250,9 @@ public class Valadoc.Html.Api.Vala {
 		else if (symbol.is_protected) {
 			return "protected ";
 		}
+		else if (symbol.is_internal) {
+			return "internal ";
+		}
 		else {
 			return "private ";
 		}
@@ -544,9 +547,12 @@ public class Valadoc.Html.Api.Vala {
 		else if (propac.is_public) {
 			str.append ("public ");
 		}
-		else {
+		else if (propac.is_protected) {
 			str.append ("protected ");
 		}
+		else {
+			str.append ("internal ");
+		}
 
 		if (propac.is_owned) {
 			str.append ("owned ");
diff --git a/src/libvaladoc/apitree.vala b/src/libvaladoc/apitree.vala
index db3f496..a0f5699 100755
--- a/src/libvaladoc/apitree.vala
+++ b/src/libvaladoc/apitree.vala
@@ -1097,24 +1097,30 @@ public interface Valadoc.StructHandler : Basic {
 
 
 public interface Valadoc.Visitable : Basic, SymbolAccessibility {
-	protected bool is_type_visitor_accessible ( Valadoc.Basic element ) {
-		if ( !this.settings._private && this.is_private )
+	protected bool is_type_visitor_accessible (Valadoc.Basic element) {
+		if (!this.settings._private && this.is_private)
 			return false;
 
-		if ( !this.settings._protected && this.is_protected )
+		if (!this.settings._internal && this.is_internal)
 			return false;
 
-		if ( this.parent != element && !this.settings.add_inherited )
+		if (!this.settings._protected && this.is_protected)
+			return false;
+
+		if (this.parent != element && !this.settings.add_inherited)
 				return false;
 
 		return true;
 	}
 
 	public bool is_visitor_accessible ( ) {
-		if ( !this.settings._private && this.is_private )
+		if (!this.settings._private && this.is_private)
+			return false;
+
+		if (!this.settings._internal && this.is_internal)
 			return false;
 
-		if ( !this.settings._protected && this.is_protected )
+		if (!this.settings._protected && this.is_protected)
 			return false;
 
 		return true;
@@ -1133,14 +1139,21 @@ public interface Valadoc.SymbolAccessibility : Basic {
 	public bool is_protected {
 		get {
 			Vala.SymbolAccessibility access = vsymbol.access;
-			return ( access == Vala.SymbolAccessibility.PROTECTED );
+			return (access == Vala.SymbolAccessibility.PROTECTED);
+		}
+	}
+
+	public bool is_internal {
+		get {
+			Vala.SymbolAccessibility access = vsymbol.access;
+			return (access == Vala.SymbolAccessibility.INTERNAL);
 		}
 	}
 
 	public bool is_private {
 		get {
 			Vala.SymbolAccessibility access = vsymbol.access;
-			return ( access == Vala.SymbolAccessibility.PRIVATE );
+			return (access == Vala.SymbolAccessibility.PRIVATE);
 		}
 	}
 }
@@ -1999,6 +2012,12 @@ public class Valadoc.PropertyAccessor : Object {
 		}
 	}
 
+	public bool is_internal {
+		get {
+			return this.vpropacc.access == Vala.SymbolAccessibility.INTERNAL;
+		}
+	}
+
 	public bool is_set {
 		get {
 			return this.vpropacc.writable;
diff --git a/src/libvaladoc/settings.vala b/src/libvaladoc/settings.vala
index 7595f8b..d5129e5 100755
--- a/src/libvaladoc/settings.vala
+++ b/src/libvaladoc/settings.vala
@@ -28,6 +28,7 @@ public class Valadoc.Settings : Object {
 
 	public bool _private = false;
 	public bool _protected = false;
+	public bool _internal = false;
 	public bool with_deps = false;
 	public bool add_inherited = false;
 	public bool verbose = false;
diff --git a/src/valadoc/valadoc.vala b/src/valadoc/valadoc.vala
index 1863d29..0558955 100755
--- a/src/valadoc/valadoc.vala
+++ b/src/valadoc/valadoc.vala
@@ -34,6 +34,7 @@ public class ValaDoc : Object {
 
 	private static bool add_inherited = false;
 	private static bool _protected = false;
+	private static bool _internal = false;
 	private static bool with_deps = false;
 	private static bool _private = false;
 	private static bool version = false;
@@ -77,6 +78,7 @@ public class ValaDoc : Object {
 		{ "doclet", 0, 0, OptionArg.STRING, ref pluginpath, "plugin", "Name of an included doclet or path to custom doclet" },
 
 		{ "protected", 0, 0, OptionArg.NONE, ref _protected, "Adds protected elements to documentation", null },
+		{ "internal", 0, 0, OptionArg.NONE, ref _internal, "Adds internal elements to documentation", null },
 		{ "private", 0, 0, OptionArg.NONE, ref _private, "Adds private elements to documentation", null },
 //		{ "inherit", 0, 0, OptionArg.NONE, ref add_inherited, "Adds inherited elements to a class", null },
 		{ "package-name", 0, 0, OptionArg.STRING, ref pkg_name, "package name", "DIRECTORY" },
@@ -130,6 +132,7 @@ public class ValaDoc : Object {
 		settings.pkg_version = this.pkg_version;
 		settings.add_inherited = this.add_inherited;
 		settings._protected = this._protected;
+		settings._internal = this._internal;
 		settings.with_deps = this.with_deps;
 		settings._private = this._private;
 		settings.path = realpath (this.directory);



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