From: Florian Brosch Date: Sat, 19 Sep 2009 00:43:35 +0000 (+0200) Subject: - apiwriter >> libvaladoc X-Git-Tag: 0.37.1~3^2~581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc5b5111f73ab8d3518fd45067e9b0f0d51cbf7e;p=thirdparty%2Fvala.git - apiwriter >> libvaladoc --- diff --git a/THANKS b/THANKS index 94a24296d..ecada2bbf 100644 --- a/THANKS +++ b/THANKS @@ -1,3 +1,4 @@ +Didier "Ptitjes" Nicolas Joseph Stefan Nuxoll Yu Feng diff --git a/configure.in b/configure.in index fc1e8676e..da5130c4d 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 ca54da1b0..acf64ba87 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/htmlhelpers/languages/Makefile.am b/src/doclets/htmlhelpers/languages/Makefile.am deleted file mode 100644 index 2444dc67c..000000000 --- a/src/doclets/htmlhelpers/languages/Makefile.am +++ /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) - diff --git a/src/doclets/valadoc.org/doclet/Makefile.am b/src/doclets/valadoc.org/doclet/Makefile.am index 3764a3d0a..4511bc4c6 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 cc66d6256..8e3a21867 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 fd49a0033..9a934f253 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 88ade6828..7c0245846 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 fa266951e..5b5fb5932 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 000000000..0e675bd48 --- /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 8c061c8b6..7d8e89ecc 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 0e6f96f14..706be2cdb 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 e78623f29..c69ba48f6 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 f4e971ad6..b408dd179 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;