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


#include <glibmm.h>

#include <giomm/dbusobjectmanager.h>
#include <giomm/private/dbusobjectmanager_p.h>


/* Copyright (C) 2019 The giomm 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, see <http://www.gnu.org/licenses/>.
 */

#include <gio/gio.h>
#include <giomm/dbusobject.h>
#include <giomm/dbusinterface.h>

namespace
{
// Used in call to g_list_copy_deep().
void* list_copy_ref(const void* src, void* /* data */)
{
  return g_object_ref(const_cast<void*>(src));
}

// Define some replacements for Glib::unwrap_copy().
// Can't use the template function in glibmm/wrap.h, because interface classes
// don't override Glib::ObjectBase::gobj_copy(), which returns a GObject*.
GDBusObject* local_unwrap_copy(const Glib::RefPtr<Gio::DBus::Object>& ptr)
{
  return ptr ? reinterpret_cast<GDBusObject*>(ptr->gobj_copy()) : nullptr;
}

GDBusInterface* local_unwrap_copy(const Glib::RefPtr<Gio::DBus::Interface>& ptr)
{
  return ptr ? reinterpret_cast<GDBusInterface*>(ptr->gobj_copy()) : nullptr;
}

} // anonymous namespace

namespace
{


extern "C" {
static void ObjectManager_signal_object_added_connect_callback(GDBusObjectManager* self, GDBusObject* p0,void* data)
{
  using namespace Gio::DBus;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Object>&)>;

  auto obj = dynamic_cast<ObjectManager*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo ObjectManager_signal_object_added_info =
{
  "object-added",
  (GCallback) &ObjectManager_signal_object_added_connect_callback,
  (GCallback) &ObjectManager_signal_object_added_connect_callback
};


using ObjectManager_signal_object_added_functype = void (*)(GDBusObjectManager* self, GDBusObject* p0);
ObjectManager_signal_object_added_functype ObjectManager_signal_object_added_funcptr;
extern "C" {
static void ObjectManager_signal_object_added_default_callback(GDBusObjectManager* self, GDBusObject* p0)
{
  ObjectManager_signal_object_added_funcptr( self, p0);
}
} // extern "C"


extern "C" {
static void ObjectManager_signal_object_removed_connect_callback(GDBusObjectManager* self, GDBusObject* p0,void* data)
{
  using namespace Gio::DBus;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Object>&)>;

  auto obj = dynamic_cast<ObjectManager*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo ObjectManager_signal_object_removed_info =
{
  "object-removed",
  (GCallback) &ObjectManager_signal_object_removed_connect_callback,
  (GCallback) &ObjectManager_signal_object_removed_connect_callback
};


using ObjectManager_signal_object_removed_functype = void (*)(GDBusObjectManager* self, GDBusObject* p0);
ObjectManager_signal_object_removed_functype ObjectManager_signal_object_removed_funcptr;
extern "C" {
static void ObjectManager_signal_object_removed_default_callback(GDBusObjectManager* self, GDBusObject* p0)
{
  ObjectManager_signal_object_removed_funcptr( self, p0);
}
} // extern "C"


extern "C" {
static void ObjectManager_signal_interface_added_connect_callback(GDBusObjectManager* self, GDBusObject* p0,GDBusInterface* p1,void* data)
{
  using namespace Gio::DBus;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&)>;

  auto obj = dynamic_cast<ObjectManager*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
, Glib::wrap(p1, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo ObjectManager_signal_interface_added_info =
{
  "interface-added",
  (GCallback) &ObjectManager_signal_interface_added_connect_callback,
  (GCallback) &ObjectManager_signal_interface_added_connect_callback
};


using ObjectManager_signal_interface_added_functype = void (*)(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1);
ObjectManager_signal_interface_added_functype ObjectManager_signal_interface_added_funcptr;
extern "C" {
static void ObjectManager_signal_interface_added_default_callback(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1)
{
  ObjectManager_signal_interface_added_funcptr( self, p0, p1);
}
} // extern "C"


extern "C" {
static void ObjectManager_signal_interface_removed_connect_callback(GDBusObjectManager* self, GDBusObject* p0,GDBusInterface* p1,void* data)
{
  using namespace Gio::DBus;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&)>;

  auto obj = dynamic_cast<ObjectManager*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
, Glib::wrap(p1, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo ObjectManager_signal_interface_removed_info =
{
  "interface-removed",
  (GCallback) &ObjectManager_signal_interface_removed_connect_callback,
  (GCallback) &ObjectManager_signal_interface_removed_connect_callback
};


using ObjectManager_signal_interface_removed_functype = void (*)(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1);
ObjectManager_signal_interface_removed_functype ObjectManager_signal_interface_removed_funcptr;
extern "C" {
static void ObjectManager_signal_interface_removed_default_callback(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1)
{
  ObjectManager_signal_interface_removed_funcptr( self, p0, p1);
}
} // extern "C"
using ObjectManager_get_object_path_vfunc_functype = const gchar* (*)(GDBusObjectManager* self);
ObjectManager_get_object_path_vfunc_functype ObjectManager_get_object_path_vfunc_funcptr;
extern "C" {
static const gchar* ObjectManager_get_object_path_vfunc_c_callback(GDBusObjectManager* self)
{
  return ObjectManager_get_object_path_vfunc_funcptr( self);
}
} // extern "C"
using ObjectManager_get_objects_vfunc_functype = GList* (*)(GDBusObjectManager* self);
ObjectManager_get_objects_vfunc_functype ObjectManager_get_objects_vfunc_funcptr;
extern "C" {
static GList* ObjectManager_get_objects_vfunc_c_callback(GDBusObjectManager* self)
{
  return ObjectManager_get_objects_vfunc_funcptr( self);
}
} // extern "C"
using ObjectManager_get_object_vfunc_functype = GDBusObject* (*)(GDBusObjectManager* self, const gchar* object_path);
ObjectManager_get_object_vfunc_functype ObjectManager_get_object_vfunc_funcptr;
extern "C" {
static GDBusObject* ObjectManager_get_object_vfunc_c_callback(GDBusObjectManager* self, const gchar* object_path)
{
  return ObjectManager_get_object_vfunc_funcptr( self, object_path);
}
} // extern "C"
using ObjectManager_get_interface_vfunc_functype = GDBusInterface* (*)(GDBusObjectManager* self, const gchar* object_path, const gchar* interface_name);
ObjectManager_get_interface_vfunc_functype ObjectManager_get_interface_vfunc_funcptr;
extern "C" {
static GDBusInterface* ObjectManager_get_interface_vfunc_c_callback(GDBusObjectManager* self, const gchar* object_path, const gchar* interface_name)
{
  return ObjectManager_get_interface_vfunc_funcptr( self, object_path, interface_name);
}
} // extern "C"
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gio::DBus::ObjectManager> wrap(GDBusObjectManager* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gio::DBus::ObjectManager>( dynamic_cast<Gio::DBus::ObjectManager*> (Glib::wrap_auto_interface<Gio::DBus::ObjectManager> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Gio
{

namespace DBus
{


/* The *_Class implementation: */

const Glib::Interface_Class& ObjectManager_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_ = &ObjectManager_Class::iface_init_function;

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

  return *this;
}

void ObjectManager_Class::iface_init_function(void* g_iface, void*)
{
  const auto 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 != nullptr);

  klass->get_object_path = &ObjectManager_get_object_path_vfunc_c_callback;
  ObjectManager_get_object_path_vfunc_funcptr = &get_object_path_vfunc_callback;
  klass->get_objects = &ObjectManager_get_objects_vfunc_c_callback;
  ObjectManager_get_objects_vfunc_funcptr = &get_objects_vfunc_callback;
  klass->get_object = &ObjectManager_get_object_vfunc_c_callback;
  ObjectManager_get_object_vfunc_funcptr = &get_object_vfunc_callback;
  klass->get_interface = &ObjectManager_get_interface_vfunc_c_callback;
  ObjectManager_get_interface_vfunc_funcptr = &get_interface_vfunc_callback;

  klass->object_added = &ObjectManager_signal_object_added_default_callback;
  ObjectManager_signal_object_added_funcptr = &object_added_callback;
  klass->object_removed = &ObjectManager_signal_object_removed_default_callback;
  ObjectManager_signal_object_removed_funcptr = &object_removed_callback;
  klass->interface_added = &ObjectManager_signal_interface_added_default_callback;
  ObjectManager_signal_interface_added_funcptr = &interface_added_callback;
  klass->interface_removed = &ObjectManager_signal_interface_removed_default_callback;
  ObjectManager_signal_interface_removed_funcptr = &interface_removed_callback;
}

const gchar* ObjectManager_Class::get_object_path_vfunc_callback(GDBusObjectManager* self)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        static auto quark_return_value = g_quark_from_static_string("Gio::DBus::ObjectManager::get_object_path_vfunc");

        auto return_value = static_cast<Glib::ustring*>(g_object_get_qdata(obj_base->gobj(), quark_return_value));
        if (!return_value)
        {
          return_value = new Glib::ustring();
          g_object_set_qdata_full(obj_base->gobj(), quark_return_value, return_value,
          &Glib::destroy_notify_delete<Glib::ustring>);
        }
        // Keep a copy of the return value. The caller is not expected
        // to free the object that the returned pointer points to.
        *return_value = obj->get_object_path_vfunc();
        return (*return_value).c_str();
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  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_object_path)
    return (*base->get_object_path)(self);

  using RType = const gchar*;
  return RType();
}
GList* ObjectManager_Class::get_objects_vfunc_callback(GDBusObjectManager* self)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return g_list_copy_deep(Glib::ListHandler<Glib::RefPtr<Gio::DBus::Object>>::vector_to_list(obj->get_objects_vfunc()).data(), list_copy_ref, nullptr);
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  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_objects)
    return (*base->get_objects)(self);

  using RType = GList*;
  return RType();
}
GDBusObject* ObjectManager_Class::get_object_vfunc_callback(GDBusObjectManager* self, const gchar* object_path)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return local_unwrap_copy(obj->get_object_vfunc(Glib::convert_const_gchar_ptr_to_ustring(object_path)
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  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_object)
    return (*base->get_object)(self, object_path);

  using RType = GDBusObject*;
  return RType();
}
GDBusInterface* ObjectManager_Class::get_interface_vfunc_callback(GDBusObjectManager* self, const gchar* object_path, const gchar* interface_name)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        return local_unwrap_copy(obj->get_interface_vfunc(Glib::convert_const_gchar_ptr_to_ustring(object_path)
, Glib::convert_const_gchar_ptr_to_ustring(interface_name)
));
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  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_interface)
    return (*base->get_interface)(self, object_path, interface_name);

  using RType = GDBusInterface*;
  return RType();
}

void ObjectManager_Class::object_added_callback(GDBusObjectManager* self, GDBusObject* p0)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_object_added(Glib::wrap(p0, true)
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto 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->object_added)
    (*base->object_added)(self, p0);
}
void ObjectManager_Class::object_removed_callback(GDBusObjectManager* self, GDBusObject* p0)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_object_removed(Glib::wrap(p0, true)
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto 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->object_removed)
    (*base->object_removed)(self, p0);
}
void ObjectManager_Class::interface_added_callback(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_interface_added(Glib::wrap(p0, true)
, Glib::wrap(p1, true)
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto 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->interface_added)
    (*base->interface_added)(self, p0, p1);
}
void ObjectManager_Class::interface_removed_callback(GDBusObjectManager* self, GDBusObject* p0, GDBusInterface* p1)
{
  const auto 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_())
  {
    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
    if(obj) // This can be NULL during destruction.
    {
      try // Trap C++ exceptions which would normally be lost because this is a C callback.
      {
        // Call the virtual member method, which derived classes might override.
        obj->on_interface_removed(Glib::wrap(p0, true)
, Glib::wrap(p1, true)
);
        return;
      }
      catch(...)
      {
        Glib::exception_handlers_invoke();
      }
    }
  }

  const auto 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->interface_removed)
    (*base->interface_removed)(self, p0, p1);
}


