From: Florian Brosch Date: Wed, 14 Jan 2009 00:57:23 +0000 (+0000) Subject: - new mysql-based valadoc.org doclet (--enable-valadocorg) - trivial X-Git-Tag: 0.37.1~3^2~607 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ac71467c4ce124d4b81d7d68a42908f64fa4c5;p=thirdparty%2Fvala.git - new mysql-based valadoc.org doclet (--enable-valadocorg) - trivial - new mysql-based valadoc.org doclet (--enable-valadocorg) - trivial cleanups - vala-0.5.5-emigration - delegate exception lists svn path=/trunk/; revision=27 --- diff --git a/configure.in b/configure.in index 578cdc663..38ac4eee9 100644 --- a/configure.in +++ b/configure.in @@ -12,6 +12,22 @@ AC_PROG_LIBTOOL AC_PATH_PROG(VALAC, valac, valac) AC_SUBST(VALAC) + + +AC_ARG_ENABLE(valadocorg, AS_HELP_STRING([--enable-valadocorg], []), enable_valadocorg=$enableval, enable_valadocorg=no) +AM_CONDITIONAL(ENABLE_VALADOCORG, test x$enable_valadocorg = xyes) + + + +if test x$enable_valadocorg = xyes; then + AC_CHECK_PROGS(YACC, mysql_config, :) + if test "$YACC" = :; then + AC_MSG_ERROR([mysql_config not found but required]) + fi +fi + + + # Checks for libraries. LIBVALA_REQUIRED=0.3.4 LIBGVC_REQUIRED=2.16 @@ -19,6 +35,7 @@ GLIB_REQUIRED=2.12.0 GTK_REQUIRED=2.10.0 LIBXML2_REQUIRED=2.0 + PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED ) AC_SUBST(LIBXML2_CFLAGS) AC_SUBST(LIBXML2_LIBS) @@ -41,6 +58,8 @@ AC_SUBST(LIBVALA_LIBS) + + # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. @@ -81,16 +100,7 @@ AC_CONFIG_FILES([Makefile src/doclets/html/taglets/listelement/Makefile src/doclets/html/taglets/cell/Makefile src/doclets/valadoc.org/Makefile - src/doclets/valadoc.org/linkhelper/Makefile src/doclets/valadoc.org/doclet/Makefile - src/doclets/valadoc.org/taglets/Makefile - src/doclets/valadoc.org/taglets/parameter/Makefile - src/doclets/valadoc.org/taglets/version/Makefile - src/doclets/valadoc.org/taglets/throws/Makefile - src/doclets/valadoc.org/taglets/return/Makefile - src/doclets/valadoc.org/taglets/string/Makefile - src/doclets/valadoc.org/taglets/link/Makefile - src/doclets/valadoc.org/taglets/see/Makefile src/doclets/devhelp/Makefile src/doclets/devhelp/taglets/image/Makefile src/doclets/devhelp/taglets/notification/Makefile diff --git a/src/doclets/devhelp/doclet/Makefile.am b/src/doclets/devhelp/doclet/Makefile.am index 411b38090..a9b2b4f54 100644 --- a/src/doclets/devhelp/doclet/Makefile.am +++ b/src/doclets/devhelp/doclet/Makefile.am @@ -12,7 +12,7 @@ BUILT_SOURCES = libdoclet.vala.stamp libdoclet.vala.stamp: $(libdoclet_VALASOURCES) - $(VALAC) -C --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --vapidir ../linkhelper --pkg libxml-2.0 --pkg libhtmlhelper-1.0 --vapidir . --pkg docletconfig --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --vapidir ../linkhelper --pkg libxml-2.0 --pkg libhtmlhelper-1.0 --vapidir . --pkg docletconfig --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/doclet/template.vala b/src/doclets/devhelp/doclet/template.vala index 9db0f0118..74d6e538a 100644 --- a/src/doclets/devhelp/doclet/template.vala +++ b/src/doclets/devhelp/doclet/template.vala @@ -26,7 +26,7 @@ using Gee; public class Valadoc.LangletIndex : Valadoc.BasicHtmlLanglet, Valadoc.HtmlHelper { - protected override string get_link ( Basic element, Basic pos ) { + protected override string get_link ( DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( this.settings, element, pos ); } @@ -150,23 +150,23 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.HtmlHelper { private string package_dir_name = ""; private DevhelpFormat devhelp; - protected override string get_link ( Valadoc.Basic p1, Valadoc.Basic? p2 ) { + protected override string get_link ( DocumentedElement p1, DocumentedElement? p2 ) { return this.get_html_link ( this.settings, p1, p2 ); } - private string get_path ( Valadoc.Basic element ) { + private string get_path ( DocumentedElement element ) { return element.full_name () + ".html"; } - private string get_real_path ( Valadoc.Basic element ) { + private string get_real_path ( DocumentedElement element ) { return this.settings.get_real_path ( ) + "/" + this.package_dir_name + "/" + element.full_name () + ".html"; } - protected override string get_img_path ( Valadoc.Basic element ) { + protected override string get_img_path ( DocumentedElement element ) { return "img/" + element.full_name () + ".png"; } - protected override string get_img_real_path ( Valadoc.Basic element ) { + protected override string get_img_real_path ( DocumentedElement element ) { return this.settings.get_real_path ( ) + "/" + this.package_dir_name + "/" + "img/" + element.full_name () + ".png"; } @@ -175,7 +175,7 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.HtmlHelper { protected get; } - public override void initialisation ( Settings settings ) { + public override void initialisation ( Settings settings, Tree tree ) { this.settings = settings; var rt = DirUtils.create ( this.settings.path, 0777 ); @@ -183,6 +183,11 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.HtmlHelper { this.langlet = new Valadoc.LangletIndex ( settings ); this.devhelp = new DevhelpFormat ( settings.pkg_name, "" ); + + Gee.ReadOnlyCollection packages = tree.get_package_list (); + foreach ( Package pkg in packages ) { + pkg.visit ( this ); + } } public override void visit_package ( Package file ) { @@ -313,7 +318,6 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.HtmlHelper { GLib.FileStream file = GLib.FileStream.open ( rpath, "w"); this.write_file_header ( file, "style.css", stru.full_name() ); - // HIER CRASHT ES!! this.write_struct_content ( file, stru, stru ); this.write_file_footer ( file ); file = null; diff --git a/src/doclets/devhelp/linkhelper/Makefile.am b/src/doclets/devhelp/linkhelper/Makefile.am index 3bae029c2..1e334d271 100644 --- a/src/doclets/devhelp/linkhelper/Makefile.am +++ b/src/doclets/devhelp/linkhelper/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libhtmlhelper.vala.stamp libhtmlhelper.vala.stamp: $(libhtmlhelper_VALASOURCES) - $(VALAC) -C --library libhtmlhelper-1.0 --basedir . --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --disable-non-null $^ + $(VALAC) -C --library libhtmlhelper-1.0 --basedir . --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 $^ touch $@ diff --git a/src/doclets/devhelp/linkhelper/helper.vala b/src/doclets/devhelp/linkhelper/helper.vala index a9bb6bd0e..355523e97 100755 --- a/src/doclets/devhelp/linkhelper/helper.vala +++ b/src/doclets/devhelp/linkhelper/helper.vala @@ -23,7 +23,7 @@ using GLib; public interface Valadoc.HtmlHelper { - protected string? get_html_link ( Settings settings, Basic element, Basic pos ) { + protected string? get_html_link ( Settings settings, DocumentedElement element, DocumentedElement? pos ) { if ( element is Package ) { return "../" + element.name + "/index.html"; } @@ -32,12 +32,12 @@ public interface Valadoc.HtmlHelper { string prefix = ""; if ( element != pos ) { - prefix = "../" + element.file.name; + prefix = "../" + element.package.name; } if ( element is Valadoc.EnumValue || element is Valadoc.ErrorCode ) { tmp = "#" + element.name; - element = element.parent; + element = (DocumentedElement)element.parent; } return prefix + "/" + element.full_name () + ".html" + tmp; diff --git a/src/doclets/devhelp/taglets/bold/Makefile.am b/src/doclets/devhelp/taglets/bold/Makefile.am index e68a766a1..1bfa5340b 100755 --- a/src/doclets/devhelp/taglets/bold/Makefile.am +++ b/src/doclets/devhelp/taglets/bold/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletbold.vala.stamp libtagletbold.vala.stamp: $(libtagletbold_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/cell/Makefile.am b/src/doclets/devhelp/taglets/cell/Makefile.am index 76b04a1d3..e6beb744f 100755 --- a/src/doclets/devhelp/taglets/cell/Makefile.am +++ b/src/doclets/devhelp/taglets/cell/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtaglettablecell.vala.stamp libtaglettablecell.vala.stamp: $(libtaglettablecell_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/center/Makefile.am b/src/doclets/devhelp/taglets/center/Makefile.am index 83ac7abb7..757a2c061 100755 --- a/src/doclets/devhelp/taglets/center/Makefile.am +++ b/src/doclets/devhelp/taglets/center/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletcenter.vala.stamp libtagletcenter.vala.stamp: $(libtagletcenter_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/image/Makefile.am b/src/doclets/devhelp/taglets/image/Makefile.am index 93677c6b9..71a91f172 100755 --- a/src/doclets/devhelp/taglets/image/Makefile.am +++ b/src/doclets/devhelp/taglets/image/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletimage.vala.stamp libtagletimage.vala.stamp: $(libtagletimage_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/italic/Makefile.am b/src/doclets/devhelp/taglets/italic/Makefile.am index de4c29f71..01b1e5f8b 100755 --- a/src/doclets/devhelp/taglets/italic/Makefile.am +++ b/src/doclets/devhelp/taglets/italic/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletitalic.vala.stamp libtagletitalic.vala.stamp: $(libtagletitalic_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/link/Makefile.am b/src/doclets/devhelp/taglets/link/Makefile.am index da02537fa..333c1a4fa 100644 --- a/src/doclets/devhelp/taglets/link/Makefile.am +++ b/src/doclets/devhelp/taglets/link/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/list/Makefile.am b/src/doclets/devhelp/taglets/list/Makefile.am index e459923b0..71980f114 100755 --- a/src/doclets/devhelp/taglets/list/Makefile.am +++ b/src/doclets/devhelp/taglets/list/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletlist.vala.stamp libtagletlist.vala.stamp: $(libtagletlist_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/listelement/Makefile.am b/src/doclets/devhelp/taglets/listelement/Makefile.am index d797618b8..5eead8a94 100755 --- a/src/doclets/devhelp/taglets/listelement/Makefile.am +++ b/src/doclets/devhelp/taglets/listelement/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletlistelement.vala.stamp libtagletlistelement.vala.stamp: $(libtagletlistelement_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/notification/Makefile.am b/src/doclets/devhelp/taglets/notification/Makefile.am index dc65d0143..3e26848fc 100755 --- a/src/doclets/devhelp/taglets/notification/Makefile.am +++ b/src/doclets/devhelp/taglets/notification/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletnotification.vala.stamp libtagletnotification.vala.stamp: $(libtagletnotification_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/parameter/Makefile.am b/src/doclets/devhelp/taglets/parameter/Makefile.am index da02537fa..333c1a4fa 100644 --- a/src/doclets/devhelp/taglets/parameter/Makefile.am +++ b/src/doclets/devhelp/taglets/parameter/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/return/Makefile.am b/src/doclets/devhelp/taglets/return/Makefile.am index 6a4282ebc..24c464750 100644 --- a/src/doclets/devhelp/taglets/return/Makefile.am +++ b/src/doclets/devhelp/taglets/return/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/right/Makefile.am b/src/doclets/devhelp/taglets/right/Makefile.am index 99aab9dff..5bf2c9fb0 100755 --- a/src/doclets/devhelp/taglets/right/Makefile.am +++ b/src/doclets/devhelp/taglets/right/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletright.vala.stamp libtagletright.vala.stamp: $(libtagletright_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/see/Makefile.am b/src/doclets/devhelp/taglets/see/Makefile.am index 9264d0b5e..7efee3224 100644 --- a/src/doclets/devhelp/taglets/see/Makefile.am +++ b/src/doclets/devhelp/taglets/see/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/see/taglet.vala b/src/doclets/devhelp/taglets/see/taglet.vala index e417eb0f4..80317a3b7 100644 --- a/src/doclets/devhelp/taglets/see/taglet.vala +++ b/src/doclets/devhelp/taglets/see/taglet.vala @@ -25,7 +25,7 @@ using Gee; public class Valadoc.SeeDevhelpTaglet : SeeHtmlHelperTaglet, HtmlHelper { - protected override string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ) { + protected override string? get_link ( Settings settings, Tree tree, DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( settings, element, pos ); } @@ -41,7 +41,7 @@ public class Valadoc.SeeDevhelpTaglet : SeeHtmlHelperTaglet, HtmlHelper { return this.write_imp ( res, max, index ); } - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { return this.parse_imp ( settings, tree, me, content, out errmsg ); } } diff --git a/src/doclets/devhelp/taglets/source/Makefile.am b/src/doclets/devhelp/taglets/source/Makefile.am index aae5d5bba..3a9c16acd 100755 --- a/src/doclets/devhelp/taglets/source/Makefile.am +++ b/src/doclets/devhelp/taglets/source/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletsrcsample.vala.stamp libtagletsrcsample.vala.stamp: $(libtagletsrcsample_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/string/Makefile.am b/src/doclets/devhelp/taglets/string/Makefile.am index 3bc77e4eb..cb8c68fe1 100644 --- a/src/doclets/devhelp/taglets/string/Makefile.am +++ b/src/doclets/devhelp/taglets/string/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/table/Makefile.am b/src/doclets/devhelp/taglets/table/Makefile.am index 154158b4d..69cd5679a 100755 --- a/src/doclets/devhelp/taglets/table/Makefile.am +++ b/src/doclets/devhelp/taglets/table/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtaglettable.vala.stamp libtaglettable.vala.stamp: $(libtaglettable_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/throws/Makefile.am b/src/doclets/devhelp/taglets/throws/Makefile.am index 0b68ac376..c72fd817f 100644 --- a/src/doclets/devhelp/taglets/throws/Makefile.am +++ b/src/doclets/devhelp/taglets/throws/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/underline/Makefile.am b/src/doclets/devhelp/taglets/underline/Makefile.am index f591aad67..6ca6ea6c2 100755 --- a/src/doclets/devhelp/taglets/underline/Makefile.am +++ b/src/doclets/devhelp/taglets/underline/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletunderline.vala.stamp libtagletunderline.vala.stamp: $(libtagletunderline_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/version/Makefile.am b/src/doclets/devhelp/taglets/version/Makefile.am index 12af194cd..5c4ca5a17 100644 --- a/src/doclets/devhelp/taglets/version/Makefile.am +++ b/src/doclets/devhelp/taglets/version/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/devhelp/taglets/wikilink/Makefile.am b/src/doclets/devhelp/taglets/wikilink/Makefile.am index 3cc82ba74..3ccd539a2 100755 --- a/src/doclets/devhelp/taglets/wikilink/Makefile.am +++ b/src/doclets/devhelp/taglets/wikilink/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletwikilink.vala.stamp libtagletwikilink.vala.stamp: $(libtagletwikilink_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/doclet/Makefile.am b/src/doclets/html/doclet/Makefile.am index 2b67e048f..69b839765 100644 --- a/src/doclets/html/doclet/Makefile.am +++ b/src/doclets/html/doclet/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libdoclet.vala.stamp libdoclet.vala.stamp: $(libdoclet_VALASOURCES) - $(VALAC) -C --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --vapidir ../linkhelper --pkg libhtmlhelper-1.0 --basedir . --vapidir . --pkg docletconfig --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --vapidir ../linkhelper --pkg libhtmlhelper-1.0 --basedir . --vapidir . --pkg docletconfig --save-temps $^ touch $@ diff --git a/src/doclets/html/doclet/template.vala b/src/doclets/html/doclet/template.vala index 90d79b5f0..818874ca8 100644 --- a/src/doclets/html/doclet/template.vala +++ b/src/doclets/html/doclet/template.vala @@ -26,7 +26,7 @@ using Gee; public class Valadoc.LangletIndex : Valadoc.BasicHtmlLanglet, Valadoc.LinkHelper { - protected override string get_link ( Basic element, Basic pos ) { + protected override string get_link ( DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( this.settings, element, pos ); } @@ -56,11 +56,11 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.LinkHelper { return css_path.str; } - protected override string get_link ( Valadoc.Basic element, Valadoc.Basic? pos ) { + protected override string get_link ( DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( this.settings, element, pos ); } - protected override void write_top_element ( GLib.FileStream file, Basic? pos ) { + protected override void write_top_element ( GLib.FileStream file, DocumentedElement? pos ) { string top = ""; if ( pos != null ) @@ -101,14 +101,19 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.LinkHelper { protected get; } - public override void initialisation ( Settings settings ) { + public override void initialisation ( Settings settings, Tree tree ) { this.settings = settings; DirUtils.create ( this.settings.path, 0777 ); this.langlet = new Valadoc.LangletIndex ( settings ); + + Gee.ReadOnlyCollection packages = tree.get_package_list (); + foreach ( Package pkg in packages ) { + pkg.visit ( this ); + } } - protected override string get_img_real_path ( Basic element ) { + protected override string get_img_real_path ( DocumentedElement element ) { if ( element is Package ) { return this.current_path + element.name + ".png"; } @@ -116,7 +121,7 @@ public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.LinkHelper { return this.current_path + "tree.png"; } - protected override string get_img_path ( Basic element ) { + protected override string get_img_path ( DocumentedElement element ) { if ( element is Package ) { return element.name + ".png"; } diff --git a/src/doclets/html/linkhelper/Makefile.am b/src/doclets/html/linkhelper/Makefile.am index 831d6ec73..4f93b19d1 100644 --- a/src/doclets/html/linkhelper/Makefile.am +++ b/src/doclets/html/linkhelper/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libhtmlhelper.vala.stamp libhtmlhelper.vala.stamp: $(libhtmlhelper_VALASOURCES) - $(VALAC) -C --library libhtmlhelper-1.0 --basedir . --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --disable-non-null $^ + $(VALAC) -C --library libhtmlhelper-1.0 --basedir . --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 $^ touch $@ diff --git a/src/doclets/html/linkhelper/helper.vala b/src/doclets/html/linkhelper/helper.vala index d68a1339e..9b0e665aa 100755 --- a/src/doclets/html/linkhelper/helper.vala +++ b/src/doclets/html/linkhelper/helper.vala @@ -23,7 +23,7 @@ using GLib; public interface Valadoc.LinkHelper { - protected string get_html_top_link ( Valadoc.Basic postag ) { + protected string get_html_top_link ( DocumentedElement? postag ) { GLib.StringBuilder str = new GLib.StringBuilder ( "" ); Valadoc.Basic pos = postag; @@ -34,41 +34,38 @@ public interface Valadoc.LinkHelper { return str.str; } - protected string? get_html_link ( Valadoc.Settings settings, Valadoc.Basic element, Valadoc.Basic pos2 ) { - Package pkg = ( element is Package )? (Package)element : element.file; + protected string? get_html_link ( Valadoc.Settings settings, DocumentedElement element, DocumentedElement? pos2 ) { + Package pkg = ( element is Package )? (Package)element : element.package; if ( pkg.is_visitor_accessible () == false ) return null; GLib.StringBuilder str = new GLib.StringBuilder ( "" ); - Valadoc.Basic pos = element; + DocumentedElement pos = element; string? link_id = null; if ( element is Valadoc.Package == false ) { if ( element is Valadoc.EnumValue || element is Valadoc.ErrorCode ) { link_id = "#" + element.name; - pos = pos.parent; + pos = (DocumentedElement)pos.parent; } else if ( element is Visitable ) { if ( !((Visitable)element).is_visitor_accessible() ) return null; } - while ( pos != null ) { - if ( pos.name == null ) + while ( pos is Package == false ) { + string name = pos.name; + if ( name == null ) str.prepend ( "0" ); else - str.prepend ( pos.name ); + str.prepend ( name ); str.prepend ( "/" ); - - if ( pos.parent is Valadoc.Package ) - break; - - pos = pos.parent; + pos = (DocumentedElement)pos.parent; } } - str.prepend ( pos.file.name ); + str.prepend ( pos.package.name ); str.prepend ( this.get_html_top_link ( pos2 ) ); str.append ( "/index.html" ); diff --git a/src/doclets/html/taglets/bold/Makefile.am b/src/doclets/html/taglets/bold/Makefile.am index 76c4dd720..3796538e4 100755 --- a/src/doclets/html/taglets/bold/Makefile.am +++ b/src/doclets/html/taglets/bold/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletbold.vala.stamp libtagletbold.vala.stamp: $(libtagletbold_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/cell/Makefile.am b/src/doclets/html/taglets/cell/Makefile.am index b1b2a00ce..e8b1dc938 100755 --- a/src/doclets/html/taglets/cell/Makefile.am +++ b/src/doclets/html/taglets/cell/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtaglettablecell.vala.stamp libtaglettablecell.vala.stamp: $(libtaglettablecell_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/center/Makefile.am b/src/doclets/html/taglets/center/Makefile.am index bb7bc7ba1..9106990fb 100755 --- a/src/doclets/html/taglets/center/Makefile.am +++ b/src/doclets/html/taglets/center/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletcenter.vala.stamp libtagletcenter.vala.stamp: $(libtagletcenter_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/image/Makefile.am b/src/doclets/html/taglets/image/Makefile.am index 93677c6b9..71a91f172 100755 --- a/src/doclets/html/taglets/image/Makefile.am +++ b/src/doclets/html/taglets/image/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletimage.vala.stamp libtagletimage.vala.stamp: $(libtagletimage_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/italic/Makefile.am b/src/doclets/html/taglets/italic/Makefile.am index 781c2702b..6bff04ac2 100755 --- a/src/doclets/html/taglets/italic/Makefile.am +++ b/src/doclets/html/taglets/italic/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletitalic.vala.stamp libtagletitalic.vala.stamp: $(libtagletitalic_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/link/Makefile.am b/src/doclets/html/taglets/link/Makefile.am index 7e0ad1df0..c2c9e5c51 100644 --- a/src/doclets/html/taglets/link/Makefile.am +++ b/src/doclets/html/taglets/link/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/link/taglet.vala b/src/doclets/html/taglets/link/taglet.vala index 342c111b3..2205c89c3 100644 --- a/src/doclets/html/taglets/link/taglet.vala +++ b/src/doclets/html/taglets/link/taglet.vala @@ -24,7 +24,7 @@ using Gee; public class Valadoc.LinkHtmlTaglet : Valadoc.LinkHtmlHelperTaglet, LinkHelper { - protected override string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ) { + protected override string? get_link ( Settings settings, Tree tree, DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( settings, element, pos ); } @@ -36,7 +36,7 @@ public class Valadoc.LinkHtmlTaglet : Valadoc.LinkHtmlHelperTaglet, LinkHelper { return write_imp ( res, max, index ); } - public override bool parse ( Settings settings, Tree tree, Basic me, string content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, string content, out string[] errmsg ) { return this.parse_imp ( settings, tree, me, content, out errmsg ); } } diff --git a/src/doclets/html/taglets/list/Makefile.am b/src/doclets/html/taglets/list/Makefile.am index ad20832ff..6fea88a49 100755 --- a/src/doclets/html/taglets/list/Makefile.am +++ b/src/doclets/html/taglets/list/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletlist.vala.stamp libtagletlist.vala.stamp: $(libtagletlist_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/listelement/Makefile.am b/src/doclets/html/taglets/listelement/Makefile.am index 7e7d89960..2c7dcff38 100755 --- a/src/doclets/html/taglets/listelement/Makefile.am +++ b/src/doclets/html/taglets/listelement/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletlistelement.vala.stamp libtagletlistelement.vala.stamp: $(libtagletlistelement_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/notification/Makefile.am b/src/doclets/html/taglets/notification/Makefile.am index 19154145b..bb7743b49 100755 --- a/src/doclets/html/taglets/notification/Makefile.am +++ b/src/doclets/html/taglets/notification/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletnotification.vala.stamp libtagletnotification.vala.stamp: $(libtagletnotification_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/parameter/Makefile.am b/src/doclets/html/taglets/parameter/Makefile.am index e2eaf9a77..44fa188fc 100644 --- a/src/doclets/html/taglets/parameter/Makefile.am +++ b/src/doclets/html/taglets/parameter/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/return/Makefile.am b/src/doclets/html/taglets/return/Makefile.am index 84ac01ade..c9b96f3bd 100644 --- a/src/doclets/html/taglets/return/Makefile.am +++ b/src/doclets/html/taglets/return/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/right/Makefile.am b/src/doclets/html/taglets/right/Makefile.am index bece7391d..19ebe8d53 100755 --- a/src/doclets/html/taglets/right/Makefile.am +++ b/src/doclets/html/taglets/right/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletright.vala.stamp libtagletright.vala.stamp: $(libtagletright_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/see/Makefile.am b/src/doclets/html/taglets/see/Makefile.am index 3fdbf0487..8f91b7142 100644 --- a/src/doclets/html/taglets/see/Makefile.am +++ b/src/doclets/html/taglets/see/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/see/taglet.vala b/src/doclets/html/taglets/see/taglet.vala index 81d097116..f0f74aced 100644 --- a/src/doclets/html/taglets/see/taglet.vala +++ b/src/doclets/html/taglets/see/taglet.vala @@ -25,7 +25,7 @@ using Gee; public class Valadoc.SeeHtmlTaglet : SeeHtmlHelperTaglet, LinkHelper { - protected override string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ) { + protected override string? get_link ( Settings settings, Tree tree, DocumentedElement element, DocumentedElement? pos ) { return this.get_html_link ( settings, element, pos ); } @@ -41,7 +41,7 @@ public class Valadoc.SeeHtmlTaglet : SeeHtmlHelperTaglet, LinkHelper { return this.write_imp ( res, max, index ); } - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { return this.parse_imp ( settings, tree, me, content, out errmsg ); } } diff --git a/src/doclets/html/taglets/source/Makefile.am b/src/doclets/html/taglets/source/Makefile.am index a1660fad5..6c989a189 100755 --- a/src/doclets/html/taglets/source/Makefile.am +++ b/src/doclets/html/taglets/source/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletsrcsample.vala.stamp libtagletsrcsample.vala.stamp: $(libtagletsrcsample_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/string/Makefile.am b/src/doclets/html/taglets/string/Makefile.am index 972faf082..247d42099 100644 --- a/src/doclets/html/taglets/string/Makefile.am +++ b/src/doclets/html/taglets/string/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/table/Makefile.am b/src/doclets/html/taglets/table/Makefile.am index 92314da41..77f496af3 100755 --- a/src/doclets/html/taglets/table/Makefile.am +++ b/src/doclets/html/taglets/table/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtaglettable.vala.stamp libtaglettable.vala.stamp: $(libtaglettable_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/throws/Makefile.am b/src/doclets/html/taglets/throws/Makefile.am index 972faf082..247d42099 100644 --- a/src/doclets/html/taglets/throws/Makefile.am +++ b/src/doclets/html/taglets/throws/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/underline/Makefile.am b/src/doclets/html/taglets/underline/Makefile.am index 3baa293fc..280847426 100755 --- a/src/doclets/html/taglets/underline/Makefile.am +++ b/src/doclets/html/taglets/underline/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletunderline.vala.stamp libtagletunderline.vala.stamp: $(libtagletunderline_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/version/Makefile.am b/src/doclets/html/taglets/version/Makefile.am index 199e13e92..d29a29c1b 100644 --- a/src/doclets/html/taglets/version/Makefile.am +++ b/src/doclets/html/taglets/version/Makefile.am @@ -11,7 +11,7 @@ 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 $^ + $(VALAC) -C --vapidir ../../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/html/taglets/wikilink/Makefile.am b/src/doclets/html/taglets/wikilink/Makefile.am index 143a24f36..e7f17879e 100755 --- a/src/doclets/html/taglets/wikilink/Makefile.am +++ b/src/doclets/html/taglets/wikilink/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libtagletwikilink.vala.stamp libtagletwikilink.vala.stamp: $(libtagletwikilink_VALASOURCES) - $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^ + $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --vapidir ../../../htmlhelpers/ --pkg libhtmlhelpers-1.0 --pkg libhtmlhelper-1.0 --basedir . --save-temps $^ touch $@ diff --git a/src/doclets/htmlhelpers/Makefile.am b/src/doclets/htmlhelpers/Makefile.am index 156e0b8d1..63cad2252 100644 --- a/src/doclets/htmlhelpers/Makefile.am +++ b/src/doclets/htmlhelpers/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = libhtmlhelpers.vala.stamp libhtmlhelpers.vala.stamp: $(libhtmlhelpers_VALASOURCES) - $(VALAC) -C --library libhtmlhelpers-1.0 --basedir . --vapidir ../../vapi --pkg valadoc-1.0 --disable-non-null $^ + $(VALAC) -C --library libhtmlhelpers-1.0 --basedir . --vapidir ../../vapi --pkg valadoc-1.0 --save-temps $^ touch $@ diff --git a/src/doclets/htmlhelpers/htmlhelpers.vala b/src/doclets/htmlhelpers/htmlhelpers.vala index 98ae52d28..4145c6d91 100644 --- a/src/doclets/htmlhelpers/htmlhelpers.vala +++ b/src/doclets/htmlhelpers/htmlhelpers.vala @@ -277,7 +277,7 @@ public abstract class Valadoc.SeeHtmlHelperTaglet : MainTaglet { private string link; private string css; - protected abstract string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ); + protected abstract string? get_link ( Settings settings, Tree tree, DocumentedElement element, DocumentedElement? pos ); // override-bug protected bool write_block_start_imp ( void* res ) { @@ -302,7 +302,7 @@ public abstract class Valadoc.SeeHtmlHelperTaglet : MainTaglet { } // override-bug - protected bool parse_imp ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + protected bool parse_imp ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { if ( content.size != 1 ) { errmsg = new string[1]; errmsg[0] = "Type name was expected."; @@ -319,7 +319,7 @@ public abstract class Valadoc.SeeHtmlHelperTaglet : MainTaglet { return false; } - Valadoc.Basic? node = tree.search_symbol_str ( me, ((StringTaglet)element).content.strip ( ) ); + Valadoc.DocumentedElement? node = tree.search_symbol_str ( me, ((StringTaglet)element).content.strip ( ) ); if ( node == null ) { errmsg = new string[1]; errmsg[0] = "Linked type is not available."; @@ -355,7 +355,7 @@ public class Valadoc.SinceHtmlTaglet : MainTaglet { return true; } - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { if ( content.size != 1 ) { errmsg = new string[1]; errmsg[0] = "Version name was expected."; @@ -384,7 +384,7 @@ public abstract class Valadoc.LinkHtmlHelperTaglet : InlineTaglet { private string? name = null; private string? css = null; - protected abstract string? get_link ( Settings settings, Tree tree, Basic element, Basic? pos ); + protected abstract string? get_link ( Settings settings, Tree tree, DocumentedElement element, DocumentedElement? pos ); protected string to_string_imp ( ) { return this.name; @@ -399,8 +399,8 @@ public abstract class Valadoc.LinkHtmlHelperTaglet : InlineTaglet { return true; } - protected bool parse_imp ( Settings settings, Tree tree, Basic me, string content, out string[] errmsg ) { - Valadoc.Basic? element = tree.search_symbol_str ( me, content.strip() ); + protected bool parse_imp ( Settings settings, Tree tree, DocumentedElement me, string content, out string[] errmsg ) { + Valadoc.DocumentedElement? element = tree.search_symbol_str ( me, content.strip() ); if ( element == null ) { errmsg = new string[1]; errmsg[0] = "Linked type is not available."; @@ -420,7 +420,7 @@ public class Valadoc.ExceptionHtmlTaglet : MainTaglet { private Gee.ArrayList content; private string paramname; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { if ( me is Valadoc.ExceptionHandler == false ) { errmsg = new string[1]; errmsg[0] = "Tag @throws cannot be used in %s documentation. It can only be used in the following types of documentation: method, signal, delegate.".printf ( this.get_data_type ( me ) ); @@ -481,11 +481,8 @@ public class Valadoc.ExceptionHtmlTaglet : MainTaglet { } private bool check_exception_parameter_name ( Valadoc.ExceptionHandler me, string paramname ) { - if ( paramname[0] == '.' || paramname == "" ) - return false; - - foreach ( Valadoc.TypeReference param in me.get_error_domains() ) { - if ( param.type_name.has_suffix ( paramname ) ) + foreach ( Valadoc.DataType param in me.get_error_domains() ) { + if ( param.name == paramname ) return true; } return false; @@ -580,7 +577,7 @@ public class Valadoc.ParameterHtmlTaglet : MainTaglet { return true; } - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { if ( me is Valadoc.ParameterListHandler == false ) { errmsg = new string[1]; errmsg[0] = "Tag @param cannot be used in %s documentation. It can only be used in the following types of documentation: method, signal, delegate.".printf ( this.get_data_type ( me ) ); @@ -644,7 +641,7 @@ public class Valadoc.ReturnHtmlTaglet : MainTaglet { public override int order { get { return 300; } } private Gee.Collection content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ) { if ( !(me is Valadoc.Method || me is Valadoc.Signal || me is Valadoc.Delegate) ) { errmsg = new string[1]; errmsg[0] = "Tag @return cannot be used in %s documentation. It can only be used in the following types of documentation: method, signal, delegate.".printf ( this.get_data_type ( me ) ); @@ -679,7 +676,7 @@ public class Valadoc.ReturnHtmlTaglet : MainTaglet { public class Valadoc.StringHtmlTaglet : StringTaglet { - public override bool parse ( Settings settings, Tree tree, Basic me, string content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, string content ) { this.content = content; return true; } @@ -735,9 +732,9 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { this.settings = settings; } - private Basic position = null; + private DocumentedElement position = null; - protected abstract string get_link ( Basic type, Basic position ); + protected abstract string get_link ( DocumentedElement type, DocumentedElement? position ); private inline bool is_basic_type ( string name ) { string[] basic_types = new string[] { "bool", "char", "uchar", "int", "uint", "short", "ushort", @@ -760,7 +757,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { } string typename = datatype.full_name (); - if ( datatype.parent.name == null && (datatype is Class || datatype is Struct) ) { + if ( ((DocumentedElement)datatype.parent).name == null && (datatype is Class || datatype is Struct) ) { if ( this.is_basic_type ( typename ) ) { string link = this.get_link(datatype, this.position ); if ( link == null ) @@ -824,6 +821,10 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { if ( type_reference.is_weak ) modifiers.append ( "weak " ); + else if ( type_reference.is_unowned ) + modifiers.append ( "unowned " ); + else if ( type_reference.is_owned ) + modifiers.append ( "owned " ); if ( modifiers.len > 0 ) file.printf ( "%s ", css_keyword, modifiers.str ); @@ -837,13 +838,8 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { file.printf ( "[%s]", str ); } - if ( type_reference.pass_ownership ) { - file.putc ( '#' ); - } - - if ( type_reference.is_nullable ) { + if ( type_reference.is_nullable ) file.putc ( '?' ); - } string str = string.nfill ( type_reference.pointer_rank, '*' ); file.puts ( str ); @@ -912,7 +908,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { foreach ( FormalParameter param in params ) { i++; - if ( param.default_value != null && open_bracket == false ) { + if ( param.has_default_value == true && open_bracket == false ) { file.printf ( "[", css_optional_parameter ); open_bracket = true; } @@ -930,7 +926,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { } private void write_exception_list ( ExceptionHandler exception_handler, GLib.FileStream file ) { - Gee.ReadOnlyCollection error_domains = exception_handler.get_error_domains (); + Gee.ReadOnlyCollection error_domains = exception_handler.get_error_domains (); int size = error_domains.size; int i = 1; @@ -939,14 +935,8 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { file.printf ( " throws ", css_keyword ); - foreach ( TypeReference type_reference in error_domains ) { - if ( type_reference == null ) { - file.printf ( "GLib.Error", css_other_type ); - } - else { - this.write_type_reference ( type_reference, file ); - } - + foreach ( DataType type in error_domains ) { + this.write_type_name ( type, file ); if ( error_domains.size > i ) { file.puts ( ", " ); } @@ -974,7 +964,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { modifiers.append ( " inline" ); file.printf ( " %s ", css_keyword, modifiers.str ); - this.write_type_reference ( m.return_type, file ); + this.write_type_reference ( m.type_reference, file ); file.puts ( m.name ); file.puts ( " " ); this.write_parameter_list ( m, file ); @@ -987,7 +977,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { public override void write_type_parameter ( TypeParameter param, void* ptr ) { weak GLib.FileStream file = (GLib.FileStream)ptr; - file.puts ( param.datatype_name ); + file.puts ( param.name ); } public override void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) { @@ -1039,27 +1029,27 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { Property prop = (Property)propac.parent; + file.printf ( "", css_keyword ); + if ( !(prop.is_public == propac.is_public && prop.is_private == propac.is_private && prop.is_protected == propac.is_protected) ) { // FIXME: PropertyAccessor isn't a SymbolAccessibility. (Valac-Bug.) if ( propac.is_public ) - file.printf ( "public ", css_keyword ); + file.puts ( "public " ); else if ( propac.is_protected ) - file.printf ( "protected ", css_keyword ); + file.puts ( "protected " ); else if ( propac.is_private ) - file.printf ( "private ", css_keyword ); + file.puts ( "private " ); } + if ( propac.is_owned ) + file.puts ( "owned " ); - if ( propac.is_get ) { - file.printf ( " get;", css_keyword ); - } - else if ( propac.is_set ) { - if ( propac.is_construct ) { - file.printf ( " construct ", css_keyword ); - } + if ( propac.is_get ) + file.puts ( "get" ); + else if ( propac.is_set ) + file.puts ( "set" ); - file.printf ( " set;", css_keyword ); - } + file.puts ( ";" ); } public override void write_property ( Valadoc.Property prop, void* ptr ) { @@ -1079,7 +1069,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { if ( modifiers.len > 0 ) file.printf ( " %s ", css_keyword, modifiers.str ); - this.write_type_reference ( prop.return_type, file ); + this.write_type_reference ( prop.type_reference, file ); file.printf ( " %s { ", prop.name ); if ( prop.setter != null ) @@ -1100,9 +1090,14 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { this.write_accessor ( sig, file ); - file.printf ( " signal ", css_keyword ); + file.printf ( " ", css_keyword ); + + if ( sig.is_virtual == true ) + file.printf ( "virtual " ); + + file.printf ( "signal " ); - this.write_type_reference ( sig.return_type, file ); + this.write_type_reference ( sig.type_reference, file ); file.printf ( " %s ", sig.name ); this.write_parameter_list ( sig, file ); } @@ -1120,7 +1115,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { this.write_accessor ( del, file ); file.printf ( " delegate ", css_keyword ); - this.write_type_reference ( del.return_type, file ); + this.write_type_reference ( del.type_reference, file ); file.printf ( " %s ", del.name ); this.write_parameter_list ( del, file ); this.write_exception_list ( del, file ); @@ -1212,7 +1207,7 @@ public abstract class Valadoc.BasicHtmlLanglet : Valadoc.Langlet { public class Valadoc.UnderlinedHtmlHelperDocElement : UnderlinedDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1238,7 +1233,7 @@ public class Valadoc.UnderlinedHtmlHelperDocElement : UnderlinedDocElement { public class Valadoc.ListHtmlHelperEntryDocElement : ListEntryDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, ListType type, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, ListType type, Gee.ArrayList content ) { this.content = content; return true; } @@ -1265,7 +1260,7 @@ public class Valadoc.ListHtmlHelperDocElement : ListDocElement { private Gee.ArrayList entries; private ListType type; - public override bool parse ( Settings settings, Tree tree, Basic me, ListType type, Gee.ArrayList entries ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, ListType type, Gee.ArrayList entries ) { this.entries = entries; this.type = type; return true; @@ -1295,7 +1290,7 @@ public class Valadoc.LinkHtmlHelperDocElement : LinkDocElement { protected Gee.ArrayList? desc; protected string path; - public override bool parse ( Settings settings, Tree tree, Basic me, string# path, Gee.ArrayList? desc ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, string# path, Gee.ArrayList? desc ) { this.path = #path; this.desc = desc; return true; @@ -1332,7 +1327,7 @@ public class Valadoc.TableCellHtmlHelperDocElement : TableCellDocElement { private int dcells; private int cells; - public override void parse ( Settings settings, Tree tree, Basic me, TextPosition pos, TextVerticalPosition hpos, int cells, int dcells, Gee.ArrayList content ) { + public override void parse ( Settings settings, Tree tree, DocumentedElement me, TextPosition pos, TextVerticalPosition hpos, int cells, int dcells, Gee.ArrayList content ) { this.content = content; this.dcells = dcells; this.cells = cells; @@ -1422,7 +1417,7 @@ public class Valadoc.TableHtmlHelperDocElement : TableDocElement { public class Valadoc.NotificationHtmlHelperDocElement : NotificationDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1448,7 +1443,7 @@ public class Valadoc.SourceCodeHtmlHelerDocElement : SourceCodeDocElement { public Language lang; public string src; - public override bool parse ( Settings settings, Tree tree, Basic me, string# src, Language lang ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, string# src, Language lang ) { this.lang = lang; this.src = #src; return true; @@ -1468,7 +1463,7 @@ public class Valadoc.SourceCodeHtmlHelerDocElement : SourceCodeDocElement { public class Valadoc.ItalicHtmlHelperDocElement : ItalicDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1494,7 +1489,7 @@ public class Valadoc.ItalicHtmlHelperDocElement : ItalicDocElement { public class Valadoc.BoldHtmlHelperDocElement : BoldDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1521,7 +1516,7 @@ public class Valadoc.BoldHtmlHelperDocElement : BoldDocElement { public class Valadoc.RightAlignedHtmlHelperDocElement : RightAlignedDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1550,7 +1545,7 @@ public class Valadoc.RightAlignedHtmlHelperDocElement : RightAlignedDocElement { public class Valadoc.CenterHtmlHelperDocElement : CenterDocElement { private Gee.ArrayList content; - public override bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ) { this.content = content; return true; } @@ -1583,7 +1578,7 @@ public class Valadoc.ImageHtmlHelperDocElement : ImageDocElement { protected ImageDocElementPosition position; protected string path; - public override bool parse ( Settings settings, Tree tree, Basic me, string# path, ImageDocElementPosition pos ) { + public override bool parse ( Settings settings, Tree tree, DocumentedElement me, string# path, ImageDocElementPosition pos ) { this.position = pos; this.path = #path; return true; @@ -1637,7 +1632,7 @@ public class Valadoc.ImageHtmlHelperDocElement : ImageDocElement { public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { protected Valadoc.Langlet langlet; - protected abstract string get_link ( Valadoc.Basic p1, Valadoc.Basic? p2 ); + protected abstract string get_link ( DocumentedElement p1, DocumentedElement? p2 ); // Navi: @@ -1649,7 +1644,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.printf ( "\t
  • %s
  • \n", style, css_navi_link, link, content ); } - protected void write_navi_entry ( GLib.FileStream file, Basic element, Basic pos, string style, bool link, bool full_name = false ) { + protected void write_navi_entry ( GLib.FileStream file, DocumentedElement element, DocumentedElement? pos, string style, bool link, bool full_name = false ) { string name; if ( element is Class ) { @@ -1659,7 +1654,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { name = element.name; } else if ( element is Package ) { - name = element.file.name; + name = element.package.name; } else if ( full_name == true && element is Namespace ) { string tmp = element.full_name(); @@ -1676,7 +1671,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { this.write_navi_entry_html_template ( file, style, name ); } - protected void write_navi_top_entry ( GLib.FileStream file, Basic element, Basic mself ) { + protected void write_navi_top_entry ( GLib.FileStream file, DocumentedElement element, DocumentedElement? mself ) { string name = (element.name == null)? "Global Namespace" : element.name; string style = null; @@ -1693,7 +1688,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { else if ( element is Interface ) style = css_navi_iface; else if ( element is Package ) { - name = element.file.name; + name = element.package.name; style = css_navi_package; } @@ -1713,12 +1708,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } //FIXME: Basic pos => Basic? pos - protected virtual void write_top_element ( GLib.FileStream file, Basic? pos ) { + protected virtual void write_top_element ( GLib.FileStream file, DocumentedElement? pos ) { } - protected void write_top_elements ( GLib.FileStream file, Basic element, Basic? mself ) { - Gee.ArrayList lst = new Gee.ArrayList (); - Basic pos = element; + protected void write_top_elements ( GLib.FileStream file, DocumentedElement element, DocumentedElement? mself ) { + Gee.ArrayList lst = new Gee.ArrayList (); + DocumentedElement pos = element; // if ( mself == null ) // mself = element; @@ -1729,11 +1724,11 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { while ( pos != null ) { lst.add ( pos ); - pos = pos.parent; + pos = (DocumentedElement)pos.parent; } for ( int i = lst.size-1; i >= 0 ; i-- ) { - Basic el = lst.get ( i ); + DocumentedElement el = lst.get ( i ); if ( el.name != null ) { this.write_navi_top_entry ( file, el, mself ); @@ -1750,7 +1745,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_file ( GLib.FileStream file, Package efile, Basic pos ) { + protected void write_navi_file ( GLib.FileStream file, Package efile, DocumentedElement? pos ) { Gee.ArrayList ns_list = new Gee.ArrayList (); this.fetch_subnamespace_names (efile, ns_list ); @@ -1763,7 +1758,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { else if ( pos == efile ) this.write_top_elements ( file, efile, efile ); else - this.write_top_elements ( file, pos.parent.parent, pos ); + this.write_top_elements ( file, (DocumentedElement)pos.parent.parent, pos ); file.printf ( "\t\t\t\t
      \n", css_navi ); @@ -1785,7 +1780,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t\n" ); } - protected void write_navi_child_namespaces_inline_withouth_block ( GLib.FileStream file, Namespace ns, Basic mself ) { + protected void write_navi_child_namespaces_inline_withouth_block ( GLib.FileStream file, Namespace ns, DocumentedElement? mself ) { this.write_navi_child_namespaces_without_childs ( file, ns, mself ); this.write_navi_child_classes_without_childs ( file, ns, mself ); this.write_navi_child_interfaces_without_childs ( file, ns, mself ); @@ -1799,7 +1794,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { this.write_navi_child_constants ( file, ns, mself ); } - protected void write_navi_child_namespaces_inline ( GLib.FileStream file, Namespace ns, Basic mself ) { + protected void write_navi_child_namespaces_inline ( GLib.FileStream file, Namespace ns, DocumentedElement? mself ) { file.printf ( "
        \n", css_navi ); if ( ns.name == null ) { @@ -1811,12 +1806,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
      \n" ); } - protected void write_navi_child_namespaces ( GLib.FileStream file, Namespace ns, Basic mself ) { + protected void write_navi_child_namespaces ( GLib.FileStream file, Namespace ns, DocumentedElement? mself ) { this.write_top_elements ( file, ns, mself ); this.write_navi_child_namespaces_inline ( file, ns, mself ); } - protected void write_navi_struct_inline ( GLib.FileStream file, Struct stru, Basic mself ) { + protected void write_navi_struct_inline ( GLib.FileStream file, Struct stru, DocumentedElement? mself ) { file.printf ( "
        \n", css_navi ); this.write_navi_child_construction_methods ( file, stru, mself ); this.write_navi_child_static_methods ( file, stru, mself ); @@ -1826,14 +1821,14 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
      \n" ); } - protected void write_navi_struct ( GLib.FileStream file, Struct stru, Basic mself ) { + protected void write_navi_struct ( GLib.FileStream file, Struct stru, DocumentedElement? mself ) { file.printf ( "\t\t\t
      \n", css_style_navigation ); this.write_top_elements ( file, stru, mself ); this.write_navi_struct_inline ( file, stru, mself ); file.puts ( "\t\t\t
      \n" ); } - protected void write_navi_interface_inline ( GLib.FileStream file, Interface iface, Basic mself ) { + protected void write_navi_interface_inline ( GLib.FileStream file, Interface iface, DocumentedElement? mself ) { file.printf ( "
        \n", css_navi ); this.write_navi_child_static_methods ( file, iface, mself ); this.write_navi_child_delegates ( file, iface, mself ); @@ -1844,14 +1839,14 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
      \n" ); } - protected void write_navi_interface ( GLib.FileStream file, Interface iface, Basic mself ) { + protected void write_navi_interface ( GLib.FileStream file, Interface iface, DocumentedElement? mself ) { file.printf ( "\t\t\t
      \n", css_style_navigation ); this.write_top_elements ( file, iface, mself ); this.write_navi_interface_inline ( file, iface, mself ); file.puts ( "\t\t\t
      \n" ); } - protected void write_navi_enum_inline ( GLib.FileStream file, Enum en, Basic mself ) { + protected void write_navi_enum_inline ( GLib.FileStream file, Enum en, DocumentedElement? mself ) { Gee.ReadOnlyCollection enum_values = en.get_enum_values ( ); file.printf ( "
        \n", css_navi ); @@ -1864,14 +1859,14 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
      \n" ); } - protected void write_navi_enum ( GLib.FileStream file, Enum en, Basic mself ) { + protected void write_navi_enum ( GLib.FileStream file, Enum en, DocumentedElement? mself ) { file.printf ( "\t\t\t
      \n", css_style_navigation ); this.write_top_elements ( file, en, mself ); this.write_navi_enum_inline ( file, en, mself ); file.puts ( "\t\t\t
      \n" ); } - protected void write_navi_error_domain_inline ( GLib.FileStream file, ErrorDomain errdom, Basic mself = null ) { + protected void write_navi_error_domain_inline ( GLib.FileStream file, ErrorDomain errdom, DocumentedElement? mself = null ) { Gee.ReadOnlyCollection error_codes = errdom.get_error_code_list ( ); file.printf ( "
        \n", css_navi ); @@ -1891,14 +1886,14 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t\n" ); } - protected void write_navi_error_domain ( GLib.FileStream file, ErrorDomain errdom, Basic mself ) { + protected void write_navi_error_domain ( GLib.FileStream file, ErrorDomain errdom, DocumentedElement? mself ) { file.printf ( "\t\t\t
        \n", css_style_navigation ); this.write_top_elements ( file, errdom, mself ); this.write_navi_error_domain_inline ( file, errdom, mself ); file.puts ( "\t\t\t
        \n" ); } - protected void write_navi_class_inline ( GLib.FileStream file, Class cl, Basic mself ) { + protected void write_navi_class_inline ( GLib.FileStream file, Class cl, DocumentedElement? mself ) { file.printf ( "
          \n", css_navi ); this.write_navi_child_construction_methods ( file, cl, mself ); this.write_navi_child_static_methods ( file, cl, mself ); @@ -1914,7 +1909,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
        \n" ); } - protected void write_navi_class ( GLib.FileStream file, Class cl, Basic mself ) { + protected void write_navi_class ( GLib.FileStream file, Class cl, DocumentedElement? mself ) { file.printf ( "\t\t\t
        \n", css_style_navigation ); this.write_top_elements ( file, cl, mself ); this.write_navi_class_inline ( file, cl, mself ); @@ -1922,7 +1917,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_method ( GLib.FileStream file, Method m ) { - Basic parent = m.parent; + DocumentedElement parent = (DocumentedElement)m.parent; if ( parent.name == null ) { this.write_navi_file ( file, (Package)parent.parent, m ); @@ -1950,10 +1945,10 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_property ( GLib.FileStream file, Property prop ) { - Basic parent = prop.parent; + DocumentedElement parent = (DocumentedElement)prop.parent; file.printf ( "\t\t\t
        \n", css_style_navigation ); - this.write_top_elements ( file, prop.parent, prop ); + this.write_top_elements ( file, parent, prop ); if ( parent is Class ) this.write_navi_class_inline ( file, (Class)parent, prop ); @@ -1964,11 +1959,11 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_signal ( GLib.FileStream file, Signal sig ) { - Basic parent = sig.parent; + DocumentedElement parent = (DocumentedElement)sig.parent; file.printf ( "\t\t\t
        \n", css_style_navigation ); - this.write_top_elements ( file, sig.parent, sig ); + this.write_top_elements ( file, parent, sig ); if ( parent is Class ) this.write_navi_class_inline ( file, (Class)parent, sig ); @@ -1979,7 +1974,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_constant ( GLib.FileStream file, Constant c ) { - Basic parent = c.parent; + DocumentedElement parent = (DocumentedElement)c.parent; if ( parent.name == null ) { this.write_navi_file ( file, (Package)parent.parent, c ); @@ -2002,7 +1997,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_field ( GLib.FileStream file, Field f ) { - Basic parent = f.parent; + DocumentedElement parent = (DocumentedElement)f.parent; if ( parent.name == null ) { this.write_navi_file ( file, (Package)parent.parent, f ); @@ -2025,7 +2020,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } protected void write_navi_delegate ( GLib.FileStream file, Delegate del ) { - Basic parent = del.parent; + DocumentedElement parent = (DocumentedElement)del.parent; if ( parent.name == null ) { this.write_navi_file ( file, (Package)parent.parent, del ); @@ -2045,7 +2040,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_methods_collection ( GLib.FileStream file, Gee.Collection methods, Basic mself ) { + protected void write_navi_child_methods_collection ( GLib.FileStream file, Gee.Collection methods, DocumentedElement? mself ) { foreach ( Method m in methods ) { if ( !m.is_static ) { string css; @@ -2065,7 +2060,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_construction_methods_collection ( GLib.FileStream file, Gee.Collection methods, Basic mself ) { + protected void write_navi_child_construction_methods_collection ( GLib.FileStream file, Gee.Collection methods, DocumentedElement? mself ) { foreach ( Method m in methods ) { if ( m == mself ) this.write_navi_entry ( file, m, mself, css_navi_construction_method, false ); @@ -2074,7 +2069,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_static_methods_collection ( GLib.FileStream file, Gee.Collection methods, Basic mself ) { + protected void write_navi_child_static_methods_collection ( GLib.FileStream file, Gee.Collection methods, DocumentedElement? mself ) { foreach ( Method m in methods ) { if ( m.is_static ) { if ( m == mself ) @@ -2085,17 +2080,17 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_methods ( GLib.FileStream file, MethodHandler mh, Basic mself ) { + protected void write_navi_child_methods ( GLib.FileStream file, MethodHandler mh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = mh.get_method_list ( ); this.write_navi_child_methods_collection ( file, methods, mself ); } - protected void write_navi_child_static_methods ( GLib.FileStream file, MethodHandler mh, Basic mself ) { + protected void write_navi_child_static_methods ( GLib.FileStream file, MethodHandler mh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = mh.get_method_list ( ); this.write_navi_child_static_methods_collection ( file, methods, mself ); } - protected void write_navi_child_classes_without_childs_collection ( GLib.FileStream file, Gee.Collection classes, Basic mself ) { + protected void write_navi_child_classes_without_childs_collection ( GLib.FileStream file, Gee.Collection classes, DocumentedElement? mself ) { foreach ( Class cl in classes ) { if ( cl == mself ) this.write_navi_entry ( file, cl, mself, (cl.is_abstract)? css_navi_abstract_class : css_navi_class, false ); @@ -2104,17 +2099,17 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_classes_without_childs ( GLib.FileStream file, ClassHandler clh, Basic mself ) { + protected void write_navi_child_classes_without_childs ( GLib.FileStream file, ClassHandler clh, DocumentedElement? mself ) { Gee.ReadOnlyCollection classes = clh.get_class_list ( ); this.write_navi_child_classes_without_childs_collection ( file, classes, mself ); } - protected void write_navi_child_construction_methods ( GLib.FileStream file, ConstructionMethodHandler cmh, Basic mself ) { + protected void write_navi_child_construction_methods ( GLib.FileStream file, ConstructionMethodHandler cmh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = cmh.get_construction_method_list ( ); this.write_navi_child_construction_methods_collection ( file, methods, mself ); } - protected void write_navi_child_signals ( GLib.FileStream file, SignalHandler sh, Basic mself ) { + protected void write_navi_child_signals ( GLib.FileStream file, SignalHandler sh, DocumentedElement? mself ) { Gee.ReadOnlyCollection signals = sh.get_signal_list ( ); foreach ( Signal sig in signals ) { @@ -2125,7 +2120,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_properties ( GLib.FileStream file, PropertyHandler ph, Basic mself ) { + protected void write_navi_child_properties ( GLib.FileStream file, PropertyHandler ph, DocumentedElement? mself ) { Gee.ReadOnlyCollection properties = ph.get_property_list ( ); foreach ( Property p in properties ) { @@ -2144,7 +2139,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_fields_collection ( GLib.FileStream file, Gee.Collection fields, Basic mself ) { + protected void write_navi_child_fields_collection ( GLib.FileStream file, Gee.Collection fields, DocumentedElement? mself ) { foreach ( Field f in fields ) { if ( f == mself ) this.write_navi_entry ( file, f, mself, css_navi_field, false ); @@ -2153,12 +2148,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_fields ( GLib.FileStream file, FieldHandler fh, Basic mself ) { + protected void write_navi_child_fields ( GLib.FileStream file, FieldHandler fh, DocumentedElement? mself ) { Gee.ReadOnlyCollection fields = fh.get_field_list ( ); this.write_navi_child_fields_collection ( file, fields, mself ); } - protected void write_navi_child_constants_collection ( GLib.FileStream file, Gee.Collection constants, Basic mself ) { + protected void write_navi_child_constants_collection ( GLib.FileStream file, Gee.Collection constants, DocumentedElement? mself ) { foreach ( Constant c in constants ) { if ( c == mself ) this.write_navi_entry ( file, c, mself, css_navi_constant, false ); @@ -2167,12 +2162,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_constants ( GLib.FileStream file, ConstantHandler ch, Basic mself ) { + protected void write_navi_child_constants ( GLib.FileStream file, ConstantHandler ch, DocumentedElement? mself ) { Gee.ReadOnlyCollection constants = ch.get_constant_list ( ); this.write_navi_child_constants_collection ( file, constants, mself ); } - protected void write_navi_child_structs_without_childs_collection ( GLib.FileStream file, Gee.Collection structs, Basic mself ) { + protected void write_navi_child_structs_without_childs_collection ( GLib.FileStream file, Gee.Collection structs, DocumentedElement? mself ) { foreach ( Struct stru in structs ) { if ( stru == mself ) this.write_navi_entry ( file, stru, mself, css_navi_struct, false ); @@ -2181,12 +2176,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_structs_without_childs ( GLib.FileStream file, StructHandler strh, Basic mself ) { + protected void write_navi_child_structs_without_childs ( GLib.FileStream file, StructHandler strh, DocumentedElement? mself ) { Gee.Collection structs = strh.get_struct_list ( ); this.write_navi_child_structs_without_childs_collection ( file, structs, mself ); } - protected void write_navi_child_delegates_collection ( GLib.FileStream file, Gee.Collection delegates, Basic mself ) { + protected void write_navi_child_delegates_collection ( GLib.FileStream file, Gee.Collection delegates, DocumentedElement? mself ) { foreach ( Delegate del in delegates ) { if ( del == mself ) this.write_navi_entry ( file, del, mself, css_navi_del, false ); @@ -2195,12 +2190,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_delegates ( GLib.FileStream file, DelegateHandler delh, Basic mself ) { + protected void write_navi_child_delegates ( GLib.FileStream file, DelegateHandler delh, DocumentedElement? mself ) { Gee.Collection delegates = delh.get_delegate_list ( ); this.write_navi_child_delegates_collection ( file, delegates, mself ); } - protected void write_navi_child_interfaces_without_childs_collection ( GLib.FileStream file, Gee.Collection interfaces, Basic mself ) { + protected void write_navi_child_interfaces_without_childs_collection ( GLib.FileStream file, Gee.Collection interfaces, DocumentedElement? mself ) { foreach ( Interface iface in interfaces ) { if ( iface == mself ) this.write_navi_entry ( file, iface, mself, css_navi_iface, false ); @@ -2209,12 +2204,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_interfaces_without_childs ( GLib.FileStream file, Namespace ifh, Basic mself ) { + protected void write_navi_child_interfaces_without_childs ( GLib.FileStream file, Namespace ifh, DocumentedElement? mself ) { Gee.Collection interfaces = ifh.get_interface_list ( ); this.write_navi_child_interfaces_without_childs_collection ( file, interfaces, mself ); } - protected void write_navi_child_enums_without_childs_collection ( GLib.FileStream file, Gee.Collection enums, Basic mself ) { + protected void write_navi_child_enums_without_childs_collection ( GLib.FileStream file, Gee.Collection enums, DocumentedElement? mself ) { foreach ( Enum en in enums ) { if ( en == mself ) this.write_navi_entry ( file, en, mself, css_navi_enum, false ); @@ -2223,12 +2218,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_enums_without_childs ( GLib.FileStream file, EnumHandler eh, Basic mself ) { + protected void write_navi_child_enums_without_childs ( GLib.FileStream file, EnumHandler eh, DocumentedElement? mself ) { Gee.Collection enums = eh.get_enum_list ( ); this.write_navi_child_enums_without_childs_collection ( file, enums, mself ); } - protected void write_navi_child_error_domains_without_childs_collection ( GLib.FileStream file, Gee.Collection errordomains, Basic mself ) { + protected void write_navi_child_error_domains_without_childs_collection ( GLib.FileStream file, Gee.Collection errordomains, DocumentedElement? mself ) { foreach ( ErrorDomain errdom in errordomains ) { if ( errdom == mself ) this.write_navi_entry ( file, errdom, mself, css_navi_error_domain, false ); @@ -2237,12 +2232,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_navi_child_error_domains_without_childs ( GLib.FileStream file, Namespace errdomh, Basic mself ) { + protected void write_navi_child_error_domains_without_childs ( GLib.FileStream file, Namespace errdomh, DocumentedElement? mself ) { Gee.Collection errordomains = errdomh.get_error_domain_list ( ); this.write_navi_child_error_domains_without_childs_collection ( file, errordomains, mself ); } - protected void write_navi_child_namespaces_without_childs ( GLib.FileStream file, NamespaceHandler nsh, Basic mself ) { + protected void write_navi_child_namespaces_without_childs ( GLib.FileStream file, NamespaceHandler nsh, DocumentedElement? mself ) { Gee.ReadOnlyCollection namespaces = nsh.get_namespace_list ( ); foreach ( Namespace ns in namespaces ) { if ( ns.name == null ) @@ -2255,32 +2250,26 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - -//////////////// - - - protected void write_package_note ( GLib.FileStream file, Basic element ) { - string package = element.package; + protected void write_package_note ( GLib.FileStream file, DocumentedElement element ) { + string package = element.package.name; if ( package == null ) return ; file.printf ( "\n\n
        \nPackage: %s\n\n", package ); } - protected void write_namespace_note ( GLib.FileStream file, Basic element ) { - for ( ; element is Namespace == false; element = element.parent ) - ; - - if ( element.parent == null ) + protected void write_namespace_note ( GLib.FileStream file, DocumentedElement element ) { + Namespace? ns = element.nspace; + if ( ns == null ) return ; - if ( element.name == null ) + if ( ns.name == null ) return ; - file.printf ( "\n\n
        \nNamespace: %s\n\n", element.full_name() ); + file.printf ( "\n\n
        \nNamespace: %s\n\n", ns.full_name() ); } - private void write_brief_description ( GLib.FileStream file, Valadoc.Basic element , Valadoc.Basic? pos ) { + private void write_brief_description ( GLib.FileStream file, DocumentedElement element , DocumentedElement? pos ) { DocumentationTree? doctree = element.documentation; if ( doctree == null ) return ; @@ -2304,7 +2293,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - private void write_documentation ( GLib.FileStream file, Valadoc.Basic element , Valadoc.Basic? pos ) { + private void write_documentation ( GLib.FileStream file, DocumentedElement element , DocumentedElement? pos ) { DocumentationTree? doctree = element.documentation; if ( doctree == null ) return ; @@ -2449,7 +2438,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t
        \n" ); } - public void write_enum_content ( GLib.FileStream file, Enum en, Basic? mself ) { + public void write_enum_content ( GLib.FileStream file, Enum en, DocumentedElement? mself ) { string full_name = en.full_name ( ); file.printf ( "\t\t\t
        \n", css_style_content ); file.printf ( "\t\t\t\t

        %s:

        \n", css_title, full_name ); @@ -2490,7 +2479,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_namespaces ( GLib.FileStream file, NamespaceHandler nh, Basic? mself ) { + protected void write_child_namespaces ( GLib.FileStream file, NamespaceHandler nh, DocumentedElement? mself ) { Gee.ArrayList nsl = new Gee.ArrayList (); this.fetch_subnamespace_names ( nh, nsl ); @@ -2525,7 +2514,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
      \n" ); } - protected void write_child_methods ( GLib.FileStream file, MethodHandler mh, Basic? mself ) { + protected void write_child_methods ( GLib.FileStream file, MethodHandler mh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = mh.get_method_list (); Gee.ArrayList imethods = new Gee.ArrayList ( ); foreach ( Method m in methods ) { @@ -2545,7 +2534,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_dependencies ( GLib.FileStream file, Package package, Basic? mself ) { + protected void write_child_dependencies ( GLib.FileStream file, Package package, DocumentedElement? mself ) { Gee.ReadOnlyCollection deps = package.get_full_dependency_list (); if ( deps.size == 0 ) return ; @@ -2573,7 +2562,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "
    \n" ); } - protected void write_child_static_methods ( GLib.FileStream file, MethodHandler mh, Basic? mself ) { + protected void write_child_static_methods ( GLib.FileStream file, MethodHandler mh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = mh.get_method_list (); Gee.ArrayList static_methods = new Gee.ArrayList ( ); @@ -2594,7 +2583,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - public void write_class_content ( GLib.FileStream file, Class cl, Basic? mself ) { + public void write_class_content ( GLib.FileStream file, Class cl, DocumentedElement? mself ) { string full_name = cl.full_name ( ); file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, full_name ); @@ -2627,7 +2616,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t
    \n" ); } - public void write_interface_content ( GLib.FileStream file, Interface iface, Basic? mself ) { + public void write_interface_content ( GLib.FileStream file, Interface iface, DocumentedElement? mself ) { string full_name = iface.full_name (); file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, full_name ); @@ -2657,7 +2646,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t
    \n" ); } - public void write_error_domain_content ( GLib.FileStream file, ErrorDomain errdom, Basic? mself ) { + public void write_error_domain_content ( GLib.FileStream file, ErrorDomain errdom, DocumentedElement? mself ) { string full_name = errdom.full_name ( ); file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, full_name ); @@ -2678,7 +2667,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t
    \n" ); } - public void write_struct_content ( GLib.FileStream file, Struct stru, Basic? mself ) { + public void write_struct_content ( GLib.FileStream file, Struct stru, DocumentedElement? mself ) { string full_name = stru.full_name ( ); file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, full_name ); @@ -2707,12 +2696,12 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } - protected abstract string get_img_real_path ( Basic element ); + protected abstract string get_img_real_path ( DocumentedElement element ); - protected abstract string get_img_path ( Basic element ); + protected abstract string get_img_path ( DocumentedElement element ); - protected void write_child_constants ( GLib.FileStream file, ConstantHandler ch, Basic? mself ) { + protected void write_child_constants ( GLib.FileStream file, ConstantHandler ch, DocumentedElement? mself ) { Gee.ReadOnlyCollection constants = ch.get_constant_list (); if ( constants.size > 0 ) { file.printf ( "

    Constants:

    \n", css_title ); @@ -2726,7 +2715,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_enums ( GLib.FileStream file, EnumHandler eh, Basic? mself ) { + protected void write_child_enums ( GLib.FileStream file, EnumHandler eh, DocumentedElement? mself ) { Gee.Collection enums = eh.get_enum_list (); if ( enums.size > 0 ) { file.printf ( "

    Enums:

    \n", css_title ); @@ -2740,7 +2729,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_errordomains ( GLib.FileStream file, ErrorDomainHandler eh, Basic? mself ) { + protected void write_child_errordomains ( GLib.FileStream file, ErrorDomainHandler eh, DocumentedElement? mself ) { Gee.Collection errdoms = eh.get_error_domain_list (); if ( errdoms.size > 0 ) { file.printf ( "

    Errordomains:

    \n", css_title ); @@ -2754,7 +2743,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_construction_methods ( GLib.FileStream file, ConstructionMethodHandler cmh, Basic? mself ) { + protected void write_child_construction_methods ( GLib.FileStream file, ConstructionMethodHandler cmh, DocumentedElement? mself ) { Gee.ReadOnlyCollection methods = cmh.get_construction_method_list (); if ( methods.size > 0 ) { file.printf ( "

    Construction Methods:

    \n", css_title ); @@ -2786,7 +2775,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.printf ( "\n", css_diagram, imgpath ); } - protected void write_child_fields ( GLib.FileStream file, FieldHandler fh, Basic? mself ) { + protected void write_child_fields ( GLib.FileStream file, FieldHandler fh, DocumentedElement? mself ) { Gee.ReadOnlyCollection fields = fh.get_field_list (); if ( fields.size > 0 ) { file.printf ( "

    Fields:

    \n", css_title ); @@ -2800,7 +2789,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_properties ( GLib.FileStream file, PropertyHandler ph, Basic? mself ) { + protected void write_child_properties ( GLib.FileStream file, PropertyHandler ph, DocumentedElement? mself ) { Gee.ReadOnlyCollection properties = ph.get_property_list (); if ( properties.size > 0 ) { file.printf ( "

    Properties:

    \n", css_title ); @@ -2814,7 +2803,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_signals ( GLib.FileStream file, SignalHandler sh, Basic? mself ) { + protected void write_child_signals ( GLib.FileStream file, SignalHandler sh, DocumentedElement? mself ) { Gee.ReadOnlyCollection signals = sh.get_signal_list (); if ( signals.size > 0 ) { file.printf ( "

    Signals:

    \n", css_title ); @@ -2828,7 +2817,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_classes ( GLib.FileStream file, ClassHandler clh, Basic? mself ) { + protected void write_child_classes ( GLib.FileStream file, ClassHandler clh, DocumentedElement? mself ) { Gee.ReadOnlyCollection classes = clh.get_class_list (); if ( classes.size > 0 ) { file.printf ( "

    Classes:

    \n", css_title ); @@ -2850,7 +2839,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_interfaces ( GLib.FileStream file, InterfaceHandler ih, Basic? mself ) { + protected void write_child_interfaces ( GLib.FileStream file, InterfaceHandler ih, DocumentedElement? mself ) { Gee.Collection ifaces = ih.get_interface_list ( ); if ( ifaces.size > 0 ) { file.printf ( "

    Interfaces:

    \n", css_title ); @@ -2864,7 +2853,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_delegates ( GLib.FileStream file, DelegateHandler dh, Basic? mself ) { + protected void write_child_delegates ( GLib.FileStream file, DelegateHandler dh, DocumentedElement? mself ) { Gee.Collection delegates = dh.get_delegate_list (); if ( delegates.size > 0 ) { file.printf ( "

    Delegates:

    \n", css_title ); @@ -2878,7 +2867,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - protected void write_child_structs ( GLib.FileStream file, StructHandler struh, Basic? mself ) { + protected void write_child_structs ( GLib.FileStream file, StructHandler struh, DocumentedElement? mself ) { Gee.Collection structs = struh.get_struct_list (); if ( structs.size > 0 ) { file.printf ( "

    Structs:

    \n", css_title ); @@ -2892,7 +2881,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { } } - public void write_namespace_content ( GLib.FileStream file, Namespace ns, Basic? mself ) { + public void write_namespace_content ( GLib.FileStream file, Namespace ns, DocumentedElement? mself ) { file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, (ns.name == null)? "Global Namespace" : ns.full_name () ); file.printf ( "\t\t\t\t
    \n", css_hr ); @@ -2918,7 +2907,7 @@ public abstract class Valadoc.BasicHtmlDoclet : Valadoc.Doclet { file.puts ( "\t\t\t
    \n" ); } - protected void write_file_content ( GLib.FileStream file, Package f, Basic? mself ) { + protected void write_file_content ( GLib.FileStream file, Package f, DocumentedElement? mself ) { file.printf ( "\t\t\t
    \n", css_style_content ); file.printf ( "\t\t\t\t

    %s:

    \n", css_title, f.name ); file.printf ( "\t\t\t\t
    \n", css_headline_hr ); diff --git a/src/doclets/valadoc.org/Makefile.am b/src/doclets/valadoc.org/Makefile.am index 4239419aa..c835b12e7 100644 --- a/src/doclets/valadoc.org/Makefile.am +++ b/src/doclets/valadoc.org/Makefile.am @@ -1,16 +1,17 @@ # src/Makefile.am + + + + +if ENABLE_VALADOCORG + NULL = SUBDIRS = \ - linkhelper \ doclet \ - taglets \ $(NULL) -# langlet \ -# doclet \ -# $(NULL) - +endif diff --git a/src/doclets/valadoc.org/doclet/Makefile.am b/src/doclets/valadoc.org/doclet/Makefile.am index b0758797b..5953bf8af 100644 --- a/src/doclets/valadoc.org/doclet/Makefile.am +++ b/src/doclets/valadoc.org/doclet/Makefile.am @@ -12,7 +12,7 @@ BUILT_SOURCES = libdoclet.vala.stamp libdoclet.vala.stamp: $(libdoclet_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 $^ + $(VALAC) -C --vapidir ../../../vapi --pkg mysql --pkg valadoc-1.0 --basedir . --save-temps $^ touch $@ @@ -33,21 +33,19 @@ libdoclet_la_SOURCES = \ AM_CFLAGS = -g \ -I ../../../libvaladoc/ \ - -I ../../htmlhelpers/ \ - -I ../linkhelper/ \ - -I ../ \ + `mysql_config --cflags` \ $(GLIB_CFLAGS) \ $(LIBVALA_CFLAGS) \ $(NULL) -libdoclet_la_LDFLAGS = -module -avoid-version +libdoclet_la_LDFLAGS = -module -avoid-version \ + `mysql_config --libs` \ + $(NULL) libdoclet_la_LIBADD = \ - ../../htmlhelpers/libhtmlhelpers.la \ ../../../libvaladoc/libvaladoc.la \ - ../linkhelper/libhtmlhelper.la \ $(GLIB_LIBS) \ $(LIBVALA_LIBS) \ $(NULL) diff --git a/src/doclets/valadoc.org/doclet/template.vala b/src/doclets/valadoc.org/doclet/template.vala index 50307ebab..4b7a4d6d5 100644 --- a/src/doclets/valadoc.org/doclet/template.vala +++ b/src/doclets/valadoc.org/doclet/template.vala @@ -18,19 +18,605 @@ */ using Valadoc; +using Mysql; using GLib; using Gee; -public class Valadoc.LangletIndex : Valadoc.BasicHtmlLanglet, Valadoc.LinkHelper { - protected override string get_link ( Basic element, Basic pos ) { - return this.get_html_link ( this.settings, element ); + + +public class Valadoc.ValadocOrgLanglet : Valadoc.Langlet { + private const string css_optional_parameter = ""; + private const string css_basic_type = ""; + private const string css_other_type = ""; + private const string css_keyword = ""; + + public Valadoc.Settings settings { + construct set; + protected get; + } + + public ValadocOrgLanglet ( Settings settings ) { + this.settings = settings; + } + + private Basic position = null; + + protected string get_link ( Basic type, Basic position ) { + return ""; + } + + private inline bool is_basic_type ( string name ) { + string[] basic_types = new string[] { "bool", "char", "uchar", "int", "uint", "short", "ushort", + "long", "ulong", "size_t", "ssize_t", "int8", "uint8", "int16", "uint16", "int32", + "uint32", "int64", "uint64", "float", "double", "time_t", "unichar", "string" + }; + + foreach ( string str in basic_types ) { + if ( str == name ) + return true; + } + + return false; + } + + private void write_type_name ( DataType? datatype, GLib.StringBuilder stream ) { + if ( datatype == null ) { + stream.append ( "void" ); + return ; + } + + string typename = datatype.full_name (); + if ( ((DocumentedElement)datatype.parent).name == null && (datatype is Class || datatype is Struct) ) { + if ( this.is_basic_type ( typename ) ) { + string link = this.get_link(datatype, this.position ); + if ( link == null ) { + stream.append ( "" ); + stream.append ( typename ); + stream.append ( "" ); + } + else { + stream.append ( "" ); + stream.append ( typename ); + stream.append ( "" ); + } + return ; + } + } + + string link = this.get_link(datatype, this.position); + if ( link == null ) { + stream.append ( "" ); + stream.append ( typename ); + stream.append ( "" ); + } + else { + stream.append ( "" ); + stream.append ( typename ); + stream.append ( "" ); + } + } + + private void write_type_reference_name ( TypeReference type_reference, GLib.StringBuilder stream ) { + if ( type_reference.type_name == "void" ) { + stream.append ( "void" ); + } + else { + if ( type_reference.data_type == null ) { + stream.append ( "" ); + stream.append ( type_reference.type_name ); + stream.append ( "" ); + } + else { + this.write_type_name ( type_reference.data_type, stream ); + } + } + } + + private void write_type_reference_template_arguments ( Valadoc.TypeReference type_reference, GLib.StringBuilder stream ) { + Gee.Collection arglst = type_reference.get_type_arguments ( ); + int size = arglst.size; + if ( size == 0 ) + return ; + + stream.append ( "<" ); + int i = 0; + + foreach ( TypeReference arg in arglst ) { + i++; + + this.write_nested_type_referene ( arg, stream ); + if ( i != size ) + stream.append ( ", " ); + } + + stream.append ( ">" ); + } + + private void write_nested_type_referene ( Valadoc.TypeReference type_reference, GLib.StringBuilder stream ) { + if ( type_reference.type_name == null ) + return ; + + + GLib.StringBuilder modifiers = new GLib.StringBuilder (); + + if ( type_reference.is_dynamic ) + modifiers.append ( "dynamic " ); + + if ( type_reference.is_weak ) + modifiers.append ( "weak " ); + else if ( type_reference.is_unowned ) + modifiers.append ( "unowned " ); + else if ( type_reference.is_owned ) + modifiers.append ( "owned " ); + + if ( modifiers.len > 0 ) { + stream.append ( "" ); + stream.append ( modifiers.str ); + stream.append ( " "); + } + + + this.write_type_reference_name ( type_reference, stream ); + this.write_type_reference_template_arguments ( type_reference, stream ); + + if ( type_reference.is_array ) { + stream.append_unichar ( '[' ); + stream.append ( string.nfill ( type_reference.array_rank-1, ',') ); + stream.append_unichar ( ']' ); + } + + if ( type_reference.is_nullable ) { + stream.append_unichar ( '?' ); + } + + stream.append ( string.nfill ( type_reference.pointer_rank, '*') ); + } + + public override void write_type_reference ( Valadoc.TypeReference type_reference, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + + if ( type_reference == null ) + return ; + + this.write_nested_type_referene ( type_reference, stream ); + stream.append_unichar ( ' ' ); + + /* + if ( type_reference.is_weak ) { + file.printf ( "weak ", css_keyword ); + } + + this.write_type_name ( type_reference.data_type, file ); + + if ( type_reference.is_array ) { + string str = string.nfill ( type_reference.array_rank-1, ','); + file.printf ( "[%s]", str ); + } + + if ( type_reference.pass_ownership ) { + file.putc ( '#' ); + } + + if ( type_reference.is_nullable ) { + file.putc ( '?' ); + } + + string str = string.nfill ( type_reference.pointer_rank, '*' ); + file.puts ( str ); + */ + } + + private void write_formal_parameter ( FormalParameter param, GLib.StringBuilder stream ) { + if ( param.ellipsis ) { + stream.append ( " ..." ); + } + else { + if ( param.is_out ) { + stream.append ( "out " ); + } + else if ( param.is_ref ) { + stream.append ( "ref " ); + } + + this.write_type_reference ( param.type_reference, stream ); + stream.append_unichar ( ' ' ); + stream.append ( param.name ); + } + } + + public override void write_parameter_list ( ParameterListHandler thandler, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + bool open_bracket = false; + + Gee.ArrayList params = thandler.param_list; + int size = params.size; + int i = 0; + + stream.append_unichar ( '(' ); + + foreach ( FormalParameter param in params ) { + i++; + + if ( param.has_default_value == true && open_bracket == false ) { + stream.append ( "[" ); + open_bracket = true; + } + + this.write_formal_parameter ( param, stream ); + if ( i != size ) { + stream.append ( ", " ); + } + else if ( open_bracket == true ) { + stream.append ( "]" ); + } + } + + stream.append_unichar ( ')' ); + } + + private void write_exception_list ( ExceptionHandler exception_handler, GLib.StringBuilder stream ) { + Gee.ReadOnlyCollection error_domains = exception_handler.get_error_domains (); + int size = error_domains.size; + int i = 1; + + if ( size == 0 ) + return ; + + stream.append ( " throws " ); + + + foreach ( DataType type in error_domains ) { + this.write_type_name ( type, stream ); + if ( error_domains.size > i ) { + stream.append ( ", " ); + } + i++; + } + } + + public override void write_method ( void* ptr, Valadoc.Method m, Valadoc.MethodHandler parent ) { + GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" ); + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = m; + + this.write_accessor ( m, stream ); + + if ( m.is_abstract ) + modifiers.append ( " abstract" ); + else if ( m.is_virtual ) + modifiers.append ( " virtual" ); + else if ( m.is_override ) + modifiers.append ( " override" ); + if ( m.is_static ) + modifiers.append ( " static" ); + if ( m.is_inline ) + modifiers.append ( " inline" ); + + if ( modifiers.len > 0 ) { + stream.append ( " " ); + stream.append ( modifiers.str ); + stream.append ( "" ); + } + + this.write_type_reference ( m.type_reference, stream ); + stream.append ( m.name ); + stream.append_unichar ( ' ' ); + this.write_parameter_list ( m, stream ); + + if ( m.is_yields ) { + stream.append ( " yields " ); + } + + this.write_exception_list ( m, stream ); + } + + public override void write_type_parameter ( TypeParameter param, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + stream.append ( param.name ); + } + + public override void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + int i = 1; + + var lst = thandler.get_template_param_list( ); + if ( lst.size == 0 ) + return ; + + stream.append ( "<" ); // < + + foreach ( TypeParameter param in lst ) { + param.write ( this, stream ); + if ( lst.size > i ) + stream.append ( ", " ); + + i++; + } + stream.append ( ">" ); // > + } + + public override void write_field ( Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = field; + + this.write_accessor ( field, stream ); + + if ( field.is_volatile ) { + stream.append ( " volatile" ); + } + + this.write_type_reference ( field.type_reference, stream ); + + stream.append_unichar ( ' ' ); + stream.append ( field.name ); } - public LangletIndex ( Settings settings ) { - base ( settings ); + public override void write_constant ( Constant constant, ConstantHandler parent, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = constant; + + this.write_accessor ( constant, stream ); + stream.append ( " const " ); + + this.write_type_reference ( constant.type_reference, stream ); + + stream.append_unichar ( ' ' ); + stream.append ( constant.name ); + } + + public override void write_property_accessor ( Valadoc.PropertyAccessor propac, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + Property prop = (Property)propac.parent; + + stream.append ( "" ); + + if ( !(prop.is_public == propac.is_public && prop.is_private == propac.is_private && prop.is_protected == propac.is_protected) ) { + // FIXME: PropertyAccessor isn't a SymbolAccessibility. + if ( propac.is_public ) + stream.append ( "public " ); + else if ( propac.is_protected ) + stream.append ( "protected " ); + else if ( propac.is_private ) + stream.append ( "private " ); + } + + if ( propac.is_owned ) + stream.append ( "owned " ); + + if ( propac.is_get ) + stream.append ( "get" ); + else if ( propac.is_set ) + stream.append ( "set" ); + + stream.append ( "; " ); + } + + public override void write_property ( Valadoc.Property prop, void* ptr ) { + GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" ); + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = prop; + + + this.write_accessor ( prop, stream ); + + if ( prop.is_virtual ) { + modifiers.append ( " virtual " ); + } + else if ( prop.is_abstract ) { + modifiers.append ( " abstract " ); + } + else if ( prop.is_override ) { + modifiers.append ( " override " ); + } + + if ( modifiers.len > 0 ) { + stream.append ( " " ); + stream.append ( modifiers.str ); + stream.append ( " " ); + } + + this.write_type_reference ( prop.type_reference, stream ); + stream.append_unichar ( ' ' ); + stream.append ( prop.name ); + stream.append ( " { " ); + + if ( prop.setter != null ) + this.write_property_accessor ( prop.setter, stream ); + + + stream.append_unichar ( ' ' ); + + if ( prop.getter != null ) + this.write_property_accessor ( prop.getter, stream ); + + stream.append ( " }" ); + } + + public override void write_signal ( Valadoc.Signal sig, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = sig; + + this.write_accessor ( sig, stream ); + + stream.append ( " " ); + + if ( sig.is_virtual == true ) + stream.append ( "virtual " ); + + stream.append ( "signal " ); + + this.write_type_reference ( sig.type_reference, stream ); + stream.append_unichar ( ' ' ); + stream.append ( sig.name ); + stream.append_unichar ( ' ' ); + this.write_parameter_list ( sig, stream ); + } + + public override void write_enum_value ( Valadoc.EnumValue enval, void* ptr ) { + } + + public override void write_error_code ( Valadoc.ErrorCode errcode, void* ptr ) { + } + + public override void write_delegate ( Valadoc.Delegate del, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = del; + + this.write_accessor ( del, stream ); + + stream.append ( " delegate " ); + + this.write_type_reference ( del.type_reference, stream ); + + stream.append_unichar ( ' ' ); + stream.append ( del.name ); + stream.append_unichar ( ' ' ); + this.write_parameter_list ( del, stream ); + this.write_exception_list ( del, stream ); + } + + public override void write_enum ( Valadoc.Enum en, void* ptr ) { + } + + public override void write_error_domain ( Valadoc.ErrorDomain errdom, void* ptr ) { + } + + private void write_accessor ( Valadoc.SymbolAccessibility element, GLib.StringBuilder stream ) { + stream.append ( "public " ); + stream.append ( css_keyword ); + stream.append ( "\">" ); + + if ( element.is_public ) + stream.append ( "public" ); + else if ( element.is_protected ) + stream.append ( "protected" ); + else if ( element.is_private ) + stream.append ( "private" ); + + stream.append ( " " ); + } + + public override void write_struct ( Valadoc.Struct stru, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = stru; + + this.write_accessor ( stru, stream ); + stream.append ( "struct " ); + stream.append ( stru.name ); + + this.write_template_parameters ( stru, stream ); + this.write_inheritance_list ( stru, stream ); + } + + private void write_inheritance_list ( Valadoc.ContainerDataType dtype, GLib.StringBuilder stream ) { + Gee.Collection lst = dtype.get_parent_types ( ); + int size = lst.size; + int i = 1; + + if ( size == 0 ) + return ; + + stream.append ( " : " ); + + foreach ( DataType cntype in lst ) { + this.write_type_name ( cntype, stream ); + if ( size > i ) + stream.append ( ", " ); + + i++; + } + + stream.append_unichar ( ' ' ); + } + + public override void write_class ( Valadoc.Class cl, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = cl; + + this.write_accessor ( cl, stream ); + + stream.append ( "" ); + + if ( cl.is_abstract ) + stream.append ( "abstract " ); + + stream.append ( " class " ); + stream.append ( cl.name ); + + this.write_template_parameters ( cl, stream ); + this.write_inheritance_list ( cl, stream ); + } + + public override void write_interface ( Valadoc.Interface iface, void* ptr ) { + weak GLib.StringBuilder stream = (GLib.StringBuilder)ptr; + this.position = iface; + + this.write_accessor ( iface, stream ); + + stream.append ( "interface " ); + stream.append ( iface.name ); + + this.write_template_parameters ( iface, stream ); + this.write_inheritance_list ( iface, stream ); + } + + public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) { + } + + public override void write_file ( Valadoc.Package file, void* ptr ) { } } @@ -42,384 +628,1092 @@ public class Valadoc.LangletIndex : Valadoc.BasicHtmlLanglet, Valadoc.LinkHelper -public class Valadoc.HtmlDoclet : Valadoc.BasicHtmlDoclet, Valadoc.LinkHelper { - private string current_path = null; - private bool is_vapi = false; +public class Valadoc.HtmlDoclet : Valadoc.Doclet { + private Gee.HashMap ids = new Gee.HashMap (); + private GLib.List exist = new GLib.List (); + private Valadoc.ValadocOrgLanglet langlet; + private Settings settings; + private bool run = true; + private Database mysql; + private int level; - protected override string get_link ( Valadoc.Basic p1, Valadoc.Basic? p2 ) { - return this.get_html_link ( this.settings, p1 ); + private Namespace? get_global_namespace ( Package pkg ) { + foreach ( Namespace ns in pkg.get_namespace_list() ) { + if ( ns.name == null ) { + return ns; + } + } + return null; } - private override void write_top_element ( GLib.FileStream file, Basic? pos ) { - this.write_top_element_template ( file, "?" ); + private ulong get_package_id ( Package element ) { + if ( this.ids.contains ( element ) == true ) { + return this.ids.get ( element ); + } + + string query = "SELECT `id` FROM `Element` NATURAL JOIN `PackageElement` WHERE `name`='" + element.name + "' LIMIT 1"; + if ( mysql.query ( query ) != 0 ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + Result? res = mysql.store_result (); + if ( res == null ) { + return 0; + } + + weak string[]? row = res.fetch_row (); + if ( row == null ) { + return 0; + } + + ulong id = row[0].to_ulong (); + Namespace? ns = this.get_global_namespace ( element ); + if ( ns != null ) { + this.ids.set ( ns, id ); + } + + this.ids.set ( element, id ); + return id; } + private ulong get_type_id ( DocumentedElement element ) { + if ( this.ids.contains ( element ) == true ) { + return this.ids.get ( element ); + } + + GLib.Queue stack = new Queue (); + for ( DocumentedElement pos = element; pos != null ; pos = (DocumentedElement)pos.parent ) { + stack.push_head ( pos ); + } + Package pkg = (Package)stack.pop_head ( ); + ulong lastid = this.get_package_id ( pkg ); - private string get_full_path ( Basic element ) { - if ( element.name == null ) - return ""; + foreach ( DocumentedElement pos in stack.head ) { + if ( this.ids.contains ( pos ) ) { + lastid = this.ids.get ( pos ); + continue ; + } - GLib.StringBuilder str = new GLib.StringBuilder ( "" ); + string query = "SELECT `id` FROM `ChildElement` NATURAL JOIN `Element` WHERE `name`='%s' AND `parentelement`='%lu' LIMIT 1".printf ( pos.name, lastid ); + bool tmp = mysql.query ( query ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - for ( var pos = element; pos != null ; pos = pos.parent ) { - if ( pos is Package ) - break; + Result? res = mysql.store_result (); + if ( res == null ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + weak string[]? row = res.fetch_row (); + if ( row == null ) { + return 0; + } + + lastid = row[0].to_ulong (); - str.prepend_unichar ( '/' ); + if ( lastid == 0 ) { + return 0; + } - if ( pos.name == null ) - str.prepend ( "0" ); - else - str.prepend ( pos.name ); + this.ids.set ( pos, lastid ); } - string package_name = element.file.name + "/"; + return lastid; + } - str.prepend ( package_name ); - str.append_unichar ( '/' ); - return str.str; + private ulong db_create_element ( DocumentedElement element ) { + string name = element.name; + if ( name == null ) { + // err msg + return 0; + } + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `Element` (`name`,`fullname`,`txtid`) VALUES ( '"); + query.append ( name ); + query.append ( "', '" ); + query.append ( element.full_name () ); + query.append ( "', '" ); + + if ( element is Package == false ) { + query.append ( element.package.name ); + query.append_unichar ( '/' ); + } + + query.append ( element.full_name () ); + query.append ( "');" ); + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + // err msg + return 0; + } + + ulong id = this.mysql.insert_id (); + this.ids.set ( element, id ); + return id; } - public Valadoc.Settings settings { - construct set; - protected get; + private ulong db_create_property ( Property element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) { + return 0; + } + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `PropertyElement` (`id`,`abstract`,`virtual`,`override`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_abstract ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_virtual ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_override ) ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + ulong tmp2 = this.db_create_accessibility ( element ); + if ( tmp2 == 0 ) + return 0; + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; } - public override void initialisation ( Settings settings ) { - this.settings = settings; + private ulong db_create_field ( Field element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; - DirUtils.create ( this.settings.path, 0777 ); - this.langlet = new Valadoc.LangletIndex ( settings ); + bool tmp = mysql.query ( "INSERT INTO `FieldElement` (`id`,`volatile`) VALUES ('%lu','%s');".printf ( id, this.db_boolean ( element.is_volatile ) ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + ulong tmp2 = this.db_create_accessibility ( element ); + if ( tmp2 == 0 ) + return 0; + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; } - protected override string get_img_real_path ( Basic element ) { - return this.current_path + "tree.png"; + private ulong db_create_constant ( Constant element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; + + bool tmp = mysql.query ( "INSERT INTO `ConstantElement` (`id`) VALUES ('%lu');".printf ( id ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + ulong tmp2 = this.db_create_accessibility ( element ); + if ( tmp2 == 0 ) + return 0; + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; } - protected override string get_img_path ( Basic element ) { - return "docs/" + get_full_path ( element ) + "tree.png"; + private bool db_add_child_element ( Basic element ) { + bool tmp = mysql.query ( "INSERT INTO `ChildElement` (`id`, `parentelement`) VALUES ('%lu', '%lu');".printf ( this.ids.get ( element ), this.ids.get ( element.parent ) ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return false; + } + return true; } - public override void visit_package ( Package file ) { - string package_name = file.name; - this.is_vapi = file.is_package; + private ulong db_create_package ( Package element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; - string new_path = this.settings.path + package_name + "/"; + bool tmp = mysql.query ( "INSERT INTO `PackageElement` (`id`) VALUES ('%lu');".printf ( id ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - DirUtils.create ( new_path, 0777 ); + return id; + } - GLib.FileStream nav = GLib.FileStream.open ( new_path + "navi.html", "w" ); - this.write_navi_file ( nav, file, file ); - nav = null; + private ulong db_create_namespace ( Namespace element ) { + if ( element.name == null ) { + ulong id = this.get_type_id ( element.package ); + this.ids.set ( element, id ); + return id; + } - GLib.FileStream sfile = GLib.FileStream.open ( new_path + "index.html", "w" ); - this.write_file_content ( sfile, file, file ); - sfile = null; + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; - this.current_path = new_path; - file.visit_namespaces ( this ); - this.current_path = null; + bool tmp = mysql.query ( "INSERT INTO `NamespaceElement` (`id`) VALUES ('%lu');".printf ( id ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; } - public override void visit_namespace ( Namespace ns ) { - string old_path = this.current_path; + private ulong db_create_type ( DocumentedElement element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; + + bool tmp = mysql.query ( "INSERT INTO `TypeElement` (`id`) VALUES ('%lu');".printf ( id ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + return id; + } + + private string db_boolean ( bool boolean ) { + return ( boolean == true )? "1" : "0"; + } + + private bool db_create_class_parent ( Class element ) { + ContainerDataType parent = element.parent_class; + if ( parent == null ) + return true; + + ulong id = this.get_type_id ( element ); + ulong pid = this.get_type_id ( parent ); + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ParentClassElement` (`id`, `parent`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + query.append ( pid.to_string() ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return false; + } + return true; + } + + private bool db_create_interface_list ( ContainerDataType element ) { + Gee.Collection interfacelist = element.get_parent_types (); + if ( interfacelist.size == 0 ) + return true; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ImplementedInterfaceList` (`id`, `interface`) VALUES ('" ); + query.append ( this.get_type_id ( element ).to_string() ); + query.append ( "', '%lu');" ); + + foreach ( DataType type in interfacelist ) { + if ( type is Valadoc.Interface ) { + bool tmp = mysql.query ( query.str.printf ( this.get_type_id ( type ) ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return false; + } + } + } + return true; + } + + private bool db_create_with_image_element ( DocumentedElement element ) { + string realimgpath = this.settings.path + element.package.name + "/" + element.full_name () + ".png"; + if ( element is Class ) { + Diagrams.write_class_diagram ( (Class)element, realimgpath ); + } + else if ( element is Interface ) { + Diagrams.write_interface_diagram ( (Interface)element, realimgpath ); + } + else if ( element is Struct ) { + Diagrams.write_struct_diagram ( (Struct)element, realimgpath ); + } + return true; + } + + private bool db_create_with_api_element ( DocumentedElement element ) { + GLib.StringBuilder stream = new GLib.StringBuilder (); - if ( ns.name == null ) { - string tmp = this.current_path + "0/"; - this.current_path = tmp; + if ( element is Class ) { + ((Class)element).write ( this.langlet, stream ); + } + else if ( element is Interface ) { + ((Interface)element).write ( this.langlet, stream ); + } + else if ( element is Struct ) { + ((Struct)element).write ( this.langlet, stream ); + } + else if ( element is Method ) { + ((Method)element).write ( this.langlet, stream, (MethodHandler)element.parent ); + } + else if ( element is Delegate ) { + ((Delegate)element).write ( this.langlet, stream ); + } + else if ( element is Signal ) { + ((Signal)element).write ( this.langlet, stream ); + } + else if ( element is Property ) { + ((Property)element).write ( this.langlet, stream ); + } + else if ( element is Constant ) { + ((Constant)element).write ( this.langlet, stream, (ConstantHandler)element.parent ); + } + else if ( element is Field ) { + ((Field)element).write ( this.langlet, stream, (FieldHandler)element.parent ); } else { - string tmp = this.current_path + ns.name + "/"; - this.current_path = tmp; + return true; + } + + unichar[] code = new unichar[stream.len*2+1]; + this.mysql.real_escape_string ( (string)code, stream.str, stream.len ); + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `WithApiElement` (`id`, `code`) VALUES ('" ); + query.append ( this.ids.get ( element ).to_string() ); + query.append ( "', '" ); + query.append ( (string)code ); + query.append ( "');" ); + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return false; + } + return true; + } + + private bool db_create_exception_list ( ExceptionHandler element ) { + Gee.ReadOnlyCollection list = element.get_error_domains (); + if ( list.size == 0 ) + return true; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ExceptionList` (`id`, `errordomain`) VALUES ('" ); + query.append ( this.ids.get ( element ).to_string() ); + query.append ( "', '%d');" ); + + foreach ( DataType type in list ) { + bool tmp = mysql.query ( query.str.printf ( this.get_type_id ( type ) ) ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return false; + } + } + return true; + } + + private ulong db_create_accessibility ( SymbolAccessibility element ) { + ulong id = this.ids.get ( element ); + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `AccessibilityElement` (`id`,`accessibility`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + + if ( element.is_protected ) + query.append ( "PROTECTED" ); + else if ( element.is_private ) + query.append ( "PRIVATE" ); + else if ( element.is_public ) + query.append ( "PUBLIC" ); + + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; } - DirUtils.create ( this.current_path, 0777 ); + return id; + } - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_namespace ( navi, ns ); - navi = null; + private ulong db_create_class ( Class element ) { + ulong id = this.db_create_type ( element ); + if ( id == 0 ) + return 0; + + id = this.db_create_accessibility ( element ); + if ( id == 0 ) + return 0; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ClassElement` (`id`,`abstract`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_abstract ) ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" ); - this.write_namespace_content ( file, ns, ns ); - file = null; + tmp = this.db_create_with_image_element ( element ); + if ( tmp == false ) + return 0; - // file: - ns.visit_namespaces ( this ); - ns.visit_classes ( this ); - ns.visit_interfaces ( this ); - ns.visit_structs ( this ); - ns.visit_enums ( this ); - ns.visit_error_domains ( this ); - ns.visit_delegates ( this ); - ns.visit_methods ( this ); - ns.visit_fields ( this ); - ns.visit_constants ( this ); + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + return id; } - public override void visit_interface ( Interface iface ) { - string old_path = this.current_path; - this.current_path += iface.name + "/"; - DirUtils.create ( this.current_path, 0777 ); + private ulong db_create_enum ( Enum element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; - iface.visit_classes ( this ); - iface.visit_structs ( this ); - iface.visit_delegates ( this ); - iface.visit_methods ( this ); - iface.visit_signals ( this ); - iface.visit_properties ( this ); - iface.visit_fields ( this ); + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; - GLib.FileStream cname = GLib.FileStream.open ( this.current_path + "cname", "w" ); - cname.puts ( iface.get_cname() ); - cname = null; + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `EnumElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_interface ( navi, iface, iface ); - navi = null; + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w"); - this.write_interface_content ( file, iface, iface ); - file = null; + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + return id; } - public override void visit_class ( Class cl ) { - string old_path = this.current_path; - this.current_path += cl.name + "/"; - DirUtils.create ( this.current_path, 0777 ); + private ulong db_create_errordomain ( ErrorDomain element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; - cl.visit_construction_methods ( this ); - cl.visit_classes ( this ); - cl.visit_structs ( this ); - cl.visit_enums ( this ); - cl.visit_delegates ( this ); - cl.visit_methods ( this ); - cl.visit_signals ( this ); - cl.visit_properties ( this ); - cl.visit_fields ( this ); - cl.visit_constants ( this ); + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_class ( navi, cl, cl ); - navi = null; + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ErrordomainElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); - GLib.FileStream cname = GLib.FileStream.open ( this.current_path + "cname", "w" ); - cname.puts ( cl.get_cname() ); - cname = null; + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w"); - this.write_class_content ( file, cl, cl ); - file = null; + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + return id; } - public override void visit_struct ( Struct stru ) { - string old_path = this.current_path; - this.current_path += stru.name + "/"; - DirUtils.create ( this.current_path, 0777 ); + private ulong db_create_enumvalue ( EnumValue element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `EnumValueElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - stru.visit_construction_methods ( this ); - stru.visit_methods ( this ); - stru.visit_fields ( this ); - stru.visit_constants ( this ); + return id; + } + + private ulong db_create_errorcode ( ErrorCode element ) { + ulong id = db_create_element ( element ); + if ( id == 0 ) + return 0; - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_struct ( navi, stru, stru ); - navi = null; + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `ErrorCodeElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); - // FIXME: libbonoboui-2.0 - GLib.FileStream cname = GLib.FileStream.open ( this.current_path + "cname", "w" ); - if ( cname != null ) { - cname.puts ( stru.get_cname() ); - cname = null; + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w"); - this.write_struct_content ( file, stru, stru ); - file = null; + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + return id; } - public override void visit_error_domain ( ErrorDomain errdom ) { - string old_path = this.current_path; - this.current_path += errdom.name + "/"; - DirUtils.create ( this.current_path, 0777 ); + private ulong db_create_interface ( Interface element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; - errdom.visit_methods ( this ); + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; - GLib.FileStream cname = GLib.FileStream.open ( this.current_path + "cname", "w" ); - cname.puts ( errdom.get_cname() ); - cname = null; + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `InterfaceElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_error_domain ( navi, errdom, errdom ); - navi = null; + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w"); - this.write_error_domain_content ( file, errdom, errdom ); - file = null; + tmp = this.db_create_with_image_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; } - public override void visit_enum ( Enum en ) { - string old_path = this.current_path; - this.current_path += en.name + "/"; - DirUtils.create ( this.current_path, 0777 ); + private ulong db_create_delegate ( Delegate element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; - en.visit_enum_values ( this ); - en.visit_methods ( this ); + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; - GLib.FileStream cname = GLib.FileStream.open ( this.current_path + "cname", "w" ); - cname.puts ( en.get_cname() ); - cname = null; + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `DelegateElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); - GLib.FileStream navi = GLib.FileStream.open ( this.current_path + "navi.html", "w" ); - this.write_navi_enum ( navi, en, en ); - navi = null; + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } - GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w"); - this.write_enum_content ( file, en, en ); - file = null; + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; - this.current_path = old_path; + return id; } - public override void visit_property ( Property prop ) { - string path = this.current_path + prop.name + "/"; - DirUtils.create ( path, 0777 ); + private ulong db_create_method ( Method element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; + + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `MethodElement` (`id`, `yields`, `abstract`, `virtual`, `override`, `static`, `inline`, `constructor`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_yields ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_abstract ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_virtual ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_override ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_static ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_inline ) ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_constructor ) ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; + } - GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" ); - if ( prop.parent is Class ) { - cname.printf ( "%s:%s", ((Class)prop.parent).get_cname(), prop.get_cname() ); + private ulong db_create_signal ( Signal element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; + + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `SignalElement` (`id`, `virtual`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "', '" ); + query.append ( this.db_boolean ( element.is_virtual ) ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_create_with_api_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; + } + + private ulong db_create_struct ( Struct element ) { + ulong id = db_create_type ( element ); + if ( id == 0 ) + return 0; + + id = db_create_accessibility ( element ); + if ( id == 0 ) + return 0; + + GLib.StringBuilder query = new GLib.StringBuilder ( "INSERT INTO `StructElement` (`id`) VALUES ('" ); + query.append ( id.to_string() ); + query.append ( "');" ); + + bool tmp = mysql.query ( query.str ) == 0; + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return 0; + } + + tmp = this.db_create_with_image_element ( element ); + if ( tmp == false ) + return 0; + + tmp = this.db_add_child_element ( element ); + if ( tmp == false ) + return 0; + + return id; + } + + private string getline ( ) { + GLib.StringBuilder str = new GLib.StringBuilder ( ); + + for ( int c = stdin.getc (); c != '\n' ; c = stdin.getc () ) { + str.append_c ( (char)c ); + } + return str.str; + } + + public override void initialisation ( Settings settings, Tree tree ) { + this.langlet = new Valadoc.ValadocOrgLanglet ( settings ); + this.settings = settings; + + this.mysql = new Database (); + mysql.init (); + + DirUtils.create ( this.settings.path, 0777 ); + + + stdout.puts ( "host: " ); + string host = this.getline ( ); + + stdout.puts ( "user: " ); + string usr = this.getline ( ); + + stdout.puts ( "password: " ); + string pw = this.getline ( ); + + stdout.puts ( "database: " ); + string db = this.getline ( ); + + bool tmp = mysql.real_connect (host, usr, pw, db, 0, null, 0); + if ( tmp == false ) { + stderr.printf ("ERROR: '%s'\n", mysql.error ()); + return; + } + + Gee.ReadOnlyCollection packages = tree.get_package_list (); + this.level = 0; + + foreach ( Package pkg in packages ) { + pkg.visit ( this ); + } + + this.level = 1; + + foreach ( Package pkg in packages ) { + if ( this.run == false ) { + break; + } + + pkg.visit ( this ); + } + } + + public override void visit_package ( Package pkg ) { + if ( this.level == 0 ) { + ulong id = this.get_package_id ( pkg ); + if ( id > 0 ) { + this.exist.append ( pkg ); + return ; + } + + DirUtils.create ( this.settings.path + pkg.name, 0777 ); + + id = this.db_create_package ( pkg ); + if ( id == 0 ) { + this.run = false; + return ; + } + + pkg.visit_namespaces ( this ); + } + else if ( this.exist.find ( pkg ) == null ) { + pkg.visit_namespaces ( this ); + } + } + + public override void visit_namespace ( Namespace ns ) { + if ( this.run == false ) { + return ; + } + + if ( this.level == 0 ) { + ulong id = this.db_create_namespace ( ns ); + if ( id == 0 ) { + this.run = false; + return ; + } + + ns.visit_namespaces ( this ); + ns.visit_classes ( this ); + ns.visit_interfaces ( this ); + ns.visit_structs ( this ); + ns.visit_enums ( this ); + ns.visit_error_domains ( this ); + ns.visit_delegates ( this ); } else { - cname.printf ( "%s:%s", ((Interface)prop.parent).get_cname(), prop.get_cname() ); + ns.visit_namespaces ( this ); + ns.visit_classes ( this ); + ns.visit_interfaces ( this ); + ns.visit_structs ( this ); + ns.visit_enums ( this ); + ns.visit_error_domains ( this ); + ns.visit_delegates ( this ); + ns.visit_methods ( this ); + ns.visit_fields ( this ); + ns.visit_constants ( this ); + } + } + + //TODO: parent list + public override void visit_interface ( Interface iface ) { + if ( this.run == false ) { + return ; } - cname = null; - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_property ( navi, prop ); - navi = null; + if ( this.level == 0 ) { + ulong id = this.db_create_interface ( iface ); + if ( id == 0 ) { + this.run = false; + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - this.write_property_content ( file, prop ); - file = null; + iface.visit_classes ( this ); + iface.visit_structs ( this ); + iface.visit_delegates ( this ); + } + else { + bool tmp = this.db_create_interface_list ( iface ); + if ( tmp == false ) { + this.run = false; + return ; + } + + iface.visit_methods ( this ); + iface.visit_signals ( this ); + iface.visit_properties ( this ); + iface.visit_fields ( this ); + iface.visit_classes ( this ); + iface.visit_structs ( this ); + iface.visit_delegates ( this ); + } } - public override void visit_constant ( Constant constant, ConstantHandler parent ) { - string path = this.current_path + constant.name + "/"; - DirUtils.create ( path, 0777 ); + public override void visit_class ( Class cl ) { + if ( this.run == false ) { + return ; + } + + if ( this.level == 0 ) { + ulong id = this.db_create_class ( cl ); + if ( id == 0 ) { + this.run = false; + return ; + } + + cl.visit_classes ( this ); + cl.visit_structs ( this ); + cl.visit_enums ( this ); + cl.visit_delegates ( this ); + } + else { + bool tmp = this.db_create_interface_list ( cl ); + if ( tmp == false ) { + this.run = false; + return ; + } + + tmp = this.db_create_class_parent ( cl ); + if ( tmp == false ) { + this.run = false; + return ; + } + + cl.visit_construction_methods ( this ); + cl.visit_methods ( this ); + cl.visit_signals ( this ); + cl.visit_properties ( this ); + cl.visit_fields ( this ); + cl.visit_constants ( this ); + cl.visit_classes ( this ); + cl.visit_structs ( this ); + cl.visit_enums ( this ); + cl.visit_delegates ( this ); + } + } - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_constant ( navi, constant ); - navi = null; + //TODO: parent list + public override void visit_struct ( Struct stru ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - this.write_constant_content ( file, constant, parent ); - file = null; + if ( this.level == 0 ) { + ulong id = this.db_create_struct ( stru ); + if ( id == 0 ) { + this.run = false; + } + } + else { + stru.visit_construction_methods ( this ); + stru.visit_methods ( this ); + stru.visit_fields ( this ); + stru.visit_constants ( this ); + } } - public override void visit_field ( Field field, FieldHandler parent ) { - string path = this.current_path + field.name + "/"; - DirUtils.create ( path, 0777 ); + public override void visit_error_domain ( ErrorDomain errdom ) { + if ( this.run == false ) { + return ; + } + + if ( this.level == 0 ) { + ulong id = this.db_create_errordomain ( errdom ); + if ( id == 0 ) { + this.run = false; + return ; + } - GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" ); - if ( field.parent is Class ) { - cname.puts( ((Class)field.parent).get_cname() ); + errdom.visit_error_codes ( this ); + } + else { + errdom.visit_methods ( this ); } - else if ( field.parent is Struct ) { - cname.puts( ((Struct)field.parent).get_cname() ); + } + + public override void visit_enum ( Enum en ) { + if ( this.run == false ) { + return ; } - else if ( field.parent is Interface ) { - cname.puts( ((Interface)field.parent).get_cname() ); + + if ( this.level == 0 ) { + ulong id = this.db_create_enum ( en ); + if ( id == 0 ) { + this.run = false; + return ; + } + + en.visit_enum_values ( this ); } - else if ( field.parent is Namespace ) { - cname.puts( field.get_cname() ); + else { + en.visit_methods ( this ); } - cname = null; + } - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_field ( navi, field ); - navi = null; + public override void visit_property ( Property prop ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - this.write_field_content ( file, field, parent ); - file = null; + if ( this.level == 1 ) { + ulong id = this.db_create_property ( prop ); + if ( id == 0 ) + this.run = false; + } } - public override void visit_error_code ( ErrorCode errcode ) { + public override void visit_constant ( Constant constant, ConstantHandler parent ) { + if ( this.run == false ) { + return ; + } + + if ( this.level == 1 ) { + ulong id = this.db_create_constant ( constant ); + if ( id == 0 ) + this.run = false; + } } - public override void visit_enum_value ( EnumValue enval ) { + public override void visit_field ( Field field, FieldHandler parent ) { + if ( this.run == false ) { + return ; + } + + if ( this.level == 1 ) { + ulong id = this.db_create_field ( field ); + if ( id == 0 ) + this.run = false; + } } - public override void visit_delegate ( Delegate del ) { - string path = this.current_path + del.name + "/"; - DirUtils.create ( path, 0777 ); + public override void visit_error_code ( ErrorCode errcode ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" ); - cname.puts ( del.get_cname() ); - cname = null; + if ( this.level == 0 ) { + ulong id = this.db_create_errorcode ( errcode ); + if ( id == 0 ) + this.run = false; + } + } - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_delegate ( navi, del ); - navi = null; + public override void visit_enum_value ( EnumValue enval ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - this.write_delegate_content ( file, del ); - file = null; + if ( this.level == 0 ) { + ulong id = this.db_create_enumvalue ( enval ); + if ( id == 0 ) + this.run = false; + } } - public override void visit_signal ( Signal sig ) { - string path = this.current_path + sig.name + "/"; - DirUtils.create ( path, 0777 ); + public override void visit_delegate ( Delegate del ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" ); - if ( sig.parent is Class ) { - cname.printf ( "%s::%s", ((Class)sig.parent).get_cname(), sig.get_cname() ); + if ( this.level == 0 ) { + ulong id = this.db_create_delegate ( del ); + if ( id == 0 ) + this.run = false; } else { - cname.printf ( "%s::%s", ((Interface)sig.parent).get_cname(), sig.get_cname() ); + bool tmp = this.db_create_exception_list ( del ); + if ( tmp == false ) + this.run = false; } - cname = null; + } - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_signal ( navi, sig ); - navi = null; + //TODO: exception list + public override void visit_signal ( Signal sig ) { + if ( this.run == false ) { + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - write_signal_content ( file, sig ); - file = null; + if ( this.level == 1 ) { + ulong id = this.db_create_signal ( sig ); + if ( id == 0 ) + this.run = false; + } } public override void visit_method ( Method m, Valadoc.MethodHandler parent ) { - string path = this.current_path + m.name + "/"; - DirUtils.create ( path, 0777 ); - - GLib.FileStream cname = GLib.FileStream.open ( path + "cname", "w" ); - cname.puts ( m.get_cname () ); - cname = null; - - GLib.FileStream navi = GLib.FileStream.open ( path + "navi.html", "w" ); - this.write_navi_method ( navi, m ); - navi = null; + if ( this.run == false ) { + return ; + } - GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w"); - this.write_method_content ( file, m, parent ); - file = null; + if ( this.level == 1 ) { + ulong id = this.db_create_method ( m ); + if ( id == 0 ) + this.run = false; + } + else { + bool tmp = this.db_create_exception_list ( m ); + if ( tmp == false ) + this.run = false; + } } - public override void cleanups () { + public override void cleanups ( ) { } } diff --git a/src/doclets/valadoc.org/linkhelper/Makefile.am b/src/doclets/valadoc.org/linkhelper/Makefile.am deleted file mode 100644 index 273bc4c11..000000000 --- a/src/doclets/valadoc.org/linkhelper/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# src/Makefile.am - - - -libhtmlhelper_VALASOURCES = \ - helper.vala \ - $(NULL) - - -BUILT_SOURCES = libhtmlhelper.vala.stamp - - -libhtmlhelper.vala.stamp: $(libhtmlhelper_VALASOURCES) - $(VALAC) -C --library libhtmlhelper-1.0 --basedir . --vapidir ../../htmlhelpers --pkg libhtmlhelpers-1.0 --vapidir ../../../vapi --pkg valadoc-1.0 --disable-non-null $^ - touch $@ - - - -htmlhelperdir = $(libdir)/valadoc/plugins/valadoc.org/ -htmlhelper_LTLIBRARIES = libhtmlhelper.la - - -libhtmlhelper_la_SOURCES = \ - libhtmlhelper.vala.stamp \ - $(libhtmlhelper_VALASOURCES:.vala=.c) \ - $(libhtmlhelper_VALASOURCES:.vala=.h) \ - $(NULL) - - -AM_CFLAGS = \ - -I ../../../libvaladoc/ \ - -I ../../htmlhelpers/ \ - $(LIBVALA_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(NULL) - - -libhtmlhelper_la_LIBADD = \ - ../../../libvaladoc/libvaladoc.la \ - ../../htmlhelpers/libhtmlhelpers.la \ - $(LIBVALA_LIBS) \ - $(GLIB_LIBS) \ - $(NULL) - - -EXTRA_DIST = $(libhtmlhelper_VALASOURCES) libhtmlhelper.vala.stamp diff --git a/src/doclets/valadoc.org/linkhelper/helper.vala b/src/doclets/valadoc.org/linkhelper/helper.vala deleted file mode 100755 index b7b7a0e77..000000000 --- a/src/doclets/valadoc.org/linkhelper/helper.vala +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; - - -public interface Valadoc.LinkHelper { - public string? get_html_link ( Valadoc.Settings? settings, Valadoc.Basic element ) { - GLib.StringBuilder str = new GLib.StringBuilder ( "" ); - Valadoc.Basic pos = element; - - if ( element is Valadoc.Package == false ) { - if ( element is Valadoc.EnumValue || element is Valadoc.ErrorCode ) { - str.append_unichar ( '#' ); - str.append ( element.name ); - pos = element.parent; - } - - while ( pos != null ) { - if ( pos.name == null ) - str.prepend ( "0" ); - else - str.prepend ( pos.name ); - - str.prepend ( "::" ); - - if ( pos.parent is Valadoc.Package ) - break; - - pos = pos.parent; - } - } - - str.prepend ( element.file.name ); - str.prepend ( "?path=" ); - return str.str; - } -} diff --git a/src/libvaladoc/Makefile.am b/src/libvaladoc/Makefile.am index ae7a3502d..edf67a59b 100644 --- a/src/libvaladoc/Makefile.am +++ b/src/libvaladoc/Makefile.am @@ -17,7 +17,7 @@ BUILT_SOURCES = libvaladoc.vala.stamp libvaladoc.vala.stamp: $(libvaladoc_VALASOURCES) - $(VALAC) -C --pkg vala-1.0 --pkg gmodule-2.0 --vapidir ../vapi --pkg libxml-2.0 --pkg libgvc --library valadoc-1.0 --basedir $(top_srcdir)/src/libvaladoc/ --disable-non-null --save-temps $^ + $(VALAC) -C --pkg vala-1.0 --pkg gmodule-2.0 --vapidir ../vapi --pkg libxml-2.0 --pkg libgvc --library valadoc-1.0 --basedir $(top_srcdir)/src/libvaladoc/ --save-temps $^ touch $@ diff --git a/src/libvaladoc/doclet.vala b/src/libvaladoc/doclet.vala index 9e85c8be3..14062d297 100755 --- a/src/libvaladoc/doclet.vala +++ b/src/libvaladoc/doclet.vala @@ -27,9 +27,9 @@ public static delegate Type Valadoc.DocletRegisterFunction ( ); public abstract class Valadoc.Doclet : GLib.Object { - public abstract void initialisation ( Settings settings ); + public abstract void initialisation ( Settings settings, Tree tree ); - // walkarround for a strage bug + // walkarround for a strange valac-bug public abstract void cleanups ( ); public abstract void visit_package ( Package pkg ); diff --git a/src/libvaladoc/doctree.vala b/src/libvaladoc/doctree.vala index 0ebae16a6..28e92f7ba 100755 --- a/src/libvaladoc/doctree.vala +++ b/src/libvaladoc/doctree.vala @@ -119,77 +119,73 @@ namespace Valadoc { public Valadoc.Class glib_error = null; -public enum CommentContext { - NAMESPACE, - ERRORDOMAIN, - ENUMVALUE, - ERRORCODE, - INTERFACE, - DELEGATE, - CONSTANT, - PROPERTY, - SIGNAL, - STRUCT, - CLASS, - FIELD, - ENUM -} +public abstract class Valadoc.Basic : Object { + public Valadoc.Settings settings { + construct set; + protected get; + } + public Basic parent { + construct set; + get; + } -public class Valadoc.Basic : Object { - private string _full_name = null; + protected Vala.Symbol vsymbol { + protected get; + set; + } - public string? full_name () { - if ( this.name == null ) - return null; + public Tree head { + construct set; + protected get; + } +} - if ( this._full_name == null ) { - this._full_name = this.name; - Basic pos = this.parent; - while ( pos is Package == false ) { - if ( pos.name != null ) - this._full_name = pos.name + "." + this._full_name; +public abstract class Valadoc.DocumentedElement : Basic { + private Namespace? _nspace = null; + private Package? _package = null; + private string _full_name = null; + private int _line = -1; - pos = pos.parent; + public Package? package { + get { + if ( this._package == null ) { + Valadoc.Basic ast = this; + while ( ast is Valadoc.Package == false ) { + ast = ast.parent; + if ( ast == null ) + return null; + } + this._package = (Valadoc.Package)ast; } + return this._package; } - return this._full_name; } - public string?# package { + public Namespace? nspace { get { - SourceReference? sref = this.vsymbol.source_reference; - if ( sref == null ) - return null; - - Vala.SourceFile? file = sref.file; - if ( file == null ) - return null; - - string path = sref.file.filename; - if ( path.has_suffix (".vapi") ) { - string file_name = GLib.Path.get_basename ( path ); - return file_name.ndup ( file_name.size() - ".vapi".size() ); + if ( this._nspace == null ) { + Valadoc.Basic ast = this; + while ( ast is Valadoc.Namespace == false ) { + ast = ast.parent; + if ( ast == null ) + return null; + } + this._nspace = (Valadoc.Namespace)ast; } - - return this.settings.pkg_name; + return this._nspace; } } - public string?# filename { + public int line { get { - SourceReference? sref = this.vsymbol.source_reference; - if ( sref == null ) - return null; - - Vala.SourceFile? file = sref.file; - if ( file == null ) - return null; - - string path = sref.file.filename; - return GLib.Path.get_basename ( path ); + if ( this._line == -1 ) { + Vala.SourceReference vsref = this.vsymbol.source_reference; + this._line = ( vsref == null )? 0 : vsref.first_line; + } + return this._line; } } @@ -210,157 +206,82 @@ public class Valadoc.Basic : Object { } } - //- Nur dort hin packen, wo es gebraucht wird. public DocumentationTree? documentation { protected set; get; } - // internal - public virtual weak Basic? search_element ( string[] params, int pos ) { - return null; - } - - // internal - public virtual weak Basic? search_element_vala ( Gee.ArrayList list, int pos ) { - return null; - } - - //Vala.Symbol symbol, Gee.HashMap taglets, CommentContext context - protected void parse_comment_helper ( Valadoc.Parser docparser, CommentContext context ) { - if ( this.documentation != null ) - return ; - - string? docu = this.comment_string; - if ( docu == null ) - return ; - - bool tmp = Parser.is_documentation ( docu ); - if ( tmp == false ) - return ; - - this.documentation = docparser.parse ( this.head, this, docu ); - } - - public int line { - get { - Vala.SourceReference vsref = this.vsymbol.source_reference; - if ( vsref == null ) - return 0; - - return vsref.first_line; - } - } - - // Herausnehmen, dort übergeben wo es sein muss. - public Valadoc.Settings settings { - construct set; - protected get; - } - - public DataType? parent_data_type { - get { - if ( this.parent is DataType ) - return (DataType)this.parent; - + public virtual string? name { + owned get { return null; } } - public string? file_name { - get { - Basic element = this; - while ( element != null ) { - if ( element is Package ) - return element.name; - - element = element.parent; - } - return null; - } - } + // rename to get_full_name, weak + public string? full_name () { + if ( this._full_name == null ) { + if ( this.name == null ) + return null; - // construct set -> creation method - public Package? file { - get { - Valadoc.Basic ast = this; - while ( ast is Valadoc.Package == false ) { - ast = ast.parent; - if ( ast == null ) - return null; - } - return (Valadoc.Package)ast; - } - } + GLib.StringBuilder full_name = new GLib.StringBuilder ( this.name ); - // construct set -> creation method - public Namespace? nspace { - get { - Valadoc.Basic ast = this; - while ( ast is Valadoc.Namespace == false ) { - ast = ast.parent; - if ( ast == null ) - return null; + 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 ); + } + } } - return (Valadoc.Namespace)ast; + this._full_name = full_name.str; } + return this._full_name; } - public Basic parent { - construct set; - get; - } - - protected Vala.Symbol vsymbol { - // internal - protected get; - set; - } + // rename to file_name + public string? filename { + owned get { + SourceReference? sref = this.vsymbol.source_reference; + if ( sref == null ) + return null; - public Tree head { - construct set; - protected get; - } + Vala.SourceFile? file = sref.file; + if ( file == null ) + return null; - public virtual string?# name { - get { - return null; + string path = sref.file.filename; + return GLib.Path.get_basename ( path ); } } + protected void parse_comment_helper ( Valadoc.Parser docparser ) { + if ( this.documentation != null ) + return ; - public bool is_public { - get { - Vala.SymbolAccessibility access = vsymbol.access; - return ( access == Vala.SymbolAccessibility.PUBLIC ); - } - } + string? docu = this.comment_string; + if ( docu == null ) + return ; - public bool is_protected { - get { - Vala.SymbolAccessibility access = vsymbol.access; - return ( access == Vala.SymbolAccessibility.PROTECTED ); - } - } + bool tmp = Parser.is_documentation ( docu ); + if ( tmp == false ) + return ; - public bool is_private { - get { - Vala.SymbolAccessibility access = vsymbol.access; - return ( access == Vala.SymbolAccessibility.PRIVATE ); - } + this.documentation = docparser.parse ( this.head, this, docu ); } + // internal + public virtual weak DocumentedElement? search_element ( string[] params, int pos ) { + return null; + } - // Move to Valadoc.SymbolAccessibility - protected Basic? find_member_lst ( Gee.Collection lst, string name ) { - foreach ( Basic element in lst ) { - if ( element.name == name ) - return element; - } + // internal + public virtual weak DocumentedElement? search_element_vala ( Gee.ArrayList list, int pos ) { return null; } } + public interface Valadoc.EnumHandler : Basic { protected abstract Gee.ArrayList enums { private set; @@ -373,18 +294,18 @@ public interface Valadoc.EnumHandler : Basic { } } - protected weak Basic? search_enum_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_enum_vala ( Gee.ArrayList params, int pos ) { foreach ( Enum en in this.enums ) { - Basic element = en.search_element_vala ( params, pos+1 ); + DocumentedElement element = en.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } return null; } - protected weak Basic? search_enum ( string[] params, int pos ) { + protected weak DocumentedElement? search_enum ( string[] params, int pos ) { foreach ( Enum en in this.enums ) { - Basic element = en.search_element ( params, pos+1 ); + DocumentedElement element = en.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -434,7 +355,7 @@ public interface Valadoc.DelegateHandler : Basic { get; } - protected weak Basic? search_delegate_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_delegate_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Delegate == false ) return null; @@ -447,7 +368,7 @@ public interface Valadoc.DelegateHandler : Basic { return null; } - protected weak Basic? search_delegate ( string[] params, int pos ) { + protected weak DocumentedElement? search_delegate ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -509,18 +430,18 @@ public interface Valadoc.InterfaceHandler : Basic { get; } - protected weak Basic? search_interface_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_interface_vala ( Gee.ArrayList params, int pos ) { foreach ( Interface iface in this.interfaces ) { - Basic? element = iface.search_element_vala ( params, pos+1 ); + DocumentedElement? element = iface.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } return null; } - protected weak Basic? search_interface ( string[] params, int pos ) { + protected weak DocumentedElement? search_interface ( string[] params, int pos ) { foreach ( Interface iface in this.interfaces ) { - Basic element = iface.search_element ( params, pos+1 ); + DocumentedElement? element = iface.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -579,18 +500,18 @@ public interface Valadoc.ErrorDomainHandler : Basic { get; } - protected weak Basic? search_error_domain_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_error_domain_vala ( Gee.ArrayList params, int pos ) { foreach ( ErrorDomain errdom in this.errdoms ) { - Basic? element = errdom.search_element_vala ( params, pos+1 ); + DocumentedElement? element = errdom.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } return null; } - protected weak Basic? search_error_domain ( string[] params, int pos ) { + protected weak DocumentedElement? search_error_domain ( string[] params, int pos ) { foreach ( ErrorDomain errdom in this.errdoms ) { - Basic? element = errdom.search_element ( params, pos+1 ); + DocumentedElement? element = errdom.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -649,21 +570,12 @@ public interface Valadoc.ErrorDomainHandler : Basic { } } -// remove +// rename public interface Valadoc.Writeable : Basic { public abstract DocumentationTree? documentation { protected set; get; } - - /* rename to write_documentation - public bool write_comment ( void* ptr ) { - if ( this.documentation == null ) - return false; - - this.documentation.write ( ptr ); - return true; - }*/ } public interface Valadoc.NamespaceHandler : Basic { @@ -805,18 +717,18 @@ public interface Valadoc.ClassHandler : Basic { get; } - protected weak Basic? search_class_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_class_vala ( Gee.ArrayList params, int pos ) { foreach ( Class cl in this.classes ) { - Basic element = cl.search_element_vala ( params, pos+1 ); + DocumentedElement? element = cl.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } return null; } - protected weak Basic? search_class ( string[] params, int pos ) { + protected weak DocumentedElement? search_class ( string[] params, int pos ) { foreach ( Class cl in this.classes ) { - Basic element = cl.search_element ( params, pos+1 ); + DocumentedElement? element = cl.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -847,11 +759,6 @@ public interface Valadoc.ClassHandler : Basic { return new Gee.ReadOnlyCollection( lst ); } - // internal, remove - public void append_class ( Valadoc.Class cl ) { - this.classes.add( cl ); - } - // internal public void add_class ( Vala.Class vcl ) { Class cl = new Class ( this.settings, vcl, this, this.head ); @@ -893,7 +800,7 @@ public interface Valadoc.PropertyHandler : ContainerDataType { set; } - protected weak Basic? search_property_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_property_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Property == false ) return null; @@ -909,7 +816,7 @@ public interface Valadoc.PropertyHandler : ContainerDataType { return null; } - protected weak Basic? search_property ( string[] params, int pos ) { + protected weak DocumentedElement? search_property ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -982,7 +889,7 @@ public interface Valadoc.ConstructionMethodHandler : DataType, MethodHandler { get; } - protected weak Basic? search_construction_method_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_construction_method_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Method == false ) return null; @@ -998,7 +905,7 @@ public interface Valadoc.ConstructionMethodHandler : DataType, MethodHandler { return null; } - protected weak Basic? search_construction_method ( string[] params, int pos ) { + protected weak DocumentedElement? search_construction_method ( string[] params, int pos ) { pos++; if ( params[pos+1] == null ) @@ -1072,7 +979,7 @@ public interface Valadoc.SignalHandler : ContainerDataType { set; } - protected weak Basic? search_signal_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_signal_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Signal == false ) return null; @@ -1088,7 +995,7 @@ public interface Valadoc.SignalHandler : ContainerDataType { return null; } - protected weak Basic? search_signal ( string[] params, int pos ) { + protected weak DocumentedElement? search_signal ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -1151,9 +1058,9 @@ public interface Valadoc.StructHandler : Basic { get; } - protected weak Basic? search_struct_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_struct_vala ( Gee.ArrayList params, int pos ) { foreach ( Struct stru in this.structs ) { - Basic element = stru.search_element_vala ( params, pos+1 ); + DocumentedElement? element = stru.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } @@ -1161,9 +1068,9 @@ public interface Valadoc.StructHandler : Basic { } - protected weak Basic? search_struct ( string[] params, int pos ) { + protected weak DocumentedElement? search_struct ( string[] params, int pos ) { foreach ( Struct stru in this.structs ) { - Basic element = stru.search_element ( params, pos+1 ); + DocumentedElement? element = stru.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -1182,11 +1089,6 @@ public interface Valadoc.StructHandler : Basic { return new Gee.ReadOnlyCollection( lst ); } - // internal, remove - public void append_struct ( Valadoc.Struct stru ) { - this.structs.add( stru ); - } - public void add_struct ( Vala.Struct vstru ) { Struct stru = new Struct ( this.settings, vstru, this, this.head ); this.structs.add( stru ); @@ -1246,44 +1148,53 @@ public interface Valadoc.Visitable : Basic, SymbolAccessibility { } -public interface Valadoc.SymbolAccessibility { - public abstract bool is_public { - get; +public interface Valadoc.SymbolAccessibility : Basic { + public bool is_public { + get { + Vala.SymbolAccessibility access = vsymbol.access; + return ( access == Vala.SymbolAccessibility.PUBLIC ); + } } - public abstract bool is_protected { - get; + public bool is_protected { + get { + Vala.SymbolAccessibility access = vsymbol.access; + return ( access == Vala.SymbolAccessibility.PROTECTED ); + } } - public abstract bool is_private { - get; + public bool is_private { + get { + Vala.SymbolAccessibility access = vsymbol.access; + return ( access == Vala.SymbolAccessibility.PRIVATE ); + } } } public interface Valadoc.ReturnTypeHandler : Basic { - public abstract TypeReference return_type { + public abstract TypeReference? type_reference { protected set; get; } // internal public void set_return_type_references ( ) { - if ( this.return_type == null ) + if ( this.type_reference == null ) return ; - this.return_type.set_type_references ( ); + this.type_reference.set_type_references ( ); } // internal, rename - protected void set_ret_type ( Vala.DataType vtref ) { + protected void set_ret_type ( Vala.DataType? vtref ) { var tmp = new TypeReference ( this.settings, vtref, this, this.head ); - this.return_type = tmp; + this.type_reference = tmp; } } - +/* // ???? public interface Valadoc.TypeHandler : Basic { public abstract TypeReference type_reference { @@ -1304,7 +1215,7 @@ public interface Valadoc.TypeHandler : Basic { this.type_reference = tmp; } } - +*/ public interface Valadoc.ConstantHandler : Basic { protected abstract Gee.ArrayList constants { @@ -1312,7 +1223,7 @@ public interface Valadoc.ConstantHandler : Basic { get; } - protected weak Basic? search_constant_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_constant_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Constant == false ) return null; @@ -1329,7 +1240,7 @@ public interface Valadoc.ConstantHandler : Basic { } // internal - protected weak Basic? search_constant ( string[] params, int pos ) { + protected weak DocumentedElement? search_constant ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -1396,7 +1307,7 @@ public interface Valadoc.FieldHandler : Basic { get; } - protected weak Basic? search_field_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_field_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Field == false ) return null; @@ -1413,7 +1324,7 @@ public interface Valadoc.FieldHandler : Basic { } // internal - protected weak Basic? search_field ( string[] params, int pos ) { + protected weak DocumentedElement? search_field ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -1476,28 +1387,28 @@ public interface Valadoc.FieldHandler : Basic { } } +// rename to ExceptionListHandler public interface Valadoc.ExceptionHandler : Basic { - protected abstract Gee.ArrayList err_domains { + protected abstract Gee.ArrayList err_domains { protected set; get; } - public Gee.ReadOnlyCollection get_error_domains ( ) { - return new Gee.ReadOnlyCollection ( this.err_domains ); - } - - // internal - public void add_error_domains ( Gee.Collection vexceptions ) { - foreach ( Vala.DataType vtref in vexceptions ) { - var tmp = new TypeReference ( this.settings, vtref, (Valadoc.Basic)this, this.head ); - this.err_domains.add ( tmp ); - } + public Gee.ReadOnlyCollection get_error_domains ( ) { + return new Gee.ReadOnlyCollection ( this.err_domains ); } - // internal - public void set_exception_type_references ( ) { - foreach ( TypeReference tref in this.err_domains ) { - tref.set_type_references ( ); + public void add_exception_list ( Gee.Collection vexceptions ) { + foreach ( Vala.DataType vtype in vexceptions ) { + if ( vtype is Vala.ErrorType ) { + if ( ((Vala.ErrorType)vtype).error_domain == null ) { + this.err_domains.add ( glib_error ); + } + else { + ErrorDomain type = (ErrorDomain)this.head.search_vala_symbol ( ((Vala.ErrorType)vtype).error_domain ); + this.err_domains.add ( type ); + } + } } } } @@ -1536,7 +1447,7 @@ public interface Valadoc.MethodHandler : Basic { get; } - protected weak Basic? search_method_vala ( Gee.ArrayList params, int pos ) { + protected weak DocumentedElement? search_method_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.Method == false ) return null; @@ -1553,7 +1464,7 @@ public interface Valadoc.MethodHandler : Basic { } // internal - protected weak Basic? search_method ( string[] params, int pos ) { + protected weak DocumentedElement? search_method ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -1640,8 +1551,8 @@ public interface Valadoc.TemplateParameterListHandler : Basic { } } -public class Valadoc.Constant : Basic, SymbolAccessibility, TypeHandler, Visitable, Writeable { - public TypeReference type_reference { +public class Valadoc.Constant : DocumentedElement, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { + public TypeReference? type_reference { protected set; get; } @@ -1651,8 +1562,8 @@ public class Valadoc.Constant : Basic, SymbolAccessibility, TypeHandler, Visitab private get; } - public override string?# name { - get { + public override string? name { + owned get { return this.vconst.name; } } @@ -1677,12 +1588,12 @@ public class Valadoc.Constant : Basic, SymbolAccessibility, TypeHandler, Visitab // internal public void set_type_references ( ) { - ((TypeHandler)this).set_type_references ( ); + ((ReturnTypeHandler)this).set_return_type_references ( ); } // internal public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.CONSTANT ); + this.parse_comment_helper ( docparser ); } public void visit ( Doclet doclet, ConstantHandler? parent ) { @@ -1698,7 +1609,7 @@ public class Valadoc.Constant : Basic, SymbolAccessibility, TypeHandler, Visitab } -public class Valadoc.Field : Basic, SymbolAccessibility, TypeHandler, Visitable, Writeable { +public class Valadoc.Field : DocumentedElement, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { public Field ( Valadoc.Settings settings, Vala.Field vfield, FieldHandler parent, Tree head ) { this.settings = settings; this.vfield = vfield; @@ -1706,6 +1617,7 @@ public class Valadoc.Field : Basic, SymbolAccessibility, TypeHandler, Visitable, this.head = head; } + // internal public bool is_vfield ( Vala.Field vfield ) { return ( this.vfield == vfield ); } @@ -1714,13 +1626,13 @@ public class Valadoc.Field : Basic, SymbolAccessibility, TypeHandler, Visitable, return this.vfield.get_cname(); } - public TypeReference type_reference { + public TypeReference? type_reference { protected set; get; } - public override string?# name { - get { + public override string? name { + owned get { return this.vfield.name; } } @@ -1744,21 +1656,14 @@ public class Valadoc.Field : Basic, SymbolAccessibility, TypeHandler, Visitable, } } - // remove - public bool is_global { - get { - return ( this.parent is Valadoc.Namespace ); - } - } - // internal public void set_type_references ( ) { - ((TypeHandler)this).set_type_references ( ); + ((ReturnTypeHandler)this).set_return_type_references ( ); } // internal public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.FIELD ); + this.parse_comment_helper ( docparser ); } public void visit ( Doclet doclet, FieldHandler? parent ) { @@ -1774,7 +1679,7 @@ public class Valadoc.Field : Basic, SymbolAccessibility, TypeHandler, Visitable, } public class Valadoc.TypeReference : Basic { - public TypeReference ( Valadoc.Settings settings, Vala.DataType vtyperef, Basic parent, Tree head ) { + public TypeReference ( Valadoc.Settings settings, Vala.DataType? vtyperef, Basic parent, Tree head ) { this.settings = settings; this.vtyperef = vtyperef; this.parent = parent; @@ -1796,12 +1701,12 @@ public class Valadoc.TypeReference : Basic { } } - public DataType data_type { + public DataType? data_type { private set; get; } - public Vala.DataType vtyperef { + public Vala.DataType? vtyperef { construct set; private get; } @@ -1825,17 +1730,62 @@ public class Valadoc.TypeReference : Basic { } } - // from vala/valainterfacewriter.vala - private bool is_weak_helper (Vala.DataType type) { + public bool is_owned { + get { + Vala.CodeNode parent = this.vtyperef.parent_node; + + // parameter: + if ( parent is Vala.FormalParameter ) { + if ( ((Vala.FormalParameter)parent).direction != ParameterDirection.IN ) + return false; + + return ((Vala.FormalParameter)parent).parameter_type.value_owned; + } + return false; + } + } + + public bool is_unowned { + get { + Vala.CodeNode parent = this.vtyperef.parent_node; + + // parameter: + if ( parent is Vala.FormalParameter ) { + if ( ((Vala.FormalParameter)parent).direction == ParameterDirection.IN ) + return false; + + return this.is_weak_helper ( ((Vala.FormalParameter)parent).parameter_type ); + } + + // return type + if ( parent is Vala.Method == true ) + return this.is_weak_helper ( ((Vala.Method)parent).return_type ); + else if ( parent is Vala.Signal == true ) + return this.is_weak_helper ( ((Vala.Signal)parent).return_type ); + else if ( parent is Vala.Delegate == true ) + return this.is_weak_helper ( ((Vala.Delegate)parent).return_type ); + + return false; + } + } + + + // from vala/valacodewriter.vala + private bool is_weak_helper ( Vala.DataType type ) { if (type.value_owned) { return false; - } else if (type is VoidType || type is PointerType) { + } else if (type is Vala.VoidType || type is Vala.PointerType) { return false; - } else if (type is ValueType) { + } else if (type is Vala.ValueType) { if (type.nullable) { - return false; + // nullable structs are heap allocated + return true; } + + // TODO return true for structs with destroy + return false; } + return true; } @@ -1847,23 +1797,7 @@ public class Valadoc.TypeReference : Basic { public bool is_weak { get { - Vala.CodeNode? node = this.vtyperef.parent_node; - if ( node == null ) - return false; - - if ( node is Vala.Constant || node is Vala.Property ) - return false; - - if ( node is Vala.FormalParameter ) { - var direction = ((Vala.FormalParameter)node).direction; - - if ( direction == Vala.ParameterDirection.OUT || direction == Vala.ParameterDirection.IN ) - return false; - - return !this.vtyperef.value_owned; - } - - return is_weak_helper( this.vtyperef ); + return ( this.vtyperef.parent_node is Field )? this.is_weak_helper( this.vtyperef ) : false; } } @@ -1933,8 +1867,8 @@ public class Valadoc.TypeReference : Basic { } // remove - public string# type_name { - get { + public string type_name { + owned get { return this.extract_type_name ( this.vtyperef ); } } @@ -1952,10 +1886,12 @@ public class Valadoc.TypeReference : Basic { if ( vtype is Vala.ErrorType ) { Vala.ErrorDomain verrdom = ((Vala.ErrorType)vtype).error_domain; - if ( verrdom != null ) + if ( verrdom != null ) { this.data_type = (DataType?)this.head.search_vala_symbol ( verrdom ); - else + } + else { this.data_type = glib_error; + } } else if (vtype is Vala.DelegateType ) { this.data_type = (DataType?)this.head.search_vala_symbol ( ((Vala.DelegateType)vtype).delegate_symbol ); @@ -1974,7 +1910,7 @@ public class Valadoc.TypeReference : Basic { // TODO: Remove unused stuff // You just need it for the name in a template-parameter-list. // remove TypeHandler-interface -public class Valadoc.TypeParameter : Basic, TypeHandler { +public class Valadoc.TypeParameter : Basic, ReturnTypeHandler { public TypeParameter ( Valadoc.Settings settings, Vala.TypeParameter vtypeparam, Basic parent, Tree head ) { this.vtypeparam = vtypeparam; this.settings = settings; @@ -1982,7 +1918,7 @@ public class Valadoc.TypeParameter : Basic, TypeHandler { this.head = head; } - public TypeReference type_reference { + public TypeReference? type_reference { protected set; get; } @@ -1996,14 +1932,15 @@ public class Valadoc.TypeParameter : Basic, TypeHandler { protected get; } - public string# datatype_name { - get { + public string? name { + owned get { return this.vtypeparam.name; } } // internal public void initialisation ( ) { + this.vsymbol = this.vtypeparam; } // internal @@ -2012,7 +1949,7 @@ public class Valadoc.TypeParameter : Basic, TypeHandler { } -public class Valadoc.FormalParameter : Basic, TypeHandler { +public class Valadoc.FormalParameter : Basic, ReturnTypeHandler { public FormalParameter ( Valadoc.Settings settings, Vala.FormalParameter vformalparam, Basic parent, Tree head ) { this.settings = settings; this.vformalparam = vformalparam; @@ -2032,12 +1969,20 @@ public class Valadoc.FormalParameter : Basic, TypeHandler { } } + /* public string? default_value { private set; public get; } + */ - // internal + public bool has_default_value { + get { + return this.vformalparam.default_expression != null; + } + } + + // internal, FIXME: public void initialisation ( ) { this.vsymbol = this.vformalparam; @@ -2065,7 +2010,7 @@ public class Valadoc.FormalParameter : Basic, TypeHandler { */ } - public TypeReference type_reference { + public TypeReference? type_reference { protected set; get; } @@ -2076,14 +2021,8 @@ public class Valadoc.FormalParameter : Basic, TypeHandler { } } - public bool is_construct { - get { - return this.vformalparam.construct_parameter; - } - } - - public override string?# name { - get { + public string? name { + owned get { return ( this.vformalparam.name == null )? "" : this.vformalparam.name; } } @@ -2098,7 +2037,7 @@ public class Valadoc.FormalParameter : Basic, TypeHandler { if ( this.vformalparam.ellipsis ) return ; - ((TypeHandler)this).set_type_references ( ); + ((ReturnTypeHandler)this).set_return_type_references ( ); } public void write ( Langlet langlet, void* ptr ) { @@ -2178,12 +2117,18 @@ public class Valadoc.PropertyAccessor : Object /*, FIXME: Valac-Bug! Can't overr } } + public bool is_owned { + get { + return this.vpropacc.value_type.value_owned; + } + } + public void write ( Langlet langlet, void* ptr ) { langlet.write_property_accessor ( this, ptr ); } } -public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { +public class Valadoc.Property : DocumentedElement, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { public Property ( Valadoc.Settings settings, Vala.Property vproperty, ContainerDataType parent, Tree head ) { this.settings = settings; this.vproperty = vproperty; @@ -2203,7 +2148,7 @@ public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, V return this.vproperty.equals ( p.vproperty ); } - public TypeReference return_type { + public TypeReference? type_reference { protected set; get; } @@ -2255,8 +2200,8 @@ public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, V protected get; } - public override string?# name { - get { + public override string? name { + owned get { return this.vproperty.name; } } @@ -2292,7 +2237,7 @@ public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, V return ; } - this.parse_comment_helper ( docparser, CommentContext.PROPERTY ); + this.parse_comment_helper ( docparser ); } public void visit ( Doclet doclet ) { @@ -2309,29 +2254,28 @@ public class Valadoc.Property : Basic, SymbolAccessibility, ReturnTypeHandler, V -public class Valadoc.Signal : Basic, ParameterListHandler, SymbolAccessibility, +public class Valadoc.Signal : DocumentedElement, ParameterListHandler, SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { public Signal ( Valadoc.Settings settings, Vala.Signal vsignal, ContainerDataType parent, Tree head ) { + this.param_list = new Gee.ArrayList (); + this.settings = settings; this.vsignal = vsignal; this.parent = parent; this.head = head; } + // internal public bool is_vsignal ( Vala.Signal vsig ) { return ( this.vsignal == vsig ); } - construct { - this.param_list = new Gee.ArrayList (); - } - public string? get_cname () { return this.vsignal.get_cname(); } - public TypeReference return_type { + public TypeReference? type_reference { protected set; get; } @@ -2365,15 +2309,21 @@ public class Valadoc.Signal : Basic, ParameterListHandler, SymbolAccessibility, // internal public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.SIGNAL ); + this.parse_comment_helper ( docparser ); } - public override string?# name { - get { + public override string? name { + owned get { return this.vsignal.name; } } + public bool is_virtual { + get { + return this.vsignal.is_virtual; + } + } + public void visit ( Doclet doclet ) { if ( !this.is_visitor_accessible ( ) ) return ; @@ -2388,16 +2338,21 @@ public class Valadoc.Signal : Basic, ParameterListHandler, SymbolAccessibility, -public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, - SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable +public class Valadoc.Method : DocumentedElement, ParameterListHandler, ExceptionHandler, TemplateParameterListHandler, + SymbolAccessibility, ReturnTypeHandler, Visitable, Writeable { public Method ( Valadoc.Settings settings, Vala.Method vmethod, MethodHandler parent, Tree head ) { + this.template_param_lst = new Gee.ArrayList (); + this.param_list = new Gee.ArrayList(); + this.err_domains = new Gee.ArrayList(); + this.settings = settings; this.vmethod = vmethod; this.parent = parent; this.head = head; } + // intern public bool is_vmethod ( Vala.Method vm ) { return ( this.vmethod == vm ); } @@ -2406,18 +2361,12 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem return this.vmethod.get_cname(); } - construct { - this.err_domains = new Gee.ArrayList(); - this.param_list = new Gee.ArrayList(); - this.template_param_lst = new Gee.ArrayList (); - } - - public Method base_method { + public Method? base_method { private set; get; } - public TypeReference return_type { + public TypeReference? type_reference { protected set; get; } @@ -2432,14 +2381,14 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem get; } - public Gee.ArrayList err_domains { + public Gee.ArrayList err_domains { protected set; get; } // FIXME - public string?# comment_str { - get { + public string? comment_str { + owned get { return this.vmethod.source_reference.comment; } } @@ -2467,8 +2416,7 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem return ; } - // wrong context! - this.parse_comment_helper ( docparser, CommentContext.CLASS ); + this.parse_comment_helper ( docparser ); } // internal @@ -2481,8 +2429,8 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem var vparamlst = this.vmethod.get_parameters (); this.add_parameter_list ( vparamlst ); - var vexceptionlst = this.vmethod.get_error_types (); - this.add_error_domains ( vexceptionlst ); + //var vexceptionlst = this.vmethod.get_error_types (); + //this.add_error_domains ( vexceptionlst ); } public Vala.Method vmethod { @@ -2523,18 +2471,6 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem } } - public string# parent_name { - get { - return this.parent.name; - } - } - - public bool is_global { - get { - return ( this.parent is Namespace ); - } - } - public bool is_constructor { get { return ( this.vmethod is Vala.CreationMethod ); @@ -2547,13 +2483,13 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem } } - public override string?# name { - get { + public override string? name { + owned get { if ( this.is_constructor ) { if ( this.vmethod.name == "new" ) - return this.parent_name; + return ((DocumentedElement)this.parent).name; else - return this.parent_name + "." + this.vmethod.name; + return ((DocumentedElement)this.parent).name + "." + this.vmethod.name; } else { return this.vmethod.name; @@ -2569,9 +2505,11 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem } this.set_return_type_references ( ); - - this.set_exception_type_references ( ); +// this.set_exception_type_references ( ); this.set_parameter_list_type_references ( ); + + var vexceptionlst = this.vmethod.get_error_types (); + this.add_exception_list ( vexceptionlst ); } public void visit ( Doclet doclet, Valadoc.MethodHandler in_type ) { @@ -2587,7 +2525,7 @@ public class Valadoc.Method : Basic, ParameterListHandler, ExceptionHandler, Tem } -public class Valadoc.EnumValue: Basic, Writeable { +public class Valadoc.EnumValue: DocumentedElement, Writeable { public EnumValue ( Valadoc.Settings settings, Vala.EnumValue venval, Enum parent, Tree head ) { this.settings = settings; this.venval = venval; @@ -2603,8 +2541,8 @@ public class Valadoc.EnumValue: Basic, Writeable { this.vsymbol = venval; } - public override string?# name { - get { + public override string? name { + owned get { return this.venval.name; } } @@ -2615,7 +2553,7 @@ public class Valadoc.EnumValue: Basic, Writeable { } public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.ENUMVALUE ); + this.parse_comment_helper ( docparser ); } public void write ( Langlet langlet, void* ptr ) { @@ -2627,7 +2565,7 @@ public class Valadoc.EnumValue: Basic, Writeable { } } -public class Valadoc.ErrorCode : Basic, Writeable { +public class Valadoc.ErrorCode : DocumentedElement, Writeable { public ErrorCode ( Valadoc.Settings settings, Vala.ErrorCode verrcode, ErrorDomain parent, Tree head ) { this.settings = settings; this.verrcode = verrcode; @@ -2644,8 +2582,8 @@ public class Valadoc.ErrorCode : Basic, Writeable { this.vsymbol = verrcode; } - public override string?# name { - get { + public override string? name { + owned get { return this.verrcode.name; } } @@ -2660,7 +2598,7 @@ public class Valadoc.ErrorCode : Basic, Writeable { } public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.ENUMVALUE ); + this.parse_comment_helper ( docparser ); } public void visit ( Doclet doclet ) { @@ -2668,20 +2606,24 @@ public class Valadoc.ErrorCode : Basic, Writeable { } } -public abstract class Valadoc.DataType: Basic, SymbolAccessibility, Visitable, Writeable { - public override string?# name { - get { + + +public abstract class Valadoc.DataType: DocumentedElement, SymbolAccessibility, Visitable, Writeable { + public override string? name { + owned get { return this.vsymbol.name; } } - // internal + // remove public virtual void set_type_references ( ) { } + // move to DocumentedElement public virtual void visit ( Doclet doclet ) { } + // Move to Basic; add a third parameter for "parent" public virtual void write ( Langlet langlet, void* ptr ) { } } @@ -2692,6 +2634,10 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil ReturnTypeHandler, TemplateParameterListHandler, ExceptionHandler { public Delegate ( Valadoc.Settings settings, Vala.Delegate vdelegate, DelegateHandler parent, Tree head ) { + this.template_param_lst = new Gee.ArrayList (); + this.param_list = new Gee.ArrayList(); + this.err_domains = new Gee.ArrayList(); + this.settings = settings; this.vdelegate = vdelegate; this.parent = parent; @@ -2702,7 +2648,7 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil return this.vdelegate.get_cname(); } - public TypeReference return_type { + public TypeReference? type_reference { protected set; get; } @@ -2724,7 +2670,7 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil get; } - protected Gee.ArrayList err_domains { + protected Gee.ArrayList err_domains { protected set; get; } @@ -2733,18 +2679,11 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil public void initialisation ( ) { this.vsymbol = this.vdelegate; - this.template_param_lst = new Gee.ArrayList (); + var ret = this.vdelegate.return_type; + this.set_ret_type ( ret ); var vparamlst = this.vdelegate.get_parameters (); - this.param_list = new Gee.ArrayList (); this.add_parameter_list ( vparamlst ); - - var vexceptionlst = this.vdelegate.get_error_types (); - this.err_domains = new Gee.ArrayList(); - this.add_error_domains ( vexceptionlst ); - - var ret = this.vdelegate.return_type; - this.set_ret_type ( ret ); } public Vala.Delegate vdelegate { @@ -2760,14 +2699,16 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil // internal public override void set_type_references ( ) { - this.set_template_parameter_list_references ( ); - this.set_parameter_list_type_references ( ); this.set_return_type_references ( ); + this.set_parameter_list_type_references ( ); + + var vexceptionlst = this.vdelegate.get_error_types (); + this.add_exception_list ( vexceptionlst ); } // internal public void parse_comment ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.DELEGATE ); + this.parse_comment_helper ( docparser ); } // internal @@ -2775,14 +2716,13 @@ public class Valadoc.Delegate : DataType, ParameterListHandler, SymbolAccessibil return ( this.vdelegate == vdel ); } + // new parameter: DelegateHandler parent public override void write ( Langlet langlet, void* ptr ) { langlet.write_delegate ( this, ptr ); } } -public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visitable, - TemplateParameterListHandler -{ +public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, TemplateParameterListHandler { protected Gee.ArrayList parent_types = new Gee.ArrayList(); construct { @@ -2801,8 +2741,8 @@ public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visit get; } - public string?# comment_str { - get { + public string? comment_str { + owned get { return null; } } @@ -2817,6 +2757,7 @@ public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visit return this.parent_types; } + // remove public bool derived_from_interface ( Interface iface ) { foreach ( DataType dtype in this.parent_types ) { if ( dtype == iface ) @@ -2825,7 +2766,6 @@ public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visit return false; } - // rename, remove virtual public virtual void parse_comments ( Valadoc.Parser docparser ) { this.parse_method_comments ( docparser ); } @@ -2835,13 +2775,10 @@ public abstract class Valadoc.ContainerDataType : DataType, MethodHandler, Visit return ; foreach ( Vala.DataType vtyperef in lst ) { - DataType? element = (DataType?)this.head.search_vala_symbol ( vtyperef.data_type ); + ContainerDataType? element = (ContainerDataType?)this.head.search_vala_symbol ( vtyperef.data_type ); this.parent_types.add ( element ); - if ( element is Class ) { - this.parent_class = (Class)element; - } - else if ( element is Struct ) { - this.parent_class = (Struct)element; + if ( element is Class || element is Struct ) { + this.parent_class = element; } } } @@ -2916,7 +2853,7 @@ public class Valadoc.Class : ContainerDataType, Visitable, ClassHandler, StructH } // internal - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.Class == false ) @@ -2930,68 +2867,50 @@ public class Valadoc.Class : ContainerDataType, Visitable, ClassHandler, StructH velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.Field ) { - var element = this.search_field_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_field_vala ( params, pos ); } else if ( velement is Vala.Method ) { - var element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } else if ( velement is Vala.Delegate ) { - var element = this.search_delegate_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_delegate_vala ( params, pos ); } else if ( velement is Vala.CreationMethod ) { - var element = this.search_construction_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_construction_method_vala ( params, pos ); } else if ( velement is Vala.Signal ) { - var element = this.search_signal_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_signal_vala ( params, pos ); } else if ( velement is Vala.Property ) { - var element = this.search_property_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_property_vala ( params, pos ); } else if ( velement is Vala.Struct ) { - var element = this.search_struct_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_struct_vala ( params, pos ); } else if ( velement is Vala.Class ) { - var element = this.search_class_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_class_vala ( params, pos ); } else if ( velement is Vala.Enum ) { - var element = this.search_enum_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_enum_vala ( params, pos ); } else if ( velement is Vala.Constant ) { - var element = this.search_constant_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_constant_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( !(this.name == params[pos] || params[0] == "this") ) return null; if ( params[pos+1] == null ) return this; - var element = this.search_field ( params, pos ); + DocumentedElement? element = this.search_field ( params, pos ); if ( element != null ) return element; @@ -3084,8 +3003,8 @@ public class Valadoc.Class : ContainerDataType, Visitable, ClassHandler, StructH this.add_constants ( vconstants ); } - public string?# comment_str { - get { + public string? comment_str { + owned get { return this.vclass.source_reference.comment; } } @@ -3130,7 +3049,7 @@ public class Valadoc.Class : ContainerDataType, Visitable, ClassHandler, StructH this.documentation = this.parent_class.documentation; } else { - this.parse_comment_helper ( docparser, CommentContext.CLASS ); + this.parse_comment_helper ( docparser ); } } } @@ -3283,7 +3202,7 @@ public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable { return ( this.verrdom == ver ); } - private weak Basic? search_error_code ( string[] params, int pos ) { + private weak DocumentedElement? search_error_code ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -3296,7 +3215,7 @@ public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable { return null; } - private weak Basic? search_error_code_vala ( Gee.ArrayList params, int pos ) { + private weak DocumentedElement? search_error_code_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.ErrorCode == false ) return null; @@ -3312,7 +3231,7 @@ public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable { return null; } - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.ErrorDomain == false ) @@ -3326,28 +3245,26 @@ public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable { velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.ErrorCode ) { - var element = this.search_error_code_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_error_code_vala ( params, pos ); } else if ( velement is Vala.Method ) { - var element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( this.name != params[pos] ) return null; if ( params[pos+1] == null ) return this; - var element = this.search_method ( params, pos ); + DocumentedElement? element = this.search_method ( params, pos ); if ( element != null ) return element; @@ -3360,7 +3277,7 @@ public class Valadoc.ErrorDomain : DataType, MethodHandler, Visitable { // internal public void parse_comments ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.ERRORDOMAIN ); + this.parse_comment_helper ( docparser ); this.parse_method_comments ( docparser ); foreach ( ErrorCode errcode in this.errcodes ) { @@ -3426,7 +3343,7 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { return this.venum.get_cname(); } - private weak Basic? search_enum_value_vala ( Gee.ArrayList params, int pos ) { + private weak DocumentedElement? search_enum_value_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos+1]; if ( velement is Vala.EnumValue == false ) return null; @@ -3442,7 +3359,7 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { return null; } - private weak Basic? search_enum_value ( string[] params, int pos ) { + private weak DocumentedElement? search_enum_value ( string[] params, int pos ) { pos++; if ( params[pos+1] != null ) @@ -3455,7 +3372,7 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { return null; } - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.Enum == false ) @@ -3469,21 +3386,19 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.EnumValue ) { - var element = this.search_enum_value_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_enum_value_vala ( params, pos ); } else if ( velement is Vala.Method ) { - var element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( this.name != params[pos] ) return null; @@ -3491,7 +3406,7 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { return this; - var element = this.search_method ( params, pos ); + DocumentedElement? element = this.search_method ( params, pos ); if ( element != null ) return element; @@ -3523,8 +3438,7 @@ public class Valadoc.Enum : DataType, MethodHandler, Visitable { // internal public void parse_comments ( Valadoc.Parser docparser ) { - // CommentContext.ENUM - this.parse_comment_helper ( docparser, CommentContext.ENUM ); + this.parse_comment_helper ( docparser ); foreach ( EnumValue enval in this.en_values ) { enval.parse_comment ( docparser ); @@ -3610,7 +3524,7 @@ public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHa get; } - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.Struct == false ) @@ -3624,39 +3538,33 @@ public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHa velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.Field ) { - var element = this.search_field_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_field_vala ( params, pos ); } else if ( velement is Vala.CreationMethod ) { - var element = this.search_construction_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_construction_method_vala ( params, pos ); } else if ( velement is Vala.Method ) { - var element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } else if ( velement is Vala.Constant ) { - var element = this.search_constant_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_constant_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( this.name != params[pos] ) return null; if ( params[pos+1] == null ) return this; - var element = this.search_field ( params, pos ); + DocumentedElement? element = this.search_field ( params, pos ); if ( element != null ) return element; @@ -3692,8 +3600,8 @@ public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHa } // TODO remove - public string?# comment_str { - get { + public string? comment_str { + owned get { return this.vstruct.source_reference.comment; } } @@ -3733,7 +3641,7 @@ public class Valadoc.Struct : ContainerDataType, Visitable, ConstructionMethodHa this.documentation = this.parent_class.documentation; } else { - this.parse_comment_helper ( docparser, CommentContext.STRUCT ); + this.parse_comment_helper ( docparser ); } } } @@ -3809,7 +3717,7 @@ public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, Pr protected get; } - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.Interface == false ) @@ -3823,58 +3731,44 @@ public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, Pr velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.Field ) { - var element = this.search_field_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_field_vala ( params, pos ); } else if ( velement is Vala.Method ) { - var element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } else if ( velement is Vala.Signal ) { - var element = this.search_signal_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_signal_vala ( params, pos ); } else if ( velement is Vala.Property ) { - var element = this.search_property_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_property_vala ( params, pos ); } else if ( velement is Vala.Delegate ) { - var element = this.search_delegate_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_delegate_vala ( params, pos ); } else if ( velement is Vala.Struct ) { - var element = this.search_struct_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_struct_vala ( params, pos ); } else if ( velement is Vala.Enum ) { - var element = this.search_enum_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_enum_vala ( params, pos ); } else if ( velement is Vala.Class ) { - var element = this.search_class_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_class_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( !(this.name == params[pos] || params[0] == "this") ) return null; if ( params[pos+1] == null ) return this; - var element = this.search_field ( params, pos ); + DocumentedElement? element = this.search_field ( params, pos ); if ( element != null ) return element; @@ -3949,8 +3843,8 @@ public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, Pr this.add_enums ( enums ); } - public string?# comment_str { - get { + public string? comment_str { + owned get { return this.vinterface.source_reference.comment; } } @@ -3973,7 +3867,7 @@ public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, Pr // internal public override void parse_comments ( Valadoc.Parser docparser ) { - this.parse_comment_helper ( docparser, CommentContext.INTERFACE ); + this.parse_comment_helper ( docparser ); this.parse_delegate_comments ( docparser ); this.parse_property_comments ( docparser ); this.parse_signal_comments ( docparser ); @@ -4001,7 +3895,7 @@ public class Valadoc.Interface : ContainerDataType, Visitable, SignalHandler, Pr } } -public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHandler, ErrorDomainHandler, +public class Valadoc.Namespace : DocumentedElement, MethodHandler, FieldHandler, NamespaceHandler, ErrorDomainHandler, EnumHandler, ClassHandler, StructHandler, Writeable, InterfaceHandler, DelegateHandler, ConstantHandler { @@ -4060,9 +3954,9 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa } // interface - private weak Basic? search_namespace ( string[] params, int pos ) { + private weak DocumentedElement? search_namespace ( string[] params, int pos ) { foreach ( Namespace ns in this.namespaces ) { - Basic element = ns.search_element ( params, pos+1 ); + DocumentedElement? element = ns.search_element ( params, pos+1 ); if ( element != null ) return element; } @@ -4070,16 +3964,16 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa } //interface - private weak Basic? search_namespace_vala ( Gee.ArrayList params, int pos ) { + private weak DocumentedElement? search_namespace_vala ( Gee.ArrayList params, int pos ) { foreach ( Namespace ns in this.namespaces ) { - Basic element = ns.search_element_vala ( params, pos+1 ); + DocumentedElement? element = ns.search_element_vala ( params, pos+1 ); if ( element != null ) return element; } return null; } - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { Vala.Symbol velement = params[pos]; if ( velement is Vala.Namespace == false ) @@ -4093,61 +3987,43 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa velement = params[pos+1]; + DocumentedElement? element = null; + if ( velement is Vala.Namespace ) { - Basic element = this.search_namespace_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_namespace_vala ( params, pos ); } else if ( velement is Vala.Class ) { - Basic element = this.search_class_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_class_vala ( params, pos ); } else if ( velement is Vala.Interface ) { - Basic element = this.search_interface_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_interface_vala ( params, pos ); } else if ( velement is Vala.Struct ) { - Basic element = this.search_struct_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_struct_vala ( params, pos ); } else if ( velement is Vala.Enum ) { - Basic element = this.search_enum_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_enum_vala ( params, pos ); } else if ( velement is Vala.ErrorDomain ) { - Basic element = this.search_error_domain_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_error_domain_vala ( params, pos ); } else if ( velement is Vala.Method ) { - Basic element = this.search_method_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_method_vala ( params, pos ); } else if ( velement is Vala.Field ) { - Basic element = this.search_field_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_field_vala ( params, pos ); } else if ( velement is Vala.DelegateType || velement is Vala.Delegate ) { - Basic element = this.search_delegate_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_delegate_vala ( params, pos ); } else if ( velement is Vala.Constant ) { - Basic element = this.search_constant_vala ( params, pos ); - if ( element != null ) - return element; + element = this.search_constant_vala ( params, pos ); } - return null; + return element; } // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { if ( this.name != params[pos] ) return null; @@ -4155,7 +4031,7 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa return this; - Basic element = this.search_namespace ( params, pos ); + DocumentedElement? element = this.search_namespace ( params, pos ); if ( element != null ) return element; @@ -4224,8 +4100,8 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa private get; } - public override string?# name { - get { + public override string? name { + owned get { return this.vnspace.name; } } @@ -4254,7 +4130,7 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa // internal public void parse_comments ( Valadoc.Parser docparser ) { - //this.parse_comment_helper ( docparser, CommentContext.NAMESPACE ); + //this.parse_comment_helper ( docparser ); this.parse_enum_comments ( docparser ); this.parse_field_comments ( docparser ); @@ -4279,7 +4155,7 @@ public class Valadoc.Namespace : Basic, MethodHandler, FieldHandler, NamespaceHa } -public class Valadoc.Package : Basic, NamespaceHandler { +public class Valadoc.Package : DocumentedElement, NamespaceHandler { private Gee.ArrayList vfiles = new Gee.ArrayList (); // internal @@ -4292,12 +4168,7 @@ public class Valadoc.Package : Basic, NamespaceHandler { private set; private get; } -/* - public bool is_external_package { - /+ internal +/ set; - get; - } -*/ + public bool is_package { private set; get; @@ -4310,24 +4181,6 @@ public class Valadoc.Package : Basic, NamespaceHandler { private Gee.ArrayList _dependencies; - // internal remove - public bool is_dependency ( Package dep ) { - if ( dep == this ) - return false; - - foreach ( Package pkg in this._dependencies ) { - if ( pkg == dep ) { - return true; - } - - bool tmp = pkg.is_dependency ( dep ); - if ( tmp == true ) { - return true; - } - } - return false; - } - public Gee.ReadOnlyCollection get_full_dependency_list () { Gee.ArrayList list = new Gee.ArrayList (); @@ -4379,6 +4232,7 @@ public class Valadoc.Package : Basic, NamespaceHandler { this.package_name = name; this.vfiles.add ( vfile ); + this.parent = null; } public Package ( Valadoc.Settings settings, Vala.SourceFile vfile, Tree head, bool is_package = false ) { @@ -4387,23 +4241,16 @@ public class Valadoc.Package : Basic, NamespaceHandler { private string package_name; - public override string?# name { - get { + public override string? name { + owned get { return package_name; } } -/* - public Vala.SourceFile vfile { - construct set; - private get; - } -*/ - // internal - public override weak Basic? search_element ( string[] params, int pos ) { + public override weak DocumentedElement? search_element ( string[] params, int pos ) { foreach ( Namespace ns in this.namespaces ) { - Basic element = ns.search_element ( params, pos ); + DocumentedElement? element = ns.search_element ( params, pos ); if ( element != null ) return element; } @@ -4411,9 +4258,9 @@ public class Valadoc.Package : Basic, NamespaceHandler { } // internal - public override weak Basic? search_element_vala ( Gee.ArrayList params, int pos ) { + public override weak DocumentedElement? search_element_vala ( Gee.ArrayList params, int pos ) { foreach ( Namespace ns in this.namespaces ) { - Basic element = ns.search_element_vala ( params, pos ); + DocumentedElement? element = ns.search_element_vala ( params, pos ); if ( element != null ) return element; } @@ -4459,16 +4306,19 @@ public class Valadoc.Package : Basic, NamespaceHandler { public class Valadoc.Tree : Vala.CodeVisitor { - private Gee.ArrayList files = new Gee.ArrayList(); + private Gee.ArrayList packages = new Gee.ArrayList(); + + public Gee.ReadOnlyCollection get_package_list () { + return new Gee.ReadOnlyCollection ( this.packages ); + } private Valadoc.Settings settings; public Tree ( Valadoc.Settings settings, bool non_null_experimental, - bool disable_non_null, bool disable_checking, - string basedir, - string directory ) + string? basedir, + string? directory ) { this.context = new Vala.CodeContext ( ); this.settings = settings; @@ -4484,7 +4334,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { this.context.directory = context.basedir; } - this.context.non_null = !disable_non_null || non_null_experimental; +// this.context.non_null = !disable_non_null || non_null_experimental; this.context.non_null_experimental = non_null_experimental; this.context.checking = !disable_checking; @@ -4506,7 +4356,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { private void add_dependencies_to_source_package () { if ( this.source_package != null ) { Gee.ArrayList deplst = new Gee.ArrayList (); - foreach ( Package pkg in this.files ) { + foreach ( Package pkg in this.packages ) { if ( pkg != this.source_package ) { deplst.add ( pkg ); } @@ -4532,7 +4382,6 @@ public class Valadoc.Tree : Vala.CodeVisitor { vfile = new Vala.SourceFile (this.context, source, false); vfile.add_using_directive (new Vala.UsingDirective (new Vala.UnresolvedSymbol (null, "GLib", null))); this.context.add_source_file ( vfile ); - } else if ( path.has_suffix ( ".vapi" ) ) { vfile = new Vala.SourceFile ( this.context, source, true ); @@ -4544,7 +4393,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { if ( this.source_package == null ) { this.source_package = new Package.with_name ( this.settings, vfile, this.settings.pkg_name, this ); - this.files.add ( this.source_package ); + this.packages.add ( this.source_package ); } this.source_package.add_file ( vfile ); @@ -4569,7 +4418,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { Package vdpkg = new Package ( this.settings, vfile, this, true ); - this.files.add ( vdpkg ); + this.packages.add ( vdpkg ); var deps_filename = Path.build_filename (Path.get_dirname (package_path), "%s.deps".printf (pkg)); @@ -4606,17 +4455,10 @@ public class Valadoc.Tree : Vala.CodeVisitor { private CodeContext context; public void visit ( Doclet doclet ) { - foreach ( Package file in this.files ) { - file.visit ( doclet ); - } + doclet.initialisation ( this.settings, this ); } -/* - private weak Basic? search_symbol_in_namespace ( Basic element, string[] params ) { - return this.search_symbol_in_symbol ( element.nspace, params ); - } -*/ - private weak Basic? search_symbol_in_type ( Basic element, string[] params, int params_offset = 0 ) { + private weak DocumentedElement? search_symbol_in_type ( DocumentedElement element, string[] params, int params_offset = 0 ) { if ( !( element.parent is ContainerDataType || element.parent is Enum || element.parent is ErrorDomain ) ) return null; @@ -4626,13 +4468,13 @@ public class Valadoc.Tree : Vala.CodeVisitor { for ( int i = 0; params.length > i ; i++ ) { nparams [i+1] = params[i]; } - return this.search_symbol_in_symbol ( element.parent, nparams, 0 ); + return this.search_symbol_in_symbol ( (DocumentedElement)element.parent, nparams, 0 ); } - return this.search_symbol_in_symbol ( element.parent, params, 0 ); + return this.search_symbol_in_symbol ( (DocumentedElement)element.parent, params, 0 ); } - private weak Basic? search_symbol_in_symbol ( Basic element, string[] params, int params_offset = 0 ) { + private weak DocumentedElement? search_symbol_in_symbol ( DocumentedElement element, string[] params, int params_offset = 0 ) { if ( element is Class || element is Interface || element is Struct ) { return element.search_element ( params, params_offset ); } @@ -4645,7 +4487,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { return null; } - private weak Basic? search_symbol_in_global_namespaces ( Basic? element, string[] params ) { + private weak DocumentedElement? search_symbol_in_global_namespaces ( DocumentedElement? element, string[] params ) { int param_size = 0; for ( param_size = 0; params[param_size] != null; param_size++ ); @@ -4656,24 +4498,24 @@ public class Valadoc.Tree : Vala.CodeVisitor { global_params[i+1] = params[i]; } - foreach ( Package f in this.files ) { - Basic element = f.search_element ( global_params, 0 ); + foreach ( Package pkg in this.packages ) { + DocumentedElement? element = pkg.search_element ( global_params, 0 ); if ( element != null ) return element; } return null; } - private weak Basic? search_symbol_in_namespaces ( Basic element, string[] params ) { - foreach ( Package f in this.files ) { - Basic element = f.search_element ( params, 0 ); + private weak DocumentedElement? search_symbol_in_namespaces ( DocumentedElement element, string[] params ) { + foreach ( Package pkg in this.packages ) { + DocumentedElement? element = pkg.search_element ( params, 0 ); if ( element != null ) return element; } return null; } - private weak Basic? search_element ( Basic? element, string[] params ) { + private weak DocumentedElement? search_element ( DocumentedElement? element, string[] params ) { if ( element != null ) { if ( params[0] == "this" ) { return search_symbol_in_type ( element, params, 1 ); @@ -4696,7 +4538,7 @@ public class Valadoc.Tree : Vala.CodeVisitor { return null; } - public weak Basic? search_symbol_str ( Valadoc.Basic? element, string symname ) { + public weak DocumentedElement? search_symbol_str ( DocumentedElement? element, string symname ) { string[] params = symname.split( ".", -1 ); int i = 0; while ( params[i] != null ) i++; params.length = i; @@ -4835,33 +4677,33 @@ public class Valadoc.Tree : Vala.CodeVisitor { // internal public Package? find_file ( Vala.SourceFile vfile ) { - foreach ( Package f in this.files ) { - if ( f.is_vpackage( vfile ) ) - return f; + foreach ( Package pkg in this.packages ) { + if ( pkg.is_vpackage( vfile ) ) + return pkg; } return null; } private void set_type_references ( ) { - foreach ( Package f in this.files ) { - f.set_type_references( ); + foreach ( Package pkg in this.packages ) { + pkg.set_type_references( ); } } private void inheritance ( ) { - foreach ( Package f in this.files ) { - f.inheritance( ); + foreach ( Package pkg in this.packages ) { + pkg.inheritance( ); } } public void parse_comments ( Valadoc.Parser docparser ) { - foreach ( Package f in this.files ) { - f.parse_comments( docparser ); + foreach ( Package pkg in this.packages ) { + pkg.parse_comments( docparser ); } } // internal - public weak Basic? search_vala_symbol ( Vala.Symbol vnode ) { + public weak DocumentedElement? search_vala_symbol ( Vala.Symbol? vnode ) { if ( vnode == null ) return null; @@ -4888,66 +4730,8 @@ public class Valadoc.Tree : Vala.CodeVisitor { return file.search_element_vala ( params, 0 ); } - /*/ => add_external_package - private Gee.ArrayList? load_dependency_list ( string vapi_path ) { - if ( vapi_path.has_suffix ( ".vapi" ) ) { - string deps_filename = vapi_path.ndup ( vapi_path.size() - ".vapi".size() ) + ".deps"; - Gee.ArrayList list = new Gee.ArrayList (); - - if (FileUtils.test (deps_filename, FileTest.EXISTS)) { - try { - string deps_content; - ulong deps_len; - - FileUtils.get_contents (deps_filename, out deps_content, out deps_len); - foreach (string dep in deps_content.split ("\n")) { - if (dep != "") { - foreach ( Package pkg in this.files ) { - if ( pkg.name == dep ) { - list.add ( pkg ); - continue ; - } - } - } - } - } - catch (FileError e) { - Report.error (null, "Unable to read dependency file: %s".printf (e.message)); - } - } - return list; - } - return null; - } -*/ -// private Gee.ArrayList vfiles = new Gee.ArrayList (); - -/* - private void add_dependencies () { - foreach ( weak Vala.SourceFile vfile in this.vfiles ) { - Gee.ArrayList? deps = this.load_dependency_list ( vfile.filename ); - if ( deps != null ) { - Package pkg = this.get_file ( vfile ); - pkg.set_dependency_list ( deps ); - } - } - - if ( this.source_package != null ) { - Gee.ArrayList list = new Gee.ArrayList (); - foreach ( Package pkg in this.files ) { - if ( pkg != this.source_package ) { - list.add ( pkg ); - } - } - this.source_package.set_dependency_list ( list ); - } - - this.source_package = null; - this.vfiles = null; - } -*/ private Package? get_external_package_by_name ( string name ) { - foreach ( Package pkg in this.files ) { + foreach ( Package pkg in this.packages ) { if ( name == pkg.name ) { return pkg; } @@ -4955,15 +4739,5 @@ public class Valadoc.Tree : Vala.CodeVisitor { return null; } - /*/ internal, deprecated - public Package? get_file ( Vala.SourceFile vfile ) { - Package file = this.find_file( vfile ); - if ( file != null ) - return file; - - Package tmp = new Package ( this.settings, vfile, this ); - this.files.add ( tmp ); - return tmp; - } */ } diff --git a/src/libvaladoc/parser.vala b/src/libvaladoc/parser.vala index 343b68650..c43ce28b5 100644 --- a/src/libvaladoc/parser.vala +++ b/src/libvaladoc/parser.vala @@ -37,12 +37,12 @@ public abstract class Taglet : DocElement { } public abstract class InlineTaglet : Taglet { - public abstract bool parse ( Settings settings, Tree tree, Basic me, string content, out string[] errmsg ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, string content, out string[] errmsg ); public abstract string to_string ( ); } public abstract class MainTaglet : Taglet { - protected string? get_data_type ( Basic me ) { + protected string? get_data_type ( DocumentedElement me ) { if ( me is Valadoc.Class ) return "class"; if ( me is Valadoc.Delegate ) @@ -74,7 +74,7 @@ public abstract class MainTaglet : Taglet { } public virtual int order { get { return 0; } } - public abstract bool parse ( Settings settings, Tree tree, Basic me, Gee.Collection content, out string[] errmsg ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.Collection content, out string[] errmsg ); public abstract bool write_block_start ( void* res ); public abstract bool write_block_end ( void* res ); } @@ -84,7 +84,7 @@ public abstract class StringTaglet : Taglet { set; get; } - public abstract bool parse ( Settings settings, Tree tree, Basic me, string content ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, string content ); } public enum ImageDocElementPosition { @@ -106,32 +106,32 @@ public enum ListType { } public abstract class ImageDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, string# path, ImageDocElementPosition pos ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, string# path, ImageDocElementPosition pos ); } public abstract class LinkDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, string# link, Gee.ArrayList? desc ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, string# link, Gee.ArrayList? desc ); } public abstract class SourceCodeDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, string# src, Language lang ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, string# src, Language lang ); } public abstract class ListEntryDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, ListType type, Gee.ArrayList content ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, ListType type, Gee.ArrayList content ); } public abstract class ListDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, ListType type, Gee.ArrayList entries ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, ListType type, Gee.ArrayList entries ); } public abstract class NotificationDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ); } public abstract class HighlightedDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ); } public abstract class ItalicDocElement : HighlightedDocElement { @@ -144,7 +144,7 @@ public abstract class UnderlinedDocElement : HighlightedDocElement { } public abstract class ContentPositionDocElement : DocElement { - public abstract bool parse ( Settings settings, Tree tree, Basic me, Gee.ArrayList content ); + public abstract bool parse ( Settings settings, Tree tree, DocumentedElement me, Gee.ArrayList content ); } public abstract class CenterDocElement : ContentPositionDocElement { @@ -169,7 +169,7 @@ public enum TextVerticalPosition { public abstract class TableCellDocElement : DocElement { - public abstract void parse ( Settings settings, Tree tree, Basic me, TextPosition pos, TextVerticalPosition hpos, int size, int dsize, Gee.ArrayList content ); + public abstract void parse ( Settings settings, Tree tree, DocumentedElement me, TextPosition pos, TextVerticalPosition hpos, int size, int dsize, Gee.ArrayList content ); } public abstract class TableDocElement : DocElement { @@ -340,7 +340,6 @@ public class ModuleLoader : Object { private Module docletmodule; private Type doclettype; - public bool load ( string path ) { bool tmp = this.load_doclet ( path ); if ( tmp == false ) @@ -349,7 +348,7 @@ public class ModuleLoader : Object { return this.load_taglets ( path ); } - public bool load_doclet ( string path ) { + private bool load_doclet ( string path ) { void* function; docletmodule = Module.open ( path + "/libdoclet.so", ModuleFlags.BIND_LAZY); @@ -368,7 +367,7 @@ public class ModuleLoader : Object { return true; } - public bool load_taglets ( string fulldirpath ) { + private bool load_taglets ( string fulldirpath ) { try { taglets = new Gee.HashMap ( GLib.str_hash, GLib.str_equal ); Gee.ArrayList modules = new Gee.ArrayList ( ); @@ -384,7 +383,6 @@ public class ModuleLoader : Object { Module* module = Module.open ( tagletpath, ModuleFlags.BIND_LAZY); if (module == null) { - stderr.printf ( "Can't load plugin.\n" ); taglets = null; return false; } @@ -445,7 +443,6 @@ public class ModuleLoader : Object { return true; } catch ( FileError err ) { - stderr.printf ( "Can't load plugin.\n" ); taglets = null; return false; } @@ -466,7 +463,7 @@ public class Parser { private int line; private int pos; - private weak string filename; + private string filename; private weak string str; private bool run; @@ -617,7 +614,7 @@ public class Parser { } } - private void parse_inline_taglet ( Tree tree, Basic me, string content, InlineTaglet taglet, int namelen, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { + private void parse_inline_taglet ( Tree tree, DocumentedElement me, string content, InlineTaglet taglet, int namelen, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { string[] errmsgs; bool tmp = taglet.parse ( settings, tree, me, content, out errmsgs ); @@ -626,7 +623,7 @@ public class Parser { } } - private void parse_main_taglet ( Tree tree, Basic me, Gee.ArrayList content, MainTaglet taglet, int namelen, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { + private void parse_main_taglet ( Tree tree, DocumentedElement me, Gee.ArrayList content, MainTaglet taglet, int namelen, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { string[] errmsgs; bool tmp = taglet.parse ( settings, tree, me, content, out errmsgs ); @@ -635,7 +632,7 @@ public class Parser { } } - private void append_main_taglet ( Tree tree, DocumentationTree dtree, Basic me, MainTaglet? curtag, int paragraph, string? curtagname, Gee.ArrayList content, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { + private void append_main_taglet ( Tree tree, DocumentationTree dtree, DocumentedElement me, MainTaglet? curtag, int paragraph, string? curtagname, Gee.ArrayList content, int starttag_linestartpos, int starttag_startpos, int starttag_line, int starttag_pos ) { if ( curtag == null ) { dtree.add_description ( content ); } @@ -645,14 +642,14 @@ public class Parser { } } - private StringTaglet create_string_taglet ( Tree tree, Basic? me, GLib.StringBuilder buf ) { + private StringTaglet create_string_taglet ( Tree tree, DocumentedElement? me, GLib.StringBuilder buf ) { StringTaglet strtag = (StringTaglet)GLib.Object.new ( this.modules.strtag ); strtag.parse ( settings, tree, me, buf.str ); buf.erase ( 0, -1 ); return strtag; } - private void append_and_create_string_taglet ( Gee.ArrayList content, Tree tree, Basic? me, GLib.StringBuilder buf ) { + private void append_and_create_string_taglet ( Gee.ArrayList content, Tree tree, DocumentedElement? me, GLib.StringBuilder buf ) { if ( buf.len == 0 ) return ; @@ -692,7 +689,7 @@ public class Parser { return (int)offset; } - private void parse_inline_taglets ( Tree tree, Basic me, Gee.ArrayList elements ) { + private void parse_inline_taglets ( Tree tree, DocumentedElement me, Gee.ArrayList elements ) { this.pos++; for ( unichar chr = this.str[this.pos]; ; chr = this.str[++this.pos] ) { @@ -775,7 +772,7 @@ public class Parser { return ( str[this.pos] == '\n' ); } - private int parse_list_entry ( Tree tree, Basic me, ListType type, Gee.ArrayList entries, GLib.Queue queue, int deep, int prevdeep ) { + private int parse_list_entry ( Tree tree, DocumentedElement me, ListType type, Gee.ArrayList entries, GLib.Queue queue, int deep, int prevdeep ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); @@ -908,7 +905,7 @@ public class Parser { return -2; } - private int parse_list ( Tree tree, Basic me, ListType listtype, Gee.ArrayList content, GLib.Queue stack, int deep, int prevdeep ) { + private int parse_list ( Tree tree, DocumentedElement me, ListType listtype, Gee.ArrayList content, GLib.Queue stack, int deep, int prevdeep ) { Gee.ArrayList entries = new Gee.ArrayList (); unichar chr = this.str[this.pos]; int ndeep = -1; @@ -1040,7 +1037,7 @@ public class Parser { - private bool parse_row ( Tree tree, Basic me, Gee.ArrayList> rows ) { + private bool parse_row ( Tree tree, DocumentedElement me, Gee.ArrayList> rows ) { Gee.ArrayList row = new Gee.ArrayList (); Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); @@ -1126,7 +1123,7 @@ public class Parser { return false; } - private void parse_table ( Tree tree, Basic me, Gee.ArrayList content ) { + private void parse_table ( Tree tree, DocumentedElement me, Gee.ArrayList content ) { Gee.ArrayList> rows = new Gee.ArrayList> (); bool next = true; this.pos++; @@ -1140,19 +1137,19 @@ public class Parser { content.add ( table ); } - private void parse_italic_content ( Tree tree, Basic me, Gee.ArrayList content, bool newline = true ) { + private void parse_italic_content ( Tree tree, DocumentedElement me, Gee.ArrayList content, bool newline = true ) { this.parse_highlighted_content ( tree, me, this.modules.italictag, '/', content, newline ); } - private void parse_bold_content ( Tree tree, Basic me, Gee.ArrayList content, bool newline = true ) { + private void parse_bold_content ( Tree tree, DocumentedElement me, Gee.ArrayList content, bool newline = true ) { this.parse_highlighted_content ( tree, me, this.modules.boldtag, '+', content, newline ); } - private void parse_underlined_content ( Tree tree, Basic me, Gee.ArrayList content, bool newline = true ) { + private void parse_underlined_content ( Tree tree, DocumentedElement me, Gee.ArrayList content, bool newline = true ) { this.parse_highlighted_content ( tree, me, this.modules.underlinedtag, '_', content, newline ); } - private void parse_highlighted_content ( Tree tree, Basic me, GLib.Type tagtype, unichar separator, Gee.ArrayList content2, bool newline = true ) { + private void parse_highlighted_content ( Tree tree, DocumentedElement me, GLib.Type tagtype, unichar separator, Gee.ArrayList content2, bool newline = true ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); int starttag_linestartpos = this.linestartpos; @@ -1267,7 +1264,7 @@ public class Parser { this.run = false; } - private void parse_notification ( Tree tree, Basic me, Gee.ArrayList content2 ) { + private void parse_notification ( Tree tree, DocumentedElement me, Gee.ArrayList content2 ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); int starttag_linestartpos = this.linestartpos; @@ -1382,7 +1379,7 @@ public class Parser { this.run = false; } - private void parse_content_position ( Tree tree, Basic me, GLib.Type postagtype, Gee.ArrayList content2 ) { + private void parse_content_position ( Tree tree, DocumentedElement me, GLib.Type postagtype, Gee.ArrayList content2 ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); this.pos = this.pos + 3; @@ -1496,7 +1493,7 @@ public class Parser { this.run = false; } - private void parse_brief_description ( Tree tree, Basic me, DocumentationTree dtree ) { + private void parse_brief_description ( Tree tree, DocumentedElement me, DocumentationTree dtree ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); @@ -1529,7 +1526,7 @@ public class Parser { this.run = false; } - public DocumentationTree? parse ( Tree tree, Basic me, string str ) { + public DocumentationTree? parse ( Tree tree, DocumentedElement me, string str ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder ( ); DocumentationTree dtree = new DocumentationTree (); @@ -1715,7 +1712,7 @@ public class Parser { return dtree; } - private void parse_source_code ( Tree tree, Basic me, Gee.ArrayList elements ) { + private void parse_source_code ( Tree tree, DocumentedElement me, Gee.ArrayList elements ) { GLib.StringBuilder buf = new GLib.StringBuilder (); Language lang = Language.VALA; int startpos = this.pos; @@ -1793,7 +1790,7 @@ public class Parser { return ImageDocElementPosition.NEUTRAL; } - private void parse_image ( Tree tree, Basic me, Gee.ArrayList elements ) { + private void parse_image ( Tree tree, DocumentedElement me, Gee.ArrayList elements ) { GLib.StringBuilder buf = new GLib.StringBuilder (); ImageDocElementPosition imgpos = ImageDocElementPosition.NEUTRAL; int startpos = this.pos; @@ -1841,7 +1838,7 @@ public class Parser { return false; } - private Gee.ArrayList? parse_link_text ( Tree tree, Basic me, int startpos ) { + private Gee.ArrayList? parse_link_text ( Tree tree, DocumentedElement me, int startpos ) { Gee.ArrayList content = new Gee.ArrayList (); GLib.StringBuilder buf = new GLib.StringBuilder (); int separatorpos = ++this.pos; @@ -1903,7 +1900,7 @@ public class Parser { return null; } - private void parse_link ( Tree tree, Basic me, Gee.ArrayList elements ) { + private void parse_link ( Tree tree, DocumentedElement me, Gee.ArrayList elements ) { GLib.StringBuilder buf = new GLib.StringBuilder (); int startpos = this.pos; this.pos = this.pos+2; diff --git a/src/libvaladoc/settings.vala b/src/libvaladoc/settings.vala index 56cca536c..8cbdf5304 100755 --- a/src/libvaladoc/settings.vala +++ b/src/libvaladoc/settings.vala @@ -30,6 +30,8 @@ public class Valadoc.Settings : Object { public bool with_deps = false; public bool add_inherited = false; + + // remove public string get_real_path () { if ( rpath == null ) { string path = realpath ( this.path ); diff --git a/src/valadoc/Makefile.am b/src/valadoc/Makefile.am index b04feb249..0ddfc8a68 100644 --- a/src/valadoc/Makefile.am +++ b/src/valadoc/Makefile.am @@ -41,7 +41,7 @@ valadoc_LDADD = \ valadoc.vala.stamp: $(libvaladoc_VALASOURCES) - $(VALAC) -C --pkg gmodule-2.0 --pkg config --vapidir ../vapi --pkg valadoc-1.0 --basedir $(top_srcdir)/src/valadoc/ valadoc.vala --disable-non-null --save-temps $^ + $(VALAC) -C --pkg gmodule-2.0 --pkg config --vapidir ../vapi --pkg valadoc-1.0 --basedir $(top_srcdir)/src/valadoc/ valadoc.vala --save-temps $^ touch $@ EXTRA_DIST = $(valadoc_VALASOURCES) valadoc.vala.stamp diff --git a/src/valadoc/valadoc.vala b/src/valadoc/valadoc.vala index dd0b74492..abb4741d7 100755 --- a/src/valadoc/valadoc.vala +++ b/src/valadoc/valadoc.vala @@ -44,35 +44,36 @@ public class ValaDoc : Object { private static string pluginpath; private static bool non_null_experimental = false; - private static bool disable_non_null = false; private static bool disable_checking; private static bool force = false; + [CCode (array_length = false, array_null_terminated = true)] [NoArrayLength ()] private static string[] vapi_directories; + [CCode (array_length = false, array_null_terminated = true)] [NoArrayLength ()] - private static weak string[] tsources; + private static string[] tsources; + [CCode (array_length = false, array_null_terminated = true)] [NoArrayLength ()] - private static weak string[] tpackages; + private static string[] tpackages; private const GLib.OptionEntry[] options = { - { "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, out vapi_directories, + { "vapidir", 0, 0, OptionArg.FILENAME_ARRAY, ref vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..." }, - { "pkg", 0, 0, OptionArg.STRING_ARRAY, out tpackages, "Include binding for PACKAGE", "PACKAGE..." }, - { "directory", 'o', 0, OptionArg.FILENAME, out directory, "Output directory", "DIRECTORY" }, + { "pkg", 0, 0, OptionArg.STRING_ARRAY, ref tpackages, "Include binding for PACKAGE", "PACKAGE..." }, + { "directory", 'o', 0, OptionArg.FILENAME, ref directory, "Output directory", "DIRECTORY" }, { "protected", 0, 0, OptionArg.NONE, ref _protected, "Adds protected elements to documentation", null }, { "private", 0, 0, OptionArg.NONE, ref _private, "Adds private elements to documentation", null }, { "inherit", 0, 0, OptionArg.NONE, ref add_inherited, "Adds inherited elements to a class", null }, { "deps", 0, 0, OptionArg.NONE, ref with_deps, "Adds packages to the documentation", null }, - { "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null }, { "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, - "Enable experimentalenhancements for non-null types", null }, - { "", 0, 0, OptionArg.FILENAME_ARRAY, out tsources, null, "FILE..." }, + "Enable experimentalenhancements for non-null types", null }, { "doclet", 0, 0, OptionArg.FILENAME, ref pluginpath, "plugin", "DIRECTORY" }, { "package-name", 0, 0, OptionArg.STRING, ref pkg_name, "package name", "DIRECTORY" }, { "package-version", 0, 0, OptionArg.STRING, ref pkg_version, "package version", "DIRECTORY" }, { "force", 0, 0, OptionArg.NONE, ref force, "force", null }, + { "", 0, 0, OptionArg.FILENAME_ARRAY, ref tsources, null, "FILE..." }, { null } }; @@ -137,7 +138,7 @@ public class ValaDoc : Object { Valadoc.Parser docparser = new Valadoc.Parser ( settings, reporter, modules ); - Valadoc.Tree doctree = new Valadoc.Tree ( settings, non_null_experimental, disable_non_null, disable_checking, basedir, directory ); + Valadoc.Tree doctree = new Valadoc.Tree ( settings, non_null_experimental, disable_checking, basedir, directory ); if (!doctree.add_external_package ( vapi_directories, "glib-2.0" )) { Report.error (null, "glib-2.0 not found in specified Vala API directories" ); @@ -159,14 +160,14 @@ public class ValaDoc : Object { this.tpackages = null; } - if ( this.tsources != null ) { - foreach ( string src in this.tsources ) { + if ( tsources != null ) { + foreach ( string src in tsources ) { if ( !doctree.add_file ( src ) ) { Report.error (null, "%s not found".printf (src)); return quit (); } } - this.tsources = null; + tsources = null; } if ( !doctree.create_tree( ) ) @@ -176,8 +177,6 @@ public class ValaDoc : Object { if ( reporter.errors > 0 ) return 1; - - modules.doclet.initialisation ( settings ); doctree.visit ( modules.doclet ); modules.doclet.cleanups ( ); diff --git a/src/vapi/mysql.vapi b/src/vapi/mysql.vapi new file mode 100644 index 000000000..23614dc11 --- /dev/null +++ b/src/vapi/mysql.vapi @@ -0,0 +1,108 @@ +/* mysql.vala + * + * Copyright (C) 2008 Jukka-Pekka Iivonen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Jukka-Pekka Iivonen + */ + +[CCode (lower_case_cprefix = "mysql_", cheader_filename = "mysql/mysql.h")] +namespace Mysql { + /* Database Connection Handle */ + [Compact] + [CCode (free_function = "mysql_close", cname = "MYSQL", cprefix = "mysql_")] + public class Database { + [CCode (argument0 = "NULL", cname = "mysql_init")] + public void init (); + + public ulong affected_rows (); + public bool autocommit (bool mode); + public bool change_user (string username, string passwd, string dbname); + public weak string character_set_name (); + public bool commit (); + public int dump_debug_info (); + public uint errno (); + public weak string error (); + public weak string get_host_info (); + public uint get_proto_info (); + public weak string get_server_info (); + public ulong get_server_version (); + public weak string get_ssl_cipher (); + public weak string info (); + public ulong insert_id (); + public int kill (ulong pid); + public Result list_dbs (string wild); + public Result list_fields (string table, string wild); + public Result list_processes (); + public Result list_tables (string wild); + public bool more_results (); + public int next_result (); + public int options (int option, string arg); + public int ping (); + public int query (string stmt_str); + public bool real_connect (string host, string username, string passwd, string dbname, uint port, string? unix_socket, ulong client_flag); + public ulong real_escape_string (string to, string from, ulong length); + public int real_query (string query, ulong len); + public int reload (); + public bool rollback (); + public int select_db (string dbname); + public int set_character_set (string csname); + public void set_local_infile_default (); + public int set_server_option (int option); + public weak string sqlstate (); + public int shutdown (int shutdown_level); + public bool ssl_set (string key, string cert, string ca, string capath, string cipher); + public weak string stat (); + public Result? store_result (); + public ulong thread_id (); + public Result use_result (); + public uint warning_count (); + } + [Compact] + [CCode (free_function = "mysql_free_result", cname = "MYSQL_RES", cprefix = "mysql_")] + public class Result { + public bool eof (); + public Field fetch_field (); + public Field fetch_field_direct (uint field_nbr); + public Field[] fetch_fields (); + public ulong[] fetch_lengths (); + [CCode(array_length=false)] + [NoArrayLength] + public weak string[]? fetch_row (); + public uint fetch_count (); + public uint num_fields (); + public uint num_rows (); + + public bool data_seek (ulong offset); + } + [CCode (cname = "MYSQL_FIELD")] + public struct Field { + } + + public weak string get_client_info (); + public ulong get_client_version (); + public void debug (string msg); + public ulong hex_string (string to, string from, ulong length); + public void library_end (); + public int library_init (int argc, string[] argv, string[] groups); + public void server_end (); + public int server_init (int argc, string[] argv, string[] groups); + public void thread_end (); + public bool thread_init (); + public uint thread_safe (); +} +