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 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00010 
00011 /* gstreamermm - a C++ wrapper for gstreamer
00012  *
00013  * Copyright 2008 The gstreamermm Development Team
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free
00027  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00038 
00039 
00040 namespace Gst
00041 { class Interface_Class; } // namespace Gst
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   // noncopyable
00067   Interface(const Interface&);
00068   Interface& operator=(const Interface&);
00069 
00070 protected:
00071   Interface(); // you must derive from this class
00072 
00079   explicit Interface(const Glib::Interface_Class& interface_class);
00080 
00081 public:
00082   // This is public so that C++ wrapper instances can be
00083   // created for C instances of unwrapped types.
00084   // For instance, if an unexpected C type implements the C interface. 
00085   explicit Interface(GstImplementsInterface* castitem);
00086 
00087 protected:
00088 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
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   //C++ methods used to invoke GTK+ virtual functions:
00126 #ifdef GLIBMM_VFUNCS_ENABLED
00127 #endif //GLIBMM_VFUNCS_ENABLED
00128 
00129 protected:
00130   //GTK+ Virtual Functions (override these to change behaviour):
00131 #ifdef GLIBMM_VFUNCS_ENABLED
00132 #endif //GLIBMM_VFUNCS_ENABLED
00133 
00134   //Default Signal Handlers::
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00161 
00162 } //namespace Gst
00163 
00164 
00165 namespace Glib
00166 {
00175   Glib::RefPtr<Gst::Interface> wrap(GstImplementsInterface* object, bool take_copy = false);
00176 
00177 } // namespace Glib
00178 
00179 
00180 #endif /* _GSTREAMERMM_INTERFACE_H */
00181 

Generated on Sun Jul 27 17:07:20 2008 for gstreamermm by  doxygen 1.5.4