[lasem] mathml: new enclose element



commit 7c4bf9df5cff838f8129da5e93a8614a122255a1
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sun Jan 18 22:37:16 2015 +0100

    mathml: new enclose element
    
    Does nothing yet, but at least element content is shown now.

 src/Makefile.am               |    2 +
 src/lsmmathmldocument.c       |    3 ++
 src/lsmmathmlencloseelement.c |   58 +++++++++++++++++++++++++++++++++++++++++
 src/lsmmathmlencloseelement.h |   56 +++++++++++++++++++++++++++++++++++++++
 src/lsmmathmltypes.h          |    1 +
 5 files changed, 120 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index f65ec10..85c25b6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -80,6 +80,7 @@ LASEM_MATHML_SRCS =                           \
        lsmmathmlpresentationcontainer.c        \
        lsmmathmlstyleelement.c                 \
        lsmmathmlrowelement.c                   \
+       lsmmathmlencloseelement.c               \
        lsmmathmlfencedelement.c                \
        lsmmathmlpaddedelement.c                \
        lsmmathmlerrorelement.c                 \
@@ -195,6 +196,7 @@ LASEM_MATHML_HDRS =                         \
        lsmmathmlpresentationcontainer.h        \
        lsmmathmlstyleelement.h                 \
        lsmmathmlrowelement.h                   \
+       lsmmathmlencloseelement.h                       \
        lsmmathmlfencedelement.h                \
        lsmmathmlpaddedelement.h                \
        lsmmathmlerrorelement.h                 \
diff --git a/src/lsmmathmldocument.c b/src/lsmmathmldocument.c
index 684dad5..685f989 100644
--- a/src/lsmmathmldocument.c
+++ b/src/lsmmathmldocument.c
@@ -36,6 +36,7 @@
 #include <lsmmathmloperatorelement.h>
 #include <lsmmathmlstringelement.h>
 #include <lsmmathmlrowelement.h>
+#include <lsmmathmlencloseelement.h>
 #include <lsmmathmlpaddedelement.h>
 #include <lsmmathmlfencedelement.h>
 #include <lsmmathmlerrorelement.h>
@@ -102,6 +103,8 @@ _create_element (LsmDomDocument *document, const char *tag_name)
                node = lsm_mathml_operator_element_new ();
        else if (strcmp (tag_name, "mrow") == 0)
                node = lsm_mathml_row_element_new ();
+       else if (strcmp (tag_name, "menclose") == 0)
+               node = lsm_mathml_enclose_element_new ();
        else if (strcmp (tag_name, "mn") == 0)
                node = lsm_mathml_number_element_new ();
        else if (strcmp (tag_name, "mi") == 0)
diff --git a/src/lsmmathmlencloseelement.c b/src/lsmmathmlencloseelement.c
new file mode 100644
index 0000000..13c7d8c
--- /dev/null
+++ b/src/lsmmathmlencloseelement.c
@@ -0,0 +1,58 @@
+/* Lasem
+ * 
+ * Copyright © 2007-2008 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 <lsmmathmlencloseelement.h>
+
+/* LsmDomNode implementation */
+
+static const char *
+lsm_mathml_enclose_element_get_node_name (LsmDomNode *node)
+{
+       return "menclose";
+}
+
+/* LsmMathmlEncloseElement implementation */
+
+LsmDomNode *
+lsm_mathml_enclose_element_new (void)
+{
+       return g_object_new (LSM_TYPE_MATHML_ENCLOSE_ELEMENT, NULL);
+}
+
+static void
+lsm_mathml_enclose_element_init (LsmMathmlEncloseElement *element)
+{
+}
+
+/* LsmMathmlEncloseElement class */
+
+static void
+lsm_mathml_enclose_element_class_init (LsmMathmlEncloseElementClass *klass)
+{
+       LsmDomNodeClass *d_node_class = LSM_DOM_NODE_CLASS (klass);
+
+       d_node_class->get_node_name = lsm_mathml_enclose_element_get_node_name;
+}
+
+G_DEFINE_TYPE (LsmMathmlEncloseElement, lsm_mathml_enclose_element, LSM_TYPE_MATHML_PRESENTATION_CONTAINER)
+
diff --git a/src/lsmmathmlencloseelement.h b/src/lsmmathmlencloseelement.h
new file mode 100644
index 0000000..8496029
--- /dev/null
+++ b/src/lsmmathmlencloseelement.h
@@ -0,0 +1,56 @@
+/* Lasem
+ * 
+ * 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
+ * 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_ENCLOSE_ELEMENT_H
+#define LSM_MATHML_ENCLOSE_ELEMENT_H
+
+#include <lsmmathmltypes.h>
+#include <lsmmathmlpresentationcontainer.h>
+
+G_BEGIN_DECLS
+
+#define LSM_TYPE_MATHML_ENCLOSE_ELEMENT             (lsm_mathml_enclose_element_get_type ())
+#define LSM_MATHML_ENCLOSE_ELEMENT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
LSM_TYPE_MATHML_ENCLOSE_ELEMENT, LsmMathmlEncloseElement))
+#define LSM_MATHML_ENCLOSE_ELEMENT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), 
LSM_TYPE_MATHML_ENCLOSE_ELEMENT, LsmMathmlEncloseElementClass))
+#define LSM_IS_MATHML_ENCLOSE_ELEMENT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
LSM_TYPE_MATHML_ENCLOSE_ELEMENT))
+#define LSM_IS_MATHML_ENCLOSE_ELEMENT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), 
LSM_TYPE_MATHML_ENCLOSE_ELEMENT))
+#define LSM_MATHML_ENCLOSE_ELEMENT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), 
LSM_TYPE_MATHML_ENCLOSE_ELEMENT, LsmMathmlEncloseElementClass))
+
+typedef struct _LsmMathmlEncloseElementClass LsmMathmlEncloseElementClass;
+
+struct _LsmMathmlEncloseElement {
+       LsmMathmlPresentationContainer presentation_container;
+};
+
+struct _LsmMathmlEncloseElementClass {
+       LsmMathmlPresentationContainerClass parent_class;
+};
+
+GType lsm_mathml_enclose_element_get_type (void);
+
+LsmDomNode *lsm_mathml_enclose_element_new (void);
+
+G_END_DECLS
+
+#endif
+
diff --git a/src/lsmmathmltypes.h b/src/lsmmathmltypes.h
index 14ef8f4..ebc148e 100644
--- a/src/lsmmathmltypes.h
+++ b/src/lsmmathmltypes.h
@@ -48,6 +48,7 @@ typedef struct _LsmMathmlStringElement LsmMathmlStringElement;
 typedef struct _LsmMathmlPresentationContainer LsmMathmlPresentationContainer;
 typedef struct _LsmMathmlStyleElement LsmMathmlStyleElement;
 typedef struct _LsmMathmlRowElement LsmMathmlRowElement;
+typedef struct _LsmMathmlEncloseElement LsmMathmlEncloseElement;
 typedef struct _LsmMathmlFencedElement LsmMathmlFencedElement;
 typedef struct _LsmMathmlPaddedElement LsmMathmlPaddedElement;
 typedef struct _LsmMathmlErrorElement LsmMathmlErrorElement;


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