]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Api: Introduce in-tree signature building
authorDidier 'Ptitjes <ptitjes@free.fr>
Fri, 16 Oct 2009 06:34:15 +0000 (08:34 +0200)
committerDidier 'Ptitjes <ptitjes@free.fr>
Fri, 16 Oct 2009 14:36:09 +0000 (16:36 +0200)
38 files changed:
src/doclets/devhelp/doclet/doclet.vala
src/doclets/htm/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/Makefile.am
src/doclets/htmlhelpers/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/htmlrenderer.vala
src/doclets/htmlhelpers/doclet/langlet.vala [deleted file]
src/doclets/htmlhelpers/doclet/libhtmlhelpers-1.0.vapi
src/libvaladoc/Makefile.am
src/libvaladoc/apitree/apiitem.vala
src/libvaladoc/apitree/apisymbolnode.vala
src/libvaladoc/apitree/array.vala
src/libvaladoc/apitree/class.vala
src/libvaladoc/apitree/constant.vala
src/libvaladoc/apitree/delegate.vala
src/libvaladoc/apitree/enum.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/package.vala
src/libvaladoc/apitree/pointer.vala
src/libvaladoc/apitree/property.vala
src/libvaladoc/apitree/propertyaccessor.vala
src/libvaladoc/apitree/signal.vala
src/libvaladoc/apitree/signaturebuilder.vala [new file with mode: 0644]
src/libvaladoc/apitree/struct.vala
src/libvaladoc/apitree/templateparameterlisthandler.vala
src/libvaladoc/apitree/typeparameter.vala
src/libvaladoc/apitree/typereference.vala
src/libvaladoc/drawer.vala
src/libvaladoc/langlet.vala [deleted file]
src/libvaladoc/valadoc-1.0.vapi
src/valadoc/valadoc
src/vapi/valadoc-1.0.vapi

index c13de8df9e6939cf9b8d43c0738a74d210b49152..5708b90e77b84b6d39c1f19ac1ac555ba6a90df9 100755 (executable)
@@ -218,7 +218,6 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 
                DirUtils.create ( this.settings.path, 0777 );
 
-               this.langlet = new Valadoc.Html.BasicLanglet ( settings );
                this.devhelp = new DevhelpFormat ( settings.pkg_name, "" );
 
                this.write_wiki_pages ( tree, css_path_wiki, Path.build_filename(this.settings.path, this.settings.pkg_name, "content") );
index dc64f092fe56214ef2b0468beea41a40d4ffd2b3..b3a003fa7c0d34b77c99a6808da853584c58c1c7 100755 (executable)
@@ -124,9 +124,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                this.write_file_footer ( file );
                file = null;
 
-
-               this.langlet = new Valadoc.Html.BasicLanglet ( settings );
-
                Gee.Collection<Package> packages = tree.get_package_list ();
                foreach ( Package pkg in packages ) {
                        pkg.visit ( this );
index aaeafc53f22a3618d6bd1a1e61e2d146d9983651..7eda7eabe9329e5152d4c1879a6e3df1ca542415 100644 (file)
@@ -24,7 +24,6 @@ htmlhelpers_LTLIBRARIES =   \
 
 libhtmlhelpers_la_VALASOURCES = \
        globals.vala                \
-       langlet.vala                \
        doclet.vala                 \
        htmlrenderer.vala                 \
        $(NULL)
index 6a772e355d31d538c351488c5dd5174a6b680014..caf3ebcf28072e9f555dab9ffe4b35a7df36ed41 100755 (executable)
@@ -22,7 +22,6 @@ using GLib;
 using Valadoc.Content;
 
 public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
-       protected Valadoc.Langlet langlet;
        protected Settings settings;
        protected HtmlRenderer _renderer;
 
@@ -715,6 +714,12 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                _renderer.render (doctree);
        }
 
+       private void write_signature ( GLib.FileStream file, Api.Node element , Api.Node? pos ) {
+               _renderer.set_container (pos);
+               _renderer.set_filestream (file);
+               _renderer.render (element.signature);
+       }
+
        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() ) {
@@ -762,7 +767,7 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
 
-               this.langlet.write_method ( file, m, parent );
+               this.write_signature (file, m, m);
 
                file.printf ( "\n\t\t\t\t</div>\n" );
 
@@ -803,7 +808,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_signal ( sig, file );
+
+               this.write_signature (file, sig, sig);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
                this.write_documentation ( file, sig, sig );
                file.puts ( "\t\t\t</div>\n" );
@@ -816,7 +823,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_delegate ( del, file );
+
+               this.write_signature (file, del, del);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, del, del );
@@ -837,7 +846,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_field ( field, parent, file );
+
+               this.write_signature (file, field, field);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, field, field );
@@ -858,7 +869,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_constant ( constant, parent, file );
+
+               this.write_signature (file, constant, constant);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, constant, constant );
@@ -879,7 +892,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<hr class=\"%s\" />\n", css_headline_hr );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_property ( prop, file );
+
+               this.write_signature (file, prop, prop);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
                this.write_documentation ( file, prop, prop );
                file.puts ( "\t\t\t</div>\n" );
@@ -1029,7 +1044,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                this.write_image_block ( file, cl );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_class ( cl, file );
+
+               this.write_signature (file, cl, cl);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, cl, cl );
@@ -1062,7 +1079,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                this.write_image_block ( file, iface );
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_interface ( iface, file );
+
+               this.write_signature (file, iface, iface);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, iface, iface );
@@ -1116,7 +1135,9 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
                file.printf ( "\t\t\t\t<h2 class=\"%s\">Description:</h2>\n", css_title );
 
                file.printf ( "\t\t\t\t<div class=\"%s\">\n\t", css_code_definition );
-               this.langlet.write_struct ( stru, file );
+
+               this.write_signature (file, stru, stru);
+
                file.printf ( "\n\t\t\t\t</div>\n" );
 
                this.write_documentation ( file, stru, stru );
