[valadoc] Api: Introduce in-tree signature building
- From: Florian Brosch <flobrosch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [valadoc] Api: Introduce in-tree signature building
- Date: Sat, 17 Oct 2009 00:16:27 +0000 (UTC)
commit e1eb43e73e61e95a2792efe6bc7278303098b8e3
Author: Didier 'Ptitjes <ptitjes free fr>
Date: Fri Oct 16 08:34:15 2009 +0200
Api: Introduce in-tree signature building
src/doclets/devhelp/doclet/doclet.vala | 1 -
src/doclets/htm/doclet/doclet.vala | 3 -
src/doclets/htmlhelpers/doclet/Makefile.am | 1 -
src/doclets/htmlhelpers/doclet/doclet.vala | 41 ++-
src/doclets/htmlhelpers/doclet/htmlrenderer.vala | 23 +-
src/doclets/htmlhelpers/doclet/langlet.vala | 532 --------------------
.../htmlhelpers/doclet/libhtmlhelpers-1.0.vapi | 30 --
src/libvaladoc/Makefile.am | 2 +-
src/libvaladoc/apitree/apiitem.vala | 13 +
src/libvaladoc/apitree/apisymbolnode.vala | 12 +
src/libvaladoc/apitree/array.vala | 14 +-
src/libvaladoc/apitree/class.vala | 77 +++-
src/libvaladoc/apitree/constant.vala | 16 +-
src/libvaladoc/apitree/delegate.vala | 59 ++-
src/libvaladoc/apitree/enum.vala | 11 +-
src/libvaladoc/apitree/enumvalue.vala | 15 +-
src/libvaladoc/apitree/errorcode.vala | 13 +-
src/libvaladoc/apitree/errordomain.vala | 9 +-
src/libvaladoc/apitree/field.vala | 23 +-
src/libvaladoc/apitree/formalparameter.vala | 27 +-
src/libvaladoc/apitree/interface.vala | 68 ++-
src/libvaladoc/apitree/method.vala | 73 +++-
src/libvaladoc/apitree/namespace.vala | 17 +-
src/libvaladoc/apitree/package.vala | 10 +-
src/libvaladoc/apitree/pointer.vala | 14 +-
src/libvaladoc/apitree/property.vala | 37 ++-
src/libvaladoc/apitree/propertyaccessor.vala | 26 +-
src/libvaladoc/apitree/signal.vala | 33 +-
src/libvaladoc/apitree/signaturebuilder.vala | 89 ++++
src/libvaladoc/apitree/struct.vala | 42 ++-
.../apitree/templateparameterlisthandler.vala | 2 +-
src/libvaladoc/apitree/typeparameter.vala | 13 +-
src/libvaladoc/apitree/typereference.vala | 91 +++--
src/libvaladoc/drawer.vala | 18 +-
src/libvaladoc/langlet.vala | 51 --
src/libvaladoc/valadoc-1.0.vapi | 95 ++--
src/valadoc/valadoc | 60 +--
src/vapi/valadoc-1.0.vapi | 95 ++--
38 files changed, 812 insertions(+), 944 deletions(-)
---
diff --git a/src/doclets/devhelp/doclet/doclet.vala b/src/doclets/devhelp/doclet/doclet.vala
index c13de8d..5708b90 100755
--- a/src/doclets/devhelp/doclet/doclet.vala
+++ b/src/doclets/devhelp/doclet/doclet.vala
@@ -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") );
diff --git a/src/doclets/htm/doclet/doclet.vala b/src/doclets/htm/doclet/doclet.vala
index dc64f09..b3a003f 100755
--- a/src/doclets/htm/doclet/doclet.vala
+++ b/src/doclets/htm/doclet/doclet.vala
@@ -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 );
diff --git a/src/doclets/htmlhelpers/doclet/Makefile.am b/src/doclets/htmlhelpers/doclet/Makefile.am
index aaeafc5..7eda7ea 100644
--- a/src/doclets/htmlhelpers/doclet/Makefile.am
+++ b/src/doclets/htmlhelpers/doclet/Makefile.am
@@ -24,7 +24,6 @@ htmlhelpers_LTLIBRARIES = \
libhtmlhelpers_la_VALASOURCES = \
globals.vala \
- langlet.vala \
doclet.vala \
htmlrenderer.vala \
$(NULL)
diff --git a/src/doclets/htmlhelpers/doclet/doclet.vala b/src/doclets/htmlhelpers/doclet/doclet.vala
index 6a772e3..caf3ebc 100755
--- a/src/doclets/htmlhelpers/doclet/doclet.vala
+++ b/src/doclets/htmlhelpers/doclet/doclet.vala
@@ -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 );
diff --git a/src/doclets/htmlhelpers/doclet/htmlrenderer.vala b/src/doclets/htmlhelpers/doclet/htmlrenderer.vala
index 461b1d2..7d8afe8 100755
--- a/src/doclets/htmlhelpers/doclet/htmlrenderer.vala
+++ b/src/doclets/htmlhelpers/doclet/htmlrenderer.vala
@@ -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/libhtmlhelpers-1.0.vapi b/src/doclets/htmlhelpers/doclet/libhtmlhelpers-1.0.vapi
index 80c49e0..7cd9320 100644
--- a/src/doclets/htmlhelpers/doclet/libhtmlhelpers-1.0.vapi
+++ b/src/doclets/htmlhelpers/doclet/libhtmlhelpers-1.0.vapi
@@ -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);
diff --git a/src/libvaladoc/Makefile.am b/src/libvaladoc/Makefile.am
index dd15769..ac9ddc2 100644
--- a/src/libvaladoc/Makefile.am
+++ b/src/libvaladoc/Makefile.am
@@ -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 \
diff --git a/src/libvaladoc/apitree/apiitem.vala b/src/libvaladoc/apitree/apiitem.vala
index d38dac8..1d94811 100644
--- a/src/libvaladoc/apitree/apiitem.vala
+++ b/src/libvaladoc/apitree/apiitem.vala
@@ -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 ();
}
diff --git a/src/libvaladoc/apitree/apisymbolnode.vala b/src/libvaladoc/apitree/apisymbolnode.vala
index 20bce12..959560e 100644
--- a/src/libvaladoc/apitree/apisymbolnode.vala
+++ b/src/libvaladoc/apitree/apisymbolnode.vala
@@ -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";
+ }
+ }
}
diff --git a/src/libvaladoc/apitree/array.vala b/src/libvaladoc/apitree/array.vala
index ff80537..e0799dc 100644
--- a/src/libvaladoc/apitree/array.vala
+++ b/src/libvaladoc/apitree/array.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/class.vala b/src/libvaladoc/apitree/class.vala
index 6e8f162..3ce4a62 100644
--- a/src/libvaladoc/apitree/class.vala
+++ b/src/libvaladoc/apitree/class.vala
@@ -18,15 +18,15 @@
*/
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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/constant.vala b/src/libvaladoc/apitree/constant.vala
index af76138..4332e36 100644
--- a/src/libvaladoc/apitree/constant.vala
+++ b/src/libvaladoc/apitree/constant.vala
@@ -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);
- }
}
-
diff --git a/src/libvaladoc/apitree/delegate.vala b/src/libvaladoc/apitree/delegate.vala
index 316947b..5b5c529 100644
--- a/src/libvaladoc/apitree/delegate.vala
+++ b/src/libvaladoc/apitree/delegate.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/apitree/enum.vala b/src/libvaladoc/apitree/enum.vala
index 10be6e1..86fd629 100644
--- a/src/libvaladoc/apitree/enum.vala
+++ b/src/libvaladoc/apitree/enum.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/apitree/enumvalue.vala b/src/libvaladoc/apitree/enumvalue.vala
index c74a8fb..5d40eee 100644
--- a/src/libvaladoc/apitree/enumvalue.vala
+++ b/src/libvaladoc/apitree/enumvalue.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/errorcode.vala b/src/libvaladoc/apitree/errorcode.vala
index 9cbed09..63a701a 100644
--- a/src/libvaladoc/apitree/errorcode.vala
+++ b/src/libvaladoc/apitree/errorcode.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/errordomain.vala b/src/libvaladoc/apitree/errordomain.vala
index 1658128..8af7891 100644
--- a/src/libvaladoc/apitree/errordomain.vala
+++ b/src/libvaladoc/apitree/errordomain.vala
@@ -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 ();
}
}
diff --git a/src/libvaladoc/apitree/field.vala b/src/libvaladoc/apitree/field.vala
index 8e90761..a1443b8 100644
--- a/src/libvaladoc/apitree/field.vala
+++ b/src/libvaladoc/apitree/field.vala
@@ -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);
- }
}
-
diff --git a/src/libvaladoc/apitree/formalparameter.vala b/src/libvaladoc/apitree/formalparameter.vala
index b7cb4b1..130dab4 100644
--- a/src/libvaladoc/apitree/formalparameter.vala
+++ b/src/libvaladoc/apitree/formalparameter.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/apitree/interface.vala b/src/libvaladoc/apitree/interface.vala
index 0cdcef0..bfe5fc8 100644
--- a/src/libvaladoc/apitree/interface.vala
+++ b/src/libvaladoc/apitree/interface.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/method.vala b/src/libvaladoc/apitree/method.vala
index 58c902d..d902315 100644
--- a/src/libvaladoc/apitree/method.vala
+++ b/src/libvaladoc/apitree/method.vala
@@ -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);
- }
}
-
diff --git a/src/libvaladoc/apitree/namespace.vala b/src/libvaladoc/apitree/namespace.vala
index a686134..256c51e 100644
--- a/src/libvaladoc/apitree/namespace.vala
+++ b/src/libvaladoc/apitree/namespace.vala
@@ -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);
- }
}
-
-
-
diff --git a/src/libvaladoc/apitree/package.vala b/src/libvaladoc/apitree/package.vala
index ce814de..91542c9 100644
--- a/src/libvaladoc/apitree/package.vala
+++ b/src/libvaladoc/apitree/package.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/apitree/pointer.vala b/src/libvaladoc/apitree/pointer.vala
index e967298..b1f0132 100644
--- a/src/libvaladoc/apitree/pointer.vala
+++ b/src/libvaladoc/apitree/pointer.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/property.vala b/src/libvaladoc/apitree/property.vala
index a6526b5..13870cc 100644
--- a/src/libvaladoc/apitree/property.vala
+++ b/src/libvaladoc/apitree/property.vala
@@ -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);
- }
}
-
diff --git a/src/libvaladoc/apitree/propertyaccessor.vala b/src/libvaladoc/apitree/propertyaccessor.vala
index e4f2f72..9aa1b51 100644
--- a/src/libvaladoc/apitree/propertyaccessor.vala
+++ b/src/libvaladoc/apitree/propertyaccessor.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/apitree/signal.vala b/src/libvaladoc/apitree/signal.vala
index 17d7262..0559ab4 100644
--- a/src/libvaladoc/apitree/signal.vala
+++ b/src/libvaladoc/apitree/signal.vala
@@ -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
index 0000000..1b5e13e
--- /dev/null
+++ b/src/libvaladoc/apitree/signaturebuilder.vala
@@ -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;
+ }
+}
diff --git a/src/libvaladoc/apitree/struct.vala b/src/libvaladoc/apitree/struct.vala
index a70f9fe..828547c 100644
--- a/src/libvaladoc/apitree/struct.vala
+++ b/src/libvaladoc/apitree/struct.vala
@@ -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 ();
+ }
+}
diff --git a/src/libvaladoc/apitree/templateparameterlisthandler.vala b/src/libvaladoc/apitree/templateparameterlisthandler.vala
index b8414e7..b6036f7 100644
--- a/src/libvaladoc/apitree/templateparameterlisthandler.vala
+++ b/src/libvaladoc/apitree/templateparameterlisthandler.vala
@@ -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);
}
}
diff --git a/src/libvaladoc/apitree/typeparameter.vala b/src/libvaladoc/apitree/typeparameter.vala
index 43351d9..f204331 100644
--- a/src/libvaladoc/apitree/typeparameter.vala
+++ b/src/libvaladoc/apitree/typeparameter.vala
@@ -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);
- }
}
-
diff --git a/src/libvaladoc/apitree/typereference.vala b/src/libvaladoc/apitree/typereference.vala
index 332d030..10f3d68 100644
--- a/src/libvaladoc/apitree/typereference.vala
+++ b/src/libvaladoc/apitree/typereference.vala
@@ -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 ();
}
}
-
diff --git a/src/libvaladoc/drawer.vala b/src/libvaladoc/drawer.vala
index 85bf3c7..9ae0b3d 100755
--- a/src/libvaladoc/drawer.vala
+++ b/src/libvaladoc/drawer.vala
@@ -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/valadoc-1.0.vapi b/src/libvaladoc/valadoc-1.0.vapi
index 919b82f..9fe92b9 100644
--- a/src/libvaladoc/valadoc-1.0.vapi
+++ b/src/libvaladoc/valadoc-1.0.vapi
@@ -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; }
diff --git a/src/valadoc/valadoc b/src/valadoc/valadoc
index 9e660a3..1cf2345 100755
--- a/src/valadoc/valadoc
+++ b/src/valadoc/valadoc
@@ -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
diff --git a/src/vapi/valadoc-1.0.vapi b/src/vapi/valadoc-1.0.vapi
index 919b82f..9fe92b9 100644
--- a/src/vapi/valadoc-1.0.vapi
+++ b/src/vapi/valadoc-1.0.vapi
@@ -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; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]