]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala 0.7.10 migration
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 10 Feb 2010 00:28:24 +0000 (01:28 +0100)
committerFlorian Brosch <flo.brosch@gmail.com>
Wed, 10 Feb 2010 00:28:24 +0000 (01:28 +0100)
55 files changed:
src/doclets/devhelp/doclet.vala
src/doclets/htm/doclet.vala
src/doclets/xml/doclet.vala
src/libvaladoc/Makefile.am
src/libvaladoc/api/array.vala
src/libvaladoc/api/class.vala
src/libvaladoc/api/constant.vala
src/libvaladoc/api/delegate.vala
src/libvaladoc/api/enumvalue.vala
src/libvaladoc/api/field.vala
src/libvaladoc/api/formalparameter.vala
src/libvaladoc/api/interface.vala
src/libvaladoc/api/item.vala
src/libvaladoc/api/member.vala
src/libvaladoc/api/method.vala
src/libvaladoc/api/namespace.vala
src/libvaladoc/api/node.vala
src/libvaladoc/api/package.vala
src/libvaladoc/api/pointer.vala
src/libvaladoc/api/property.vala
src/libvaladoc/api/signal.vala
src/libvaladoc/api/struct.vala
src/libvaladoc/api/symbol.vala
src/libvaladoc/api/tree.vala
src/libvaladoc/api/typereference.vala
src/libvaladoc/api/typesymbol.vala
src/libvaladoc/content/blockcontent.vala
src/libvaladoc/content/comment.vala
src/libvaladoc/content/contentfactory.vala
src/libvaladoc/content/embedded.vala
src/libvaladoc/content/headline.vala
src/libvaladoc/content/inlinecontent.vala
src/libvaladoc/content/inlinetaglet.vala
src/libvaladoc/content/link.vala
src/libvaladoc/content/list.vala
src/libvaladoc/content/listitem.vala
src/libvaladoc/content/paragraph.vala
src/libvaladoc/content/run.vala
src/libvaladoc/content/sourcecode.vala
src/libvaladoc/content/styleattributes.vala
src/libvaladoc/content/symbollink.vala
src/libvaladoc/content/table.vala
src/libvaladoc/content/tablecell.vala
src/libvaladoc/content/tablerow.vala
src/libvaladoc/content/text.vala
src/libvaladoc/doclet.vala
src/libvaladoc/documentation/documentationparser.vala
src/libvaladoc/documentation/wiki.vala
src/libvaladoc/html/basicdoclet.vala
src/libvaladoc/html/globals.vala
src/libvaladoc/html/htmlmarkupwriter.vala
src/libvaladoc/html/htmlrenderer.vala
src/libvaladoc/moduleloader.vala
src/libvaladoc/settings.vala
src/valadoc/valadoc.vala

index 69a823ad0b9c60189df936b24114961811ea42ab..f67dc249a7f4bc481c83b8dbe4910e900a92ba98 100755 (executable)
@@ -182,19 +182,19 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                _devhelpwriter.start_functions ();
                foreach (Api.Node node in this.nodes) {
                        string typekeyword = "";
-                       if (node is Enum) {
+                       if (node is Api.Enum) {
                                typekeyword = "enum";
-                       } else if (node is Constant) {
+                       } else if (node is Api.Constant) {
                                typekeyword = "constant";
-                       } else if (node is Method) {
+                       } else if (node is Api.Method) {
                                typekeyword = "function";
-                       } else if (node is Field) {
+                       } else if (node is Api.Field) {
                                typekeyword = "variable";
-                       } else if (node is Property) {
+                       } else if (node is Api.Property) {
                                typekeyword = "property";
                        } else if (node is Api.Signal) {
                                typekeyword = "signal";
-                       } else if (node is Struct) {
+                       } else if (node is Api.Struct) {
                                typekeyword = "struct";
                        }
 
@@ -266,7 +266,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                process_node (item);
        }
 
-       public override void visit_enum ( Enum item) {
+       public override void visit_enum (Api.Enum item) {
                process_node (item);
        }
 
index 14cbf9075e0aa819fe4a600587c7e74795aab5b4..480d4754ab0e657276162f4cd573b8f2332b36b6 100755 (executable)
@@ -150,10 +150,10 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( path, "index.htm" ), "w");
                writer = new Html.MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (this.css_path, pkg_name);
+//             write_file_header (this.css_path, pkg_name);
                write_navi_package (package);
                write_package_content (package, package);
-               write_file_footer ();
+//             write_file_footer ();
                file = null;
 
                package.accept_all_children (this);
@@ -198,35 +198,35 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                process_node (item);
        }
 
