]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc/vapi: index for sub-classes / required classes / implementing classes...
authorFlorian Brosch <flo.brosch@gmail.com>
Fri, 19 Feb 2010 01:33:50 +0000 (02:33 +0100)
committerFlorian Brosch <flo.brosch@gmail.com>
Fri, 19 Feb 2010 01:33:50 +0000 (02:33 +0100)
libvaladoc/html: provides new indexed information (Bug #599960)

18 files changed:
icons/Makefile.am
icons/coll_close.png [new file with mode: 0644]
icons/coll_open.png [new file with mode: 0644]
icons/scripts.js [new file with mode: 0644]
icons/style.css
src/doclets/devhelp/Makefile.am
src/doclets/devhelp/doclet.vala
src/doclets/htm/doclet.vala
src/doclets/valadoc.org/doclet.vala
src/libvaladoc/api/class.vala
src/libvaladoc/api/interface.vala
src/libvaladoc/api/item.vala
src/libvaladoc/api/node.vala
src/libvaladoc/api/tree.vala
src/libvaladoc/html/basicdoclet.vala
src/libvaladoc/html/globals.vala
src/libvaladoc/html/htmlmarkupwriter.vala
src/vapi/libgvc.vapi

index 5dd768a3f7f01df3dfc3f9866247ee5d41003c11..5869bff058414e3df4c4eb4c7960a423540dc63b 100644 (file)
@@ -4,7 +4,7 @@ NULL =
 iconsdir = $(datadir)/valadoc/icons
 
 
-dist_icons_DATA =         \
+dist_icons_DATA =        \
        warning.png          \
        abstractclass.png    \
        abstractmethod.png   \
@@ -32,6 +32,9 @@ dist_icons_DATA =         \
        constructor.png      \
        virtualmethod.png    \
        virtualproperty.png  \
+       scripts.js           \
+       coll_close.png       \
+       coll_open.png        \
        $(NULL)
 
 
diff --git a/icons/coll_close.png b/icons/coll_close.png
new file mode 100644 (file)
index 0000000..948573a
Binary files /dev/null and b/icons/coll_close.png differ
diff --git a/icons/coll_open.png b/icons/coll_open.png
new file mode 100644 (file)
index 0000000..d2124a2
Binary files /dev/null and b/icons/coll_open.png differ
diff --git a/icons/scripts.js b/icons/scripts.js
new file mode 100644 (file)
index 0000000..eb79093
--- /dev/null
@@ -0,0 +1,46 @@
+/* markupwriter.vala
+ *
+ * Copyright (C) 2008-2009 Florian Brosch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ *
+ * Author:
+ *     Florian Brosch <flo.brosch@gmail.com>
+ */
+
+function get_path (path) {
+       var pos = path.lastIndexOf ('/');
+       if (pos < 0) {
+               return '';
+       }
+
+       return path.substring (pos, -1) + '/';
+}
+
+function toggle_box (self, id) {
+       var element = document.getElementById (id);
+       if (element == null) {
+               return ;
+       }
+
+       if (element.style.display == 'block') {
+               element.style.display = 'none';
+               self.src = get_path (self.src) + 'coll_open.png';
+       } else {
+               element.style.display = 'block';
+               self.src = get_path (self.src) + 'coll_close.png';
+       }
+}
+
index 3124d44a742e12ba2b932ccf3d494be946662c35..f0248a84d2fd35fd14da1c28314eb33ebb8bc2cd 100644 (file)
@@ -302,7 +302,7 @@ h3.main_title {
        background-position:center right;
        border:0px;
 }
-.description a.abstract_class, .brief_description a.abstract_class {
+a.abstract_class, .description a.abstract_class, .brief_description a.abstract_class {
        background-image:url(abstractclass.png);
        display:inline-block;
        padding-right:17px;
@@ -351,7 +351,7 @@ h3.main_title {
        background-position:center right;
        border:0px;
 }
-.description a.virtual_method, .brief_description a.virtual_method {
+a.virtual_method, .description a.virtual_method, .brief_description a.virtual_method {
        background-image:url(virtualmethod.png);
        display:inline-block;
        padding-right:17px;
@@ -466,8 +466,7 @@ h3.main_title {
 
 
 
-.navi_main a, .navi_inline a,
-a.external_link
+.navi_main a, .navi_inline a, a.external_link
 {
        text-decoration: none;
        color:  #214b87;
@@ -485,7 +484,6 @@ ul.no_bullet > li {
        list-style-type: none;
 }
 
-
 .main_see_list {
 }
 
@@ -496,13 +494,50 @@ ul.no_bullet > li {
        font: monospace;
        color: #ff01ff;
 }
-
 .main_code_definition a, .leaf_code_definition a {
        text-decoration: none;
        color: inherit;
 }
-
 .main_code_definition a:hover, .leaf_code_definition a:hover {
        text-decoration: underline;
 }
 
+
+.box {
+}
+.box .headline {
+       background-color: #eeeeff;
+       border-color: #aaaaff;
+       border-style: solid;
+       border-width: 1px;
+       margin: auto;
+       width: 90%;
+       margin-top: 20px;
+}
+.box .text {
+       font-weight: bold;  
+       float: left;
+}
+.box .toggle {
+       text-align: right;
+       float: clear;
+}
+.box .content {
+       border-color: #aaaaff;
+       border-width: 0 1 1 1;
+       border-style: solid;
+       overflow: auto;
+       display: none;
+       margin: auto;
+       width: 90%;
+}
+.box .column {
+       float: left;
+       width: 33%;
+}
+
+.namespace_note {
+}
+.package_note {
+}
+
index 6fb7847cd92922778ea4db5f5582968c843c3d49..8527e11f32dd702b85d250bf2f1fa98f8b2e2471 100644 (file)
@@ -37,7 +37,7 @@ libdoclet_la_SOURCES =      \
 
 
 libdoclet.vala.stamp: $(libdoclet_la_VALASOURCES)
-       $(VALAC) -C --vapidir $(top_srcdir)/src/vapi --vapidir $(top_srcdir)/src/vapi/libvaladoc --pkg vala-1.0 --pkg gee-1.0 --pkg valadoc-1.0 --basedir . $^
+       $(VALAC) -C --vapidir $(top_srcdir)/src/vapi --vapidir $(top_srcdir)/src/libvaladoc --pkg vala-1.0 --pkg gee-1.0 --pkg valadoc-1.0 --basedir . $^
        touch $@
 
 
index f67dc249a7f4bc481c83b8dbe4910e900a92ba98..6dfef1552a7a918954e963f7bbc3113830127278 100755 (executable)
@@ -108,6 +108,10 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
        private const string css_path_wiki = "../devhelpstyle.css";
        private const string css_path = "devhelpstyle.css";
 
+       private const string js_path_wiki = "../scripts.js";
+       private const string js_path = "scripts.js";
+
+
        private ArrayList<Api.Node> nodes = new ArrayList<Api.Node> ();
        private string package_dir_name = ""; // remove
        private Api.Tree tree;
@@ -132,7 +136,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 
                DirUtils.create (this.settings.path, 0777);
 
-               write_wiki_pages (tree, css_path_wiki, Path.build_filename (this.settings.path, this.settings.pkg_name, "content"));
+               write_wiki_pages (tree, css_path_wiki, js_path_wiki, Path.build_filename (this.settings.path, this.settings.pkg_name, "content"));
                tree.accept (this);
        }
 
@@ -168,7 +172,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                GLib.FileStream file = GLib.FileStream.open (filepath, "w");
                writer = new Html.MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (this.css_path, pkg_name);
+               write_file_header (this.css_path, this.js_path, pkg_name);
                write_package_content (package, package, wikipage);
                write_file_footer ();
                file = null;
@@ -213,7 +217,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                        GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                        writer = new Html.MarkupWriter (file);
                        _renderer.set_writer (writer);
-                       write_file_header (css_path, node.full_name ());
+                       write_file_header (css_path, js_path, node.full_name ());
                        write_symbol_content (node);
                        write_file_footer ();
                        file = null;
@@ -236,7 +240,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                writer = new Html.MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (css_path, node.full_name());
+               write_file_header (css_path, js_path, node.full_name());
                write_symbol_content (node);
                write_file_footer ();
                file = null;
index 74ccee5f92b2b3c1d85fa90ff30232b6aca71438..aaf2ccb97170f6709ba641eec1cace760bd6e7c3 100755 (executable)
@@ -108,6 +108,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
        private const string css_path_wiki = "../style.css";
        private const string css_path = "../style.css";
 
+
+       private const string js_path_package = "scripts.js";
+       private const string js_path_wiki = "../scripts.js";
+       private const string js_path = "../scripts.js";
+
        construct {
                _renderer = new HtmlRenderer (this);
        }
@@ -122,12 +127,12 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                DirUtils.create (this.settings.path, 0777);
                copy_directory (icons_dir, settings.path);
 
-               write_wiki_pages (tree, css_path_wiki, Path.build_filename(settings.path, "content"));
+               write_wiki_pages (tree, css_path_wiki, js_path_wiki, Path.build_filename(settings.path, "content"));
 
                GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( settings.path, "index.html" ), "w");
                writer = new Html.MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (this.css_path_package, settings.pkg_name);
+               write_file_header (this.css_path_package, this.js_path_package, settings.pkg_name);
                write_navi_packages (tree);
                write_package_index_content (tree);
                write_file_footer ();
@@ -150,7 +155,7 @@ 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, this.js_path, pkg_name);
                write_navi_package (package);
                write_package_content (package, package);
                write_file_footer ();
@@ -166,7 +171,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                        GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                        writer = new Html.MarkupWriter (file);
                        _renderer.set_writer (writer);
-                       write_file_header (this.css_path, ns.full_name ());
+                       write_file_header (this.css_path, this.js_path, ns.full_name ());
                        write_navi_symbol (ns);
                        write_namespace_content (ns, ns);
                        write_file_footer ();
@@ -182,7 +187,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                writer = new Html.MarkupWriter (file);
                _renderer.set_writer (writer);
-               write_file_header (css_path, node.full_name());
+               write_file_header (css_path, js_path, node.full_name());
                if (is_internal_node (node)) {
                        write_navi_symbol (node);
                } else {
index 44268d7e6de5becdd34431c0e0d791aca3d6511d..fb48291e7a04927dacab34063a9b8e52e6026c72 100755 (executable)
@@ -97,9 +97,6 @@ namespace Valadoc.ValadocOrg {
 
 
 public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
-       private const string css_path_wiki = "../../wiki-style.css";
-       private const string css_path = "../reference-style.css";
-
        private ArrayList<Api.Node> nodes = new ArrayList<Api.Node> ();
        private string package_dir_name = ""; // remove
        private Api.Tree tree;
@@ -122,7 +119,7 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
 
                DirUtils.create (this.settings.path, 0777);
 
-               write_wiki_pages (tree, css_path_wiki, Path.build_filename (this.settings.path, this.settings.pkg_name, "content"));
+               write_wiki_pages (tree, "", "", Path.build_filename (this.settings.path, this.settings.pkg_name, "content"));
                tree.accept (this);
        }
 
@@ -136,6 +133,7 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
                string path = GLib.Path.build_filename (this.settings.path, pkg_name);
                string imgpath = GLib.Path.build_filename (path, "img");
 
+               chart_directory = Path.build_filename ("/doc/", pkg_name);
 
                var rt = DirUtils.create (path, 0777);
                rt = DirUtils.create (imgpath, 0777);
@@ -178,7 +176,7 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
                        GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                        writer = new Html.MarkupWriter (file, false);
                        _renderer.set_writer (writer);
-                       write_symbol_content (node, Path.build_filename ("/doc/", node.package.name));
+                       write_symbol_content (node);
                        file = null;
 
 
@@ -204,7 +202,7 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
                GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                writer = new Html.MarkupWriter (file, false);
                _renderer.set_writer (writer);
-               write_symbol_content (node, Path.build_filename ("/doc/", node.package.name));
+               write_symbol_content (node);
                file = null;
 
 
@@ -224,6 +222,14 @@ public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet {
                node.accept_all_children (this);
        }
 
+       protected override void write_wiki_page (WikiPage page, string contentp, string css_path, string js_path, string pkg_name) {
+               GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.ndup(page.name.len()-7).replace ("/", ".")+"wiki.tpl"), "w");
+               writer = new Html.MarkupWriter (file);
+               _renderer.set_writer (writer);
+               _renderer.set_container (page);
+               _renderer.render (page.documentation);
+       }
+
        public override void visit_namespace (Api.Namespace item) {
                process_compound_node (item);
        }
index e3fe29b7d8c8f25ace74c9afa3e1e37ce2691592..37434c2d7b9c76c0abbc436782391140628cb1e7 100644 (file)
@@ -53,6 +53,21 @@ public class Valadoc.Api.Class : TypeSymbol {
                return this.interfaces;
        }
 
+       private Collection<TypeReference> _full_implemented_interfaces = null;
+
+       public Collection<TypeReference> get_full_implemented_interface_list () {
+               if (_full_implemented_interfaces == null) {
+                       _full_implemented_interfaces = new HashSet<TypeReference> ();
+                       _full_implemented_interfaces.add_all (this.interfaces);
+
+                       if (base_type != null) {
+                               _full_implemented_interfaces.add_all (((Class) base_type.data_type).get_full_implemented_interface_list ());
+                       }
+               }
+
+               return _full_implemented_interfaces;
+       }
+
        public bool is_abstract {
                get {
                        return this.vclass.is_abstract;
@@ -82,6 +97,43 @@ public class Valadoc.Api.Class : TypeSymbol {
                }
        }
 
+       private Set<Interface> _known_derived_interfaces = new TreeSet<Interface> ();
+       private Set<Class> _known_child_classes = new TreeSet<Class> ();
+
+       public Collection<Class> get_known_child_classes () {
+               return _known_child_classes.read_only_view;
+       }
+
+       public Collection<Interface> get_known_derived_interfaces () {
+               return _known_derived_interfaces.read_only_view;
+       }
+
+       internal void register_derived_interface (Interface iface) {
+               _known_derived_interfaces.add (iface);
+       }
+
+       internal void register_child_class (Class cl) {
+               if (this.base_type != null) {
+                       ((Class) this.base_type.data_type).register_child_class (cl);
+               }
+
+               _known_child_classes.add (cl);
+       }
+
+       internal override void resolve_children (Tree root) {
+               // base class:
+               if (this.base_type != null)     {
+                       ((Class) this.base_type.data_type).register_child_class (this);
+               }
+
+               // implemented interfaces:
+               foreach (var iface in get_full_implemented_interface_list ()) {
+                       ((Interface) iface.data_type).register_implementation (this);
+               }
+
+               base.resolve_children (root);
+       }
+
        internal override void resolve_type_references (Tree root) {
                var lst = this.vclass.get_base_types ();
                this.set_parent_type_references (root, lst);
index e7bb315ee178945f4808a212e600a338853acc70..c6b68af60150d683be0b3386b4e5ac03276bd4de 100644 (file)
@@ -34,6 +34,22 @@ public class Valadoc.Api.Interface : TypeSymbol {
                return this.interfaces;
        }
 
+
+       private Collection<TypeReference> _full_implemented_interfaces = null;
+
+       public Collection<TypeReference> get_all_implemented_interface_list () {
+               if (_full_implemented_interfaces == null) {
+                       _full_implemented_interfaces = new HashSet<TypeReference> ();
+                       _full_implemented_interfaces.add_all (this.interfaces);
+
+                       if (base_type != null) {
+                               _full_implemented_interfaces.add_all (((Class) base_type.data_type).get_full_implemented_interface_list ());
+                       }
+               }
+
+               return _full_implemented_interfaces;
+       }
+
        public string? get_cname () {
                return ((Vala.Interface) symbol).get_cname ();
        }
@@ -63,6 +79,37 @@ public class Valadoc.Api.Interface : TypeSymbol {
                }
        }
 
+       private Set<Interface> _known_related_interfaces = new TreeSet<Interface> ();
+       private Set<Class> _known_implementations = new TreeSet<Class> ();
+
+       public Collection<Class> get_known_implementations () {
+               return _known_implementations;
+       }
+
+       public Collection<Interface> get_known_related_interfaces () {
+               return _known_related_interfaces;
+       }
+
+       internal void register_related_interface (Interface iface) {
+               _known_related_interfaces.add (iface);
+       }
+
+       internal void register_implementation (Class cl) {
+               _known_implementations.add (cl);
+       }
+
+       internal override void resolve_children (Tree root) {
+               if (base_type != null) {
+                       ((Class) this.base_type.data_type).register_derived_interface (this);
+               }
+
+               foreach (var iface in get_all_implemented_interface_list ()) {
+                       ((Interface) iface.data_type).register_related_interface (this);
+               }
+
+               base.resolve_children (root);
+       }
+
        internal override void resolve_type_references (Tree root) {
                var prerequisites = ((Vala.Interface) symbol).get_prerequisites ();
                this.set_prerequisites (root, prerequisites);
index ecb087a5f0538365d79167677446c16703612fa1..bd4da7b766df7a6f1a1ef362876a1237614f784c 100644 (file)
@@ -31,6 +31,9 @@ public abstract class Valadoc.Api.Item : Object {
        internal virtual void resolve_type_references (Tree root) {
        }
 
+       internal virtual void resolve_children (Tree root) {
+       }
+
        internal virtual void process_comments (Settings settings, DocumentationParser parser) {
        }
 
index 498df4ad06bd2e18a566b8fe49d12b89cf67e4b1..6e496c9d0733e2c4f5c733a93aba0999f85ee8d5 100644 (file)
@@ -91,6 +91,36 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
                children.add (child);
        }
 
+       internal override void resolve_children (Tree root) {
+               var list = per_type_children.get (NodeType.NAMESPACE);
+               if (list != null) {
+                       foreach (Node node in list) {
+                               node.resolve_children (root);
+                       }
+               }
+
+               list = per_type_children.get (NodeType.STRUCT);
+               if (list != null) {
+                       foreach (Node node in list) {
+                               node.resolve_children (root);
+                       }
+               }
+
+               list = per_type_children.get (NodeType.CLASS);
+               if (list != null) {
+                       foreach (Node node in list) {
+                               node.resolve_children (root);
+                       }
+               }
+
+               list = per_type_children.get (NodeType.INTERFACE);
+               if (list != null) {
+                       foreach (Node node in list) {
+                               node.resolve_children (root);
+                       }
+               }
+       }
+
        internal override void resolve_type_references (Tree root) {
                foreach (Node node in per_name_children.values) {
                        node.resolve_type_references (root);
@@ -200,8 +230,7 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
                                        if (ast == null)
                                                return null;
                                }
-                               this._package = (Valadoc.Api.Package)ast;
-                       }
+                               this._package = (Valadoc.Api.Package)ast;                       }
                        return this._package;
                }
        }
@@ -237,4 +266,3 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Compara
                return strcmp (name, node.name);
        }
 }
