// Generated by gtkmmproc -- DO NOT MODIFY!


#include <gstreamermm/propertyprobe.h>
#include <gstreamermm/private/propertyprobe_p.h>

/* gstreamermm - a C++ wrapper for gstreamer
 *
 * Copyright 2008 The gstreamermm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

namespace
{


static void PropertyProbe_signal_probe_needed_callback(GstPropertyProbe* self, const GParamSpec* p0,void* data)
{
  using namespace Gst;
  typedef sigc::slot< void,const GParamSpec* > SlotType;

  // Do not try to call a signal on a disassociated wrapper.
  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
  {
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    try
    {
    #endif //GLIBMM_EXCEPTIONS_ENABLED
      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(p0);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo PropertyProbe_signal_probe_needed_info =
{
  "probe_needed",
  (GCallback) &PropertyProbe_signal_probe_needed_callback,
  (GCallback) &PropertyProbe_signal_probe_needed_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gst::PropertyProbe> wrap(GstPropertyProbe* object, bool take_copy)
{
  return Glib::RefPtr<Gst::PropertyProbe>( dynamic_cast<Gst::PropertyProbe*> (Glib::wrap_auto_interface<Gst::PropertyProbe> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Gst
{


/* The *_Class implementation: */

const Glib::Interface_Class& PropertyProbe_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &PropertyProbe_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = gst_property_probe_get_type();
  }

  return *this;
}

void PropertyProbe_Class::iface_init_function(void* g_iface, void*)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != 0); 

  klass->get_properties = &get_properties_vfunc_callback;
  klass->needs_probe = &needs_probe_vfunc_callback;
  klass->probe_property = &probe_property_vfunc_callback;
  klass->get_values = &get_values_vfunc_callback;

  klass->probe_needed = &probe_needed_callback;
}

const GList* PropertyProbe_Class::get_properties_vfunc_callback(GstPropertyProbe* self)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        return obj->get_properties_vfunc();
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_properties)
    return (*base->get_properties)(self);


  typedef const GList* RType;
  return RType();
}
gboolean PropertyProbe_Class::needs_probe_vfunc_callback(GstPropertyProbe* self, guint prop_id, const GParamSpec* pspec)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        return static_cast<int>(obj->needs_probe_vfunc(prop_id, pspec));
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->needs_probe)
    return (*base->needs_probe)(self, prop_id, pspec);


  typedef gboolean RType;
  return RType();
}
void PropertyProbe_Class::probe_property_vfunc_callback(GstPropertyProbe* self, guint prop_id, const GParamSpec* pspec)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->probe_property_vfunc(prop_id, pspec);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->probe_property)
    (*base->probe_property)(self, prop_id, pspec);

}
GValueArray* PropertyProbe_Class::get_values_vfunc_callback(GstPropertyProbe* self, guint prop_id, const GParamSpec* pspec)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        return (obj->get_values_vfunc(prop_id, pspec)).gobj_copy();
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)  );

  // Call the original underlying C function:
  if(base && base->get_values)
    return (*base->get_values)(self, prop_id, pspec);


  typedef GValueArray* RType;
  return RType();
}

void PropertyProbe_Class::probe_needed_callback(GstPropertyProbe* self, const GParamSpec* p0)
{
  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
      Glib::ObjectBase::_get_current_wrapper((GObject*)self));

  // Non-gtkmmproc-generated custom classes implicitly call the default
  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
  // generated classes can use this optimisation, which avoids the unnecessary
  // parameter conversions if there is no possibility of the virtual function
  // being overridden:
  if(obj_base && obj_base->is_derived_())
  {
    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
      #endif //GLIBMM_EXCEPTIONS_ENABLED
        // Call the virtual member method, which derived classes might override.
        obj->on_probe_needed(p0);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
)    );

  // Call the original underlying C function:
  if(base && base->probe_needed)
    (*base->probe_needed)(self, p0);
}


Glib::ObjectBase* PropertyProbe_Class::wrap_new(GObject* object)
{
  return new PropertyProbe((GstPropertyProbe*)(object));
}


/* The implementation: */