-       public override void visit_class (Class item) {
+       public override void visit_class (Api.Class item) {
                process_node (item);
        }
 
-       public override void visit_struct (Struct item) {
+       public override void visit_struct (Api.Struct item) {
                process_node (item);
        }
 
-       public override void visit_error_domain (ErrorDomain item) {
+       public override void visit_error_domain (Api.ErrorDomain item) {
                process_node (item);
        }
 
-       public override void visit_enum (Enum item) {
+       public override void visit_enum (Api.Enum item) {
                process_node (item);
        }
 
-       public override void visit_property (Property item) {
+       public override void visit_property (Api.Property item) {
                process_node (item);
        }
 
-       public override void visit_constant (Constant item) {
+       public override void visit_constant (Api.Constant item) {
                process_node (item);
        }
 
-       public override void visit_field (Field item) {
+       public override void visit_field (Api.Field item) {
                process_node (item);
        }
 
-       public override void visit_error_code (ErrorCode item) {
+       public override void visit_error_code (Api.ErrorCode item) {
                process_node (item);
        }
 
@@ -234,7 +234,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                process_node (item);
        }
 
-       public override void visit_delegate (Delegate item) {
+       public override void visit_delegate (Api.Delegate item) {
                process_node (item);
        }
 
@@ -242,7 +242,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                process_node (item);
        }
 
-       public override void visit_method (Method item) {
+       public override void visit_method (Api.Method item) {
                process_node (item);
        }
 }
index e496c57db34fdcff77204269f218a1f45d4f8b6b..dfa63ccfd7398e0af34ca6a05c2e2c4a3030599c 100755 (executable)
@@ -53,7 +53,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
                }
 
                // avoid exceptions and signal childs
-               if (node is Class || node is Struct || node is Enum || node is ErrorDomain || node is Namespace) {
+               if (node is Api.Class || node is Api.Struct || node is Api.Enum || node is Api.ErrorDomain || node is Api.Namespace) {
                        node.accept_all_children (this);
                }
 
@@ -64,7 +64,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
                tree.accept_children (this);
        }
 
-       public override void visit_package (Package package) {
+       public override void visit_package (Api.Package package) {
                string path = GLib.Path.build_filename (this.settings.path, package.name);
                DirUtils.create (path, 0777);
 
@@ -78,43 +78,43 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
                file = null;
        }
 
-       public override void visit_namespace (Namespace ns) {
+       public override void visit_namespace (Api.Namespace ns) {
                process_node (ns, "namespace");
        }
 
-       public override void visit_interface (Interface item) {
+       public override void visit_interface (Api.Interface item) {
                process_node (item, "interface");
        }
 
-       public override void visit_class (Class item) {
+       public override void visit_class (Api.Class item) {
                process_node (item, "class");
        }
 
-       public override void visit_struct (Struct item) {
+       public override void visit_struct (Api.Struct item) {
                process_node (item, "struct");
        }
 
-       public override void visit_error_domain (ErrorDomain item) {
+       public override void visit_error_domain (Api.ErrorDomain item) {
                process_node (item, "error-domain");
        }
 
-       public override void visit_enum (Enum item) {
+       public override void visit_enum (Api.Enum item) {
                process_node (item, "enum");
        }
 
-       public override void visit_property (Property item) {
+       public override void visit_property (Api.Property item) {
                process_node (item, "property");
        }
 
-       public override void visit_constant (Constant item) {
+       public override void visit_constant (Api.Constant item) {
                process_node (item, "constant");
        }
 
-       public override void visit_field (Field item) {
+       public override void visit_field (Api.Field item) {
                process_node (item, "field");
        }
 
-       public override void visit_error_code (ErrorCode item) {
+       public override void visit_error_code (Api.ErrorCode item) {
                process_node (item, "error-code");
        }
 
@@ -122,7 +122,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
                process_node (item, "enum-value");
        }
 
-       public override void visit_delegate (Delegate item) {
+       public override void visit_delegate (Api.Delegate item) {
                process_node (item, "delegate");
        }
 
@@ -130,7 +130,7 @@ public class Valadoc.Xml.Doclet : Api.Visitor, Valadoc.Doclet {
                process_node (item, "signal");
        }
 
-       public override void visit_method (Method item) {
+       public override void visit_method (Api.Method item) {
                process_node (item, "method");
        }
 }
index c2cc30e396100e42267c1e6da79bcae2b67075e2..08dfaa6b38875de9602690583e08fc2bd25bd72e 100644 (file)
@@ -1,8 +1,11 @@
 NULL =
 
+globalvapidir = `pkg-config vala-1.0 --variable vapidir`
+
 
 AM_CFLAGS = \
        -DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \
+       -DPACKAGE_VAPIDIR=\"$(globalvapidir)\" \
        $(LIBGVC_CFLAGS) \
        $(GLIB_CFLAGS) \
        $(LIBGEE_CFLAGS) \
@@ -35,6 +38,9 @@ libvaladoc_la_VALASOURCES = \
        documentation/documentationparser.vala \
        documentation/wiki.vala \
        documentation/wikiscanner.vala \
+       importer/documentationimporter.vala \
+       importer/valadocdocumentationimporter.vala \
+       importer/valamarkupreader.vala \
        api/array.vala \
        api/class.vala \
        api/constant.vala \
@@ -136,7 +142,7 @@ libvaladocincludedir = $(includedir)/
 
 
 libvaladoc.vala.stamp: $(libvaladoc_la_VALASOURCES)
-       $(VALAC) $(VALAFLAGS) -C -H valadoc-1.0.h --pkg gee-1.0 --pkg vala-1.0 --pkg gmodule-2.0 --vapidir ../vapi --pkg libgvc --library valadoc-1.0 --basedir $(top_srcdir)/src/libvaladoc/ --save-temps $^
+       $(VALAC) $(VALAFLAGS) -C -H valadoc-1.0.h --pkg gee-1.0 --pkg vala-1.0 --pkg gmodule-2.0 --vapidir ../vapi --pkg libgvc --pkg config --library valadoc-1.0 --basedir $(top_srcdir)/src/libvaladoc/ --save-temps $^
        touch $@
 
 
index da14b79ab0075cbd4c0bb1f37dbf73a90e14f22a..171b9b474c4578e5e6e595d460e5ad803994a1e7 100644 (file)
@@ -43,7 +43,7 @@ public class Valadoc.Api.Array : Item {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                if (this.data_type == null) {
                        /*TODO:possible?*/;
                } else if (this.data_type is Array) {
index c3b93a7867dc62c44b00ad52774b4a41d97dd812..e3fe29b7d8c8f25ace74c9afa3e1e37ce2691592 100644 (file)
@@ -40,7 +40,7 @@ public class Valadoc.Api.Class : TypeSymbol {
                }
        }
 
-       protected TypeReference? base_type {
+       public TypeReference? base_type {
                private set;
                get;
        }
@@ -82,7 +82,7 @@ public class Valadoc.Api.Class : TypeSymbol {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                var lst = this.vclass.get_base_types ();
                this.set_parent_type_references (root, lst);
 
index 2af71e29f6a992ab243f51f626976dcef40591a6..0422f84f16cb506cc2c38118b9117625a05a158a 100644 (file)
@@ -35,7 +35,7 @@ public class Valadoc.Api.Constant : Member {
                return ((Vala.Constant) symbol).get_cname ();
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                type_reference.resolve_type_references (root);
        }
 
index 903c778c8100f96d4d1e3710ee08e620b06fb8bb..442849619a96d791491c6196e9eef1ba38cc1a47 100644 (file)
@@ -47,7 +47,7 @@ public class Valadoc.Api.Delegate : TypeSymbol {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                return_type.resolve_type_references (root);
 
                base.resolve_type_references (root);
index 57113b8feff05d3207fe0d2bd90edab2c778537f..ee3038b443f92b7793a87e54717a559707918e3e 100644 (file)
@@ -52,7 +52,7 @@ public class Valadoc.Api.EnumValue: Symbol {
                }
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.EnumValue) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
index 5f084f76ae9083d5cb45de286622406a9935c895..16d3d44b0e52f4d48178f45a07f7c8968e593de9 100644 (file)
@@ -51,7 +51,7 @@ public class Valadoc.Api.Field : Member {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                field_type.resolve_type_references (root);
 
                base.resolve_type_references (root);
index e7491111974f5df57e1ebcd0bafe11cd6eca9e17..538433d1306a14084baf5f6bfa79c06a80a6a934 100644 (file)
@@ -61,7 +61,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
                visitor.visit_formal_parameter (this);
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                if (ellipsis) {
                        return;
                }
index 459e18c1c6b7780248ca45c759ceb423953c8527..e7bb315ee178945f4808a212e600a338853acc70 100644 (file)
@@ -38,7 +38,7 @@ public class Valadoc.Api.Interface : TypeSymbol {
                return ((Vala.Interface) symbol).get_cname ();
        }
 
-       protected TypeReference? base_type { private set; get; }
+       public TypeReference? base_type { private set; get; }
 
        public override NodeType node_type { get { return NodeType.INTERFACE; } }
 
@@ -63,7 +63,7 @@ public class Valadoc.Api.Interface : TypeSymbol {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                var prerequisites = ((Vala.Interface) symbol).get_prerequisites ();
                this.set_prerequisites (root, prerequisites);
 
index a58830c3fbacfc7cb779e270771986836c24f807..ecb087a5f0538365d79167677446c16703612fa1 100644 (file)
@@ -28,10 +28,10 @@ public abstract class Valadoc.Api.Item : Object {
 
        public Item parent { protected set; get; }
 
-       protected virtual void resolve_type_references (Tree root) {
+       internal virtual void resolve_type_references (Tree root) {
        }
 
-       protected virtual void process_comments (Settings settings, DocumentationParser parser) {
+       internal virtual void process_comments (Settings settings, DocumentationParser parser) {
        }
 
        public Inline signature {
index b2766da80ae46940deff25a20e82ab0f1bf5bd63..428d3acb8c7fc7b5c8367d95dac2e3e9f48c21f8 100644 (file)
@@ -28,7 +28,7 @@ public abstract class Valadoc.Api.Member : Symbol {
                base (symbol, parent);
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.Member) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
index 893ab30fd3d266dc34eb9565d7935c292b81b262..243587db83d93bd2a1b3033f8f7ae8810e9c297d 100644 (file)
@@ -97,7 +97,7 @@ public class Valadoc.Api.Method : Member {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                Vala.Method vala_method = symbol as Vala.Method;
                Vala.Method? base_vala_method = null;
                if (vala_method.base_method != null) {
index 6a106c840fe0a077a7f80e5802baa29693bb29d4..00464f8d139b34209c7487e3db3e7492dfead1b3 100644 (file)
@@ -39,7 +39,7 @@ public class Valadoc.Api.Namespace : Symbol {
                }
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
                }
index b4eb6abba4fe474caa4d5fdb669824307fbf1450..498df4ad06bd2e18a566b8fe49d12b89cf67e4b1 100644 (file)
@@ -72,7 +72,7 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
                return null;
        }
 
-       protected void add_child (Symbol child) {
+       internal void add_child (Symbol child) {
                if (child.name != null) {
                        per_name_children.set (child.name, child);
                } else {
@@ -91,13 +91,13 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
                children.add (child);
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                foreach (Node node in per_name_children.values) {
                        node.resolve_type_references (root);
                }
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                do_document = true;
 
                foreach (Node node in per_symbol_children.values) {
@@ -207,7 +207,7 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
        }
 
        public Content.Comment? documentation {
-               protected set;
+               internal set;
                get;
        }
 
index c50c986e9142d61f774c0729bf8e3275859ea191..7979972cd7c7824a681b455042aea5bf5830322b 100644 (file)
@@ -94,7 +94,7 @@ public class Valadoc.Api.Package : Node {
        }
 
        public override bool is_visitor_accessible (Settings settings) {
-               return !( this.is_package && settings.with_deps == false );
+               return !(this.is_package && settings.with_deps == false);
        }
 
        public override NodeType node_type { get { return NodeType.PACKAGE; } }
@@ -110,7 +110,11 @@ public class Valadoc.Api.Package : Node {
                        .get ();
        }
 
-       protected Namespace get_namespace (Tree root, Vala.Symbol symbol) {
+       internal void import_documentation (string path, Settings settings, DocumentationImporter importer) {
+               importer.process (path, settings, this);
+       }
+
+       internal Namespace get_namespace (Tree root, Vala.Symbol symbol) {
                Vala.Symbol namespace_symbol = symbol;
                while (!(namespace_symbol is Vala.Namespace)) {
                        namespace_symbol = namespace_symbol.parent_symbol;
index 446b8f6453d3c78ec960f2ffcdc296549f37d9b8..6b2b736ca3b48479dbc976d37d373a4643794359 100644 (file)
@@ -45,7 +45,7 @@ public class Valadoc.Api.Pointer : Item {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                Api.Item type = this.data_type;
                if (type == null) {
                        ;
index 6774ecc95eb816e826e5fc4ddf3dea37444b6f63..af7e25b9ad347b6ffc43000c54b713592d6b4464 100644 (file)
@@ -68,7 +68,7 @@ public class Valadoc.Api.Property : Member {
 
        public Property base_property { private set; get; }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                Vala.Property vala_property = symbol as Vala.Property;
                Vala.Property? base_vala_property = null;
                if (vala_property.base_property != null) {
@@ -87,7 +87,7 @@ public class Valadoc.Api.Property : Member {
                property_type.resolve_type_references (root);
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                if (getter != null && getter.is_visitor_accessible (settings)) {
                        getter.process_comments (settings, parser);
                }
index 0f15abd799fd8bf1cc53a62ae2f55ecb94a33c4b..30b5a36e2bdcac9b78ee8db2492862959b18df3a 100644 (file)
@@ -35,7 +35,7 @@ public class Valadoc.Api.Signal : Member {
 
        public TypeReference? return_type { protected set; get; }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                return_type.resolve_type_references (root);
 
                base.resolve_type_references (root);
index dfe56052d012847818e750e4fea90698fe357d70..7b672e96e45ed86933470b70d5d63aca80019193 100644 (file)
@@ -28,7 +28,7 @@ public class Valadoc.Api.Struct : TypeSymbol {
                base (symbol, parent);
        }
 
-       protected TypeReference? base_type { private set; get; }
+       public TypeReference? base_type { private set; get; }
 
        public string? get_cname () {
                return ((Vala.Struct) symbol).get_cname();
@@ -49,7 +49,7 @@ public class Valadoc.Api.Struct : TypeSymbol {
                this.base_type.resolve_type_references (root);
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                this.set_parent_references (root);
 
                base.resolve_type_references (root);
index 6ca4d7683e15826bb607092a5955d717876c2ed0..1da6be3141d756b626f2b355991c151af56b138f 100644 (file)
@@ -24,7 +24,7 @@ using Gee;
 
 public abstract class Valadoc.Api.Symbol : Node {
 
-       protected Vala.Symbol symbol { private set; get; }
+       internal Vala.Symbol symbol { private set; get; }
 
        public override string? name {
                owned get {
@@ -101,7 +101,7 @@ public abstract class Valadoc.Api.Symbol : Node {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                base.resolve_type_references (root);
 
                foreach (Vala.DataType type in symbol.get_error_types ()) {
index dfacf98a4f0c8d91eec9b0911ab7392cdebb35be..e19ab2204c28dae106c4dac663e503b73d9cd471 100644 (file)
@@ -66,6 +66,7 @@ public class Valadoc.Api.Tree {
 
        private Node? search_relative_to (Node element, string[] path) {
                Api.Node? node = element;
+
                foreach (string name in path) {
                        node = node.find_by_name (name);
                        if (node == null) {
@@ -80,25 +81,49 @@ public class Valadoc.Api.Tree {
                return node;
        }
 
+       public Node? search_symbol_path (Node? element, string[] path) {
+               Api.Node? node = null;
+
+               // relative to element
+               if (element != null) {
+                       node = search_relative_to (element, path);
+                       if (node != null) {
+                               return node;
+                       }
+               }
+
+
+               // absolute
+               foreach (Package package in packages) {
+                       // search in root namespace
+                       node = search_relative_to (package.find_by_name (""), path);
+                       if (node != null) {
+                               return node;
+                       }
+               }
+
+               return null;
+       }
+
        public Node? search_symbol_str (Node? element, string symname) {
                string[] path = split_name (symname);
 
-               if (element == null) {
-                       Api.Node? node = null;
-                       foreach (Package packgage in packages) {
-                               node = search_relative_to (packgage, path);
-                               if (node != null) {
-                                       return (Node) node;
-                               }
-                       }
-                       return null;
+               var node = search_symbol_path (element, path);
+               if (node != null) {
+                       return node;
+               }
+
+               if (path.length >= 3 && path[path.length-3] == path[path.length-2]) {
+                       path[path.length-2] = path[path.length-2]+"."+path[path.length-1];
+                       path.resize (path.length-1);
+                       return search_symbol_path (element, path);
                }
 
-               return (Node) search_relative_to ((Node) element, path);
+               return null;
        }
 
        private string[] split_name (string full_name) {
-               string[] params = full_name.split (".", -1);
+               string[] params = (full_name).split (".", -1);
                int i = 0; while (params[i] != null) i++;
                params.length = i;
                return params;
@@ -215,6 +240,43 @@ public class Valadoc.Api.Tree {
                return true;
        }
 
+       // copied from valacodecontext.vala
+       private string? get_file_path (string basename, string data_dir, string[] directories) {
+               string filename = null;
+
+               if (directories != null) {
+                       foreach (string dir in directories) {
+                               filename = Path.build_filename (dir, basename);
+                               if (FileUtils.test (filename, FileTest.EXISTS)) {
+                                       return filename;
+                               }
+                       }
+               }
+
+               foreach (string dir in Environment.get_system_data_dirs ()) {
+                       filename = Path.build_filename (dir, data_dir, basename);
+                       if (FileUtils.test (filename, FileTest.EXISTS)) {
+                               return filename;
+                       }
+               }
+
+               return null;
+       }
+
+       // copied from valacodecontext.vala
+       private string? get_external_documentation_path (string pkg) {
+               var path = get_file_path (Path.build_filename (pkg, pkg + ".valadoc"), "vala/vapi/documentation", settings.docu_directories);
+
+               if (path == null) {
+                       /* last chance: try the package compiled-in vapi dir */
+                       var filename = Path.build_filename (Config.vapi_dir, "vapi", "documentation", pkg, pkg + ".valadoc");
+                       if (FileUtils.test (filename, FileTest.EXISTS)) {
+                               path = filename;
+                       }
+               }
+
+               return path;
+       }
 
        public void add_depencies (string[] packages) {
                foreach (string package in packages) {
@@ -315,11 +377,28 @@ public class Valadoc.Api.Tree {
                }
        }
 
+       private Package? get_source_package () {
+               foreach (Package pkg in packages) {
+                       if (!pkg.is_package) {
+                               return pkg;
+                       }
+               }
+
+               return null;
+       }
+
+       private void process_wiki (DocumentationParser docparser) {
+               this.wikitree = new WikiPageTree(this.reporter, this.settings);
+               var pkg = get_source_package ();
+               if (pkg != null) {
+                       wikitree.create_tree (docparser, pkg);
+               }
+       }
+
        // TODO Rename to process_comments
        public void parse_comments (DocumentationParser docparser) {
                // TODO Move Wiki tree parse to Package
-               this.wikitree = new WikiPageTree(this.reporter, this.settings);
-               wikitree.create_tree (docparser);
+               process_wiki (docparser);
 
                foreach (Package pkg in this.packages) {
                        if (pkg.is_visitor_accessible (settings)) {
@@ -328,6 +407,17 @@ public class Valadoc.Api.Tree {
                }
        }
 
+       public void import_documentation (DocumentationImporter importer) {
+               foreach (Package pkg in this.packages) {
+                       string? path = (pkg.is_package)? get_external_documentation_path (pkg.name) : null;
+
+                       if (pkg.is_visitor_accessible (settings) && path != null) {
+                               pkg.import_documentation (path, settings, importer);
+                       }
+               }
+
+       }
+
        internal Symbol? search_vala_symbol (Vala.Symbol symbol) {
                Vala.SourceFile source_file = symbol.source_reference.file;
                Package package = find_package_for_file (source_file);
index 3b6af658ef72ddf6d57e89426e5a574118c2506f..64b5ac6bcad3dd6796d96d30f846e383abd81700 100644 (file)
@@ -174,7 +174,7 @@ public class Valadoc.Api.TypeReference : Item {
                }
        }
 
-       protected override void resolve_type_references (Tree root) {
+       internal override void resolve_type_references (Tree root) {
                if ( this.vtyperef is Vala.PointerType) {
                        this.data_type = new Pointer ((Vala.PointerType) this.vtyperef, this);
                } else if (vtyperef is Vala.ArrayType) {
index 1a02499737d248c4ed8728fea8e790bd30be8080..31fb3ee5723ce62fe1f58ad710cd5fade76ca54e 100644 (file)
@@ -41,7 +41,7 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
                }
        }
 
-       protected override void process_comments (Settings settings, DocumentationParser parser) {
+       internal override void process_comments (Settings settings, DocumentationParser parser) {
                var source_comment = ((Vala.TypeSymbol) symbol).comment;
                if (source_comment != null) {
                        documentation = parser.parse (this, source_comment);
index c6a555e72ea4e83c39810ada6898965a0d47be69..d9d3e4bf44a48aab13a05c27eb80d74dfece919e 100755 (executable)
@@ -34,9 +34,9 @@ public abstract class Valadoc.Content.BlockContent : ContentElement {
        public override void configure (Settings settings, ResourceLocator locator) {
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                foreach (Block element in _content) {
-                       element.check (api_root, container, reporter);
+                       element.check (api_root, container, reporter, settings);
                }
        }
 
index d98947698b7d07c30c97bfcbb89006d7f744dadf..0a49cc39fa7417c1da25f60278361d7b7c241e15 100755 (executable)
@@ -36,11 +36,11 @@ public class Valadoc.Content.Comment : BlockContent {
        public override void configure (Settings settings, ResourceLocator locator) {
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
-               base.check (api_root, container, reporter);
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
+               base.check (api_root, container, reporter, settings);
 
                foreach (Taglet element in _taglets) {
-                       element.check (api_root, container, reporter);
+                       element.check (api_root, container, reporter, settings);
                }
        }
 
index fd455711f619868dcfd494522e8ef6621c8aacff..323fb4794a3b25efa3da58c1ed5718d0d6d49dd7 100755 (executable)
@@ -92,7 +92,7 @@ public class Valadoc.Content.ContentFactory : Object {
                return (TableRow) configure (new TableRow ());
        }
 
-       public Taglet create_taglet (string name) {
+       public Taglet? create_taglet (string name) {
                return _modules.create_taglet (name);
        }
 
index 882fb4bf3b56279a8d4b4b3c7e650dacfc96f6d0..fd040d31f959755dbef5aceb2d506312d5e5a93a 100755 (executable)
@@ -30,6 +30,7 @@ public class Valadoc.Content.Embedded : ContentElement, Inline, StyleAttributes
        public HorizontalAlign? horizontal_align { get; set; }
        public VerticalAlign? vertical_align { get; set; }
        public string? style { get; set; }
+       public Api.Package package;
 
        private ResourceLocator _locator;
 
@@ -41,8 +42,12 @@ public class Valadoc.Content.Embedded : ContentElement, Inline, StyleAttributes
                _locator = locator;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
-               // Check the image exists if it a local resource
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
+               if (!FileUtils.test (url, FileTest.EXISTS | FileTest.IS_REGULAR)) {
+                       reporter.simple_error ("%s does not exist".printf (url));
+               } else {
+                       package = container.package;
+               }
        }
 
        public override void accept (ContentVisitor visitor) {
index c8e13a6f4fb818b555747f8f008bdeea63bedbcb..60844dbcd0e82ad39dafea25e29d06cf634cf3c7 100755 (executable)
@@ -31,11 +31,12 @@ public class Valadoc.Content.Headline : Block, InlineContent {
                _level = 0;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // TODO report error if level == 0 ?
+               // TODO: content.size == 0?
 
                // Check inline content
-               base.check (api_root, container, reporter);
+               base.check (api_root, container, reporter, settings);
        }
 
        public override void accept (ContentVisitor visitor) {
index 34c75533c5cda3b4a63db5d50e4abea0275f31cf..687331419f647a516368a889a8ee488d9c371abf 100755 (executable)
@@ -35,9 +35,9 @@ public abstract class Valadoc.Content.InlineContent : ContentElement {
        internal InlineContent () {
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                foreach (Inline element in _content) {
-                       element.check (api_root, container, reporter);
+                       element.check (api_root, container, reporter, settings);
                }
        }
 
index 8a28e1cd8b533c8411332a0d3f9a7d7f4617b105..32df022b9432a59966f44ed5cb2f2220377fa081 100755 (executable)
@@ -34,6 +34,8 @@ public abstract class Valadoc.Content.InlineTaglet : ContentElement, Taglet, Inl
 
        public abstract Rule? get_parser_rule (Rule run_rule);
 
+       public abstract void xml_importer_parer_rule (Xml.DocumentationImporter importer);
+
        public abstract ContentElement produce_content ();
 
        private ContentElement get_content () {
@@ -48,9 +50,9 @@ public abstract class Valadoc.Content.InlineTaglet : ContentElement, Taglet, Inl
                this.locator = locator;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                ContentElement element = get_content ();
-               element.check (api_root, container, reporter);
+               element.check (api_root, container, reporter, settings);
        }
 
        public override void accept (ContentVisitor visitor) {
index fa8da9a024bbedfcbfd20dc16c2492a2b37980d7..21658e71fc957292129be3715020e891a009f7d8 100755 (executable)
@@ -33,7 +33,8 @@ public class Valadoc.Content.Link : InlineContent, Inline {
        public override void configure (Settings settings, ResourceLocator locator) {
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
+               //TODO: check url
        }
 
        public override void accept (ContentVisitor visitor) {
index 4170a43291ed543d4c60a4d898411ed7bd37bcf0..9c6cb7faae9e7c7fb0e7d31231d2b9bedc3f1f07 100755 (executable)
@@ -32,7 +32,68 @@ public class Valadoc.Content.List : ContentElement, Block {
                ORDERED_LOWER_CASE_ALPHA,
                ORDERED_UPPER_CASE_ALPHA,
                ORDERED_LOWER_CASE_ROMAN,
-               ORDERED_UPPER_CASE_ROMAN
+               ORDERED_UPPER_CASE_ROMAN;
+
+               public static Bullet? from_string (string? str) {
+                       switch (str) {
+                       case "none":
+                               return Bullet.NONE;
+
+                       case "unordered":
+                               return Bullet.UNORDERED;
+
+                       case "ordered":
+                               return Bullet.ORDERED;
+
+                       case "ordered-number":
+                               return Bullet.ORDERED_NUMBER;
+
+                       case "ordered-lower-case-alpa":
+                               return Bullet.ORDERED_LOWER_CASE_ALPHA;
+
+                       case "ordered-upper-case-alpha":
+                               return Bullet.ORDERED_UPPER_CASE_ALPHA;
+
+                       case "ordered-lower-case-roman":
+                               return Bullet.ORDERED_LOWER_CASE_ROMAN;
+
+                       case "ordered-upper-case-roman":
+                               return Bullet.ORDERED_UPPER_CASE_ROMAN;
+                       }
+
+                       return null;
+               }
+
+               public weak string to_string () {
+                       switch (this) {
+                       case Bullet.NONE:
+                               return "none";
+
+                       case Bullet.UNORDERED:
+                               return "unordered";
+
+                       case Bullet.ORDERED:
+                               return "ordered";
+
+                       case Bullet.ORDERED_NUMBER:
+                               return "ordered-number";
+
+                       case Bullet.ORDERED_LOWER_CASE_ALPHA:
+                               return "ordered-lower-case-alpa";
+
+                       case Bullet.ORDERED_UPPER_CASE_ALPHA:
+                               return "ordered-upper-case-alpha";
+
+                       case Bullet.ORDERED_LOWER_CASE_ROMAN:
+                               return "ordered-lower-case-roman";
+
+                       case Bullet.ORDERED_UPPER_CASE_ROMAN:
+                               return "ordered-upper-case-roman";
+                       }
+
+                       assert (true);
+                       return "";
+               }
        }
 
        public Bullet bullet { get; set; }
@@ -47,10 +108,10 @@ public class Valadoc.Content.List : ContentElement, Block {
                _items = new ArrayList<ListItem> ();
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check individual list items
                foreach (ListItem element in _items) {
-                       element.check (api_root, container, reporter);
+                       element.check (api_root, container, reporter, settings);
                }
        }
 
index 8a2c6f9f9210ba422d336becc9aada55e88e2935..56f13ddf5b1a3e11891425a479fb45022dfb5113 100755 (executable)
@@ -30,12 +30,12 @@ public class Valadoc.Content.ListItem : InlineContent {
                base ();
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check inline content
-               base.check (api_root, container, reporter);
+               base.check (api_root, container, reporter, settings);
 
                if (sub_list != null) {
-                       sub_list.check (api_root, container, reporter);
+                       sub_list.check (api_root, container, reporter, settings);
                }
        }
 
index baf1578ccb5b535a2a966bbc51f2f099c812df37..12bded1cb4dc092ef5b427f61b49091f40af2927 100755 (executable)
@@ -32,9 +32,9 @@ public class Valadoc.Content.Paragraph : InlineContent, Block, StyleAttributes {
                base ();
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check inline content
-               base.check (api_root, container, reporter);
+               base.check (api_root, container, reporter, settings);
        }
 
        public override void accept (ContentVisitor visitor) {
index cc6072ce0d9cfda8237437209631a5d6ba502820..17a6809c45c2fe0d4fb111f517450b4f20c90f39 100755 (executable)
@@ -34,7 +34,80 @@ public class Valadoc.Content.Run : InlineContent, Inline {
                LANG_KEYWORD,
                LANG_LITERAL,
                LANG_BASIC_TYPE,
-               LANG_TYPE
+               LANG_TYPE;
+
+               public static Style? from_string (string str) {
+                       switch (str) {
+                       case "none":
+                               return Style.NONE;
+
+                       case "bold":
+                               return Style.BOLD;
+
+                       case "italic":
+                               return Style.ITALIC;
+
+                       case "underlined":
+                               return Style.UNDERLINED;
+
+                       case "monospaced":
+                               return Style.MONOSPACED;        
+
+                       case "stroke":
+                               return Style.STROKE;
+
+                       case "lang-keyword":
+                               return Style.LANG_KEYWORD;
+
+                       case "lang-literal":
+                               return Style.LANG_LITERAL;
+
+                       case "lang-basic-type":
+                               return Style.LANG_BASIC_TYPE;
+
+                       case "lang-type":
+                               return Style.LANG_TYPE;
+                       }
+
+                       return null;
+               }
+
+               public weak string to_string () {
+                       switch (this) {
+                       case Style.NONE:
+                               return "none";
+
+                       case Style.BOLD:
+                               return "bold";
+
+                       case Style.ITALIC:
+                               return "italic";
+
+                       case Style.UNDERLINED:
+                               return "underlined";
+
+                       case Style.MONOSPACED:
+                               return "monopace";
+
+                       case Style.STROKE:
+                               return "stroke";
+
+                       case Style.LANG_KEYWORD:
+                               return "lang-keyword";
+
+                       case Style.LANG_LITERAL:
+                               return "lang-literal";
+
+                       case Style.LANG_BASIC_TYPE:
+                               return "lang-basic-type";
+
+                       case Style.LANG_TYPE:
+                               return "lang-type";
+                       }
+
+                       assert (true);
+                       return "";
+               }
        }
 
        public Style style { get; set; }
@@ -44,9 +117,9 @@ public class Valadoc.Content.Run : InlineContent, Inline {
                _style = style;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check inline content
-               base.check (api_root, container, reporter);
+               base.check (api_root, container, reporter, settings);
        }
 
        public override void accept (ContentVisitor visitor) {
index 18a3f395ff1c7420a6c564b8186a94a4243e66f5..c10e7c461a34533ad9be7e9b804ed477c95509c9 100755 (executable)
@@ -26,7 +26,34 @@ public class Valadoc.Content.SourceCode : ContentElement, Inline{
        public enum Language {
                GENIE,
                VALA,
-               C
+               C;
+
+               public static Language? from_string (string str) {
+                       switch (str) {
+                       case "Genie":
+                               return Language.GENIE;
+                       case "Vala":
+                               return Language.VALA;
+                       case "C":
+                               return Language.C;
+                       }
+
+                       return null;
+               }
+
+               public weak string to_string () {
+                       switch (this) {
+                       case Language.GENIE:
+                               return "Genie";
+                       case Language.VALA:
+                               return "Vala";
+                       case Language.C:
+                               return "C";
+                       }
+
+                       assert (true);
+                       return "";
+               }
        }
 
        public string code { get; set; }
@@ -37,7 +64,7 @@ public class Valadoc.Content.SourceCode : ContentElement, Inline{
                _language = Language.VALA;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
        }
 
        public override void accept (ContentVisitor visitor) {
index 2c9fda2f61f81d6eb4ad19aadca03b827b087a42..265f44452de97fdb61fbceb580d03cf88220cfc6 100755 (executable)
@@ -26,13 +26,75 @@ using Gee;
 public enum Valadoc.Content.HorizontalAlign {
        LEFT,
        RIGHT,
-       CENTER
+       CENTER;
+
+       public static HorizontalAlign? from_string (string str) {
+               switch (str) {
+               case "left":
+                       return HorizontalAlign.LEFT;
+
+               case "right":
+                       return HorizontalAlign.RIGHT;
+
+               case "center":
+                       return HorizontalAlign.CENTER;
+               }
+
+               return null;
+       }
+
+       public weak string to_string () {
+               switch (this) {
+               case HorizontalAlign.LEFT:
+                       return "left";
+
+               case HorizontalAlign.RIGHT:
+                       return "right";
+
+               case HorizontalAlign.CENTER:
+                       return "center";
+               }
+
+               assert (true);
+               return "";
+       }
 }
 
 public enum Valadoc.Content.VerticalAlign {
        TOP,
        MIDDLE,
-       BOTTOM
+       BOTTOM;
+
+       public static VerticalAlign? from_string (string str) {
+               switch (str) {
+               case "top":
+                       return VerticalAlign.TOP;
+
+               case "middle":
+                       return VerticalAlign.MIDDLE;
+
+               case "bottom":
+                       return VerticalAlign.BOTTOM;
+               }
+
+               return null;
+       }
+
+       public weak string to_string () {
+               switch (this) {
+               case VerticalAlign.TOP:
+                       return "top";
+
+               case VerticalAlign.MIDDLE:
+                       return "middle";
+
+               case VerticalAlign.BOTTOM:
+                       return "bottom";
+               }
+
+               assert (true);
+               return "";
+       }
 }
 
 public interface Valadoc.Content.StyleAttributes : ContentElement {
index b4764840e0ef094ce2794200bf5784a98c5abe67..5dd1d0913786fd6758e78e7045042d41b880a1ca 100755 (executable)
@@ -36,7 +36,7 @@ public class Valadoc.Content.SymbolLink : ContentElement, Inline {
        public override void configure (Settings settings, ResourceLocator locator) {
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
        }
 
        public override void accept (ContentVisitor visitor) {
index 608f21f1a6785146c9aa762011abbb21530cfd43..45828fa8a2f27ccc765bcf39213da75488999ce8 100755 (executable)
@@ -33,12 +33,12 @@ public class Valadoc.Content.Table : ContentElement, Block {
                _rows = new ArrayList<TableRow> ();
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check the table consistency in term of row/column number
 
                // Check individual rows
                foreach (var row in _rows) {
-                       row.check (api_root, container, reporter);
+                       row.check (api_root, container, reporter, settings);
                }
        }
 
index 307a5db496712dbc4d3782bf90967b868f47811c..1987520a7b876e685cfa1073cc7460970dbaca54 100755 (executable)
@@ -36,9 +36,9 @@ public class Valadoc.Content.TableCell : InlineContent, StyleAttributes {
                _rowspan = 1;
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check inline content
-               base.check (api_root, container, reporter);
+               base.check (api_root, container, reporter, settings);
        }
 
        public override void accept (ContentVisitor visitor) {
index 89ea5018c896f6272e23d384e6aace5cd7b17196..a4835defbbbc82d103468db30a957f27680b48db 100755 (executable)
@@ -33,10 +33,10 @@ public class Valadoc.Content.TableRow : ContentElement {
                _cells = new ArrayList<TableCell> ();
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
                // Check individual cells
                foreach (var cell in _cells) {
-                       cell.check (api_root, container, reporter);
+                       cell.check (api_root, container, reporter, settings);
                }
        }
 
index 6bac616fd3232528eb120c81712c81d77223bb15..7609696533d5b391d95ed9f73d3a7d52d302cdb5 100755 (executable)
@@ -36,7 +36,7 @@ public class Valadoc.Content.Text : ContentElement, Inline {
                }
        }
 
-       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter) {
+       public override void check (Api.Tree api_root, Api.Node? container, ErrorReporter reporter, Settings settings) {
        }
 
        public override void accept (ContentVisitor visitor) {
index a08565fa538ccd7a299a5dabc4c052103d7012f1..dc72cde4af0d382209b9cc86ae86c27333b26ae9 100755 (executable)
@@ -22,7 +22,8 @@
 
 using Gee;
 
-public static delegate Type Valadoc.DocletRegisterFunction ( );
+[CCode (has_target = false)]
+public delegate Type Valadoc.DocletRegisterFunction ( );
 
 public interface Valadoc.Doclet : GLib.Object {
        public abstract void process (Settings settings, Api.Tree tree);
index 7450f83fe32c86667269fe20e1302aef947f54ea..869c5e0f0cc73dcb61d85146419d8e59f83c1331 100644 (file)
@@ -64,14 +64,14 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator {
                var source_ref = source_comment.source_reference;
                try {
                        Comment doc_comment = parse_comment (content, source_ref.file.filename, source_ref.first_line, source_ref.first_column);
-                       doc_comment.check (_tree, element, _reporter);
+                       doc_comment.check (_tree, element, _reporter, _settings);
                        return doc_comment;
                } catch (ParserError error) {
                        return null;
                }
        }
 
-       public Page? parse_wikipage (WikiPage page) {
+       public Page? parse_wikipage (WikiPage page, Api.Package pkg) {
                if (page.documentation != null) {
                        return page.documentation;
                }
@@ -82,7 +82,7 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator {
 
                try {
                        Page documentation = parse_wiki (page.documentation_str, page.get_filename ());
-                       documentation.check (_tree, null, _reporter);
+                       documentation.check (_tree, pkg, _reporter, _settings);
                        return documentation;
                } catch (ParserError error) {
                        return null;
index 6fd39543821d511635642a08eeda00474d25aa95..d79383cfb19247ba121972e2ff87cb7c3ffb42ee 100755 (executable)
@@ -62,8 +62,8 @@ public class Valadoc.WikiPage : Object, Documentation {
                }
        }
 
-       public bool parse (DocumentationParser docparser) {
-               documentation = docparser.parse_wikipage ( this );
+       public bool parse (DocumentationParser docparser, Api.Package pkg) {
+               documentation = docparser.parse_wikipage (this, pkg);
                return true;
        }
 }
@@ -74,6 +74,7 @@ public class Valadoc.WikiPageTree : Object {
        private ErrorReporter reporter;
        private Settings settings;
 
+       //TODO: reporter, settings -> create_tree
        public WikiPageTree (ErrorReporter reporter, Settings settings) {
                this.reporter = reporter;
                this.settings = settings;
@@ -111,7 +112,7 @@ public class Valadoc.WikiPageTree : Object {
                }
        }
 
-       public void create_tree (DocumentationParser docparser) throws GLib.FileError {
+       public void create_tree (DocumentationParser docparser, Api.Package pkg) throws GLib.FileError {
                try {
                        weak string path = this.settings.wiki_directory;
                        if (path == null) {
@@ -122,7 +123,7 @@ public class Valadoc.WikiPageTree : Object {
                        this.create_tree_from_path (docparser, path);
 
                        foreach (WikiPage page in this.wikipages) {
-                               page.parse (docparser);
+                               page.parse (docparser, pkg);
                        }
                }
                catch (FileError err) {
index a98345b24218eb432faa8849f143a6f822d048b9..a7de0695ddc8cf9d048c84ba205156621e018654 100755 (executable)
@@ -24,7 +24,7 @@ using Valadoc.Content;
 using Valadoc.Api;
 
 public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
-       protected Settings settings;
+       public Settings settings { protected set; get; }
        protected HtmlRenderer _renderer;
        protected Html.MarkupWriter writer;
 
@@ -294,14 +294,14 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 
        protected bool is_internal_node (Api.Node node) {
                return node is Package
-                      || node is Namespace
-                      || node is Interface
-                      || node is Class
-                      || node is Struct
-                      || node is Enum
+                      || node is Api.Namespace
+                      || node is Api.Interface
+                      || node is Api.Class
+                      || node is Api.Struct
+                      || node is Api.Enum
                       || node is Api.EnumValue
-                      || node is ErrorDomain
-                      || node is ErrorCode;
+                      || node is Api.ErrorDomain
+                      || node is Api.ErrorCode;
        }
 
        public void write_navi_packages_inline (Api.Tree tree) {
@@ -345,12 +345,12 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                writer.end_tag ("div");
        }
 
-       public void write_symbol_content (Api.Node node) {
+       public void write_symbol_content (Api.Node node, string image_path_prefix = "") {
                string full_name = node.full_name ();
                writer.start_tag ("div", {"class", css_style_content});
                writer.start_tag ("h1", {"class", css_title, full_name}).text (node.name).end_tag ("h1");
                writer.simple_tag ("hr", {"class", css_headline_hr});
-               this.write_image_block (node);
+               this.write_image_block (node, image_path_prefix);
                writer.start_tag ("h2", {"class", css_title}).text ("Description:").end_tag ("h2");
                writer.start_tag ("div", {"class", css_code_definition});
                this.write_signature (node, node);
@@ -362,6 +362,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                        this.write_namespace_note (node);
                        this.write_package_note (node);
                }
+
                if (node.has_children ({
                                Api.NodeType.ERROR_CODE,
                                Api.NodeType.ENUM_VALUE,
@@ -490,13 +491,16 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                }
        }
 
-       protected void write_image_block (Api.Node element) {
+       protected void write_image_block (Api.Node element, string path_prefix = "") {
                if (!(element is Class || element is Interface || element is Struct)) {
                        return;
                }
 
                string realimgpath = this.get_img_real_path (element);
                string imgpath = this.get_img_path (element);
+               if (path_prefix != null) {
+                       imgpath = Path.build_filename (path_prefix, imgpath);
+               }
 
                if (element is Class) {
                        Diagrams.write_class_diagram ((Class)element, realimgpath);
index 519e60f3470a4fd1d0733a65f435a8f474e32285..c4b82dee393eeefa309b1621ba2d4e949324ccd6 100755 (executable)
@@ -124,37 +124,37 @@ namespace Valadoc.Html {
        }
 
        public string get_html_css_class (Valadoc.Api.Item element) {
-               if ( element is Namespace ) {
+               if ( element is Api.Namespace ) {
                        return css_namespace;
                }
-               else if ( element is Struct ) {
+               else if ( element is Api.Struct ) {
                        return css_struct;
                }
-               else if ( element is Interface ) {
+               else if ( element is Api.Interface ) {
                        return css_interface;
                }
-               else if ( element is Class ) {
+               else if ( element is Api.Class ) {
                        return (((Class)element).is_abstract)? css_abstract_class : css_class;
                }
-               else if ( element is Enum ) {
+               else if ( element is Api.Enum ) {
                        return css_enum;
                }
-               else if ( element is ErrorDomain ) {
+               else if ( element is Api.ErrorDomain ) {
                        return css_errordomain;
                }
-               else if ( element is Delegate ) {
+               else if ( element is Api.Delegate ) {
                        return css_delegate;
                }
-               else if ( element is Method ) {
-                       if ( ((Method)element).is_static )
+               else if ( element is Api.Method ) {
+                       if ( ((Api.Method)element).is_static )
                                return css_static_method;
-                       else if ( ((Method)element).is_static )
+                       else if ( ((Api.Method)element).is_static )
                                return css_static_method;
-                       else if ( ((Method)element).is_constructor )
+                       else if ( ((Api.Method)element).is_constructor )
                                return css_creation_method;
-                       else if ( ((Method)element).is_abstract )
+                       else if ( ((Api.Method)element).is_abstract )
                                return css_abstract_method;
-                       else if ( ((Method)element).is_virtual || ((Method)element).is_override )
+                       else if ( ((Api.Method)element).is_virtual || ((Api.Method)element).is_override )
                                return css_virtual_method;
                        else
                                return css_method;
@@ -162,27 +162,27 @@ namespace Valadoc.Html {
                else if ( element is Api.Signal ) {
                        return css_signal;
                }
-               else if ( element is Property ) {
-                       if ( ((Property)element).is_virtual || ((Property)element).is_override )
+               else if ( element is Api.Property ) {
+                       if ( ((Api.Property)element).is_virtual || ((Property)element).is_override )
                                return css_virtual_property;
-                       else if ( ((Property)element).is_abstract )
+                       else if ( ((Api.Property)element).is_abstract )
                                return css_abstract_property;
                        else
                                return css_property;
                }
-               else if ( element is Field ) {
+               else if ( element is Api.Field ) {
                        return css_field;
                }
-               else if ( element is Constant ) {
+               else if ( element is Api.Constant ) {
                        return css_constant;
                }
                else if ( element is Api.EnumValue ) {
                        return css_enumvalue;
                }
-               else if ( element is ErrorCode ) {
+               else if ( element is Api.ErrorCode ) {
                        return css_errorcode;
                }
-               else if ( element is Package ) {
+               else if ( element is Api.Package ) {
                        return css_package;
                }
                return "";
index 2351ea751b781660280edbdbd6ff0829e652c12e..e48865d61be0d786634c6b079be557871449aff4 100755 (executable)
@@ -35,6 +35,7 @@ public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
                } else {
                        start_tag ("a", {"href", url, "class", css_class});
                }
+
                text (label);
                end_tag ("a");
                return this;
index 306b9338b407a82e4778ec36206547c197dae572..9af34132f07f6c30d13556feff9bb258a5c623c3 100755 (executable)
@@ -25,9 +25,9 @@ using Valadoc.Content;
 
 public class Valadoc.Html.HtmlRenderer : ContentRenderer {
 
-       private BasicDoclet _doclet;
-       private Documentation? _container;
-       private unowned MarkupWriter writer;
+       protected BasicDoclet _doclet;
+       protected Documentation? _container;
+       protected unowned MarkupWriter writer;
 
        public HtmlRenderer (BasicDoclet doclet) {
                _doclet = doclet;
@@ -53,7 +53,7 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
                return get_html_link (_doclet.settings, symbol, _container);
        }
 
-       private void write_symbol_link (Api.Node symbol, string label) {
+       private void write_symbol_link (Api.Node symbol, string? label) {
                var url = get_url (symbol);
                writer.link (url,
                             (label == null || label == "") ? symbol.full_name () : label,
@@ -200,7 +200,13 @@ public class Valadoc.Html.HtmlRenderer : ContentRenderer {
 
        public override void visit_embedded (Embedded element) {
                var caption = element.caption;
-               writer.image (element.url, (caption == null || caption == "") ? "" : caption);
+
+               var absolute_path = Path.build_filename (_doclet.settings.path, element.package.name, "img", Path.get_basename (element.url));
+               var relative_path = Path.build_filename ("img", Path.get_basename (element.url));
+
+               copy_file (element.url, absolute_path);
+
+               writer.image (relative_path, (caption == null || caption == "") ? "" : caption);
        }
 
        public override void visit_headline (Headline element) {
index 2faa546c50732839818e993c2df7767a51f18b76..963f1258c527ffcbaa0d1897a34d45bcacaad35a 100755 (executable)
@@ -24,7 +24,8 @@ using GLib.Path;
 using Gee;
 
 
-public static delegate  void Valadoc.TagletRegisterFunction (ModuleLoader loader);
+[CCode (has_target = false)]
+public delegate  void Valadoc.TagletRegisterFunction (ModuleLoader loader);
 
 
 public class Valadoc.ModuleLoader : Object {
@@ -43,8 +44,8 @@ public class Valadoc.ModuleLoader : Object {
                return true;
        }
 
-       public Content.Taglet create_taglet (string keyword) {
-               return (Content.Taglet) GLib.Object.new (taglets.get (keyword));
+       public Content.Taglet? create_taglet (string keyword) {
+               return (taglets.has_key (keyword))? (Content.Taglet) GLib.Object.new (taglets.get (keyword)) : null;
        }
 
        private bool load_doclet (string path) {
index 8cc5e94647f18f4c48d4d5bf7363b8e28c39832b..58d367020525a2bb7060821f1fe5b964cf69e31a 100755 (executable)
@@ -45,6 +45,7 @@ public class Valadoc.Settings : Object {
 
        public string[] defines;
        public string[] vapi_directories;
+       public string[] docu_directories;
 }
 
 
index 9f6ad65724fdff186d7e92d4f46a87ac7759aa31..672e82acde2ff7554999be7e5c9e5706f0a3e069 100755 (executable)
@@ -53,6 +53,8 @@ public class ValaDoc : Object {
        private static bool disable_dbus_transformation;
        private static string profile;
 
+       [CCode (array_length = false, array_null_terminated = true)]
+       private static string[] docu_directories;
        [CCode (array_length = false, array_null_terminated = true)]
        private static string[] vapi_directories;
        [CCode (array_length = false, array_null_terminated = true)]
@@ -69,6 +71,7 @@ public class ValaDoc : Object {
                { "enable-experimental-non-null", 0, 0, OptionArg.NONE, ref experimental_non_null, "Enable experimental enhancements for non-null types", null },
                { "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
                { "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, ref vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..." },
+               { "docudir", 0, 0, OptionArg.FILENAME_ARRAY, ref docu_directories, "Look for external documentation in DIRECTORY", "DIRECTORY..." },
                { "profile", 0, 0, OptionArg.STRING, ref profile, "Use the given profile instead of the default", "PROFILE" },
 
 
@@ -149,6 +152,7 @@ public class ValaDoc : Object {
                settings.basedir = basedir;
                settings.directory = directory;
                settings.vapi_directories = vapi_directories;
+               settings.docu_directories = docu_directories;
 
                settings.profile = profile;
                settings.defines = defines;
@@ -184,27 +188,31 @@ public class ValaDoc : Object {
 
                Valadoc.Api.Tree doctree = new Valadoc.Api.Tree (reporter, settings);
                Valadoc.DocumentationParser docparser = new Valadoc.DocumentationParser (settings, reporter, doctree, modules);
-               if (reporter.errors > 0) {
-                       return quit (reporter);
-               }
+               Valadoc.DocumentationImporter importer = new Valadoc.Xml.DocumentationImporter (doctree, modules, settings, reporter);
 
                doctree.add_depencies (packages);
                if (reporter.errors > 0) {
                        return quit (reporter);
                }
 
-
                doctree.add_documented_file (tsources);
                if (reporter.errors > 0) {
                        return quit (reporter);
                }
 
-               if (!doctree.create_tree())
+               if (!doctree.create_tree()) {
                        return quit (reporter);
+               }
 
                doctree.parse_comments (docparser);
-               if (reporter.errors > 0)
+               if (reporter.errors > 0) {
+                       return quit (reporter);
+               }
+
+               doctree.import_documentation (importer);
+               if (reporter.errors > 0) {
                        return quit (reporter);
+               }
 
                modules.doclet.process (settings, doctree);
                return quit (reporter);