From: Florian Brosch Date: Fri, 11 Sep 2009 22:56:18 +0000 (+0200) Subject: - internal support X-Git-Tag: 0.37.1~3^2~589 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad89f193f0d7541d65610873fa01c8ba1d3e4bcd;p=thirdparty%2Fvala.git - internal support --- diff --git a/src/doclets/htmlhelpers/doclet/langlet.vala b/src/doclets/htmlhelpers/doclet/langlet.vala index 0046ce947..8e321de2d 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 ( "protected ", css_keyword ); else if ( element.is_private ) file.printf ( "private ", css_keyword ); + else if ( element.is_internal ) + file.printf ( "internal ", css_keyword ); } diff --git a/src/doclets/htmlhelpers/languages/vala.vala b/src/doclets/htmlhelpers/languages/vala.vala index ed3c5b4c1..da848441e 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 db3f4967b..a0f5699e0 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 7595f8bf8..d5129e5d7 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 1863d2996..055895502 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);