[lasem] dom_document_fgragment: new.



commit fd8eececd672fbeb44e1bb23dde46019cd384167
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Nov 16 22:25:55 2010 +0100

    dom_document_fgragment: new.

 docs/reference/lasem/lasem-docs.xml     |    1 +
 docs/reference/lasem/lasem-sections.txt |   16 ++++++
 src/Makefile.am                         |    2 +
 src/lsmdomdocumentfragment.c            |   81 +++++++++++++++++++++++++++++++
 src/lsmdomdocumentfragment.h            |   55 +++++++++++++++++++++
 src/lsmdomtypes.h                       |    1 +
 6 files changed, 156 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/lasem/lasem-docs.xml b/docs/reference/lasem/lasem-docs.xml
index b080ef8..22f1e58 100644
--- a/docs/reference/lasem/lasem-docs.xml
+++ b/docs/reference/lasem/lasem-docs.xml
@@ -41,6 +41,7 @@
 			<xi:include href="xml/lsmdomnode.xml"/>
 			<xi:include href="xml/lsmdomnodelist.xml"/>
 			<xi:include href="xml/lsmdomdocument.xml"/>
+			<xi:include href="xml/lsmdomdocumentfragment.xml"/>
 			<xi:include href="xml/lsmdomelement.xml"/>
 			<xi:include href="xml/lsmdomcharacterdata.xml"/>
 			<xi:include href="xml/lsmdomtext.xml"/>
diff --git a/docs/reference/lasem/lasem-sections.txt b/docs/reference/lasem/lasem-sections.txt
index cad8e43..84c3f25 100644
--- a/docs/reference/lasem/lasem-sections.txt
+++ b/docs/reference/lasem/lasem-sections.txt
@@ -113,6 +113,22 @@ LsmDomDocumentError
 </SECTION>
 
 <SECTION>
+<FILE>lsmdomdocumentfragment</FILE>
+<TITLE>LsmDomDocumentFragment</TITLE>
+lsm_dom_document_fragment_new
+<SUBSECTION Standard>
+LSM_DOM_DOCUMENT_FRAGMENT
+LSM_DOM_DOCUMENT_FRAGMENT_CLASS
+LSM_DOM_DOCUMENT_FRAGMENT_GET_CLASS
+LSM_IS_DOM_DOCUMENT_FRAGMENT
+LSM_IS_DOM_DOCUMENT_FRAGMENT_CLASS
+LSM_TYPE_DOM_DOCUMENT_FRAGMENT
+LsmDomDocumentFragment
+LsmDomDocumentFragmentClass
+lsm_dom_document_fragment_get_type
+</SECTION>
+
+<SECTION>
 <FILE>lsmdomelement</FILE>
 <TITLE>LsmDomElement</TITLE>
 LsmDomElement
diff --git a/src/Makefile.am b/src/Makefile.am
index 5bae194..5121d8a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,6 +44,7 @@ LASEM_DOM_SRCS =				\
 	lsmdomnode.c				\
 	lsmdomnodelist.c			\
 	lsmdomdocument.c			\
+	lsmdomdocumentfragment.c		\
 	lsmdomelement.c				\
 	lsmdomcharacterdata.c			\
 	lsmdomtext.c				\
@@ -141,6 +142,7 @@ LASEM_DOM_HDRS = 				\
 	lsmdomnode.h				\
 	lsmdomnodelist.h			\
 	lsmdomdocument.h			\
+	lsmdomdocumentfragment.h		\
 	lsmdomelement.h				\
 	lsmdomcharacterdata.h			\
 	lsmdomtext.h				\