index 461b1d2bdd29e2e89dd2aba46fd148c87ba86549..7d8afe88d3f4cfa20dba2195204abe278d1e4675 100755 (executable)
@@ -179,7 +179,13 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
        }
 
        public override void visit_symbol_link (SymbolLink element) {
-               write_symbol_link (element.symbol, element.label);
+               if (element.symbol == _container
+                   || !element.symbol.is_visitor_accessible (_doclet.settings)
+                   || !element.symbol.package.is_visitor_accessible (_doclet.settings)) {
+                       _stream.printf (element.label);
+               } else {
+                       write_symbol_link (element.symbol, element.label);
+               }
        }
 
        public override void visit_list (Content.List element) {
@@ -200,6 +206,7 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
 
        public override void visit_run (Run element) {
                string tag = null;
+               string css_type = null;
                switch (element.style) {
                case Run.Style.BOLD:
                        tag = "b";
@@ -216,9 +223,21 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
                case Run.Style.STROKE:
                        tag = "stroke";
                        break;
+               case Run.Style.LANG_KEYWORD:
+                       tag = "span";
+                       css_type = "main_keyword";
+                       break;
+               case Run.Style.LANG_LITERAL:
+                       tag = "span";
+                       css_type = "main_optional_parameter";
+                       break;
+               case Run.Style.LANG_TYPE:
+                       tag = "span";
+                       css_type = "main_basic_type";
+                       break;
                }
                if (tag != null) {
-                       _stream.printf ("<%s>", tag);
+                       _stream.printf ("<%s%s>", tag, css_type != null ? " class=\"" + css_type + "\"" : "");
                }
                element.accept_children (this);
                if (tag != null) {
diff --git a/src/doclets/htmlhelpers/doclet/langlet.vala b/src/doclets/htmlhelpers/doclet/langlet.vala
deleted file mode 100755 (executable)
index 1c3dd85..0000000
+++ /dev/null
@@ -1,532 +0,0 @@
-/*
- * Valadoc - 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 GLib;
-using Gee;
-
-
-public class Valadoc.Html.BasicLanglet : Valadoc.Langlet {
-       public Valadoc.Settings settings {
-               construct set;
-               protected get;
-       }
-
-       public BasicLanglet ( Settings settings ) {
-               this.settings = settings;
-       }
-
-       private Api.Node position = null;
-
-       private string get_link ( Api.Node element, Api.Node? position ) {
-               return get_html_link ( this.settings, element, position );
-       }
-
-       private inline bool is_basic_type ( string name ) {
-               string[] basic_types = new string[] { "bool", "char", "uchar", "int", "uint", "short", "ushort",
-                               "long", "ulong", "size_t", "ssize_t", "int8", "uint8", "int16", "uint16", "int32",
-                               "uint32", "int64", "uint64", "float", "double", "time_t", "unichar", "string"
-                       };
-
-               foreach ( string str in basic_types ) {
-                       if ( str == name )
-                               return true;
-               }
-
-               return false;
-       }
-
-       private void write_type_name ( Api.Node? datatype, GLib.FileStream file ) {
-               if ( datatype == null ) {
-                       file.printf ( "<font class=\"%s\">void</font>", css_keyword );
-                       return ;
-               }
-
-               string typename = datatype.full_name ();
-               if ( ((Api.Node)datatype.parent).name == null && (datatype is Class || datatype is Struct) ) {
-                       if ( this.is_basic_type ( typename ) ) {
-                               string link = this.get_link(datatype, this.position );
-                               if ( link == null )
-                                       file.printf ( "<span class=\"%s\">%s</span>", css_basic_type, typename );
-                               else
-                                       file.printf ( "<a class=\"%s\" href=\"%s\">%s</a>", css_basic_type, link, typename );
-                               return ;
-                       }
-               }
-
-               string link = this.get_link(datatype, this.position);
-               if ( link == null )
-                       file.printf ( "<span class=\"%s\">%s</span>", css_other_type, typename );
-               else
-                       file.printf ( "<a class=\"%s\" href=\"%s\">%s</a>", css_other_type, link, typename );
-       }
-
-       private void write_type_reference_template_arguments ( Valadoc.TypeReference type_reference, GLib.FileStream file ) {
-               Gee.Collection<TypeReference> arglst = type_reference.get_type_arguments ( );
-               int size = arglst.size;
-               if ( size == 0 )
-                       return ;
-
-               file.puts ( "<" );
-               int i = 0;
-
-               foreach ( TypeReference arg in arglst ) {
-                       i++;
-
-                       this.write_nested_type_referene ( arg, file );
-                       if ( i != size )
-                               file.puts ( ", " );
-               }
-
-               file.puts ( ">" );
-       }
-
-       private void write_type ( Api.Item? type, Api.Node? pos, GLib.FileStream file ) {
-               if ( type == null ) {
-                       file.printf ( "<font class=\"%s\">void</font>", css_keyword );
-               }
-               else if ( type is Api.Node ) {
-                       Api.Node dtype = (Api.Node)type;
-                       weak string css = (dtype.package.name == "glib-2.0" && ((Api.Node)dtype.parent).name == null)? css_basic_type : css_other_type;
-                       string? link = this.get_link ( dtype, pos );
-                       if ( link == null)
-                               file.printf ( "<font class=\"%s\">%s</font>", css, dtype.name );
-                       else
-                               file.printf ( "<a href=\"%s\"><font class=\"%s\">%s</font></a>", link, css, dtype.name );
-               }
-               else if ( type is Pointer ) {
-                       this.write_pointer ( (Pointer)type, file, pos );
-               }
-               else if ( type is Array ) {
-                       this.write_array ( (Array)type, file, pos );
-               }
-               else if ( type is TypeParameter ) {
-                       this.write_type_parameter ( (TypeParameter)type, file );
-               }
-               else {
-                       this.write_type_reference ( (TypeReference)type, file );
-               }
-       }
-
-       public override void write_pointer ( Pointer ptr, void* fptr, Api.Node pos ) {
-               weak GLib.FileStream file = (GLib.FileStream)fptr;
-               Api.Item type = ptr.data_type;
-               this.write_type ( type, pos, file );
-               file.putc ( '*' );
-       }
-
-       public override void write_array ( Array arr, void* fptr, Api.Node pos ) {
-               weak GLib.FileStream file = (GLib.FileStream)fptr;
-               Api.Item type =arr.data_type;
-               this.write_type ( type, pos, file );
-               file.puts ( "[]" );
-       }
-
-       //TODO: pos-parameter (-> this.write_type (?, pos, ?))
-       private void write_nested_type_referene ( Valadoc.TypeReference type_reference, GLib.FileStream file ) {
-               if ( type_reference.type_name == null )
-                       return ;
-
-               // type-modifiers:
-               GLib.StringBuilder modifiers = new GLib.StringBuilder ();
-               if ( type_reference.is_dynamic )
-                       modifiers.append ( "dynamic " );
-
-               if ( type_reference.is_weak )
-                       modifiers.append ( "weak " );
-               else if ( type_reference.is_unowned )
-                       modifiers.append ( "unowned " );
-               else if ( type_reference.is_owned )
-                       modifiers.append ( "owned " );
-
-               if ( modifiers.len > 0 )
-                       file.printf ( "<font class=\"%s\">%s</font> ", css_keyword, modifiers.str );
-
-               modifiers = null;
-
-               Api.Item? type = type_reference.data_type;
-               this.write_type ( type, this.position, file ); //TODO: this.position -> pos-parameter
-               this.write_type_reference_template_arguments ( type_reference, file );
-       }
-
-       public override void write_type_reference ( Valadoc.TypeReference type_reference, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.write_nested_type_referene ( type_reference, file );
-       }
-
-       public override void write_formal_parameter ( FormalParameter param, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               if ( param.ellipsis ) {
-                       file.puts ( " ..." );
-               }
-               else {
-                       if ( param.is_out )
-                               file.printf ( "<span class=\"%s\">out</span> ", css_keyword );
-                       else if ( param.is_ref )
-                               file.printf ( "<span class=\"%s\">ref</span> ", css_keyword );
-
-                       this.write_type_reference ( param.type_reference, file );
-                       file.printf ( " %s", param.name );
-               }
-       }
-
-       public override void write_parameter_list ( ParameterListHandler thandler, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               bool open_bracket = false;
-
-               Gee.List<FormalParameter> params = thandler.param_list;
-               int size = params.size;
-               int i = 0;
-
-               file.putc ( '(' );
-
-               foreach ( FormalParameter param in params ) {
-                       i++;
-
-                       if ( param.has_default_value == true && open_bracket == false ) {
-                               file.printf ( "<span class=\"%s\">[", css_optional_parameter );
-                               open_bracket = true;
-                       }
-
-                       this.write_formal_parameter ( param, file );
-                       if ( i != size ) {
-                               file.puts ( ", " );
-                       }
-                       else if ( open_bracket == true ) {
-                               file.puts ( "]</span>" );
-                       }
-               }
-
-               file.putc ( ')' );
-       }
-
-       private void write_exception_list ( ExceptionHandler exception_handler, GLib.FileStream file ) {
-               Gee.Collection<Api.Node> error_domains = exception_handler.get_error_domains ();
-               int size = error_domains.size;
-               int i = 1;
-
-               if ( size == 0 )
-                       return ;
-
-               file.printf ( " <span class=\"%s\">throws</span> ", css_keyword );
-
-               foreach ( Api.Node type in error_domains ) {
-                       this.write_type_name ( type, file );
-                       if ( error_domains.size > i ) {
-                               file.puts ( ", " );
-                       }
-                       i++;
-               }
-       }
-
-       public override void write_method ( void* ptr, Valadoc.Method m, Valadoc.MethodHandler parent ) {
-               this.position = m;
-
-               GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               this.write_accessor ( m, file );
-
-               if ( m.is_abstract )
-                       modifiers.append ( " abstract" );
-               else if ( m.is_virtual )
-                       modifiers.append ( " virtual" );
-               else if ( m.is_override )
-                       modifiers.append ( " override" );
-               if ( m.is_static )
-                       modifiers.append ( " static" );
-               if ( m.is_inline )
-                       modifiers.append ( " inline" );
-
-               file.printf ( " <span class=\"%s\">%s</span> ", css_keyword, modifiers.str );
-               if ( m.is_constructor == false ) {
-                       this.write_type_reference ( m.type_reference, file );
-               }
-               file.printf ( " %s ", m.name );
-               this.write_parameter_list ( m, file );
-
-               if ( m.is_yields )
-                       file.printf ( " <span class=\"%s\">yields</span> ", css_keyword );
-
-               this.write_exception_list ( m, file );
-       }
-
-       public override void write_type_parameter ( TypeParameter param, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               file.puts ( param.name );
-       }
-
-       public override void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               int i = 1;
-
-               var lst = thandler.get_template_param_list( );
-               if ( lst.size == 0 )
-                       return ;
-
-               file.puts ( "&lt;" ); // <
-
-               foreach ( TypeParameter param in lst ) {
-                       param.write ( this, file );
-                       if ( lst.size > i )
-                               file.puts ( ", " );
-
-                       i++;
-               }
-               file.puts ( "&gt;" ); // >
-       }
-
-       public override void write_field ( Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr ) {
-               this.position = field;
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               this.write_accessor ( field, file );
-
-               if ( field.is_volatile ) {
-                       file.printf ( " <span class=\"%s\">volatile</span> ", css_keyword );
-               }
-
-               if ( field.is_static ) {
-                       file.printf ( " <span class=\"%s\">static</span> ", css_keyword );
-               }
-
-               this.write_type_reference ( field.type_reference, file );
-               file.printf ( " %s ", field.name );
-       }
-
-       public override void write_constant ( Constant constant, ConstantHandler parent, void* ptr ) {
-               this.position = constant;
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               this.write_accessor ( constant, file );
-               file.printf ( " <span class=\"%s\"> const </span>", css_keyword );
-               this.write_type_reference ( constant.type_reference, file );
-               file.printf ( " %s ", constant.name );
-       }
-
-       public override void write_property_accessor ( Valadoc.PropertyAccessor propac, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               Property prop = (Property)propac.parent;
-
-               file.printf ( "<span class=\"%s\">", css_keyword );
-
-               if ( !(prop.is_public == propac.is_public && prop.is_private == propac.is_private && prop.is_protected == propac.is_protected) ) {
-                       // FIXME: PropertyAccessor isn't a SymbolAccessibility. (Valac-Bug.)
-                       if ( propac.is_public )
-                               file.puts ( "public " );
-                       else if ( propac.is_protected )
-                               file.puts ( "protected " );
-                       else if ( propac.is_private )
-                               file.puts ( "private " );
-                       else if ( propac.is_internal )
-                               file.puts ( "internal " );
-               }
-
-               if ( propac.is_owned )
-                       file.puts ( "owned " );
-
-               if ( propac.is_get )
-                       file.puts ( "get" );
-               else if ( propac.is_set )
-                       file.puts ( "set" );
-
-               file.puts ( "</span>;" );
-       }
-
-       public override void write_property ( Valadoc.Property prop, void* ptr ) {
-               this.position = prop;
-               GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               this.write_accessor ( prop, file );
-
-               if ( prop.is_virtual )
-                       modifiers.append ( " virtual " );
-               else if ( prop.is_abstract )
-                       modifiers.append ( " abstract " );
-               else if ( prop.is_override )
-                       modifiers.append ( " override " );
-
-               if ( modifiers.len > 0 )
-                       file.printf ( " <span class=\"%s\">%s</span> ", css_keyword, modifiers.str );
-
-               this.write_type_reference ( prop.type_reference, file );
-               file.printf ( " %s { ", prop.name );
-
-               if ( prop.setter != null )
-                       this.write_property_accessor ( prop.setter, file );
-
-
-               file.printf ( " " );
-
-               if ( prop.getter != null )
-                       this.write_property_accessor ( prop.getter, file );
-
-               file.printf ( " }" );
-       }
-
-       public override void write_signal ( Valadoc.Signal sig, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.position = sig;
-
-               this.write_accessor ( sig, file );
-
-               file.printf ( " <span class=\"%s\">", css_keyword );
-
-               if ( sig.is_virtual == true )
-                       file.printf ( "virtual " );
-
-               file.printf ( "signal</span> " );
-
-               this.write_type_reference ( sig.type_reference, file );
-               file.printf ( " %s ", sig.name );
-               this.write_parameter_list ( sig, file );
-       }
-
-       public override void write_enum_value ( Valadoc.EnumValue enval, void* ptr ) {
-       }
-
-       public override void write_error_code ( Valadoc.ErrorCode errcode, void* ptr ) {
-       }
-
-       public override void write_delegate ( Valadoc.Delegate del, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.position = del;
-
-               this.write_accessor ( del, file );
-
-               file.printf ( " <span class=\"%s\">delegate</span> ", css_keyword );
-               this.write_type_reference ( del.type_reference, file );
-               file.printf ( " %s ", del.name );
-               this.write_parameter_list ( del, file );
-               this.write_exception_list ( del, file );
-       }
-
-       public override void write_enum ( Valadoc.Enum en, void* ptr ) {
-       }
-
-       public override void write_error_domain ( Valadoc.ErrorDomain errdom, void* ptr ) {
-       }
-
-       private void write_accessor ( Valadoc.SymbolAccessibility element, GLib.FileStream file ) {
-               if ( element.is_public )
-                       file.printf ( "<span class=\"%s\">public</span> ", css_keyword );
-               else if ( element.is_protected )
-                       file.printf ( "<span class=\"%s\">protected</span> ", css_keyword );
-               else if ( element.is_private )
-                       file.printf ( "<span class=\"%s\">private</span> ", css_keyword );
-               else if ( element.is_internal )
-                       file.printf ( "<span class=\"%s\">internal</span> ", css_keyword );
-       }
-
-
-       public override void write_struct ( Valadoc.Struct stru, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.position = stru;
-
-               this.write_accessor ( stru, file );
-               file.printf ( "<span class=\"%s\">struct</span> %s", css_keyword, stru.name );
-               this.write_template_parameters ( stru, ptr );
-               this.write_inheritance_list ( stru, file );
-       }
-
-       public override void write_inheritance_list ( Api.Node dtype, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-
-               Gee.Collection<Interface> lst = null;
-               Api.Node? base_type = null;
-               int size = 0;
-               int i = 1;
-
-               if (dtype is Class) {
-                       lst = ((Class)dtype).get_implemented_interface_list ();
-                       base_type = ((Class)dtype).base_type;
-                       size = lst.size;
-               }
-               else if (dtype is Interface) {
-                       lst = ((Interface)dtype).get_implemented_interface_list ();
-                       base_type = ((Interface)dtype).base_type;
-                       size = lst.size;
-               }
-               else if (dtype is Struct) {
-                       base_type = ((Struct)dtype).base_type;
-               }
-
-
-               if ( size == 0 && base_type == null )
-                       return ;
-
-               file.puts ( " : " );
-
-               if ( base_type != null ) {
-                       this.write_type_name ( (Api.Node)base_type, file );
-                       if ( size > 0 ) {
-                               file.puts ( ", " );
-                       }
-               }
-
-               if (lst != null) {
-                       foreach ( Interface cntype in lst ) {
-                               this.write_type_name ( cntype, file );
-                               if ( size > i )
-                                       file.puts ( ", " );
-
-                               i++;
-                       }
-               }
-               file.putc ( ' ' );
-       }
-
-       public override void write_class ( Valadoc.Class cl, void* ptr ) {
-               GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.position = cl;
-
-               this.write_accessor ( cl, file );
-
-               if ( cl.is_abstract )
-                       modifiers.append ( "abstract " );
-
-               file.printf ( "<span class=\"%s\">%s class</span> %s", css_keyword, modifiers.str, cl.name );
-
-               this.write_template_parameters ( cl, file );
-               this.write_inheritance_list ( cl, file );
-       }
-
-       public override void write_interface ( Valadoc.Interface iface, void* ptr ) {
-               weak GLib.FileStream file = (GLib.FileStream)ptr;
-               this.position = iface;
-
-               this.write_accessor ( iface, file );
-
-               file.printf ( "<span class=\"%s\">interface</span> %s", css_keyword, iface.name );
-
-               this.write_template_parameters ( iface, ptr );
-               this.write_inheritance_list ( iface, file );
-       }
-
-       public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
-       }
-
-       public override void write_file ( Valadoc.Package file, void* ptr ) {
-       }
-}
-
-
index 80c49e0a2f012d1a3cabebf5401aee5a7b90f130..7cd9320452095242eb861b1c6921868496fd9d6f 100644 (file)
@@ -7,7 +7,6 @@ namespace Valadoc {
                [CCode (cheader_filename = "libhtmlhelpers-1.0.h")]
                public abstract class BasicDoclet : Valadoc.Doclet {
                        protected Valadoc.Html.HtmlRenderer _renderer;
-                       protected Valadoc.Langlet langlet;
                        protected Valadoc.Settings settings;
                        public BasicDoclet ();
                        protected void fetch_subnamespace_names (Valadoc.NamespaceHandler pos, Gee.ArrayList<Valadoc.Namespace> lst);
@@ -106,35 +105,6 @@ namespace Valadoc {
                        protected void write_wiki_pages (Valadoc.Tree tree, string css_path_wiki, string contentp);
                }
                [CCode (cheader_filename = "libhtmlhelpers-1.0.h")]
-               public class BasicLanglet : Valadoc.Langlet {
-                       public BasicLanglet (Valadoc.Settings settings);
-                       public override void write_array (Valadoc.Array arr, void* fptr, Valadoc.Api.Node pos);
-                       public override void write_class (Valadoc.Class cl, void* ptr);
-                       public override void write_constant (Valadoc.Constant constant, Valadoc.ConstantHandler parent, void* ptr);
-                       public override void write_delegate (Valadoc.Delegate del, void* ptr);
-                       public override void write_enum (Valadoc.Enum en, void* ptr);
-                       public override void write_enum_value (Valadoc.EnumValue enval, void* ptr);
-                       public override void write_error_code (Valadoc.ErrorCode errcode, void* ptr);
-                       public override void write_error_domain (Valadoc.ErrorDomain errdom, void* ptr);
-                       public override void write_field (Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr);
-                       public override void write_file (Valadoc.Package file, void* ptr);
-                       public override void write_formal_parameter (Valadoc.FormalParameter param, void* ptr);
-                       public override void write_inheritance_list (Valadoc.Api.Node dtype, void* ptr);
-                       public override void write_interface (Valadoc.Interface iface, void* ptr);
-                       public override void write_method (void* ptr, Valadoc.Method m, Valadoc.MethodHandler parent);
-                       public override void write_namespace (Valadoc.Namespace ns, void* ptr);
-                       public override void write_parameter_list (Valadoc.ParameterListHandler thandler, void* ptr);
-                       public override void write_pointer (Valadoc.Pointer ptr, void* fptr, Valadoc.Api.Node pos);
-                       public override void write_property (Valadoc.Property prop, void* ptr);
-                       public override void write_property_accessor (Valadoc.PropertyAccessor propac, void* ptr);
-                       public override void write_signal (Valadoc.Signal sig, void* ptr);
-                       public override void write_struct (Valadoc.Struct stru, void* ptr);
-                       public override void write_template_parameters (Valadoc.TemplateParameterListHandler thandler, void* ptr);
-                       public override void write_type_parameter (Valadoc.TypeParameter param, void* ptr);
-                       public override void write_type_reference (Valadoc.TypeReference type_reference, void* ptr);
-                       public Valadoc.Settings settings { get; set construct; }
-               }
-               [CCode (cheader_filename = "libhtmlhelpers-1.0.h")]
                public class HtmlRenderer : Valadoc.Content.ContentRenderer {
                        public HtmlRenderer (Valadoc.Html.BasicDoclet doclet);
                        public override void render (Valadoc.Content.ContentElement element);
index dd15769d7635226a6189806e2fbde94c16fa0d42..ac9ddc27bc1ed6196763beb18cb4221e68ec3c13 100644 (file)
@@ -26,7 +26,6 @@ libvaladoc_la_VALASOURCES = \
        drawer.vala \
        errorreporter.vala \
        filehelper.vala \
-       langlet.vala \
        moduleloader.vala \
        settings.vala \
        documentation/commentscanner.vala \
@@ -74,6 +73,7 @@ libvaladoc_la_VALASOURCES = \
        apitree/returntypehandler.vala \
        apitree/signal.vala \
        apitree/signalhandler.vala \
+       apitree/signaturebuilder.vala \
        apitree/struct.vala \
        apitree/structhandler.vala \
        apitree/symbolaccessibility.vala \
index d38dac853d6c910e21641cfdd02773aa007fc589..1d948114de5b736451244dac60a7e530559a5cf7 100644 (file)
@@ -23,6 +23,8 @@ using Gee;
 
 
 public abstract class Valadoc.Api.Item : Object {
+       private Inline _signature;
+
        public Api.Item parent {
                protected set;
                get;
@@ -33,5 +35,16 @@ public abstract class Valadoc.Api.Item : Object {
 
        protected virtual void process_comments (Settings settings, DocumentationParser parser) {
        }
+
+       public Inline signature {
+               get {
+                       if (_signature == null) {
+                               _signature = build_signature ();
+                       }
+                       return _signature;
+               }
+       }
+
+       protected abstract Inline build_signature ();
 }
 
index 20bce12119f0331ae1cd8c77c0dda14b255fc9cb..959560ebf1207a692a59427352b6a981bcf8edbf 100644 (file)
@@ -92,5 +92,17 @@ public abstract class Valadoc.Api.SymbolNode : Api.Node, SymbolAccessibility {
                        return symbol.access == Vala.SymbolAccessibility.PRIVATE;
                }
        }
+
+       protected string get_accessibility_modifier () {
+               if (is_public) {
+                       return "public";
+               } else if (is_protected) {
+                       return "protected";
+               } else if (is_internal) {
+                       return "internal";
+               } else {
+                       return "private";
+               }
+       }
 }
 
index ff805375fe75414fa9c2a8bbe390dd6a79cb3e9f..e0799dcae978a72cc9e9ba46f20175b6aa98911d 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Array : Api.Item {
        private Vala.ArrayType vtype;
@@ -40,10 +40,6 @@ public class Valadoc.Array : Api.Item {
                }
        }
 
-       public void write (Langlet langlet, void* ptr, Api.Node parent) {
-               langlet.write_array (this, ptr, parent);
-       }
-
        protected override void resolve_type_references (Tree root) {
                if (this.data_type == null) {
                        /*TODO:possible?*/;
@@ -55,5 +51,11 @@ public class Valadoc.Array : Api.Item {
                        ((TypeReference)this.data_type).resolve_type_references (root);
                }
        }
-}
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_content (data_type.signature)
+                       .append ("[]", false)
+                       .get ();
+       }
+}
index 6e8f1623acecf6351816f37c99a1ed21d203366c..3ce4a627928bc92c41ec29a54935cb5f238fa8eb 100644 (file)
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, SignalHandler, MethodHandler, EnumHandler, PropertyHandler, ConstructionMethodHandler, FieldHandler, DelegateHandler, ConstantHandler, TemplateParameterListHandler {
-       private ArrayList<Interface> interfaces;
+       private ArrayList<TypeReference> interfaces;
        private Vala.Class vclass;
 
        public Class (Vala.Class symbol, Api.Node parent) {
                base (symbol, parent);
-               this.interfaces = new ArrayList<Interface> ();
+               this.interfaces = new ArrayList<TypeReference> ();
 
                this.vclass = symbol;
 
@@ -37,7 +37,7 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                }
        }
 
