// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

#include <gstreamermm/pad.h>
#include <gstreamermm/private/pad_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.
 */

#include <gst/gstutils.h>
#include <gst/gstenumtypes.h>
#include <gstreamermm/buffer.h>
#include <gstreamermm/caps.h>
#include <gstreamermm/element.h>
#include <gstreamermm/event.h>
#include <gstreamermm/padtemplate.h>
#include <gstreamermm/iterator.h>


namespace
{

extern "C"
{

static void Pad_Block_gstreamermm_callback(GstPad* pad, gboolean blocked, void* data)
{
  Gst::Pad::SlotBlock * the_slot = static_cast<Gst::Pad::SlotBlock*>(data);

  try
  {
    (*the_slot)(Glib::wrap(pad), blocked);
    delete the_slot;
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
  }
}

static void Pad_Block_gstreamermm_callback_destroy(void* data)
{
  delete static_cast<Gst::Pad::SlotBlock*>(data);
}

static gboolean Pad_Data_gstreamermm_callback(GstPad* pad, GstMiniObject* mini_obj, void* data)
{
  Gst::Pad::SlotData* the_slot = static_cast<Gst::Pad::SlotData*>(data);

  try
  {
    return (*the_slot)(Glib::wrap(pad, true), Gst::wrap(mini_obj, true));
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
  }

  return false;
}

static void Pad_Data_gstreamermm_callback_disconnect(void* data)
{
  Gst::Pad::SlotData* the_slot = static_cast<Gst::Pad::SlotData*>(data);

  if(the_slot)
    delete the_slot;
}

} // extern "C"

} // anonymous namespace

namespace Gst
{

Pad::Pad(PadDirection dir)
  : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Object(Glib::ConstructParams(pad_class_.init(), "name",static_cast<char*>(0),"direction",dir, static_cast<char*>(0)))
{}

Pad::Pad(const Glib::RefPtr<const Gst::PadTemplate>& templ,
  const Glib::ustring& name)
  : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Object(Glib::ConstructParams(pad_class_.init(), "name",(name.empty() ? static_cast<char*>(0) : name.c_str()),"direction",(templ ? static_cast<GstPadDirection>(templ->get_direction())
      : GST_PAD_UNKNOWN),"template",Glib::unwrap(templ), static_cast<char*>(0)))
{
  if(!templ)
    gstreamermm_handle_error(
      "Gst::Pad::Pad(const Glib::RefPtr<Gst::PadTemplate>&, "
      "const Glib::ustring&): Failed to construct pad (name = " + name + ") "
      "from null template.");
}

Pad::Pad(const Glib::RefPtr<const Gst::PadTemplate>& templ)
  : // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Object(Glib::ConstructParams(pad_class_.init(), "name",static_cast<char*>(0),"direction",(templ ? static_cast<GstPadDirection>(templ->get_direction())
      : GST_PAD_UNKNOWN),"template",Glib::unwrap(templ), static_cast<char*>(0)))
{
  if(!templ)
    gstreamermm_handle_error(
      "Gst::Pad::Pad(const Glib::RefPtr<Gst::PadTemplate>&): Failed to "
      "construct pad from null template.");
}

// This is handcoded because the documentation tells us that we need to copy
// the Caps
Glib::RefPtr<const Gst::Caps> Pad::get_pad_template_caps() const
{
  const GstCaps* caps = gst_pad_get_pad_template_caps(const_cast<GstPad*>(gobj()));
  GstCaps* copy_caps = gst_caps_copy(caps);
  return Glib::wrap(copy_caps, false);
}

FlowReturn Pad::alloc_buffer(guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer)
{
  GstBuffer* c_buffer = 0;
  GstFlowReturn result = gst_pad_alloc_buffer(gobj(), offset, size, caps->gobj(), &c_buffer);
  buffer = wrap(c_buffer, false);
  return FlowReturn(result);
}

