]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Api: Remove settings reference in nodes
authorDidier 'Ptitjes <ptitjes@free.fr>
Wed, 14 Oct 2009 12:31:51 +0000 (14:31 +0200)
committerDidier 'Ptitjes <ptitjes@free.fr>
Wed, 14 Oct 2009 17:22:16 +0000 (19:22 +0200)
36 files changed:
src/doclets/devhelp/doclet/doclet.vala
src/doclets/htm/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/doclet.vala
src/libvaladoc/apitree/apiitem.vala
src/libvaladoc/apitree/apimembernode.vala
src/libvaladoc/apitree/apinode.vala
src/libvaladoc/apitree/apinodebuilder.vala
src/libvaladoc/apitree/apisymbolnode.vala
src/libvaladoc/apitree/apitree.vala
src/libvaladoc/apitree/apitypesymbolnode.vala
src/libvaladoc/apitree/array.vala
src/libvaladoc/apitree/class.vala
src/libvaladoc/apitree/constant.vala
src/libvaladoc/apitree/delegate.vala
src/libvaladoc/apitree/documentedelement.vala
src/libvaladoc/apitree/enum.vala
src/libvaladoc/apitree/enumhandler.vala
src/libvaladoc/apitree/enumvalue.vala
src/libvaladoc/apitree/errorcode.vala
src/libvaladoc/apitree/errordomain.vala
src/libvaladoc/apitree/field.vala
src/libvaladoc/apitree/formalparameter.vala
src/libvaladoc/apitree/interface.vala
src/libvaladoc/apitree/method.vala
src/libvaladoc/apitree/namespace.vala
src/libvaladoc/apitree/namespacehandler.vala
src/libvaladoc/apitree/package.vala
src/libvaladoc/apitree/pointer.vala
src/libvaladoc/apitree/property.vala
src/libvaladoc/apitree/propertyaccessor.vala
src/libvaladoc/apitree/returntypehandler.vala
src/libvaladoc/apitree/signal.vala
src/libvaladoc/apitree/struct.vala
src/libvaladoc/apitree/typeparameter.vala
src/libvaladoc/apitree/typereference.vala
src/libvaladoc/apitree/visitable.vala