-
index e19ab2204c28dae106c4dac663e503b73d9cd471..9a99f8df26a9f471c60f92709f7e16c5938f3150 100644 (file)
@@ -359,6 +359,7 @@ public class Valadoc.Api.Tree {
                Api.NodeBuilder builder = new NodeBuilder (this);
                this.context.accept(builder);
                this.resolve_type_references ();
+               this.resolve_children ();
                this.add_dependencies_to_source_package ();
                return true;
        }
@@ -377,6 +378,12 @@ public class Valadoc.Api.Tree {
                }
        }
 
+       private void resolve_children () {
+               foreach (Package pkg in packages) {
+                       pkg.resolve_children (this);
+               }
+       }
+
        private Package? get_source_package () {
                foreach (Package pkg in packages) {
                        if (!pkg.is_package) {
index a7de0695ddc8cf9d048c84ba205156621e018654..ea400d9ca047d8d91643e1ff0bd85fd9b2b9a2bc 100755 (executable)
@@ -28,6 +28,9 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
        protected HtmlRenderer _renderer;
        protected Html.MarkupWriter writer;
 
+       protected string chart_directory = "img";
+       protected string icon_directory = "..";
+
        public abstract void process (Settings settings, Api.Tree tree);
 
        protected string? get_link (Api.Node element, Api.Node? pos) {
@@ -65,7 +68,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                }
        }
 
-       protected void write_wiki_pages (Api.Tree tree, string css_path_wiki, string contentp) {
+       protected void write_wiki_pages (Api.Tree tree, string css_path_wiki, string js_path_wiki, string contentp) {
                if (tree.wikitree == null) {
                        return ;
                }
@@ -85,17 +88,21 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 
                foreach (WikiPage page in pages) {
                        if (page.name != "index.valadoc") {
-                               GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.ndup(page.name.len()-7).replace ("/", ".")+"html"), "w");
-                               writer = new MarkupWriter (file);
-                               _renderer.set_writer (writer);
-                               this.write_file_header (css_path_wiki, this.settings.pkg_name);
-                               _renderer.set_container (page);
-                               _renderer.render (page.documentation);
-                               this.write_file_footer ();
+                               write_wiki_page (page, contentp, css_path_wiki, js_path_wiki, this.settings.pkg_name);
                        }
                }
        }
 
+       protected virtual void write_wiki_page (WikiPage page, string contentp, string css_path, string js_path, string pkg_name) {
+               GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.ndup(page.name.len()-7).replace ("/", ".")+"html"), "w");
+               writer = new MarkupWriter (file);
+               _renderer.set_writer (writer);
+               this.write_file_header (css_path, js_path, pkg_name);
+               _renderer.set_container (page);
+               _renderer.render (page.documentation);
+               this.write_file_footer ();
+       }
+
        protected void write_navi_top_entry (Api.Node element, Api.Node? parent) {
                string style = get_html_css_class (element);
 
@@ -234,9 +241,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                        return;
                }
 