FlowReturn Pad::alloc_buffer_and_set_caps(guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer)
{
  GstBuffer* c_buffer = 0;
  GstFlowReturn result = gst_pad_alloc_buffer_and_set_caps(gobj(), offset, size, caps->gobj(), &c_buffer);
  buffer = wrap(c_buffer, false);
  return FlowReturn(result);
}

FlowReturn Pad::get_range(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer)
{
  GstBuffer* c_buffer = 0;
  GstFlowReturn result = gst_pad_get_range(gobj(), offset, size, &c_buffer);
  buffer = wrap(c_buffer, false);
  return FlowReturn(result);
}

FlowReturn Pad::push(const Glib::RefPtr<Gst::Buffer>& buffer)
{
  buffer->reference();
  return FlowReturn(gst_pad_push(gobj(), buffer->gobj()));
}

bool Pad::push_event(const Glib::RefPtr<Gst::Event>& event)
{
  event->reference();
  return gst_pad_push_event(gobj(), event->gobj());
}

FlowReturn Pad::pull_range(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer)
{
  GstBuffer* c_buffer = 0;
  GstFlowReturn result = gst_pad_pull_range(gobj(), offset, size, &c_buffer);
  buffer = wrap(c_buffer, false);
  return FlowReturn(result);
}

bool Pad::send_event(const Glib::RefPtr<Gst::Event>& event)
{
  event->reference();
  return gst_pad_send_event(gobj(), event->gobj());
}

bool Pad::query_position(Format& format) const
{
  return gst_pad_query_position(const_cast<GstPad*>(gobj()), reinterpret_cast<GstFormat*>(&format), 0);
}

bool Pad::query_duration(Format& format) const
{
  return gst_pad_query_duration(const_cast<GstPad*>(gobj()), reinterpret_cast<GstFormat*>(&format), 0);
}

bool Pad::query_peer_position(Format& format) const
{
  return gst_pad_query_peer_position(const_cast<GstPad*>(gobj()), reinterpret_cast<GstFormat*>(&format), 0);
}

bool Pad::query_peer_duration(Format& format) const
{
  return gst_pad_query_peer_duration(const_cast<GstPad*>(gobj()), reinterpret_cast<GstFormat*>(&format), 0);
}

FlowReturn Pad::chain(const Glib::RefPtr<Gst::Buffer>& buffer)
{
  buffer->reference();
  return FlowReturn(gst_pad_chain(gobj(), buffer->gobj()));
}

bool Pad::set_blocked_async(const SlotBlock& slot, bool blocked)
{
  SlotBlock* slot_copy = new SlotBlock(slot);
  return bool(gst_pad_set_blocked_async_full(GST_PAD(gobj()), gboolean(blocked), &Pad_Block_gstreamermm_callback, slot_copy, &Pad_Block_gstreamermm_callback_destroy));
}

gulong Pad::add_data_probe(const SlotData& slot)
{
  SlotData* slot_copy = new SlotData(slot);

  return gst_pad_add_data_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
}

gulong Pad::add_buffer_probe(const SlotData& slot)
{
  SlotData* slot_copy = new SlotData(slot);

  return gst_pad_add_buffer_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
}

gulong Pad::add_event_probe(const SlotData& slot)
{
  SlotData* slot_copy = new SlotData(slot);

  return gst_pad_add_event_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
}

} //namespace Gst

namespace
{


static void Pad_signal_linked_callback(GstPad* self, GstPad* p0,void* data)
{
  using namespace Gst;
  typedef sigc::slot< void,const Glib::RefPtr<Gst::Pad>& > 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))(Glib::wrap(p0, true)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Pad_signal_linked_info =
{
  "linked",
  (GCallback) &Pad_signal_linked_callback,
  (GCallback) &Pad_signal_linked_callback
};


static const Glib::SignalProxyInfo Pad_signal_request_link_info =
{
  "request-link",
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
};


static void Pad_signal_unlinked_callback(GstPad* self, GstPad* p0,void* data)
{
  using namespace Gst;
  typedef sigc::slot< void,const Glib::RefPtr<Gst::Pad>& > 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))(Glib::wrap(p0, true)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Pad_signal_unlinked_info =
{
  "unlinked",
  (GCallback) &Pad_signal_unlinked_callback,
  (GCallback) &Pad_signal_unlinked_callback
};


} // anonymous namespace

