]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Api: Remove *Handler interfaces
authorDidier "Ptitjes <ptitjes@free.fr>
Tue, 20 Oct 2009 00:48:26 +0000 (02:48 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Tue, 20 Oct 2009 00:48:26 +0000 (02:48 +0200)
41 files changed:
src/doclets/devhelp/doclet/doclet.vala
src/doclets/htm/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/doclet.vala
src/libvaladoc/Makefile.am
src/libvaladoc/api/class.vala
src/libvaladoc/api/classhandler.vala [deleted file]
src/libvaladoc/api/constant.vala
src/libvaladoc/api/constanthandler.vala [deleted file]
src/libvaladoc/api/constructionmethodhandler.vala [deleted file]
src/libvaladoc/api/delegate.vala
src/libvaladoc/api/delegatehandler.vala [deleted file]
src/libvaladoc/api/enum.vala
src/libvaladoc/api/enumhandler.vala [deleted file]
src/libvaladoc/api/errordomain.vala
src/libvaladoc/api/errordomainhandler.vala [deleted file]
src/libvaladoc/api/exceptionlisthandler.vala [deleted file]
src/libvaladoc/api/field.vala
src/libvaladoc/api/fieldhandler.vala [deleted file]
src/libvaladoc/api/formalparameter.vala
src/libvaladoc/api/interface.vala
src/libvaladoc/api/interfacehandler.vala [deleted file]
src/libvaladoc/api/method.vala
src/libvaladoc/api/methodhandler.vala [deleted file]
src/libvaladoc/api/namespace.vala
src/libvaladoc/api/namespacehandler.vala [deleted file]
src/libvaladoc/api/node.vala
src/libvaladoc/api/nodebuilder.vala
src/libvaladoc/api/package.vala
src/libvaladoc/api/parameterlisthandler.vala [deleted file]
src/libvaladoc/api/property.vala
src/libvaladoc/api/propertyhandler.vala [deleted file]
src/libvaladoc/api/returntypehandler.vala [deleted file]
src/libvaladoc/api/signal.vala
src/libvaladoc/api/signalhandler.vala [deleted file]
src/libvaladoc/api/struct.vala
src/libvaladoc/api/structhandler.vala [deleted file]
src/libvaladoc/api/symbol.vala
src/libvaladoc/api/templateparameterlisthandler.vala [deleted file]
src/libvaladoc/api/tree.vala
src/libvaladoc/api/typeparameter.vala
src/libvaladoc/api/typereference.vala

index b0415ac907bc93e17be09b393273472d7bbb3416..3a4714b9abe7313c47bab2ecf57f1048789c86fd 100755 (executable)
@@ -222,10 +222,11 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 
                write_wiki_pages ( tree, css_path_wiki, Path.build_filename(this.settings.path, this.settings.pkg_name, "content") );
 
-               Gee.Collection<Package> packages = tree.get_package_list ();
-               foreach ( Package pkg in packages ) {
-                       pkg.accept (this);
-               }
+               tree.accept (this);
+       }
+
+       public override void visit_tree (Api.Tree tree) {
+               tree.accept_children (this);
        }
 
        public override void visit_package (Package package) {
@@ -257,278 +258,111 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                write_file_footer ();
                file = null;
 
-               package.visit_namespaces ( this );
+               package.accept_all_children (this);
 
                this.devhelp.save_file ( devpath );
        }
 
