]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
- apiwriter >> libvaladoc
authorFlorian Brosch <flo.brosch@gmail.com>
Sat, 19 Sep 2009 00:43:35 +0000 (02:43 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Sat, 19 Sep 2009 00:43:35 +0000 (02:43 +0200)
14 files changed:
THANKS
configure.in
src/doclets/htmlhelpers/Makefile.am
src/doclets/htmlhelpers/languages/Makefile.am [deleted file]
src/doclets/valadoc.org/doclet/Makefile.am
src/doclets/valadoc.org/doclet/doclet.vala
src/libvaladoc/Makefile.am
src/libvaladoc/documentation/errorreporter.vala
src/libvaladoc/html-apiwriter/apiwriter-vala.vala [moved from src/doclets/htmlhelpers/languages/vala.vala with 84% similarity]
src/libvaladoc/html-apiwriter/apiwriter.vala [new file with mode: 0755]
src/libvaladoc/html/attribute.vala
src/libvaladoc/html/block.vala
src/libvaladoc/html/htmlwriter.vala
src/libvaladoc/html/inline.vala

diff --git a/THANKS b/THANKS
index 94a24296df8ccc3de0fd80abdf6b108739c25eb5..ecada2bbfe987c0b4623c182b8af5ccab651a4d4 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,3 +1,4 @@
+Didier "Ptitjes" <ptitjes at free dot fr> 
 Nicolas Joseph <nicolas.joseph@valaide.org>
 Stefan Nuxoll <stefan@nuxoll.eu.org>
 Yu Feng <rainwoodman@gmail.com>
index fc1e8676e8a445ef47834b2dff1f5e7a7d64405f..da5130c4d98ae3f28ba8eebcb4a78790e166712a 100644 (file)
@@ -63,7 +63,6 @@ AC_CONFIG_FILES([Makefile
                  src/doclets/Makefile
                  src/doclets/htmlhelpers/Makefile
                  src/doclets/htmlhelpers/deps/Makefile
-                 src/doclets/htmlhelpers/languages/Makefile
                  src/doclets/htmlhelpers/doclet/Makefile
                  src/doclets/htmlhelpers/taglets/Makefile
                  src/doclets/htm/Makefile
index ca54da1b0182d6b1845fee904ef38619537e1d25..acf64ba87f190e4c5686cc96033567adf1796f08 100644 (file)
@@ -2,7 +2,6 @@ NULL =
 
 
 SUBDIRS =     \
-       languages \
        doclet    \
        taglets   \
        deps      \
diff --git a/src/doclets/htmlhelpers/languages/Makefile.am b/src/doclets/htmlhelpers/languages/Makefile.am
deleted file mode 100644 (file)
index 2444dc6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-NULL =
-
-
-AM_CFLAGS =  -g \
-       -I ../../../libvaladoc/ \
-       $(GLIB_CFLAGS) \
-       $(LIBVALA_CFLAGS) \
-       $(NULL)
-
-
-BUILT_SOURCES = libapiwriter.vala.stamp
-
-
-apiwriterdir = $(libdir)/valadoc/plugins/htmlhelpers/
-
-
-apiwriter_LTLIBRARIES =  \
-       libapiwriter.la      \
-       $(NULL)
-
-
-libapiwriter_la_VALASOURCES = \
-       vala.vala                 \
-       $(NULL)
-
-
-libapiwriter_la_SOURCES =                   \
-       libapiwriter.vala.stamp                 \
-       $(libapiwriter_la_VALASOURCES:.vala=.c) \
-       $(NULL)
-
-
-libapiwriter.vala.stamp: $(libapiwriter_la_VALASOURCES)
-       $(VALAC) -C --vapidir ../../../vapi --pkg valadoc-1.0 --basedir . --save-temps -H apiwriter-1.0.h --library apiwriter-1.0 $^
-       touch $@
-
-
-libapiwriter_la_LDFLAGS = -module -avoid-version
-
-
-libapiwriter_la_LIBADD = \
-       ../../../libvaladoc/libvaladoc.la \
-       $(LIBGVC_LIBS) \
-       $(LIBVALA_LIBS) \
-       $(GLIB_LIBS) \
-       $(NULL)
-
-
-EXTRA_DIST = $(libapiwriter_la_VALASOURCES)  libapiwriter.vala.stamp 
-
-
-MAINTAINERCLEANFILES = \
-       $(libapiwriter_la_SOURCES) \
-       apiwriter-1.0.vapi \
-       apiwriter-1.0.h \
-       $(NULL)
-
index 3764a3d0a26152af1adb577f77302946f51f86d6..4511bc4c633de147ea1efc2834c85047b9a4087f 100755 (executable)
@@ -10,7 +10,7 @@ BUILT_SOURCES = libdoclet.vala.stamp
 
 
 libdoclet.vala.stamp: $(libdoclet_VALASOURCES)
-       $(VALAC) -C --vapidir ../../htmlhelpers/languages/ --pkg apiwriter-1.0 --vapidir ../../../vapi/ --pkg valadoc-1.0 --basedir . --save-temps $^
+       $(VALAC) -C --vapidir ../../../vapi/ --pkg valadoc-1.0 --basedir . --save-temps $^
        touch $@
 
 
@@ -30,7 +30,6 @@ libdoclet_la_SOURCES =                \
 
 AM_CFLAGS =  -g                    \
        -I ../../../libvaladoc/        \
-       -I ../../htmlhelpers/languages \
        $(GLIB_CFLAGS)                 \
        $(LIBVALA_CFLAGS)              \
        $(NULL)
@@ -42,7 +41,6 @@ libdoclet_la_LDFLAGS = -module -avoid-version \
 
 libdoclet_la_LIBADD =                           \
        ../../../libvaladoc/libvaladoc.la           \
-       ../../htmlhelpers/languages/libapiwriter.la \
        $(GLIB_LIBS)                                \
        $(LIBVALA_LIBS)                             \
        $(NULL)
index cc66d6256e38076323a1aaba9c4810bcb6c50633..8e3a218671635316446a4dfe569b789aaa1f5c7a 100755 (executable)
@@ -26,7 +26,7 @@ using Gee;
 
 
 public class Valadoc.ValdocOrg.Doclet : Valadoc.Doclet {
-       private Valadoc.Html.Api.Vala langwriter = new Valadoc.Html.Api.Vala ();
+       private Valadoc.Html.ValaApiWriter langwriter = new Valadoc.Html.ValaApiWriter ();
        private Settings settings;
        private FileStream types;
        private FileStream file;
index fd49a00336051f2f5ba2b24d16f7a71d8bd613f7..9a934f25388626fa4ce9150dd5c22f4ed73dbd93 100644 (file)
@@ -78,6 +78,8 @@ libvaladoc_la_VALASOURCES = \
        html/block.vala \
        html/htmlwriter.vala \
        html/inline.vala \
+       html-apiwriter/apiwriter.vala \
+       html-apiwriter/apiwriter-vala.vala \
        $(NULL)
 
 
index 88ade68289b27af1e4a7088038fd710cadea7bc4..7c02458463af4b36cdda5af47fc487256c3188ef 100755 (executable)
@@ -1,3 +1,21 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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.
+ */
 
 
 public enum Valadoc.ErrorLevel {
similarity index 84%
rename from src/doclets/htmlhelpers/languages/vala.vala
rename to src/libvaladoc/html-apiwriter/apiwriter-vala.vala
index fa266951e8a8b7ff8b9878544766a132b19712fa..5b5fb593219168d1776da8d721586d8d50c04808 100755 (executable)
@@ -1,21 +1,27 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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.Html;
 using Valadoc;
 using Gee;
 
-public class Valadoc.Html.Api.Vala {
-       private Attribute csskeyword = new Attribute ("class", "apikeyword");
-       private Attribute cssformalparam = new Attribute ("class", "apiformalparameter");
-       private Attribute cssparamlist = new Attribute ("class", "apiparameterlist");
-       private Attribute cssexclist = new Attribute ("class", "apiexceptionlist");
-       private Attribute cssapi = new Attribute ("class", "api");
-       private Attribute csstype = new Attribute ("class", "apitype");
-       private Attribute cssbasictype = new Attribute ("class", "apibasictype");
-       private Attribute csslink = new Attribute ("class", "apilink");
-       private Attribute cssoptparamlist = new Attribute ("class", "apioptparameterlist");
-       private Attribute cssparentlist = new Attribute ("class", "parentlist");
-
+public class Valadoc.Html.ValaApiWriter : ApiWriter {
        private Entry keyword (string str) {
                Span span = new Span ();
                span.add_attribute (this.csskeyword);
@@ -297,7 +303,7 @@ public class Valadoc.Html.Api.Vala {
                return span;
        }
 
-       public Div from_method (Method m) {
+       public override Div from_method (Method m) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -357,7 +363,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_delegate (Delegate del) {
+       public override Div from_delegate (Delegate del) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -392,7 +398,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_signal (Signal sig) {
+       public override Div from_signal (Signal sig) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -412,7 +418,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_field (Field field) {
+       public override Div from_field (Field field) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -437,7 +443,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_constant (Constant c) {
+       public override Div from_constant (Constant c) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -451,7 +457,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_namespace (Namespace ns) {
+       public override Div from_namespace (Namespace ns) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -460,7 +466,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_enum (Enum en) {
+       public override Div from_enum (Enum en) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -469,7 +475,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_errordomain (ErrorDomain err) {
+       public override Div from_errordomain (ErrorDomain err) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -478,21 +484,21 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_enumvalue (EnumValue env) {
+       public override Div from_enumvalue (EnumValue env) {
                Div api = new Div ();
                api.add_attribute (cssapi);
                api.add_child (new String (env.name));
                return api;
        }
 
-       public Div from_errorcode (ErrorCode errc) {
+       public override Div from_errorcode (ErrorCode errc) {
                Div api = new Div ();
                api.add_attribute (cssapi);
                api.add_child (new String (errc.name));
                return api;
        }
 
-       public Div from_struct (Struct stru) {
+       public override Div from_struct (Struct stru) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -509,7 +515,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_class (Class cl) {
+       public override Div from_class (Class cl) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -535,7 +541,7 @@ public class Valadoc.Html.Api.Vala {
                return api;
        }
 
-       public Div from_interface (Interface iface) {
+       public override Div from_interface (Interface iface) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -586,7 +592,7 @@ public class Valadoc.Html.Api.Vala {
                return span;
        }
 
-       public Div from_property (Property prop) {
+       public override Div from_property (Property prop) {
                Div api = new Div ();
                api.add_attribute (cssapi);
 
@@ -620,51 +626,6 @@ public class Valadoc.Html.Api.Vala {
                api.add_child (new String("}"));
                return api;
        }
-
-       public Div from_documented_element (DocumentedElement el) {
-               if (el is Method) {
-                       return this.from_method ((Method)el);
-               }
-               else if (el is Delegate) {
-                       return this.from_delegate ((Delegate)el);
-               }
-               else if (el is Signal) {
-                       return this.from_signal ((Signal)el);
-               }
-               else if (el is Field) {
-                       return this.from_field ((Field)el);
-               }
-               else if (el is Constant) {
-                       return this.from_constant ((Constant)el);
-               }
-               else if (el is Namespace) {
-                       return this.from_namespace ((Namespace)el);
-               }
-               else if (el is Enum) {
-                       return this.from_enum ((Enum)el);
-               }
-               else if (el is ErrorDomain) {
-                       return this.from_errordomain ((ErrorDomain)el);
-               }
-               else if (el is EnumValue) {
-                       return this.from_enumvalue ((EnumValue)el);
-               }
-               else if (el is ErrorCode) {
-                       return this.from_errorcode ((ErrorCode)el);
-               }
-               else if (el is Struct) {
-                       return this.from_struct ((Struct)el);
-               }
-               else if (el is Class) {
-                       return this.from_class ((Class)el);
-               }
-               else if (el is Interface) {
-                       return this.from_interface ((Interface)el);
-               }
-               else {
-                       return this.from_property ((Property)el);
-               }
-       }
 }
 
 
diff --git a/src/libvaladoc/html-apiwriter/apiwriter.vala b/src/libvaladoc/html-apiwriter/apiwriter.vala
new file mode 100755 (executable)
index 0000000..0e675bd
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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 Gee;
+
+public abstract class Valadoc.Html.ApiWriter {
+       protected Attribute csskeyword = new Attribute ("class", "apikeyword");
+       protected Attribute cssformalparam = new Attribute ("class", "apiformalparameter");
+       protected Attribute cssparamlist = new Attribute ("class", "apiparameterlist");
+       protected Attribute cssexclist = new Attribute ("class", "apiexceptionlist");
+       protected Attribute cssapi = new Attribute ("class", "api");
+       protected Attribute csstype = new Attribute ("class", "apitype");
+       protected Attribute cssbasictype = new Attribute ("class", "apibasictype");
+       protected Attribute csslink = new Attribute ("class", "apilink");
+       protected Attribute cssoptparamlist = new Attribute ("class", "apioptparameterlist");
+       protected Attribute cssparentlist = new Attribute ("class", "parentlist");
+
+       public abstract Div from_method (Method m);
+       public abstract Div from_delegate (Delegate del);
+       public abstract Div from_signal (Signal sig);
+       public abstract Div from_field (Field field);
+       public abstract Div from_constant (Constant c);
+       public abstract Div from_namespace (Namespace ns);
+       public abstract Div from_enum (Enum en);
+       public abstract Div from_errordomain (ErrorDomain err);
+       public abstract Div from_enumvalue (EnumValue env);
+       public abstract Div from_errorcode (ErrorCode errc);
+       public abstract Div from_struct (Struct stru);
+       public abstract Div from_class (Class cl);
+       public abstract Div from_interface (Interface iface);
+       public abstract Div from_property (Property prop);
+
+       public Div from_documented_element (DocumentedElement el) {
+               if (el is Method) {
+                       return this.from_method ((Method)el);
+               }
+               else if (el is Delegate) {
+                       return this.from_delegate ((Delegate)el);
+               }
+               else if (el is Signal) {
+                       return this.from_signal ((Signal)el);
+               }
+               else if (el is Field) {
+                       return this.from_field ((Field)el);
+               }
+               else if (el is Constant) {
+                       return this.from_constant ((Constant)el);
+               }
+               else if (el is Namespace) {
+                       return this.from_namespace ((Namespace)el);
+               }
+               else if (el is Enum) {
+                       return this.from_enum ((Enum)el);
+               }
+               else if (el is ErrorDomain) {
+                       return this.from_errordomain ((ErrorDomain)el);
+               }
+               else if (el is EnumValue) {
+                       return this.from_enumvalue ((EnumValue)el);
+               }
+               else if (el is ErrorCode) {
+                       return this.from_errorcode ((ErrorCode)el);
+               }
+               else if (el is Struct) {
+                       return this.from_struct ((Struct)el);
+               }
+               else if (el is Class) {
+                       return this.from_class ((Class)el);
+               }
+               else if (el is Interface) {
+                       return this.from_interface ((Interface)el);
+               }
+               else {
+                       return this.from_property ((Property)el);
+               }
+       }
+}
+
+
index 8c061c8b6589cdd47fba908934b17b6d6e1d9f09..7d8e89ecc171980cb94af130ed72989fbfa73791 100755 (executable)
@@ -1,3 +1,21 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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 Gee;
 
index 0e6f96f1424809c223c00d4edce684193362577c..706be2cdbb57df9865407e4c488b49e5a945c850 100755 (executable)
@@ -1,3 +1,21 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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 Gee;
 
index e78623f291f0ffbfe1d97c5f0fd83e6e35537042..c69ba48f6cee53b54fe49c35998b56489519cbf9 100755 (executable)
@@ -1,3 +1,21 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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 Gee;
 
index f4e971ad64dcf40db42db850ac7f8fbeaf09cfee..b408dd17960a9c15a2f9717ca3895ba1aa1c5916 100755 (executable)
@@ -1,3 +1,21 @@
+/*
+ * Valadoc - a documentation tool for vala.
+ * Copyright (C) 2009 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 Gee;