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);
}
}
}
}
}
+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;
+ }
+}
+
}
-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;
}
}
+public class Valadoc.Html.Italic : Valadoc.Html.InlineElement {
+ private static string mytag = "i";
+
+ public Italic () {
+ this.tag = mytag;
+ }
+}
+
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 ();
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;
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;
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 ();
api.add_childs (lst);
}
+ api.add_child (this.parents (stru));
api.add_child (new String (";"));
return api;
}
api.add_childs (lst);
}
+ api.add_child (this.parents (cl));
api.add_child (new String (";"));
return api;
}
api.add_childs (lst);
}
+ api.add_child (this.parents (iface));
api.add_child (new String (";"));
return api;
}
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;
}
-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);
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 ;
}
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);
}
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);
}
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);
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
}
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 ;
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) {
[ModuleInit]
public Type register_plugin ( ) {
- return typeof ( Valadoc.HtmlDoclet );
+ return typeof ( Valadoc.ValdocOrg.Doclet );
}
+++ /dev/null
-# src/Makefile.am
-
-NULL =
-
-
-SUBDIRS = \
- see \
- link \
- return \
- string \
- throws \
- version \
- parameter \
- $(NULL)
-
-
--- /dev/null
+/*
+ * 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 );
+}
+
--- /dev/null
+/*
+ * 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);
+}
+
--- /dev/null
+/*
+ * 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);
+}
+
--- /dev/null
+/*
+ * 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);
+}
+
* 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);
}
-
+++ /dev/null
-# 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
* 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);
}
-
--- /dev/null
+/*
+ * 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);
+}
+
+
--- /dev/null
+/*
+ * 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);
+}
+
+
--- /dev/null
+/*
+ * 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);
+}
+
+
+
+++ /dev/null
-# 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
* 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;
+}
+++ /dev/null
-# 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
* 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;
}
--- /dev/null
+/*
+ * 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);
+}
+
+++ /dev/null
-# 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
* 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;
}
+
--- /dev/null
+/*
+ * 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;
+}
+
--- /dev/null
+/*
+ * 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);
+}
+
+
+
+++ /dev/null
-# 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
* 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;
}
--- /dev/null
+/*
+ * 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);
+}
+
+
--- /dev/null
+/*
+ * 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);
+}
+
+
+++ /dev/null
-# 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
* 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;
}
--- /dev/null
+/*
+ * 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;
+}
+
--- /dev/null
+/*
+ * 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);
+}
+
+
+++ /dev/null
-# 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
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;
}
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;
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 () {
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 () {
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;
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;
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 {
}
}
- // 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);
}
}
}
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 );
}
}
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;
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;
}
public Tree head {
- construct;
+ set;
get;
}
public Settings settings {
- construct;
+ set;
get;
}
}
public Tree tree {
- construct;
+ set;
get;
}
}
}
- 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 () {
// 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 ;
}
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;
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;
get;
}
- public string? comment_str {
- owned get {
- return this.vmethod.source_reference.comment;
- }
- }
-
// intern
public bool equals ( Method m ) {
return ( m.vmethod == this.vmethod );
// 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 ) ) {
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;
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;
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;
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;
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;
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 );
}
}
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;
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;
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;
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 {
return this.search_construction_method ( params, pos );
}
- public string? comment_str {
- owned get {
- return this.vstruct.source_reference.comment;
- }
- }
-
private Vala.Struct vstruct;
// internal
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 );
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;
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>();
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 );
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);
}
}
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 {
}
}
- 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;
}
// 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 () {
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);
}
}
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 );
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);
}
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 {
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 {
}
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);
}
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);
}
}
}
- 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);
}
}
}
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++;
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;
}
}
-
-
public bool load ( string path ) {
bool tmp = this.load_doclet ( path );
- if ( tmp == false )
+ if ( tmp == false ) {
return false;
+ }
return this.load_taglets ( path );
}
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;
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;
nspace = space;
nline = line;
npos = pos;
-//Gee.ArrayList<Gee.ArrayList<TableCellDocElement>> rows
rows.add ( cells );
return true;
}
}
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;
}
}
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;
}
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 );
}
}
- 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;