index fa7f4e9f91851c9256c12f40ea6998f22f362354..21c5eb3b658ef3569270bec20ba6cce15ecc9658 100755 (executable)
@@ -27,13 +27,13 @@ using Gee;
 namespace Valadoc.Devhelp {
        public string? get_html_link ( Settings settings, Documentation element, Documentation? pos ) {
                if ( element is Visitable ) {
-                       if ( ((Visitable)element).is_visitor_accessible () == false ) {
+                       if ( ((Visitable)element).is_visitor_accessible (settings) == false ) {
                                return null;
                        }
                }
 
                if ( element is DocumentedElement ) {
-                       if ( ((DocumentedElement)element).package.is_visitor_accessible () == false ) {
+                       if ( ((DocumentedElement)element).package.is_visitor_accessible (settings) == false ) {
                                return null;
                        }
                }
index d9f3762025e9b787f99d982874298e59282856ca..4ff5cff3d7d3547fdc590fd927cb72540f26c5a1 100755 (executable)
@@ -26,13 +26,13 @@ using Gee;
 namespace Valadoc {
        public string? get_html_link ( Settings settings, Documentation element, Documentation? pos ) {
                if ( element is Visitable ) {
-                       if ( ((Visitable)element).is_visitor_accessible () == false ) {
+                       if (! ((Visitable) element).is_visitor_accessible (settings)) {
                                return null;
                        }
                }
 
                if ( element is DocumentedElement ) {
-                       if ( ((DocumentedElement)element).package.is_visitor_accessible () == false ) {
+                       if (! ((DocumentedElement) element).package.is_visitor_accessible (settings)) {
                                return null;
                        }
                }
index e571607194f239ced167f156ae5bc365ab3e305d..12d56b4d3e542f39a784bb5288a18d9fd5cd2fee 100755 (executable)
@@ -718,7 +718,7 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
        public void write_navi_packages_inline ( GLib.FileStream file, Tree tree ) {
                file.printf ( "<ul class=\"%s\">\n", css_navi );
                foreach ( Package pkg in tree.get_package_list() ) {
-                       if ( pkg.is_visitor_accessible ( ) ) {
+                       if (pkg.is_visitor_accessible (settings)) {
                                file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a>\n", get_html_inline_navigation_link_css_class (pkg), css_navi_link, this.get_link(pkg, null), pkg.name );
                                // brief description
                                file.puts ( "</li>\n" );
index 27a4890c1b7090372f2062156eeae083a8d31d93..c312f97d985037ea77db09aa856faed03e04e8bf 100644 (file)
@@ -24,12 +24,7 @@ using Gee;
 using Valadoc.Content;
 
 public abstract class Valadoc.Api.Item : Object {
-       public Valadoc.Settings settings {
-               protected get;
-               set;
-       }
-
-       public Basic parent {
+       public Api.Item parent {
                protected set;
                get;
        }
@@ -37,6 +32,6 @@ public abstract class Valadoc.Api.Item : Object {
        protected virtual void resolve_type_references (Tree root) {
        }
 
-       protected virtual void parse_comments (DocumentationParser parser) {
+       protected virtual void process_comments (Settings settings, DocumentationParser parser) {
        }
 }
index ea5b201b74633c68499ffb03014b08f668c87f0f..f836b17e3c8d2bbbf746e5fa93a86aa227bcbfac 100644 (file)
@@ -26,16 +26,16 @@ using Gee;
 
 public abstract class Valadoc.Api.MemberNode : Api.SymbolNode {
 
-       public MemberNode (Settings settings, Vala.Member symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public MemberNode (Vala.Member symbol, Api.Node parent) {
+               base (symbol, parent);
        }
 
-       protected override void parse_comments (DocumentationParser parser) {
+       protected override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.Member) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
                }
 
-               base.parse_comments (parser);
+               base.process_comments (settings, parser);
        }
 }
index 94af777bcc0d624f6cf45b458b1f9830aedf9650..5037502881f52413c0f93c72912bb8f823ae0e19 100644 (file)
@@ -48,6 +48,7 @@ public enum Valadoc.Api.NodeType {
 
 // TODO Drop DocumentedElement
 public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitable {
+       private bool do_document = false;
 
        // TODO Drop DocumentElement
        /* public abstract string? name { owned get; } */
@@ -58,8 +59,7 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
        private Map<Symbol,Node> per_symbol_children;
        private Map<NodeType?,Gee.List<Node>> per_type_children;
 
-       public Node (Settings settings, Api.Node? parent) {
-               this.settings = settings;
+       public Node (Api.Node? parent) {
                this.parent = parent;
 
                per_name_children = new HashMap<string,Node> ();
@@ -69,9 +69,7 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
 
        public abstract void accept (Doclet doclet);
 
-       protected abstract bool is_type_visitor_accessible (Valadoc.Basic element);
-
-       public abstract bool is_visitor_accessible ();
+       public abstract bool is_visitor_accessible (Settings settings);
 
        public override string? get_filename () {
                return null;
@@ -102,24 +100,25 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
                }
        }
 
-       protected override void parse_comments (DocumentationParser parser) {
-               // TODO check is visitable to avoid unuseful processing
+       protected override void process_comments (Settings settings, DocumentationParser parser) {
+               do_document = true;
 
-               foreach (Node node in per_name_children.values) {
-                       node.parse_comments (parser);
+               foreach (Node node in per_symbol_children.values) {
+                       if (node.is_visitor_accessible (settings)) {
+                               node.process_comments (settings, parser);
+                       }
                }
        }
 
-       public Gee.List<Node> get_children_by_type (NodeType type) {
+       public Gee.List<Node> get_children_by_type (NodeType type, bool filtered = true) {
                var children = new ArrayList<Node> ();
 
                Gee.List<Node> all_children = per_type_children.get (type);
                if (all_children != null) {
-                       foreach (Node child in all_children) {
-                               if (!child.is_type_visitor_accessible (this))
-                                       continue ;
-
-                               children.add (child);
+                       foreach (Node node in all_children) {
+                               if (node.do_document || !filtered) {
+                                       children.add (node);
+                               }
                        }
                }
 
@@ -130,7 +129,9 @@ public abstract class Valadoc.Api.Node : /*Api.Item*/DocumentedElement, Visitabl
                Gee.List<Node> all_children = per_type_children.get (type);
                if (all_children != null) {
                        foreach (Node node in all_children) {
-                               node.accept (doclet);
+                               if (node.do_document) {
+                                       node.accept (doclet);
+                               }
                        }
                }
        }
index 75e979123a57944c27d9c93a2dd2deb4bbe17d6c..24d410dc7b127d467f6e4c7a9fad6ce9642965cc 100644 (file)
@@ -25,13 +25,11 @@ using Vala;
 using Gee;
 
 internal class Valadoc.Api.NodeBuilder : CodeVisitor {
-       private Settings settings;
        private Tree root;
        private Gee.Collection<Package> packages;
        private Node current_node;
 
-       internal NodeBuilder (Settings settings, Tree root) {
-               this.settings = settings;
+       internal NodeBuilder (Tree root) {
                this.root = root;
                packages = root.get_package_list ();
                current_node = null;
@@ -70,7 +68,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_class (Vala.Class element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Class (settings, element, parent);
+               SymbolNode node = new Class (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -79,7 +77,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_interface (Vala.Interface element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Interface (settings, element, parent);
+               SymbolNode node = new Interface (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -88,7 +86,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_struct (Vala.Struct element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Struct (settings, element, parent);
+               SymbolNode node = new Struct (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -97,7 +95,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_field (Vala.Field element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Field (settings, element, parent);
+               SymbolNode node = new Field (element, parent);
                parent.add_child (node);
 
                // Process field type
@@ -108,7 +106,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_property (Vala.Property element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Property (settings, element, parent);
+               SymbolNode node = new Property (element, parent);
                parent.add_child (node);
 
                // Process property type
@@ -119,7 +117,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_method (Vala.Method element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Method (settings, element, parent);
+               SymbolNode node = new Method (element, parent);
                parent.add_child (node);
 
                // Process error types
@@ -131,7 +129,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_signal (Vala.Signal element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Signal (settings, element, parent);
+               SymbolNode node = new Signal (element, parent);
                parent.add_child (node);
 
                // Process return type
@@ -142,7 +140,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_delegate (Vala.Delegate element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Delegate (settings, element, parent);
+               SymbolNode node = new Delegate (element, parent);
                parent.add_child (node);
 
                // Process error types
@@ -154,7 +152,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_enum (Vala.Enum element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Enum (settings, element, parent);
+               SymbolNode node = new Enum (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -163,7 +161,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_enum_value (Vala.EnumValue element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new EnumValue (settings, element, parent);
+               SymbolNode node = new EnumValue (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -172,7 +170,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_constant (Vala.Constant element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new Constant (settings, element, parent);
+               SymbolNode node = new Constant (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -181,7 +179,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_error_domain (Vala.ErrorDomain element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new ErrorDomain (settings, element, parent);
+               SymbolNode node = new ErrorDomain (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -190,7 +188,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_error_code (Vala.ErrorCode element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new ErrorCode (settings, element, parent);
+               SymbolNode node = new ErrorCode (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -199,7 +197,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_type_parameter (Vala.TypeParameter element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new TypeParameter (settings, element, parent);
+               SymbolNode node = new TypeParameter (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
@@ -208,7 +206,7 @@ internal class Valadoc.Api.NodeBuilder : CodeVisitor {
        public override void visit_formal_parameter (Vala.FormalParameter element) {
                Node parent = get_parent_node_for (element);
 
-               SymbolNode node = new FormalParameter (settings, element, parent);
+               SymbolNode node = new FormalParameter (element, parent);
                parent.add_child (node);
 
                process_children (node, element);
index d46aa55c173c6729c08e0d6794c778620df007de..de1e314999debc5ec3d29bc620a25b2a6742fcb5 100644 (file)
@@ -36,8 +36,8 @@ public abstract class Valadoc.Api.SymbolNode : Api.Node, SymbolAccessibility {
                }
        }
 
-       public SymbolNode (Settings settings, Vala.Symbol symbol, Api.Node parent) {
-               base (settings, parent);
+       public SymbolNode (Vala.Symbol symbol, Api.Node parent) {
+               base (parent);
                this.symbol = symbol;
        }
 
@@ -54,30 +54,14 @@ public abstract class Valadoc.Api.SymbolNode : Api.Node, SymbolAccessibility {
                return GLib.Path.get_basename ( path );
        }
 
-       protected override bool is_type_visitor_accessible (Valadoc.Basic element) {
-               if (!this.settings._private && is_private)
+       public override bool is_visitor_accessible (Settings settings) {
+               if (!settings._private && this.is_private)
                        return false;
 
-               if (!this.settings._internal && is_internal)
+               if (!settings._internal && this.is_internal)
                        return false;
 
-               if (!this.settings._protected && is_protected)
-                       return false;
-
-               if (this.parent != element && !this.settings.add_inherited)
-                               return false;
-
-               return true;
-       }
-
-       public override bool is_visitor_accessible () {
-               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 (!settings._protected && this.is_protected)
                        return false;
 
                return true;
index ed7fe4d7a6be926a84bea84cbe39381866250062..6f929d9162ddb125c679d5cabb3f0cadc547b7ac 100644 (file)
@@ -186,7 +186,7 @@ public class Valadoc.Tree {
                var vfile = new SourceFile (context, package_path, true);
                context.add_source_file (vfile);
 
-               Package vdpkg = new Package (this.settings, vfile, true);
+               Package vdpkg = new Package (vfile, pkg, true);
                this.packages.add (vdpkg);
 
                var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg));
@@ -233,7 +233,7 @@ public class Valadoc.Tree {
 
 
                                        if (this.sourcefiles == null) {
-                                               this.sourcefiles = new Package (this.settings, source_file, false);
+                                               this.sourcefiles = new Package (source_file, settings.pkg_name, false);
                                                this.packages.add (this.sourcefiles);
                                        }
                                        else {
@@ -254,8 +254,11 @@ public class Valadoc.Tree {
 
                                        context.add_source_file (source_file);
                                } else if (source.has_suffix (".vapi")) {
+                                       string file_name = GLib.Path.get_basename (source);
+                                       file_name = file_name.ndup ( file_name.size() - ".vapi".size() );
+                       
                                        var vfile = new SourceFile (context, rpath, true);
-                                       Package vdpkg = new Package (this.settings, vfile); 
+                                       Package vdpkg = new Package (vfile, file_name); 
                                        context.add_source_file (vfile);
                                        this.packages.add (vdpkg);
                                } else if (source.has_suffix (".c")) {
@@ -297,7 +300,7 @@ public class Valadoc.Tree {
                        }
                }
 
-               Api.NodeBuilder builder = new Api.NodeBuilder (settings, this);
+               Api.NodeBuilder builder = new Api.NodeBuilder (this);
                this.context.accept(builder);
                this.resolve_type_references ();
                this.add_dependencies_to_source_package ();
@@ -318,12 +321,16 @@ public class Valadoc.Tree {
                }
        }
 
+       // TODO Rename to process_comments
        public void parse_comments (DocumentationParser docparser) {
+               // TODO Move Wiki tree parse to Package
                this.wikitree = new WikiPageTree(this.reporter, this.settings);
                wikitree.create_tree (docparser);
 
                foreach (Package pkg in this.packages) {
-                       pkg.parse_comments(docparser);
+                       if (pkg.is_visitor_accessible (settings)) {
+                               pkg.process_comments(settings, docparser);
+                       }
                }
        }
 
index cfb74c7da03ac14d0d6b25f4ff74a02945464744..5d0b0828ab497065710fea64a7a543fdc027b4f6 100644 (file)
@@ -26,16 +26,16 @@ using Gee;
 
 public abstract class Valadoc.Api.TypeSymbolNode : Api.SymbolNode {
 
-       public TypeSymbolNode (Settings settings, Vala.TypeSymbol symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public TypeSymbolNode (Vala.TypeSymbol symbol, Api.Node parent) {
+               base (symbol, parent);
        }
 
-       protected override void parse_comments (DocumentationParser parser) {
+       protected override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.TypeSymbol) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
                }
 
-               base.parse_comments (parser);
+               base.process_comments (settings, parser);
        }
 }
index 1ef8ba590b559b9170dc17f9e562ff081b561d7f..f0f1b8b5c4adec9b73158fc8f66715fcc6f3b1cc 100644 (file)
@@ -31,16 +31,15 @@ public class Valadoc.Array : Basic {
                get;
        }
 
-       public Array (Valadoc.Settings settings, Vala.ArrayType vtyperef, Basic parent) {
-               this.settings = settings;
+       public Array (Vala.ArrayType vtyperef, Api.Item parent) {
                this.vtype = vtyperef;
                this.parent = parent;
 
                Vala.DataType vntype = vtyperef.element_type;
                if ( vntype is Vala.ArrayType )
-                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this);
+                       this.data_type = new Array ((Vala.ArrayType) vntype, this);
                else
-                       this.data_type = new TypeReference (settings, vntype, this);
+                       this.data_type = new TypeReference (vntype, this);
        }
 
        public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
index 62dd708435163ab28839615c3057c6fe6283a1f5..5566a784841f888f9652e97ed1408ea247155753 100644 (file)
@@ -27,8 +27,8 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
        private Gee.ArrayList<Interface> interfaces;
        private Vala.Class vclass;
 
-       public Class (Valadoc.Settings settings, Vala.Class symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Class (Vala.Class symbol, Api.Node parent) {
+               base (symbol, parent);
                this.interfaces = new Gee.ArrayList<Interface>();
 
                this.vclass = symbol;
@@ -68,9 +68,6 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
        }
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_class ( this );
        }
 
index 90e0b33a9fc25cfcf8d58cfd4f1018f9af360710..2afadb3c26fd4604d6e5e20c6efe57d750b5e9ad 100644 (file)
@@ -35,8 +35,8 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
                return ( this.vconst == vconst );
        }
 
-       public Constant (Valadoc.Settings settings, Vala.Constant symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Constant (Vala.Constant symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vconst = symbol;
 
                var vret = this.vconst.type_reference;
@@ -52,9 +52,6 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
        }
 
        public void visit ( Doclet doclet, ConstantHandler? parent ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_constant ( this, parent );
        }
 
index a1fdd4b0042052cbd25b6485a38a15e0148eee91..6c929d9e29e662b003b769a1c942eb7be373a351 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, ReturnTypeHandler, TemplateParameterListHandler, ExceptionHandler {
        private Vala.Delegate vdelegate;
 
-       public Delegate (Valadoc.Settings settings, Vala.Delegate symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Delegate (Vala.Delegate symbol, Api.Node parent) {
+               base (symbol, parent);
 
                this.vdelegate = symbol;
 
@@ -45,9 +45,6 @@ public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, Return
        }
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_delegate ( this );
        }
 
index 20f34e689ac221a8f0884bed588845252e5c6705..01a52dd48e57a25299629b321d020ba54013953c 100644 (file)
@@ -34,7 +34,7 @@ public abstract class Valadoc.DocumentedElement : Basic, Documentation {
        public Namespace? nspace {
                get {
                        if (this._nspace == null) {
-                               Valadoc.Basic ast = this;
+                               Api.Item ast = this;
                                while (ast is Valadoc.Namespace == false) {
                                        ast = ast.parent;
                                        if (ast == null)
@@ -50,7 +50,7 @@ public abstract class Valadoc.DocumentedElement : Basic, Documentation {
        public Package? package {
                get {
                        if (this._package == null) {
-                               Valadoc.Basic ast = this;
+                               Api.Item ast = this;
                                while (ast is Valadoc.Package == false) {
                                        ast = ast.parent;
                                        if (ast == null)
@@ -87,7 +87,7 @@ public abstract class Valadoc.DocumentedElement : Basic, Documentation {
                        GLib.StringBuilder full_name = new GLib.StringBuilder (this.name);
 
                        if (this.parent != null) {
-                               for (Basic pos = this.parent; pos is Package == false ; pos = pos.parent) {
+                               for (Api.Item pos = this.parent; pos is Package == false ; pos = pos.parent) {
                                        string name = ((DocumentedElement)pos).name;
                                        if (name != null) {
                                                full_name.prepend_unichar ('.');
index 33ef0533e18e03f7b0192cd61fdeb9fc912b2850..6453c0b3881e64c900ab849bb2b822fbad3e20c3 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 
 
 public class Valadoc.Enum : Api.TypeSymbolNode, MethodHandler {
-       public Enum (Valadoc.Settings settings, Vala.Enum symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Enum (Vala.Enum symbol, Api.Node parent) {
+               base (symbol, parent);
                this.venum = symbol;
        }
 
@@ -43,9 +43,6 @@ public class Valadoc.Enum : Api.TypeSymbolNode, MethodHandler {
        }
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_enum ( this );
        }
 
index 48f95019c2a3aee6574fc83928148e0395837916..af8c9daf1082f6c042f5b5c99e8ca1b5dc911c12 100644 (file)
@@ -29,15 +29,4 @@ public interface Valadoc.EnumHandler : Api.Node {
        public void visit_enums ( Doclet doclet ) {
                accept_children_by_type (Api.NodeType.ENUM, doclet);
        }
-
-       public void add_enums ( Gee.Collection<Vala.Enum> venums ) {
-               foreach ( Vala.Enum venum in venums ) {
-                       this.add_enum ( venum );
-               }
-       }
-
-       public void add_enum ( Vala.Enum venum ) {
-               Enum tmp = new Enum (this.settings, venum, this);
-               add_child (tmp);
-       }
 }
index 3a440ee605f51699256d4f021a524975d46b0b8b..209698eb11b92473dfd7c439fc395033db9b833d 100644 (file)
@@ -26,18 +26,18 @@ using Gee;
 public class Valadoc.EnumValue: Api.SymbolNode {
        private Vala.EnumValue venval;
 
-       public EnumValue (Valadoc.Settings settings, Vala.EnumValue symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public EnumValue (Vala.EnumValue symbol, Api.Node parent) {
+               base (symbol, parent);
                this.venval = symbol;
        }
 
-       protected override void parse_comments (DocumentationParser parser) {
+       protected override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.EnumValue) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
                }
 
-               base.parse_comments (parser);
+               base.process_comments (settings, parser);
        }
 
        public string get_cname () {
index a493cf62bbaa37e24414743278215aa607e35a3b..b147dba5136ddf6c54eebbeab81db171047a7da1 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.ErrorCode : Api.TypeSymbolNode {
        private Vala.ErrorCode verrcode;
 
-       public ErrorCode (Valadoc.Settings settings, Vala.ErrorCode symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public ErrorCode (Vala.ErrorCode symbol, Api.Node parent) {
+               base (symbol, parent);
                this.verrcode = symbol;
        }
 
index 920a793fb79464bd7e2cc330e62730a272517a08..38ae9522074b86ffbfa31446be11bd7ad0baa1dc 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 public class Valadoc.ErrorDomain : Api.TypeSymbolNode, MethodHandler {
        private Vala.ErrorDomain verrdom;
 
-       public ErrorDomain (Valadoc.Settings settings, Vala.ErrorDomain symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public ErrorDomain (Vala.ErrorDomain symbol, Api.Node parent) {
+               base (symbol, parent);
                this.verrdom = symbol;
        }
 
@@ -42,9 +42,6 @@ public class Valadoc.ErrorDomain : Api.TypeSymbolNode, MethodHandler {
        }
 
        public void visit (Doclet doclet) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_error_domain ( this );
        }
 
index df97a5094b15b0e63326ce6aa26c6e95e3d25e50..389416ba804231dd4d004f0bb95bac6596a295fb 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
        private Vala.Field vfield;
 
-       public Field (Valadoc.Settings settings, Vala.Field symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Field (Vala.Field symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vfield = symbol;
 
                var vret = this.vfield.field_type;
@@ -65,9 +65,6 @@ public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
        }
 
        public void visit ( Doclet doclet, FieldHandler? parent ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_field ( this, parent );
        }
 
index 3239e45c2f0028864fee168904e08530ffa113c5..77c3885eeb48c69b0800498562a35496f9118ffb 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 public class Valadoc.FormalParameter : Api.SymbolNode, ReturnTypeHandler {
        private Vala.FormalParameter vformalparam;
 
-       public FormalParameter (Valadoc.Settings settings, Vala.FormalParameter symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public FormalParameter (Vala.FormalParameter symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vformalparam = symbol;
 
                var vformparam = this.vformalparam.parameter_type;
index 2ad85cadb9171fcb6f9450f43fa327f1e47f502f..8ea3fd6bf49a3f62d73cc9d853d93e23708cb074 100644 (file)
@@ -24,8 +24,8 @@ using Gee;
 
 
 public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler, MethodHandler, DelegateHandler, EnumHandler, StructHandler, ClassHandler {
-       public Interface (Valadoc.Settings settings, Vala.Interface symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Interface (Vala.Interface symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vinterface = symbol;
        }
 
@@ -47,9 +47,6 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
        private Vala.Interface vinterface;
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_interface ( this );
        }
 
index 9b511de3410c0ff2ccf13158dc4825bb87e8d611..0b28b7ece0770050c0b9841b3e0f9c8c17ea129b 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, ReturnTypeHandler {
        private Vala.Method vmethod;
 
-       public Method (Valadoc.Settings settings, Vala.Method symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Method (Vala.Method symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vmethod = symbol;
 
                var vret = this.vmethod.return_type;
@@ -130,9 +130,6 @@ public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHan
        }
 
        public void visit ( Doclet doclet, Valadoc.MethodHandler in_type ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_method ( this, in_type );
        }
 
index 8546da25fe2b97c0048aa122d801d048b07250f7..1cb91190d0e5c84f5016bfecb2a8fb78c5313114 100644 (file)
@@ -29,8 +29,8 @@ public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, Na
 {
        private Comment source_comment;
 
-       public Namespace (Valadoc.Settings settings, Vala.Namespace symbol, NamespaceHandler parent) {
-               base (settings, symbol, parent);
+       public Namespace (Vala.Namespace symbol, NamespaceHandler parent) {
+               base (symbol, parent);
 
                this.vnspace = symbol;
 
@@ -44,12 +44,12 @@ public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, Na
                }
        }
 
-       protected override void parse_comments (DocumentationParser parser) {
+       protected override void process_comments (Settings settings, DocumentationParser parser) {
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
                }
 
-               base.parse_comments (parser);
+               base.process_comments (settings, parser);
        }
 
        public void visit (Doclet doclet) {
index 8f8ba69c79ea530696f33bfb0ba65dc25b7f37d6..bc5cc939c824012b8d0aa0c06616bd6e2012be7d 100644 (file)
@@ -22,8 +22,8 @@ using GLib;
 using Gee;
 
 public interface Valadoc.NamespaceHandler : Api.Node {
-       public Gee.Collection<Namespace> get_namespace_list () {
-               return get_children_by_type (Api.NodeType.NAMESPACE);
+       public Gee.Collection<Namespace> get_namespace_list (bool filtered = true) {
+               return get_children_by_type (Api.NodeType.NAMESPACE, filtered);
        }
 
        public void visit_namespaces ( Doclet doclet ) {
@@ -47,7 +47,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
 
                Namespace ns = this.find_namespace_without_childs ( vns );
                if ( ns == null ) {
-                       ns = new Namespace (this.settings, vns, this);
+                       ns = new Namespace (vns, this);
                        add_child ( ns );
                }
 
@@ -74,7 +74,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
                        return this.get_namespace_helper ( node, vnspaces, 1 );
                }
                else {
-                       var ns = new Namespace (this.settings, vnspace, this);
+                       var ns = new Namespace (vnspace, this);
                        add_child ( ns );
                        return ns;
                }
@@ -85,7 +85,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
                if ( vns == null )
                        return null;
 
-               foreach ( Namespace ns in get_namespace_list () ) {
+               foreach ( Namespace ns in get_namespace_list (false) ) {
                        if ( !ns.is_vnspace( vns ) )
                                continue ;
 
@@ -101,7 +101,7 @@ public interface Valadoc.NamespaceHandler : Api.Node {
        internal Namespace find_namespace_without_childs ( Vala.Namespace vns ) {
                Namespace ns2 = null;
 
-               foreach ( Namespace ns in get_namespace_list () ) {
+               foreach ( Namespace ns in get_namespace_list (false) ) {
                        if ( ns.is_vnspace(vns) )
                                ns2 = ns;
                }
index 0b99a3cef6656a2f9daa0a380627c93ed44bd809..cbcf76a87dd39638ff7ed527f1bbe3bc06577a44 100644 (file)
@@ -71,22 +71,8 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                return this._dependencies.read_only_view;
        }
 
-       private static string extract_package_name ( Settings settings, Vala.SourceFile vfile ) {
-               if ( vfile.filename.has_suffix (".vapi") ) {
-                       string file_name = GLib.Path.get_basename (vfile.filename);
-                       return file_name.ndup ( file_name.size() - ".vapi".size() );
-               }
-               else if ( vfile.filename.has_suffix (".gidl") ) {
-                       string file_name = GLib.Path.get_basename (vfile.filename);
-                       return file_name.ndup ( file_name.size() - ".gidl".size() );
-               }
-               else {
-                       return settings.pkg_name;
-               }
-       }
-
-       public Package.with_name (Valadoc.Settings settings, Vala.SourceFile vfile, string name, bool is_package = false) {
-               base (settings, null);
+       public Package (Vala.SourceFile vfile, string name, bool is_package = false) {
+               base (null);
                this.is_package = is_package;
 
                this.package_name = name;
@@ -95,10 +81,6 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                this.parent = null;
        }
 
-       public Package (Valadoc.Settings settings, Vala.SourceFile vfile, bool is_package = false) {
-               this.with_name (settings, vfile, this.extract_package_name (settings, vfile), is_package);
-       }
-
        private string package_name;
 
        public override string? name {
@@ -116,18 +98,11 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                return this.vfiles.contains (source_file);
        }
 
-       protected override bool is_type_visitor_accessible (Valadoc.Basic element) {
-               return true;
-       }
-
-       public override bool is_visitor_accessible () {
-               return !( this.is_package && this.settings.with_deps == false );
+       public override bool is_visitor_accessible (Settings settings) {
+               return !( this.is_package && settings.with_deps == false );
        }
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible () ) {
-                       return ;
-               }
                doclet.visit_package ( this );
        }
 
index be693b7c093fc8c1fa3d7ebdc8f577a19bb11af9..aac5e7dc3ac72f1067dfa87abcc48fb65e6de25f 100644 (file)
@@ -32,18 +32,17 @@ public class Valadoc.Pointer : Basic {
                get;
        }
 
-       public Pointer (Valadoc.Settings settings, Vala.PointerType vtyperef, Basic parent) {
-               this.settings = settings;
+       public Pointer (Vala.PointerType vtyperef, Api.Item parent) {
                this.vtype = vtyperef;
                this.parent = parent;
 
                Vala.DataType vntype = vtype.base_type;
                if (vntype is Vala.PointerType)
-                       this.data_type = new Pointer (settings, (Vala.PointerType) vntype, this);
+                       this.data_type = new Pointer ((Vala.PointerType) vntype, this);
                else if (vntype is Vala.ArrayType)
-                       this.data_type = new Array (settings, (Vala.ArrayType) vntype, this);
+                       this.data_type = new Array ((Vala.ArrayType) vntype, this);
                else
-                       this.data_type = new TypeReference (settings, vntype, this);
+                       this.data_type = new TypeReference (vntype, this);
        }
 
        public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
index 8ba2768efebdc34568fcc184ac3e1490d70a64a6..6f7fe9056e17a539519b80e16833f5bad5f506bc 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        private Vala.Property vproperty;
 
-       public Property (Valadoc.Settings settings, Vala.Property symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Property (Vala.Property symbol, Api.Node parent) {
+               base (symbol, parent);
 
                this.vproperty = symbol;
 
@@ -35,11 +35,11 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
                this.set_ret_type (ret);
 
                if (this.vproperty.get_accessor != null) {
-                       this.getter = new PropertyAccessor (this.settings, this.vproperty.get_accessor, this);
+                       this.getter = new PropertyAccessor (this.vproperty.get_accessor, this);
                }
 
                if (this.vproperty.set_accessor != null) {
-                       this.setter = new PropertyAccessor (this.settings, this.vproperty.set_accessor, this);
+                       this.setter = new PropertyAccessor (this.vproperty.set_accessor, this);
                }
        }
 
@@ -111,9 +111,6 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        }
 
        public void visit (Doclet doclet) {
-               if (!this.is_visitor_accessible ())
-                       return ;
-
                doclet.visit_property (this);
        }
 
index 49b23b6524441e715ac99aa3500f977402ec07ad..67910b8f43924992d064a3afca1254cd7ed1a99b 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.PropertyAccessor : Api.SymbolNode {
        private Vala.PropertyAccessor vpropacc;
 
-       public PropertyAccessor (Valadoc.Settings settings, Vala.PropertyAccessor symbol, Property parent) {
-               base (settings, symbol, parent);
+       public PropertyAccessor (Vala.PropertyAccessor symbol, Property parent) {
+               base (symbol, parent);
                this.vpropacc = symbol;
        }
 
index 5f157234459fa5c919320605b1b432c93e521e0e..c9887e94e5eae77b8dfeb93378cbf5b7a9dddb8c 100644 (file)
@@ -36,7 +36,7 @@ public interface Valadoc.ReturnTypeHandler : Basic {
 
        // rename
        internal void set_ret_type ( Vala.DataType? vtref ) {
-               var tmp = new TypeReference (this.settings, vtref, this);
+               var tmp = new TypeReference (vtref, this);
                this.type_reference = tmp;
        }
 }
index ba3b73b8f1abe9a94be46471b78a5a0aa1c59303..922eaaf4a0f94f43c813d1f7ca898d26d628d8e8 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHandler {
        private Vala.Signal vsignal;
 
-       public Signal (Valadoc.Settings settings, Vala.Signal symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Signal (Vala.Signal symbol, Api.Node parent) {
+               base (symbol, parent);
 
                this.vsignal = symbol;
 
@@ -57,9 +57,6 @@ public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHa
        }
 
        public void visit (Doclet doclet) {
-               if ( !this.is_visitor_accessible () )
-                       return ;
-
                doclet.visit_signal (this);
        }
 
index 786460cd134ba41cca4969b76133303ad1a0002f..fb24229f34d1553240124e26103d218a6a4c91cd 100644 (file)
@@ -26,8 +26,8 @@ using Gee;
 public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMethodHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler {
        private Vala.Struct vstruct;
 
-       public Struct (Valadoc.Settings settings, Vala.Struct symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public Struct (Vala.Struct symbol, Api.Node parent) {
+               base (symbol, parent);
                this.vstruct = symbol;
        }
 
@@ -41,9 +41,6 @@ public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMet
        }
 
        public void visit ( Doclet doclet ) {
-               if ( !this.is_visitor_accessible ( ) )
-                       return ;
-
                doclet.visit_struct (this);
        }
 
index 607a38431290b8eeea8e4fa0415dd1608473387e..22e9d05270bd912d643c94caf81cb6b36dc15006 100644 (file)
@@ -25,8 +25,8 @@ using Gee;
 
 public class Valadoc.TypeParameter : Api.SymbolNode, ReturnTypeHandler {
 
-       public TypeParameter (Valadoc.Settings settings, Vala.TypeParameter symbol, Api.Node parent) {
-               base (settings, symbol, parent);
+       public TypeParameter (Vala.TypeParameter symbol, Api.Node parent) {
+               base (symbol, parent);
        }
 
        public TypeReference? type_reference {
index 86e1a9860d56c8f7f626463d80148a8fa9568c29..1360930abbeeeb30f0368cddada472784033b32c 100644 (file)
@@ -27,8 +27,7 @@ public class Valadoc.TypeReference : Basic {
        private Gee.ArrayList<TypeReference> type_arguments = new Gee.ArrayList<TypeReference> ();
        private Vala.DataType? vtyperef;
 
-       public TypeReference (Valadoc.Settings settings, Vala.DataType? vtyperef, Basic parent) {
-               this.settings = settings;
+       public TypeReference (Vala.DataType? vtyperef, Api.Item parent) {
                this.vtyperef = vtyperef;
                this.parent = parent;
        }
@@ -39,7 +38,7 @@ public class Valadoc.TypeReference : Basic {
 
        private void set_template_argument_list (Tree root, Gee.Collection<Vala.DataType> varguments) {
                foreach ( Vala.DataType vdtype in varguments ) {
-                       var dtype = new TypeReference (this.settings, vdtype, this);
+                       var dtype = new TypeReference (vdtype, this);
                        dtype.resolve_type_references (root);
                        this.type_arguments.add ( dtype );
                }
@@ -187,9 +186,9 @@ public class Valadoc.TypeReference : Basic {
        protected override void resolve_type_references (Tree root) {
                if ( this.vtyperef != null ) {
                        if ( this.vtyperef is PointerType )
-                               this.data_type = new Pointer (settings, (Vala.PointerType) this.vtyperef, this);
+                               this.data_type = new Pointer ((Vala.PointerType) this.vtyperef, this);
                        else if ( vtyperef is ArrayType )
-                               this.data_type = new Array (settings, (Vala.ArrayType) this.vtyperef, this);
+                               this.data_type = new Array ((Vala.ArrayType) this.vtyperef, this);
                        else if ( vtyperef is GenericType )
                                 this.data_type = (TypeParameter) root.search_vala_symbol (((Vala.GenericType) this.vtyperef).type_parameter);
                }
index 012d4a5e4648f322a6a460f1b31175563ebc3f34..bcb03d449412db298824f36f4472e8ebe7dee2a9 100644 (file)
@@ -21,9 +21,9 @@ using Vala;
 using GLib;
 using Gee;
 
+// Rename to Browsable
 public interface Valadoc.Visitable : Api.Item {
 
-       protected abstract bool is_type_visitor_accessible (Valadoc.Basic element);
-
-       public abstract bool is_visitor_accessible ();
+       // Rename to is_browsable
+       public abstract bool is_visitor_accessible (Settings settings);
 }