gstreamermm: interface.h Source File

- Main Page
- Modules
- Namespaces
- Classes
- Files

# interface.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_INTERFACE_H
    00004 #define _GSTREAMERMM_INTERFACE_H
    00005
    00006
    00007 #include <glibmm.h>
    00008
    00009 /* gstreamermm - a C++ wrapper for gstreamer
    00010  *
    00011  * Copyright 2008 The gstreamermm Development Team
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Lesser General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2.1 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Lesser General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Lesser General Public
    00024  * License along with this library; if not, write to the Free
    00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00026  */
    00027
    00028 #include <glibmm/interface.h>
    00029 #include <gstreamermm/element.h>
    00030
    00031
    00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00033 typedef struct _GstImplementsInterface GstImplementsInterface;
    00034 typedef struct _GstImplementsInterfaceClass GstImplementsInterfaceClass;
    00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00036
    00037
    00038 namespace Gst
    00039 { class Interface_Class; } // namespace Gst
    00040 namespace Gst
    00041 {
    00042
    00050 class Interface : public Glib::Interface
    00051 {
    00052
    00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00054
    00055 public:
    00056   typedef Interface CppObjectType;
    00057   typedef Interface_Class CppClassType;
    00058   typedef GstImplementsInterface BaseObjectType;
    00059   typedef GstImplementsInterface BaseClassType;
    00060
    00061 private:
    00062   friend class Interface_Class;
    00063   static CppClassType interface_class_;
    00064
    00065   // noncopyable
    00066   Interface(const Interface&);
    00067   Interface& operator=(const Interface&);
    00068
    00069 protected:
    00070   Interface(); // you must derive from this class
    00071
    00078   explicit Interface(const Glib::Interface_Class& interface_class);
    00079
    00080 public:
    00081   // This is public so that C++ wrapper instances can be
    00082   // created for C instances of unwrapped types.
    00083   // For instance, if an unexpected C type implements the C interface.
    00084   explicit Interface(GstImplementsInterface* castitem);
    00085
    00086 protected:
    00087 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00088
    00089 public:
    00090   virtual ~Interface();
    00091
    00092   static void add_interface(GType gtype_implementer);
    00093
    00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00095   static GType get_type()      G_GNUC_CONST;
    00096   static GType get_base_type() G_GNUC_CONST;
    00097 #endif
    00098
    00100   GstImplementsInterface*       gobj()       { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
    00101
    00103   const GstImplementsInterface* gobj() const { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
    00104
    00105 private:
    00106
    00107
    00108 public:
    00109
    00115   static bool element_implements(const Glib::RefPtr<const Gst::Element>&element, GType iface_type);
    00116
    00117   template <class T_CastTo>
    00118   static Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > cast(const Glib::RefPtr<Gst::Element>& element);
    00119
    00120   //For some reason, gmmproc thinks that all of the GstElement functions (and
    00121   //signals) are also members of GstImplementsInterface.
    00122
    00123
    00124 public:
    00125
    00126 public:
    00127   //C++ methods used to invoke GTK+ virtual functions:
    00128 #ifdef GLIBMM_VFUNCS_ENABLED
    00129 #endif //GLIBMM_VFUNCS_ENABLED
    00130
    00131 protected:
    00132   //GTK+ Virtual Functions (override these to change behaviour):
    00133 #ifdef GLIBMM_VFUNCS_ENABLED
    00134 #endif //GLIBMM_VFUNCS_ENABLED
    00135
    00136   //Default Signal Handlers::
    00137 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00138 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00139
    00140
    00141 };
    00142
    00143 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00144
    00145 template <class T_CastTo>
    00146 Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > Interface::cast(const Glib::RefPtr<Gst::Element>& element)
    00147 {
    00148   if (element && gst_element_implements_interface(element->gobj(), T_CastTo::get_type()))
    00149   {
    00150     void* result =
    00151       gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
    00152
    00153     Gst::ElementInterfaced<T_CastTo>* element_interfaced =
    00154       new ElementInterfaced<T_CastTo>((GstElement*) result);
    00155
    00156     return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(element_interfaced);
    00157   }
    00158   else
    00159     return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(0);
    00160 }
    00161
    00162 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00163
    00164 } //namespace Gst
    00165
    00166
    00167 namespace Glib
    00168 {
    00177   Glib::RefPtr<Gst::Interface> wrap(GstImplementsInterface* object, bool take_copy = false);
    00178
    00179 } // namespace Glib
    00180
    00181
    00182 #endif /* _GSTREAMERMM_INTERFACE_H */
    00183