This is a megapatch with the following changes:
[platform/upstream/gstreamer.git] / gst / gstxml.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wim.taymans@chello.be>
4  *
5  * gstxml.h: Header for XML save/restore operations
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef __GST_XML_H__
24 #define __GST_XML_H__
25
26 #include <parser.h>
27
28 // Include compatability defines: if libxml hasn't already defined these,
29 // we have an old version 1.x
30 #ifndef xmlChildrenNode
31 #define xmlChildrenNode childs
32 #define xmlRootNode root
33 #endif
34
35 #include <gst/gstelement.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 #define GST_TYPE_XML \
42   (gst_xml_get_type())
43 #define GST_XML(obj) \
44   (GTK_CHECK_CAST((obj),GST_TYPE_XML,GstXML))
45 #define GST_XML_CLASS(klass) \
46   (GTK_CHECK_CLASS_CAST((klass),GST_TYPE_XML,GstXMLClass))
47 #define GST_IS_XML(obj) \
48   (GTK_CHECK_TYPE((obj),GST_TYPE_XML))
49 #define GST_IS_XML_CLASS(obj) \
50   (GTK_CHECK_CLASS_TYPE((klass),GST_TYPE_XML))
51
52 typedef struct _GstXML GstXML;
53 typedef struct _GstXMLClass GstXMLClass;
54
55 struct _GstXML {
56   GstObject object;
57
58   GList      *topelements;
59
60   xmlNsPtr ns;
61 };
62
63 struct _GstXMLClass {
64   GstObjectClass parent_class;
65
66   /* signal callbacks */
67   void (*object_loaded)         (GstXML *xml, GstObject *object, xmlNodePtr self);
68   void (*object_saved)          (GstXML *xml, GstObject *object, xmlNodePtr self);
69 };
70
71 GtkType         gst_xml_get_type        (void);
72
73
74 /* create an XML document out of a pipeline */
75 xmlDocPtr       gst_xml_write           (GstElement *element);
76
77 GstXML*         gst_xml_new             (void);
78
79 gboolean        gst_xml_parse_file      (GstXML *xml, const guchar *fname, const guchar *root);
80 gboolean        gst_xml_parse_memory    (GstXML *xml, guchar *buffer, guint size, const gchar *root);
81
82
83 GstElement*     gst_xml_get_element     (GstXML *xml, const guchar *name);
84 GList*          gst_xml_get_topelements (GstXML *xml);
85
86 void            gst_xml_object_loaded   (GstXML *xml, GstObject *object, xmlNodePtr self);
87 void            gst_xml_object_saved    (GstXML *xml, GstObject *object, xmlNodePtr self);
88
89 #ifdef __cplusplus
90 }
91 #endif /* __cplusplus */
92
93 #endif /* __GST_XML_H__ */