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 Gst::Element>&element, GType iface_type);
00117
00118 template <class T_CastTo>
00119 static Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > cast(const Glib::RefPtr<Gst::Element>& element);
00120
00121
00122
00123
00124
00125 public:
00126
00127 public:
00128
00129 #ifdef GLIBMM_VFUNCS_ENABLED
00130 #endif //GLIBMM_VFUNCS_ENABLED
00131
00132 protected:
00133
00134 #ifdef GLIBMM_VFUNCS_ENABLED
00135 #endif //GLIBMM_VFUNCS_ENABLED
00136
00137
00138 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00139 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00140
00141
00142 };
00143
00144 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00145
00146 template <class T_CastTo>
00147 Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > Interface::cast(const Glib::RefPtr<Gst::Element>& element)
00148 {
00149 if (element && gst_element_implements_interface(element->gobj(), T_CastTo::get_type()))
00150 {
00151 void* result =
00152 gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
00153
00154 Gst::ElementInterfaced<T_CastTo>* element_interfaced =
00155 new ElementInterfaced<T_CastTo>((GstElement*) result);
00156
00157 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(element_interfaced);
00158 }
00159 else
00160 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(0);
00161 }
00162
00163 #endif
00164
00165 }
00166
00167
00168 namespace Glib
00169 {
00178 Glib::RefPtr<Gst::Interface> wrap(GstImplementsInterface* object, bool take_copy = false);
00179
00180 }
00181
00182
00183 #endif
00184