// static
GType Glib::Value<Gst::ActivateMode>::value_type()
{
  return gst_activate_mode_get_type();
}

// static
GType Glib::Value<Gst::FlowReturn>::value_type()
{
  return gst_flow_return_get_type();
}

// static
GType Glib::Value<Gst::PadDirection>::value_type()
{
  return gst_pad_direction_get_type();
}

// static
GType Glib::Value<Gst::PadFlags>::value_type()
{
  return gst_pad_flags_get_type();
}

// static
GType Glib::Value<Gst::PadLinkReturn>::value_type()
{
  return gst_pad_link_return_get_type();
}

// static
GType Glib::Value<Gst::PadLinkCheck>::value_type()
{
  return gst_pad_link_check_get_type();
}


namespace Glib
{

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

} /* namespace Glib */


namespace Gst
{


/* The *_Class implementation: */

const Glib::Class& Pad_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &Pad_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gst_pad_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void Pad_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


  klass->linked = &linked_callback;
  klass->request_link = &request_link_callback;
  klass->unlinked = &unlinked_callback;
}


void Pad_Class::linked_callback(GstPad* self, GstPad* 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_linked(Glib::wrap(p0, true)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->linked)
    (*base->linked)(self, p0);
}
void Pad_Class::request_link_callback(GstPad* 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.
        obj->on_request_link();
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

  // Call the original underlying C function:
  if(base && base->request_link)
    (*base->request_link)(self);
}
void Pad_Class::unlinked_callback(GstPad* self, GstPad* 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_unlinked(Glib::wrap(p0, true)
);
        return;
      #ifdef GLIBMM_EXCEPTIONS_ENABLED
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
      #endif //GLIBMM_EXCEPTIONS_ENABLED
    }
  }

  BaseClassType *const base = static_cast<BaseClassType*>(
        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
    );

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


Glib::ObjectBase* Pad_Class::wrap_new(GObject* object)
{
  return new Pad((GstPad*)object);
}


/* The implementation: */

GstPad* Pad::gobj_copy()
{
  reference();
  return gobj();
}

Pad::Pad(const Glib::ConstructParams& construct_params)
:
  Object(construct_params)
{

}

Pad::Pad(GstPad* castitem)
:
  Object((GstObject*)(castitem))
{}


Pad::~Pad()
{}


Pad::CppClassType Pad::pad_class_; // initialize static member

GType Pad::get_type()
{
  return pad_class_.init().get_type();
}


GType Pad::get_base_type()
{
  return gst_pad_get_type();
}


Pad::Pad(const Glib::ustring& name, PadDirection direction)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Object(Glib::ConstructParams(pad_class_.init(), "name", name.c_str(), "direction", ((GstPadDirection)(direction)), static_cast<char*>(0)))
{
  

}

Glib::RefPtr<Pad> Pad::create(const Glib::ustring& name, PadDirection dir)
{
  return Glib::RefPtr<Pad>( new Pad(name, dir) );
}

Glib::RefPtr<Pad> Pad::create(PadDirection dir)
{
  return Glib::RefPtr<Pad>( new Pad(dir) );
}

Glib::RefPtr<Pad> Pad::create(const Glib::RefPtr<const Gst::PadTemplate>& pad_template)
{
  return Glib::RefPtr<Pad>( new Pad(pad_template) );
}

Glib::RefPtr<Pad> Pad::create(const Glib::RefPtr<const Gst::PadTemplate>& pad_template, const Glib::ustring& name)
{
  return Glib::RefPtr<Pad>( new Pad(pad_template, name) );
}

PadDirection Pad::get_direction() const
{
  return ((PadDirection)(gst_pad_get_direction(const_cast<GstPad*>(gobj()))));
}

