]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
- valadoc.org-doclet: documentation exporter
authorFlorian Brosch <flo.brosch@gmail.com>
Fri, 4 Sep 2009 17:40:43 +0000 (19:40 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Fri, 4 Sep 2009 18:07:00 +0000 (20:07 +0200)
54 files changed:
src/doclets/devhelp/doclet/doclet.vala [changed mode: 0644->0755]
src/doclets/htm/doclet/doclet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/doclet/doclet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/doclet/globals.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/doclet/langlet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/html/attribute.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/html/block.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/html/htmlwriter.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/html/inline.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/languages/vala.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/listelement/taglet.vala
src/doclets/htmlhelpers/taglets/parameter/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/return/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/see/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/since/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/string/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/throws/taglet.vala [changed mode: 0644->0755]
src/doclets/htmlhelpers/taglets/typelink/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/doclet/template.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/bold/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/center/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/headline/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/image/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/italic/taglet.vala [moved from src/doclets/valadoc.org/taglets/version/taglet.vala with 58% similarity, mode: 0755]
src/doclets/valadoc.org/taglets/link/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/link/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/list/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/listelement/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/notification/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/parameter/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/parameter/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/return/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/return/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/right/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/see/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/see/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/since/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/source/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/string/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/string/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/table/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/tablecell/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/throws/Makefile.am [deleted file]
src/doclets/valadoc.org/taglets/throws/taglet.vala [changed mode: 0644->0755]
src/doclets/valadoc.org/taglets/typelink/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/underline/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/version/Makefile.am [deleted file]
src/libvaladoc/apitree.vala
src/libvaladoc/doctree.vala [changed mode: 0644->0755]
src/libvaladoc/filehelper.vala [changed mode: 0644->0755]
src/libvaladoc/moduleloader.vala [changed mode: 0644->0755]
src/libvaladoc/parser.vala [changed mode: 0644->0755]
src/libvaladoc/wiki.vala [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 0981756..4dc4137
@@ -941,21 +941,23 @@ public abstract class Valadoc.Html.BasicDoclet : Valadoc.Doclet {
 
                bool with_childs = (mself == null)? false : mself is Package;
 
-               file.printf ( "<h3 class=\"%s\">Namespaces:</h3>\n", css_title );
-               file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
-               foreach ( Namespace ns in nsl ) {
-                       if ( ns.name != null ) {
-                               file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_namespace, css_navi_link, this.get_link(ns, mself), ns.name );
-                               if ( with_childs == true ) {
-                                       this.write_child_classes ( file, ns, mself );
-                                       this.write_child_interfaces ( file, ns, mself );
-                                       this.write_child_structs ( file, ns, mself );
-                                       this.write_child_enums ( file, ns, mself );
-                                       this.write_child_errordomains ( file, ns, mself );
-                                       this.write_child_delegates ( file, ns, mself );
-                                       this.write_child_methods ( file, ns, mself );
-                                       this.write_child_fields ( file, ns, mself );
-                                       this.write_child_constants ( file, ns, mself );
+               file.printf ("<h3 class=\"%s\">Namespaces:</h3>\n", css_title);
+               file.printf ("<ul class=\"%s\">\n", css_inline_navigation);
+               foreach (Namespace ns in nsl) {
+                       if (ns.name != null) {
+                               file.printf ("\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a>\n", css_inline_navigation_namespace, css_navi_link, this.get_link(ns, mself), ns.name);
+                               this.write_brief_description (file, ns , mself);
+                               file.printf ("</li>\n");
+                               if (with_childs == true) {
+                                       this.write_child_classes (file, ns, mself);
+                                       this.write_child_interfaces (file, ns, mself);
+                                       this.write_child_structs (file, ns, mself);
+                                       this.write_child_enums (file, ns, mself);
+                                       this.write_child_errordomains (file, ns, mself);
+                                       this.write_child_delegates (file, ns, mself);
+                                       this.write_child_methods (file, ns, mself);
+                                       this.write_child_fields (file, ns, mself);
+                                       this.write_child_constants (file, ns, mself);
                                }
                        }
                }
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 08aef6a..0e6f96f
@@ -63,3 +63,61 @@ public class Valadoc.Html.Div : Valadoc.Html.BlockElement {
        }
 }
 
+public class Valadoc.Html.Script : Valadoc.Html.BlockElement {
+       private static string mytag = "script";
+       private Attribute lang;
+       private Attribute type;
+       private Attribute src;
+
+       public Script (string lang, string src, string type) {
+               this.lang = new Attribute ("type", lang);
+               this.type = new Attribute ("rel", type);
+               this.src = new Attribute ("href", src);
+
+               this.add_attribute (this.lang);
+               this.add_attribute (this.type);
+               this.add_attribute (this.src);
+
+               this.tag = mytag;
+       }
+}
+
+public class Valadoc.Html.Headline : Valadoc.Html.BlockElement {
+       private static string mytag;
+
+       public Headline (int lvl) {
+               mytag = "h%d".printf (lvl);
+               this.tag = mytag;
+       }
+}
+
+public class Valadoc.Html.Title : Valadoc.Html.BlockElement {
+       private static string mytag = "title";
+       private String title;
+
+       public Title (string title) {
+               this.tag = mytag;
+               this.title = new String (title);
+               this.add_child (this.title);
+       }
+}
+
+public class Valadoc.Html.Link : Valadoc.Html.BlockElement {
+       private static string mytag = "link";
+       private Attribute lang;
+       private Attribute type;
+       private Attribute src;
+
+       public Link (string lang, string src, string type) {
+               this.lang = new Attribute ("type", lang);
+               this.type = new Attribute ("rel", type);
+               this.src = new Attribute ("href", src);
+
+               this.add_attribute (this.lang);
+               this.add_attribute (this.type);
+               this.add_attribute (this.src);
+
+               this.tag = mytag;
+       }
+}
+
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index cc96e75..f4e971a
@@ -41,18 +41,18 @@ public class Valadoc.Html.Span : Valadoc.Html.InlineElement {
 }
 
 
-public class Valadoc.Html.Link : Valadoc.Html.InlineElement {
+public class Valadoc.Html.HyperLink : Valadoc.Html.InlineElement {
        private static string mytag = "a";
        private Attribute path;
 
-       public class Link (string path, Entry desc) {
+       public HyperLink (string path, Entry desc) {
                this.path = new Attribute ("href", path);
                this.add_attribute (this.path);
                this.children.add (desc);
                this.tag = mytag;
        }
 
-       public Link.from_list (string path, Collection<Entry> descs) {
+       public HyperLink.from_list (string path, Collection<Entry> descs) {
                this.path = new Attribute ("href", path);
                this.add_attribute (this.path);
                this.tag = mytag;
@@ -72,3 +72,11 @@ public class Valadoc.Html.Image : Valadoc.Html.InlineElement {
        }
 }
 
+public class Valadoc.Html.Italic : Valadoc.Html.InlineElement {
+       private static string mytag = "i";
+
+       public Italic () {
+               this.tag = mytag;
+       }
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index 99eb791..ed3c5b4
@@ -14,7 +14,7 @@ public class Valadoc.Html.Api.Vala {
        private Attribute cssbasictype = new Attribute ("class", "apibasictype");
        private Attribute csslink = new Attribute ("class", "apilink");
        private Attribute cssoptparamlist = new Attribute ("class", "apioptparameterlist");
-
+       private Attribute cssparentlist = new Attribute ("class", "parentlist");
 
        private Entry keyword (string str) {
                Span span = new Span ();
@@ -23,6 +23,37 @@ public class Valadoc.Html.Api.Vala {
                return span;
        }
 
+       private Entry parents (Inheritable type) {
+               Span span = new Span ();
+               span.add_attribute (this.cssparentlist);
+
+               Gee.Collection<Interface> interfaces = type.get_implemented_interface_list ();
+               Basic? basetype = type.base_type;
+               bool documentedelement;
+
+               if (basetype != null || interfaces.size > 0) {
+                       span.add_child (new String (" : "));
+               }
+
+               if (basetype != null) {
+                       span.add_child (this.type (basetype, out documentedelement));
+               }
+
+               if (basetype != null && interfaces.size > 0) {
+                       span.add_child (new String (", "));
+               }
+
+               int i = 0;
+               foreach (Interface iface in interfaces) {
+                       span.add_child (this.type (iface, out documentedelement));
+                       if (interfaces.size < ++i) {
+                               span.add_child (new String (", "));
+                       }
+               }
+
+               return span;
+       }
+
        private Entry type (Basic? type, out bool documentedelement) {
                ArrayList<Entry> elements = new ArrayList<Entry> ();
                weak Attribute css = this.csstype;
@@ -52,7 +83,7 @@ public class Valadoc.Html.Api.Vala {
                                        css = this.cssbasictype;
                                }
 
-                               Link link = new Link ("/%s/%s.html".printf (dtype.package.name, dtype.full_name ()), new String (dtype.name));
+                               HyperLink link = new HyperLink ("/%s/%s.html".printf (dtype.package.name, dtype.full_name ()), new String (dtype.name));
                                link.add_attribute (csslink);
                                elements.insert (0, link);
                                documentedelement = true;
@@ -188,7 +219,7 @@ public class Valadoc.Html.Api.Vala {
                int i = 0;
 
                foreach (FormalParameter param in paramh.param_list) {
-                       if (param.has_default_value) {
+                       if (param.has_default_value && !default_value) {
                                default_value = true;
 
                                span = new Span ();
@@ -455,6 +486,7 @@ public class Valadoc.Html.Api.Vala {
                        api.add_childs (lst);
                }
 
+               api.add_child (this.parents (stru));
                api.add_child (new String (";"));
                return api;
        }
@@ -480,6 +512,7 @@ public class Valadoc.Html.Api.Vala {
                        api.add_childs (lst);
                }
 
+               api.add_child (this.parents (cl));
                api.add_child (new String (";"));
                return api;
        }
@@ -497,6 +530,7 @@ public class Valadoc.Html.Api.Vala {
                        api.add_childs (lst);
                }
 
+               api.add_child (this.parents (iface));
                api.add_child (new String (";"));
                return api;
        }
index bbf9048b3390a699f95454b794a379c4e95558d1..cfc5777ad4d13cfab5f6ea7389744faaa34d5906 100755 (executable)
@@ -26,7 +26,7 @@ namespace Valadoc.Html {
        public class ListEntryDocElement : Valadoc.ListEntryDocElement {
                private Gee.ArrayList<DocElement> content;
 
-               public override bool parse ( ListType type, Gee.ArrayList<DocElement> content ) {
+               public override bool parse ( ListType type, long lvl, Gee.ArrayList<DocElement> content ) {
                        this.content = content;
                        return true;
                }
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 360559c..af6c29e
@@ -25,20 +25,35 @@ using Gee;
 
 
 
-public class Valadoc.HtmlDoclet : Valadoc.Doclet {
+public class Valadoc.ValdocOrg.Doclet : Valadoc.Doclet {
        private Valadoc.Html.Api.Vala langwriter = new Valadoc.Html.Api.Vala ();
        private Settings settings;
+       private FileStream types;
        private FileStream file;
        private bool run;
 
+       private void write_documentation (DocumentedElement element) {
+               if(element.documentation == null) {
+                       return ;
+               }
+stdout.printf("foooo 1\n");
+               string path = Path.build_filename (this.settings.path, element.package.name, "documentation", element.full_name ());
+               FileStream file = FileStream.open (path, "w");
+               if (file == null) {
+                       this.run = false;
+                       return ;
+               }
+stdout.printf("foooo 2\n");
+               element.documentation.write_brief (file);
+               element.documentation.write_content (file);
+       }
+
        public override void initialisation (Settings settings, Tree tree) {
                this.settings = settings;
                this.run = true;
 
                DirUtils.create (this.settings.path, 0777);
 
-
-
                foreach (Package pkg in tree.get_package_list ()) {
                        pkg.visit (this);
 
@@ -120,8 +135,21 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                        return ;
                }
 
-               path = Path.build_filename(path, "dump.sql");
-               this.file = FileStream.open (path , "w");
+               if (GLib.DirUtils.create (Path.build_filename(path, "documentation"), 0777) == -1) {
+                       this.run = false;
+                       return ;
+               }
+
+               string fpath = Path.build_filename(path, "dump.sql");
+               this.file = FileStream.open (fpath , "w");
+               if (this.file == null) {
+                       this.run = false;
+                       return ;
+               }
+
+
+               string tpath = Path.build_filename(path, "typenames.types");
+               this.types = FileStream.open (tpath , "w");
                if (this.file == null) {
                        this.run = false;
                        return ;
@@ -240,9 +268,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocNamespaces` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(ns));
+               this.write_documentation (ns);
        }
 
        public override void visit_interface ( Interface iface ) {
+               this.types.printf ("%s|%s/%s|%s\n", iface.get_cname (), iface.package.name, iface.full_name(), "interface");
                write_interface_diagram (iface, this.get_image_path (iface));
 
                this.write_insert_into_valadoc_element (iface);
@@ -320,9 +350,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocInterfaces` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(iface));
+               this.write_documentation (iface);
        }
 
        public override void visit_class ( Class cl ) {
+               this.types.printf ("%s|%s/%s|%s\n", cl.get_cname (), cl.package.name, cl.full_name(), "class");
                write_class_diagram (cl, this.get_image_path (cl));
 
                this.write_insert_into_valadoc_element (cl);
@@ -424,9 +456,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
        
                this.file.printf ("INSERT INTO `ValadocClasses` (`id`, `modifier`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1),'%s');\n", this.get_type_path(cl), modifier);
+               this.write_documentation (cl);
        }
 
        public override void visit_struct ( Struct stru ) {
+               this.types.printf ("%s|%s/%s|%s\n", stru.get_cname (), stru.package.name, stru.full_name (), "struct");
                write_struct_diagram (stru, this.get_image_path (stru));
 
                this.write_insert_into_valadoc_element (stru);
@@ -472,9 +506,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocStructs` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(stru));
+               this.write_documentation (stru);
        }
 
        public override void visit_error_domain ( ErrorDomain errdom ) {
+               this.types.printf ("%s|%s/%s|%s\n", errdom.get_cname (), errdom.package.name, errdom.full_name (), "errordomain");
                this.write_insert_into_valadoc_element (errdom);
                if (this.run == false) {
                        return ;
@@ -502,9 +538,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocErrordomains` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(errdom));
+               this.write_documentation (errdom);
        }
 
        public override void visit_enum ( Enum en ) {
+               this.types.printf ("%s|%s/%s|%s\n", en.get_cname (), en.package.name, en.full_name (), "enum");
                this.write_insert_into_valadoc_element (en);
                if (this.run == false) {
                        return ;
@@ -532,9 +570,12 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocEnum` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(en));
+               this.write_documentation (en);
        }
 
        public override void visit_property ( Property prop ) {
+               string pcname = (prop.parent is Class)? ((Class)prop.parent).get_cname() : ((Interface)prop.parent).get_cname ();
+               this.types.printf ("%s:%s|%s/%s|%s\n", pcname, prop.name, prop.package.name, prop.full_name (), "property");
                this.write_insert_into_valadoc_element (prop);
                if (this.run == false) {
                        return ;
@@ -560,9 +601,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocProperties` (`id`, `modifier`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1), '%s');\n", this.get_type_path(prop), modifier);
+               this.write_documentation (prop);
        }
 
        public override void visit_constant ( Constant constant, ConstantHandler parent ) {
+               this.types.printf ("%s|%s/%s|%s\n", constant.get_cname (), constant.package.name, constant.full_name (), "const");
                this.write_insert_into_valadoc_element (constant);
                if (this.run == false) {
                        return ;
@@ -574,9 +617,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocConstants` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(constant));
+               this.write_documentation (constant);
        }
 
        public override void visit_field ( Field field, FieldHandler parent ) {
+               this.types.printf ("%s|%s/%s|%s\n", field.get_cname (), field.package.name, field.full_name (), "field");
                this.write_insert_into_valadoc_element (field);
                if (this.run == false) {
                        return ;
@@ -596,9 +641,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocFields` (`id`, `modifier`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1), '%s');\n", this.get_type_path(field), modifier);
+               this.write_documentation (field);
        }
 
        public override void visit_error_code ( ErrorCode errcode ) {
+               this.types.printf ("%s|%s/%s|%s\n", errcode.get_cname (), errcode.package.name, errcode.full_name (), "errorcode");
                this.write_insert_into_valadoc_element (errcode);
                if (this.run == false) {
                        return ;
@@ -610,9 +657,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocErrorcodes` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n" , this.get_type_path(errcode));
+               this.write_documentation (errcode);
        }
 
        public override void visit_enum_value ( EnumValue enval ) {
+               this.types.printf ("%s|%s/%s|%s\n", enval.get_cname (), enval.package.name, enval.full_name (), "enumvalue");
                this.write_insert_into_valadoc_element (enval);
                if (this.run == false) {
                        return ;
@@ -624,9 +673,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocEnumvalues` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(enval));
+               this.write_documentation (enval);
        }
 
        public override void visit_delegate ( Delegate del ) {
+               this.types.printf ("%s|%s/%s|%s\n", del.get_cname (), del.package.name, del.full_name (), "delegate");
                this.write_insert_into_valadoc_element (del);
                if (this.run == false) {
                        return ;
@@ -646,9 +697,12 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocDelegates` (`id`, `modifier`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE  BINARY`fullname`='%s' LIMIT 1), '%s');\n", this.get_type_path(del), modifier);
+               this.write_documentation (del);
        }
 
        public override void visit_signal ( Signal sig ) {
+               string pcname = (sig.parent is Class)? ((Class)sig.parent).get_cname() : ((Interface)sig.parent).get_cname ();
+               this.types.printf ("%s::%s|%s/%s|%s\n", pcname, sig.name, sig.package.name, sig.full_name (), "signal");
                this.write_insert_into_valadoc_element (sig);
                if (this.run == false) {
                        return ;
@@ -660,9 +714,11 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
                }
 
                this.file.printf ("INSERT INTO `ValadocSignals` (`id`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1));\n", this.get_type_path(sig));
+               this.write_documentation (sig);
        }
 
        public override void visit_method ( Method m, Valadoc.MethodHandler parent ) {
+               this.types.printf ("%s|%s/%s|%s\n", m.get_cname (), m.package.name, m.full_name (), "method");
                this.write_insert_into_valadoc_element (m);
                if (this.run == false) {
                        return ;
@@ -694,6 +750,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
 
                        this.file.printf("INSERT INTO `ValadocMethods` (`id`, `modifier`)VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1), '%s');\n", this.get_type_path(m), modifier);
                }
+               this.write_documentation (m);
        }
 
        private string get_type_path (DocumentedElement element) {
@@ -709,6 +766,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Doclet {
 
 [ModuleInit]
 public Type register_plugin ( ) {
-       return typeof ( Valadoc.HtmlDoclet );
+       return typeof ( Valadoc.ValdocOrg.Doclet );
 }
 
diff --git a/src/doclets/valadoc.org/taglets/Makefile.am b/src/doclets/valadoc.org/taglets/Makefile.am
deleted file mode 100644 (file)
index adb9f7d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# src/Makefile.am
-
-NULL =
-
-
-SUBDIRS =       \
-      see       \
-      link      \
-      return    \
-      string    \
-      throws    \
-      version   \
-      parameter \
-      $(NULL)
-
-
diff --git a/src/doclets/valadoc.org/taglets/bold/taglet.vala b/src/doclets/valadoc.org/taglets/bold/taglet.vala
new file mode 100755 (executable)
index 0000000..9658bca
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.BoldDocElement : Valadoc.BoldDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse ( Gee.ArrayList<DocElement> content ) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write ( void* res, int max, int index ) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ( "++" );
+
+               foreach ( DocElement element in this.content ) {
+                       element.write ( res, _max, _index );
+                       _index++;
+               }
+
+               file.printf ( "++" );
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+       return typeof ( Valadoc.ValdocOrg.BoldDocElement );
+}
+
diff --git a/src/doclets/valadoc.org/taglets/center/taglet.vala b/src/doclets/valadoc.org/taglets/center/taglet.vala
new file mode 100755 (executable)
index 0000000..355def1
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.CenterDocElement : Valadoc.CenterDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse (Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.puts ("\n)( ");
+
+               foreach (DocElement element in this.content) {
+                       element.write ( res, _max, _index );
+                       _index++;
+               }
+
+               file.puts ("\n");
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.CenterDocElement);
+}
+
diff --git a/src/doclets/valadoc.org/taglets/headline/taglet.vala b/src/doclets/valadoc.org/taglets/headline/taglet.vala
new file mode 100755 (executable)
index 0000000..db653a3
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.HeadlineDocElement : Valadoc.HeadlineDocElement {
+       private string title;
+       private int lvl;
+
+       public override bool parse (owned string title, int lvl) {
+               this.title = title;
+               this.lvl = lvl;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               file.printf ("\n\n%s %s\n", string.nfill (this.lvl+1, '='), this.title);
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.HeadlineDocElement);
+}
+
diff --git a/src/doclets/valadoc.org/taglets/image/taglet.vala b/src/doclets/valadoc.org/taglets/image/taglet.vala
new file mode 100755 (executable)
index 0000000..1e9a939
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+using Gdk;
+
+
+public class Valadoc.ValdocOrg.ImageDocElement : Valadoc.ImageDocElement {
+       private string imgpath;
+       private string path;
+       private string alt;
+
+       public override bool parse (Settings settings, Documented pos, owned string path, owned string alt) {
+               if ( GLib.FileUtils.test (path, GLib.FileTest.EXISTS | GLib.FileTest.IS_REGULAR ) == false) {
+                       return false;
+               }
+
+               this.imgpath = (pos is DocumentedElement)?
+                       Path.build_filename (settings.path, ((DocumentedElement)pos).package.name, "wiki-images", Path.get_basename (path)) :
+                       Path.build_filename (settings.path, settings.pkg_name, "wiki-images", Path.get_basename (path));
+
+               this.path = path;
+               this.alt = alt;
+
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               bool tmp = copy_file (this.path, this.imgpath);
+               if (tmp == false) {
+                       return false;
+               }
+
+               ((GLib.FileStream)res).printf ("{{%s|%s}}", this.imgpath, (this.alt==null||this.alt=="")? this.imgpath: this.alt);
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.ImageDocElement);
+}
+
old mode 100644 (file)
new mode 100755 (executable)
similarity index 58%
rename from src/doclets/valadoc.org/taglets/version/taglet.vala
rename to src/doclets/valadoc.org/taglets/italic/taglet.vala
index 5109bda..2f84b4f
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.ItalicDocElement : Valadoc.ItalicDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse (Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ("//");
+
+               foreach (DocElement element in this.content) {
+                       element.write (res, _max, _index);
+                       _index++;
+               }
+
+               file.printf ("//");
+               return true;
+       }
+}
+
 
 [ModuleInit]
 public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( SinceHtmlTaglet );
-               taglets.set ( "since", type );
-               return type;
+       return typeof (Valadoc.ValdocOrg.ItalicDocElement);
 }
-
diff --git a/src/doclets/valadoc.org/taglets/link/Makefile.am b/src/doclets/valadoc.org/taglets/link/Makefile.am
deleted file mode 100644 (file)
index 3cac614..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletlink_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletlink.vala.stamp
-
-
-libtagletlink.vala.stamp: $(libtagletlink_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletlinkdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletlink_LTLIBRARIES = libtagletlink.la
-
-
-libtagletlink_la_SOURCES =                \
-       libtagletlink.vala.stamp              \
-       $(libtagletlink_VALASOURCES:.vala=.c) \
-       $(libtagletlink_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletlink_la_LDFLAGS = -module -avoid-version
-
-
-libtagletlink_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletlink_VALASOURCES)  libtagletlink.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index 81bc5cb..fc6c38f
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
-public class Valadoc.LinkValadocOrgTaglet : Valadoc.LinkHtmlHelperTaglet, LinkHelper {
-       protected override string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ) {
-               return this.get_html_link ( settings, element );
-       }
+public class Valadoc.ValdocOrg.LinkDocElement : Valadoc.LinkDocElement {
+       private string desc;
+       private string path;
 
-       public override string to_string () {
-               return to_string_imp ( );
-       }
+       public override bool parse (Settings settings, Tree tree, Documented pos, owned string path, owned string desc) {
+               if ( path.has_suffix(".valadoc")&&path.has_prefix("/") ) {
+                       if ( tree.wikitree == null ) {
+                               return false;
+                       }
 
-       public override bool write ( void* res, int max, int index ) {
-               return write_imp ( res, max, index );
+                       WikiPage? wikipage = tree.wikitree.search(path.offset(1));
+                       if ( wikipage == null ) {
+                               return false;
+                       }
+
+                       this.path = settings.pkg_name+"/"+path.substring (0, path.len()-8);
+                       this.desc = desc;
+                       return true;
+               }
+
+               this.path = path;
+               this.desc = desc;
+               return true;
        }
 
-       public override bool parse ( Settings settings, Tree tree, Basic me, string content, out string[] errmsg ) {
-               return this.parse_imp ( settings, tree, me, content, out errmsg );
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               file.printf ("[[%s|%s]]", this.path, (this.desc==null||this.desc=="")? this.path: this.desc);
+               return true;
        }
 }
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( LinkValadocOrgTaglet );
-               taglets.set ( "link", type );
-               return type;
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.LinkDocElement);
 }
 
-
diff --git a/src/doclets/valadoc.org/taglets/list/taglet.vala b/src/doclets/valadoc.org/taglets/list/taglet.vala
new file mode 100755 (executable)
index 0000000..260e483
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+
+public class Valadoc.ValdocOrg.ListDocElement : Valadoc.ListDocElement {
+       private Gee.ArrayList<ListEntryDocElement> entries;
+       private ListType type;
+
+       public override bool parse (ListType type, Gee.ArrayList<ListEntryDocElement> entries) {
+               this.entries = entries;
+               this.type = type;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.entries.size;
+               int _index = 0;
+
+               foreach (ListEntryDocElement entry in this.entries) {
+                       entry.write (res, _max, _index);
+                       _index++;
+               }
+
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.ListDocElement);
+}
+
+
diff --git a/src/doclets/valadoc.org/taglets/listelement/taglet.vala b/src/doclets/valadoc.org/taglets/listelement/taglet.vala
new file mode 100755 (executable)
index 0000000..34c841d
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.ListEntryDocElement : Valadoc.ListEntryDocElement {
+       private Gee.ArrayList<DocElement> content;
+       private ListType type;
+       private long lvl;
+
+       public override bool parse (ListType type, long lvl, Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               this.type = type;
+               this.lvl = lvl;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ("%s%s", string.nfill (this.lvl, ' '), (this.type == ListType.SORTED)? "#": "-");
+
+               foreach ( DocElement element in this.content ) {
+                       element.write ( res, _max, _index );
+                       _index++;
+               }
+
+               file.printf ("\n");
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.ListEntryDocElement);
+}
+
+
diff --git a/src/doclets/valadoc.org/taglets/notification/taglet.vala b/src/doclets/valadoc.org/taglets/notification/taglet.vala
new file mode 100755 (executable)
index 0000000..ea1dfba
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+using GLib;
+using Gee;
+
+
+
+public class Valadoc.ValdocOrg.NotificationDocElement : Valadoc.NotificationDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse ( Gee.ArrayList<DocElement> content ) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write ( void* res, int max, int index ) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ( "\n[[warning:\n");
+
+               foreach ( DocElement element in this.content ) {
+                       element.write ( res, _max, _index );
+                       _index++;
+               }
+
+               file.printf ( "\n]]\n" );
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+       return typeof (Valadoc.ValdocOrg.NotificationDocElement);
+}
+
+
+
diff --git a/src/doclets/valadoc.org/taglets/parameter/Makefile.am b/src/doclets/valadoc.org/taglets/parameter/Makefile.am
deleted file mode 100644 (file)
index f66987b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletparameter_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletparameter.vala.stamp
-
-
-libtagletparameter.vala.stamp: $(libtagletparameter_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletparameterdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletparameter_LTLIBRARIES = libtagletparameter.la
-
-
-libtagletparameter_la_SOURCES =                \
-       libtagletparameter.vala.stamp              \
-       $(libtagletparameter_VALASOURCES:.vala=.c) \
-       $(libtagletparameter_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletparameter_la_LDFLAGS = -module -avoid-version
-
-
-libtagletparameter_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletparameter_VALASOURCES)  libtagletparameter.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index 2c15166..47a66a1
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.ParameterTaglet : Valadoc.MainTaglet {
+       public override int order { get { return 100; } }
+       private Gee.Collection<DocElement> content;
+       private string paramname;
 
-[ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( ParameterHtmlTaglet );
-               taglets.set ( "param", type );
-               return type;
+       private static bool check_parameter_name (Valadoc.ParameterListHandler me, string name) {
+               if (name == "") {
+                       return false;
+               }
+
+               foreach (Valadoc.FormalParameter param in me.get_parameter_list ()) {
+                       if (param.name == name) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public override bool write (void* ptr, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+               file.printf (" @param %s \n", this.paramname);
+
+               int _max = this.content.size;
+               int _index = 0;
+
+               foreach (DocElement tag in this.content) {
+                       tag.write ( ptr, _max, _index );
+                       _index++;
+               }
+
+               file.puts ( "\n" );
+               return true;
+       }
+
+       public override bool write_block_start (void* ptr) {
+               return true;
+       }
+
+       public override bool write_block_end (void* ptr) {
+               return true;
+       }
+
+       public override bool parse (Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg) {
+               if (me is Valadoc.ParameterListHandler == false) {
+                       errmsg = "Tag @param cannot be used in this context";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               if (content.size == 0) {
+                       errmsg = "Parameter name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               Gee.ArrayList<DocElement> contentlst = new Gee.ArrayList<DocElement> ();
+               foreach (DocElement element in content) {
+                       contentlst.add (element);
+               }
+
+               DocElement tag = contentlst.get(0);
+               if (tag is StringTaglet == false) {
+                       errmsg = "Parameter name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               string str = ((StringTaglet)tag).content;
+               weak string lposa =  str.chr (-1, '\n');
+               weak string lposb =  str.chr (-1, ' ');
+               weak string lpos;
+
+               long lposaoffset = (lposa == null)? long.MAX : str.pointer_to_offset (lposa);
+               long lposboffset = (lposb == null)? long.MAX : str.pointer_to_offset (lposb);
+
+               if (lposaoffset < lposboffset) {
+                       lpos = lposa;
+               }
+               else {
+                       lpos = lposb;
+               }
+
+               if (lpos == null) {
+                       this.paramname = str.strip ();
+                       ((StringTaglet)tag).content = "";
+               }
+               else {
+                       int namepos = (int)str.pointer_to_offset (lpos);
+                       this.paramname = str.ndup (namepos).strip ();
+                       ((StringTaglet)tag).content = lpos.ndup (lpos.size ()).chomp ();
+               }
+
+               bool tmp = this.check_parameter_name ( (Valadoc.ParameterListHandler)me, this.paramname);
+               if ( tmp == false ) {
+                       errmsg = "Parameter is not available";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               this.content = contentlst;
+               return true;
+       }
 }
 
 
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       GLib.Type type = typeof (Valadoc.ValdocOrg.ParameterTaglet );
+       taglets.set ("param", type);
+       return type;
+}
 
diff --git a/src/doclets/valadoc.org/taglets/return/Makefile.am b/src/doclets/valadoc.org/taglets/return/Makefile.am
deleted file mode 100644 (file)
index 4e03753..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletXXXX_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletXXXX.vala.stamp
-
-
-libtagletXXXX.vala.stamp: $(libtagletXXXX_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletXXXXdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletXXXX_LTLIBRARIES = libtagletXXXX.la
-
-
-libtagletXXXX_la_SOURCES =                \
-       libtagletXXXX.vala.stamp              \
-       $(libtagletXXXX_VALASOURCES:.vala=.c) \
-       $(libtagletXXXX_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletXXXX_la_LDFLAGS = -module -avoid-version
-
-
-libtagletXXXX_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletXXXX_VALASOURCES)  libtagletXXXX.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index d6e543c..dc6d05a
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.ReturnTaglet : Valadoc.MainTaglet {
+       public override int order { get { return 300; } }
+       private Gee.Collection<DocElement> content;
+
+       public override bool parse (Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg) {
+               if (!(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate)) {
+                       errmsg = "Tag @return cannot be used in this context";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf (" @return ");
+
+               foreach (DocElement element in this.content) {
+                       element.write (res, _max, _index);
+                       _index++;
+               }
+
+               file.printf ("\n");
+               return true;
+       }
+
+       public override bool write_block_start (void* res) {
+               return true;
+       }
+
+       public override bool write_block_end (void* res) {
+               return true;
+       }
+}
+
+
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( ReturnHtmlTaglet );
-               taglets.set ( "return", type );
-               return type;
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+   GLib.Type type = typeof (Valadoc.ValdocOrg.ReturnTaglet);
+       taglets.set ("return", type);
+       return type;
 }
 
 
diff --git a/src/doclets/valadoc.org/taglets/right/taglet.vala b/src/doclets/valadoc.org/taglets/right/taglet.vala
new file mode 100755 (executable)
index 0000000..39f26c6
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.RightAlignedDocElement : Valadoc.RightAlignedDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse (Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ("\n)( ");
+
+               foreach (DocElement element in this.content) {
+                       element.write (res, _max, _index);
+                       _index++;
+               }
+
+               file.printf ("\n");
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.RightAlignedDocElement);
+}
+
diff --git a/src/doclets/valadoc.org/taglets/see/Makefile.am b/src/doclets/valadoc.org/taglets/see/Makefile.am
deleted file mode 100644 (file)
index 8dd3b5f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletsee_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletsee.vala.stamp
-
-
-libtagletsee.vala.stamp: $(libtagletsee_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletseedir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletsee_LTLIBRARIES = libtagletsee.la
-
-
-libtagletsee_la_SOURCES =                \
-       libtagletsee.vala.stamp              \
-       $(libtagletsee_VALASOURCES:.vala=.c) \
-       $(libtagletsee_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletsee_la_LDFLAGS = -module -avoid-version
-
-
-libtagletsee_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletsee_VALASOURCES)  libtagletsee.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index f331e02..91708e2
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+
 using Valadoc;
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.SeeTaglet : MainTaglet {
+       public override int order { get { return 400; } }
+       private string typename;
 
-
-public class Valadoc.SeeValadocOrgTaglet : SeeHtmlHelperTaglet, LinkHelper {
-//     protected abstract string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos );
-       protected override string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ) {
-               return this.get_html_link ( settings, element );
+       protected override bool write_block_start (void* res) {
+               return true;
        }
 
-       public override bool write_block_start ( void* ptr ) {
-               return this.write_block_start_imp ( ptr );
+       protected override bool write_block_end (void* res) {
+               return true;
        }
 
-       public override bool write_block_end ( void* res ) {
-               return this.write_block_end_imp ( res );
+       protected override bool write (void* res, int max, int index) {
+               ((GLib.FileStream)res).printf (" @see %s\n", this.typename);
+               return true;
        }
 
-       public override bool write ( void* res, int max, int index ) {
-               return this.write_imp ( res, max, index );
-       }
+       public override bool parse (Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg) {
+               if (content.size != 1) {
+                       errmsg = "Type name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
 
-       public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection<DocElement> content, out string[] errmsg ) {
-               return this.parse_imp ( settings, tree, me, content, out errmsg );
-       }
-}
+               Gee.Iterator<DocElement> it = content.iterator ();
+               it.next ();
 
+               DocElement element = it.get ();
+               if (element is StringTaglet == false) {
+                       errmsg = "Type name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
 
+               Valadoc.DocumentedElement? node = tree.search_symbol_str (me, ((StringTaglet)element).content.strip ());
+               if (node == null) {
+                       errmsg = "Linked type is not available";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               this.typename = node.full_name ();
+               return true;
+       }
+}
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( SeeValadocOrgTaglet );
-               taglets.set ( "see", type );
-               return type;
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+    GLib.Type type = typeof (Valadoc.ValdocOrg.SeeTaglet);
+       taglets.set ("see", type);
+       return type;
 }
 
+
diff --git a/src/doclets/valadoc.org/taglets/since/taglet.vala b/src/doclets/valadoc.org/taglets/since/taglet.vala
new file mode 100755 (executable)
index 0000000..494c89f
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.SinceTaglet : Valadoc.MainTaglet {
+       public override int order { get { return 400; } }
+       private StringTaglet content;
+
+       public override bool write_block_start (void* ptr) {
+               return true;
+       }
+
+       public override bool write_block_end (void* res) {
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               if (max != index+1 )
+                       ((GLib.FileStream)res).printf (" @since %s\n", this.content.content);
+
+               return true;
+       }
+
+       public override bool parse (Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg) {
+               if (content.size != 1) {
+                       errmsg = "Version name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               Gee.Iterator<DocElement> it = content.iterator ();
+               it.next ();
+
+               DocElement element = it.get ();
+               if (element is StringTaglet == false) {
+                       errmsg = "Version name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               this.content = (StringTaglet)element;
+               return true;
+       }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+    GLib.Type type = typeof (Valadoc.ValdocOrg.SinceTaglet);
+       taglets.set ("since", type);
+       return type;
+}
+
diff --git a/src/doclets/valadoc.org/taglets/source/taglet.vala b/src/doclets/valadoc.org/taglets/source/taglet.vala
new file mode 100755 (executable)
index 0000000..dd76050
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.SourceCodeDocElement : Valadoc.SourceCodeDocElement {
+       private Language lang;
+       private int srclines;
+       private string src;
+
+       public override bool parse (owned string src, Language lang) {
+               this.src = (owned)src;
+               this.lang = lang;
+               this.srclines=0;
+
+               for (weak string str=this.src; str.get_char()!='\0'; str=str.next_char()) {
+                       if (str.get_char () == '\n') {
+                               this.srclines++;
+                       }
+               }
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               file.printf ("\n{{{\n%s\n}}}\n", src);
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.SourceCodeDocElement);
+}
+
+
+
diff --git a/src/doclets/valadoc.org/taglets/string/Makefile.am b/src/doclets/valadoc.org/taglets/string/Makefile.am
deleted file mode 100644 (file)
index d1e30e4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletstring_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletstring.vala.stamp
-
-
-libtagletstring.vala.stamp: $(libtagletstring_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletstringdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletstring_LTLIBRARIES = libtagletstring.la
-
-
-libtagletstring_la_SOURCES =                \
-       libtagletstring.vala.stamp              \
-       $(libtagletstring_VALASOURCES:.vala=.c) \
-       $(libtagletstring_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletstring_la_LDFLAGS = -module -avoid-version
-
-
-libtagletstring_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletstring_VALASOURCES)  libtagletstring.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index f8daf5f..0ade84e
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.StringTaglet : Valadoc.StringTaglet {
+       public override bool parse (string content) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               file.puts (this.content); 
+               return true;
+       }
+}
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( StringHtmlTaglet );
-               taglets.set ( "", type );
-               return type;
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       GLib.Type type = typeof (Valadoc.ValdocOrg.StringTaglet);
+       taglets.set ("", type);
+       return type;
 }
 
 
diff --git a/src/doclets/valadoc.org/taglets/table/taglet.vala b/src/doclets/valadoc.org/taglets/table/taglet.vala
new file mode 100755 (executable)
index 0000000..d2eaf45
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.TableDocElement : Valadoc.TableDocElement {
+       private Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> cells;
+
+       public override void parse (Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> cells) {
+               this.cells = cells;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+
+               file.puts ("\n");
+
+               foreach (Gee.ArrayList<TableCellDocElement> row in this.cells) {
+                       int _max = row.size;
+                       int _index = 0;
+
+                       foreach (TableCellDocElement cell in row) {
+                               file.puts ("\n ||");
+                               cell.write (res, _max, _index );
+                               _index++;
+                       }
+               }
+
+               file.puts ("\n");
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.TableDocElement);
+}
+
+
diff --git a/src/doclets/valadoc.org/taglets/tablecell/taglet.vala b/src/doclets/valadoc.org/taglets/tablecell/taglet.vala
new file mode 100755 (executable)
index 0000000..273f84c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+using GLib;
+using Gee;
+
+
+public class Valadoc.ValdocOrg.TableCellDocElement : Valadoc.TableCellDocElement {
+       private Gee.ArrayList<DocElement> content;
+       private TextVerticalPosition hpos;
+       private TextPosition pos;
+       private int dcells;
+       private int cells;
+
+       public override void parse (TextPosition pos, TextVerticalPosition hpos, int cells, int dcells, Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               this.dcells = dcells;
+               this.cells = cells;
+               this.hpos = hpos;
+               this.pos = pos;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               GLib.StringBuilder td = new GLib.StringBuilder ();
+               if (this.cells != 1) {
+                       td.append ("|");
+                       td.append (this.cells.to_string());
+               }
+
+               if (this.dcells != 1) {
+                       td.append ("-");
+                       td.append (this.dcells.to_string());
+               }
+
+               switch (this.pos) {
+               case TextPosition.CENTER:
+                       td.append (")(");
+                       break;
+               case TextPosition.RIGHT:
+                       td.append (")) ");
+                       break;
+               }
+
+               switch (this.hpos) {
+               case TextVerticalPosition.TOP:
+                       td.append ("^");
+                       break;
+               case TextVerticalPosition.BOTTOM:
+                       td.append ("v");
+                       break;
+               }
+
+               if (td.len > 0) {
+                       file.printf ("<%s>", td.str);
+               }
+
+               file.printf (" ");
+
+               foreach (DocElement cell in this.content) {
+                       cell.write (res, _max, _index );
+                       _index++;
+               }
+               file.puts (" || \n" );
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.TableCellDocElement);
+}
+
+
diff --git a/src/doclets/valadoc.org/taglets/throws/Makefile.am b/src/doclets/valadoc.org/taglets/throws/Makefile.am
deleted file mode 100644 (file)
index 0e029d3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libexceptionparameter_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libexceptionparameter.vala.stamp
-
-
-libexceptionparameter.vala.stamp: $(libexceptionparameter_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-exceptionparameterdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-exceptionparameter_LTLIBRARIES = libexceptionparameter.la
-
-
-libexceptionparameter_la_SOURCES =                \
-       libexceptionparameter.vala.stamp              \
-       $(libexceptionparameter_VALASOURCES:.vala=.c) \
-       $(libexceptionparameter_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libexceptionparameter_la_LDFLAGS = -module -avoid-version
-
-
-libexceptionparameter_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libexceptionparameter_VALASOURCES)  libexceptionparameter.vala.stamp 
old mode 100644 (file)
new mode 100755 (executable)
index a7b27ba..971b775
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-using Valadoc;
+
 using GLib;
-using Vala;
 using Gee;
 
 
+public class Valadoc.ValdocOrg.ExceptionTaglet : Valadoc.MainTaglet {
+       public override int order { get { return 200; } }
+       private Gee.ArrayList<DocElement> content;
+       private string paramname;
+
+       public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg ) {
+               if ( me is Valadoc.ExceptionHandler == false ) {
+                       errmsg = "Tag @throws cannot be used in this context";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               if ( content.size == 0 ) {
+                       errmsg = "Exception name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+
+               Gee.ArrayList<DocElement> contentlst = new Gee.ArrayList<DocElement> ();
+               foreach ( DocElement element in content ) {
+                       contentlst.add ( element );
+               }
+
+               DocElement tag = contentlst.get( 0 );
+               if ( tag is StringTaglet == false ) {
+                       errmsg = "Exception name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               string str = ((StringTaglet)tag).content;
+               weak string lposa =  str.chr (-1, '\n');
+               weak string lposb =  str.chr (-1, ' ');
+               weak string lpos;
+
+               long lposaoffset = (lposa == null)? long.MAX : str.pointer_to_offset ( lposa );
+               long lposboffset = (lposb == null)? long.MAX : str.pointer_to_offset ( lposb );
+
+               if ( lposaoffset < lposboffset ) {
+                       lpos = lposa;
+               }
+               else {
+                       lpos = lposb;
+               }
+
+               if ( lpos == null ) {
+                       this.paramname = str.strip ();
+                       ((StringTaglet)tag).content = "";
+               }
+               else {
+                       int namepos = (int)str.pointer_to_offset ( lpos );
+                       this.paramname = str.ndup ( namepos ).strip ();
+                       ((StringTaglet)tag).content = lpos.ndup ( lpos.size () ).chomp ();
+               }
+
+               bool tmp = this.check_exception_parameter_name ( (Valadoc.ExceptionHandler)me, this.paramname );
+               if ( tmp == false ) {
+                       errmsg = "Exception name was expected";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               this.content = contentlst;
+               return true;
+       }
+
+       private bool check_exception_parameter_name ( Valadoc.ExceptionHandler me, string paramname ) {
+               string paramname2 = "."+paramname;
+
+               foreach ( DocumentedElement param in me.get_error_domains() ) {
+                       if ( param.name == paramname || param.full_name() == paramname || param.full_name().has_suffix(paramname2) ) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public override bool write (void* ptr, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)ptr;
+               file.printf (" @throws %s ", this.paramname);
+
+               int _max = this.content.size;
+               int _index = 0;
+
+               foreach (DocElement element in this.content) {
+                       element.write (ptr, _max, _index);
+                       _index++;
+               }
+
+               file.puts ( "\n" );
+               return true;
+       }
+
+       public override bool write_block_start (void* ptr) {
+               return true;
+       }
+
+       public override bool write_block_end (void* ptr) {
+               return true;
+       }
+}
+
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-        GLib.Type type = typeof ( ExceptionHtmlTaglet );
-               taglets.set ( "throws", type );
-               return type;
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       GLib.Type type = typeof (Valadoc.ValdocOrg.ExceptionTaglet);
+       taglets.set ("throws", type);
+       return type;
 }
 
 
diff --git a/src/doclets/valadoc.org/taglets/typelink/taglet.vala b/src/doclets/valadoc.org/taglets/typelink/taglet.vala
new file mode 100755 (executable)
index 0000000..eff4913
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+
+public class Valadoc.ValdocOrg.TypeLinkInlineTaglet : Valadoc.InlineTaglet {
+       private string typename = null;
+
+       protected override string to_string () {
+               return this.typename;
+       }
+
+       protected override bool write (void* res, int max, int index) {
+               ((GLib.FileStream)res).printf ("{@link %s}", this.typename);
+               return true;
+       }
+
+       protected override bool parse (Settings settings, Tree tree, Documented self, string content, ref ErrorLevel errlvl, out string? errmsg) {
+               Valadoc.DocumentedElement? element = tree.search_symbol_str ( (self is DocumentedElement)? (DocumentedElement)self : null, content.strip() );
+               if (element == null) {
+                       errmsg = "Linked type is not available";
+                       errlvl = ErrorLevel.ERROR;
+                       return false;
+               }
+
+               this.typename = element.package.name+"/"+element.full_name ();
+               return true;
+       }
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       GLib.Type type = typeof (Valadoc.ValdocOrg.TypeLinkInlineTaglet);
+       taglets.set ("link", type);
+       return type;
+}
+
diff --git a/src/doclets/valadoc.org/taglets/underline/taglet.vala b/src/doclets/valadoc.org/taglets/underline/taglet.vala
new file mode 100755 (executable)
index 0000000..258999f
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+
+public class Valadoc.ValdocOrg.UnderlinedDocElement : Valadoc.UnderlinedDocElement {
+       private Gee.ArrayList<DocElement> content;
+
+       public override bool parse (Gee.ArrayList<DocElement> content) {
+               this.content = content;
+               return true;
+       }
+
+       public override bool write (void* res, int max, int index) {
+               weak GLib.FileStream file = (GLib.FileStream)res;
+               int _max = this.content.size;
+               int _index = 0;
+
+               file.printf ("__");
+
+               foreach (DocElement element in this.content) {
+                       element.write (res, _max, _index);
+                       _index++;
+               }
+
+               file.printf ("__");
+               return true;
+       }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+       return typeof (Valadoc.ValdocOrg.UnderlinedDocElement);
+}
+
+
diff --git a/src/doclets/valadoc.org/taglets/version/Makefile.am b/src/doclets/valadoc.org/taglets/version/Makefile.am
deleted file mode 100644 (file)
index b80d1ae..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# src/Makefile.am
-
-
-
-libtagletversion_VALASOURCES = \
-       taglet.vala       \
-       $(NULL)
-
-
-BUILT_SOURCES = libtagletversion.vala.stamp
-
-
-libtagletversion.vala.stamp: $(libtagletversion_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
-       touch $@
-
-
-       
-
-tagletversiondir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
-
-tagletversion_LTLIBRARIES = libtagletversion.la
-
-
-libtagletversion_la_SOURCES =                \
-       libtagletversion.vala.stamp              \
-       $(libtagletversion_VALASOURCES:.vala=.c) \
-       $(libtagletversion_VALASOURCES:.vala=.h) \
-       $(NULL)
-
-
-
-AM_CFLAGS =  -g               \
-       -I ../../../../libvaladoc/   \
-       -I ../../../htmlhelpers/     \
-       -I ../../linkhelper/         \
-       -I ../../                    \
-       $(GLIB_CFLAGS)            \
-       $(LIBVALA_CFLAGS)         \
-       $(NULL)
-
-
-libtagletversion_la_LDFLAGS = -module -avoid-version
-
-
-libtagletversion_la_LIBADD =                 \
-       ../../../../libvaladoc/libvaladoc.la \
-       ../../linkhelper/libhtmlhelper.la    \
-       $(GLIB_LIBS)                      \
-       $(LIBVALA_LIBS)                   \
-       $(NULL)
-
-
-
-
-EXTRA_DIST = $(libtagletversion_VALASOURCES)  libtagletversion.vala.stamp 
index e608f11d7c80a5e59463c4595e6d790750971fcf..81fe5f808d28f626d45f4b77c665eedef8166c1f 100755 (executable)
@@ -30,17 +30,17 @@ public Valadoc.Class glib_error = null;
 
 public abstract class Valadoc.Basic : Object {
        public Valadoc.Settings settings {
-               construct set;
                protected get;
+               set;
        }
 
        public Basic parent {
-               construct set;
+               set;
                get;
        }
 
        public Tree head {
-               construct set;
+               set;
                get;
        }
 
@@ -59,7 +59,7 @@ public class Valadoc.Array : Basic {
                get;
        }
 
-       public Array ( Valadoc.Settings settings, Vala.ArrayType vtyperef, Basic parent, Tree head ) {
+       public Array (Valadoc.Settings settings, Vala.ArrayType vtyperef, Basic parent, Tree head) {
                this.settings = settings;
                this.vtype = vtyperef;
                this.parent = parent;
@@ -67,13 +67,13 @@ public class Valadoc.Array : Basic {
 
                Vala.DataType vntype = vtyperef.element_type;
                if ( vntype is Vala.ArrayType )
-                       this.data_type = new Array ( settings, (Vala.ArrayType)vntype, this, head );
+                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this, head);
                else
-                       this.data_type = new TypeReference ( settings, vntype, this, head );
+                       this.data_type = new TypeReference (settings, vntype, this, head);
        }
 
-       public void write ( Langlet langlet, void* ptr, DocumentedElement parent ) {
-               langlet.write_array ( this, ptr, parent);
+       public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
+               langlet.write_array (this, ptr, parent);
        }
 
        public void set_type_references () {
@@ -96,23 +96,23 @@ public class Valadoc.Pointer : Basic {
                get;
        }
 
-       public Pointer ( Valadoc.Settings settings, Vala.PointerType vtyperef, Basic parent, Tree head ) {
+       public Pointer (Valadoc.Settings settings, Vala.PointerType vtyperef, Basic parent, Tree head) {
                this.settings = settings;
                this.vtype = vtyperef;
                this.parent = parent;
                this.head = head;
 
                Vala.DataType vntype = vtype.base_type;
-               if ( vntype is Vala.PointerType )
-                       this.data_type = new Pointer ( settings, (Vala.PointerType)vntype, this, head );
-               else if ( vntype is Vala.ArrayType )
-                       this.data_type = new Array ( settings, (Vala.ArrayType)vntype, this, head );
+               if (vntype is Vala.PointerType)
+                       this.data_type = new Pointer (settings, (Vala.PointerType)vntype, this, head);
+               else if (vntype is Vala.ArrayType)
+                       this.data_type = new Array (settings, (Vala.ArrayType)vntype, this, head);
                else
-                       this.data_type = new TypeReference ( settings, vntype, this, head );
+                       this.data_type = new TypeReference (settings, vntype, this, head);
        }
 
-       public void write ( Langlet langlet, void* ptr, DocumentedElement parent ) {
-               langlet.write_pointer ( this, ptr, parent );
+       public void write (Langlet langlet, void* ptr, DocumentedElement parent) {
+               langlet.write_pointer (this, ptr, parent);
        }
 
        public void set_type_references () {
@@ -137,11 +137,11 @@ public abstract class Valadoc.DocumentedElement : Basic, Documented {
 
        public Namespace? nspace {
                get {
-                       if ( this._nspace == null ) {
+                       if (this._nspace == null) {
                                Valadoc.Basic ast = this;
-                               while ( ast is Valadoc.Namespace == false ) {
+                               while (ast is Valadoc.Namespace == false) {
                                        ast = ast.parent;
-                                       if ( ast == null )
+                                       if (ast == null)
                                                return null;
                                }
                                this._nspace = (Valadoc.Namespace)ast;
@@ -153,11 +153,11 @@ public abstract class Valadoc.DocumentedElement : Basic, Documented {
 
        public Package? package {
                get {
-                       if ( this._package == null ) {
+                       if (this._package == null) {
                                Valadoc.Basic ast = this;
-                               while ( ast is Valadoc.Package == false ) {
+                               while (ast is Valadoc.Package == false) {
                                        ast = ast.parent;
-                                       if ( ast == null )
+                                       if (ast == null)
                                                return null;
                                }
                                this._package = (Valadoc.Package)ast;
@@ -168,22 +168,16 @@ public abstract class Valadoc.DocumentedElement : Basic, Documented {
 
        public int line {
                get {
-                       if ( this._line == -1 ) {
+                       if (this._line == -1) {
                                Vala.SourceReference vsref = this.vsymbol.source_reference;
-                               this._line = ( vsref == null )? 0 : vsref.first_line;
+                               this._line = (vsref == null)? 0 : vsref.first_line;
                        }
                        return this._line;
                }
        }
 
-       protected string? comment_string  {
-               get {
-                       SourceReference sref = this.vsymbol.source_reference;
-                       if ( sref == null )
-                               return null;
-
-                       return sref.comment;
-               }
+       protected Vala.Comment vcomment {
+               get; set;
        }
 
        public DocumentationTree? documentation {
@@ -197,20 +191,20 @@ public abstract class Valadoc.DocumentedElement : Basic, Documented {
                }
        }
 
-       // rename to get_full_name, weak
+       // rename to get_full_name
        public string? full_name () {
-               if ( this._full_name == null ) {
-                       if ( this.name == null )
+               if (this._full_name == null) {
+                       if (this.name == null)
                                return null;
 
-                       GLib.StringBuilder full_name = new GLib.StringBuilder ( this.name );
+                       GLib.StringBuilder full_name = new GLib.StringBuilder (this.name);
 
-                       if ( this.parent != null ) {
-                               for ( Basic pos = this.parent; pos is Package == false ; pos = pos.parent ) {
+                       if (this.parent != null) {
+                               for (Basic pos = this.parent; pos is Package == false ; pos = pos.parent) {
                                        string name = ((DocumentedElement)pos).name;
-                                       if ( name != null ) {
-                                               full_name.prepend_unichar ( '.' );
-                                               full_name.prepend ( name );
+                                       if (name != null) {
+                                               full_name.prepend_unichar ('.');
+                                               full_name.prepend (name);
                                        }
                                }
                        }
@@ -1212,26 +1206,26 @@ public interface Valadoc.ConstantHandler : Basic {
 
        public Gee.ReadOnlyCollection<Constant> get_constant_list ( ) {
                var lstd = new Gee.ArrayList<Constant> ();
-               foreach ( Constant c in this.constants ) {
-                       if ( !c.is_type_visitor_accessible ( this ) )
+               foreach (Constant c in this.constants) {
+                       if (!c.is_type_visitor_accessible (this) )
                                continue ;
 
-                       lstd.add ( c );
+                       lstd.add (c);
                }
 
-               return new Gee.ReadOnlyCollection<Constant>( lstd );
+               return new Gee.ReadOnlyCollection<Constant>(lstd);
        }
 
        // internal
-       public void add_constants ( Gee.Collection<Vala.Constant> vconstants ) {
-               foreach ( Vala.Constant vc in vconstants ) {
-                       this.add_constant ( vc );
+       public void add_constants (Gee.Collection<Vala.Constant> vconstants) {
+               foreach (Vala.Constant vc in vconstants) {
+                       this.add_constant (vc);
                }
        }
 
        // internal
-       public void add_constant ( Vala.Constant vc ) {
-               var tmp = new Constant ( this.settings, vc, this, this.head );
+       public void add_constant (Vala.Constant vc) {
+               var tmp = new Constant (this.settings, vc, this, this.head);
                this.constants.add ( tmp );
        }
 
@@ -1526,6 +1520,7 @@ public class Valadoc.Constant : DocumentedElement, SymbolAccessibility, ReturnTy
        }
 
        public Constant ( Valadoc.Settings settings, Vala.Constant vconst, ConstantHandler parent, Tree head ) {
+               this.vcomment = vconst.comment;
                this.settings = settings;
                this.vsymbol = vconst;
                this.vconst = vconst;
@@ -1567,6 +1562,7 @@ public class Valadoc.Field : DocumentedElement, SymbolAccessibility, ReturnTypeH
        private Vala.Field vfield;
 
        public Field ( Valadoc.Settings settings, Vala.Field vfield, FieldHandler parent, Tree head ) {
+               this.vcomment = vfield.comment;
                this.settings = settings;
                this.vsymbol = vfield;
                this.vfield = vfield;
@@ -1960,12 +1956,12 @@ public class Valadoc.PropertyAccessor : Object {
        }
 
        public Tree head {
-               construct;
+               set;
                get;
        }
 
        public Settings settings {
-               construct;
+               set;
                get;
        }
 
@@ -1975,7 +1971,7 @@ public class Valadoc.PropertyAccessor : Object {
        }
 
        public Tree tree {
-               construct;
+               set;
                get;
        }
 
@@ -2021,33 +2017,37 @@ public class Valadoc.PropertyAccessor : Object {
                }
        }
 
-       public void write ( Langlet langlet, void* ptr ) {
-               langlet.write_property_accessor ( this, ptr );
+       public void write (Langlet langlet, void* ptr) {
+               langlet.write_property_accessor (this, ptr);
        }
 }
 
 public class Valadoc.Property : DocumentedElement, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable {
        private Vala.Property vproperty;
 
-       public Property ( Valadoc.Settings settings, Vala.Property vproperty, PropertyHandler parent, Tree head ) {
+       public Property (Valadoc.Settings settings, Vala.Property vproperty, PropertyHandler parent, Tree head) {
+               this.vcomment = vproperty.comment;
                this.settings = settings;
-               this.vproperty = vproperty;
-               this.vsymbol = vproperty;
                this.parent = parent;
                this.head = head;
 
+               this.vsymbol = vproperty;
+               this.vproperty = vproperty;
+
                var ret = this.vproperty.property_type;
-               this.set_ret_type ( ret );
+               this.set_ret_type (ret);
 
-               if ( this.vproperty.get_accessor != null )
-                       this.getter = new PropertyAccessor ( this.settings, this.vproperty.get_accessor, this, this.head );
+               if (this.vproperty.get_accessor != null) {
+                       this.getter = new PropertyAccessor (this.settings, this.vproperty.get_accessor, this, this.head);
+               }
 
-               if ( this.vproperty.set_accessor != null )
-                       this.setter = new PropertyAccessor ( this.settings, this.vproperty.set_accessor, this, this.head );
+               if (this.vproperty.set_accessor != null) {
+                       this.setter = new PropertyAccessor (this.settings, this.vproperty.set_accessor, this, this.head);
+               }
        }
 
-       public bool is_vproperty ( Vala.Property vprop ) {
-               return ( this.vproperty == vprop );
+       public bool is_vproperty (Vala.Property vprop) {
+               return (this.vproperty == vprop);
        }
 
        public string? get_cname () {
@@ -2098,26 +2098,22 @@ public class Valadoc.Property : DocumentedElement, SymbolAccessibility, ReturnTy
 
        // internal
        public void set_type_references ( ) {
-               if ( this.is_override ) {
-                       Vala.Property vp = ( this.vproperty.base_property == null )? this.vproperty.base_interface_property : this.vproperty.base_property;
-                       this.base_property = (Property?)this.head.search_vala_symbol ( vp );
+               if (this.is_override) {
+                       Vala.Property vp = (this.vproperty.base_property == null)? this.vproperty.base_interface_property : this.vproperty.base_property;
+                       this.base_property = (Property?)this.head.search_vala_symbol (vp);
                }
                this.set_return_type_references ( );
        }
 
-       public void parse_comment ( Valadoc.Parser docparser ) {
-               if ( this.documentation != null )
+       public void parse_comment (Valadoc.Parser docparser) {
+               if (this.documentation != null)
                        return ;
 
-               if ( this.comment_string == null )
-                       return ;
-
-               bool tmp = Parser.is_documentation ( this.comment_string );
-               if ( tmp == false )
+               if (this.vcomment == null)
                        return ;
 
                if ( this.is_override && docparser.is_inherit_doc ( this ) ) {
-                       this.base_property.parse_comment ( docparser );
+                       this.base_property.parse_comment (docparser);
                        this.documentation = this.base_property.documentation;
                        return ;
                }
@@ -2145,6 +2141,7 @@ public class Valadoc.Signal : DocumentedElement, ParameterListHandler, SymbolAcc
        public Signal ( Valadoc.Settings settings, Vala.Signal vsignal, SignalHandler parent, Tree head ) {
                this.param_list = new Gee.ArrayList<FormalParameter> ();
 
+               this.vcomment = vsignal.comment;
                this.settings = settings;
                this.vsymbol = vsignal;
                this.vsignal = vsignal;
@@ -2216,6 +2213,7 @@ public class Valadoc.Method : DocumentedElement, ParameterListHandler, Exception
                this.param_list = new Gee.ArrayList<FormalParameter>();
                this.err_domains = new Gee.ArrayList<DocumentedElement>();
 
+               this.vcomment = vmethod.comment;
                this.settings = settings;
                this.vsymbol = vmethod;
                this.vmethod = vmethod;
@@ -2266,12 +2264,6 @@ public class Valadoc.Method : DocumentedElement, ParameterListHandler, Exception
                get;
        }
 
-       public string? comment_str {
-               owned get {
-                       return this.vmethod.source_reference.comment;
-               }
-       }
-
        // intern
        public bool equals ( Method m ) {
                return ( m.vmethod == this.vmethod );
@@ -2279,14 +2271,10 @@ public class Valadoc.Method : DocumentedElement, ParameterListHandler, Exception
 
        // intern
        public void parse_comment ( Valadoc.Parser docparser ) {
-               if ( this.documentation != null )
+               if (this.documentation != null)
                        return ;
 
-               if ( this.comment_string == null )
-                       return ;
-
-               bool tmp = Parser.is_documentation ( this.comment_string );
-               if ( tmp == false )
+               if (this.vcomment == null)
                        return ;
 
                if ( this.is_override && docparser.is_inherit_doc ( this ) ) {
@@ -2389,6 +2377,7 @@ public class Valadoc.EnumValue: DocumentedElement, Writeable {
        private Vala.EnumValue venval;
 
        public EnumValue ( Valadoc.Settings settings, Vala.EnumValue venval, Enum parent, Tree head ) {
+               this.vcomment = venval.comment;
                this.settings = settings;
                this.vsymbol = venval;
                this.venval = venval;
@@ -2423,6 +2412,7 @@ public class Valadoc.ErrorCode : DocumentedElement, Writeable {
        private Vala.ErrorCode verrcode;
 
        public ErrorCode ( Valadoc.Settings settings, Vala.ErrorCode verrcode, ErrorDomain parent, Tree head ) {
+               this.vcomment = verrcode.comment;
                this.settings = settings;
                this.verrcode = verrcode;
                this.vsymbol = verrcode;
@@ -2461,6 +2451,7 @@ public class Valadoc.Delegate : DocumentedElement, SymbolAccessibility, Visitabl
                this.param_list = new Gee.ArrayList<FormalParameter>();
                this.err_domains = new Gee.ArrayList<DocumentedElement>();
 
+               this.vcomment = vdelegate.comment;
                this.settings = settings;
                this.vdelegate = vdelegate;
                this.vsymbol = vdelegate;
@@ -2548,6 +2539,7 @@ public class Valadoc.Class : DocumentedElement, SymbolAccessibility, Writeable,
                this.parent_types = new Gee.ArrayList<Interface>();
                this.methods = new Gee.ArrayList<Method> ();
 
+               this.vcomment = vclass.comment;
                this.settings = settings;
                this.vsymbol = vclass;
                this.vclass = vclass;
@@ -2769,12 +2761,6 @@ public class Valadoc.Class : DocumentedElement, SymbolAccessibility, Writeable,
                return null;
        }
 
-       public string? comment_str {
-               owned get {
-                       return this.vclass.source_reference.comment;
-               }
-       }
-
        // internal
        public bool is_vclass ( Vala.Class vcl ) {
                return this.vclass == vcl;
@@ -2802,16 +2788,13 @@ public class Valadoc.Class : DocumentedElement, SymbolAccessibility, Writeable,
                if ( this.documentation != null )
                        return ;
 
-               if ( this.comment_string != null ) {
-                       bool tmp = docparser.is_documentation ( this.comment_string );
-                       if ( tmp == true ) {
-                               if ( docparser.is_inherit_doc ( this ) && this.base_type != null ) {
-                                       ((Class)this.base_type).parse_comments ( docparser );
-                                       this.documentation = this.base_type.documentation;
-                               }
-                               else {
-                                       this.parse_comment_helper ( docparser );
-                               }
+               if ( this.vcomment != null ) {
+                       if ( docparser.is_inherit_doc ( this ) && this.base_type != null ) {
+                               ((Class)this.base_type).parse_comments ( docparser );
+                               this.documentation = this.base_type.documentation;
+                       }
+                       else {
+                               this.parse_comment_helper ( docparser );
                        }
                }
 
@@ -2956,6 +2939,7 @@ public class Valadoc.ErrorDomain : DocumentedElement, SymbolAccessibility, Visit
        private Vala.ErrorDomain verrdom;
 
        public ErrorDomain ( Valadoc.Settings settings, Vala.ErrorDomain verrdom, ErrorDomainHandler parent, Tree head ) {
+               this.vcomment = verrdom.comment;
                this.settings = settings;
                this.vsymbol = verrdom;
                this.verrdom = verrdom;
@@ -3103,6 +3087,7 @@ public class Valadoc.ErrorDomain : DocumentedElement, SymbolAccessibility, Visit
 
 public class Valadoc.Enum : DocumentedElement, SymbolAccessibility, Visitable, Writeable, MethodHandler {
        public Enum ( Valadoc.Settings settings, Vala.Enum venum, EnumHandler parent, Tree head ) {
+               this.vcomment = venum.comment;
                this.settings = settings;
                this.vsymbol = venum;
                this.venum = venum;
@@ -3258,7 +3243,8 @@ public class Valadoc.Enum : DocumentedElement, SymbolAccessibility, Visitable, W
 
 
 public class Valadoc.Struct : DocumentedElement, SymbolAccessibility, Writeable, Visitable, MethodHandler, ConstructionMethodHandler, FieldHandler, ConstantHandler, Inheritable, TemplateParameterListHandler {
-       public Struct ( Valadoc.Settings settings, Vala.Struct vstruct, StructHandler parent, Tree head ) {
+       public Struct (Valadoc.Settings settings, Vala.Struct vstruct, StructHandler parent, Tree head) {
+               this.vcomment = vstruct.comment;
                this.settings = settings;
                this.vstruct = vstruct;
                this.vsymbol = vstruct;
@@ -3269,19 +3255,19 @@ public class Valadoc.Struct : DocumentedElement, SymbolAccessibility, Writeable,
                this.methods = new Gee.ArrayList<Method> ();
 
                var vtparams = this.vstruct.get_type_parameters ();
-               this.set_template_parameter_list ( vtparams );
+               this.set_template_parameter_list (vtparams);
 
                Gee.Collection<Vala.Field> vfields = this.vstruct.get_fields();
                this.fields = new Gee.ArrayList<Field> ();
-               this.add_fields ( vfields );
+               this.add_fields (vfields);
 
                Gee.Collection<Vala.Constant> vconstants = this.vstruct.get_constants();
                this.constants = new Gee.ArrayList<Constant> ();
-               this.add_constants ( vconstants );
+               this.add_constants (vconstants);
 
                Gee.Collection<Vala.Method> vmethods = this.vstruct.get_methods ();
                this.construction_methods = new Gee.ArrayList<Method>();
-               this.add_methods_and_construction_methods ( vmethods );
+               this.add_methods_and_construction_methods (vmethods);
        }
 
        protected Inheritable? base_type {
@@ -3378,12 +3364,6 @@ public class Valadoc.Struct : DocumentedElement, SymbolAccessibility, Writeable,
                return this.search_construction_method ( params, pos );
        }
 
-       public string? comment_str {
-               owned get {
-                       return this.vstruct.source_reference.comment;
-               }
-       }
-
        private Vala.Struct vstruct;
 
        // internal
@@ -3395,41 +3375,37 @@ public class Valadoc.Struct : DocumentedElement, SymbolAccessibility, Writeable,
                if ( !this.is_visitor_accessible ( ) )
                        return ;
 
-               doclet.visit_struct ( this );
+               doclet.visit_struct (this);
        }
 
-       public void write ( Langlet langlet, void* ptr ) {
-               langlet.write_struct ( this, ptr );
+       public void write (Langlet langlet, void* ptr) {
+               langlet.write_struct (this, ptr);
        }
 
        // internal
-       public void parse_comments ( Valadoc.Parser docparser ) {
-               if ( this.documentation != null )
+       public void parse_comments (Valadoc.Parser docparser) {
+               if (this.documentation != null)
                        return ;
 
-
-               if ( this.comment_string != null ) {
-                       bool tmp = Parser.is_documentation ( this.comment_string );
-                       if ( tmp == true ) {
-                               if ( docparser.is_inherit_doc ( this ) && this.base_type != null ) {
-                                       ((Valadoc.Struct)this.base_type).parse_comments ( docparser );
-                                       this.documentation = this.base_type.documentation;
-                               }
-                               else {
-                                       this.parse_comment_helper ( docparser );
-                               }
+               if (this.vcomment != null) {
+                       if ( docparser.is_inherit_doc (this) && this.base_type != null) {
+                               ((Valadoc.Struct)this.base_type).parse_comments (docparser);
+                               this.documentation = this.base_type.documentation;
+                       }
+                       else {
+                               this.parse_comment_helper (docparser);
                        }
                }
 
-               this.parse_construction_method_comments ( docparser );
-               this.parse_constant_comments ( docparser );
-               this.parse_method_comments ( docparser );
-               this.parse_field_comments ( docparser );
+               this.parse_construction_method_comments (docparser);
+               this.parse_constant_comments (docparser);
+               this.parse_method_comments (docparser);
+               this.parse_field_comments (docparser);
        }
 
        private void set_parent_references ( ) {
                Vala.ValueType? basetype = (Vala.ValueType?)this.vstruct.base_type;
-               if ( basetype == null )
+               if (basetype == null)
                        return ;
 
                this.base_type = (Struct?)this.head.search_vala_symbol ( (Vala.Struct)basetype.type_symbol );
@@ -3448,7 +3424,8 @@ public class Valadoc.Struct : DocumentedElement, SymbolAccessibility, Writeable,
 
 
 public class Valadoc.Interface : DocumentedElement, SymbolAccessibility, Writeable, Visitable, SignalHandler, PropertyHandler, FieldHandler, TemplateParameterListHandler, MethodHandler, DelegateHandler, EnumHandler, StructHandler, ClassHandler, Inheritable {
-       public Interface ( Valadoc.Settings settings, Vala.Interface vinterface, InterfaceHandler parent, Tree head ) {
+       public Interface (Valadoc.Settings settings, Vala.Interface vinterface, InterfaceHandler parent, Tree head) {
+               this.vcomment = vinterface.comment;
                this.settings = settings;
                this.vinterface = vinterface;
                this.vsymbol = vinterface;
@@ -3459,39 +3436,39 @@ public class Valadoc.Interface : DocumentedElement, SymbolAccessibility, Writeab
                this.methods = new Gee.ArrayList<Method> ();
 
                var vtparams = this.vinterface.get_type_parameters ();
-               this.set_template_parameter_list ( vtparams );
+               this.set_template_parameter_list (vtparams);
 
                Gee.Collection<Vala.Method> methods = this.vinterface.get_methods ();
                this.methods = new Gee.ArrayList<Method>();
-               this.add_methods ( methods );
+               this.add_methods (methods);
 
                Gee.Collection<Vala.Delegate> delegates = this.vinterface.get_delegates ();
                this.delegates = new Gee.ArrayList<Delegate>();
-               this.add_delegates ( delegates );
+               this.add_delegates (delegates);
 
                Gee.Collection<Vala.Signal> signals = this.vinterface.get_signals();
                this.signals = new Gee.ArrayList<Signal>();
-               this.add_signals ( signals );
+               this.add_signals (signals);
 
                Gee.Collection<Vala.Property> properties = this.vinterface.get_properties();
                this.properties = new Gee.ArrayList<Property>();
-               this.add_properties ( properties );
+               this.add_properties (properties);
 
                Gee.Collection<Vala.Field> fields = this.vinterface.get_fields();
                this.fields = new Gee.ArrayList<Field>();
-               this.add_fields ( fields );
+               this.add_fields (fields);
 
                Gee.Collection<Vala.Struct> structs = this.vinterface.get_structs();
                this.structs = new Gee.ArrayList<Struct>();
-               this.add_structs ( structs );
+               this.add_structs (structs);
 
                Gee.Collection<Vala.Class> classes = this.vinterface.get_classes();
                this.classes = new Gee.ArrayList<Class>();
-               this.add_classes ( classes );
+               this.add_classes (classes);
 
                Gee.Collection<Vala.Enum> enums = this.vinterface.get_enums();
                this.enums = new Gee.ArrayList<Enum>();
-               this.add_enums ( enums );
+               this.add_enums (enums);
        }
 
        private Gee.ArrayList<Interface> parent_types = new Gee.ArrayList<Interface>();
@@ -3642,12 +3619,6 @@ public class Valadoc.Interface : DocumentedElement, SymbolAccessibility, Writeab
                return null;
        }
 
-       public string? comment_str {
-               owned get {
-                       return this.vinterface.source_reference.comment;
-               }
-       }
-
        // internal
        public bool is_vinterface ( Vala.Interface viface ) {
                return ( this.vinterface == viface );
@@ -3900,61 +3871,71 @@ public class Valadoc.Namespace : DocumentedElement, MethodHandler, FieldHandler,
                this.errdoms = new Gee.ArrayList<ErrorDomain>();
                this.enums = new Gee.ArrayList<Enum>();
                this.fields = new Gee.ArrayList<Field> ();
+
+               if (vnspace.source_reference != null) {
+                       var vfile = vnspace.source_reference.file;
+                       foreach (Comment c in vnspace.get_comments()) {
+                               if (this.package.is_vpackage (c.source_reference.file)) {
+                                       this.vcomment = c;
+                                       break;
+                               }
+                       }
+               }
        }
 
-       public void visit ( Doclet doclet ) {
-               doclet.visit_namespace ( this );
+       public void visit (Doclet doclet) {
+               doclet.visit_namespace (this);
        }
 
        public Vala.Namespace vnspace {
-               construct set;
                private get;
+               set;
        }
 
        // internal
        public void set_type_references ( ) {
-               this.set_errordomain_type_referenes ( );
-               this.set_namespace_type_references ( );
-               this.set_interface_type_references ( );
-               this.set_delegate_type_references ( );
-               this.set_constant_type_references ( );
-               this.set_method_type_references ( );
-               this.set_field_type_references ( );
-               this.set_struct_type_references ( );
-               this.set_class_type_references ( );
-               this.set_enum_type_references ( );
+               this.set_errordomain_type_referenes ();
+               this.set_namespace_type_references ();
+               this.set_interface_type_references ();
+               this.set_delegate_type_references ();
+               this.set_constant_type_references ();
+               this.set_method_type_references ();
+               this.set_field_type_references ();
+               this.set_struct_type_references ();
+               this.set_class_type_references ();
+               this.set_enum_type_references ();
        }
 
        // internal
-       public void inheritance ( ) {
-               this.namespace_inheritance ( );
-               foreach ( Class cl in this.classes ) {
-                       cl.inheritance ( );
+       public void inheritance () {
+               this.namespace_inheritance ();
+               foreach (Class cl in this.classes) {
+                       cl.inheritance ();
                }
        }
 
        // internal
-       public void parse_comments ( Valadoc.Parser docparser ) {
-               //this.parse_comment_helper ( docparser );
-               this.parse_enum_comments ( docparser );
-               this.parse_field_comments ( docparser );
-               this.parse_class_comments ( docparser );
-               this.parse_method_comments ( docparser );
-               this.parse_struct_comments ( docparser );
-               this.parse_constant_comments ( docparser );
-               this.parse_delegate_comments ( docparser );
-               this.parse_interface_comments ( docparser );
-               this.parse_namespace_comments ( docparser );
-               this.parse_errordomain_comments ( docparser );
+       public void parse_comments (Valadoc.Parser docparser) {
+               this.parse_comment_helper (docparser);
+               this.parse_enum_comments (docparser);
+               this.parse_field_comments (docparser);
+               this.parse_class_comments (docparser);
+               this.parse_method_comments (docparser);
+               this.parse_struct_comments (docparser);
+               this.parse_constant_comments (docparser);
+               this.parse_delegate_comments (docparser);
+               this.parse_interface_comments (docparser);
+               this.parse_namespace_comments (docparser);
+               this.parse_errordomain_comments (docparser);
        }
 
        // internal
        public bool is_vnspace ( Vala.Namespace vns ) {
-               return ( this.vnspace == vns );
+               return (this.vnspace == vns);
        }
 
-       public void write ( Langlet langlet, void* ptr ) {
-               langlet.write_namespace ( this, ptr );
+       public void write (Langlet langlet, void* ptr) {
+               langlet.write_namespace (this, ptr);
        }
 }
 
@@ -3963,8 +3944,8 @@ public class Valadoc.Package : DocumentedElement, NamespaceHandler {
        private Gee.ArrayList<Vala.SourceFile> vfiles = new Gee.ArrayList<Vala.SourceFile> ();
 
        // internal
-       public void add_file ( Vala.SourceFile vfile ) {
-               this.vfiles.add ( vfile );
+       public void add_file (Vala.SourceFile vfile) {
+               this.vfiles.add (vfile);
        }
 
        public Gee.ArrayList<Namespace> namespaces {
@@ -4028,19 +4009,19 @@ public class Valadoc.Package : DocumentedElement, NamespaceHandler {
                }
        }
 
-       public Package.with_name ( Valadoc.Settings settings, Vala.SourceFile vfile, string name, Tree head, bool is_package = false ) {
+       public Package.with_name (Valadoc.Settings settings, Vala.SourceFile vfile, string name, Tree head, bool is_package = false) {
+               this.is_package = is_package;
                this.settings = settings;
                this.head = head;
 
-               this.is_package = is_package;
                this.package_name = name;
 
-               this.vfiles.add ( vfile );
+               this.vfiles.add (vfile);
                this.parent = null;
        }
 
-       public Package ( Valadoc.Settings settings, Vala.SourceFile vfile, Tree head, bool is_package = false ) {
-               this.with_name ( settings, vfile, this.extract_package_name ( settings, vfile ), head, is_package );
+       public Package (Valadoc.Settings settings, Vala.SourceFile vfile, Tree head, bool is_package = false) {
+               this.with_name (settings, vfile, this.extract_package_name (settings, vfile), head, is_package);
        }
 
        private string package_name;
@@ -4052,28 +4033,30 @@ public class Valadoc.Package : DocumentedElement, NamespaceHandler {
        }
 
        // internal
-       public override DocumentedElement? search_element ( string[] params, int pos ) {
-               foreach ( Namespace ns in this.namespaces ) {
+       public override DocumentedElement? search_element (string[] params, int pos) {
+               foreach (Namespace ns in this.namespaces) {
                        DocumentedElement? element = ns.search_element ( params, pos );
-                       if ( element != null )
+                       if (element != null) {
                                return element;
+                       }
                }
                return null;
        }
 
        // internal
-       public override DocumentedElement? search_element_vala ( Gee.ArrayList<Vala.Symbol> params, int pos ) {
-               foreach ( Namespace ns in this.namespaces ) {
-                       DocumentedElement? element = ns.search_element_vala ( params, pos );
-                       if ( element != null )
+       public override DocumentedElement? search_element_vala (Gee.ArrayList<Vala.Symbol> params, int pos) {
+               foreach (Namespace ns in this.namespaces) {
+                       DocumentedElement? element = ns.search_element_vala (params, pos);
+                       if (element != null) {
                                return element;
+                       }
                }
                return null;
        }
 
        // internal
-       public bool is_vpackage ( Vala.SourceFile vfile ) {
-               return this.vfiles.contains ( vfile );
+       public bool is_vpackage (Vala.SourceFile vfile) {
+               return this.vfiles.contains (vfile);
        }
 
        public bool is_visitor_accessible () {
@@ -4102,8 +4085,8 @@ public class Valadoc.Package : DocumentedElement, NamespaceHandler {
                this.set_namespace_type_references ( );
        }
 
-       public void write ( Langlet langlet, void* ptr ) {
-               langlet.write_file ( this, ptr );
+       public void write (Langlet langlet, void* ptr) {
+               langlet.write_file (this, ptr);
        }
 }
 
@@ -4546,7 +4529,7 @@ public class Valadoc.Tree : Vala.CodeVisitor {
 
        public void parse_comments ( Valadoc.Parser docparser ) {
                this.wikitree = new WikiPageTree( this.reporter, this.settings );
-               wikitree.create_tree ( docparser );
+               wikitree.create_tree (docparser);
 
                foreach ( Package pkg in this.packages ) {
                        pkg.parse_comments( docparser );
old mode 100644 (file)
new mode 100755 (executable)
index b747c38..d60bdcc
@@ -60,54 +60,54 @@ public interface Valadoc.Documented : Object {
 
 
 public abstract class Valadoc.DocElement : Object {
-       public abstract bool write ( void* res, int max, int index );
+       public abstract bool write (void* res, int max, int index);
 }
 
 public abstract class Valadoc.Taglet : DocElement {
 }
 
 public abstract class Valadoc.InlineTaglet : Taglet {
-       public abstract bool parse ( Settings settings, Tree tree, Documented self, string content, ref ErrorLevel errlvl, out string? errmsg );
-       public abstract string to_string ( );
+       public abstract bool parse (Settings settings, Tree tree, Documented self, string content, ref ErrorLevel errlvl, out string? errmsg);
+       public abstract string to_string ();
 }
 
 public abstract class Valadoc.MainTaglet : Taglet {
        // remove
-       protected string? get_data_type ( DocumentedElement me ) {
-               if ( me is Valadoc.Class )
+       protected string? get_data_type (DocumentedElement me) {
+               if (me is Valadoc.Class)
                        return "class";
-               if ( me is Valadoc.Delegate )
+               if (me is Valadoc.Delegate)
                        return "delegate";
-               if ( me is Valadoc.Interface )
+               if (me is Valadoc.Interface)
                        return "interface";
-               if ( me is Valadoc.Method )
+               if (me is Valadoc.Method)
                        return "method";
-               if ( me is Valadoc.Property )
+               if (me is Valadoc.Property)
                        return "property";
-               if ( me is Valadoc.Signal )
+               if (me is Valadoc.Signal)
                        return "signal";
-               if ( me is Valadoc.Enum )
+               if (me is Valadoc.Enum)
                        return "enum";
-               if ( me is Valadoc.EnumValue )
+               if (me is Valadoc.EnumValue)
                        return "enum-value";
-               if ( me is Valadoc.ErrorDomain )
+               if (me is Valadoc.ErrorDomain)
                        return "errordomain";
-               if ( me is Valadoc.ErrorCode )
+               if (me is Valadoc.ErrorCode)
                        return "error-code";
-               if ( me is Valadoc.Field )
+               if (me is Valadoc.Field)
                        return "field";
-               if ( me is Valadoc.Constant )
+               if (me is Valadoc.Constant)
                        return "constant";
-               if ( me is Valadoc.Namespace )
+               if (me is Valadoc.Namespace)
                        return "namespace";
 
                return null;
        }
 
        public virtual int order { get { return 0; } }
-       public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg );
-       public abstract bool write_block_start ( void* res );
-       public abstract bool write_block_end ( void* res );
+       public abstract bool parse (Settings settings, Tree tree, DocumentedElement me, Gee.Collection<DocElement> content, ref ErrorLevel errlvl, out string errmsg);
+       public abstract bool write_block_start (void* res);
+       public abstract bool write_block_end (void* res);
 }
 
 
@@ -117,40 +117,40 @@ public abstract class Valadoc.StringTaglet : Taglet {
                protected set; get;
        }
 
-       public abstract bool parse ( string content );
+       public abstract bool parse (string content);
 }
 
 public abstract class Valadoc.HeadlineDocElement : DocElement {
-       public abstract bool parse ( owned string title, int lvl );
+       public abstract bool parse (owned string title, int lvl);
 }
 
 public abstract class Valadoc.ImageDocElement : DocElement {
-       public abstract bool parse ( Settings settings, Documented pos, owned string path, owned string alt );
+       public abstract bool parse (Settings settings, Documented pos, owned string path, owned string alt);
 }
 
 public abstract class Valadoc.LinkDocElement : DocElement {
-       public abstract bool parse ( Settings settings, Tree tree, Documented pos, owned string link, owned string desc );
+       public abstract bool parse (Settings settings, Tree tree, Documented pos, owned string link, owned string desc);
 }
 
 public abstract class Valadoc.SourceCodeDocElement : DocElement {
-       public abstract bool parse ( owned string src, Language lang );
+       public abstract bool parse (owned string src, Language lang);
 }
 
 public abstract class Valadoc.ListEntryDocElement : DocElement {
-       public abstract bool parse ( ListType type, Gee.ArrayList<DocElement> content );
+       public abstract bool parse (ListType type, long lvl, Gee.ArrayList<DocElement> content);
 }
 
 public abstract class Valadoc.ListDocElement : DocElement {
-       public abstract bool parse ( ListType type, Gee.ArrayList<ListEntryDocElement> entries );
+       public abstract bool parse (ListType type, Gee.ArrayList<ListEntryDocElement> entries);
 }
 
 public abstract class Valadoc.NotificationDocElement : DocElement {
-       public abstract bool parse ( Gee.ArrayList<DocElement> content );
+       public abstract bool parse (Gee.ArrayList<DocElement> content);
 }
 
 
 public abstract class Valadoc.HighlightedDocElement : DocElement {
-       public abstract bool parse ( Gee.ArrayList<DocElement> content );
+       public abstract bool parse (Gee.ArrayList<DocElement> content);
 }
 
 public abstract class Valadoc.ItalicDocElement : HighlightedDocElement {
@@ -165,7 +165,7 @@ public abstract class Valadoc.UnderlinedDocElement : HighlightedDocElement {
 
 
 public abstract class Valadoc.ContentPositionDocElement : DocElement {
-       public abstract bool parse ( Gee.ArrayList<DocElement> content );
+       public abstract bool parse (Gee.ArrayList<DocElement> content);
 }
 
 public abstract class Valadoc.CenterDocElement : ContentPositionDocElement {
@@ -175,11 +175,11 @@ public abstract class Valadoc.RightAlignedDocElement : ContentPositionDocElement
 }
 
 public abstract class Valadoc.TableCellDocElement : DocElement {
-       public abstract void parse ( TextPosition pos, TextVerticalPosition hpos, int size, int dsize, Gee.ArrayList<DocElement> content );
+       public abstract void parse (TextPosition pos, TextVerticalPosition hpos, int size, int dsize, Gee.ArrayList<DocElement> content);
 }
 
 public abstract class Valadoc.TableDocElement : DocElement {
-       public abstract void parse ( Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> cells );
+       public abstract void parse (Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> cells);
 }
 
 
@@ -189,10 +189,10 @@ public class Valadoc.DocumentationTree : Object {
        private Gee.ArrayList<DocElement> description = new Gee.ArrayList<DocElement> ();
        private Gee.ArrayList<DocElement> brief = new Gee.ArrayList<DocElement> ();
        private Gee.HashMap<Type, Gee.ArrayList<MainTaglet> > taglets
-               = new Gee.HashMap<Type, Gee.ArrayList<MainTaglet> > ( );
+               = new Gee.HashMap<Type, Gee.ArrayList<MainTaglet> > ();
 
-       public void add_taglet ( MainTaglet taglet ) {
-               if ( this.taglets.contains ( taglet.get_type() ) ) {
+       public void add_taglet (MainTaglet taglet) {
+               if ( this.taglets.contains (taglet.get_type())) {
                        ArrayList<MainTaglet> lst = this.taglets.get(taglet.get_type());
                        lst.add(taglet);
                }
@@ -203,51 +203,51 @@ public class Valadoc.DocumentationTree : Object {
                }
        }
 
-       public void add_taglets ( Collection<MainTaglet> taglets ) {
-               foreach (MainTaglet tag in taglets ) {
+       public void add_taglets (Collection<MainTaglet> taglets) {
+               foreach (MainTaglet tag in taglets) {
                        this.add_taglet(tag);
                }
        }
 
        public Gee.ReadOnlyCollection<DocElement> get_brief ( ) {
-               return new Gee.ReadOnlyCollection<DocElement> ( (this.brief == null)? new Gee.ArrayList<DocElement>() : this.brief );
+               return new Gee.ReadOnlyCollection<DocElement> ((this.brief == null)? new Gee.ArrayList<DocElement>() : this.brief);
        }
 
-       public void add_brief ( Gee.ArrayList<DocElement> content ) {
+       public void add_brief (Gee.ArrayList<DocElement> content) {
                this.brief = content;
        }
 
-       public Gee.ReadOnlyCollection<DocElement> get_description ( ) {
-               return new Gee.ReadOnlyCollection<DocElement> ( (this.description == null)? new Gee.ArrayList<DocElement>() : this.description );
+       public Gee.ReadOnlyCollection<DocElement> get_description () {
+               return new Gee.ReadOnlyCollection<DocElement> ((this.description == null)? new Gee.ArrayList<DocElement>() : this.description);
        }
 
-       public void add_description ( Gee.ArrayList<DocElement> content ) {
+       public void add_description (Gee.ArrayList<DocElement> content) {
                this.description = content;
        }
 
-       private static Gee.ArrayList< Gee.ArrayList<MainTaglet> > sort_tag_collection ( Gee.Collection< Gee.ArrayList<MainTaglet> > lst ) {
+       private static Gee.ArrayList< Gee.ArrayList<MainTaglet> > sort_tag_collection (Gee.Collection< Gee.ArrayList<MainTaglet> > lst) {
                Gee.ArrayList< Gee.ArrayList<MainTaglet> > slst
                        = new Gee.ArrayList< Gee.ArrayList<MainTaglet> > ();
 
-               foreach ( Gee.ArrayList<MainTaglet> entry in lst ) {
-                       slst.add ( entry );
+               foreach (Gee.ArrayList<MainTaglet> entry in lst) {
+                       slst.add (entry);
                }
 
                //<bublesort>
                int count = slst.size;
-               if ( count <= 0 )
+               if (count <= 0)
                        return slst;
 
-               for ( int i = 0; i < count; i++ ) {
-                       for ( int j = count-1; j>i; j-- ) {
-                               if ( slst.get(j).get(0).order < slst.get(j-1).get(0).order ) {
+               for (int i = 0; i < count; i++) {
+                       for (int j = count-1; j>i; j--) {
+                               if (slst.get(j).get(0).order < slst.get(j-1).get(0).order) {
                                        Gee.ArrayList<MainTaglet> tmp1 = slst.get(j-1);
                                        Gee.ArrayList<MainTaglet> tmp2 = slst.get(j);
 
-                                       slst.remove_at ( j );
-                                       slst.insert (j, tmp1 );
-                                       slst.remove_at ( j-1 );
-                                       slst.insert (j-1, tmp2 );
+                                       slst.remove_at (j);
+                                       slst.insert (j, tmp1);
+                                       slst.remove_at (j-1);
+                                       slst.insert (j-1, tmp2);
                                }
                        }
                }
@@ -255,31 +255,31 @@ public class Valadoc.DocumentationTree : Object {
                return slst;
        }
 
-       public bool write_brief ( void* res ) {
-               if ( this.brief == null )
+       public bool write_brief (void* res) {
+               if (this.brief == null)
                        return true;
 
                int _max = this.brief.size;
                int _index = 0;
 
-               foreach ( DocElement element in this.brief ) {
-                       element.write ( res, _max, _index );
+               foreach (DocElement element in this.brief) {
+                       element.write (res, _max, _index);
                        _index++;
                }
                return true;
        }
 
-       public bool write_content ( void* res ) {
-               if ( this.description == null )
+       public bool write_content (void* res) {
+               if (this.description == null)
                        return true;
 
                int max = this.description.size;
                int i = 0;
                bool tmp;
 
-               foreach ( DocElement tag in this.description ) {
-                       tmp = tag.write ( res, max, i );
-                       if ( tmp == false )
+               foreach (DocElement tag in this.description) {
+                       tmp = tag.write (res, max, i);
+                       if (tmp == false)
                                return false;
 
                        i++;
@@ -288,30 +288,28 @@ public class Valadoc.DocumentationTree : Object {
                Gee.Collection< Gee.ArrayList<MainTaglet> > lst = this.taglets.get_values ( );
                Gee.ArrayList< Gee.ArrayList<MainTaglet> > alst = sort_tag_collection ( lst );
 
-               foreach ( Gee.ArrayList<MainTaglet> tags in alst ) {
-                       MainTaglet ftag = tags.get ( 0 );
+               foreach (Gee.ArrayList<MainTaglet> tags in alst) {
+                       MainTaglet ftag = tags.get (0);
                        max = tags.size;
                        i = 0;
 
-                       tmp = ftag.write_block_start ( res );
-                       if ( tmp == false )
+                       tmp = ftag.write_block_start (res);
+                       if (tmp == false)
                                return false;
 
-                       foreach ( MainTaglet tag in tags ) {
-                               tmp = tag.write ( res, max, i );
+                       foreach (MainTaglet tag in tags) {
+                               tmp = tag.write (res, max, i);
                                if ( tmp == false )
                                        return false;
 
                                i++;
                        }
 
-                       tmp = ftag.write_block_end ( res );
-                       if ( tmp == false )
+                       tmp = ftag.write_block_end (res);
+                       if (tmp == false)
                                return false;
                }
                return true;
        }
 }
 
-
-
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index b306f6f..bba118f
@@ -52,8 +52,9 @@ public class Valadoc.ModuleLoader : Object {
 
        public bool load ( string path ) {
                bool tmp = this.load_doclet ( path );
-               if ( tmp == false )
+               if ( tmp == false ) {
                        return false;
+               }
 
                return this.load_taglets ( path );
        }
old mode 100644 (file)
new mode 100755 (executable)
index cf61627..f363f8e
@@ -10,7 +10,7 @@ public class Valadoc.Parser : Object {
        private ErrorReporter err;
        private Tree tree;
 
-       public Parser ( Settings settings, ErrorReporter reporter, Tree tree, ModuleLoader modules ) {
+       public Parser (Settings settings, ErrorReporter reporter, Tree tree, ModuleLoader modules) {
                this.settings = settings;
                this.modules = modules;
                this.err = reporter;
@@ -272,7 +272,7 @@ public class Valadoc.Parser : Object {
                return false;
        }
 
-       public bool parse_align_helper ( Documented curelement, string str, long strlen, Gee.ArrayList<DocElement> content, ref long npos, ref long nline, ref long nnewlinepos, ref long space, bool wikimode, GLib.Type tagtype, string tag ) {
+       private bool parse_align_helper ( Documented curelement, string str, long strlen, Gee.ArrayList<DocElement> content, ref long npos, ref long nline, ref long nnewlinepos, ref long space, bool wikimode, GLib.Type tagtype, string tag ) {
                long newlinepos = nnewlinepos;
                long line = nline;
                long pos = npos;
@@ -951,7 +951,6 @@ public class Valadoc.Parser : Object {
                nspace = space;
                nline = line;
                npos = pos;
-//Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> rows
                rows.add ( cells );
                return true;
        }
@@ -1025,13 +1024,17 @@ public class Valadoc.Parser : Object {
        }
 
        public bool is_inherit_doc ( DocumentedElement self ) {
-               weak string str = self.comment_string;
+               if (self.vcomment == null) {
+                       return false;
+               }
+
+               weak string str = self.vcomment.content;
 
-               if ( self.comment_string == null ) {
+               if ( str == null ) {
                        return false;
                }
 
-               if ( self.comment_string[0]!='*' ) {
+               if ( str[0]!='*' ) {
                        return false;
                }
 
@@ -1197,7 +1200,11 @@ public class Valadoc.Parser : Object {
        }
 
        public DocumentationTree? parse ( DocumentedElement self ) {
-               weak string str = self.comment_string;
+               if (self.vcomment == null) {
+                       return null;
+               }
+
+               weak string str = self.vcomment.content;
                if ( str == null ) {
                        return null;
                }
@@ -1416,11 +1423,11 @@ public class Valadoc.Parser : Object {
                        else if (this.parse_newline_pos (str, strlen, ref pos, ref line, ref newlinepos, wikimode)) {
                                break;
                        }
-                       else if (this.parse_inline_taglet_pos ( curelement, str, strlen, content, ref pos, ref line, ref newlinepos, wikimode )) {
-                               this.prepend_string_taglet ( str, strlen, content, ref startpos, pos, lpos, buf );
+                       else if (this.parse_inline_taglet_pos ( curelement, str, strlen, content, ref pos, ref line, ref newlinepos, wikimode)) {
+                               this.prepend_string_taglet (str, strlen, content, ref startpos, pos, lpos, buf);
                        }
-                       else if ( this.parse_url_pos ( curelement, str, strlen, content, ref pos, ref line, ref newlinepos ) ) {
-                               this.prepend_string_taglet ( str, strlen, content, ref startpos, pos, lpos, buf );
+                       else if ( this.parse_url_pos (curelement, str, strlen, content, ref pos, ref line, ref newlinepos)) {
+                               this.prepend_string_taglet (str, strlen, content, ref startpos, pos, lpos, buf);
                        }
                        //else if ( this.parse_img_pos ( content, ref pos, ref line, ref newlinepos ) ) {
                        //      this.prepend_string_taglet ( content, ref startpos, pos, lpos, buf );
@@ -1430,13 +1437,13 @@ public class Valadoc.Parser : Object {
                        }
                }
 
-               for ( space = pos, pos++; str[pos]==' '||str[pos]=='\t' ; pos++ );
-               this.append_string_taglet ( str, strlen, content, ref startpos, pos, lpos, buf );
+               for (space = pos, pos++; str[pos]==' '||str[pos]=='\t'; pos++);
+               this.append_string_taglet (str, strlen, content, ref startpos, pos, lpos, buf);
                space = pos-space;
 
-               ListEntryDocElement listeltag = (ListEntryDocElement)GLib.Object.new ( this.modules.ulistetag );
-               listeltag.parse ( listtype, content );
-               listelements.add ( listeltag );
+               ListEntryDocElement listeltag = (ListEntryDocElement)GLib.Object.new (this.modules.ulistetag);
+               listeltag.parse (listtype, newlinepos, content);
+               listelements.add (listeltag);
 
                npos = pos;
                return true;
old mode 100644 (file)
new mode 100755 (executable)