-       protected Class? base_type {
+       protected TypeReference? base_type {
                private set;
                get;
        }
@@ -46,7 +46,7 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                return this.vclass.get_cname();
        }
 
-       public Collection<Interface> get_implemented_interface_list () {
+       public Collection<TypeReference> get_implemented_interface_list () {
                return this.interfaces;
        }
 
@@ -54,10 +54,6 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                return this.vclass == vcl;
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_class (this, ptr);
-       }
-
        public bool is_abstract {
                get {
                        return this.vclass.is_abstract;
@@ -80,12 +76,13 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
                }
 
                foreach (Vala.DataType vtyperef in lst) {
-                       Api.Item? element = root.search_vala_symbol (vtyperef.data_type);
-                       if (element is Class) {
-                               this.base_type = (Class)element;
-                       }
-                       else {
-                               this.interfaces.add ((Interface)element);
+                       var inherited = new TypeReference (vtyperef, this);
+                       inherited.resolve_type_references (root);
+
+                       if (inherited.data_type is Class) {
+                               this.base_type = inherited;
+                       } else {
+                               this.interfaces.add (inherited);
                        }
                }
        }
@@ -96,5 +93,53 @@ public class Valadoc.Class : Api.TypeSymbolNode, ClassHandler, StructHandler, Si
 
                base.resolve_type_references (root);
        }
-}
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_abstract) {
+                       signature.append_keyword ("abstract");
+               }
+               signature.append_keyword ("class");
+               signature.append_symbol (this);
+
+               var type_parameters = get_children_by_type (Api.NodeType.TYPE_PARAMETER, false);
+               if (type_parameters.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_parameters) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
+
+               bool first = true;
+               if (base_type != null) {
+                       signature.append (":");
+
+                       signature.append_content (base_type.signature);
+                       first = false;
+               }
+
+               if (interfaces.size > 0) {
+                       if (first) {
+                               signature.append (":");
+                       }
+
+                       foreach (Api.Item implemented_interface in interfaces) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (implemented_interface.signature);
+                               first = false;
+                       }
+               }
+
+               return signature.get ();
+       }
+}
index af76138f153fd79b0ef03e51b080dc18d46baf62..4332e369c6ac714c554d081e1d5e07a9d4e8b78a 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
        private Vala.Constant vconst;
@@ -48,6 +48,15 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
                this.set_return_type_references (root);
        }
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_keyword (get_accessibility_modifier ())
+                       .append_keyword ("const")
+                       .append_content (type_reference.signature)
+                       .append_symbol (this)
+                       .get ();
+       }
+
        public void visit (Doclet doclet, ConstantHandler? parent) {
                doclet.visit_constant (this, parent);
        }
@@ -57,9 +66,4 @@ public class Valadoc.Constant : Api.MemberNode, ReturnTypeHandler {
        public override void accept (Doclet doclet) {
                visit (doclet, (ConstantHandler)parent);
        }
-
-       public void write (Langlet langlet, void* ptr, ConstantHandler parent) {
-               langlet.write_constant (this, parent, ptr);
-       }
 }
-
index 316947b1c9b1a4f6b1f226709d013f9acdca6554..5b5c52941c5aad28cc6c81b55e70739f2375d7c8 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, ReturnTypeHandler, TemplateParameterListHandler, ExceptionHandler {
        private Vala.Delegate vdelegate;
@@ -62,10 +62,61 @@ public class Valadoc.Delegate : Api.TypeSymbolNode, ParameterListHandler, Return
 
                var vexceptionlst = this.vdelegate.get_error_types ();
                this.add_exception_list (root, vexceptionlst);
+
+               base.resolve_type_references (root);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_delegate (this, ptr);
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_static) {
+                       signature.append_keyword ("static");
+               }
+
+               signature.append_content (type_reference.signature);
+               signature.append_symbol (this);
+
+               var type_parameters = get_children_by_type (Api.NodeType.TYPE_PARAMETER);
+               if (type_parameters.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_parameters) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
+
+               signature.append ("(");
+
+               bool first = true;
+               foreach (Api.Node param in get_children_by_type (Api.NodeType.FORMAL_PARAMETER)) {
+                       if (!first) {
+                               signature.append (",", false);
+                       }
+                       signature.append_content (param.signature, !first);
+                       first = false;
+               }
+
+               signature.append (")", false);
+
+               var exceptions = get_children_by_type (Api.NodeType.ERROR_DOMAIN);
+               if (exceptions.size > 0) {
+                       signature.append_keyword ("throws");
+
+                       foreach (Api.Node param in exceptions) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, !first);
+                               first = false;
+                       }
+               }
+
+               return signature.get ();
        }
 }
