[valadoc] - apiwriter >> libvaladoc



commit fc5b5111f73ab8d3518fd45067e9b0f0d51cbf7e
Author: Florian Brosch <flo brosch gmail com>
Date:   Sat Sep 19 02:43:35 2009 +0200

    - apiwriter >> libvaladoc

 THANKS                                             |    1 +
 configure.in                                       |    1 -
 src/doclets/htmlhelpers/Makefile.am                |    1 -
 src/doclets/htmlhelpers/languages/Makefile.am      |   57 -----------
 src/doclets/valadoc.org/doclet/Makefile.am         |    4 +-
 src/doclets/valadoc.org/doclet/doclet.vala         |    2 +-
 src/libvaladoc/Makefile.am                         |    2 +
 src/libvaladoc/documentation/errorreporter.vala    |   18 ++++
 .../html-apiwriter/apiwriter-vala.vala}            |  105 ++++++-------------
 src/libvaladoc/html-apiwriter/apiwriter.vala       |   97 ++++++++++++++++++
 src/libvaladoc/html/attribute.vala                 |   18 ++++
 src/libvaladoc/html/block.vala                     |   18 ++++
 src/libvaladoc/html/htmlwriter.vala                |   18 ++++
 src/libvaladoc/html/inline.vala                    |   18 ++++
 14 files changed, 225 insertions(+), 135 deletions(-)
---
diff --git a/THANKS b/THANKS
index 94a2429..ecada2b 100644
--- 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>
diff --git a/configure.in b/configure.in
index fc1e867..da5130c 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/src/doclets/htmlhelpers/Makefile.am b/src/doclets/htmlhelpers/Makefile.am
index ca54da1..acf64ba 100644
--- a/src/doclets/htmlhelpers/Makefile.am
+++ b/src/doclets/htmlhelpers/Makefile.am
@@ -2,7 +2,6 @@ NULL =
 
 
 SUBDIRS =     \
-	languages \
 	doclet    \
 	taglets   \
 	deps      \
diff --git a/src/doclets/valadoc.org/doclet/Makefile.am b/src/doclets/valadoc.org/doclet/Makefile.am
index 3764a3d..4511bc4 100755
--- a/src/doclets/valadoc.org/doclet/Makefile.am
+++ b/src/doclets/valadoc.org/doclet/Makefile.am
@@ -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)
diff --git a/src/doclets/valadoc.org/doclet/doclet.vala b/src/doclets/valadoc.org/doclet/doclet.vala
index cc66d62..8e3a218 100755
--- a/src/doclets/valadoc.org/doclet/doclet.vala
+++ b/src/doclets/valadoc.org/doclet/doclet.vala
@@ -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;
diff --git a/src/libvaladoc/Makefile.am b/src/libvaladoc/Makefile.am
index fd49a00..9a934f2 100644
--- a/src/libvaladoc/Makefile.am
+++ b/src/libvaladoc/Makefile.am
@@ -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)
 
 
diff --git a/src/libvaladoc/documentation/errorreporter.vala b/src/libvaladoc/documentation/errorreporter.vala
index 88ade68..7c02458 100755
--- a/src/libvaladoc/documentation/errorreporter.vala
+++ b/src/libvaladoc/documentation/errorreporter.vala
@@ -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 {
diff --git a/src/doclets/htmlhelpers/languages/vala.vala b/src/libvaladoc/html-apiwriter/apiwriter-vala.vala
similarity index 84%
rename from src/doclets/htmlhelpers/languages/vala.vala
rename to src/libvaladoc/html-apiwriter/apiwriter-vala.vala
index fa26695..5b5fb59 100755
--- a/src/doclets/htmlhelpers/languages/vala.vala
+++ b/src/libvaladoc/html-apiwriter/apiwriter-vala.vala
@@ -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
index 0000000..0e675bd
--- /dev/null
+++ b/src/libvaladoc/html-apiwriter/apiwriter.vala
@@ -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);
+		}
+	}
+}
+
+
diff --git a/src/libvaladoc/html/attribute.vala b/src/libvaladoc/html/attribute.vala
index 8c061c8..7d8e89e 100755
--- a/src/libvaladoc/html/attribute.vala
+++ b/src/libvaladoc/html/attribute.vala
@@ -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;
 
diff --git a/src/libvaladoc/html/block.vala b/src/libvaladoc/html/block.vala
index 0e6f96f..706be2c 100755
--- a/src/libvaladoc/html/block.vala
+++ b/src/libvaladoc/html/block.vala
@@ -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;
 
diff --git a/src/libvaladoc/html/htmlwriter.vala b/src/libvaladoc/html/htmlwriter.vala
index e78623f..c69ba48 100755
--- a/src/libvaladoc/html/htmlwriter.vala
+++ b/src/libvaladoc/html/htmlwriter.vala
@@ -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;
 
diff --git a/src/libvaladoc/html/inline.vala b/src/libvaladoc/html/inline.vala
index f4e971a..b408dd1 100755
--- a/src/libvaladoc/html/inline.vala
+++ b/src/libvaladoc/html/inline.vala
@@ -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;
 



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