Glib::RefPtr<Gst::Element> Pad::get_parent_element()
{
  return Glib::wrap(gst_pad_get_parent_element(gobj()));
}

Glib::RefPtr<const Gst::Element> Pad::get_parent_element() const
{
  return const_cast<Pad*>(this)->get_parent_element();
}

Glib::RefPtr<Gst::PadTemplate> Pad::get_pad_template()
{
  return Glib::wrap(gst_pad_get_pad_template(gobj()));
}

Glib::RefPtr<const Gst::PadTemplate> Pad::get_pad_template() const
{
  return const_cast<Pad*>(this)->get_pad_template();
}

PadLinkReturn Pad::link(const Glib::RefPtr<Gst::Pad>& sink_pad)
{
  return ((PadLinkReturn)(gst_pad_link(gobj(), Glib::unwrap(sink_pad))));
}

bool Pad::unlink(const Glib::RefPtr<Gst::Pad>& sink_pad)
{
  return gst_pad_unlink(gobj(), Glib::unwrap(sink_pad));
}

bool Pad::is_linked() const
{
  return gst_pad_is_linked(const_cast<GstPad*>(gobj()));
}

bool Pad::can_link(const Glib::RefPtr<const Gst::Pad>& other_pad) const
{
  return gst_pad_can_link(const_cast<GstPad*>(gobj()), const_cast<GstPad*>(Glib::unwrap(other_pad)));
}

Glib::RefPtr<Gst::Caps> Pad::get_caps()
{
  return Glib::wrap(gst_pad_get_caps(gobj()));
}

Glib::RefPtr<const Gst::Caps> Pad::get_caps() const
{
  return const_cast<Pad*>(this)->get_caps();
}

Glib::RefPtr<Gst::Caps> Pad::get_allowed_caps()
{
  return Glib::wrap(gst_pad_get_allowed_caps(gobj()));
}

Glib::RefPtr<const Gst::Caps> Pad::get_allowed_caps() const
{
  return const_cast<Pad*>(this)->get_allowed_caps();
}

Glib::RefPtr<Gst::Caps> Pad::get_negotiated_caps()
{
  return Glib::wrap(gst_pad_get_negotiated_caps(gobj()));
}

Glib::RefPtr<const Gst::Caps> Pad::get_negotiated_caps() const
{
  return const_cast<Pad*>(this)->get_negotiated_caps();
}

bool Pad::set_caps(const Glib::RefPtr<Gst::Caps>& caps)
{
  return gst_pad_set_caps(gobj(), Glib::unwrap(caps));
}

Glib::RefPtr<Gst::Pad> Pad::get_peer()
{
  return Glib::wrap(gst_pad_get_peer(gobj()));
}

Glib::RefPtr<const Gst::Pad> Pad::get_peer() const
{
  return const_cast<Pad*>(this)->get_peer();
}

Glib::RefPtr<Gst::Caps> Pad::peer_get_caps()
{
  return Glib::wrap(gst_pad_peer_get_caps(gobj()));
}

Glib::RefPtr<const Gst::Caps> Pad::peer_get_caps() const
{
  return const_cast<Pad*>(this)->peer_get_caps();
}

void Pad::use_fixed_caps()
{
  gst_pad_use_fixed_caps(gobj());
}

bool Pad::is_active() const
{
  return gst_pad_is_active(const_cast<GstPad*>(gobj()));
}

bool Pad::set_blocked(bool blocked)
{
  return gst_pad_set_blocked(gobj(), static_cast<int>(blocked));
}

bool Pad::is_blocked() const
{
  return gst_pad_is_blocked(const_cast<GstPad*>(gobj()));
}

bool Pad::is_blocking() const
{
  return gst_pad_is_blocking(const_cast<GstPad*>(gobj()));
}

void Pad::remove_data_probe(guint handler_id)
{
  gst_pad_remove_data_probe(gobj(), handler_id);
}

void Pad::remove_buffer_probe(guint handler_id)
{
  gst_pad_remove_buffer_probe(gobj(), handler_id);
}