Glib::ObjectBase* ObjectManager_Class::wrap_new(GObject* object)
{
  return new ObjectManager((GDBusObjectManager*)(object));
}


/* The implementation: */

ObjectManager::ObjectManager()
:
  Glib::Interface(objectmanager_class_.init())
{}

ObjectManager::ObjectManager(GDBusObjectManager* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

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

ObjectManager::ObjectManager(ObjectManager&& src) noexcept
: Glib::Interface(std::move(src))
{}

ObjectManager& ObjectManager::operator=(ObjectManager&& src) noexcept
{
  Glib::Interface::operator=(std::move(src));
  return *this;
}

ObjectManager::~ObjectManager() noexcept
{}

// static
void ObjectManager::add_interface(GType gtype_implementer)
{
  objectmanager_class_.init().add_interface(gtype_implementer);
}

ObjectManager::CppClassType ObjectManager::objectmanager_class_; // initialize static member

GType ObjectManager::get_type()
{
  return objectmanager_class_.init().get_type();
}


GType ObjectManager::get_base_type()
{
  return g_dbus_object_manager_get_type();
}


Glib::ustring ObjectManager::get_object_path() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(g_dbus_object_manager_get_object_path(const_cast<GDBusObjectManager*>(gobj())));
}

std::vector<Glib::RefPtr<Gio::DBus::Object>> ObjectManager::get_objects()
{
  return Glib::ListHandler<Glib::RefPtr<Gio::DBus::Object>>::list_to_vector(g_dbus_object_manager_get_objects(gobj()), Glib::OWNERSHIP_DEEP);
}

