[lasem] mathml: begin implementation of semantics element.



commit 302759131caf8a6dbb423c1f75d6f1578debcc14
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sun Dec 11 17:02:09 2011 +0100

    mathml: begin implementation of semantics element.

 src/Makefile.am                      |    2 +
 src/lsmmathmldocument.c              |    3 ++
 src/lsmmathmlpresentationcontainer.c |    4 +-
 src/lsmmathmlpresentationcontainer.h |    4 +-
 src/lsmmathmlrowelement.c            |    4 +-
 src/lsmmathmlrowelement.h            |    6 ++--
 src/lsmmathmlsemanticselement.c      |   60 ++++++++++++++++++++++++++++++++++
 src/lsmmathmlsemanticselement.h      |   56 +++++++++++++++++++++++++++++++
 src/lsmmathmltypes.h                 |    1 +
 9 files changed, 131 insertions(+), 9 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b2af864..e493a68 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -63,6 +63,7 @@ LASEM_MATHML_SRCS =				\
 	lsmmathmloperatordictionary.c		\
 	lsmmathmldocument.c			\
 	lsmmathmlelement.c			\
+	lsmmathmlsemanticselement.c		\
 	lsmmathmlphantomelement.c		\
 	lsmmathmlmathelement.c			\
 	lsmmathmltableelement.c			\
@@ -163,6 +164,7 @@ LASEM_MATHML_HDRS =				\
 	lsmmathmloperatordictionary.h		\
 	lsmmathmldocument.h			\
 	lsmmathmlelement.h			\
+	lsmmathmlsemanticselement.h		\
 	lsmmathmlphantomelement.h		\
 	lsmmathmlmathelement.h			\
 	lsmmathmltableelement.h			\
diff --git a/src/lsmmathmldocument.c b/src/lsmmathmldocument.c
index 5d66f3f..6065491 100644
--- a/src/lsmmathmldocument.c
+++ b/src/lsmmathmldocument.c
@@ -22,6 +22,7 @@
  */
 
 #include <lsmmathmldocument.h>
+#include <lsmmathmlsemanticselement.h>
 #include <lsmmathmlphantomelement.h>
 #include <lsmmathmlmathelement.h>
 #include <lsmmathmltableelement.h>
