[valadoc] - paragraph plugins



commit 189083c265a24705f1eaac2e75121e2485a7bd89
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Sep 17 20:08:22 2009 +0200

    - paragraph plugins

 configure.in                                       |    2 +
 src/doclets/htmlhelpers/taglets/Makefile.am        |    1 +
 .../htmlhelpers/taglets/headline/taglet.vala       |   10 ++--
 .../htmlhelpers/taglets/paragraph/Makefile.am      |   56 +++++++++++++++++++
 .../htmlhelpers/taglets/paragraph/taglet.vala      |   57 ++++++++++++++++++++
 src/doclets/htmlhelpers/taglets/source/taglet.vala |   18 +++---
 src/doclets/valadoc.org/taglets/Makefile.am        |    1 +
 .../valadoc.org/taglets/headline/taglet.vala       |    2 +-
 .../valadoc.org/taglets/paragraph/Makefile.am      |   56 +++++++++++++++++++
 .../valadoc.org/taglets/paragraph/taglet.vala      |   55 +++++++++++++++++++
 src/doclets/valadoc.org/taglets/source/taglet.vala |    4 +-
 src/libvaladoc/documentation/doctree.vala          |   13 +++--
 src/libvaladoc/documentation/moduleloader.vala     |    9 ++-
 13 files changed, 259 insertions(+), 25 deletions(-)