std::vector<Glib::RefPtr<const Gio::DBus::Object>> ObjectManager::get_objects() const
{
  return Glib::ListHandler<Glib::RefPtr<const Gio::DBus::Object>>::list_to_vector(g_dbus_object_manager_get_objects(const_cast<GDBusObjectManager*>(gobj())), Glib::OWNERSHIP_DEEP);
}

Glib::RefPtr<Gio::DBus::Object> ObjectManager::get_object(const Glib::ustring& object_path)
{
  return Glib::wrap(g_dbus_object_manager_get_object(gobj(), object_path.c_str()));
}

Glib::RefPtr<const Gio::DBus::Object> ObjectManager::get_object(const Glib::ustring& object_path) const
{
  return const_cast<ObjectManager*>(this)->get_object(object_path);
}

Glib::RefPtr<Gio::DBus::Interface> ObjectManager::get_interface(const Glib::ustring& object_path, const Glib::ustring& interface_name)
{
  return Glib::wrap(g_dbus_object_manager_get_interface(gobj(), object_path.c_str(), interface_name.c_str()));
}

Glib::RefPtr<const Gio::DBus::Interface> ObjectManager::get_interface(const Glib::ustring& object_path, const Glib::ustring& interface_name) const
{
  return const_cast<ObjectManager*>(this)->get_interface(object_path, interface_name);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&)> ObjectManager::signal_object_added()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&) >(this, &ObjectManager_signal_object_added_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&)> ObjectManager::signal_object_removed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&) >(this, &ObjectManager_signal_object_removed_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&)> ObjectManager::signal_interface_added()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&) >(this, &ObjectManager_signal_interface_added_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&)> ObjectManager::signal_interface_removed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gio::DBus::Object>&, const Glib::RefPtr<Gio::DBus::Interface>&) >(this, &ObjectManager_signal_interface_removed_info);
}


