00001
00002
00003 #ifndef _GSTREAMERMM_XML_H
00004 #define _GSTREAMERMM_XML_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <gst/gstxml.h>
00029 #include <gstreamermm/object.h>
00030 #include <libxml++/document.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 typedef struct _GstXML GstXML;
00035 typedef struct _GstXMLClass GstXMLClass;
00036 #endif
00037
00038
00039 namespace Gst
00040 { class XML_Class; }
00041 namespace Gst
00042 {
00043
00044 class Element;
00045
00056 class XML : public Object
00057 {
00058
00059 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00060
00061 public:
00062 typedef XML CppObjectType;
00063 typedef XML_Class CppClassType;
00064 typedef GstXML BaseObjectType;
00065 typedef GstXMLClass BaseClassType;
00066
00067 private: friend class XML_Class;
00068 static CppClassType xml_class_;
00069
00070 private:
00071
00072 XML(const XML&);
00073 XML& operator=(const XML&);
00074
00075 protected:
00076 explicit XML(const Glib::ConstructParams& construct_params);
00077 explicit XML(GstXML* castitem);
00078
00079 #endif
00080
00081 public:
00082 virtual ~XML();
00083
00084 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00085 static GType get_type() G_GNUC_CONST;
00086
00087
00088 static GType get_base_type() G_GNUC_CONST;
00089 #endif
00090
00092 GstXML* gobj() { return reinterpret_cast<GstXML*>(gobject_); }
00093
00095 const GstXML* gobj() const { return reinterpret_cast<GstXML*>(gobject_); }
00096
00098 GstXML* gobj_copy();
00099
00100 private:
00101
00102
00103 protected:
00104 XML();
00105
00106 public:
00111 static Glib::RefPtr<XML> create();
00112
00113
00118 static xmlDocPtr write(const Glib::RefPtr<const Gst::Element>& element);
00119
00126 static void write_to_stream(const Glib::RefPtr<const Gst::Element>& element, std::ostream& out);
00127
00128
00135 bool parse_doc(xmlpp::Document* doc, Glib::ustring& root);
00136
00149 bool parse_file(const std::string& filename, const Glib::ustring& root);
00150
00158 bool parse_memory(const std::string& buffer, const Glib::ustring& root);
00159
00160
00167 Glib::RefPtr<Gst::Element> get_element(const Glib::ustring& name);
00168
00175 Glib::RefPtr<const Gst::Element> get_element(const Glib::ustring& name) const;
00176
00177
00184 Glib::ListHandle< Glib::RefPtr<Gst::Element> > get_topelements();
00185
00186
00193 Glib::ListHandle< Glib::RefPtr<const Gst::Element> > get_topelements() const;
00194
00195
00201 static Glib::RefPtr<Gst::Element> make_element(xmlpp::Node* curr, const Glib::RefPtr<Gst::Object>& parent);
00202
00203
00206
00207
00213 Glib::SignalProxy2< void,const Glib::RefPtr<Gst::Object>&,xmlNodePtr > signal_object_loaded();
00214
00215
00216 public:
00217
00218 public:
00219
00220 #ifdef GLIBMM_VFUNCS_ENABLED
00221 #endif //GLIBMM_VFUNCS_ENABLED
00222
00223 protected:
00224
00225 #ifdef GLIBMM_VFUNCS_ENABLED
00226 #endif //GLIBMM_VFUNCS_ENABLED
00227
00228
00229 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00230 virtual void on_object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNodePtr xml_node);
00231 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00232
00233
00234 };
00235
00236 }
00237
00238
00239 namespace Glib
00240 {
00249 Glib::RefPtr<Gst::XML> wrap(GstXML* object, bool take_copy = false);
00250 }
00251
00252
00253 #endif
00254