-
index 10be6e15dd611875a0131e5857f434284419f69e..86fd629b3c02a499ba8a0cd22ff4cad478f3f319 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Enum : Api.TypeSymbolNode, MethodHandler {
        public Enum (Vala.Enum symbol, Api.Node parent) {
@@ -51,8 +51,11 @@ public class Valadoc.Enum : Api.TypeSymbolNode, MethodHandler {
 
        private Vala.Enum venum;
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_enum (this, ptr);
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_keyword (get_accessibility_modifier ())
+                       .append_keyword ("enum")
+                       .append_symbol (this)
+                       .get ();
        }
 }
-
index c74a8fb7e4f8086ac10fa87415e0f8864b31cff3..5d40eee397eb45bb3794ae7139681b1bcfbb21bc 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.EnumValue: Api.SymbolNode {
        private Vala.EnumValue venval;
@@ -45,10 +45,6 @@ public class Valadoc.EnumValue: Api.SymbolNode {
                return this.venval == venval;
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_enum_value (this, ptr);
-       }
-
        public void visit (Doclet doclet) {
                doclet.visit_enum_value (this);
        }
@@ -58,5 +54,12 @@ public class Valadoc.EnumValue: Api.SymbolNode {
        public override void accept (Doclet doclet) {
                visit (doclet);
        }
-}
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_symbol (this)
+                       .append ("=")
+                       .append (this.venval.value.to_string ())
+                       .get ();
+       }
+}
index 9cbed097ce8a798f09a92ae5db592ba8feba156a..63a701af82fe02d3f3a86b7436ee8569dde3d406 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.ErrorCode : Api.TypeSymbolNode {
        private Vala.ErrorCode verrcode;
@@ -36,10 +36,6 @@ public class Valadoc.ErrorCode : Api.TypeSymbolNode {
                return this.verrcode == verrcode;
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_error_code (this, ptr);
-       }
-
        public void visit (Doclet doclet) {
                doclet.visit_error_code (this);
        }
@@ -49,5 +45,10 @@ public class Valadoc.ErrorCode : Api.TypeSymbolNode {
        public override void accept (Doclet doclet) {
                visit (doclet);
        }
-}
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_symbol (this)
+                       .get ();
+       }
+}
index 1658128402671e3f9e0418a460ed9345d6095437..8af78913a01596b849aacecd9b7732657cea32e5 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 using Gee;
+using Valadoc.Content;
 
 
 public class Valadoc.ErrorDomain : Api.TypeSymbolNode, MethodHandler {
@@ -50,7 +51,11 @@ public class Valadoc.ErrorDomain : Api.TypeSymbolNode, MethodHandler {
                visit (doclet);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_error_domain (this, ptr);
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_keyword (get_accessibility_modifier ())
+                       .append_keyword ("errordomain")
+                       .append_symbol (this)
+                       .get ();
        }
 }
index 8e907614abfef7894e29f3b496d8f022e4c6cb9e..a1443b875117cc82cba48c0786145736e7cc88f9 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
        private Vala.Field vfield;
@@ -62,6 +62,22 @@ public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
                base.resolve_type_references (root);
        }
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_static) {
+                       signature.append_keyword ("static");
+               }
+               if (is_volatile) {
+                       signature.append_keyword ("volatile");
+               }
+
+               signature.append_content (type_reference.signature);
+               signature.append_symbol (this);
+               return signature.get ();
+       }
+
        public void visit (Doclet doclet, FieldHandler? parent) {
                doclet.visit_field (this, parent);
        }
@@ -71,9 +87,4 @@ public class Valadoc.Field : Api.MemberNode, ReturnTypeHandler {
        public override void accept (Doclet doclet) {
                visit (doclet, (FieldHandler) parent);
        }
-
-       public void write (Langlet langlet, void* ptr, FieldHandler parent) {
-               langlet.write_field (this, parent, ptr);
-       }
 }
-
index b7cb4b118cb9d3fccc2d91b97d44677f9cd2f487..130dab44d7ebd9862007b91f1e3c8dee825fb610 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.FormalParameter : Api.SymbolNode, ReturnTypeHandler {
        private Vala.FormalParameter vformalparam;
@@ -75,8 +75,27 @@ public class Valadoc.FormalParameter : Api.SymbolNode, ReturnTypeHandler {
                base.resolve_type_references (root);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_formal_parameter (this, ptr);
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               if (ellipsis) {
+                       signature.append ("...");
+               } else {
+                       if (is_out) {
+                               signature.append_keyword ("out");
+                       } else if (is_ref) {
+                               signature.append_keyword ("ref");
+                       }
+
+                       signature.append_content (type_reference.signature);
+                       signature.append (name);
+
+                       if (has_default_value) {
+                               signature.append ("=");
+                               signature.append (this.vformalparam.default_expression.to_string ());
+                       }
+               }
+
+               return signature.get ();
        }
 }
-
index 0cdcef03c42e2420480d01553014a2480de48b0b..bfe5fc805a96734cddae54b96d8db121fc7473e1 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler, MethodHandler, DelegateHandler, EnumHandler, StructHandler, ClassHandler {
        public Interface (Vala.Interface symbol, Api.Node parent) {
@@ -26,9 +26,9 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
                this.vinterface = symbol;
        }
 
-       private ArrayList<Interface> interfaces = new ArrayList<Interface> ();
+       private ArrayList<TypeReference> interfaces = new ArrayList<TypeReference> ();
 
-       public Collection<Interface> get_implemented_interface_list () {
+       public Collection<TypeReference> get_implemented_interface_list () {
                return this.interfaces;
        }
 
@@ -36,7 +36,7 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
                return this.vinterface.get_cname ();
        }
 
-       protected Class? base_type {
+       protected TypeReference? base_type {
                private set;
                get;
        }
@@ -53,21 +53,19 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
                visit (doclet);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_interface (this, ptr);
-       }
-
        private void set_prerequisites (Tree root, Vala.Collection<Vala.DataType> lst) {
                if (this.interfaces.size != 0) {
                        return;
                }
 
                foreach (Vala.DataType vtyperef in lst) {
-                       Api.Item? element = root.search_vala_symbol (vtyperef.data_type);
-                       if (element is Class) {
-                               this.base_type = (Class)element;
+                       var inherited = new TypeReference (vtyperef, this);
+                       inherited.resolve_type_references (root);
+
+                       if (inherited.data_type is Class) {
+                               this.base_type = inherited;
                        } else {
-                               this.interfaces.add ((Interface)element);
+                               this.interfaces.add (inherited);
                        }
                }
        }
@@ -78,6 +76,50 @@ public class Valadoc.Interface : Api.TypeSymbolNode, SignalHandler, PropertyHand
 
                base.resolve_type_references (root);
        }
-}
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               signature.append_keyword ("interface");
+               signature.append_symbol (this);
+
+               var type_parameters = get_children_by_type (Api.NodeType.TYPE_PARAMETER, false);
+               if (type_parameters.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_parameters) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
 
+               bool first = true;
+               if (base_type != null) {
+                       signature.append (":");
+
+                       signature.append_content (base_type.signature);
+                       first = false;
+               }
+
+               if (interfaces.size > 0) {
+                       if (first) {
+                               signature.append (":");
+                       }
+
+                       foreach (Api.Item implemented_interface in interfaces) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (implemented_interface.signature);
+                               first = false;
+                       }
+               }
+
+               return signature.get ();
+       }
+}
index 58c902d82e5ab76027561f241c727a5084ee7fd5..d902315adbde38c7d70b1306f38b6840c8e1d624 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, ReturnTypeHandler {
        private Vala.Method vmethod;
@@ -127,6 +127,72 @@ public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHan
                base.resolve_type_references (root);
        }
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_static) {
+                       signature.append_keyword ("static");
+               } else if (is_abstract) {
+                       signature.append_keyword ("abstract");
+               } else if (is_override) {
+                       signature.append_keyword ("override");
+               } else if (is_virtual) {
+                       signature.append_keyword ("virtual");
+               }
+               if (is_inline) {
+                       signature.append_keyword ("inline");
+               }
+               if (is_yields) {
+                       signature.append_keyword ("async");
+               }
+
+               signature.append_content (type_reference.signature);
+               signature.append_symbol (this);
+
+               var type_parameters = get_children_by_type (Api.NodeType.TYPE_PARAMETER, false);
+               if (type_parameters.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_parameters) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
+
+               signature.append ("(");
+
+               bool first = true;
+               foreach (Api.Node param in get_children_by_type (Api.NodeType.FORMAL_PARAMETER)) {
+                       if (!first) {
+                               signature.append (",", false);
+                       }
+                       signature.append_content (param.signature, !first);
+                       first = false;
+               }
+
+               signature.append (")", false);
+
+               var exceptions = get_children_by_type (Api.NodeType.ERROR_DOMAIN);
+               if (exceptions.size > 0) {
+                       signature.append_keyword ("throws");
+
+                       foreach (Api.Node param in exceptions) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, !first);
+                               first = false;
+                       }
+               }
+
+               return signature.get ();
+       }
+
        public void visit (Doclet doclet, Valadoc.MethodHandler in_type) {
                doclet.visit_method (this, in_type);
        }
@@ -140,9 +206,4 @@ public class Valadoc.Method : Api.MemberNode, ParameterListHandler, ExceptionHan
        public override void accept (Doclet doclet) {
                visit (doclet, (MethodHandler) parent);
        }
-
-       public void write (Langlet langlet, void* ptr, Valadoc.MethodHandler parent) {
-               langlet.write_method (ptr, this, parent);
-       }
 }
-
index a686134b2a5cd6dde6896001fd8e532df6260e70..256c51ee5958be86f8e6860ed758136bffb02f88 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, NamespaceHandler, ErrorDomainHandler,
                                  EnumHandler, ClassHandler, StructHandler, InterfaceHandler,
@@ -49,6 +49,14 @@ public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, Na
                base.process_comments (settings, parser);
        }
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_keyword (get_accessibility_modifier ())
+                       .append_keyword ("namespace")
+                       .append_symbol (this)
+                       .get ();
+       }
+
        public void visit (Doclet doclet) {
                doclet.visit_namespace (this);
        }
@@ -67,11 +75,4 @@ public class Valadoc.Namespace : Api.SymbolNode, MethodHandler, FieldHandler, Na
        internal bool is_vnspace (Vala.Namespace vns) {
                return this.vnspace == vns;
        }
-
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_namespace (this, ptr);
-       }
 }
-
-
-
index ce814dedd007f508303f8e7c1ec9b741b9457c93..91542c906fe8fd7ee6258beb75f4d07a40a3e44c 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Package : Api.Node, NamespaceHandler {
        private ArrayList<Vala.SourceFile> vfiles = new ArrayList<Vala.SourceFile> ();
@@ -109,8 +109,10 @@ public class Valadoc.Package : Api.Node, NamespaceHandler {
                visit (doclet);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_file (this, ptr);
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_keyword ("package")
+                       .append (name)
+                       .get ();
        }
 }
-
index e9672989c9ea49400e246a3b334bd777849e75c3..b1f0132b17071b47f0a7df7f01afee04ca4ce163 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Pointer : Api.Item {
        private Vala.PointerType vtype;
@@ -42,10 +42,6 @@ public class Valadoc.Pointer : Api.Item {
                }
        }
 
