00001
00002
00003 #ifndef _GSTREAMERMM_INTERFACE_H
00004 #define _GSTREAMERMM_INTERFACE_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
00029
00030 #include <glibmm/interface.h>
00031 #include <gstreamermm/element.h>
00032
00033
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GstImplementsInterface GstImplementsInterface;
00036 typedef struct _GstImplementsInterfaceClass GstImplementsInterfaceClass;
00037 #endif
00038
00039
00040 namespace Gst
00041 { class Interface_Class; }
00042 namespace Gst
00043 {
00044
00051 class Interface : public Glib::Interface
00052 {
00053
00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00055
00056 public:
00057 typedef Interface CppObjectType;
00058 typedef Interface_Class CppClassType;
00059 typedef GstImplementsInterface BaseObjectType;
00060 typedef GstImplementsInterface BaseClassType;
00061
00062 private:
00063 friend class Interface_Class;
00064 static CppClassType interface_class_;
00065
00066
00067 Interface(const Interface&);
00068 Interface& operator=(const Interface&);
00069
00070 protected:
00071 Interface();
00072
00079 explicit Interface(const Glib::Interface_Class& interface_class);
00080
00081 public:
00082
00083
00084
00085 explicit Interface(GstImplementsInterface* castitem);
00086
00087 protected:
00088 #endif
00089
00090 public:
00091 virtual ~Interface();
00092
00093 static void add_interface(GType gtype_implementer);
00094
00095 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00096 static GType get_type() G_GNUC_CONST;
00097 static GType get_base_type() G_GNUC_CONST;
00098 #endif
00099
00101 GstImplementsInterface* gobj() { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
00102
00104 const GstImplementsInterface* gobj() const { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
00105
00106 private:
00107
00108
00109 public:
00110
00116 static bool element_implements(const Glib::RefPtr<const Element>&element, GType iface_type);
00117
00118 template <class T_CastTo>
00119 static Glib::RefPtr< ElementInterfaced<T_CastTo> > cast(const Glib::RefPtr<Element>& element);
00120
00121
00122 public:
00123
00124 public:
00125
00126 #ifdef GLIBMM_VFUNCS_ENABLED
00127 #endif //GLIBMM_VFUNCS_ENABLED
00128
00129 protected:
00130
00131 #ifdef GLIBMM_VFUNCS_ENABLED
00132 #endif //GLIBMM_VFUNCS_ENABLED
00133
00134
00135 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00136 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00137
00138
00139 };
00140
00141 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00142
00143 template <class T_CastTo>
00144 Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > Interface::cast(const Glib::RefPtr<Element>& element)
00145 {
00146 if (element && gst_element_implements_interface(element->gobj(), T_CastTo::get_type()))
00147 {
00148 void* result =
00149 gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
00150
00151 Gst::ElementInterfaced<T_CastTo>* element_interfaced =
00152 new ElementInterfaced<T_CastTo>((GstElement*) result);
00153
00154 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(element_interfaced);
00155 }
00156 else
00157 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(0);
00158 }
00159
00160 #endif
00161
00162 }
00163
00164
00165 namespace Glib
00166 {
00175 Glib::RefPtr<Gst::Interface> wrap(GstImplementsInterface* object, bool take_copy = false);
00176
00177 }
00178
00179
00180 #endif
00181