PropertyProbe::PropertyProbe()
:
  Glib::Interface(propertyprobe_class_.init())
{}

PropertyProbe::PropertyProbe(GstPropertyProbe* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

PropertyProbe::PropertyProbe(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

PropertyProbe::~PropertyProbe()
{}

// static
void PropertyProbe::add_interface(GType gtype_implementer)
{
  propertyprobe_class_.init().add_interface(gtype_implementer);
}

PropertyProbe::CppClassType PropertyProbe::propertyprobe_class_; // initialize static member

GType PropertyProbe::get_type()
{
  return propertyprobe_class_.init().get_type();
}


GType PropertyProbe::get_base_type()
{
  return gst_property_probe_get_type();
}


const GList* PropertyProbe::get_properties() const
{
  return gst_property_probe_get_properties(const_cast<GstPropertyProbe*>(gobj()));
}

const GParamSpec* PropertyProbe::get_property(const Glib::ustring& name) const
{
  return gst_property_probe_get_property(const_cast<GstPropertyProbe*>(gobj()), name.c_str());
}

Glib::ValueArray PropertyProbe::get_values(const GParamSpec* pspec) const
{
  return Glib::wrap(gst_property_probe_get_values(const_cast<GstPropertyProbe*>(gobj()), pspec));
}

Glib::ValueArray PropertyProbe::get_values(const Glib::ustring& name) const
{
  return Glib::wrap(gst_property_probe_get_values_name(const_cast<GstPropertyProbe*>(gobj()), name.c_str()));
}

bool PropertyProbe::needs_probe(const GParamSpec* pspec) const
{
  return gst_property_probe_needs_probe(const_cast<GstPropertyProbe*>(gobj()), pspec);
}

bool PropertyProbe::needs_probe(const Glib::ustring& name) const
{
  return gst_property_probe_needs_probe_name(const_cast<GstPropertyProbe*>(gobj()), name.c_str());
}

Glib::ValueArray PropertyProbe::probe_and_get_values(const GParamSpec* pspec)
{
  return Glib::wrap(gst_property_probe_probe_and_get_values(gobj(), pspec));
}

Glib::ValueArray PropertyProbe::probe_and_get_values(const Glib::ustring& name)
{
  return Glib::wrap(gst_property_probe_probe_and_get_values_name(gobj(), name.c_str()));
}

void PropertyProbe::probe_property(const GParamSpec * pspec)
{
gst_property_probe_probe_property(gobj(), pspec); 
}

void PropertyProbe::probe_property(const Glib::ustring& name)
{
gst_property_probe_probe_property_name(gobj(), name.c_str()); 
}


Glib::SignalProxy1< void,const GParamSpec* > PropertyProbe::signal_probe_needed()
{
  return Glib::SignalProxy1< void,const GParamSpec* >(this, &PropertyProbe_signal_probe_needed_info);
}


void Gst::PropertyProbe::on_probe_needed(const GParamSpec* pspec)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->probe_needed)
    (*base->probe_needed)(gobj(),pspec);
}

const GList* Gst::PropertyProbe::get_properties_vfunc() const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_properties)
    return (*base->get_properties)(const_cast<GstPropertyProbe*>(gobj()));

  typedef const GList* RType;
  return RType();
}
bool Gst::PropertyProbe::needs_probe_vfunc(guint prop_id, const GParamSpec* pspec) const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->needs_probe)
    return (*base->needs_probe)(const_cast<GstPropertyProbe*>(gobj()),prop_id,pspec);

  typedef bool RType;
  return RType();
}
void Gst::PropertyProbe::probe_property_vfunc(guint prop_id, const GParamSpec* pspec) 
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->probe_property)
    (*base->probe_property)(gobj(),prop_id,pspec);
}
Glib::ValueArray Gst::PropertyProbe::get_values_vfunc(guint prop_id, const GParamSpec* pspec) const
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
)  );

  if(base && base->get_values)
    return Glib::wrap((*base->get_values)(const_cast<GstPropertyProbe*>(gobj()),prop_id,pspec));

  typedef Glib::ValueArray RType;
  return RType();
}


} // namespace Gst