-       public void write (Langlet langlet, void* ptr, Api.Node parent) {
-               langlet.write_pointer (this, ptr, parent);
-       }
-
        protected override void resolve_type_references (Tree root) {
                Api.Item type = this.data_type;
                if (type == null) {
@@ -58,5 +54,11 @@ public class Valadoc.Pointer : Api.Item {
                        ((TypeReference) type).resolve_type_references (root);
                }
        }
-}
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append_content (data_type.signature)
+                       .append ("*", false)
+                       .get ();
+       }
+}
index a6526b5cc6e35bec3397a142b07c440a16cf8b29..13870ccefa35038e3ef3c3d10c6172bfa97a8b05 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        private Vala.Property vproperty;
@@ -90,7 +90,6 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
                get;
        }
 
-
        protected override void resolve_type_references (Tree root) {
                Vala.Property? vp = null;
                if (vproperty.base_property != null) {
@@ -107,6 +106,35 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
                this.set_return_type_references (root);
        }
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_abstract) {
+                       signature.append_keyword ("abstract");
+               } else if (is_override) {
+                       signature.append_keyword ("override");
+               } else if (is_virtual) {
+                       signature.append_keyword ("virtual");
+               }
+
+               signature.append_content (type_reference.signature);
+               signature.append_symbol (this);
+               signature.append ("{");
+
+               if (setter != null) {
+                       signature.append_content (setter.signature);
+               }
+
+               if (getter != null) {
+                       signature.append_content (getter.signature);
+               }
+
+               signature.append ("}");
+
+               return signature.get ();
+       }
+
        public void visit (Doclet doclet) {
                doclet.visit_property (this);
        }
@@ -116,9 +144,4 @@ public class Valadoc.Property : Api.MemberNode, ReturnTypeHandler {
        public override void accept (Doclet doclet) {
                visit (doclet);
        }
-
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_property (this, ptr);
-       }
 }
-
index e4f2f722ee885c8e08583114ae9219da7f1fb043..9aa1b51292f960ce7ed295042e6335ad18cc5501 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.PropertyAccessor : Api.SymbolNode {
        private Vala.PropertyAccessor vpropacc;
@@ -57,8 +57,26 @@ public class Valadoc.PropertyAccessor : Api.SymbolNode {
                }
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_property_accessor (this, ptr);
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               if (!is_public) {
+                       signature.append_keyword (get_accessibility_modifier ());
+               }
+               if (is_set || is_construct) {
+                       if (is_construct) {
+                               signature.append_keyword ("construct");
+                       }
+                       if (is_set) {
+                               signature.append_keyword ("set");
+                       }
+               } else if (is_get) {
+                       if (is_owned) {
+                               signature.append_keyword ("owned");
+                       }
+                       signature.append_keyword ("get");
+               }
+
+               return signature.get ();
        }
 }
-
index 17d72627d43f207f726193de6a11379e042957cc..0559ab4295492e59c55e5c7e363a23b55b2d7a8a 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHandler {
        private Vala.Signal vsignal;
@@ -53,6 +53,32 @@ public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHa
                }
        }
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               if (is_virtual) {
+                       signature.append_keyword ("virtual");
+               }
+
+               signature.append_content (type_reference.signature);
+               signature.append_symbol (this);
+               signature.append ("(");
+
+               bool first = true;
+               foreach (Api.Node param in get_children_by_type (Api.NodeType.FORMAL_PARAMETER)) {
+                       if (!first) {
+                               signature.append (",", false);
+                       }
+                       signature.append_content (param.signature, !first);
+                       first = false;
+               }
+
+               signature.append (")", false);
+
+               return signature.get ();
+       }
+
        public void visit (Doclet doclet) {
                doclet.visit_signal (this);
        }
@@ -62,9 +88,4 @@ public class Valadoc.Signal : Api.MemberNode, ParameterListHandler, ReturnTypeHa
        public override void accept (Doclet doclet) {
                visit (doclet);
        }
-
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_signal (this, ptr);
-       }
 }
-
diff --git a/src/libvaladoc/apitree/signaturebuilder.vala b/src/libvaladoc/apitree/signaturebuilder.vala
new file mode 100644 (file)
index 0000000..1b5e13e
--- /dev/null
@@ -0,0 +1,89 @@
+/* signaturebuilder.vala
+ *
+ * Valadoc - 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.
+ *
+ * Author:
+ *     Didier 'Ptitjes Villevalois <ptitjes@free.fr>
+ */
+
+using Valadoc.Content;
+
+public class Valadoc.Api.SignatureBuilder {
+       private Run run;
+       private Inline last_appended;
+
+       public SignatureBuilder () {
+               run = new Run (Run.Style.NONE);
+       }
+
+       private void append_text (string text) {
+               if (last_appended is Text) {
+                       ((Text) last_appended).content += text;
+               } else {
+                       run.content.add (last_appended = new Text (text));
+               }
+       }
+
+       public SignatureBuilder append (string text, bool spaced = true) {
+               string content = (last_appended != null && spaced ? " " : "") + text;
+               append_text (content);
+               return this;
+       }
+
+       public SignatureBuilder append_content (Inline content, bool spaced = true) {
+               if (last_appended != null && spaced) {
+                       append_text (" ");
+               }
+               run.content.add (last_appended = content);
+               return this;
+       }
+
+       public SignatureBuilder append_keyword (string keyword, bool spaced = true) {
+               Run inner = new Run (Run.Style.LANG_KEYWORD);
+               inner.content.add (new Text (keyword));
+               return append_content (inner, spaced);
+       }
+
+       public SignatureBuilder append_symbol (Node node, bool spaced = true) {
+               Run inner = new Run (Run.Style.NONE);
+               inner.content.add (new SymbolLink (node, node.name));
+               return append_content (inner, spaced);
+       }
+
+       public SignatureBuilder append_type (Node node, bool spaced = true) {
+               Run inner = new Run (Run.Style.LANG_TYPE);
+               inner.content.add (new SymbolLink (node, node.name));
+               return append_content (inner, spaced);
+       }
+
+       public SignatureBuilder append_type_name (string name, bool spaced = true) {
+               Run inner = new Run (Run.Style.LANG_TYPE);
+               inner.content.add (new Text (name));
+               return append_content (inner, spaced);
+       }
+
+       public SignatureBuilder append_literal (string literal, bool spaced = true) {
+               Run inner = new Run (Run.Style.LANG_LITERAL);
+               inner.content.add (new Text (literal));
+               return append_content (inner, spaced);
+       }
+
+       public new Run get () {
+               return run;
+       }
+}
index a70f9fe25db7d0744f5e66c280cb0ec3e6d8d23a..828547c8986e51ea6b023bbd7d537bf1d798b4ac 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMethodHandler, FieldHandler, ConstantHandler, TemplateParameterListHandler {
        private Vala.Struct vstruct;
@@ -28,7 +28,7 @@ public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMet
                this.vstruct = symbol;
        }
 
-       protected Struct? base_type {
+       protected TypeReference? base_type {
                protected set;
                get;
        }
@@ -47,16 +47,13 @@ public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMet
                visit (doclet);
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_struct (this, ptr);
-       }
-
        private void set_parent_references (Tree root) {
                Vala.ValueType? basetype = this.vstruct.base_type as Vala.ValueType;
                if (basetype == null) {
                        return ;
                }
-               this.base_type = (Struct?) root.search_vala_symbol ((Vala.Struct) basetype.type_symbol);
+               this.base_type = new TypeReference (basetype, this);
+               this.base_type.resolve_type_references (root);
        }
 
        protected override void resolve_type_references (Tree root) {
@@ -64,5 +61,34 @@ public class Valadoc.Struct : Api.TypeSymbolNode, MethodHandler, ConstructionMet
 
                base.resolve_type_references (root);
        }
-}
 
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               signature.append_keyword (get_accessibility_modifier ());
+               signature.append_keyword ("struct");
+               signature.append_symbol (this);
+
+               var type_parameters = get_children_by_type (Api.NodeType.TYPE_PARAMETER, false);
+               if (type_parameters.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_parameters) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
+
+               if (base_type != null) {
+                       signature.append (":");
+
+                       signature.append_content (base_type.signature);
+               }
+
+               return signature.get ();
+       }
+}
index b8414e7cbef7a03cf72cafeadfc7be8de68084bf..b6036f7ce9ed490ab7e2b12e812daea0d6836df8 100644 (file)
@@ -22,7 +22,7 @@ using Gee;
 
 public interface Valadoc.TemplateParameterListHandler : Api.Node {
        public Collection<TypeParameter> get_template_param_list () {
-               return get_children_by_type (Api.NodeType.TYPE_PARAMETER);
+               return get_children_by_type (Api.NodeType.TYPE_PARAMETER, false);
        }
 }
 
index 43351d9c7d7773224e0ec3cb132ff7cca7da251b..f204331b0dfe0aea519fa7d84cff66d22a558197 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.TypeParameter : Api.SymbolNode, ReturnTypeHandler {
 
@@ -31,13 +31,14 @@ public class Valadoc.TypeParameter : Api.SymbolNode, ReturnTypeHandler {
                get;
        }
 
+       protected override Inline build_signature () {
+               return new Api.SignatureBuilder ()
+                       .append (name)
+                       .get ();
+       }
+
        public override Api.NodeType node_type { get { return Api.NodeType.TYPE_PARAMETER; } }
 
        public override void accept (Doclet doclet) {
        }
-
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_type_parameter (this, ptr);
-       }
 }
-
index 332d0303f741555c2d9d3ca20b27bbd0c6aa95c0..10f3d68df65c7b531b6b4d4a7588950ba77b7409 100644 (file)
@@ -17,9 +17,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-
 using Gee;
