clean up DefineFont3 code
[swfdec.git] / libswfdec / swfdec_xml.h
blobc06562d9d78dcc9956a4e3e36fb19750facbf74c
1 /* Swfdec
2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 #ifndef _SWFDEC_XML_H_
22 #define _SWFDEC_XML_H_
24 #include <libswfdec/swfdec_as_object.h>
25 #include <libswfdec/swfdec_types.h>
26 #include <libswfdec/swfdec_script.h>
27 #include <libswfdec/swfdec_xml_node.h>
29 G_BEGIN_DECLS
31 typedef struct _SwfdecXml SwfdecXml;
32 typedef struct _SwfdecXmlClass SwfdecXmlClass;
34 #define SWFDEC_TYPE_XML (swfdec_xml_get_type())
35 #define SWFDEC_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_XML))
36 #define SWFDEC_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_XML))
37 #define SWFDEC_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_XML, SwfdecXml))
38 #define SWFDEC_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_XML, SwfdecXmlClass))
39 #define SWFDEC_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_XML, SwfdecXmlClass))
41 typedef enum {
42 XML_PARSE_STATUS_OK = 0,
43 XML_PARSE_STATUS_CDATA_NOT_TERMINATED = -2,
44 XML_PARSE_STATUS_XMLDECL_NOT_TERMINATED = -3,
45 XML_PARSE_STATUS_DOCTYPEDECL_NOT_TERMINATED = -4,
46 XML_PARSE_STATUS_COMMENT_NOT_TERMINATED = -5,
47 XML_PARSE_STATUS_ELEMENT_MALFORMED = -6,
48 XML_PARSE_STATUS_OUT_OF_MEMORY = -7,
49 XML_PARSE_STATUS_ATTRIBUTE_NOT_TERMINATED = -8,
50 XML_PARSE_STATUS_TAG_NOT_CLOSED = -9, // FIXME are the two correct?
51 XML_PARSE_STATUS_TAG_MISMATCH = -10
52 } SwfdecXmlParseStatus;
54 struct _SwfdecXml {
55 SwfdecXmlNode xml_node;
57 gboolean ignoreWhite;
58 SwfdecXmlParseStatus status;
59 const char *xmlDecl;
60 const char *docTypeDecl;
62 SwfdecAsValue contentType;
63 SwfdecAsValue loaded;
66 struct _SwfdecXmlClass {
67 SwfdecXmlNodeClass xml_node_class;
70 GType swfdec_xml_get_type (void);
72 char * swfdec_xml_escape (const char *orginal);
73 char * swfdec_xml_unescape (const char *orginal);
75 G_END_DECLS
76 #endif