@@ -125,6 +126,8 @@ lsm_mathml_document_create_element (LsmDomDocument *document, const char *tag_na
 		node = lsm_mathml_align_mark_element_new ();
 	else if (strcmp (tag_name, "maligngroup") == 0)
 		node = lsm_mathml_align_group_element_new ();
+	else if (strcmp (tag_name, "semantics") == 0)
+		node = lsm_mathml_semantics_element_new ();
 	else if (strcmp (tag_name, "lasem:itex") == 0)
 		node = lsm_mathml_itex_element_new ();
 	else
diff --git a/src/lsmmathmlpresentationcontainer.c b/src/lsmmathmlpresentationcontainer.c
index 0865589..577631f 100644
--- a/src/lsmmathmlpresentationcontainer.c
+++ b/src/lsmmathmlpresentationcontainer.c
@@ -1,5 +1,5 @@
-/* lsmmathmlpresentationcontainer.c
- *
+/* Lasem - A library for SVG and MathML rendering
+ * 
  * Copyright  2007-2008  Emmanuel Pacaud
  *
  * This library is free software; you can redistribute it and/or
diff --git a/src/lsmmathmlpresentationcontainer.h b/src/lsmmathmlpresentationcontainer.h
index 31b0cb2..4cb1c40 100644
--- a/src/lsmmathmlpresentationcontainer.h
+++ b/src/lsmmathmlpresentationcontainer.h
@@ -1,5 +1,5 @@
-/* lsmmathmlpresentationcontainer.h
- *
+/* Lasem - A library for SVG and MathML rendering
+ * 
  * Copyright  2007-2008  Emmanuel Pacaud
  *
  * This library is free software; you can redistribute it and/or
diff --git a/src/lsmmathmlrowelement.c b/src/lsmmathmlrowelement.c
index 5d08ab0..cacf1ee 100644
--- a/src/lsmmathmlrowelement.c
+++ b/src/lsmmathmlrowelement.c
@@ -1,5 +1,5 @@
-/* lsmmathmlrowelement.c
- *
+/* Lasem - A library for SVG and MathML rendering
+ * 
  * Copyright  2007-2008  Emmanuel Pacaud
  *
  * This library is free software; you can redistribute it and/or
diff --git a/src/lsmmathmlrowelement.h b/src/lsmmathmlrowelement.h
index d310ba5..6c5baf3 100644
--- a/src/lsmmathmlrowelement.h
+++ b/src/lsmmathmlrowelement.h
@@ -1,6 +1,6 @@
-/* lsmmathmlrowelement.h
- *
- * Copyright  2007-2008  Emmanuel Pacaud
+/* Lasem - A library for SVG and MathML rendering
+ * 
+ * Copyright  2007-2011  Emmanuel Pacaud
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
diff --git a/src/lsmmathmlsemanticselement.c b/src/lsmmathmlsemanticselement.c
new file mode 100644
index 0000000..fd6aa56
--- /dev/null
+++ b/src/lsmmathmlsemanticselement.c
@@ -0,0 +1,60 @@
+/* Lasem - A library for SVG and MathML rendering
+ * 
+ * Copyright  2011 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author:
+ * 	Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+#include <lsmmathmlsemanticselement.h>
+#include <lsmmathmlview.h>
+
+/* LsmDomNode implementation */
+
+static const char *
+lsm_mathml_semantics_element_get_node_name (LsmDomNode *node)
+{
+	return "semantics";
+}
+
+/* LsmMathmlElement implementation */
+
+/* LsmMathmlSemanticsElement implementation */
+
+LsmDomNode *
+lsm_mathml_semantics_element_new (void)
+{
+	return g_object_new (LSM_TYPE_MATHML_SEMANTICS_ELEMENT, NULL);
+}
+
+static void
+lsm_mathml_semantics_element_init (LsmMathmlSemanticsElement *container)
+{
+}
+
+/* LsmMathmlSemanticsElement class */
+
+static void
+lsm_mathml_semantics_element_class_init (LsmMathmlSemanticsElementClass *klass)
+{
+	LsmDomNodeClass *d_node_class = LSM_DOM_NODE_CLASS (klass);
+
+	d_node_class->get_node_name = lsm_mathml_semantics_element_get_node_name;
+}
+
+G_DEFINE_TYPE (LsmMathmlSemanticsElement, lsm_mathml_semantics_element, LSM_TYPE_MATHML_ELEMENT)
diff --git a/src/lsmmathmlsemanticselement.h b/src/lsmmathmlsemanticselement.h
new file mode 100644
index 0000000..7235acc
--- /dev/null
+++ b/src/lsmmathmlsemanticselement.h
@@ -0,0 +1,56 @@
+/* Lasem - A library for SVG and MathML rendering
+ * 
+ * Copyright  2011 Emmanuel Pacaud
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author:
+ * 	Emmanuel Pacaud <emmanuel gnome org>
+ */
+
+#ifndef LSM_MATHML_SEMANTICS_ELEMENT_H
+#define LSM_MATHML_SEMANTICS_ELEMENT_H
+
+#include <lsmmathmltypes.h>
+#include <lsmmathmlelement.h>
+
+G_BEGIN_DECLS
+
+#define LSM_TYPE_MATHML_SEMANTICS_ELEMENT             (lsm_mathml_semantics_element_get_type ())
+#define LSM_MATHML_SEMANTICS_ELEMENT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), LSM_TYPE_MATHML_SEMANTICS_ELEMENT, LsmMathmlSemanticsElement))
+#define LSM_MATHML_SEMANTICS_ELEMENT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), LSM_TYPE_MATHML_SEMANTICS_ELEMENT, LsmMathmlSemanticsElementClass))
+#define LSM_IS_MATHML_SEMANTICS_ELEMENT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LSM_TYPE_MATHML_SEMANTICS_ELEMENT))
+#define LSM_IS_MATHML_SEMANTICS_ELEMENT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), LSM_TYPE_MATHML_SEMANTICS_ELEMENT))
+#define LSM_MATHML_SEMANTICS_ELEMENT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), LSM_TYPE_MATHML_SEMANTICS_ELEMENT, LsmMathmlSemanticsElementClass))
+
+typedef struct _LsmMathmlSemanticsElementClass LsmMathmlSemanticsElementClass;
+
+struct _LsmMathmlSemanticsElement {
+	LsmMathmlElement	element;
+};
+
+struct _LsmMathmlSemanticsElementClass {
+	LsmMathmlElementClass  parent_class;
+};
+
+GType lsm_mathml_semantics_element_get_type (void);
+
+LsmDomNode *		lsm_mathml_semantics_element_new 	(void);
+
+G_END_DECLS
+
+#endif
+
diff --git a/src/lsmmathmltypes.h b/src/lsmmathmltypes.h
index aea7c6c..14ef8f4 100644
--- a/src/lsmmathmltypes.h
+++ b/src/lsmmathmltypes.h
@@ -30,6 +30,7 @@ G_BEGIN_DECLS
 
 typedef struct _LsmMathmlDocument LsmMathmlDocument;
 typedef struct _LsmMathmlElement LsmMathmlElement;
+typedef struct _LsmMathmlSemanticsElement LsmMathmlSemanticsElement;
 typedef struct _LsmMathmlPhantomElement LsmMathmlPhantomElement;
 typedef struct _LsmMathmlTableElement LsmMathmlTableElement;
 typedef struct _LsmMathmlTableRowElement LsmMathmlTableRowElement;



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