-
+using Valadoc.Content;
 
 public class Valadoc.TypeReference : Api.Item {
        private ArrayList<TypeReference> type_arguments = new ArrayList<TypeReference> ();
@@ -180,44 +179,74 @@ public class Valadoc.TypeReference : Api.Item {
        }
 
        protected override void resolve_type_references (Tree root) {
-               if (this.vtyperef != null) {
-                       if ( this.vtyperef is Vala.PointerType) {
-                               this.data_type = new Pointer ((Vala.PointerType) this.vtyperef, this);
-                       } else if (vtyperef is Vala.ArrayType) {
-                               this.data_type = new Array ((Vala.ArrayType) this.vtyperef, this);
-                       } else if (vtyperef is Vala.GenericType) {
-                                this.data_type = (TypeParameter) root.search_vala_symbol (((Vala.GenericType) this.vtyperef).type_parameter);
+               if ( this.vtyperef is Vala.PointerType) {
+                       this.data_type = new Pointer ((Vala.PointerType) this.vtyperef, this);
+               } else if (vtyperef is Vala.ArrayType) {
+                       this.data_type = new Array ((Vala.ArrayType) this.vtyperef, this);
+               } else if (vtyperef is Vala.GenericType) {
+                        this.data_type = root.search_vala_symbol (((Vala.GenericType) this.vtyperef).type_parameter);
+               } else if (vtyperef is Vala.ErrorType) {
+                       Vala.ErrorDomain verrdom = ((Vala.ErrorType) vtyperef).error_domain;
+                       if (verrdom != null) {
+                               this.data_type = root.search_vala_symbol (verrdom);
+                       } else {
+                               this.data_type = glib_error;
                        }
+               } else if (vtyperef is Vala.DelegateType) {
+                       this.data_type = root.search_vala_symbol (((Vala.DelegateType) vtyperef).delegate_symbol);
+               } else {
+                       this.data_type = root.search_vala_symbol (vtyperef.data_type);
                }
 
+               this.set_template_argument_list (root, vtyperef.get_type_arguments ());
 
-               if (this.data_type == null) {
-                       Vala.DataType vtype = this.vtyperef;
-                       this.set_template_argument_list (root, vtype.get_type_arguments ());
-                       // still necessary?
-                       if ( vtype is Vala.ErrorType ) {
-                               Vala.ErrorDomain verrdom = ((Vala.ErrorType)vtype).error_domain;
-                               if (verrdom != null) {
-                                       this.data_type = root.search_vala_symbol (verrdom);
-                               } else {
-                                       this.data_type = glib_error;
-                               }
-                       }
-                       // necessary?
-                       else if (vtype is Vala.DelegateType) {
-                               this.data_type = root.search_vala_symbol (((Vala.DelegateType)vtype).delegate_symbol);
-                       } else {
-                               this.data_type = root.search_vala_symbol (vtype.data_type);
-                       }
-               } else if (this.data_type is Pointer) {
+               if (this.data_type is Pointer) {
                        ((Pointer)this.data_type).resolve_type_references (root);
                } else if (this.data_type is Array) {
                        ((Array)this.data_type).resolve_type_references (root);
                }
        }
 
-       public void write (Langlet langlet, void* ptr) {
-               langlet.write_type_reference (this, ptr);
+       protected override Inline build_signature () {
+               var signature = new Api.SignatureBuilder ();
+
+               if (is_dynamic) {
+                       signature.append_keyword ("dynamic");
+               }
+
+               if (is_weak) {
+                       signature.append_keyword ("weak");
+               } else if (is_owned) {
+                       signature.append_keyword ("owned");
+               } else if (is_unowned) {
+                       signature.append_keyword ("unowned");
+               }
+
+               if (data_type == null) {
+                       signature.append_keyword ("void");
+               } else if (data_type is Api.SymbolNode) {
+                       signature.append_type ((Api.SymbolNode) data_type);
+               } else {
+                       signature.append_content (data_type.signature);
+               }
+
+               if (type_arguments.size > 0) {
+                       signature.append ("<", false);
+                       bool first = true;
+                       foreach (Api.Item param in type_arguments) {
+                               if (!first) {
+                                       signature.append (",", false);
+                               }
+                               signature.append_content (param.signature, false);
+                               first = false;
+                       }
+                       signature.append (">", false);
+               }
+
+               if (is_nullable) {
+                       signature.append ("?", false);
+               }
+
+               return signature.get ();
        }
 }
-
index 85bf3c7d10e91c31d3d4c1477b6c1f2671f7a102..9ae0b3d45786f7adb5c1591723f89b580bb32b00 100755 (executable)
@@ -54,7 +54,7 @@ namespace Valadoc.Diagrams {
        }
 
        private static void draw_struct_parents (Struct stru, Graphviz.Graph g, Graphviz.Node me) {
-               Struct? parent = (Struct?)stru.base_type;
+               Struct? parent = stru.base_type != null ? (Struct) stru.base_type.data_type : null;
                if (parent != null) {
                        weak Graphviz.Node stru2 = draw_struct (g, parent, me);
                        draw_struct_parents (parent, g, stru2);
@@ -84,15 +84,15 @@ namespace Valadoc.Diagrams {
        }
 
        private static void draw_interface_parents (Interface iface, Graphviz.Graph g, Graphviz.Node me) {
-               Collection<Interface> parentlst = iface.get_implemented_interface_list ();
-               Class? cl = (Class?)iface.base_type;
+               Collection<TypeReference> parentlst = iface.get_implemented_interface_list ();
+               Class? cl = iface.base_type != null ? (Class) iface.base_type.data_type : null;
                if (cl != null) {
                        weak Graphviz.Node cln = draw_class (g, cl, me);
                        draw_class_parents (cl, g, cln);
                }
 
-               foreach (Interface type in parentlst) {
-                       draw_interface (g, (Interface)type, me);
+               foreach (TypeReference type in parentlst) {
+                       draw_interface (g, (Interface) type.data_type, me);
                }
        }
 
@@ -176,16 +176,16 @@ namespace Valadoc.Diagrams {
        }
 
        private static void draw_class_parents (Class cl, Graphviz.Graph g, Graphviz.Node me) {
-               Collection<Interface> parents = cl.get_implemented_interface_list ();
-               Class? pcl = (Class?)cl.base_type;
+               Collection<TypeReference> parents = cl.get_implemented_interface_list ();
+               Class? pcl = cl.base_type != null ? (Class) cl.base_type.data_type : null;
 
                if (pcl != null) {
                        weak Graphviz.Node node = draw_class (g, pcl, me);
                        draw_class_parents (pcl, g, node);
                }
 
-               foreach (Interface type in parents) {
-                       draw_interface (g, (Valadoc.Interface)type, me);
+               foreach (TypeReference type in parents) {
+                       draw_interface (g, (Interface) type.data_type, me);
                }
        }
 }
diff --git a/src/libvaladoc/langlet.vala b/src/libvaladoc/langlet.vala
deleted file mode 100755 (executable)
index 73b49ff..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Valadoc - 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;
-
-
-// deprecated
-public abstract class Valadoc.Langlet : Object {
-       public abstract void write_pointer (Pointer param, void* ptr, Api.Node pos);
-       public abstract void write_array (Array param, void* ptr, Api.Node pos);
-       public abstract void write_type_parameter (TypeParameter param, void* ptr);
-       public abstract void write_template_parameters (TemplateParameterListHandler thandler, void* ptr);
-       public abstract void write_inheritance_list (Api.Node dtype, void* ptr);
-       public abstract void write_parameter_list (ParameterListHandler thandler, void* ptr);
-       public abstract void write_field (Valadoc.Field field, Valadoc.FieldHandler pos, void* ptr);
-       public abstract void write_constant (Valadoc.Constant constant, Valadoc.ConstantHandler parent, void* ptr);
-       public abstract void write_type_reference (Valadoc.TypeReference tref, void* ptr);
-       public abstract void write_formal_parameter (Valadoc.FormalParameter param, void* ptr);
-       public abstract void write_property_accessor (Valadoc.PropertyAccessor propac, void* ptr);
-       public abstract void write_property (Valadoc.Property prop, void* ptr);
-       public abstract void write_signal (Valadoc.Signal sig, void* ptr);
-       public abstract void write_method (void* ptr, Valadoc.Method m, Valadoc.MethodHandler pos);
-       public abstract void write_error_domain (Valadoc.ErrorDomain errdom, void* ptr);
-       public abstract void write_error_code (Valadoc.ErrorCode errcode, void* ptr);
-       public abstract void write_enum_value (Valadoc.EnumValue enval, void* ptr);
-       public abstract void write_delegate (Valadoc.Delegate del, void* ptr);
-       public abstract void write_class (Valadoc.Class cl, void* ptr);
-       public abstract void write_enum (Valadoc.Enum en, void* ptr);
-       public abstract void write_struct (Valadoc.Struct stru, void* ptr);
-       public abstract void write_interface (Valadoc.Interface iface, void* ptr);
-       public abstract void write_namespace (Valadoc.Namespace ns, void* ptr);
-       public abstract void write_file (Valadoc.Package file, void* ptr);
-}
-
-
index 919b82fdfd5128e746001d6008e431e1802c6049..9fe92b9729862205ced8639dacef245ff4ebc2ce 100644 (file)
@@ -7,9 +7,11 @@ namespace Valadoc {
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class Item : GLib.Object {
                        public Item ();
+                       protected abstract Valadoc.Content.Inline build_signature ();
                        protected virtual void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                        protected virtual void resolve_type_references (Valadoc.Tree root);
                        public Valadoc.Api.Item parent { get; set; }
+                       public Valadoc.Content.Inline signature { get; }
                }
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class MemberNode : Valadoc.Api.SymbolNode {
@@ -37,9 +39,22 @@ namespace Valadoc {
                        public Valadoc.Namespace? nspace { get; }
                        public Valadoc.Package? package { get; }
                }
+               [CCode (ref_function = "valadoc_api_signature_builder_ref", unref_function = "valadoc_api_signature_builder_unref", cheader_filename = "valadoc-1.0.h")]
+               public class SignatureBuilder {
+                       public SignatureBuilder ();
+                       public Valadoc.Api.SignatureBuilder append (string text, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_content (Valadoc.Content.Inline content, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_keyword (string keyword, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_literal (string literal, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_symbol (Valadoc.Api.Node node, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_type (Valadoc.Api.Node node, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_type_name (string name, bool spaced = true);
+                       public Valadoc.Content.Run @get ();
+               }
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class SymbolNode : Valadoc.Api.Node, Valadoc.SymbolAccessibility {
                        public SymbolNode (Vala.Symbol symbol, Valadoc.Api.Node parent);
+                       protected string get_accessibility_modifier ();
                        public override string? get_filename ();
                        public override bool is_visitor_accessible (Valadoc.Settings settings);
                        public override string? name { owned get; }
@@ -385,20 +400,20 @@ namespace Valadoc {
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Array : Valadoc.Api.Item {
                public Array (Vala.ArrayType vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.Api.Node parent);
                public Valadoc.Api.Item data_type { get; set; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Class : Valadoc.Api.TypeSymbolNode, Valadoc.ClassHandler, Valadoc.StructHandler, Valadoc.SignalHandler, Valadoc.MethodHandler, Valadoc.EnumHandler, Valadoc.PropertyHandler, Valadoc.ConstructionMethodHandler, Valadoc.FieldHandler, Valadoc.DelegateHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler {
                public Class (Vala.Class symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
-               public Gee.Collection<Valadoc.Interface> get_implemented_interface_list ();
+               public Gee.Collection<Valadoc.TypeReference> get_implemented_interface_list ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Class? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public bool is_abstract { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -413,21 +428,21 @@ namespace Valadoc {
        public class Constant : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Constant (Vala.Constant symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_vconstant (Vala.Constant vconst);
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.ConstantHandler? parent);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.ConstantHandler parent);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Delegate : Valadoc.Api.TypeSymbolNode, Valadoc.ParameterListHandler, Valadoc.ReturnTypeHandler, Valadoc.TemplateParameterListHandler, Valadoc.ExceptionHandler {
                public Delegate (Vala.Delegate symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_static { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -461,43 +476,43 @@ namespace Valadoc {
        public class Enum : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler {
                public Enum (Vala.Enum symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                public Gee.Collection<Valadoc.EnumValue> get_enum_values ();
                public void visit (Valadoc.Doclet doclet);
                public void visit_enum_values (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class EnumValue : Valadoc.Api.SymbolNode {
                public EnumValue (Vala.EnumValue symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_venumvalue (Vala.EnumValue venval);
                protected override void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class ErrorCode : Valadoc.Api.TypeSymbolNode {
                public ErrorCode (Vala.ErrorCode symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_verrorcode (Vala.ErrorCode verrcode);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class ErrorDomain : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler {
                public ErrorDomain (Vala.ErrorDomain symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                public Gee.Collection<Valadoc.ErrorCode> get_error_code_list ();
                public void visit (Valadoc.Doclet doclet);
                public void visit_error_codes (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
@@ -516,10 +531,10 @@ namespace Valadoc {
        public class Field : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Field (Vala.Field symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.FieldHandler? parent);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.FieldHandler parent);
                public bool is_static { get; }
                public bool is_volatile { get; }
                public override Valadoc.Api.NodeType node_type { get; }
@@ -528,8 +543,8 @@ namespace Valadoc {
        public class FormalParameter : Valadoc.Api.SymbolNode, Valadoc.ReturnTypeHandler {
                public FormalParameter (Vala.FormalParameter symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool ellipsis { get; }
                public bool has_default_value { get; }
                public bool is_out { get; }
@@ -540,50 +555,22 @@ namespace Valadoc {
        public class Interface : Valadoc.Api.TypeSymbolNode, Valadoc.SignalHandler, Valadoc.PropertyHandler, Valadoc.FieldHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler, Valadoc.MethodHandler, Valadoc.DelegateHandler, Valadoc.EnumHandler, Valadoc.StructHandler, Valadoc.ClassHandler {
                public Interface (Vala.Interface symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
-               public Gee.Collection<Valadoc.Interface> get_implemented_interface_list ();
+               public Gee.Collection<Valadoc.TypeReference> get_implemented_interface_list ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Class? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
-       public abstract class Langlet : GLib.Object {
-               public Langlet ();
-               public abstract void write_array (Valadoc.Array param, void* ptr, Valadoc.Api.Node pos);
-               public abstract void write_class (Valadoc.Class cl, void* ptr);
-               public abstract void write_constant (Valadoc.Constant constant, Valadoc.ConstantHandler parent, void* ptr);
-               public abstract void write_delegate (Valadoc.Delegate del, void* ptr);
-               public abstract void write_enum (Valadoc.Enum en, void* ptr);
-               public abstract void write_enum_value (Valadoc.EnumValue enval, void* ptr);
-               public abstract void write_error_code (Valadoc.ErrorCode errcode, void* ptr);
-               public abstract void write_error_domain (Valadoc.ErrorDomain errdom, void* ptr);
-               public abstract void write_field (Valadoc.Field field, Valadoc.FieldHandler pos, void* ptr);
-               public abstract void write_file (Valadoc.Package file, void* ptr);
-               public abstract void write_formal_parameter (Valadoc.FormalParameter param, void* ptr);
-               public abstract void write_inheritance_list (Valadoc.Api.Node dtype, void* ptr);
-               public abstract void write_interface (Valadoc.Interface iface, void* ptr);
-               public abstract void write_method (void* ptr, Valadoc.Method m, Valadoc.MethodHandler pos);
-               public abstract void write_namespace (Valadoc.Namespace ns, void* ptr);
-               public abstract void write_parameter_list (Valadoc.ParameterListHandler thandler, void* ptr);
-               public abstract void write_pointer (Valadoc.Pointer param, void* ptr, Valadoc.Api.Node pos);
-               public abstract void write_property (Valadoc.Property prop, void* ptr);
-               public abstract void write_property_accessor (Valadoc.PropertyAccessor propac, void* ptr);
-               public abstract void write_signal (Valadoc.Signal sig, void* ptr);
-               public abstract void write_struct (Valadoc.Struct stru, void* ptr);
-               public abstract void write_template_parameters (Valadoc.TemplateParameterListHandler thandler, void* ptr);
-               public abstract void write_type_parameter (Valadoc.TypeParameter param, void* ptr);
-               public abstract void write_type_reference (Valadoc.TypeReference tref, void* ptr);
-       }
-       [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Method : Valadoc.Api.MemberNode, Valadoc.ParameterListHandler, Valadoc.ExceptionHandler, Valadoc.TemplateParameterListHandler, Valadoc.ReturnTypeHandler {
                public Method (Vala.Method symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.MethodHandler in_type);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.MethodHandler parent);
                public Valadoc.Method? base_method { get; set; }
                public bool is_abstract { get; }
                public bool is_constructor { get; }
@@ -607,9 +594,9 @@ namespace Valadoc {
        public class Namespace : Valadoc.Api.SymbolNode, Valadoc.MethodHandler, Valadoc.FieldHandler, Valadoc.NamespaceHandler, Valadoc.ErrorDomainHandler, Valadoc.EnumHandler, Valadoc.ClassHandler, Valadoc.StructHandler, Valadoc.InterfaceHandler, Valadoc.DelegateHandler, Valadoc.ConstantHandler {
                public Namespace (Vala.Namespace symbol, Valadoc.NamespaceHandler parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
                public Vala.Namespace vnspace { get; set; }
        }
@@ -617,11 +604,11 @@ namespace Valadoc {
        public class Package : Valadoc.Api.Node, Valadoc.NamespaceHandler {
                public Package (Vala.SourceFile vfile, string name, bool is_package = false);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public Gee.Collection<Valadoc.Package> get_dependency_list ();
                public Gee.Collection<Valadoc.Package> get_full_dependency_list ();
                public override bool is_visitor_accessible (Valadoc.Settings settings);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_package { get; set; }
                public override string? name { owned get; }
                public override Valadoc.Api.NodeType node_type { get; }
@@ -636,20 +623,20 @@ namespace Valadoc {
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Pointer : Valadoc.Api.Item {
                public Pointer (Vala.PointerType vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.Api.Node parent);
                public Valadoc.Api.Item data_type { get; set; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Property : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Property (Vala.Property symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public bool equals (Valadoc.Property p);
                public string? get_cname ();
                public bool is_vproperty (Vala.Property vprop);
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public Valadoc.Property base_property { get; set; }
                public Valadoc.PropertyAccessor getter { get; set; }
                public bool is_abstract { get; }
@@ -662,7 +649,7 @@ namespace Valadoc {
        public class PropertyAccessor : Valadoc.Api.SymbolNode {
                public PropertyAccessor (Vala.PropertyAccessor symbol, Valadoc.Property parent);
                public override void accept (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
+               protected override Valadoc.Content.Inline build_signature ();
                public bool is_construct { get; }
                public bool is_get { get; }
                public bool is_owned { get; }
@@ -728,10 +715,10 @@ namespace Valadoc {
        public class Signal : Valadoc.Api.MemberNode, Valadoc.ParameterListHandler, Valadoc.ReturnTypeHandler {
                public Signal (Vala.Signal symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_virtual { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -739,11 +726,11 @@ namespace Valadoc {
        public class Struct : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler, Valadoc.ConstructionMethodHandler, Valadoc.FieldHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler {
                public Struct (Vala.Struct symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Struct? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
@@ -838,15 +825,15 @@ namespace Valadoc {
        public class TypeParameter : Valadoc.Api.SymbolNode, Valadoc.ReturnTypeHandler {
                public TypeParameter (Vala.TypeParameter symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
+               protected override Valadoc.Content.Inline build_signature ();
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class TypeReference : Valadoc.Api.Item {
                public TypeReference (Vala.DataType? vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                public Gee.Collection<Valadoc.TypeReference> get_type_arguments ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public Valadoc.Api.Item? data_type { get; set; }
                public bool is_dynamic { get; }
                public bool is_nullable { get; }
index 9e660a3d8efafc10c20d064e6366b1bb8f2b0268..1cf23452c0f2a080c9522e44faa3bee054d36294 100755 (executable)
@@ -1,7 +1,7 @@
-#! /bin/bash
+#! /bin/sh
 
 # valadoc - temporary wrapper script for .libs/valadoc
-# Generated by ltmain.sh (GNU libtool) 2.2.6 Debian-2.2.6a-1ubuntu1
+# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
 #
 # The valadoc program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -12,9 +12,9 @@
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
 Xsed='/bin/sed -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
 
-# Be Bourne compatible
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
@@ -32,39 +32,38 @@ DUALCASE=1; export DUALCASE # for MKS sh
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-relink_command="(cd /home/mog/Desktop/valadoc/src/valadoc; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; export PATH; gcc -DPACKAGE_DATADIR=\\\"/usr/local/lib/valadoc/plugins\\\" -DPACKAGE_VERSION=\\\"0.2\\\" -I ../libvaladoc/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include/gee-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include/vala-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/graphviz -g -O2 -o \$progdir/\$file valadoc.o -Wl,--export-dynamic  ../libvaladoc/.libs/libvaladoc.so -L/usr/local/lib /usr/lib/libxml2.so /usr/local/lib/libvala.so /usr/lib/libgmodule-2.0.so -lgvc -lgraph -lcdt /usr/local/lib/libgee.so /usr/lib/libgobject-2.0.so /usr/lib/libglib-2.0.so -Wl,-rpath -Wl,/home/mog/Desktop/valadoc/src/libvaladoc/.libs -Wl,-rpath -Wl,/usr/local/lib/valadoc/)"
+relink_command="(cd /home/didier/dev/gits/valadoc.git/src/valadoc; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=\"/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2:/home/didier/bin\"; export PATH; gcc -DPACKAGE_DATADIR=\\\"/usr/lib/valadoc/plugins\\\" -DPACKAGE_VERSION=\\\"0.2\\\" -I ../libvaladoc/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gee-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/vala-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/graphviz -g -O0 -o \$progdir/\$file valadoc.o -Wl,--export-dynamic  ../libvaladoc/.libs/libvaladoc.so /usr/lib64/libxml2.so -L/usr/lib /usr/lib/libvala.so /usr/lib64/libgmodule-2.0.so /usr/lib64/libgvc.so /usr/lib64/libpathplan.so /usr/lib64/libexpat.so /usr/lib64/libltdl.so -ldl -lz -lm /usr/lib64/libgraph.so /usr/lib64/libcdt.so /usr/lib/libgee.so -lgcov /usr/lib64/libgobject-2.0.so /usr/lib64/libglib-2.0.so  -Wl,--rpath -Wl,/home/didier/dev/gits/valadoc.git/src/libvaladoc/.libs -Wl,--rpath -Wl,/usr/lib/valadoc/ ) "
 
 # This environment variable determines our operation mode.
 if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='2.2.6'
+  # install mode needs the following variable:
   notinst_deplibs=' ../libvaladoc/libvaladoc.la'
 else
-  # When we are sourced in execute mode, $file and $ECHO are already set.
+  # When we are sourced in execute mode, $file and $echo are already set.
   if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
-    ECHO="echo"
+    echo="echo"
     file="$0"
     # Make sure echo works.
     if test "X$1" = X--no-reexec; then
       # Discard the --no-reexec flag, and continue.
       shift
-    elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
-      # Yippee, $ECHO works!
+    elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+      # Yippee, $echo works!
       :
     else
-      # Restart under the correct shell, and then maybe $ECHO will work.
-      exec /bin/bash "$0" --no-reexec ${1+"$@"}
+      # Restart under the correct shell, and then maybe $echo will work.
+      exec /bin/sh "$0" --no-reexec ${1+"$@"}
     fi
   fi
 
   # Find the directory that this script lives in.
-  thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+  thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
   test "x$thisdir" = "x$file" && thisdir=.
 
   # Follow symbolic links until we get to the real thisdir.
   file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
   while test -n "$file"; do
-    destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+    destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
 
     # If there was a directory component, then change thisdir.
     if test "x$destdir" != "x$file"; then
@@ -74,26 +73,10 @@ else
       esac
     fi
 
-    file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
+    file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
     file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
   done
 
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
-  if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
-    # special case for '.'
-    if test "$thisdir" = "."; then
-      thisdir=`pwd`
-    fi
-    # remove .libs from thisdir
-    case "$thisdir" in
-    *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
-    .libs )   thisdir=. ;;
-    esac
-  fi
-
   # Try to get the absolute directory name.
   absdir=`cd "$thisdir" && pwd`
   test -n "$absdir" && thisdir="$absdir"
@@ -101,7 +84,7 @@ else
   program=lt-'valadoc'
   progdir="$thisdir/.libs"
 
-  if test ! -f "$progdir/$program" ||
+  if test ! -f "$progdir/$program" || \
      { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
        test "X$file" != "X$progdir/$program"; }; then
 
@@ -133,15 +116,20 @@ else
     if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
       # Run the actual program with our arguments.
 
+      # Make sure env LD_LIBRARY_PATH does not mess us up
+      if test -n "${LD_LIBRARY_PATH+set}"; then
+        export LD_LIBRARY_PATH=$progdir:$LD_LIBRARY_PATH
+      fi
+
       exec "$progdir/$program" ${1+"$@"}
 
-      $ECHO "$0: cannot exec $program $*" 1>&2
+      $echo "$0: cannot exec $program $*"
       exit 1
     fi
   else
     # The program doesn't exist.
-    $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
-    $ECHO "This script is just a wrapper for $program." 1>&2
+    $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
+    $echo "This script is just a wrapper for $program." 1>&2
     echo "See the libtool documentation for more information." 1>&2
     exit 1
   fi
index 919b82fdfd5128e746001d6008e431e1802c6049..9fe92b9729862205ced8639dacef245ff4ebc2ce 100644 (file)
@@ -7,9 +7,11 @@ namespace Valadoc {
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class Item : GLib.Object {
                        public Item ();
+                       protected abstract Valadoc.Content.Inline build_signature ();
                        protected virtual void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                        protected virtual void resolve_type_references (Valadoc.Tree root);
                        public Valadoc.Api.Item parent { get; set; }
+                       public Valadoc.Content.Inline signature { get; }
                }
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class MemberNode : Valadoc.Api.SymbolNode {
@@ -37,9 +39,22 @@ namespace Valadoc {
                        public Valadoc.Namespace? nspace { get; }
                        public Valadoc.Package? package { get; }
                }
+               [CCode (ref_function = "valadoc_api_signature_builder_ref", unref_function = "valadoc_api_signature_builder_unref", cheader_filename = "valadoc-1.0.h")]
+               public class SignatureBuilder {
+                       public SignatureBuilder ();
+                       public Valadoc.Api.SignatureBuilder append (string text, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_content (Valadoc.Content.Inline content, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_keyword (string keyword, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_literal (string literal, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_symbol (Valadoc.Api.Node node, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_type (Valadoc.Api.Node node, bool spaced = true);
+                       public Valadoc.Api.SignatureBuilder append_type_name (string name, bool spaced = true);
+                       public Valadoc.Content.Run @get ();
+               }
                [CCode (cheader_filename = "valadoc-1.0.h")]
                public abstract class SymbolNode : Valadoc.Api.Node, Valadoc.SymbolAccessibility {
                        public SymbolNode (Vala.Symbol symbol, Valadoc.Api.Node parent);
+                       protected string get_accessibility_modifier ();
                        public override string? get_filename ();
                        public override bool is_visitor_accessible (Valadoc.Settings settings);
                        public override string? name { owned get; }
@@ -385,20 +400,20 @@ namespace Valadoc {
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Array : Valadoc.Api.Item {
                public Array (Vala.ArrayType vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.Api.Node parent);
                public Valadoc.Api.Item data_type { get; set; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Class : Valadoc.Api.TypeSymbolNode, Valadoc.ClassHandler, Valadoc.StructHandler, Valadoc.SignalHandler, Valadoc.MethodHandler, Valadoc.EnumHandler, Valadoc.PropertyHandler, Valadoc.ConstructionMethodHandler, Valadoc.FieldHandler, Valadoc.DelegateHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler {
                public Class (Vala.Class symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
-               public Gee.Collection<Valadoc.Interface> get_implemented_interface_list ();
+               public Gee.Collection<Valadoc.TypeReference> get_implemented_interface_list ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Class? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public bool is_abstract { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -413,21 +428,21 @@ namespace Valadoc {
        public class Constant : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Constant (Vala.Constant symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_vconstant (Vala.Constant vconst);
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.ConstantHandler? parent);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.ConstantHandler parent);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Delegate : Valadoc.Api.TypeSymbolNode, Valadoc.ParameterListHandler, Valadoc.ReturnTypeHandler, Valadoc.TemplateParameterListHandler, Valadoc.ExceptionHandler {
                public Delegate (Vala.Delegate symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_static { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -461,43 +476,43 @@ namespace Valadoc {
        public class Enum : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler {
                public Enum (Vala.Enum symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                public Gee.Collection<Valadoc.EnumValue> get_enum_values ();
                public void visit (Valadoc.Doclet doclet);
                public void visit_enum_values (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class EnumValue : Valadoc.Api.SymbolNode {
                public EnumValue (Vala.EnumValue symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_venumvalue (Vala.EnumValue venval);
                protected override void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class ErrorCode : Valadoc.Api.TypeSymbolNode {
                public ErrorCode (Vala.ErrorCode symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string get_cname ();
                public bool is_verrorcode (Vala.ErrorCode verrcode);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class ErrorDomain : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler {
                public ErrorDomain (Vala.ErrorDomain symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                public Gee.Collection<Valadoc.ErrorCode> get_error_code_list ();
                public void visit (Valadoc.Doclet doclet);
                public void visit_error_codes (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
@@ -516,10 +531,10 @@ namespace Valadoc {
        public class Field : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Field (Vala.Field symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.FieldHandler? parent);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.FieldHandler parent);
                public bool is_static { get; }
                public bool is_volatile { get; }
                public override Valadoc.Api.NodeType node_type { get; }
@@ -528,8 +543,8 @@ namespace Valadoc {
        public class FormalParameter : Valadoc.Api.SymbolNode, Valadoc.ReturnTypeHandler {
                public FormalParameter (Vala.FormalParameter symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool ellipsis { get; }
                public bool has_default_value { get; }
                public bool is_out { get; }
@@ -540,50 +555,22 @@ namespace Valadoc {
        public class Interface : Valadoc.Api.TypeSymbolNode, Valadoc.SignalHandler, Valadoc.PropertyHandler, Valadoc.FieldHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler, Valadoc.MethodHandler, Valadoc.DelegateHandler, Valadoc.EnumHandler, Valadoc.StructHandler, Valadoc.ClassHandler {
                public Interface (Vala.Interface symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
-               public Gee.Collection<Valadoc.Interface> get_implemented_interface_list ();
+               public Gee.Collection<Valadoc.TypeReference> get_implemented_interface_list ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Class? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
-       public abstract class Langlet : GLib.Object {
-               public Langlet ();
-               public abstract void write_array (Valadoc.Array param, void* ptr, Valadoc.Api.Node pos);
-               public abstract void write_class (Valadoc.Class cl, void* ptr);
-               public abstract void write_constant (Valadoc.Constant constant, Valadoc.ConstantHandler parent, void* ptr);
-               public abstract void write_delegate (Valadoc.Delegate del, void* ptr);
-               public abstract void write_enum (Valadoc.Enum en, void* ptr);
-               public abstract void write_enum_value (Valadoc.EnumValue enval, void* ptr);
-               public abstract void write_error_code (Valadoc.ErrorCode errcode, void* ptr);
-               public abstract void write_error_domain (Valadoc.ErrorDomain errdom, void* ptr);
-               public abstract void write_field (Valadoc.Field field, Valadoc.FieldHandler pos, void* ptr);
-               public abstract void write_file (Valadoc.Package file, void* ptr);
-               public abstract void write_formal_parameter (Valadoc.FormalParameter param, void* ptr);
-               public abstract void write_inheritance_list (Valadoc.Api.Node dtype, void* ptr);
-               public abstract void write_interface (Valadoc.Interface iface, void* ptr);
-               public abstract void write_method (void* ptr, Valadoc.Method m, Valadoc.MethodHandler pos);
-               public abstract void write_namespace (Valadoc.Namespace ns, void* ptr);
-               public abstract void write_parameter_list (Valadoc.ParameterListHandler thandler, void* ptr);
-               public abstract void write_pointer (Valadoc.Pointer param, void* ptr, Valadoc.Api.Node pos);
-               public abstract void write_property (Valadoc.Property prop, void* ptr);
-               public abstract void write_property_accessor (Valadoc.PropertyAccessor propac, void* ptr);
-               public abstract void write_signal (Valadoc.Signal sig, void* ptr);
-               public abstract void write_struct (Valadoc.Struct stru, void* ptr);
-               public abstract void write_template_parameters (Valadoc.TemplateParameterListHandler thandler, void* ptr);
-               public abstract void write_type_parameter (Valadoc.TypeParameter param, void* ptr);
-               public abstract void write_type_reference (Valadoc.TypeReference tref, void* ptr);
-       }
-       [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Method : Valadoc.Api.MemberNode, Valadoc.ParameterListHandler, Valadoc.ExceptionHandler, Valadoc.TemplateParameterListHandler, Valadoc.ReturnTypeHandler {
                public Method (Vala.Method symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet, Valadoc.MethodHandler in_type);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.MethodHandler parent);
                public Valadoc.Method? base_method { get; set; }
                public bool is_abstract { get; }
                public bool is_constructor { get; }
@@ -607,9 +594,9 @@ namespace Valadoc {
        public class Namespace : Valadoc.Api.SymbolNode, Valadoc.MethodHandler, Valadoc.FieldHandler, Valadoc.NamespaceHandler, Valadoc.ErrorDomainHandler, Valadoc.EnumHandler, Valadoc.ClassHandler, Valadoc.StructHandler, Valadoc.InterfaceHandler, Valadoc.DelegateHandler, Valadoc.ConstantHandler {
                public Namespace (Vala.Namespace symbol, Valadoc.NamespaceHandler parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void process_comments (Valadoc.Settings settings, Valadoc.DocumentationParser parser);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public override Valadoc.Api.NodeType node_type { get; }
                public Vala.Namespace vnspace { get; set; }
        }
@@ -617,11 +604,11 @@ namespace Valadoc {
        public class Package : Valadoc.Api.Node, Valadoc.NamespaceHandler {
                public Package (Vala.SourceFile vfile, string name, bool is_package = false);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public Gee.Collection<Valadoc.Package> get_dependency_list ();
                public Gee.Collection<Valadoc.Package> get_full_dependency_list ();
                public override bool is_visitor_accessible (Valadoc.Settings settings);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_package { get; set; }
                public override string? name { owned get; }
                public override Valadoc.Api.NodeType node_type { get; }
@@ -636,20 +623,20 @@ namespace Valadoc {
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Pointer : Valadoc.Api.Item {
                public Pointer (Vala.PointerType vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr, Valadoc.Api.Node parent);
                public Valadoc.Api.Item data_type { get; set; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class Property : Valadoc.Api.MemberNode, Valadoc.ReturnTypeHandler {
                public Property (Vala.Property symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public bool equals (Valadoc.Property p);
                public string? get_cname ();
                public bool is_vproperty (Vala.Property vprop);
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public Valadoc.Property base_property { get; set; }
                public Valadoc.PropertyAccessor getter { get; set; }
                public bool is_abstract { get; }
@@ -662,7 +649,7 @@ namespace Valadoc {
        public class PropertyAccessor : Valadoc.Api.SymbolNode {
                public PropertyAccessor (Vala.PropertyAccessor symbol, Valadoc.Property parent);
                public override void accept (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
+               protected override Valadoc.Content.Inline build_signature ();
                public bool is_construct { get; }
                public bool is_get { get; }
                public bool is_owned { get; }
@@ -728,10 +715,10 @@ namespace Valadoc {
        public class Signal : Valadoc.Api.MemberNode, Valadoc.ParameterListHandler, Valadoc.ReturnTypeHandler {
                public Signal (Vala.Signal symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public bool is_virtual { get; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
@@ -739,11 +726,11 @@ namespace Valadoc {
        public class Struct : Valadoc.Api.TypeSymbolNode, Valadoc.MethodHandler, Valadoc.ConstructionMethodHandler, Valadoc.FieldHandler, Valadoc.ConstantHandler, Valadoc.TemplateParameterListHandler {
                public Struct (Vala.Struct symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
+               protected override Valadoc.Content.Inline build_signature ();
                public string? get_cname ();
                protected override void resolve_type_references (Valadoc.Tree root);
                public void visit (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
-               protected Valadoc.Struct? base_type { get; set; }
+               protected Valadoc.TypeReference? base_type { get; set; }
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
@@ -838,15 +825,15 @@ namespace Valadoc {
        public class TypeParameter : Valadoc.Api.SymbolNode, Valadoc.ReturnTypeHandler {
                public TypeParameter (Vala.TypeParameter symbol, Valadoc.Api.Node parent);
                public override void accept (Valadoc.Doclet doclet);
-               public void write (Valadoc.Langlet langlet, void* ptr);
+               protected override Valadoc.Content.Inline build_signature ();
                public override Valadoc.Api.NodeType node_type { get; }
        }
        [CCode (cheader_filename = "valadoc-1.0.h")]
        public class TypeReference : Valadoc.Api.Item {
                public TypeReference (Vala.DataType? vtyperef, Valadoc.Api.Item parent);
+               protected override Valadoc.Content.Inline build_signature ();
                public Gee.Collection<Valadoc.TypeReference> get_type_arguments ();
                protected override void resolve_type_references (Valadoc.Tree root);
-               public void write (Valadoc.Langlet langlet, void* ptr);
                public Valadoc.Api.Item? data_type { get; set; }
                public bool is_dynamic { get; }
                public bool is_nullable { get; }