---
diff --git a/configure.in b/configure.in
index fd7cccd..0117dad 100644
--- a/configure.in
+++ b/configure.in
@@ -75,6 +75,7 @@ AC_CONFIG_FILES([Makefile
                  src/doclets/htmlhelpers/taglets/table/Makefile
                  src/doclets/htmlhelpers/taglets/right/Makefile
                  src/doclets/htmlhelpers/taglets/image/Makefile
+                 src/doclets/htmlhelpers/taglets/paragraph/Makefile
                  src/doclets/htmlhelpers/taglets/throws/Makefile
                  src/doclets/htmlhelpers/taglets/string/Makefile
                  src/doclets/htmlhelpers/taglets/center/Makefile
@@ -94,6 +95,7 @@ AC_CONFIG_FILES([Makefile
                  src/doclets/valadoc.org/doclet/Makefile
                  src/doclets/valadoc.org/taglets/Makefile
                  src/doclets/valadoc.org/taglets/see/Makefile
+                 src/doclets/valadoc.org/taglets/paragraph/Makefile
                  src/doclets/valadoc.org/taglets/link/Makefile
                  src/doclets/valadoc.org/taglets/constants/Makefile
                  src/doclets/valadoc.org/taglets/list/Makefile
diff --git a/src/doclets/htmlhelpers/taglets/Makefile.am b/src/doclets/htmlhelpers/taglets/Makefile.am
index b97a836..8181abd 100644
--- a/src/doclets/htmlhelpers/taglets/Makefile.am
+++ b/src/doclets/htmlhelpers/taglets/Makefile.am
@@ -12,6 +12,7 @@ SUBDIRS =        \
 	list         \
 	listelement  \
 	notification \
+	paragraph    \
 	parameter    \
 	return       \
 	right        \
diff --git a/src/doclets/htmlhelpers/taglets/headline/taglet.vala b/src/doclets/htmlhelpers/taglets/headline/taglet.vala
index c5c1a05..6bcc16a 100755
--- a/src/doclets/htmlhelpers/taglets/headline/taglet.vala
+++ b/src/doclets/htmlhelpers/taglets/headline/taglet.vala
@@ -27,15 +27,15 @@ namespace Valadoc.Html {
 		private string title;
 		private int lvl;
 
-		public override bool parse ( owned string title, int lvl ) {
+		public override bool parse (string title, int lvl) {
 			this.title = title;
 			this.lvl = lvl;
 			return true;
 		}
 
-		public override bool write ( void* res, int max, int index ) {
+		public override bool write (void* res, int max, int index) {
 			weak GLib.FileStream file = (GLib.FileStream)res;
-			file.printf ("\n\n<h%d>%s</h%d>\n", this.lvl, this.title, this.lvl  );
+			file.printf ("\n\n<h%d>%s</h%d>\n", this.lvl, this.title, this.lvl);
 			return true;
 		}
 	}
@@ -43,7 +43,7 @@ namespace Valadoc.Html {
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-	return typeof ( Valadoc.Html.HeadlineDocElement );
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+	return typeof (Valadoc.Html.HeadlineDocElement);
 }
 
diff --git a/src/doclets/htmlhelpers/taglets/paragraph/Makefile.am b/src/doclets/htmlhelpers/taglets/paragraph/Makefile.am
new file mode 100755
index 0000000..94ede07
--- /dev/null
+++ b/src/doclets/htmlhelpers/taglets/paragraph/Makefile.am
@@ -0,0 +1,56 @@
+NULL =
+
+
+AM_CFLAGS =  -g                  \
+	-I ../../../../libvaladoc/   \
+	-I ../../doclet/             \
+	$(GLIB_CFLAGS)               \
+	$(LIBVALA_CFLAGS)            \
+	$(NULL)
+
+
+BUILT_SOURCES = libtagletparagraph.vala.stamp
+
+
+tagletparagraphdir = $(libdir)/valadoc/plugins/htmlhelpers/taglets/
+
+
+tagletparagraph_LTLIBRARIES =    \
+	libtagletparagraph.la  \
+	$(NULL)
+
+
+libtagletparagraph_la_VALASOURCES = \
+	taglet.vala                  \
+	$(NULL)
+
+
+libtagletparagraph_la_SOURCES =                \
+	libtagletparagraph.vala.stamp              \
+	$(libtagletparagraph_la_VALASOURCES:.vala=.c) \
+	$(NULL)
+
+
+libtagletparagraph.vala.stamp: $(libtagletparagraph_la_VALASOURCES)
+	$(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --vapidir ../../doclet/ --pkg libhtmlhelpers-1.0 --basedir . $^
+	touch $@
+
+
+libtagletparagraph_la_LDFLAGS = -module -avoid-version
+
+
+libtagletparagraph_la_LIBADD =              \
+	../../../../libvaladoc/libvaladoc.la \
+	$(LIBGVC_LIBS)                       \
+	$(LIBVALA_LIBS)                      \
+	$(GLIB_LIBS)                         \
+	$(NULL)
+
+
+EXTRA_DIST = $(libtagletparagraph_la_VALASOURCES)  libtagletparagraph.vala.stamp 
+
+
+MAINTAINERCLEANFILES =                         \
+	$(libtagletparagraph_la_VALASOURCES:.vala=.c) \
+	$(NULL)
+
diff --git a/src/doclets/htmlhelpers/taglets/paragraph/taglet.vala b/src/doclets/htmlhelpers/taglets/paragraph/taglet.vala
new file mode 100755
index 0000000..387186d
--- /dev/null
+++ b/src/doclets/htmlhelpers/taglets/paragraph/taglet.vala
@@ -0,0 +1,57 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+namespace Valadoc.Html {
+	public class ParagraphDocElement : Valadoc.ParagraphDocElement {
+		private ArrayList<DocElement> content;
+
+		public override bool parse (ArrayList<DocElement> content) {
+			this.content = content;
+			return true;
+		}
+
+		public override bool write (void* res, int max, int index) {
+			weak GLib.FileStream file = (GLib.FileStream)res;
+			int _max = this.content.size;
+			int _index = 0;
+
+			file.printf ("<p>");
+
+			foreach (DocElement element in this.content) {
+				element.write (res, _max, _index);
+				_index++;
+			}
+
+			file.printf ("</p>");
+			return true;
+		}
+	}
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+	return typeof (Valadoc.Html.ParagraphDocElement);
+}
+
diff --git a/src/doclets/htmlhelpers/taglets/source/taglet.vala b/src/doclets/htmlhelpers/taglets/source/taglet.vala
index 5948114..13eea76 100755
--- a/src/doclets/htmlhelpers/taglets/source/taglet.vala
+++ b/src/doclets/htmlhelpers/taglets/source/taglet.vala
@@ -28,24 +28,24 @@ namespace Valadoc.Html {
 		private int srclines;
 		private string src;
 
-		public override bool parse ( owned string src, Language lang ) {
-			this.src = (owned)src;
+		public override bool parse (string src, Language lang) {
+			this.src = src;
 			this.lang = lang;
 			this.srclines=0;
 
 			for (weak string str=this.src; str.get_char()!='\0'; str=str.next_char()) {
-				if ( str.get_char () == '\n' ) {
+				if (str.get_char () == '\n') {
 					this.srclines++;
 				}
 			}
 			return true;
 		}
 
-		public override bool write ( void* res, int max, int index ) {
+		public override bool write (void* res, int max, int index) {
 			weak GLib.FileStream file = (GLib.FileStream)res;
-			file.printf ( "\n\n\t<pre class=\"%s\">", css_source_sample );
-			file.puts ( src );
-			file.puts ( "</pre>\n\n" );
+			file.printf ("\n\n\t<pre class=\"%s\">", css_source_sample);
+			file.puts (src);
+			file.puts ("</pre>\n\n");
 			return true;
 		}
 	}
@@ -53,8 +53,8 @@ namespace Valadoc.Html {
 
 
 [ModuleInit]
-public GLib.Type register_plugin ( Gee.HashMap<string, Type> taglets ) {
-	return typeof ( Valadoc.Html.SourceCodeDocElement );
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+	return typeof (Valadoc.Html.SourceCodeDocElement);
 }
 
 
diff --git a/src/doclets/valadoc.org/taglets/Makefile.am b/src/doclets/valadoc.org/taglets/Makefile.am
index 743eca2..f7b55dd 100755
--- a/src/doclets/valadoc.org/taglets/Makefile.am
+++ b/src/doclets/valadoc.org/taglets/Makefile.am
@@ -17,6 +17,7 @@ SUBDIRS =        \
 	list         \
 	return       \
 	source       \
+	paragraph    \
 	parameter    \
 	listelement  \
 	notification \
diff --git a/src/doclets/valadoc.org/taglets/headline/taglet.vala b/src/doclets/valadoc.org/taglets/headline/taglet.vala
index db653a3..d646a54 100755
--- a/src/doclets/valadoc.org/taglets/headline/taglet.vala
+++ b/src/doclets/valadoc.org/taglets/headline/taglet.vala
@@ -26,7 +26,7 @@ public class Valadoc.ValdocOrg.HeadlineDocElement : Valadoc.HeadlineDocElement {
 	private string title;
 	private int lvl;
 
-	public override bool parse (owned string title, int lvl) {
+	public override bool parse (string title, int lvl) {
 		this.title = title;
 		this.lvl = lvl;
 		return true;
diff --git a/src/doclets/valadoc.org/taglets/paragraph/Makefile.am b/src/doclets/valadoc.org/taglets/paragraph/Makefile.am
new file mode 100755
index 0000000..969a30a
--- /dev/null
+++ b/src/doclets/valadoc.org/taglets/paragraph/Makefile.am
@@ -0,0 +1,56 @@
+NULL =
+
+
+AM_CFLAGS =  -g                  \
+	-I ../../../../libvaladoc/   \
+	-I ../../doclet/             \
+	$(GLIB_CFLAGS)               \
+	$(LIBVALA_CFLAGS)            \
+	$(NULL)
+
+
+BUILT_SOURCES = libtagletparagraph.vala.stamp
+
+
+tagletparagraphdir = $(libdir)/valadoc/plugins/valadoc.org/taglets/
+
+
+tagletparagraph_LTLIBRARIES =    \
+	libtagletparagraph.la  \
+	$(NULL)
+
+
+libtagletparagraph_la_VALASOURCES = \
+	taglet.vala                  \
+	$(NULL)
+
+
+libtagletparagraph_la_SOURCES =                \
+	libtagletparagraph.vala.stamp              \
+	$(libtagletparagraph_la_VALASOURCES:.vala=.c) \
+	$(NULL)
+
+
+libtagletparagraph.vala.stamp: $(libtagletparagraph_la_VALASOURCES)
+	$(VALAC) -C --vapidir ../../../../vapi --pkg valadoc-1.0 --basedir . $^
+	touch $@
+
+
+libtagletparagraph_la_LDFLAGS = -module -avoid-version
+
+
+libtagletparagraph_la_LIBADD =              \
+	../../../../libvaladoc/libvaladoc.la \
+	$(LIBGVC_LIBS)                       \
+	$(LIBVALA_LIBS)                      \
+	$(GLIB_LIBS)                         \
+	$(NULL)
+
+
+EXTRA_DIST = $(libtagletparagraph_la_VALASOURCES)  libtagletparagraph.vala.stamp 
+
+
+MAINTAINERCLEANFILES =                         \
+	$(libtagletparagraph_la_VALASOURCES:.vala=.c) \
+	$(NULL)
+
diff --git a/src/doclets/valadoc.org/taglets/paragraph/taglet.vala b/src/doclets/valadoc.org/taglets/paragraph/taglet.vala
new file mode 100755
index 0000000..db39811
--- /dev/null
+++ b/src/doclets/valadoc.org/taglets/paragraph/taglet.vala
@@ -0,0 +1,55 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+namespace Valadoc.ValdocOrg {
+	public class ParagraphDocElement : Valadoc.ParagraphDocElement {
+		private ArrayList<DocElement> content;
+
+		public override bool parse (ArrayList<DocElement> content) {
+			this.content = content;
+			return true;
+		}
+
+		public override bool write (void* res, int max, int index) {
+			weak GLib.FileStream file = (GLib.FileStream)res;
+			int _max = this.content.size;
+			int _index = 0;
+
+			foreach (DocElement element in this.content) {
+				element.write (res, _max, _index);
+				_index++;
+			}
+
+			file.printf ("\n\n");
+			return true;
+		}
+	}
+}
+
+
+[ModuleInit]
+public GLib.Type register_plugin (Gee.HashMap<string, Type> taglets) {
+	return typeof (Valadoc.ValdocOrg.ParagraphDocElement);
+}
+
diff --git a/src/doclets/valadoc.org/taglets/source/taglet.vala b/src/doclets/valadoc.org/taglets/source/taglet.vala
index dd76050..facbdb9 100755
--- a/src/doclets/valadoc.org/taglets/source/taglet.vala
+++ b/src/doclets/valadoc.org/taglets/source/taglet.vala
@@ -27,8 +27,8 @@ public class Valadoc.ValdocOrg.SourceCodeDocElement : Valadoc.SourceCodeDocEleme
 	private int srclines;
 	private string src;
 
-	public override bool parse (owned string src, Language lang) {
-		this.src = (owned)src;
+	public override bool parse (string src, Language lang) {
+		this.src = src;
 		this.lang = lang;
 		this.srclines=0;
 
diff --git a/src/libvaladoc/documentation/doctree.vala b/src/libvaladoc/documentation/doctree.vala
index e4258bc..fca49d3 100755
--- a/src/libvaladoc/documentation/doctree.vala
+++ b/src/libvaladoc/documentation/doctree.vala
@@ -53,12 +53,10 @@ public enum Valadoc.ListType {
 }
 
 
-/* deprecated */
 public interface Valadoc.Documentation : Object {
 	public abstract string? get_filename ();
 }
 
-
 public abstract class Valadoc.DocElement : Object {
 	public abstract bool write (void* res, int max, int index);
 }
@@ -76,7 +74,7 @@ public abstract class Valadoc.CodeConstantDocElement : Valadoc.DocElement {
 }
 
 public abstract class Valadoc.MainTaglet : Taglet {
-	// remove
+	// deprecated
 	protected string? get_data_type (DocumentedElement me) {
 		if (me is Valadoc.Class)
 			return "class";
@@ -117,6 +115,7 @@ public abstract class Valadoc.MainTaglet : Taglet {
 
 
 public abstract class Valadoc.StringTaglet : Taglet {
+	// deprecated
 	public string content {
 		protected set; get;
 	}
@@ -124,8 +123,12 @@ public abstract class Valadoc.StringTaglet : Taglet {
 	public abstract bool parse (string content);
 }
 
+public abstract class Valadoc.ParagraphDocElement : DocElement {
+	public abstract bool parse (ArrayList<DocElement> paragraph);
+}
+
 public abstract class Valadoc.HeadlineDocElement : DocElement {
-	public abstract bool parse (owned string title, int lvl);
+	public abstract bool parse (string title, int lvl);
 }
 
 public abstract class Valadoc.ImageDocElement : DocElement {
@@ -137,7 +140,7 @@ public abstract class Valadoc.LinkDocElement : DocElement {
 }
 
 public abstract class Valadoc.SourceCodeDocElement : DocElement {
-	public abstract bool parse (owned string src, Language lang);
+	public abstract bool parse (string src, Language lang);
 }
 
 public abstract class Valadoc.ListEntryDocElement : DocElement {
diff --git a/src/libvaladoc/documentation/moduleloader.vala b/src/libvaladoc/documentation/moduleloader.vala
index 8fce8e3..d263549 100755
--- a/src/libvaladoc/documentation/moduleloader.vala
+++ b/src/libvaladoc/documentation/moduleloader.vala
@@ -27,7 +27,7 @@ public static delegate GLib.Type Valadoc.TagletRegisterFunction ( Gee.HashMap<st
 
 
 public class Valadoc.ModuleLoader : Object {
-	public Doclet doclet; //rm
+	public Doclet doclet;
 
 	public Gee.HashMap<string, GLib.Type> taglets;
 	public GLib.Type bold;
@@ -42,11 +42,11 @@ public class Valadoc.ModuleLoader : Object {
 	public GLib.Type right;
 	public GLib.Type source;
 	public GLib.Type source_inline;
-	public GLib.Type @string; //
+	public GLib.Type @string;
 	public GLib.Type table;
 	public GLib.Type table_cell;
 	public GLib.Type underline;
-
+	public GLib.Type paragraph;
 
 	private Module docletmodule;
 	private Type doclettype;
@@ -159,6 +159,9 @@ public class Valadoc.ModuleLoader : Object {
 				case "libtagletcodeconstant":
 					this.source_inline = type;
 					break;
+				case "libtagletparagraph":
+					this.source_inline = type;
+					break;
 				}
 				modules.add ( module );
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]