-               writer.simple_tag ("br");
+               writer.start_tag ("div", {"class", css_package_note});
                writer.start_tag ("b").text ("Package:").end_tag ("b");
                writer.text (" ").text (package);
+               writer.end_tag ("div");
        }
 
        protected void write_namespace_note (Api.Node element) {
@@ -249,9 +257,10 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                        return;
                }
 
-               writer.simple_tag ("br");
+               writer.start_tag ("div", {"class", css_namespace_note});
                writer.start_tag ("b").text ("Namespace:").end_tag ("b");
                writer.text (" ").text (ns.full_name());
+               writer.end_tag ("div");
        }
 
        private void write_brief_description (Api.Node element , Api.Node? pos) {
@@ -345,18 +354,81 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                writer.end_tag ("div");
        }
 
-       public void write_symbol_content (Api.Node node, string image_path_prefix = "") {
+       private int html_id_counter = 0;
+
+       private void write_known_symbols_node (Gee.Collection<Api.Node> nodes, Api.Node container, string headline) {
+               if (nodes.size > 0) {
+                       var html_id = "box-content-" + html_id_counter.to_string ();
+                       html_id_counter++;
+
+
+                       writer.start_tag ("div", {"class", css_box});
+
+                       // headline:
+                       writer.start_tag ("div", {"class", css_box_headline});
+                       writer.start_tag ("div", {"class", css_box_headline_text}).text (headline).end_tag ("div");
+                       writer.start_tag ("div", {"class", css_box_headline_toggle});
+                       writer.start_tag ("img", {"onclick", "toggle_box  (this, '" + html_id + "')", "src", Path.build_filename (icon_directory, "coll_open.png")});
+                       writer.raw_text ("&nbsp;");
+                       writer.end_tag ("div");
+                       writer.end_tag ("div");
+
+
+                       // content:
+                       int[] list_sizes = {0, 0, 0};
+                       list_sizes[0] = nodes.size;
+                       list_sizes[2] = list_sizes[0]/3;
+                       list_sizes[0] -= list_sizes[2];
+                       list_sizes[1] = list_sizes[0]/2;
+                       list_sizes[0] -= list_sizes[1];
+
+                       writer.start_tag ("div", {"class", css_box_content, "id", html_id});
+
+                       var iter = nodes.iterator ();
+
+                       for (int i = 0; i < list_sizes.length; i++) {
+                               writer.start_tag ("div", {"class", css_box_column});
+                               writer.start_tag ("ul", {"class", css_inline_navigation});
+
+                               for (int p = 0; p < list_sizes[i] && iter.next (); p++) {
+                                       var node = iter.get ();
+                                       writer.start_tag ("li", {"class", get_html_css_class (node)});
+                                       writer.link (get_link (node, container), node.name);
+                                       writer.end_tag ("li");
+                               }
+
+                               writer.end_tag ("ul");
+                               writer.end_tag ("div");
+                       }
+
+                       writer.end_tag ("div"); // end content
+
+                       writer.end_tag ("div"); // end box
+               }
+       }
+
+       public void write_symbol_content (Api.Node node) {
                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, image_path_prefix);
+               this.write_image_block (node);
                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);
                writer.end_tag ("div");
                this.write_documentation (node, node);
 