void Pad::remove_event_probe(guint handler_id)
{
  gst_pad_remove_event_probe(gobj(), handler_id);
}

bool Pad::accept_caps(const Glib::RefPtr<const Gst::Caps>& caps) const
{
  return gst_pad_accept_caps(const_cast<GstPad*>(gobj()), const_cast<GstCaps*>(Glib::unwrap(caps)));
}

Glib::RefPtr<Gst::Caps> Pad::proxy_getcaps()
{
  return Glib::wrap(gst_pad_proxy_getcaps(gobj()));
}

Glib::RefPtr<const Gst::Caps> Pad::proxy_getcaps() const
{
  return const_cast<Pad*>(this)->proxy_getcaps();
}

bool Pad::proxy_setcaps(const Glib::RefPtr<Gst::Caps>& caps)
{
  return gst_pad_proxy_setcaps(gobj(), Glib::unwrap(caps));
}

void Pad::fixate_caps(const Glib::RefPtr<Gst::Caps>& caps)
{
  gst_pad_fixate_caps(gobj(), Glib::unwrap(caps));
}

bool Pad::peer_accept_caps(const Glib::RefPtr<const Gst::Caps>& caps) const
{
  return gst_pad_peer_accept_caps(const_cast<GstPad*>(gobj()), const_cast<GstCaps*>(Glib::unwrap(caps)));
}

bool Pad::check_pull_range() const
{
  return gst_pad_check_pull_range(const_cast<GstPad*>(gobj()));
}

bool Pad::activate_pull(bool active)
{
  return gst_pad_activate_pull(gobj(), static_cast<int>(active));
}

bool Pad::activate_push(bool active)
{
  return gst_pad_activate_push(gobj(), static_cast<int>(active));
}

bool Pad::event_default(const Glib::RefPtr<Gst::Event>& event)
{
  return gst_pad_event_default(gobj(), Gst::unwrap(event));
}

bool Pad::query(const Glib::RefPtr<Gst::Query>& query) const
{
  return gst_pad_query(const_cast<GstPad*>(gobj()), Gst::unwrap(query));
}

bool Pad::peer_query(const Glib::RefPtr<Gst::Query>& query) const
{
  return gst_pad_peer_query(const_cast<GstPad*>(gobj()), Gst::unwrap(query));
}

bool Pad::query_default(const Glib::RefPtr<Gst::Query>& query) const
{
  return gst_pad_query_default(const_cast<GstPad*>(gobj()), Gst::unwrap(query));
}

bool Pad::query_position(Format& format, gint64& position) const
{
  return gst_pad_query_position(const_cast<GstPad*>(gobj()), (GstFormat*)&format, &position);
}

bool Pad::query_duration(Format& format, gint64& duration) const
{
  return gst_pad_query_duration(const_cast<GstPad*>(gobj()), (GstFormat*)&format, &duration);
}

bool Pad::query_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const
{
  return gst_pad_query_convert(const_cast<GstPad*>(gobj()), ((GstFormat)(src_format)), src_value, (GstFormat*)&dst_format, &dst_value);
}

bool Pad::query_peer_position(Format& format, gint64& position) const
{
  return gst_pad_query_peer_position(const_cast<GstPad*>(gobj()), (GstFormat*)&format, &position);
}

bool Pad::query_peer_duration(Format& format, gint64& duration) const
{
  return gst_pad_query_peer_duration(const_cast<GstPad*>(gobj()), (GstFormat*)&format, &duration);
}

bool Pad::query_peer_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const
{
  return gst_pad_query_peer_convert(const_cast<GstPad*>(gobj()), ((GstFormat)(src_format)), src_value, (GstFormat*)&dst_format, &dst_value);
}

Glib::ArrayHandle<QueryType> Pad::get_query_types() const
{
  return Glib::ArrayHandle<QueryType>((QueryType*)(gst_pad_get_query_types(const_cast<GstPad*>(gobj()))), Glib::OWNERSHIP_NONE);
}