void Gio::DBus::ObjectManager::on_object_added(const Glib::RefPtr<Gio::DBus::Object>& object)
{
  const auto 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->object_added)
    (*base->object_added)(gobj(),Glib::unwrap(object));
}
void Gio::DBus::ObjectManager::on_object_removed(const Glib::RefPtr<Gio::DBus::Object>& object)
{
  const auto 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->object_removed)
    (*base->object_removed)(gobj(),Glib::unwrap(object));
}
void Gio::DBus::ObjectManager::on_interface_added(const Glib::RefPtr<Gio::DBus::Object>& object, const Glib::RefPtr<Gio::DBus::Interface>& iface)
{
  const auto 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->interface_added)
    (*base->interface_added)(gobj(),Glib::unwrap(object),Glib::unwrap(iface));
}
void Gio::DBus::ObjectManager::on_interface_removed(const Glib::RefPtr<Gio::DBus::Object>& object, const Glib::RefPtr<Gio::DBus::Interface>& iface)
{
  const auto 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->interface_removed)
    (*base->interface_removed)(gobj(),Glib::unwrap(object),Glib::unwrap(iface));
}

Glib::ustring Gio::DBus::ObjectManager::get_object_path_vfunc() const
{
  const auto 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_object_path)
  {
    Glib::ustring retval(Glib::convert_const_gchar_ptr_to_ustring((*base->get_object_path)(const_cast<GDBusObjectManager*>(gobj()))));
    return retval;
  }

  using RType = Glib::ustring;
  return RType();
}
std::vector<Glib::RefPtr<Gio::DBus::Object>> Gio::DBus::ObjectManager::get_objects_vfunc() const
{
  const auto 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_objects)
  {
    std::vector<Glib::RefPtr<Gio::DBus::Object>> retval(Glib::ListHandler<Glib::RefPtr<Gio::DBus::Object>>::list_to_vector((*base->get_objects)(const_cast<GDBusObjectManager*>(gobj())), Glib::OWNERSHIP_DEEP));
    return retval;
  }

  using RType = std::vector<Glib::RefPtr<Gio::DBus::Object>>;
  return RType();
}
Glib::RefPtr<Gio::DBus::Object> Gio::DBus::ObjectManager::get_object_vfunc(const Glib::ustring& object_path) const
{
  const auto 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_object)
  {
    Glib::RefPtr<Gio::DBus::Object> retval(Glib::wrap((*base->get_object)(const_cast<GDBusObjectManager*>(gobj()),object_path.c_str())));
    return retval;
  }

  using RType = Glib::RefPtr<Gio::DBus::Object>;
  return RType();
}
Glib::RefPtr<Gio::DBus::Interface> Gio::DBus::ObjectManager::get_interface_vfunc(const Glib::ustring& object_path, const Glib::ustring& interface_name) const
{
  const auto 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_interface)
  {
    Glib::RefPtr<Gio::DBus::Interface> retval(Glib::wrap((*base->get_interface)(const_cast<GDBusObjectManager*>(gobj()),object_path.c_str(),interface_name.c_str())));
    return retval;
  }

  using RType = Glib::RefPtr<Gio::DBus::Interface>;
  return RType();
}


} // namespace DBus

} // namespace Gio