+               if (node is Class) {
+                       var cl = node as Class;
+                       write_known_symbols_node (cl.get_known_child_classes (), cl, "All known sub-classes:");
+                       write_known_symbols_node (cl.get_known_derived_interfaces (), cl, "Required by:");
+               } else if (node is Interface) {
+                       var iface = node as Interface;
+                       write_known_symbols_node (iface.get_known_implementations (), iface, "All known implementing classes:");
+                       write_known_symbols_node (iface.get_known_related_interfaces (), iface, "All known sub-interfaces:");
+               }
+
                if (node.parent is Namespace) {
                        writer.simple_tag ("br");
                        this.write_namespace_note (node);
@@ -393,6 +465,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                        write_children (node, Api.NodeType.SIGNAL, "Signals", node);
                        write_children (node, Api.NodeType.FIELD, "Fields", node);
                }
+
                writer.end_tag ("div");
        }
 
@@ -458,11 +531,11 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
        }
 
        protected string get_img_path (Api.Node element) {
-               return "img/" + element.full_name () + ".png";
+               return Path.build_filename (chart_directory, element.full_name () + ".png");
        }
 
        protected string get_img_real_path (Api.Node element) {
-               return this.settings.path + "/" + element.package.name + "/" + "img/" + element.full_name () + ".png";
+               return Path.build_filename (settings.path, element.package.name, chart_directory, element.full_name () + ".png");
        }
 
        protected void write_children (Api.Node node, Api.NodeType type, string type_string, Api.Node? container) {
@@ -491,16 +564,13 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                }
        }
 