Glib::ArrayHandle<QueryType> Pad::get_query_types_default() const
{
  return Glib::ArrayHandle<QueryType>((QueryType*)(gst_pad_get_query_types_default(const_cast<GstPad*>(gobj()))), Glib::OWNERSHIP_NONE);
}

Gst::Iterator<Gst::Pad> Pad::iterate_internal_links()
{
  return Gst::Iterator<Gst::Pad>(gst_pad_iterate_internal_links(gobj()));
}

Gst::Iterator<const Gst::Pad> Pad::iterate_internal_links() const
{
  return Gst::Iterator<const Gst::Pad>(gst_pad_iterate_internal_links(const_cast<GstPad*>(gobj())));
}

Gst::Iterator<Gst::Pad> Pad::iterate_internal_links_default()
{
  return Gst::Iterator<Gst::Pad>(gst_pad_iterate_internal_links_default(gobj()));
}

Gst::Iterator<const Gst::Pad> Pad::iterate_internal_links_default() const
{
  return Gst::Iterator<const Gst::Pad>(gst_pad_iterate_internal_links_default(const_cast<GstPad*>(gobj())));
}

Glib::ListHandle< Glib::RefPtr<Gst::Pad> > Pad::get_internal_links()
{
  return Glib::ListHandle< Glib::RefPtr<Gst::Pad> >(gst_pad_get_internal_links(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::ListHandle< Glib::RefPtr<const Gst::Pad> > Pad::get_internal_links() const
{
  return Glib::ListHandle< Glib::RefPtr<const Gst::Pad> >(gst_pad_get_internal_links(const_cast<GstPad*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

Glib::ListHandle< Glib::RefPtr<Gst::Pad> > Pad::get_internal_links_default()
{
  return Glib::ListHandle< Glib::RefPtr<Gst::Pad> >(gst_pad_get_internal_links_default(gobj()), Glib::OWNERSHIP_SHALLOW);
}

Glib::ListHandle< Glib::RefPtr<const Gst::Pad> > Pad::get_internal_links_default() const
{
  return Glib::ListHandle< Glib::RefPtr<const Gst::Pad> >(gst_pad_get_internal_links_default(const_cast<GstPad*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

bool Pad::pause_task()
{
  return gst_pad_pause_task(gobj());
}

bool Pad::stop_task()
{
  return gst_pad_stop_task(gobj());
}

bool Pad::set_active(bool active)
{
  return gst_pad_set_active(gobj(), static_cast<int>(active));
}


Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& > Pad::signal_linked()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& >(this, &Pad_signal_linked_info);
}


Glib::SignalProxy0< void > Pad::signal_request_link()
{
  return Glib::SignalProxy0< void >(this, &Pad_signal_request_link_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& > Pad::signal_unlinked()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& >(this, &Pad_signal_unlinked_info);
}


#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> > Pad::property_caps() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> >(this, "caps");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< PadDirection > Pad::property_direction() const
{
  return Glib::PropertyProxy_ReadOnly< PadDirection >(this, "direction");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy< PadTemplate > Pad::property_template() 
{
  return Glib::PropertyProxy< PadTemplate >(this, "template");
}
#endif //GLIBMM_PROPERTIES_ENABLED

#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::PropertyProxy_ReadOnly< PadTemplate > Pad::property_template() const
{
  return Glib::PropertyProxy_ReadOnly< PadTemplate >(this, "template");
}
#endif //GLIBMM_PROPERTIES_ENABLED


void Gst::Pad::on_linked(const Glib::RefPtr<Gst::Pad>& peer_pad)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->linked)
    (*base->linked)(gobj(),Glib::unwrap(peer_pad));
}
void Gst::Pad::on_request_link()
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->request_link)
    (*base->request_link)(gobj());
}
void Gst::Pad::on_unlinked(const Glib::RefPtr<Gst::Pad>& peer_pad)
{
  BaseClassType *const base = static_cast<BaseClassType*>(
      g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
  );

  if(base && base->unlinked)
    (*base->unlinked)(gobj(),Glib::unwrap(peer_pad));
}


} // namespace Gst