-       public override void visit_namespace ( Namespace ns ) {
-               if ( ns.name != null ) {
-                       string rpath = this.get_real_path ( ns );
-                       string path = this.get_path ( ns );
+       private void process_compound_node (Api.Node node, KeywordType type) {
+               string rpath = this.get_real_path (node);
+               string path = this.get_path (node);
 
-                       GLib.FileStream file = GLib.FileStream.open ( rpath, "w" );
+               if (node.name != null) {
+                       this.devhelp.add_chapter_start (node.name, path);
+       
+                       GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                        writer = new MarkupWriter (file);
                        _renderer.set_writer (writer);
-                       write_file_header (this.css_path, ns.full_name());
-                       write_namespace_content (ns, ns);
+                       write_file_header (css_path, node.full_name());
+                       write_symbol_content (node);
                        write_file_footer ();
                        file = null;
-
-                       this.devhelp.add_keyword ( KeywordType.NAMESPACE, ns.name, path );
-                       this.devhelp.add_chapter_start ( ns.name, path );
                }
 
-               ns.visit_namespaces ( this );
-               ns.visit_classes ( this );
-               ns.visit_interfaces ( this );
-               ns.visit_structs ( this );
-               ns.visit_enums ( this );
-               ns.visit_error_domains ( this );
-               ns.visit_delegates ( this );
-               ns.visit_methods ( this );
-               ns.visit_fields ( this );
-               ns.visit_constants ( this );
-
-               if ( ns.name != null ) {
-                       this.devhelp.add_chapter_end ( );
+               node.accept_all_children (this);
+
+               if (node.name != null) {
+                       this.devhelp.add_chapter_end ();
+                       this.devhelp.add_keyword (type, node.name, path);
                }
        }
 
-       public override void visit_interface ( Interface iface ) {
-               string rpath = this.get_real_path ( iface );
-               string path = this.get_path ( iface );
-
+       private void process_node (Api.Node node, KeywordType type) {
+               string rpath = this.get_real_path (node);
+               string path = this.get_path (node);
 
-               this.devhelp.add_chapter_start ( iface.name, path );
-
-               iface.visit_classes ( this );
-               iface.visit_structs ( this );
-               iface.visit_enums ( this );
-               iface.visit_delegates ( this );
-               iface.visit_methods ( this );
-               iface.visit_signals ( this );
-               iface.visit_properties ( this );
-               iface.visit_fields ( this );
-               iface.visit_constants ( this );
-
-               this.devhelp.add_chapter_end ( );
-
-               this.devhelp.add_keyword ( KeywordType.INTERFACE, iface.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
+               GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                writer = new MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (this.css_path, iface.full_name());
-               write_symbol_content (iface);
+               write_file_header (css_path, node.full_name());
+               write_symbol_content (node);
                write_file_footer ();
                file = null;
-       }
 
-       public override void visit_class ( Class cl ) {
-               string rpath = this.get_real_path ( cl );
-               string path = this.get_path ( cl );
+               node.accept_all_children (this);
 
-
-               this.devhelp.add_keyword ( KeywordType.CLASS, cl.name, path );
-               this.devhelp.add_chapter_start ( cl.name, path );
-
-               cl.visit_construction_methods ( this );
-               cl.visit_classes ( this );
-               cl.visit_structs ( this );
-               cl.visit_enums ( this );
-               cl.visit_delegates ( this );
-               cl.visit_methods ( this );
-               cl.visit_signals ( this );
-               cl.visit_properties ( this );
-               cl.visit_fields ( this );
-               cl.visit_constants ( this );
-
-               this.devhelp.add_chapter_end ( );
-
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, cl.full_name());
-               write_symbol_content (cl);
-               write_file_footer ();
-               file = null;
+               this.devhelp.add_keyword (type, node.name, path);
+               this.devhelp.add_chapter (node.name, path);
        }
 
-       public override void visit_struct ( Struct stru ) {
-               string rpath = this.get_real_path ( stru );
-               string path = this.get_path ( stru );
-
-
-               this.devhelp.add_keyword ( KeywordType.STRUCT, stru.name, path );
-               this.devhelp.add_chapter_start ( stru.name, path );
-
-               stru.visit_construction_methods ( this );
-               stru.visit_methods ( this );
-               stru.visit_fields ( this );
-               stru.visit_constants ( this );
-
-               this.devhelp.add_chapter_end ( );
-
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, stru.full_name());
-               write_symbol_content (stru);
-               write_file_footer ();
-               file = null;
+       public override void visit_namespace (Namespace item) {
+               process_compound_node (item, KeywordType.NAMESPACE);
        }
 
-       public override void visit_error_domain ( ErrorDomain errdom ) {
-               string rpath = this.get_real_path ( errdom );
-               string path = this.get_path ( errdom );
-
-               errdom.visit_methods ( this );
-
-               this.devhelp.add_keyword ( KeywordType.ERRORDOMAIN, errdom.name, path );
-               this.devhelp.add_chapter ( errdom.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, errdom.full_name());
-               write_symbol_content (errdom);
-               write_file_footer ();
-               file = null;
+       public override void visit_interface (Interface item) {
+               process_compound_node (item, KeywordType.INTERFACE);
        }
 
-       public override void visit_enum ( Enum en ) {
-               string rpath = this.get_real_path ( en );
-               string path = this.get_path ( en );
-
-               en.visit_enum_values ( this );
-               en.visit_methods ( this );
-
-               this.devhelp.add_keyword ( KeywordType.ENUM, en.name, path );
-               this.devhelp.add_chapter ( en.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, en.full_name());
-               write_symbol_content (en);
-               write_file_footer ();
-               file = null;
+       public override void visit_class (Class item) {
+               process_compound_node (item, KeywordType.CLASS);
        }
 
-       public override void visit_property ( Property prop ) {
-               string rpath = this.get_real_path ( prop );
-               string path = this.get_path ( prop );
-
-               this.devhelp.add_keyword ( KeywordType.PROPERTY, prop.name, path );
-               this.devhelp.add_chapter ( prop.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, prop.full_name());
-               write_symbol_content (prop);
-               write_file_footer ();
-               file = null;
+       public override void visit_struct (Struct item) {
+               process_compound_node (item, KeywordType.STRUCT);
        }
 
-       public override void visit_constant (Constant constant) {
-               string rpath = this.get_real_path ( constant );
-               string path = this.get_path ( constant );
-
-               this.devhelp.add_keyword ( KeywordType.VARIABLE, constant.name, path );
-               this.devhelp.add_chapter ( constant.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, constant.full_name());
-               write_symbol_content (constant);
-               write_file_footer ();
-               file = null;
+       public override void visit_error_domain (ErrorDomain item) {
+               process_node (item, KeywordType.ERRORDOMAIN);
        }
 
-       public override void visit_field (Field field) {
-               string rpath = this.get_real_path ( field );
-               string path = this.get_path ( field );
-
-               this.devhelp.add_keyword ( KeywordType.VARIABLE, field.name, path );
-               this.devhelp.add_chapter ( field.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, field.full_name());
-               write_symbol_content (field);
-               write_file_footer ();
-               file = null;
+       public override void visit_enum ( Enum item) {
+               process_node (item, KeywordType.ENUM);
        }
 
-       public override void visit_error_code ( ErrorCode errcode ) {
+       public override void visit_property (Property item) {
+               process_node (item, KeywordType.PROPERTY);
        }
 
-       public override void visit_enum_value ( Api.EnumValue enval ) {
+       public override void visit_constant (Constant item) {
+               process_node (item, KeywordType.VARIABLE);
        }
 
-       public override void visit_delegate ( Delegate del ) {
-               string rpath = this.get_real_path ( del );
-               string path = this.get_path ( del );
-
-               this.devhelp.add_keyword ( KeywordType.DELEGATE, del.name, path );
-               this.devhelp.add_chapter ( del.name, path );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, del.full_name());
-               write_symbol_content (del);
-               write_file_footer ();
-               file = null;
+       public override void visit_field (Field item) {
+               process_node (item, KeywordType.VARIABLE);
        }
 
-       public override void visit_signal ( Api.Signal sig ) {
-               string rpath = this.get_real_path ( sig );
-               string path = this.get_path ( sig );
-
-               this.devhelp.add_keyword ( KeywordType.SIGNAL, sig.name, path );
-               this.devhelp.add_chapter ( sig.name, path );
+       public override void visit_error_code (ErrorCode item) {
+       }
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, sig.full_name());
-               write_symbol_content (sig);
-               write_file_footer ();
-               file = null;
+       public override void visit_enum_value (Api.EnumValue item) {
        }
 
-       public override void visit_method (Method m) {
-               string rpath = this.get_real_path ( m );
-               string path = this.get_path ( m );
+       public override void visit_delegate (Delegate item) {
+               process_node (item, KeywordType.DELEGATE);
+       }
 
-               this.devhelp.add_keyword ( KeywordType.FUNCTION, m.name, path );
-               this.devhelp.add_chapter ( m.name, path );
+       public override void visit_signal (Api.Signal item) {
+               process_node (item, KeywordType.SIGNAL);
+       }
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, m.full_name());
-               write_symbol_content (m);
-               write_file_footer ();
-               file = null;
+       public override void visit_method (Method item) {
+               process_node (item, KeywordType.FUNCTION);
        }
 }
 
-
-
-
-
 [ModuleInit]
 public Type register_plugin ( ) {
        Valadoc.Html.get_html_link_imp = Valadoc.Devhelp.get_html_link;
        return typeof ( Valadoc.Devhelp.Doclet );
 }
 
-
index 6d7fbfc39a0751a446ddfbddcdbe321aaafb677b..d6e252c9bb9069f8862582cda14777b7fceb3866 100755 (executable)
@@ -130,10 +130,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                write_file_footer ();
                file = null;
 
-               Gee.Collection<Package> packages = tree.get_package_list ();
-               foreach ( Package pkg in packages ) {
-                       pkg.accept (this);
-               }
+               tree.accept (this);
+       }
+
+       public override void visit_tree (Api.Tree tree) {
+               tree.accept_children (this);
        }
 
        public override void visit_package (Package package) {
@@ -152,7 +153,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                write_file_footer ();
                file = null;
 
-               package.visit_namespaces ( this );
+               package.accept_all_children (this);
        }
 
        public override void visit_namespace ( Namespace ns ) {
@@ -169,208 +170,90 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                        file = null;
                }
 
-               // file:
-               ns.visit_namespaces ( this );
-               ns.visit_classes ( this );
-               ns.visit_interfaces ( this );
-               ns.visit_structs ( this );
-               ns.visit_enums ( this );
-               ns.visit_error_domains ( this );
-               ns.visit_delegates ( this );
-               ns.visit_methods ( this );
-               ns.visit_fields ( this );
-               ns.visit_constants ( this );
+               ns.accept_all_children (this);
        }
 
-       public override void visit_interface ( Interface iface ) {
-               string rpath = this.get_real_path ( iface );
-
-               iface.visit_classes ( this );
-               iface.visit_structs ( this );
-               iface.visit_enums ( this );
-               iface.visit_delegates ( this );
-               iface.visit_methods ( this );
-               iface.visit_signals ( this );
-               iface.visit_properties ( this );
-               iface.visit_fields ( this );
-               iface.visit_constants ( this );
+       private void process_node (Api.Node node) {
+               string rpath = this.get_real_path (node);
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
+               GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                writer = new MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (this.css_path, iface.full_name());
-               write_navi_symbol (iface);
-               write_symbol_content (iface);
+               write_file_header (css_path, node.full_name());
+               if (is_internal_node (node)) {
+                       write_navi_symbol (node);
+               } else {
+                       write_navi_leaf_symbol (node);
+               }
+               write_symbol_content (node);
                write_file_footer ();
                file = null;
-       }
 
-       public override void visit_class ( Class cl ) {
-               string rpath = this.get_real_path ( cl );
-
-               cl.visit_construction_methods ( this );
-               cl.visit_classes ( this );
-               cl.visit_structs ( this );
-               cl.visit_enums ( this );
-               cl.visit_delegates ( this );
-               cl.visit_methods ( this );
-               cl.visit_signals ( this );
-               cl.visit_properties ( this );
-               cl.visit_fields ( this );
-               cl.visit_constants ( this );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, cl.full_name());
-               write_navi_symbol (cl);
-               write_symbol_content (cl);
-               write_file_footer ();
-               file = null;
+               node.accept_all_children (this);
        }
 
-       public override void visit_struct ( Struct stru ) {
-               string rpath = this.get_real_path ( stru );
-
-               stru.visit_construction_methods ( this );
-               stru.visit_methods ( this );
-               stru.visit_fields ( this );
-               stru.visit_constants ( this );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, stru.full_name());
-               write_navi_symbol (stru);
-               write_symbol_content (stru);
-               write_file_footer ();
-               file = null;
+       private bool is_internal_node (Api.Node node) {
+               return node is Package
+                      || node is Namespace
+                      || node is Interface
+                      || node is Class
+                      || node is Struct;
        }
 
-       public override void visit_error_domain ( ErrorDomain errdom ) {
-               string rpath = this.get_real_path ( errdom );
-
-               errdom.visit_methods ( this );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, errdom.full_name());
-               write_navi_symbol (errdom);
-               write_symbol_content (errdom);
-               write_file_footer ();
-               file = null;
+       public override void visit_interface (Interface item) {
+               process_node (item);
        }
 
-       public override void visit_enum ( Enum en ) {
-               string rpath = this.get_real_path ( en );
-
-               en.visit_enum_values ( this );
-               en.visit_methods ( this );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, en.full_name());
-               write_navi_symbol (en);
-               write_symbol_content (en);
-               write_file_footer ();
-               file = null;
+       public override void visit_class (Class item) {
+               process_node (item);
        }
 
-       public override void visit_property ( Property prop ) {
-               string rpath = this.get_real_path ( prop );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, prop.full_name());
-               write_navi_leaf_symbol (prop);
-               write_symbol_content (prop);
-               write_file_footer ();
-               file = null;
+       public override void visit_struct (Struct item) {
+               process_node (item);
        }
 
-       public override void visit_constant (Constant constant) {
-               string rpath = this.get_real_path ( constant );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, constant.full_name());
-               write_navi_leaf_symbol (constant);
-               write_symbol_content (constant);
-               write_file_footer ();
-               file = null;
+       public override void visit_error_domain (ErrorDomain item) {
+               process_node (item);
        }
 
-       public override void visit_field (Field field) {
-               string rpath = this.get_real_path ( field );
-
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, field.full_name());
-               write_navi_leaf_symbol (field);
-               write_symbol_content (field);
-               write_file_footer ();
-               file = null;
+       public override void visit_enum (Enum item) {
+               process_node (item);
        }
 
-       public override void visit_error_code ( ErrorCode errcode ) {
+       public override void visit_property (Property item) {
+               process_node (item);
        }
 
-       public override void visit_enum_value ( Api.EnumValue enval ) {
+       public override void visit_constant (Constant item) {
+               process_node (item);
        }
 
-       public override void visit_delegate ( Delegate del ) {
-               string rpath = this.get_real_path ( del );
+       public override void visit_field (Field item) {
+               process_node (item);
+       }
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, del.full_name());
-               write_navi_leaf_symbol (del);
-               write_symbol_content (del);
-               write_file_footer ();
-               file = null;
+       public override void visit_error_code (ErrorCode item) {
        }
 
-       public override void visit_signal ( Api.Signal sig ) {
-               string rpath = this.get_real_path ( sig );
+       public override void visit_enum_value (Api.EnumValue item) {
+       }
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, sig.full_name());
-               write_navi_leaf_symbol (sig);
-               write_symbol_content (sig);
-               write_file_footer ();
-               file = null;
+       public override void visit_delegate (Delegate item) {
+               process_node (item);
        }
 
-       public override void visit_method (Method m) {
-               string rpath = this.get_real_path ( m );
+       public override void visit_signal (Api.Signal item) {
+               process_node (item);
+       }
 
-               GLib.FileStream file = GLib.FileStream.open ( rpath, "w");
-               writer = new MarkupWriter (file);
-               _renderer.set_writer (writer);
-               write_file_header (this.css_path, m.full_name());
-               write_navi_leaf_symbol (m);
-               write_symbol_content (m);
-               write_file_footer ();
-               file = null;
+       public override void visit_method (Method item) {
+               process_node (item);
        }
 }
 
-
-
-
-
 [ModuleInit]
 public Type register_plugin ( ) {
        Valadoc.Html.get_html_link_imp = Valadoc.get_html_link;
        return typeof ( Valadoc.HtmlDoclet );
 }
 
-
index cd3b4796b30c33ed80d1f3e6399318983c23269c..31a1c8599a42a801ca894151b8d1bd4f4407222a 100755 (executable)
@@ -154,12 +154,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                }
        }
 
-       protected void fetch_subnamespace_names (NamespaceHandler pos, Gee.ArrayList<Namespace> lst) {
-               Gee.Collection<Namespace> nspaces = pos.get_namespace_list ();
-
-               foreach (Namespace ns in nspaces) {
-                       lst.add (ns);
-                       this.fetch_subnamespace_names (ns, lst);
+       protected void fetch_subnamespace_names (Api.Node node, Gee.ArrayList<Namespace> namespaces) {
+               foreach (Api.Node child in node.get_children_by_type (Api.NodeType.NAMESPACE)) {
+                       namespaces.add ((Namespace) child);
+                       this.fetch_subnamespace_names (child, namespaces);
                }
        }
 
@@ -387,23 +385,23 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                writer.end_tag ("div");
        }
 
-       protected void write_child_namespaces (NamespaceHandler nh, Api.Node? parent) {
-               Gee.ArrayList<Namespace> nsl = new Gee.ArrayList<Namespace> ();
-               this.fetch_subnamespace_names (nh, nsl);
+       protected void write_child_namespaces (Api.Node node, Api.Node? parent) {
+               Gee.ArrayList<Namespace> namespaces = new Gee.ArrayList<Namespace> ();
+               this.fetch_subnamespace_names (node, namespaces);
 
-               if (nsl.size == 0)
+               if (namespaces.size == 0)
                        return ;
 
-               if (nsl.size == 1) {
-                       if (nsl.get(0).name == null)
+               if (namespaces.size == 1) {
+                       if (namespaces.get(0).name == null)
                                return ;
                }
 
-               bool with_childs = (parent == null)? false : parent is Package;
+               bool with_childs = parent != null && parent is Package;
 
                writer.start_tag ("h3", css_title).text ("Namespaces:").end_tag ("h3");
                writer.start_tag ("ul", css_inline_navigation);
-               foreach (Namespace child in nsl) {
+               foreach (Namespace child in namespaces) {
                        if (child.name != null) {
                                writer.start_tag ("li", css_namespace);
                                writer.link (get_link (child, parent), child.name);
index ed4534f74784a030df24a277e7a88ae8d54f4499..27649480314d91591cf073f0693c0efa21244300 100644 (file)
@@ -35,47 +35,30 @@ libvaladoc_la_VALASOURCES = \
        documentation/wikiscanner.vala \
        api/array.vala \
        api/class.vala \
-       api/classhandler.vala \
        api/constant.vala \
-       api/constanthandler.vala \
-       api/constructionmethodhandler.vala \
        api/delegate.vala \
-       api/delegatehandler.vala \
        api/enum.vala \
-       api/enumhandler.vala \
        api/enumvalue.vala \
        api/errorcode.vala \
        api/errordomain.vala \
-       api/errordomainhandler.vala \
-       api/exceptionlisthandler.vala \
        api/field.vala \
-       api/fieldhandler.vala \
        api/formalparameter.vala \
        api/interface.vala \
-       api/interfacehandler.vala \
        api/item.vala \
        api/member.vala \
        api/method.vala \
-       api/methodhandler.vala \
        api/namespace.vala \
-       api/namespacehandler.vala \
        api/node.vala \
        api/nodebuilder.vala \
        api/package.vala \
-       api/parameterlisthandler.vala \
        api/pointer.vala \
        api/property.vala \
        api/propertyaccessor.vala \
-       api/propertyhandler.vala \
-       api/returntypehandler.vala \
        api/signal.vala \
-       api/signalhandler.vala \
        api/signaturebuilder.vala \
        api/struct.vala \
-       api/structhandler.vala \
        api/symbol.vala \
        api/symbolaccessibility.vala \
-       api/templateparameterlisthandler.vala \
        api/tree.vala \
        api/typeparameter.vala \
        api/typereference.vala \
@@ -181,3 +164,4 @@ vapi_DATA =     \
        valadoc-1.0.deps \
        $(NULL)
 
+
index 9d5bd758b34afb9c4366da03229e99f5a1cbd588..81e49da10ddfcc4a71cbffab8efec1f98fa69025 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Class : TypeSymbol, ClassHandler, StructHandler, SignalHandler, MethodHandler, EnumHandler, PropertyHandler, ConstructionMethodHandler, FieldHandler, DelegateHandler, ConstantHandler, TemplateParameterListHandler {
+public class Valadoc.Api.Class : TypeSymbol {
        private ArrayList<TypeReference> interfaces;
        private Vala.Class vclass;
 
@@ -50,10 +50,6 @@ public class Valadoc.Api.Class : TypeSymbol, ClassHandler, StructHandler, Signal
                return this.interfaces;
        }
 
-       internal bool is_vclass (Vala.Class vcl) {
-               return this.vclass == vcl;
-       }
-
        public bool is_abstract {
                get {
                        return this.vclass.is_abstract;
@@ -139,3 +135,4 @@ public class Valadoc.Api.Class : TypeSymbol, ClassHandler, StructHandler, Signal
                return signature.get ();
        }
 }
+
diff --git a/src/libvaladoc/api/classhandler.vala b/src/libvaladoc/api/classhandler.vala
deleted file mode 100644 (file)
index 4a61b66..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.ClassHandler : Node {
-       protected Class? find_vclass (Vala.Class vcl) {
-               foreach (Class cl in get_class_list ()) {
-                       if (cl.is_vclass (vcl)) {
-                               return cl;
-                       }
-
-                       var tmp = cl.find_vclass (vcl);
-                       if (tmp != null) {
-                               return tmp;
-                       }
-               }
-               return null;
-       }
-
-       public Gee.Collection<Class> get_class_list () {
-               return get_children_by_type (NodeType.CLASS);
-       }
-
-       public void visit_classes (Visitor visitor) {
-               accept_children_by_type (NodeType.CLASS, visitor);
-       }
-}
-
index dd48b355cd845e6489089b7f3a63c9fee5e30226..6de083c6bbe6b20dee71e290073827eddf7b7e7f 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Constant : Member, ReturnTypeHandler {
+public class Valadoc.Api.Constant : Member {
        private Vala.Constant vconst;
 
        public TypeReference? type_reference {
@@ -36,8 +36,7 @@ public class Valadoc.Api.Constant : Member, ReturnTypeHandler {
                base (symbol, parent);
                this.vconst = symbol;
 
-               var vret = this.vconst.type_reference;
-               this.set_ret_type (vret);
+               type_reference = new TypeReference (symbol.type_reference, this);
        }
 
        public string get_cname () {
@@ -45,7 +44,7 @@ public class Valadoc.Api.Constant : Member, ReturnTypeHandler {
        }
 
        protected override void resolve_type_references (Tree root) {
-               this.set_return_type_references (root);
+               type_reference.resolve_type_references (root);
        }
 
        protected override Inline build_signature () {
@@ -63,3 +62,4 @@ public class Valadoc.Api.Constant : Member, ReturnTypeHandler {
                visitor.visit_constant (this);
        }
 }
+
diff --git a/src/libvaladoc/api/constanthandler.vala b/src/libvaladoc/api/constanthandler.vala
deleted file mode 100644 (file)
index a3975c3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.ConstantHandler : Node {
-       public Collection<Constant> get_constant_list () {
-               return get_children_by_type (NodeType.CONSTANT);
-       }
-
-       public void visit_constants (Visitor visitor) {
-               accept_children_by_type (NodeType.CONSTANT, visitor);
-       }
-}
diff --git a/src/libvaladoc/api/constructionmethodhandler.vala b/src/libvaladoc/api/constructionmethodhandler.vala
deleted file mode 100644 (file)
index 63f3f94..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.ConstructionMethodHandler : Node {
-       public Collection<Method> get_construction_method_list () {
-               return get_children_by_type (NodeType.CREATION_METHOD);
-       }
-
-       public void visit_construction_methods (Visitor visitor) {
-               accept_children_by_type (NodeType.CREATION_METHOD, visitor);
-       }
-}
-
index 36debeb1f9d09d29b288ee03a56b231eb1eafd36..cf88e7353a84647c7d7f43c3d8544e2123b15364 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Delegate : TypeSymbol, ParameterListHandler, ReturnTypeHandler, TemplateParameterListHandler, ExceptionHandler {
+public class Valadoc.Api.Delegate : TypeSymbol {
        private Vala.Delegate vdelegate;
 
        public Delegate (Vala.Delegate symbol, Node parent) {
@@ -28,8 +28,7 @@ public class Valadoc.Api.Delegate : TypeSymbol, ParameterListHandler, ReturnType
 
                this.vdelegate = symbol;
 
-               var ret = this.vdelegate.return_type;
-               this.set_ret_type (ret);
+               type_reference = new TypeReference (symbol.return_type, this);
        }
 
        public string? get_cname () {
@@ -54,10 +53,7 @@ public class Valadoc.Api.Delegate : TypeSymbol, ParameterListHandler, ReturnType
        }
 
        protected override void resolve_type_references (Tree root) {
-               this.set_return_type_references (root);
-
-               var vexceptionlst = this.vdelegate.get_error_types ();
-               this.add_exception_list (root, vexceptionlst);
+               type_reference.resolve_type_references (root);
 
                base.resolve_type_references (root);
        }
@@ -116,3 +112,4 @@ public class Valadoc.Api.Delegate : TypeSymbol, ParameterListHandler, ReturnType
                return signature.get ();
        }
 }
+
diff --git a/src/libvaladoc/api/delegatehandler.vala b/src/libvaladoc/api/delegatehandler.vala
deleted file mode 100644 (file)
index 70201f5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.DelegateHandler : Node {
-       public Gee.Collection<Delegate> get_delegate_list () {
-               return get_children_by_type (NodeType.DELEGATE);
-       }
-
-       public void visit_delegates (Visitor visitor) {
-               accept_children_by_type (NodeType.DELEGATE, visitor);
-       }
-}
index 4beade8411e217e057fbfef911e6bf1dc0702317..3f5bae776bf6de093ff0a684954c691af216aae6 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Enum : TypeSymbol, MethodHandler {
+public class Valadoc.Api.Enum : TypeSymbol {
        public Enum (Vala.Enum symbol, Node parent) {
                base (symbol, parent);
                this.venum = symbol;
@@ -30,15 +30,6 @@ public class Valadoc.Api.Enum : TypeSymbol, MethodHandler {
                return this.venum.get_cname();
        }
 
-       // rename: get_enum_value_list
-       public Collection<EnumValue> get_enum_values () {
-               return get_children_by_type (NodeType.ENUM_VALUE);
-       }
-
-       public void visit_enum_values (Visitor visitor) {
-               accept_children_by_type (NodeType.ENUM_VALUE, visitor);
-       }
-
        public override NodeType node_type { get { return NodeType.ENUM; } }
 
        public override void accept (Visitor visitor) {
@@ -55,3 +46,4 @@ public class Valadoc.Api.Enum : TypeSymbol, MethodHandler {
                        .get ();
        }
 }
+
diff --git a/src/libvaladoc/api/enumhandler.vala b/src/libvaladoc/api/enumhandler.vala
deleted file mode 100644 (file)
index f6e8080..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.EnumHandler : Node {
-       public Collection<Enum> get_enum_list () {
-               return get_children_by_type (NodeType.ENUM);
-       }
-
-       public void visit_enums (Visitor visitor) {
-               accept_children_by_type (NodeType.ENUM, visitor);
-       }
-}
-
index 3019bd15c68440543113ff4e0e84ec73faf03b80..d8c5e76925b7bf67539e1052daa85d7734fcc3ff 100644 (file)
@@ -21,7 +21,7 @@ using Gee;
 using Valadoc.Content;
 
 
-public class Valadoc.Api.ErrorDomain : TypeSymbol, MethodHandler {
+public class Valadoc.Api.ErrorDomain : TypeSymbol {
        private Vala.ErrorDomain verrdom;
 
        public ErrorDomain (Vala.ErrorDomain symbol, Node parent) {
@@ -33,14 +33,6 @@ public class Valadoc.Api.ErrorDomain : TypeSymbol, MethodHandler {
                return this.verrdom.get_cname();
        }
 
-       public void visit_error_codes (Visitor visitor) {
-               accept_children_by_type (NodeType.ERROR_CODE, visitor);
-       }
-
-       public Collection<ErrorCode> get_error_code_list () {
-               return get_children_by_type (NodeType.ERROR_CODE);
-       }
-
        public override NodeType node_type { get { return NodeType.ERROR_DOMAIN; } }
 
        public override void accept (Visitor visitor) {
@@ -55,3 +47,4 @@ public class Valadoc.Api.ErrorDomain : TypeSymbol, MethodHandler {
                        .get ();
        }
 }
+
diff --git a/src/libvaladoc/api/errordomainhandler.vala b/src/libvaladoc/api/errordomainhandler.vala
deleted file mode 100644 (file)
index a42b538..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.ErrorDomainHandler : Node {
-       public Collection<ErrorDomain> get_error_domain_list () {
-               return get_children_by_type (NodeType.ERROR_DOMAIN);
-       }
-
-       public void visit_error_domains (Visitor visitor) {
-               accept_children_by_type (NodeType.ERROR_DOMAIN, visitor);
-       }
-}
diff --git a/src/libvaladoc/api/exceptionlisthandler.vala b/src/libvaladoc/api/exceptionlisthandler.vala
deleted file mode 100644 (file)
index 9f24bd9..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-// rename to ExceptionListHandler
-public interface Valadoc.Api.ExceptionHandler : Node {
-
-       public Collection<Api.Node> get_error_domains () {
-               return get_children_by_type (NodeType.ERROR_DOMAIN);
-       }
-
-       public void add_exception_list (Tree root, Vala.Collection<Vala.DataType> vexceptions) {
-               foreach (Vala.DataType vtype in vexceptions) {
-                       if (((Vala.ErrorType) vtype).error_domain == null) {
-                               add_child (glib_error);
-                       } else {
-                               ErrorDomain type = (ErrorDomain) root.search_vala_symbol (((Vala.ErrorType) vtype).error_domain);
-                               add_child (type);
-                       }
-               }
-       }
-}
-
index a3272a3910d4c3415328f55a657035f3da9aff7a..b64066685b2408ca4ed0dfc28a2a541ae3c5ca2b 100644 (file)
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Field : Member, ReturnTypeHandler {
+public class Valadoc.Api.Field : Member {
        private Vala.Field vfield;
 
        public Field (Vala.Field symbol, Node parent) {
                base (symbol, parent);
                this.vfield = symbol;
 
-               var vret = this.vfield.field_type;
-               this.set_ret_type (vret);
+               type_reference = new TypeReference (symbol.field_type, this);
        }
 
        public string? get_cname () {
@@ -57,7 +56,7 @@ public class Valadoc.Api.Field : Member, ReturnTypeHandler {
        }
 
        protected override void resolve_type_references (Tree root) {
-               this.set_return_type_references (root);
+               type_reference.resolve_type_references (root);
 
                base.resolve_type_references (root);
        }
@@ -84,3 +83,4 @@ public class Valadoc.Api.Field : Member, ReturnTypeHandler {
                visitor.visit_field (this);
        }
 }
+
diff --git a/src/libvaladoc/api/fieldhandler.vala b/src/libvaladoc/api/fieldhandler.vala
deleted file mode 100644 (file)
index 4f54010..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.FieldHandler : Node {
-       public Collection<Field> get_field_list () {
-               return get_children_by_type (NodeType.FIELD);
-       }
-
-       public void visit_fields (Visitor visitor) {
-               accept_children_by_type (NodeType.FIELD, visitor);
-       }
-}
index 478fc7cef053a543f846d9cc133b4cab8d53b811..840b7456c16dac6f9da67245fc26c62e596e5081 100644 (file)
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.FormalParameter : Symbol, ReturnTypeHandler {
+public class Valadoc.Api.FormalParameter : Symbol {
        private Vala.FormalParameter vformalparam;
 
        public FormalParameter (Vala.FormalParameter symbol, Node parent) {
                base (symbol, parent);
                this.vformalparam = symbol;
 
-               var vformparam = this.vformalparam.parameter_type;
-               this.set_ret_type (vformparam);
+               type_reference = new TypeReference (symbol.parameter_type, this);
        }
 
        public bool is_out {
@@ -71,7 +70,7 @@ public class Valadoc.Api.FormalParameter : Symbol, ReturnTypeHandler {
                        return;
                }
 
-               this.set_return_type_references (root);
+               type_reference.resolve_type_references (root);
 
                base.resolve_type_references (root);
        }
@@ -100,3 +99,4 @@ public class Valadoc.Api.FormalParameter : Symbol, ReturnTypeHandler {
                return signature.get ();
        }
 }
+
index 17030f05cab3f11c2615aefd973b1932eb074680..de718031f1dd709d99d9d145508331ff29132caf 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Interface : TypeSymbol, SignalHandler, PropertyHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler, MethodHandler, DelegateHandler, EnumHandler, StructHandler, ClassHandler {
+public class Valadoc.Api.Interface : TypeSymbol {
        public Interface (Vala.Interface symbol, Node parent) {
                base (symbol, parent);
                this.vinterface = symbol;
@@ -119,3 +119,4 @@ public class Valadoc.Api.Interface : TypeSymbol, SignalHandler, PropertyHandler,
                return signature.get ();
        }
 }
+
diff --git a/src/libvaladoc/api/interfacehandler.vala b/src/libvaladoc/api/interfacehandler.vala
deleted file mode 100644 (file)
index a4c323a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.InterfaceHandler : Node {
-       public Collection<Interface> get_interface_list () {
-               return get_children_by_type (NodeType.INTERFACE);
-       }
-
-       public void visit_interfaces (Visitor visitor) {
-               accept_children_by_type (NodeType.INTERFACE, visitor);
-       }
-}
index 3e02aeb826c63424fbdda9d635ccbec73be5661c..93f9a83c06d55a94dfc46fce0ac1ccb5953d389b 100644 (file)
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Method : Member, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, ReturnTypeHandler {
+public class Valadoc.Api.Method : Member {
        private Vala.Method vmethod;
 
        public Method (Vala.Method symbol, Node parent) {
                base (symbol, parent);
                this.vmethod = symbol;
 
-               var vret = this.vmethod.return_type;
-               this.set_ret_type (vret);
+               type_reference = new TypeReference (symbol.return_type, this);
        }
 
        public string? get_cname () {
@@ -119,10 +118,7 @@ public class Valadoc.Api.Method : Member, ParameterListHandler, ExceptionHandler
                        this.base_method = (Method?) root.search_vala_symbol (vm);
                }
 
-               var vexceptionlst = this.vmethod.get_error_types ();
-               this.add_exception_list (root, vexceptionlst);
-
-               this.set_return_type_references (root);
+               type_reference.resolve_type_references (root);
 
                base.resolve_type_references (root);
        }
diff --git a/src/libvaladoc/api/methodhandler.vala b/src/libvaladoc/api/methodhandler.vala
deleted file mode 100644 (file)
index a5899ee..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.MethodHandler : Node {
-       public void visit_methods (Visitor visitor) {
-               accept_children_by_type (NodeType.METHOD, visitor);
-       }
-
-       public Collection<Method> get_method_list () {
-               return get_children_by_type (NodeType.METHOD);
-       }
-}
index 1253e10848d9675cbdee9494728ed1a0008886a4..15ed3450fefe11906724588091f31aa25150a882 100644 (file)
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Namespace : Symbol, MethodHandler, FieldHandler, NamespaceHandler, ErrorDomainHandler,
-                                 EnumHandler, ClassHandler, StructHandler, InterfaceHandler,
-                                 DelegateHandler, ConstantHandler
-{
+public class Valadoc.Api.Namespace : Symbol {
        private Vala.Comment source_comment;
 
-       public Namespace (Vala.Namespace symbol, NamespaceHandler parent) {
+       public Namespace (Vala.Namespace symbol, Api.Node parent) {
                base (symbol, parent);
 
                this.vnspace = symbol;
@@ -67,8 +64,5 @@ public class Valadoc.Api.Namespace : Symbol, MethodHandler, FieldHandler, Namesp
                private get;
                set;
        }
-
-       internal bool is_vnspace (Vala.Namespace vns) {
-               return this.vnspace == vns;
-       }
 }
+
diff --git a/src/libvaladoc/api/namespacehandler.vala b/src/libvaladoc/api/namespacehandler.vala
deleted file mode 100644 (file)
index f21bd3e..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.NamespaceHandler : Node {
-       public Collection<Namespace> get_namespace_list (bool filtered = true) {
-               return get_children_by_type (NodeType.NAMESPACE, filtered);
-       }
-
-       public void visit_namespaces (Visitor visitor) {
-               accept_children_by_type (NodeType.NAMESPACE, visitor);
-       }
-
-       private ArrayList<Vala.Namespace> create_parent_vnamespace_list (Vala.Symbol vsymbol) {
-               var lst = new ArrayList<Vala.Namespace> ();
-
-               while (vsymbol != null) {
-                       if (vsymbol is Vala.Namespace) {
-                               lst.insert ( 0, (Vala.Namespace)vsymbol );
-                       }
-                       vsymbol = vsymbol.parent_symbol;
-               }
-               return lst;
-       }
-
-       internal Namespace get_namespace_helper (Vala.Symbol node, Gee.List<Vala.Namespace> vnspaces, int pos) {
-               Vala.Namespace vns = vnspaces.get (pos);
-
-               Namespace ns = this.find_namespace_without_childs (vns);
-               if (ns == null) {
-                       ns = new Namespace (vns, this);
-                       add_child (ns);
-               }
-
-               if (vnspaces.size == pos+1) {
-                       return ns;
-               }
-
-               return ns.get_namespace_helper (node, vnspaces, pos+1);
-       }
-
-       protected Namespace get_namespace (Vala.Symbol node) {
-               Vala.Symbol vnd = ((Vala.Symbol)node).parent_symbol;
-               if (vnd is Vala.Namespace == false) {
-                       vnd = vnd.parent_symbol;
-               }
-
-               Vala.Namespace vnspace = (Vala.Namespace)vnd;
-               var nspace = this.find_namespace (vnspace);
-               if (nspace != null) {
-                       return nspace;
-               }
-
-               var vnspaces = this.create_parent_vnamespace_list (node);
-
-               if (vnspaces.size > 2) {
-                       return this.get_namespace_helper (node, vnspaces, 1);
-               } else {
-                       var ns = new Namespace (vnspace, this);
-                       add_child (ns);
-                       return ns;
-               }
-       }
-
-       internal Namespace? find_vnamespace_helper (Gee.List<Vala.Namespace> vnspaces, int pos) {
-               Vala.Namespace? vns = vnspaces.get (pos);
-               if (vns == null) {
-                       return null;
-               }
-
-               foreach (Namespace ns in get_namespace_list (false)) {
-                       if (!ns.is_vnspace(vns)) {
-                               continue;
-                       }
-                       if (pos+1 == vnspaces.size) {
-                               return ns;
-                       }
-                       return ns.find_vnamespace_helper (vnspaces, pos+1);
-               }
-
-               return null;
-       }
-
-       internal Namespace find_namespace_without_childs (Vala.Namespace vns) {
-               Namespace ns2 = null;
-
-               foreach (Namespace ns in get_namespace_list (false)) {
-                       if (ns.is_vnspace(vns)) {
-                               ns2 = ns;
-                       }
-               }
-
-               return ns2;
-       }
-
-       internal Namespace find_namespace (Vala.Namespace vns) {
-               var vnspaces = this.create_parent_vnamespace_list (vns);
-
-               return this.find_vnamespace_helper (vnspaces, vnspaces.index_of (vns));
-       }
-}
index 99efbf8deac50532330647f2ea086e8c667a2c31..b1c875213155b30cf6f291b957a90df76954f2a7 100644 (file)
@@ -154,6 +154,16 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation {
                }
        }
 
+       public void accept_all_children (Visitor visitor) {
+               foreach (Gee.List<Node> children in per_type_children.values) {
+                       foreach (Node node in children) {
+                               if (node.do_document) {
+                                       node.accept (visitor);
+                               }
+                       }
+               }
+       }
+
        public Node? find_by_name (string name) {
                return per_name_children.get (name);
        }
index 7b79fd01fa023ecf10d56e3b0e9fa85feddaa92d..5662a5bfbdf84120c71bb3a8e0bf3b054350493e 100644 (file)
@@ -48,8 +48,7 @@ internal class Valadoc.Api.NodeBuilder : Vala.CodeVisitor {
 
                Vala.SourceFile source_file = element.source_reference.file;
                Package package = find_package_for (source_file);
-               Namespace ns = package.get_namespace (element);
-               return ns;
+               return package.get_namespace (root, element);
        }
 
        private Package? find_package_for (Vala.SourceFile source_file) {
@@ -224,3 +223,4 @@ internal class Valadoc.Api.NodeBuilder : Vala.CodeVisitor {
        }
 }
 
+
index f9f9c2b20cd109f08af5b58f146aa8aae44e539c..a7a780cbb8622bff2a646b2cd84b54bc81fa3c8e 100644 (file)
@@ -20,9 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-
-
-public class Valadoc.Api.Package : Node, NamespaceHandler {
+public class Valadoc.Api.Package : Node {
        private ArrayList<Vala.SourceFile> vfiles = new ArrayList<Vala.SourceFile> ();
 
        internal void add_file (Vala.SourceFile vfile) {
@@ -88,7 +86,6 @@ public class Valadoc.Api.Package : Node, NamespaceHandler {
                }
        }
 
-       // TODO Remove
        internal bool is_vpackage (Vala.SourceFile vfile) {
                return this.vfiles.contains (vfile);
        }
@@ -113,4 +110,35 @@ public class Valadoc.Api.Package : Node, NamespaceHandler {
                        .append (name)
                        .get ();
        }
+
+       protected Namespace get_namespace (Tree root, Vala.Symbol symbol) {
+               Vala.Symbol namespace_symbol = symbol;
+               while (!(namespace_symbol is Vala.Namespace)) {
+                       namespace_symbol = namespace_symbol.parent_symbol;
+               }
+
+               // Try to find it first
+               var ns = (Namespace) root.search_vala_symbol_in (namespace_symbol, this);
+               if (ns != null) {
+                       return ns;
+               }
+
+               // Find parent namespace and use it as parent if existing
+               var parent_namespace_symbol = namespace_symbol.parent_symbol;
+
+               if (parent_namespace_symbol != null) {
+                       ns = (Namespace) get_namespace (root, parent_namespace_symbol);
+                       if (ns != null) {
+                               var new_namespace = new Namespace ((Vala.Namespace) namespace_symbol, ns);
+                               add_child (new_namespace);
+                               return new_namespace;
+                       }
+               }
+
+               // Else take this package as parent
+               var new_namespace = new Namespace ((Vala.Namespace) namespace_symbol, this);
+               add_child (new_namespace);
+               return new_namespace;
+       }
 }
+
diff --git a/src/libvaladoc/api/parameterlisthandler.vala b/src/libvaladoc/api/parameterlisthandler.vala
deleted file mode 100644 (file)
index 5b5e55b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-// TODO Rename FormalParameters
-public interface Valadoc.Api.ParameterListHandler : Node {
-       public Gee.List<FormalParameter> param_list {
-               owned get { return get_parameter_list (); }
-       }
-
-       public Gee.List<FormalParameter> get_parameter_list () {
-               return (Gee.List<FormalParameter>) get_children_by_type (NodeType.FORMAL_PARAMETER);
-       }
-}
-
index f42a8fe0396d1cad59793cb644492f744c319b37..68af7dfb748edc72261cddf650bf474bafe44953 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Property : Member, ReturnTypeHandler {
+public class Valadoc.Api.Property : Member {
        private Vala.Property vproperty;
 
        public Property (Vala.Property symbol, Node parent) {
@@ -28,8 +28,7 @@ public class Valadoc.Api.Property : Member, ReturnTypeHandler {
 
                this.vproperty = symbol;
 
-               var ret = this.vproperty.property_type;
-               this.set_ret_type (ret);
+               type_reference = new TypeReference (symbol.property_type, this);
 
                if (this.vproperty.get_accessor != null) {
                        this.getter = new PropertyAccessor (this.vproperty.get_accessor, this);
@@ -103,7 +102,8 @@ public class Valadoc.Api.Property : Member, ReturnTypeHandler {
                if (vp != null) {
                        this.base_property = (Property?) root.search_vala_symbol (vp);
                }
-               this.set_return_type_references (root);
+
+               type_reference.resolve_type_references (root);
        }
 
        protected override Inline build_signature () {
@@ -141,3 +141,4 @@ public class Valadoc.Api.Property : Member, ReturnTypeHandler {
                visitor.visit_property (this);
        }
 }
+
diff --git a/src/libvaladoc/api/propertyhandler.vala b/src/libvaladoc/api/propertyhandler.vala
deleted file mode 100644 (file)
index f4445ca..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.PropertyHandler : Node {
-       protected bool is_overwritten_property (Property prop) {
-               foreach (Property p in get_property_list ()) {
-                       if (p.parent != this) {
-                               continue ;
-                       }
-                       if (!p.is_override) {
-                               continue ;
-                       }
-                       if (p.equals (prop)) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
-       public Collection<Property> get_property_list () {
-               return get_children_by_type (NodeType.PROPERTY);
-       }
-
-       public void visit_properties (Visitor visitor) {
-               accept_children_by_type (NodeType.PROPERTY, visitor);
-       }
-}
diff --git a/src/libvaladoc/api/returntypehandler.vala b/src/libvaladoc/api/returntypehandler.vala
deleted file mode 100644 (file)
index 5180fb6..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.ReturnTypeHandler : Item {
-       public abstract TypeReference? type_reference {
-               protected set;
-               get;
-       }
-
-       internal void set_return_type_references (Tree root) {
-               if ( this.type_reference == null )
-                       return ;
-
-               this.type_reference.resolve_type_references (root);
-       }
-
-       // rename
-       internal void set_ret_type ( Vala.DataType? vtref ) {
-               var tmp = new TypeReference (vtref, this);
-               this.type_reference = tmp;
-       }
-}
-
index 7fdf206d1eca6df110f89ce56b52f9d8826fe005..b8161a96738ba605d957a22dbec2983bbd198b81 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Signal : Member, ParameterListHandler, ReturnTypeHandler {
+public class Valadoc.Api.Signal : Member {
        private Vala.Signal vsignal;
 
        public Signal (Vala.Signal symbol, Node parent) {
@@ -28,8 +28,7 @@ public class Valadoc.Api.Signal : Member, ParameterListHandler, ReturnTypeHandle
 
                this.vsignal = symbol;
 
-               var ret = this.vsignal.return_type;
-               this.set_ret_type (ret);
+               type_reference = new TypeReference (symbol.return_type, this);
        }
 
        public string? get_cname () {
@@ -42,7 +41,7 @@ public class Valadoc.Api.Signal : Member, ParameterListHandler, ReturnTypeHandle
        }
 
        protected override void resolve_type_references (Tree root) {
-               this.set_return_type_references (root);
+               type_reference.resolve_type_references (root);
 
                base.resolve_type_references (root);
        }
@@ -85,3 +84,4 @@ public class Valadoc.Api.Signal : Member, ParameterListHandler, ReturnTypeHandle
                visitor.visit_signal (this);
        }
 }
+
diff --git a/src/libvaladoc/api/signalhandler.vala b/src/libvaladoc/api/signalhandler.vala
deleted file mode 100644 (file)
index 3110913..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.SignalHandler : Node {
-       public void visit_signals (Visitor visitor) {
-               accept_children_by_type (NodeType.SIGNAL, visitor);
-       }
-
-       public Collection<Signal> get_signal_list () {
-               return get_children_by_type (NodeType.SIGNAL);
-       }
-}
index 21d74ddc6770a1d314d7d24e6b944136a77ce145..de4059172ba0565237938927a84c73de01e7c03e 100644 (file)
@@ -20,7 +20,7 @@
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.Struct : TypeSymbol, MethodHandler, ConstructionMethodHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler {
+public class Valadoc.Api.Struct : TypeSymbol {
        private Vala.Struct vstruct;
 
        public Struct (Vala.Struct symbol, Node parent) {
@@ -88,3 +88,4 @@ public class Valadoc.Api.Struct : TypeSymbol, MethodHandler, ConstructionMethodH
                return signature.get ();
        }
 }
+
diff --git a/src/libvaladoc/api/structhandler.vala b/src/libvaladoc/api/structhandler.vala
deleted file mode 100644 (file)
index 0a2c922..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-public interface Valadoc.Api.StructHandler : Node {
-       public Collection<Struct> get_struct_list () {
-               return get_children_by_type (NodeType.STRUCT);
-       }
-
-       public void visit_structs (Visitor visitor) {
-               accept_children_by_type (NodeType.STRUCT, visitor);
-       }
-}
index 4727963122e08418589a222359c9411a1ba74efa..011e6254c63d634dd9ebdea4a977669753ccae2d 100644 (file)
@@ -103,4 +103,18 @@ public abstract class Valadoc.Api.Symbol : Node, SymbolAccessibility {
                        return "private";
                }
        }
+
+       protected override void resolve_type_references (Tree root) {
+               base.resolve_type_references (root);
+
+               foreach (Vala.DataType type in symbol.get_error_types ()) {
+                       var error_type = type as Vala.ErrorType;
+                       if (error_type.error_domain == null) {
+                               add_child (glib_error);
+                       } else {
+                               add_child (root.search_vala_symbol (error_type.error_domain));
+                       }
+               }
+       }
 }
+
diff --git a/src/libvaladoc/api/templateparameterlisthandler.vala b/src/libvaladoc/api/templateparameterlisthandler.vala
deleted file mode 100644 (file)
index d4f496f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Valadoc.Api.- a documentation tool for vala.
- * Copyright (C) 2008 Florian Brosch
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-using Gee;
-
-
-public interface Valadoc.Api.TemplateParameterListHandler : Node {
-       public Collection<TypeParameter> get_template_param_list () {
-               return get_children_by_type (NodeType.TYPE_PARAMETER, false);
-       }
-}
-
index 41b954e2a65d7a87bad77be0f5de2d9ad37a801c..bc4ec7e4f0a2cbc4697ce393b5fbe15438c3338c 100644 (file)
@@ -56,6 +56,12 @@ public class Valadoc.Api.Tree {
                visitor.visit_tree (this);
        }
 
+       public void accept_children (Visitor visitor) {
+               foreach (Node node in packages) {
+                       node.accept (visitor);
+               }
+       }
+
        private Node? search_relative_to (Node element, string[] path) {
                Api.Node? node = element;
                foreach (string name in path) {
@@ -153,11 +159,11 @@ public class Valadoc.Api.Tree {
                        }
 
                        /* default packages */
-                       if (!this.add_package ("glib-2.0")) { //
+                       if (!this.add_package ("glib-2.0")) {
                                Vala.Report.error (null, "glib-2.0 not found in specified Vala API directories");
                        }
 
-                       if (!this.add_package ("gobject-2.0")) { //
+                       if (!this.add_package ("gobject-2.0")) {
                                Vala.Report.error (null, "gobject-2.0 not found in specified Vala API directories");
                        }
                }
@@ -329,13 +335,15 @@ public class Valadoc.Api.Tree {
                }
        }
 
-       internal Node? search_vala_symbol (Vala.Symbol? vnode) {
-               if (vnode == null) {
-                       return null;
-               }
+       internal Symbol? search_vala_symbol (Vala.Symbol symbol) {
+               Vala.SourceFile source_file = symbol.source_reference.file;
+               Package package = this.find_file (source_file);
+               return search_vala_symbol_in (symbol, package);
+       }
 
+       internal Symbol? search_vala_symbol_in (Vala.Symbol symbol, Package package) {
                ArrayList<Vala.Symbol> params = new ArrayList<Vala.Symbol> ();
-               for (Vala.Symbol iter = vnode; iter != null; iter = iter.parent_symbol) {
+               for (Vala.Symbol iter = symbol; iter != null; iter = iter.parent_symbol) {
                        if (iter is Vala.DataType) {
                                params.insert (0, ((Vala.DataType)iter).data_type);
                        } else {
@@ -353,17 +361,14 @@ public class Valadoc.Api.Tree {
                        }
                }
 
-               Vala.SourceFile vfile = vnode.source_reference.file;
-               Package file = this.find_file(vfile);
-
-               Api.Node? node = file;
-               foreach (Vala.Symbol symbol in params) {
-                       node = node.find_by_symbol (symbol);
+               Api.Node? node = package;
+               foreach (Vala.Symbol a_symbol in params) {
+                       node = node.find_by_symbol (a_symbol);
                        if (node == null) {
                                return null;
                        }
                }
-               return node;
+               return (Symbol) node;
        }
 
        private Package? get_external_package_by_name (string name) {
@@ -375,3 +380,4 @@ public class Valadoc.Api.Tree {
                return null;
        }
 }
+
index 450b1e0f351235a1d6e4534b8471cc370fd0d122..88a1946badb87a1afd53181faff4ca2dfeb20716 100644 (file)
 using Gee;
 using Valadoc.Content;
 
-public class Valadoc.Api.TypeParameter : Symbol, ReturnTypeHandler {
+public class Valadoc.Api.TypeParameter : Symbol {
 
        public TypeParameter (Vala.TypeParameter symbol, Node parent) {
                base (symbol, parent);
        }
 
-       public TypeReference? type_reference {
-               protected set;
-               get;
-       }
-
        protected override Inline build_signature () {
                return new SignatureBuilder ()
                        .append (name)
@@ -43,3 +38,4 @@ public class Valadoc.Api.TypeParameter : Symbol, ReturnTypeHandler {
                visitor.visit_type_parameter (this);
        }
 }
+
index fad20720343a957292d61a646106931cea59132c..610d6b6fbc734e9bff9cf62179d4e3306b22c98f 100644 (file)
@@ -194,7 +194,7 @@ public class Valadoc.Api.TypeReference : Item {
                        }
                } else if (vtyperef is Vala.DelegateType) {
                        this.data_type = root.search_vala_symbol (((Vala.DelegateType) vtyperef).delegate_symbol);
-               } else {
+               } else if (vtyperef.data_type != null) {
                        this.data_type = root.search_vala_symbol (vtyperef.data_type);
                }
 
@@ -250,3 +250,4 @@ public class Valadoc.Api.TypeReference : Item {
                return signature.get ();
        }
 }
+