]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
- paragraph plugins
authorFlorian Brosch <flo.brosch@gmail.com>
Thu, 17 Sep 2009 18:08:22 +0000 (20:08 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Thu, 17 Sep 2009 18:08:22 +0000 (20:08 +0200)
13 files changed:
configure.in
src/doclets/htmlhelpers/taglets/Makefile.am
src/doclets/htmlhelpers/taglets/headline/taglet.vala
src/doclets/htmlhelpers/taglets/paragraph/Makefile.am [new file with mode: 0755]
src/doclets/htmlhelpers/taglets/paragraph/taglet.vala [new file with mode: 0755]
src/doclets/htmlhelpers/taglets/source/taglet.vala
src/doclets/valadoc.org/taglets/Makefile.am
src/doclets/valadoc.org/taglets/headline/taglet.vala
src/doclets/valadoc.org/taglets/paragraph/Makefile.am [new file with mode: 0755]
src/doclets/valadoc.org/taglets/paragraph/taglet.vala [new file with mode: 0755]
src/doclets/valadoc.org/taglets/source/taglet.vala
src/libvaladoc/documentation/doctree.vala
src/libvaladoc/documentation/moduleloader.vala

index fd7cccd1ac3e2f0c29190ff8559087068b9b9665..0117dad5a84b80bcbe2b90f771898190de73e5ef 100644 (file)
@@ -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
index b97a83696cb2497641d7fd74c9f40550eaa86962..8181abd64487fc6bb3e7020c070e2aa3228108f2 100644 (file)
@@ -12,6 +12,7 @@ SUBDIRS =        \
        list         \
        listelement  \
        notification \
+       paragraph    \
        parameter    \
        return       \
        right        \
index c5c1a054151cd27dba826c5dc5df5cc57ac4b7cc..6bcc16a6952bb902ae16cb7fb5fdc7a7aeccfa34 100755 (executable)
@@ -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 (executable)
index 0000000..94ede07
--- /dev/null
@@ -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 (executable)
index 0000000..387186d
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+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);
+}
+
index 59481143866631e73ab51fe2726bc77ca7936c24..13eea768aba0057898744fba0919a3cb573564f8 100755 (executable)
@@ -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);
 }
 
 
index 743eca235a528da84ae1800b0e119238dc388778..f7b55dde011207a40186377df59ed7c53d17b9d5 100755 (executable)
@@ -17,6 +17,7 @@ SUBDIRS =        \
        list         \
        return       \
        source       \
+       paragraph    \
        parameter    \
        listelement  \
        notification \
index db653a32b2ba191edeefac76e6c61b075bf5472d..d646a5435105f82c4c898ed9f72ef17984a15097 100755 (executable)
@@ -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 (executable)
index 0000000..969a30a
--- /dev/null
@@ -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 (executable)
index 0000000..db39811
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2008 Florian Brosch
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+
+using GLib;
+using Gee;
+
+
+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);
+}
+
index dd76050e944dfccde5909f2c6de241e66e63a931..facbdb908fe217495f99ed53bb2bfc5819aad9bd 100755 (executable)
@@ -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;
 
index e4258bc617f2be455f604d4cbb2c3c5d84d6c322..fca49d3d0c69a4e59c117829fcae8c46e04f6c66 100755 (executable)
@@ -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 {
index 8fce8e38b29d28de2a57d88b27365c1dade6f88f..d26354936e609a5655a79f301899381df0704780 100755 (executable)
@@ -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 );
                        }