valadoc r6 - in trunk: . src/doclets src/doclets/devhelp src/doclets/devhelp/doclet src/doclets/devhelp/linkhelper src/doclets/devhelp/taglets src/doclets/devhelp/taglets/author src/doclets/devhelp/taglets/link src/doclets/devhelp/taglets/parameter src/doclets/devhelp/taglets/return src/doclets/devhelp/taglets/see src/doclets/devhelp/taglets/string src/doclets/devhelp/taglets/throws src/doclets/devhelp/taglets/version
- From: flobrosch svn gnome org
- To: svn-commits-list gnome org
- Subject: valadoc r6 - in trunk: . src/doclets src/doclets/devhelp src/doclets/devhelp/doclet src/doclets/devhelp/linkhelper src/doclets/devhelp/taglets src/doclets/devhelp/taglets/author src/doclets/devhelp/taglets/link src/doclets/devhelp/taglets/parameter src/doclets/devhelp/taglets/return src/doclets/devhelp/taglets/see src/doclets/devhelp/taglets/string src/doclets/devhelp/taglets/throws src/doclets/devhelp/taglets/version
- Date: Wed, 29 Oct 2008 02:21:20 +0000 (UTC)
Author: flobrosch
Date: Wed Oct 29 02:21:20 2008
New Revision: 6
URL: http://svn.gnome.org/viewvc/valadoc?rev=6&view=rev
Log:
Some basic work for devhelp integration
Added:
trunk/src/doclets/devhelp/
trunk/src/doclets/devhelp/Makefile.am
trunk/src/doclets/devhelp/doclet/
trunk/src/doclets/devhelp/doclet/Makefile.am
trunk/src/doclets/devhelp/doclet/template.vala
trunk/src/doclets/devhelp/linkhelper/
trunk/src/doclets/devhelp/linkhelper/Makefile.am
trunk/src/doclets/devhelp/linkhelper/helper.vala (contents, props changed)
trunk/src/doclets/devhelp/taglets/
trunk/src/doclets/devhelp/taglets/Makefile.am
trunk/src/doclets/devhelp/taglets/author/
trunk/src/doclets/devhelp/taglets/author/Makefile.am
trunk/src/doclets/devhelp/taglets/author/taglet.vala
trunk/src/doclets/devhelp/taglets/link/
trunk/src/doclets/devhelp/taglets/link/Makefile.am
trunk/src/doclets/devhelp/taglets/link/taglet.vala
trunk/src/doclets/devhelp/taglets/parameter/
trunk/src/doclets/devhelp/taglets/parameter/Makefile.am
trunk/src/doclets/devhelp/taglets/parameter/taglet.vala
trunk/src/doclets/devhelp/taglets/return/
trunk/src/doclets/devhelp/taglets/return/Makefile.am
trunk/src/doclets/devhelp/taglets/return/taglet.vala
trunk/src/doclets/devhelp/taglets/see/
trunk/src/doclets/devhelp/taglets/see/Makefile.am
trunk/src/doclets/devhelp/taglets/see/taglet.vala
trunk/src/doclets/devhelp/taglets/string/
trunk/src/doclets/devhelp/taglets/string/Makefile.am
trunk/src/doclets/devhelp/taglets/string/taglet.vala
trunk/src/doclets/devhelp/taglets/throws/
trunk/src/doclets/devhelp/taglets/throws/Makefile.am
trunk/src/doclets/devhelp/taglets/throws/taglet.vala
trunk/src/doclets/devhelp/taglets/version/
trunk/src/doclets/devhelp/taglets/version/Makefile.am
trunk/src/doclets/devhelp/taglets/version/taglet.vala
Modified:
trunk/configure.in
trunk/src/doclets/Makefile.am
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Oct 29 02:21:20 2008
@@ -77,6 +77,17 @@
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/linkhelper/Makefile
+ src/doclets/devhelp/doclet/Makefile
+ src/doclets/devhelp/taglets/Makefile
+ src/doclets/devhelp/taglets/parameter/Makefile
+ src/doclets/devhelp/taglets/version/Makefile
+ src/doclets/devhelp/taglets/throws/Makefile
+ src/doclets/devhelp/taglets/return/Makefile
+ src/doclets/devhelp/taglets/string/Makefile
+ src/doclets/devhelp/taglets/link/Makefile
+ src/doclets/devhelp/taglets/see/Makefile
src/valadoc/Makefile])
Modified: trunk/src/doclets/Makefile.am
==============================================================================
--- trunk/src/doclets/Makefile.am (original)
+++ trunk/src/doclets/Makefile.am Wed Oct 29 02:21:20 2008
@@ -5,6 +5,7 @@
SUBDIRS = \
html \
+ devhelp \
valadoc.org \
$(NULL)
Added: trunk/src/doclets/devhelp/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,16 @@
+# src/Makefile.am
+
+NULL =
+
+
+SUBDIRS = \
+ linkhelper \
+ doclet \
+ taglets \
+ $(NULL)
+
+# langlet \
+# doclet \
+# $(NULL)
+
+
Added: trunk/src/doclets/devhelp/doclet/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/doclet/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,58 @@
+# src/Makefile.am
+
+
+
+
+libdoclet_VALASOURCES = \
+ template.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libdoclet.vala.stamp
+
+
+libdoclet.vala.stamp: $(libdoclet_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../vapi --pkg valadoc-1.0 --vapidir ../linkhelper --pkg libxml-2.0 --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+docletdir = $(libdir)/valadoc/plugins/valadoc.org/
+
+doclet_LTLIBRARIES = libdoclet.la
+
+
+libdoclet_la_SOURCES = \
+ libdoclet.vala.stamp \
+ $(libdoclet_VALASOURCES:.vala=.c) \
+ $(libdoclet_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../libvaladoc/ \
+ -I ../linkhelper/ \
+ -I ../ \
+ $(GLIB_CFLAGS) \
+ $(LIBXML2_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libdoclet_la_LDFLAGS = -module -avoid-version
+
+
+libdoclet_la_LIBADD = \
+ ../../../libvaladoc/libvaladoc.la \
+ ../linkhelper/libhtmlhelper.la \
+ $(LIBXML2_LIBS) \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libdoclet_VALASOURCES) libdoclet.vala.stamp
Added: trunk/src/doclets/devhelp/doclet/template.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/doclet/template.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,1248 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Xml;
+using Gee;
+
+
+
+
+
+
+private string get_full_name ( Basic element ) {
+ if ( element.name == null )
+ return "";
+
+ GLib.StringBuilder str = new GLib.StringBuilder ( "" );
+
+ for ( var pos = element; pos != null ; pos = pos.parent ) {
+ str.prepend ( pos.name );
+ if ( pos.parent is File || pos.parent.name == null )
+ return str.str;
+ else
+ str.prepend_unichar ( '.' );
+ }
+ return str.str;
+}
+
+
+
+
+public class Valadoc.LangletIndex : Valadoc.Langlet, Valadoc.LinkHelper {
+ public Valadoc.Settings settings {
+ construct set;
+ protected get;
+ }
+
+ public LangletIndex ( Settings settings ) {
+ this.settings = settings;
+ }
+
+ private Basic position = null;
+
+ 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.FileStream file ) {
+ if ( datatype == null ) {
+ file.printf ( "<font class=\"%s\">void</font>", css_keyword );
+ return ;
+ }
+
+ string typename = get_full_name ( datatype );
+ if ( datatype.parent.name == null && (datatype is Class || datatype is Struct) ) {
+ if ( this.is_basic_type ( typename ) ) {
+ string link = this.get_link( datatype );
+ if ( link == null )
+ file.printf ( "<span class=\"%s\">%s</span>", css_basic_type, typename );
+ else
+ file.printf ( "<a class=\"%s\" href=\"%s\">%s</a>", css_basic_type, link, typename );
+ return ;
+ }
+ }
+
+ string link = this.get_link( datatype );
+ if ( link == null )
+ file.printf ( "<span class=\"%s\">%s</span>", css_other_type, typename );
+ else
+ file.printf ( "<a class=\"%s\" href=\"%s\">%s</a>", css_other_type, link, typename );
+ }
+
+ private void write_type_reference_name ( TypeReference type_reference, GLib.FileStream file ) {
+ if ( type_reference.type_name == "void" ) {
+ file.printf ( "<font class=\"%s\">void</font>", css_keyword );
+ }
+ else {
+ if ( type_reference.data_type == null ) {
+ file.printf ( "<font class=\"%s\">%s</font>", css_other_type, type_reference.type_name );
+ }
+ else {
+ this.write_type_name ( type_reference.data_type, file );
+ }
+ }
+ }
+
+ private void write_type_reference_template_arguments ( Valadoc.TypeReference type_reference, GLib.FileStream file ) {
+ Gee.Collection<TypeReference> arglst = type_reference.get_type_arguments ( );
+ int size = arglst.size;
+ if ( size == 0 )
+ return ;
+
+ file.puts ( "<" );
+ int i = 0;
+
+ foreach ( TypeReference arg in arglst ) {
+ i++;
+
+ this.write_nested_type_referene ( arg, file );
+ if ( i != size )
+ file.puts ( ", " );
+ }
+
+ file.puts ( ">" );
+ }
+
+ private void write_nested_type_referene ( Valadoc.TypeReference type_reference, GLib.FileStream file ) {
+ if ( type_reference.type_name == null )
+ return ;
+
+ if ( type_reference.is_weak )
+ file.printf ( "<font class=\"%s\">weak</font> ", css_keyword );
+
+ this.write_type_reference_name ( type_reference, file );
+ this.write_type_reference_template_arguments ( type_reference, 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 );
+
+ }
+
+ public override void write_type_reference ( Valadoc.TypeReference type_reference, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ if ( type_reference == null )
+ return ;
+
+ this.write_nested_type_referene ( type_reference, file );
+ file.putc ( ' ' );
+
+ /*
+ if ( type_reference.is_weak ) {
+ file.printf ( "<font class=\"%s\">weak</font> ", 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.FileStream file ) {
+ if ( param.ellipsis ) {
+ file.puts ( " ..." );
+ }
+ else {
+ if ( param.is_out )
+ file.printf ( "<span class=\"%s\">out</span> ", css_keyword );
+ else if ( param.is_ref )
+ file.printf ( "<span class=\"%s\">ref</span> ", css_keyword );
+
+ this.write_type_reference ( param.type_reference, file );
+ file.printf ( " %s", param.name );
+ }
+ }
+
+ public override void write_parameter_list ( ParameterListHandler thandler, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ bool open_bracket = false;
+
+ Gee.ArrayList<FormalParameter> params = thandler.param_list;
+ int size = params.size;
+ int i = 0;
+
+ file.putc ( '(' );
+
+ foreach ( FormalParameter param in params ) {
+ i++;
+
+ if ( param.default_value != null && open_bracket == false ) {
+ file.printf ( "<span class=\"%s\">[", css_optional_parameter );
+ open_bracket = true;
+ }
+
+ this.write_formal_parameter ( param, file );
+ if ( i != size ) {
+ file.puts ( ", " );
+ }
+ else if ( open_bracket == true ) {
+ file.puts ( "]</span>" );
+ }
+ }
+
+ file.putc ( ')' );
+ }
+
+ private void write_exception_list ( ExceptionHandler exception_handler, GLib.FileStream file ) {
+ Gee.ReadOnlyCollection<TypeReference> error_domains = exception_handler.get_error_domains ();
+ int size = error_domains.size;
+ int i = 1;
+
+ if ( size == 0 )
+ return ;
+
+ file.printf ( " <span class=\"%s\">throws</span> ", css_keyword );
+
+ foreach ( TypeReference type_reference in error_domains ) {
+ this.write_type_reference ( type_reference, file );
+ if ( error_domains.size > i ) {
+ file.puts ( ", " );
+ }
+ i++;
+ }
+ }
+
+ public override void write_method ( void* ptr, Valadoc.Method m, Valadoc.MethodHandler parent ) {
+ this.position = m;
+
+ GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ this.write_accessor ( m, file );
+
+ if ( m.is_abstract )
+ modifiers.append ( " abstract" );
+ if ( m.is_virtual )
+ modifiers.append ( " virtual" );
+ if ( m.is_override )
+ modifiers.append ( " override" );
+ if ( m.is_static )
+ modifiers.append ( " static" );
+ if ( m.is_inline )
+ modifiers.append ( " inline" );
+
+ file.printf ( " <span class=\"%s\">%s</span> ", css_keyword, modifiers.str );
+ this.write_type_reference ( m.return_type, file );
+ file.puts ( m.name );
+ this.write_parameter_list ( m, file );
+ this.write_exception_list ( m, file );
+ }
+
+ public override void write_type_parameter ( TypeParameter param, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ file.puts ( param.datatype_name );
+ }
+
+ public override void write_template_parameters ( TemplateParameterListHandler thandler, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ int i = 1;
+
+ var lst = thandler.get_template_param_list( );
+ if ( lst.size == 0 )
+ return ;
+
+ file.puts ( "<" ); // <
+
+
+ foreach ( TypeParameter param in lst ) {
+ param.write ( this, file );
+ if ( lst.size > i )
+ file.puts ( ", " );
+
+ i++;
+ }
+ file.puts ( ">" ); // >
+ }
+
+ public override void write_field ( Valadoc.Field field, Valadoc.FieldHandler parent, void* ptr ) {
+ this.position = field;
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ this.write_accessor ( field, file );
+
+ if ( field.is_volatile )
+ file.printf ( " <span class=\"%s\">volatile</span>", css_keyword );
+
+ this.write_type_reference ( field.type_reference, file );
+
+ file.printf ( " %s", field.name );
+ }
+
+ public override void write_constant ( Constant constant, ConstantHandler parent, void* ptr ) {
+ this.position = constant;
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ this.write_accessor ( constant, file );
+ file.printf ( " <span class=\"%s\"> const </span>", css_keyword );
+ this.write_type_reference ( constant.type_reference, file );
+ file.printf ( " %s", constant.name );
+ }
+
+ public override void write_property_accessor ( Valadoc.PropertyAccessor propac, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ Property prop = (Property)propac.parent;
+
+ 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 ( "<span class=\"%s\">public</span> ", css_keyword );
+ else if ( propac.is_protected )
+ file.printf ( "<span class=\"%s\">protected</span> ", css_keyword );
+ else if ( propac.is_private )
+ file.printf ( "<span class=\"%s\">private</span> ", css_keyword );
+ }
+
+
+ if ( propac.is_get ) {
+ file.printf ( "<span class=\"%s\"> get</span>;", css_keyword );
+ }
+ else if ( propac.is_set ) {
+ if ( propac.is_construct ) {
+ file.printf ( "<span class=\"%s\"> construct</span> ", css_keyword );
+ }
+
+ file.printf ( "<span class=\"%s\"> set</span>;", css_keyword );
+ }
+ }
+
+ public override void write_property ( Valadoc.Property prop, void* ptr ) {
+ this.position = prop;
+ GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ this.write_accessor ( prop, file );
+
+ if ( prop.is_virtual )
+ modifiers.append ( " virtual " );
+ if ( prop.is_abstract )
+ modifiers.append ( " abstract " );
+ if ( prop.is_override )
+ modifiers.append ( " override " );
+
+
+ this.write_type_reference ( prop.return_type, file );
+ file.printf ( " <span class=\"%s\">%s</span>%s { ", css_keyword, modifiers.str, prop.name );
+
+ if ( prop.setter != null )
+ this.write_property_accessor ( prop.setter, file );
+
+
+ file.printf ( " " );
+
+ if ( prop.getter != null )
+ this.write_property_accessor ( prop.getter, file );
+
+ file.printf ( " }" );
+ }
+
+ public override void write_signal ( Valadoc.Signal sig, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ this.position = sig;
+
+ this.write_accessor ( sig, file );
+
+ file.printf ( " <span class=\"%s\">signal</span> ", css_keyword );
+ this.write_type_reference ( sig.return_type, file );
+ file.printf ( " %s ", sig.name );
+ this.write_parameter_list ( sig, file );
+ }
+
+ 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 ) {
+ GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ this.position = del;
+
+ this.write_accessor ( del, file );
+
+ file.printf ( " <span class=\"%s\">delegate</span> ", css_keyword );
+ this.write_type_reference ( del.return_type, file );
+ file.printf ( " %s ", del.name );
+ this.write_parameter_list ( del, file );
+ this.write_exception_list ( del, file );
+ }
+
+ 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.FileStream file ) {
+ if ( element.is_public )
+ file.printf ( "<span class=\"%s\">public</span> ", css_keyword );
+ else if ( element.is_protected )
+ file.printf ( "<span class=\"%s\">protected</span> ", css_keyword );
+ else if ( element.is_private )
+ file.printf ( "<span class=\"%s\">private</span> ", css_keyword );
+ }
+
+
+ public override void write_struct ( Valadoc.Struct stru, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ this.position = stru;
+
+ this.write_accessor ( stru, file );
+ file.printf ( "<span class=\"%s\">struct</span> %s", css_keyword, stru.name );
+ this.write_template_parameters ( stru, ptr );
+ this.write_inheritance_list ( stru, file );
+ }
+
+ private void write_inheritance_list ( Valadoc.ContainerDataType dtype, GLib.FileStream file ) {
+ Gee.Collection<DataType> lst = dtype.get_parent_types ( );
+ int size = lst.size;
+ int i = 1;
+
+ if ( size == 0 )
+ return ;
+
+ file.puts ( " : " );
+
+ foreach ( DataType cntype in lst ) {
+ this.write_type_name ( cntype, file );
+ if ( size > i )
+ file.puts ( ", " );
+
+ i++;
+ }
+
+ file.putc ( ' ' );
+ }
+
+ public override void write_class ( Valadoc.Class cl, void* ptr ) {
+ GLib.StringBuilder modifiers = new GLib.StringBuilder ( "" );
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ this.position = cl;
+
+ this.write_accessor ( cl, file );
+
+ if ( cl.is_abstract )
+ modifiers.append ( "abstract " );
+ else if ( cl.is_static )
+ modifiers.append ( "static " );
+
+ file.printf ( "<span class=\"%s\">%s class</span> %s", css_keyword, modifiers.str, cl.name );
+
+ this.write_template_parameters ( cl, file );
+ this.write_inheritance_list ( cl, file );
+ }
+
+ public override void write_interface ( Valadoc.Interface iface, void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+ this.position = iface;
+
+ this.write_accessor ( iface, file );
+
+ if ( iface.is_static )
+ file.printf ( "<span class=\"%s\">static interface</span> %s", css_keyword, iface.name );
+ else
+ file.printf ( "<span class=\"%s\">interface</span> %s", css_keyword, iface.name );
+
+ this.write_template_parameters ( iface, ptr );
+ this.write_inheritance_list ( iface, file );
+ }
+
+ public override void write_namespace ( Valadoc.Namespace ns, void* ptr ) {
+ }
+
+ public override void write_file ( Valadoc.File file, void* ptr ) {
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+public class Valadoc.HtmlDoclet : Valadoc.Doclet, Valadoc.LinkHelper {
+ private Valadoc.LangletIndex langlet;
+
+ private string current_path = null;
+ private bool is_vapi = false;
+
+
+
+ // xml:
+ private Xml.Doc devhelp = null;
+ private Xml.Node* functions = null;
+ private Xml.Node* chapters = null;
+ private Xml.Node* current = null;
+
+ private void devhelp_add_chapter_start () {
+ }
+
+ private void devhelp_add_chapter () {
+ }
+
+ private void devhelp_add_chapter_end () {
+ }
+
+
+ private enum KeywordType {
+ NAMESPACE = 0,
+ CLASS = 1,
+ DELEGATE = 2,
+ INTERFACE = 3,
+ ERRORDOMAIN = 4,
+
+ CONSTANT = 5,
+ ENUM = 6,
+ FUNCTION = 7,
+ MACRO = 8,
+ PROPERTY = 9,
+ SIGNAL = 10,
+ STRUCT = 11,
+ TYPEDEF = 12,
+ UNION = 13,
+ VARIABLE = 14,
+ UNSET = 15
+ }
+
+ private const string[] keyword_type_strings = {
+ "", // namespace
+ "", // class
+ "", // delegate
+ "", // interface
+ "", // errordomain
+ "constant",
+ "enum",
+ "function",
+ "macro",
+ "property",
+ "signal",
+ "struct",
+ "typedef",
+ "union",
+ "variable",
+ ""
+ };
+
+ private void devhelp_add_keyword ( KeywordType type, string name, string link ) {
+ Xml.Node* keyword = this.functions->new_child ( null, "keyword" );
+ keyword->new_prop ( "type", keyword_type_strings[(int)type] );
+ keyword->new_prop ( "name", name );
+ keyword->new_prop ( "link", link );
+ }
+
+
+ private string get_full_path ( Basic element ) {
+ if ( element.name == null )
+ return "";
+
+ GLib.StringBuilder str = new GLib.StringBuilder ( "" );
+
+ for ( var pos = element; pos != null ; pos = pos.parent ) {
+ if ( pos is File )
+ break;
+
+ str.prepend_unichar ( '/' );
+
+ if ( pos.name == null )
+ str.prepend ( "0" );
+ else
+ str.prepend ( pos.name );
+ }
+
+ string file_path = get_file_name ( element );
+ string package_name = get_package_name ( file_path ) + "/";
+
+ str.prepend ( package_name );
+ str.append_unichar ( '/' );
+ return str.str;
+ }
+
+ public Valadoc.Settings settings {
+ construct set;
+ protected get;
+ }
+
+ public override void initialisation ( Settings settings ) {
+ this.settings = settings;
+
+ var rt = DirUtils.create ( this.settings.path, 0777 );
+ this.langlet = new Valadoc.LangletIndex ( settings );
+
+ this.devhelp = new Xml.Doc ( "1.0" );
+ this.devhelp.encoding = "utf-8";
+ this.devhelp.standalone = 0;
+
+
+ Xml.Node* root = new Xml.Node ( null, "book" ); // may cause an crash; string#
+ this.devhelp.set_root_element( root );
+ root->new_prop ( "xmlns", "http://www.devhelp.net/book" );
+ root->new_prop ( "title", "GLib Reference Manual" ); // >>> Change the title!
+ root->new_prop ( "link", "index.html" );
+ root->new_prop ( "author", "" );
+ root->new_prop ( "name", "glib" ); // >>> name
+ root->new_prop ( "version", "2" ); // >>> version
+
+ this.current = root->new_child ( null, "chapters" );
+ this.functions = root->new_child ( null, "functions" );
+ this.chapters = this.current;
+ }
+
+ private void write_image_block ( GLib.FileStream file, DataType element ) {
+ string realimgpath = this.current_path + "tree.png";
+ string imgpath = "docs/" + get_full_path ( element ) + "tree.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 );
+ }
+
+ file.printf ( "<h2 cass=\"%s\">Object Hierarchy:</h2>\n", css_title );
+ file.printf ( "<img cass=\"%s\" src=\"%s\"/>\n", css_diagram, imgpath );
+ }
+
+ public override void visit_file ( File file ) {
+ string package_name = this.get_package_name ( file.name );
+ this.is_vapi = file.name.has_suffix (".vapi");
+
+ string new_path = this.settings.path + package_name + "/";
+ bool dir_exists = FileUtils.test ( new_path, FileTest.EXISTS);
+
+ if ( !dir_exists ) {
+ var rt = DirUtils.create ( new_path, 0777 );
+ }
+
+
+ this.current_path = new_path;
+ file.visit_namespaces ( this );
+ this.current_path = null;
+ }
+
+ public void write_namespace_content ( GLib.FileStream file, Namespace ns ) {
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, (ns.name == null)? "Global Namespace" : ns.full_name() );
+ file.printf ( "<hr class=\"%s\" />\n", css_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ ns.write_comment ( file );
+ }
+
+ public override void visit_namespace ( Namespace ns ) {
+ string old_path = this.current_path;
+
+ if ( ns.name == null ) {
+ string tmp = this.current_path + "0/";
+ this.current_path = tmp;
+ }
+ else {
+ string tmp = this.current_path + ns.name + "/";
+ this.current_path = tmp;
+ }
+
+ bool dir_exists = FileUtils.test ( this.current_path, FileTest.EXISTS);
+ if ( !dir_exists ) {
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w" );
+ this.write_namespace_content ( file, ns );
+ file = null;
+ }
+
+
+ // file:
+ ns.visit_namespaces ( this );
+ ns.visit_enums ( this );
+ ns.visit_error_domains ( this );
+ ns.visit_structs ( this );
+ ns.visit_interfaces ( this );
+ ns.visit_classes ( this );
+ ns.visit_delegates ( this );
+ ns.visit_constants ( this );
+ ns.visit_fields ( this );
+ ns.visit_methods ( this );
+
+ this.current_path = old_path;
+ }
+
+ private void write_child_classes ( GLib.FileStream file, ClassHandler clh ) {
+ Gee.ReadOnlyCollection<Class> classes = clh.get_class_list ();
+ if ( classes.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Classes:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Class subcl in classes ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_class, css_navi_link, this.get_link(subcl), subcl.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_enums ( GLib.FileStream file, EnumHandler eh ) {
+ Gee.Collection<Enum> enums = eh.get_enum_list ();
+ if ( enums.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Enums:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Enum en in enums ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_enum, css_navi_link, this.get_link(en), en.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_structs ( GLib.FileStream file, StructHandler struh ) {
+ Gee.Collection<Struct> structs = struh.get_struct_list ();
+ if ( structs.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Structs:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Struct stru in structs ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_struct, css_navi_link, this.get_link(stru), stru.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_methods ( GLib.FileStream file, MethodHandler mh ) {
+ Gee.ReadOnlyCollection<Method> methods = mh.get_method_list ();
+ if ( methods.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Methods:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Method m in methods ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_method, css_navi_link, this.get_link(m), m.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_delegates ( GLib.FileStream file, DelegateHandler dh ) {
+ Gee.Collection<Delegate> delegates = dh.get_delegate_list ();
+ if ( delegates.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Delegates:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Delegate d in delegates ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_delegate, css_navi_link, this.get_link(d), d.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_construction_methods ( GLib.FileStream file, ConstructionMethodHandler cmh ) {
+ Gee.ReadOnlyCollection<Method> methods = cmh.get_construction_method_list ();
+ if ( methods.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Construction Methods:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Method m in methods ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_method, css_navi_link, this.get_link(m), m.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_signals ( GLib.FileStream file, SignalHandler sh ) {
+ Gee.ReadOnlyCollection<Signal> signals = sh.get_signal_list ();
+ if ( signals.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Signals:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Signal sig in signals ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_signal, css_navi_link, this.get_link(sig), sig.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_properties ( GLib.FileStream file, PropertyHandler ph ) {
+ Gee.ReadOnlyCollection<Property> properties = ph.get_property_list ();
+ if ( properties.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Properties:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Property prop in properties ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_property, css_navi_link, this.get_link(prop), prop.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_fields ( GLib.FileStream file, FieldHandler fh ) {
+ Gee.ReadOnlyCollection<Field> fields = fh.get_field_list ();
+ if ( fields.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Fields:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Field f in fields ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_fields, css_navi_link, this.get_link(f), f.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_constants ( GLib.FileStream file, ConstantHandler ch ) {
+ Gee.ReadOnlyCollection<Constant> constants = ch.get_constant_list ();
+ if ( constants.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Constants:</h3>\n", css_title );
+ file.printf ( "<ul class=\"%s\">\n", css_inline_navigation );
+ foreach ( Constant c in constants ) {
+ file.printf ( "\t<li class=\"%s\"><a class=\"%s\" href=\"%s\">%s</a></li>\n", css_inline_navigation_constant, css_navi_link, this.get_link(c), c.name );
+ }
+ file.puts ( "</ul>\n" );
+ }
+ }
+
+ private void write_child_error_values ( GLib.FileStream file, ErrorDomain errdom ) {
+ Gee.ReadOnlyCollection<ErrorCode> error_codes = errdom.get_error_code_list ();
+ if ( error_codes.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Error Codes:</h3>\n", css_title );
+ file.printf ( "<table class=\"%s\">\n", css_errordomain_table );
+ foreach ( ErrorCode errcode in error_codes ) {
+ file.puts ( "<tr>\n" );
+ file.printf ( "\t<td class=\"%s\" id=\"%s\">%s</td>\n", css_errordomain_table_name, errcode.name, errcode.name );
+ file.printf ( "\t<td class=\"%s\">\n", css_errordomain_table_text );
+
+ errcode.write_comment ( file );
+
+ file.puts ( "\t</td>\n" );
+ file.puts ( "</tr>\n" );
+ }
+ file.puts ( "</table>\n" );
+ }
+ }
+
+ private void write_child_enum_values ( GLib.FileStream file, Enum en ) {
+ Gee.ReadOnlyCollection<EnumValue> enum_values = en.get_enum_values ();
+ if ( enum_values.size > 0 ) {
+ file.printf ( "<h3 class=\"%s\">Enum Values:</h3>\n", css_title );
+ file.printf ( "<table class=\"%s\">\n", css_enum_table );
+ foreach ( EnumValue enval in enum_values ) {
+ file.puts ( "<tr>\n" );
+ file.printf ( "\t<td class=\"%s\" id=\"%s\">%s</td>\n", css_enum_table_name, enval.name, enval.name );
+ file.printf ( "\t<td class=\"%s\">\n", css_enum_table_text );
+
+ enval.write_comment ( file );
+
+ file.puts ( "\t</td>\n" );
+ file.puts ( "</tr>\n" );
+ }
+ file.puts ( "</table>\n" );
+ }
+ }
+
+ public void write_interface_content ( GLib.FileStream file, Interface iface ) {
+ string full_name = get_full_name ( iface );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+
+ this.write_image_block ( file, iface );
+
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ iface.write_comment ( file );
+ this.write_namespace_note ( file, iface );
+ this.write_package_note ( file, iface );
+ file.printf ( "\n<h2 class=\"%s\">Content:</h2>\n", css_title );
+
+ this.write_child_classes ( file, iface );
+ this.write_child_structs ( file, iface );
+ this.write_child_delegates ( file, iface );
+ this.write_child_fields ( file, iface );
+ this.write_child_properties ( file, iface );
+ this.write_child_signals ( file, iface );
+ this.write_child_methods ( file, iface );
+ }
+
+ public override void visit_interface ( Interface iface ) {
+ string old_path = this.current_path;
+ this.current_path += iface.name + "/";
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ iface.visit_properties ( this );
+ iface.visit_delegates ( this );
+ iface.visit_signals ( this );
+ iface.visit_methods ( this );
+ iface.visit_structs ( this );
+ iface.visit_fields ( this );
+ iface.visit_structs ( this );
+ iface.visit_classes ( this );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w");
+ this.write_interface_content ( file, iface );
+ file = null;
+
+ this.current_path = old_path;
+ }
+
+ public void write_class_content ( GLib.FileStream file, Class cl ) {
+ string full_name = get_full_name ( cl );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+
+ this.write_image_block ( file, cl );
+
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_class ( cl, file );
+ file.printf ( "\n</div>\n" );
+ cl.write_comment ( file );
+ this.write_namespace_note ( file, cl );
+ this.write_package_note ( file, cl );
+ file.printf ( "\n<h2 class=\"%s\">Content:</h2>\n", css_title );
+ this.write_child_construction_methods ( file, cl );
+ this.write_child_enums ( file, cl );
+ this.write_child_classes ( file, cl );
+ this.write_child_structs ( file, cl );
+ this.write_child_delegates ( file, cl );
+ this.write_child_constants ( file, cl );
+ this.write_child_fields ( file, cl );
+ this.write_child_properties ( file, cl );
+ this.write_child_signals ( file, cl );
+ this.write_child_methods ( file, cl );
+ }
+
+ public override void visit_class ( Class cl ) {
+ string old_path = this.current_path;
+ this.current_path += cl.name + "/";
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ cl.visit_enums ( this );
+ cl.visit_classes ( this );
+ cl.visit_structs ( this );
+ cl.visit_delegates ( this );
+ cl.visit_constants ( this );
+ cl.visit_construction_methods ( this );
+ cl.visit_methods ( this );
+ cl.visit_fields ( this );
+ cl.visit_properties ( this );
+ cl.visit_signals ( this );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w");
+ this.write_class_content ( file, cl );
+ file = null;
+
+ this.current_path = old_path;
+ }
+
+ public void write_struct_content ( GLib.FileStream file, Struct stru ) {
+ string full_name = get_full_name ( stru );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+
+ this.write_image_block ( file, stru );
+
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ stru.write_comment ( file );
+ this.write_namespace_note ( file, stru );
+ this.write_package_note ( file, stru );
+ file.printf ( "\n<h2 class=\"%s\">Content:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_struct ( stru, file );
+ file.printf ( "\n</div>\n" );
+
+ this.write_child_construction_methods ( file, stru );
+ this.write_child_constants ( file, stru );
+ this.write_child_fields ( file, stru );
+ this.write_child_methods ( file, stru );
+ }
+
+ public override void visit_struct ( Struct stru ) {
+ string old_path = this.current_path;
+ this.current_path += stru.name + "/";
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ stru.visit_constants ( this );
+ stru.visit_fields ( this );
+ stru.visit_construction_methods ( this );
+ stru.visit_methods ( this );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w");
+ this.write_struct_content ( file, stru );
+ file = null;
+
+ this.current_path = old_path;
+ }
+
+ public void write_error_domain_content ( GLib.FileStream file, ErrorDomain errdom ) {
+ string full_name = get_full_name ( errdom );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ errdom.write_comment ( file );
+ this.write_namespace_note ( file, errdom );
+ this.write_package_note ( file, errdom );
+ file.printf ( "\n<h2 class=\"%s\">Content:</h2>\n", css_title );
+ this.write_child_error_values ( file, errdom );
+ this.write_child_methods ( file, errdom );
+ }
+
+ public override void visit_error_domain ( ErrorDomain errdom ) {
+ string old_path = this.current_path;
+ this.current_path += errdom.name + "/";
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ errdom.visit_methods ( this );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w");
+ this.write_error_domain_content ( file, errdom );
+ file = null;
+
+ this.current_path = old_path;
+ }
+
+ public void write_enum_content ( GLib.FileStream file, Enum en ) {
+ string full_name = get_full_name ( en );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ en.write_comment ( file );
+ this.write_namespace_note ( file, en );
+ this.write_package_note ( file, en );
+ file.printf ( "\n<h2 class=\"%s\">Content:</h2>\n", css_title );
+ this.write_child_enum_values ( file, en );
+ this.write_child_methods ( file, en );
+ }
+
+ public override void visit_enum ( Enum en ) {
+ string old_path = this.current_path;
+ this.current_path += en.name + "/";
+ var rt = DirUtils.create ( this.current_path, 0777 );
+
+ en.visit_enum_values ( this );
+ en.visit_methods ( this );
+
+ GLib.FileStream file = GLib.FileStream.open ( this.current_path + "index.html", "w");
+ this.write_enum_content ( file, en );
+ file = null;
+
+ this.current_path = old_path;
+ }
+
+ public void write_property_content ( GLib.FileStream file, Property prop ) {
+ string full_name = get_full_name ( prop );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_property ( prop, file );
+ file.printf ( "\n</div>\n" );
+ prop.write_comment ( file );
+ }
+
+ private void write_package_note ( GLib.FileStream file, Basic element ) {
+ string package = element.package;
+ if ( package == null )
+ return ;
+
+ file.printf ( "\n\n<br />\n<b>Package:</b> %s\n\n", package );
+ }
+
+ private void write_namespace_note ( GLib.FileStream file, Basic element ) {
+ for ( ; element is Namespace == false; element = element.parent )
+ ;
+
+ if ( element.parent == null )
+ return ;
+
+ if ( element.name == null )
+ return ;
+
+ file.printf ( "\n\n<br />\n<b>Namespace:</b> %s\n\n", element.full_name() );
+ }
+
+ public override void visit_property ( Property prop ) {
+ string path = this.current_path + prop.name + "/";
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ this.write_property_content ( file, prop );
+ file = null;
+ }
+
+ public void write_constant_content ( GLib.FileStream file, Constant constant, ConstantHandler parent ) {
+ string full_name = get_full_name ( constant );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_constant ( constant, parent, file );
+ file.printf ( "\n</div>\n" );
+ constant.write_comment ( file );
+ if ( constant.parent is Namespace ) {
+ this.write_namespace_note ( file, constant );
+ this.write_package_note ( file, constant );
+ }
+ }
+
+ public override void visit_constant ( Constant constant, ConstantHandler parent ) {
+ string path = this.current_path + constant.name + "/";
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ this.write_constant_content ( file, constant, parent );
+ file = null;
+ }
+
+ public void write_field_content ( GLib.FileStream file, Field field, FieldHandler parent ) {
+ string full_name = get_full_name ( field );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_field ( field, parent, file );
+ file.printf ( "\n</div>\n" );
+ field.write_comment ( file );
+ if ( field.parent is Namespace ) {
+ this.write_namespace_note ( file, field );
+ this.write_package_note ( file, field );
+ }
+ }
+
+ public override void visit_field ( Field field, FieldHandler parent ) {
+ string path = this.current_path + field.name + "/";
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ this.write_field_content ( file, field, parent );
+ file = null;
+ }
+
+ public override void visit_error_code ( ErrorCode errcode ) {
+ }
+
+ public override void visit_enum_value ( EnumValue enval ) {
+ }
+
+ public void write_delegate_content ( GLib.FileStream file, Delegate del ) {
+ string full_name = get_full_name ( del );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_delegate ( del, file );
+ file.printf ( "\n</div>\n" );
+ del.write_comment ( file );
+ if ( del.parent is Namespace ) {
+ this.write_namespace_note ( file, del );
+ this.write_package_note ( file, del );
+ }
+ }
+
+ public override void visit_delegate ( Delegate del ) {
+ string path = this.current_path + del.name + "/";
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ this.write_delegate_content ( file, del );
+ file = null;
+ }
+
+ public void write_signal_content ( GLib.FileStream file, Signal sig ) {
+ string full_name = get_full_name ( sig );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_signal ( sig, file );
+ file.printf ( "\n</div>\n" );
+ sig.write_comment ( file );
+ }
+
+ public override void visit_signal ( Signal sig ) {
+ string path = this.current_path + sig.name + "/";
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ write_signal_content ( file, sig );
+ file = null;
+ }
+
+ public void write_method_content ( GLib.FileStream file, Method m , Valadoc.MethodHandler parent ) {
+ string full_name = get_full_name ( m );
+ file.printf ( "<h1 class=\"%s\">%s:</h1>\n", css_title, full_name );
+ file.printf ( "<hr class=\"%s\" />\n", css_headline_hr );
+ file.printf ( "<h2 class=\"%s\">Description:</h2>\n", css_title );
+ file.printf ( "<div class=\"%s\">\n\t", css_code_definition );
+ this.langlet.write_method ( file, m, parent );
+ file.printf ( "\n</div>\n" );
+ m.write_comment ( file );
+ if ( m.parent is Namespace ) {
+ this.write_namespace_note ( file, m );
+ this.write_package_note ( file, m );
+ }
+ }
+
+ public override void visit_method ( Method m, Valadoc.MethodHandler parent ) {
+ string path = this.current_path + m.name + "/";
+ string full_name = get_full_name ( m );
+ var rt = DirUtils.create ( path, 0777 );
+
+ GLib.FileStream file = GLib.FileStream.open ( path + "index.html", "w");
+ this.write_method_content ( file, m, parent );
+ file = null;
+ }
+}
+
+
+
+
+
+[ModuleInit]
+public Type register_plugin ( ) {
+ return typeof ( Valadoc.HtmlDoclet );
+}
+
Added: trunk/src/doclets/devhelp/linkhelper/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/linkhelper/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,44 @@
+# 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 ../../../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/ \
+ $(LIBVALA_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(NULL)
+
+
+libhtmlhelper_la_LIBADD = \
+ ../../../libvaladoc/libvaladoc.la \
+ $(LIBVALA_LIBS) \
+ $(GLIB_LIBS) \
+ $(NULL)
+
+
+EXTRA_DIST = $(libhtmlhelper_VALASOURCES) libhtmlhelper.vala.stamp
Added: trunk/src/doclets/devhelp/linkhelper/helper.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/linkhelper/helper.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,169 @@
+/*
+ * 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;
+
+
+
+/* css-class-names: */
+public const string css_inline_navigation = "main_inline_navigation";
+public const string css_inline_navigation_property = "main_inline_navigation_property";
+public const string css_inline_navigation_method = "main_inline_navigation_method";
+public const string css_inline_navigation_signal = "main_inline_navigation_signal";
+public const string css_inline_navigation_fields = "main_inline_navigation_fields";
+public const string css_inline_navigation_class = "main_inline_navigation_class";
+public const string css_inline_navigation_enum = "main_inline_navigation_enum";
+public const string css_inline_navigation_struct = "main_inline_navigation_struct";
+public const string css_inline_navigation_delegate = "main_inline_navigation_delegate";
+public const string css_inline_navigation_constant = "main_inline_navigation_constant";
+
+public const string css_navi_package_index = "navi_package_index";
+public const string css_navi_package = "navi_package";
+public const string css_navi_construction_method = "navi_construction_method";
+public const string css_navi_error_domain = "navi_error_domain";
+public const string css_navi_namespace = "navi_namespace";
+public const string css_navi_method = "navi_method";
+public const string css_navi_struct = "navi_struct";
+public const string css_navi_iface = "navi_iface";
+public const string css_navi_field = "navi_field";
+public const string css_navi_class = "navi_class";
+public const string css_navi_enum = "navi_enum";
+public const string css_navi_link = "navi_link";
+public const string css_navi_constant = "navi_constant";
+public const string css_navi_prop = "navi_prop";
+public const string css_navi_del = "navi_del";
+public const string css_navi_sig = "navi_sig";
+public const string css_navi = "navi_main";
+public const string css_navi_enval = "main_navi_enval";
+public const string css_navi_errdomcode = "main_navi_errdomcode";
+public const string css_navi_hr = "navi_hr";
+
+public const string css_errordomain_table_name = "main_errordomain_table_name";
+public const string css_errordomain_table_text = "main_errordomain_table_text";
+public const string css_errordomain_table = "main_errordomain_table";
+
+
+public const string css_enum_table_name = "main_enum_table_name";
+public const string css_enum_table_text = "main_enum_table_text";
+public const string css_enum_table = "main_enum_table";
+
+public const string css_diagram = "main_diagram";
+public const string css_see_list = "main_see_list";
+public const string css_exception_table = "main_parameter_table";
+public const string css_parameter_table_text = "main_parameter_table_text";
+public const string css_parameter_table_name = "main_parameter_table_name";
+public const string css_parameter_table = "main_parameter_table";
+public const string css_title = "main_title";
+public const string css_other_type = "main_other_type";
+public const string css_basic_type = "main_basic_type";
+public const string css_keyword = "main_keyword";
+public const string css_optional_parameter = "main_optional_parameter";
+public const string css_code_definition = "main_code_definition";
+public const string css_headline_hr = "main_hr";
+public const string css_hr = "main_hr";
+public const string css_list_errdom = "main_list_errdom";
+public const string css_list_en = "main_list_en";
+public const string css_list_ns = "main_list_ns";
+public const string css_list_cl = "main_list_cl";
+public const string css_list_iface = "main_list_iface";
+public const string css_list_stru = "main_list_stru";
+public const string css_list_field = "main_list_field";
+public const string css_list_prop = "main_list_prop";
+public const string css_list_del = "main_list_del";
+public const string css_list_sig = "main_list_sig";
+public const string css_list_m = "main_list_m";
+
+public interface Valadoc.LinkHelper : Object {
+ private static string package_name = null;
+
+ public abstract Settings settings {
+ construct set;
+ get;
+ }
+
+ private string get_dirname ( string file_name ) {
+ if ( file_name[file_name.len()-1] == '/' )
+ return GLib.Path.get_dirname ( file_name );
+ else
+ return GLib.Path.get_basename ( file_name );
+ }
+
+ protected string get_package_name ( string file_path ) {
+ if ( file_path.has_suffix (".vapi") ) {
+ string file_name = GLib.Path.get_basename (file_path);
+ return file_name.ndup ( file_name.size() - ".vapi".size() );
+ }
+
+ if ( this.package_name == null ) {
+ string file_name = this.get_dirname( settings.path );
+ this.package_name = file_name; //file_name.ndup ( file_name.size() - ".vala".size() );
+ }
+
+ return this.package_name;
+ }
+
+ public string get_file_name ( Valadoc.Basic tag ) {
+ Valadoc.Basic pos = tag;
+
+ while ( pos != null ) {
+ if ( pos is Valadoc.File )
+ return pos.name;
+
+ pos = pos.parent;
+ }
+ return null;
+ }
+
+ protected string? get_link ( Valadoc.Basic tag ) {
+// if ( !this.settings.to_doc( tag.file_name ) )
+// return null;
+
+ GLib.StringBuilder str = new GLib.StringBuilder ( "" );
+ Valadoc.Basic pos = tag;
+
+ if ( tag is Valadoc.File == false ) {
+ if ( tag is Valadoc.EnumValue || tag is Valadoc.ErrorCode ) {
+ str.append_unichar ( '#' );
+ str.append ( tag.name );
+ pos = pos.parent;
+ }
+
+ while ( pos != null ) {
+ if ( pos.name == null )
+ str.prepend ( "0" );
+ else
+ str.prepend ( pos.name );
+
+ str.prepend ( "::" );
+
+ if ( pos.parent is Valadoc.File )
+ break;
+
+ pos = pos.parent;
+ }
+ }
+ string filename = this.get_file_name ( tag );
+ string package_name = this.get_package_name ( filename );
+ str.prepend ( package_name );
+ str.prepend ( "?path=" );
+ return str.str;
+ }
+}
+
+
Added: trunk/src/doclets/devhelp/taglets/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,16 @@
+# src/Makefile.am
+
+NULL =
+
+
+SUBDIRS = \
+ see \
+ link \
+ return \
+ string \
+ throws \
+ version \
+ parameter \
+ $(NULL)
+
+
Added: trunk/src/doclets/devhelp/taglets/author/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/author/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletversion_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletversion.vala.stamp
+
+
+libtagletversion.vala.stamp: $(libtagletversion_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletversiondir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletversion_LTLIBRARIES = libtagletversion.la
+
+
+libtagletversion_la_SOURCES = \
+ libtagletversion.vala.stamp \
+ $(libtagletversion_VALASOURCES:.vala=.c) \
+ $(libtagletversion_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletversion_la_LDFLAGS = -module -avoid-version
+
+
+libtagletversion_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletversion_VALASOURCES) libtagletversion.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/author/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/author/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,83 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+public class AuthorHtmlTaglet : MainTaglet {
+ private string? email;
+ private string name;
+
+ public override int order {
+ get { return 400; }
+ }
+
+ public override bool write_block_start ( void* res ) {
+ ((GLib.FileStream)res).puts ( "\t\t<table width=\"100%\" align=\"center\">\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t<tr>\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t\t<td colspan=\"2\"><h5>Version:</h5></td>\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t</tr>\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t<tr>" );
+ ((GLib.FileStream)res).puts ( "\t\t\t\t<td width=\"5\"> </td>\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t\t<td>\n" );
+ return true;
+ }
+
+ public override bool write_block_end ( void* res ) {
+ ((GLib.FileStream)res).puts ( "</td>\n" );
+ ((GLib.FileStream)res).puts ( "\t\t\t</tr>" );
+ ((GLib.FileStream)res).puts ( "\t\t</table>\n" );
+ return true;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Basic me, Gee.ArrayList<InlineTaglet> content ) {
+ if ( content.size != 1 )
+ return false;
+
+ InlineTaglet tag = content.get ( 0 );
+ if ( tag is StringTaglet == false ) {
+ return false;
+ }
+
+ string str = ((StringTaglet)tag).content;
+ str = str.strip ( );
+ return true;
+ }
+
+ public override bool write ( void* res, int max, int index ) {
+ ((GLib.FileStream)res).printf ( "%s", this.version );
+ if ( max != index+1 )
+ ((GLib.FileStream)res).puts ( ", " );
+
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( AuthorHtmlTaglet );
+ taglets.set ( "author", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/link/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/link/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletlink_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletlink.vala.stamp
+
+
+libtagletlink.vala.stamp: $(libtagletlink_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletlinkdir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletlink_LTLIBRARIES = libtagletlink.la
+
+
+libtagletlink_la_SOURCES = \
+ libtagletlink.vala.stamp \
+ $(libtagletlink_VALASOURCES:.vala=.c) \
+ $(libtagletlink_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletlink_la_LDFLAGS = -module -avoid-version
+
+
+libtagletlink_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletlink_VALASOURCES) libtagletlink.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/link/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/link/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,72 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+public class LinkHtmlTaglet : InlineTaglet, LinkHelper {
+ private string content;
+ private string path;
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, string content ) {
+ string[] arr = content.split ( "\n" );
+ string str = string.joinv ("", arr ).strip();
+
+ Valadoc.Basic? element = tree.search_symbol_str ( me, str );
+ if ( element == null ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+5, "Linked Type is not available.\n", error_start );
+ return false;
+ }
+
+ this.settings = settings;
+ this.path = this.get_link ( element );
+ this.content = str;
+ return true;
+ }
+
+
+ public override bool write ( void* res, int max, int index ) {
+ if ( this.path == null )
+ ((GLib.FileStream)res).printf ( "<i>%s</i>", this.content );
+ else
+ ((GLib.FileStream)res).printf ( "<a href=\"%s\">%s</a>", this.path, this.content );
+
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( LinkHtmlTaglet );
+ taglets.set ( "link", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/parameter/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/parameter/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletparameter_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletparameter.vala.stamp
+
+
+libtagletparameter.vala.stamp: $(libtagletparameter_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletparameterdir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletparameter_LTLIBRARIES = libtagletparameter.la
+
+
+libtagletparameter_la_SOURCES = \
+ libtagletparameter.vala.stamp \
+ $(libtagletparameter_VALASOURCES:.vala=.c) \
+ $(libtagletparameter_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletparameter_la_LDFLAGS = -module -avoid-version
+
+
+libtagletparameter_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletparameter_VALASOURCES) libtagletparameter.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/parameter/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/parameter/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,126 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+
+public class ParameterHtmlTaglet : MainTaglet {
+ private Gee.ArrayList<InlineTaglet> content = new Gee.ArrayList<InlineTaglet> ();
+ private string paramname = "";
+
+ public override int order {
+ get { return 100; }
+ }
+
+ public override bool write_block_start ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "<h2 class=\"%s\">Parameters:</h2>\n", css_title );
+ file.printf ( "<table class=\"%s\">\n", css_parameter_table );
+ return true;
+ }
+
+ public override bool write_block_end ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "</table>\n" );
+ return true;
+ }
+
+ private bool check_parameter_name ( Valadoc.ParameterListHandler me, string name ) {
+ foreach ( Valadoc.FormalParameter param in me.get_parameter_list ( ) ) {
+ if ( param.name == name )
+ return true;
+ }
+ return false;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+ if ( content.size == 0 ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );
+ return false;
+ }
+
+ Taglet tag = content.get( 0 );
+ if ( tag is StringTaglet == false ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );
+ return false;
+ }
+
+
+ string strpos = ((StringTaglet)tag).content;
+ string paramname;
+
+ strpos = this.get_next_word ( strpos, out paramname );
+ ((StringTaglet)tag).content = strpos;
+ this.paramname = paramname;
+
+ if ( this.paramname == "" ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Parameter name was expected.\n", error_start );
+ return false;
+ }
+
+ if ( !check_parameter_name ( ((Valadoc.ParameterListHandler)me), this.paramname ) ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Unknown parameter.\n", error_start );
+ return false;
+ }
+
+ this.content = content;
+ return true;
+ }
+
+ public override bool write ( void* ptr, int max, int index ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "\t<tr>\n" );
+ file.printf ( "\t\t<td class=\"%s\">ptr:</td>\n", css_parameter_table_name );
+ file.printf ( "\t\t<td class=\"%s\">\n", css_parameter_table_text );
+ file.puts ( "\t\t\t" );
+
+ int _max = this.content.size;
+ int _index = 0;
+
+ foreach ( Taglet tag in this.content ) {
+ tag.write ( ptr, _max, _index );
+ _index++;
+ }
+
+ file.puts ( "\n" );
+ file.printf ( "\t\t</td>\n" );
+ file.printf ( "\t</tr>\n" );
+ return true;
+ }
+}
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( ParameterHtmlTaglet );
+ taglets.set ( "param", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/return/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/return/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletXXXX_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletXXXX.vala.stamp
+
+
+libtagletXXXX.vala.stamp: $(libtagletXXXX_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletXXXXdir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletXXXX_LTLIBRARIES = libtagletXXXX.la
+
+
+libtagletXXXX_la_SOURCES = \
+ libtagletXXXX.vala.stamp \
+ $(libtagletXXXX_VALASOURCES:.vala=.c) \
+ $(libtagletXXXX_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletXXXX_la_LDFLAGS = -module -avoid-version
+
+
+libtagletXXXX_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletXXXX_VALASOURCES) libtagletXXXX.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/return/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/return/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,71 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+
+public class ReturnHtmlTaglet : MainTaglet {
+ private Gee.ArrayList<InlineTaglet> content = new Gee.ArrayList<InlineTaglet> ();
+
+ public override int order {
+ get { return 300; }
+ }
+
+ public override bool write_block_start ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "<h2 class=\"%s\">Returns:</h2>\n", css_title );
+ return true;
+ }
+
+ public override bool write_block_end ( void* res ) {
+ return true;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+ this.content = content;
+ return true;
+ }
+
+ public override bool write ( void* ptr, int max, int index ) {
+ int _max = this.content.size;
+ int _index = 0;
+
+ foreach ( Taglet tag in this.content ) {
+ tag.write ( ptr, _max, _index );
+ _index++;
+ }
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( ReturnHtmlTaglet );
+ taglets.set ( "return", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/see/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/see/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletsee_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletsee.vala.stamp
+
+
+libtagletsee.vala.stamp: $(libtagletsee_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletseedir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletsee_LTLIBRARIES = libtagletsee.la
+
+
+libtagletsee_la_SOURCES = \
+ libtagletsee.vala.stamp \
+ $(libtagletsee_VALASOURCES:.vala=.c) \
+ $(libtagletsee_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletsee_la_LDFLAGS = -module -avoid-version
+
+
+libtagletsee_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletsee_VALASOURCES) libtagletsee.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/see/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/see/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,100 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+public class SeeHtmlTaglet : MainTaglet, LinkHelper {
+ private string name;
+ private string path;
+
+ public override int order {
+ get { return 500; }
+ }
+
+ public Settings settings {
+ construct set;
+ get;
+ }
+
+ public override bool write_block_start ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "<h2 class=\"%s\">See:</h2>\n", css_title );
+ file.printf ( "<ul class=\"%s\">", css_see_list );
+ return true;
+ }
+
+ public override bool write_block_end ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.puts ( "</ul>" );
+ return true;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+ if ( content.size == 0 ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+4, "Expected a symbol name.\n", error_start );
+ return false;
+ }
+
+ Taglet tag = content.get ( 0 );
+ if ( tag is StringTaglet == false ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+4, "Expected a symbol name.\n", error_start );
+ return false;
+ }
+
+ string[] arr = ((StringTaglet)tag).content.split ( "\n" );
+ string str = string.joinv ("", arr ).strip();
+
+ Valadoc.Basic? element = tree.search_symbol_str ( me, str );
+ if ( element == null ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+4, "Linked type is not available.\n", error_start );
+ return false;
+ }
+
+ this.settings = settings;
+ this.path = this.get_link ( element );
+ this.name = str;
+ return true;
+ }
+
+ public override bool write ( void* ptr, int max, int index ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "\t<li class=\"%s\"><a href=\"%s\">%s</a></li>\n", css_see_list, this.path, this.name );
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( SeeHtmlTaglet );
+ taglets.set ( "see", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/string/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/string/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletstring_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletstring.vala.stamp
+
+
+libtagletstring.vala.stamp: $(libtagletstring_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletstringdir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletstring_LTLIBRARIES = libtagletstring.la
+
+
+libtagletstring_la_SOURCES = \
+ libtagletstring.vala.stamp \
+ $(libtagletstring_VALASOURCES:.vala=.c) \
+ $(libtagletstring_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletstring_la_LDFLAGS = -module -avoid-version
+
+
+libtagletstring_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletstring_VALASOURCES) libtagletstring.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/string/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/string/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,54 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+
+public class StringHtmlTaglet : StringTaglet {
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, string content ) {
+ this.content = content;
+ return true;
+ }
+
+ public override bool write ( void* res, int max , int index ) {
+ try {
+ string str = new Regex ( Regex.escape_string ("\n")).replace_literal ( this.content, -1, 0, "\n<br>" );
+ ((GLib.FileStream)res).puts ( str );
+ }
+ catch ( RegexError err ) {
+ return false;
+ }
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( StringHtmlTaglet );
+ taglets.set ( "", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/throws/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/throws/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libexceptionparameter_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libexceptionparameter.vala.stamp
+
+
+libexceptionparameter.vala.stamp: $(libexceptionparameter_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+exceptionparameterdir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+exceptionparameter_LTLIBRARIES = libexceptionparameter.la
+
+
+libexceptionparameter_la_SOURCES = \
+ libexceptionparameter.vala.stamp \
+ $(libexceptionparameter_VALASOURCES:.vala=.c) \
+ $(libexceptionparameter_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libexceptionparameter_la_LDFLAGS = -module -avoid-version
+
+
+libexceptionparameter_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libexceptionparameter_VALASOURCES) libexceptionparameter.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/throws/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/throws/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,130 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+
+public class ExceptionHtmlTaglet : MainTaglet {
+ private Gee.ArrayList<Taglet> content = new Gee.ArrayList<Taglet> ();
+ private string paramname = "";
+
+ public override int order {
+ get { return 200; }
+ }
+
+ public override bool write_block_start ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "<h2 class=\"%s\">Exceptions:</h2>\n", css_title );
+ file.printf ( "<table class=\"%s\">\n", css_exception_table );
+ return true;
+ }
+
+ public override bool write_block_end ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "</table>\n" );
+ return true;
+ }
+
+ private bool check_exception_parameter_name ( Valadoc.ExceptionHandler me, string paramname ) {
+ if ( paramname[0] == '.' )
+ return false;
+
+ foreach ( Valadoc.TypeReference param in me.get_error_domains() ) {
+ if ( param.type_name.has_suffix ( paramname ) )
+ return true;
+ }
+ return false;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+ if ( content.size == 0 ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+7, "Errordomain was expected.\n", error_start );
+ return false;
+ }
+
+ Taglet tag = content.get( 0 );
+ if ( tag is StringTaglet == false ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Errordomain was expected.\n", error_start );
+ return false;
+ }
+
+ string strpos = ((StringTaglet)tag).content;
+ string paramname;
+
+ strpos = this.get_next_word ( strpos, out paramname );
+ ((StringTaglet)tag).content = strpos;
+ this.paramname = paramname;
+
+ if ( this.paramname == "" ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Errordomain was expected.\n", error_start );
+ return false;
+ }
+
+ if ( !check_exception_parameter_name ( ((Valadoc.ExceptionHandler)me), this.paramname ) ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+6, "Unknown parameter.\n", error_start );
+ return false;
+ }
+
+ this.content = content;
+ return true;
+ }
+
+ public override bool write ( void* ptr, int max, int index ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "\t<tr>\n" );
+ file.printf ( "\t\t<td class=\"%s\">ptr:</td>\n", css_parameter_table_name );
+ file.printf ( "\t\t<td class=\"%s\">\n", css_parameter_table_text );
+ file.puts ( "\t\t\t" );
+
+ int _max = this.content.size;
+ int _index = 0;
+
+ foreach ( Taglet tag in this.content ) {
+ tag.write ( ptr, _max, _index );
+ _index++;
+ }
+
+ file.puts ( "\n" );
+ file.printf ( "\t\t</td>\n" );
+ file.printf ( "\t</tr>\n" );
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( ExceptionHtmlTaglet );
+ taglets.set ( "throws", type );
+ return type;
+}
+
Added: trunk/src/doclets/devhelp/taglets/version/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/version/Makefile.am Wed Oct 29 02:21:20 2008
@@ -0,0 +1,55 @@
+# src/Makefile.am
+
+
+
+libtagletversion_VALASOURCES = \
+ taglet.vala \
+ $(NULL)
+
+
+BUILT_SOURCES = libtagletversion.vala.stamp
+
+
+libtagletversion.vala.stamp: $(libtagletversion_VALASOURCES)
+ $(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../linkhelper --pkg libhtmlhelper-1.0 --basedir . --disable-non-null --save-temps $^
+ touch $@
+
+
+
+
+tagletversiondir = $(libdir)/valadoc/plugins/devhelp/taglets/
+
+tagletversion_LTLIBRARIES = libtagletversion.la
+
+
+libtagletversion_la_SOURCES = \
+ libtagletversion.vala.stamp \
+ $(libtagletversion_VALASOURCES:.vala=.c) \
+ $(libtagletversion_VALASOURCES:.vala=.h) \
+ $(NULL)
+
+
+
+AM_CFLAGS = -g \
+ -I ../../../../libvaladoc/ \
+ -I ../../linkhelper/ \
+ -I ../../ \
+ $(GLIB_CFLAGS) \
+ $(LIBVALA_CFLAGS) \
+ $(NULL)
+
+
+libtagletversion_la_LDFLAGS = -module -avoid-version
+
+
+libtagletversion_la_LIBADD = \
+ ../../../../libvaladoc/libvaladoc.la \
+ ../../linkhelper/libhtmlhelper.la \
+ $(GLIB_LIBS) \
+ $(LIBVALA_LIBS) \
+ $(NULL)
+
+
+
+
+EXTRA_DIST = $(libtagletversion_VALASOURCES) libtagletversion.vala.stamp
Added: trunk/src/doclets/devhelp/taglets/version/taglet.vala
==============================================================================
--- (empty file)
+++ trunk/src/doclets/devhelp/taglets/version/taglet.vala Wed Oct 29 02:21:20 2008
@@ -0,0 +1,82 @@
+/*
+ * 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 Valadoc;
+using GLib;
+using Vala;
+using Gee;
+
+
+
+
+public class VersionHtmlTaglet : MainTaglet {
+ private string version;
+
+ public override int order {
+ get { return 400; }
+ }
+
+ public override bool write_block_start ( void* ptr ) {
+ weak GLib.FileStream file = (GLib.FileStream)ptr;
+
+ file.printf ( "<h2 class=\"%s\">Version:</h2>\n", css_title );
+ return true;
+ }
+
+ public override bool write_block_end ( void* res ) {
+ return true;
+ }
+
+ public override bool parse ( Valadoc.Settings settings, Valadoc.Tree tree, Valadoc.Reporter reporter, string line_start, int line, int pos, Valadoc.Basic me, Gee.ArrayList<Taglet> content ) {
+ if ( content.size != 1 ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+7, "Inline taglets are not allowed here.\n", error_start );
+ return false;
+ }
+
+ Taglet tag = content.get ( 0 );
+ if ( tag is StringTaglet == false ) {
+ string error_start = this.extract_lines ( line_start, 0, 0 );
+ reporter.add_error ( 0, pos, 0, pos+7, "Inline taglets are not allowed here.\n", error_start );
+ return false;
+ }
+
+ string str = ((StringTaglet)tag).content;
+ this.version = str.strip ( );
+ return true;
+ }
+
+ public override bool write ( void* res, int max, int index ) {
+ ((GLib.FileStream)res).printf ( "%s", this.version );
+ if ( max != index+1 )
+ ((GLib.FileStream)res).puts ( ", " );
+
+ return true;
+ }
+}
+
+
+
+[ModuleInit]
+public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
+ GLib.Type type = typeof ( VersionHtmlTaglet );
+ taglets.set ( "version", type );
+ return type;
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]