diff --git a/src/lsmdomdocumentfragment.c b/src/lsmdomdocumentfragment.c
new file mode 100644
index 0000000..5ebbc54
--- /dev/null
+++ b/src/lsmdomdocumentfragment.c
@@ -0,0 +1,81 @@
+/* Lasem - SVG and Mathml library
+ *
+ * Copyright © 2010 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>
+ */
+
+/**
+ * SECTION:lsmdomdocumentfragment
+ * @short_description: Base class for DOM document fragments
+ */
+
+#include <lsmdomdocumentfragment.h>
+#include <string.h>
+
+static GObjectClass *parent_class = NULL;
+
+/* LsmDomNode implementation */
+
+static const char *
+lsm_dom_document_fragment_get_node_name (LsmDomNode *node)
+{
+	return "#document-fragment";
+}
+
+static const char *
+lsm_dom_document_fragment_get_node_value (LsmDomNode *node)
+{
+	return NULL;
+}
+
+static LsmDomNodeType
+lsm_dom_document_fragment_get_node_type (LsmDomNode *node)
+{
+	return LSM_DOM_NODE_TYPE_DOCUMENT_FRAGMENT_NODE;
+}
+
+/* LsmDomDocumentFragment implementation */
+
+LsmDomDocumentFragment *
+lsm_dom_document_fragment_new (void)
+{
+	return g_object_new (LSM_TYPE_DOM_DOCUMENT_FRAGMENT, NULL);
+}
+
+static void
+lsm_dom_document_fragment_init (LsmDomDocumentFragment *document_fragment)
+{
+}
+
+/* LsmDomDocumentFragment class */
+
+static void
+lsm_dom_document_fragment_class_init (LsmDomDocumentFragmentClass *klass)
+{
+	LsmDomNodeClass *node_class = LSM_DOM_NODE_CLASS (klass);
+
+	parent_class = g_type_class_peek_parent (klass);
+
+	node_class->get_node_name = lsm_dom_document_fragment_get_node_name;
+	node_class->get_node_value = lsm_dom_document_fragment_get_node_value;
+	node_class->get_node_type = lsm_dom_document_fragment_get_node_type;
+}
+
+G_DEFINE_ABSTRACT_TYPE (LsmDomDocumentFragment, lsm_dom_document_fragment, LSM_TYPE_DOM_NODE)
diff --git a/src/lsmdomdocumentfragment.h b/src/lsmdomdocumentfragment.h
new file mode 100644
index 0000000..3520fd9
--- /dev/null
+++ b/src/lsmdomdocumentfragment.h
@@ -0,0 +1,55 @@
+/* Lasem - SVG and Mathml library
+ *
+ * Copyright © 2010 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_DOM_DOCUMENT_FRAGMENT_H
+#define LSM_DOM_DOCUMENT_FRAGMENT_H
+
+#include <lsmdom.h>
+#include <lsmdomnode.h>
+
+G_BEGIN_DECLS
+
+#define LSM_TYPE_DOM_DOCUMENT_FRAGMENT             (lsm_dom_document_fragment_get_type ())
+#define LSM_DOM_DOCUMENT_FRAGMENT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), LSM_TYPE_DOM_DOCUMENT_FRAGMENT, LsmDomDocumentFragment))
+#define LSM_DOM_DOCUMENT_FRAGMENT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), LSM_TYPE_DOM_DOCUMENT_FRAGMENT, LsmDomDocumentFragmentClass))
+#define LSM_IS_DOM_DOCUMENT_FRAGMENT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LSM_TYPE_DOM_DOCUMENT_FRAGMENT))
+#define LSM_IS_DOM_DOCUMENT_FRAGMENT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), LSM_TYPE_DOM_DOCUMENT_FRAGMENT))
+#define LSM_DOM_DOCUMENT_FRAGMENT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), LSM_TYPE_DOM_DOCUMENT_FRAGMENT, LsmDomDocumentFragmentClass))
+
+typedef struct _LsmDomDocumentFragmentClass LsmDomDocumentFragmentClass;
+
+struct _LsmDomDocumentFragment {
+	LsmDomNode node;
+};
+
+struct _LsmDomDocumentFragmentClass {
+	LsmDomNodeClass parent_class;
+};
+
+GType lsm_dom_document_fragment_get_type (void);
+
+LsmDomDocumentFragment * 	lsm_dom_document_fragment_new 		(void);
+
+G_END_DECLS
+
+#endif
diff --git a/src/lsmdomtypes.h b/src/lsmdomtypes.h
index f922751..60ea309 100644
--- a/src/lsmdomtypes.h
+++ b/src/lsmdomtypes.h
@@ -32,6 +32,7 @@ typedef struct _LsmDomNode LsmDomNode;
 typedef struct _LsmDomNodeList LsmDomNodeList;
 typedef struct _LsmDomElement LsmDomElement;
 typedef struct _LsmDomDocument LsmDomDocument;
+typedef struct _LsmDomDocumentFragment LsmDomDocumentFragment;
 typedef struct _LsmDomCharacterData LsmDomCharacterData;
 typedef struct _LsmDomText LsmDomText;
 



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