-       protected void write_image_block (Api.Node element, string path_prefix = "") {
+       protected void write_image_block (Api.Node element) {
                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);
@@ -577,11 +647,12 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                writer.end_tag ("div");
        }
 
-       protected void write_file_header (string css, string? title) {
+       protected void write_file_header (string css, string js, string? title) {
                writer.start_tag ("html");
                writer.start_tag ("head");
                writer.start_tag ("title").text ("Vala Binding Reference").end_tag ("title");
                writer.stylesheet_link (css);
+               writer.javascript_link (js);
                writer.end_tag ("head");
                writer.start_tag ("body");
                writer.start_tag ("div", {"class", css_site_header});
index c4b82dee393eeefa309b1621ba2d4e949324ccd6..b3df0f19d67710c07dc9a70486888e25d15fff4d 100755 (executable)
@@ -51,6 +51,7 @@ namespace Valadoc.Html {
        public const string css_package_index = "package_index";
        public const string css_brief_description = "brief_description";
        public const string css_description = "description";
+       public const string css_known_list = "known_nodes";
        public const string css_leaf_brief_description = "leaf_brief_description";
        public const string css_leaf_code_definition = "leaf_code_definition";
 
@@ -95,6 +96,15 @@ namespace Valadoc.Html {
        public const string css_style_content = "site_content";
        public const string css_style_body = "site_body";
 
+       public const string css_box_headline_text = "text";
+       public const string css_box_headline_toggle = "toggle";
+       public const string css_box_headline = "headline";
+       public const string css_box_content = "content";
+       public const string css_box_column = "column";
+       public const string css_box = "box";
+
+       public const string css_namespace_note = "namespace_note";
+       public const string css_package_note = "package_note";
 
        public delegate string? HtmlLink (Settings settings, Documentation element, Documentation? pos);
        public HtmlLink get_html_link_imp;
index e48865d61be0d786634c6b079be557871449aff4..cb007e67d69c0611071b064a04267b1a87bf7809 100755 (executable)
@@ -55,6 +55,12 @@ public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
                return this;
        }
 
+       public MarkupWriter javascript_link (string url) {
+               start_tag ("script", {"src", url, "type", "text/javascript"});
+               end_tag ("script");
+               return this;
+       }
+
        private override bool inline_element (string name) {
                return name != "html"
                        && name != "head"
index 5f8f874b38cc97213b298306a2fcfdfd1c86f6cd..e581f31517e16f6bc39f56512818eb83cb1bb54e 100755 (executable)
@@ -6,7 +6,7 @@ namespace Graphviz {
 
 //check the headerfile,        // rename
 [CCode (cprefix = "", cheader_filename="gvc.h")]
-public enum GraphType {
+public enum GraphType { // => GraphKind
        AGDIGRAPHSTRICT,
        AGRAPHSTRICT,
        AGDIGRAPH,
@@ -369,7 +369,7 @@ public class Context {
        public int parse_args ( [CCode (array_length_pos = 0.9)] string[] argv );
 
        [CCode (cname = "gvContext")]
-       public static Context context ( );
+       public static Context context ( ); // => GraphKind
 
        [CCode (cname = "gvLayout")]
        public int layout ( Graph g, string engine );