2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wim.taymans@chello.be>
5 * gstxml.h: Header for XML save/restore operations
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.
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.
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.
26 #include <gst/gstconfig.h>
28 #ifndef GST_DISABLE_LOADSAVE
30 #include <gst/gstelement.h>
34 #define GST_TYPE_XML \
36 #define GST_XML(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XML,GstXML))
38 #define GST_XML_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_XML,GstXMLClass))
40 #define GST_IS_XML(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XML))
42 #define GST_IS_XML_CLASS(obj) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XML))
45 typedef struct _GstXML GstXML;
46 typedef struct _GstXMLClass GstXMLClass;
57 GstObjectClass parent_class;
59 /* signal callbacks */
60 void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self);
61 void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
64 GType gst_xml_get_type (void);
67 /* create an XML document out of a pipeline */
68 xmlDocPtr gst_xml_write (GstElement *element);
70 /* write a formatted representation of a pipeline to an open file */
71 gint gst_xml_write_file (GstElement *element, FILE *out);
73 GstXML* gst_xml_new (void);
75 gboolean gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root);
76 gboolean gst_xml_parse_file (GstXML *xml, const guchar *fname, const guchar *root);
77 gboolean gst_xml_parse_memory (GstXML *xml, guchar *buffer, guint size, const gchar *root);
80 GstElement* gst_xml_get_element (GstXML *xml, const guchar *name);
81 GList* gst_xml_get_topelements (GstXML *xml);
83 GstElement* gst_xml_make_element (xmlNodePtr cur, GstObject *parent);
87 #else /* GST_DISABLE_LOADSAVE */
89 #pragma GCC poison gst_xml_write
90 #pragma GCC poison gst_xml_new
91 #pragma GCC poison gst_xml_parse_doc
92 #pragma GCC poison gst_xml_parse_file
93 #pragma GCC poison gst_xml_parse_memory
94 #pragma GCC poison gst_xml_get_element
95 #pragma GCC poison gst_xml_get_topelements
97 #endif /* GST_DISABLE_LOADSAVE */
99 #endif /* __GST_XML_H__ */