// Generated by gmmproc 2.50.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gstreamermm/registry.h>
#include <gstreamermm/private/registry_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/gst.h>
#include <gstreamermm/pluginfeature.h>
#include <gstreamermm/plugin.h>


namespace
{

extern "C"
{

static gboolean Registry_Plugin_Filter_gstreamermm_callback(GstPlugin* plugin, void* data)
{
  Gst::Plugin::SlotFilter* the_slot = static_cast<Gst::Plugin::SlotFilter*>(data);

  try
  {
    bool result = (*the_slot)(Glib::wrap(plugin, true));
    return result;
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
  }

  return false;
}

static gboolean Registry_PluginFeature_Filter_gstreamermm_callback(GstPluginFeature* feature, void* data)
{
  Gst::PluginFeature::SlotFilter* the_slot = static_cast<Gst::PluginFeature::SlotFilter*>(data);

  try
  {
    bool result = (*the_slot)(Glib::wrap(feature, true));
    return result;
  }
  catch(...)
  {
    Glib::exception_handlers_invoke();
  }

  return false;
}

} // extern "C"

} // anonymous namespace

namespace Gst
{

Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >
Registry::get_plugin_list(const Plugin::SlotFilter& filter, bool first)
{
  GList* list = gst_registry_plugin_filter(gobj(),
    &Registry_Plugin_Filter_gstreamermm_callback, first,
    const_cast<Plugin::SlotFilter*>(&filter));

  return Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >(list,
    Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> >
Registry::get_plugin_list(const Plugin::SlotFilter& filter, bool first) const
{
  GList* list = gst_registry_plugin_filter(const_cast<GstRegistry*>(gobj()),
    &Registry_Plugin_Filter_gstreamermm_callback, first,
    const_cast<Plugin::SlotFilter*>(&filter));

  return Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> >(list,
    Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >
Registry::get_feature_list(const PluginFeature::SlotFilter& filter, bool first)
{
  GList* list = gst_registry_feature_filter(gobj(),
    &Registry_PluginFeature_Filter_gstreamermm_callback, first,
    const_cast<PluginFeature::SlotFilter*>(&filter));

  return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(list,
    Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >
Registry::get_feature_list(const PluginFeature::SlotFilter& filter,
  bool first) const
{
  GList* list = gst_registry_feature_filter(const_cast<GstRegistry*>(gobj()),
    &Registry_PluginFeature_Filter_gstreamermm_callback, first,
    const_cast<PluginFeature::SlotFilter*>(&filter));

  return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(list,
    Glib::OWNERSHIP_DEEP);
}

Glib::RefPtr<Gst::Registry>
Registry::get()
{
  return Glib::wrap(gst_registry_get(), true);
}

void Registry::add_feature(const Glib::RefPtr<Gst::PluginFeature>& feature)
{
  feature->reference();
  gst_registry_add_feature(gobj(), feature->gobj());
}

void Registry::add_plugin(const Glib::RefPtr<Gst::Plugin>& plugin)
{
  plugin->reference();
  gst_registry_add_plugin(gobj(), plugin->gobj());
}


} //namespace Gst

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gst::Registry> wrap(GstRegistry* object, bool take_copy)
{
  return Glib::RefPtr<Gst::Registry>( dynamic_cast<Gst::Registry*> (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& Registry_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_ = &Registry_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_registry_get_type());

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

  }

  return *this;
}


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


}


Glib::ObjectBase* Registry_Class::wrap_new(GObject* object)
{
  return new Registry((GstRegistry*)object);
}


/* The implementation: */

GstRegistry* Registry::gobj_copy()
{
  reference();
  return gobj();
}

Registry::Registry(const Glib::ConstructParams& construct_params)
:
  Gst::Object(construct_params)
{

}

Registry::Registry(GstRegistry* castitem)
:
  Gst::Object((GstObject*)(castitem))
{}


Registry::Registry(Registry&& src) noexcept
: Gst::Object(std::move(src))
{}

Registry& Registry::operator=(Registry&& src) noexcept
{
  Gst::Object::operator=(std::move(src));
  return *this;
}


Registry::~Registry() noexcept
{}


Registry::CppClassType Registry::registry_class_; // initialize static member

GType Registry::get_type()
{
  return registry_class_.init().get_type();
}


GType Registry::get_base_type()
{
  return gst_registry_get_type();
}


Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Registry::get_feature_list(GType type)
{
  return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(gst_registry_get_feature_list(gobj(), type), Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Registry::get_feature_list(GType type) const
{
  return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(gst_registry_get_feature_list(const_cast<GstRegistry*>(gobj()), type), Glib::OWNERSHIP_DEEP);
}

guint32 Registry::get_feature_list_cookie() const
{
  return gst_registry_get_feature_list_cookie(const_cast<GstRegistry*>(gobj()));
}

Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Registry::get_feature_list(const Glib::ustring& name)
{
  return Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> >(gst_registry_get_feature_list_by_plugin(gobj(), name.c_str()), Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Registry::get_feature_list(const Glib::ustring& name) const
{
  return Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> >(gst_registry_get_feature_list_by_plugin(const_cast<GstRegistry*>(gobj()), name.c_str()), Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<Gst::Plugin> > Registry::get_plugin_list()
{
  return Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >(gst_registry_get_plugin_list(gobj()), Glib::OWNERSHIP_DEEP);
}

Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> > Registry::get_plugin_list() const
{
  return Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> >(gst_registry_get_plugin_list(const_cast<GstRegistry*>(gobj())), Glib::OWNERSHIP_DEEP);
}

void Registry::remove_plugin(const Glib::RefPtr<Gst::Plugin>& plugin)
{
  gst_registry_remove_plugin(gobj(), Glib::unwrap(plugin));
}

bool Registry::add_plugin(Glib::RefPtr<Gst::Plugin>&& plugin)
{
  return gst_registry_add_plugin(gobj(), (plugin) ? plugin.release()->gobj() : nullptr);
}

Glib::RefPtr<Gst::Plugin> Registry::find_plugin(const Glib::ustring& name)
{
  return Glib::wrap(gst_registry_find_plugin(gobj(), name.c_str()));
}

Glib::RefPtr<const Gst::Plugin> Registry::find_plugin(const Glib::ustring& name) const
{
  return const_cast<Registry*>(this)->find_plugin(name);
}

Glib::RefPtr<Gst::PluginFeature> Registry::find_feature(const Glib::ustring& name, GType type)
{
  return Glib::wrap(gst_registry_find_feature(gobj(), name.c_str(), type));
}

Glib::RefPtr<const Gst::PluginFeature> Registry::find_feature(const Glib::ustring& name, GType type) const
{
  return const_cast<Registry*>(this)->find_feature(name, type);
}

Glib::RefPtr<Gst::PluginFeature> Registry::lookup_feature(const Glib::ustring& name)
{
  return Glib::wrap(gst_registry_lookup_feature(gobj(), name.c_str()));
}

Glib::RefPtr<const Gst::PluginFeature> Registry::lookup_feature(const Glib::ustring& name) const
{
  return const_cast<Registry*>(this)->lookup_feature(name);
}

bool Registry::scan_path(const Glib::ustring& path)
{
  return gst_registry_scan_path(gobj(), path.c_str());
}

Glib::RefPtr<Gst::Plugin> Registry::lookup(const Glib::ustring& filename)
{
  return Glib::wrap(gst_registry_lookup(gobj(), filename.c_str()));
}

Glib::RefPtr<const Gst::Plugin> Registry::lookup(const Glib::ustring& filename) const
{
  return const_cast<Registry*>(this)->lookup(filename);
}

void Registry::remove_feature(const Glib::RefPtr<Gst::PluginFeature>& feature)
{
  gst_registry_remove_feature(gobj(), Glib::unwrap(feature));
}

void Registry::add_feature(Glib::RefPtr<Gst::PluginFeature>&& feature)
{
  gst_registry_add_feature(gobj(), (feature) ? feature.release()->gobj() : nullptr);
}

bool Registry::check_feature_version(const Glib::ustring& feature_name, guint min_major, guint min_minor, guint min_micro)
{
  return gst_registry_check_feature_version(gobj(), feature_name.c_str(), min_major, min_minor, min_micro);
}


} // namespace Gst


