// Generated by gtkmmproc -- DO NOT MODIFY!


#include <cluttermm/container.h>
#include <cluttermm/private/container_p.h>

/* Copyright (C) 2007 The cluttermm 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 <clutter/clutter.h>

namespace
{
extern "C"
{
static void SignalProxy_Container_foreach_callback(ClutterActor *actor, gpointer user_data)
{
  Clutter::Container::SlotForEach *const
    the_slot = static_cast<Clutter::Container::SlotForEach*>(user_data);

#ifdef GLIBMM_EXCEPTIONS_ENABLED
  try
#endif
  {
    const Glib::RefPtr<Clutter::Actor> cpp_actor = Glib::wrap(actor, true /* take reference */);
    (*the_slot)(cpp_actor);
  }
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  catch (...)
  {
    Glib::exception_handlers_invoke();
  }
#endif
}
} // extern "C"
} // anonymous namespace

namespace Clutter
{

void Container::raise_child(const Glib::RefPtr<Actor>& actor)
{
  clutter_container_raise_child(gobj(), Glib::unwrap(actor), 0);
}

void Container::lower_child(const Glib::RefPtr<Actor>& actor)
{
  clutter_container_lower_child(gobj(), Glib::unwrap(actor), 0);
}

void Container::foreach(const SlotForEach& slot)
{
  clutter_container_foreach(gobj(),
      &SignalProxy_Container_foreach_callback, const_cast<SlotForEach*>(&slot));
}

void Container::get_child_property_value(const Glib::RefPtr<const Actor>& child,
                     const Glib::ustring& property_name, Glib::ValueBase& value) const
{
  clutter_container_child_get_property(const_cast<ClutterContainer*>(gobj()),
      const_cast<ClutterActor*>(child->gobj()), property_name.c_str(), value.gobj());
}

void Container::actor_added(const Glib::RefPtr<Actor>& actor)
{
  g_signal_emit_by_name(gobj(), "actor_added", actor->gobj());
}

void Container::actor_removed(const Glib::RefPtr<Actor>& actor)
{
  g_signal_emit_by_name(gobj(), "actor_removed", actor->gobj());
}

std::vector<Glib::RefPtr<Actor> > Container::get_children()
{
  GList* actorList = clutter_container_get_children(gobj());
  const guint actorCount = g_list_length(actorList);
  std::vector<Glib::RefPtr<Actor> > actorVec;
  actorVec.reserve(actorCount);

  for(GList* actorNode = actorList; actorNode->next; actorNode = actorList->next)
  {
    actorVec.push_back(Glib::wrap(static_cast<ClutterActor*>(actorNode->data), true));
  }

  return actorVec;
}

std::vector<Glib::RefPtr<const Actor> > Container::get_children() const
{
  GList* actorList = clutter_container_get_children(const_cast<ClutterContainer*>(gobj()));
  const guint actorCount = g_list_length(actorList);
  std::vector<Glib::RefPtr<const Actor> > actorVec;
  actorVec.reserve(actorCount);

  for(GList* actorNode = actorList; actorNode->next; actorNode = actorList->next)
  {
    actorVec.push_back(Glib::wrap(static_cast<ClutterActor*>(actorNode->data), true));
  }

  return actorVec;
}

} // namespace Clutter

namespace
{


static void Container_signal_actor_added_callback(ClutterContainer* self, ClutterActor* actor,void* data)
{
  using namespace Clutter;
  typedef sigc::slot< void,const Glib::RefPtr<Actor>& > 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(actor, true)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Container_signal_actor_added_info =
{
  "actor_added",
  (GCallback) &Container_signal_actor_added_callback,
  (GCallback) &Container_signal_actor_added_callback
};


static void Container_signal_actor_removed_callback(ClutterContainer* self, ClutterActor* actor,void* data)
{
  using namespace Clutter;
  typedef sigc::slot< void,const Glib::RefPtr<Actor>& > 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(actor, true)
);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Container_signal_actor_removed_info =
{
  "actor_removed",
  (GCallback) &Container_signal_actor_removed_callback,
  (GCallback) &Container_signal_actor_removed_callback
};


static void Container_signal_child_notify_callback(ClutterContainer* self, ClutterActor* actor,GParamSpec* pspec,void* data)
{
  using namespace Clutter;
  typedef sigc::slot< void,const Glib::RefPtr<Actor>&,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))(Glib::wrap(actor, true)
, pspec);
    #ifdef GLIBMM_EXCEPTIONS_ENABLED
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
    #endif //GLIBMM_EXCEPTIONS_ENABLED
  }
}

static const Glib::SignalProxyInfo Container_signal_child_notify_info =
{
  "child_notify",
  (GCallback) &Container_signal_child_notify_callback,
  (GCallback) &Container_signal_child_notify_callback
};


} // anonymous namespace


namespace Glib
{

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

} // namespace Glib


namespace Clutter
{


/* The *_Class implementation: */

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

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

  return *this;
}

void Container_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->add = &add_vfunc_callback;
  klass->remove = &remove_vfunc_callback;
  klass->raise = &raise_vfunc_callback;
  klass->lower = &lower_vfunc_callback;
  klass->sort_depth_order = &sort_depth_order_vfunc_callback;
  klass->foreach = &foreach_vfunc_callback;
  klass->create_child_meta = &create_child_meta_vfunc_callback;
  klass->destroy_child_meta = &destroy_child_meta_vfunc_callback;
  klass->get_child_meta = &get_child_meta_vfunc_callback;

  klass->actor_added = &actor_added_callback;
  klass->actor_removed = &actor_removed_callback;
  klass->child_notify = &child_notify_callback;
}

void Container_Class::add_vfunc_callback(ClutterContainer* self, ClutterActor* actor)
{
  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->add_vfunc(Glib::wrap(actor, true)
);
        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->add)
    (*base->add)(self, actor);

}
void Container_Class::remove_vfunc_callback(ClutterContainer* self, ClutterActor* actor)
{
  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->remove_vfunc(Glib::wrap(actor, true)
);
        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->remove)
    (*base->remove)(self, actor);

}
void Container_Class::raise_vfunc_callback(ClutterContainer* self, ClutterActor* actor, ClutterActor* sibling)
{
  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->raise_vfunc(Glib::wrap(actor, true)
, Glib::wrap(sibling, true)
);
        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->raise)
    (*base->raise)(self, actor, sibling);

}
void Container_Class::lower_vfunc_callback(ClutterContainer* self, ClutterActor* actor, ClutterActor* sibling)
{
  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->lower_vfunc(Glib::wrap(actor, true)
, Glib::wrap(sibling, true)
);
        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->lower)
    (*base->lower)(self, actor, sibling);

}
void Container_Class::sort_depth_order_vfunc_callback(ClutterContainer* 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->sort_depth_order_vfunc();
        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->sort_depth_order)
    (*base->sort_depth_order)(self);

}
void Container_Class::foreach_vfunc_callback(ClutterContainer* self, ClutterCallback callback, gpointer user_data)
{
  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->foreach_vfunc(callback, user_data);
        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->foreach)
    (*base->foreach)(self, callback, user_data);

}
void Container_Class::create_child_meta_vfunc_callback(ClutterContainer* self, ClutterActor* actor)
{
  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->create_child_meta_vfunc(Glib::wrap(actor, true)
);
        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->create_child_meta)
    (*base->create_child_meta)(self, actor);

}
void Container_Class::destroy_child_meta_vfunc_callback(ClutterContainer* self, ClutterActor* actor)
{
  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->destroy_child_meta_vfunc(Glib::wrap(actor, true)
);
        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->destroy_child_meta)
    (*base->destroy_child_meta)(self, actor);

}
ClutterChildMeta* Container_Class::get_child_meta_vfunc_callback(ClutterContainer* self, ClutterActor* actor)
{
  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 Glib::unwrap(obj->get_child_meta_vfunc(Glib::wrap(actor, true)
));
      #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_child_meta)
    return (*base->get_child_meta)(self, actor);


  typedef ClutterChildMeta* RType;
  return RType();
}

void Container_Class::actor_added_callback(ClutterContainer* self, ClutterActor* actor)
{
  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_actor_added(Glib::wrap(actor, true)
);
        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->actor_added)
    (*base->actor_added)(self, actor);
}
void Container_Class::actor_removed_callback(ClutterContainer* self, ClutterActor* actor)
{
  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_actor_removed(Glib::wrap(actor, true)
);
        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->actor_removed)
    (*base->actor_removed)(self, actor);
}
void Container_Class::child_notify_callback(ClutterContainer* self, ClutterActor* actor, 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->on_child_notify(Glib::wrap(actor, true)
, 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->child_notify)
    (*base->child_notify)(self, actor, pspec);
}


Glib::ObjectBase* Container_Class::wrap_new(GObject* object)
{
  return new Container((ClutterContainer*)(object));
}


/* The implementation: */

Container::Container()
:
  Glib::Interface(container_class_.init())
{}

Container::Container(ClutterContainer* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

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

Container::~Container()
{}

// static
void Container::add_interface(GType gtype_implementer)
{
  container_class_.init().add_interface(gtype_implementer);
}

Container::CppClassType Container::container_class_; // initialize static member

GType Container::get_type()
{
  return container_class_.init().get_type();
}


GType Container::get_base_type()
{
  return clutter_container_get_type();
}


void Container::add_actor(const Glib::RefPtr<Actor>& actor)
{
clutter_container_add_actor(gobj(), Glib::unwrap(actor)); 
}

void Container::remove_actor(const Glib::RefPtr<Actor>& actor)
{
clutter_container_remove_actor(gobj(), Glib::unwrap(actor)); 
}

void Container::lower_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling)
{
clutter_container_lower_child(gobj(), Glib::unwrap(actor), Glib::unwrap(sibling)); 
}

void Container::raise_child(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling)
{
clutter_container_raise_child(gobj(), Glib::unwrap(actor), Glib::unwrap(sibling)); 
}

Glib::RefPtr<Actor> Container::find_child(const Glib::ustring& child_name)
{

  Glib::RefPtr<Actor> retvalue = Glib::wrap(clutter_container_find_child_by_name(gobj(), child_name.c_str()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Actor> Container::find_child(const Glib::ustring& child_name) const
{
  return const_cast<Container*>(this)->find_child(child_name);
}

void Container::set_child_property_value(const Glib::RefPtr<Actor>& child, const Glib::ustring& property_name, const Glib::ValueBase& value)
{
clutter_container_child_set_property(gobj(), Glib::unwrap(child), property_name.c_str(), (value).gobj()); 
}

Glib::RefPtr<ChildMeta> Container::get_child_meta(const Glib::RefPtr<const Actor>& actor)
{

  Glib::RefPtr<ChildMeta> retvalue = Glib::wrap(clutter_container_get_child_meta(gobj(), const_cast<ClutterActor*>(Glib::unwrap(actor))));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const ChildMeta> Container::get_child_meta(const Glib::RefPtr<const Actor>& actor) const
{
  return const_cast<Container*>(this)->get_child_meta(actor);
}

void Container::sort_depth_order()
{
clutter_container_sort_depth_order(gobj()); 
}


Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > Container::signal_actor_added()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& >(this, &Container_signal_actor_added_info);
}


Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& > Container::signal_actor_removed()
{
  return Glib::SignalProxy1< void,const Glib::RefPtr<Actor>& >(this, &Container_signal_actor_removed_info);
}


Glib::SignalProxy2< void,const Glib::RefPtr<Actor>&,GParamSpec* > Container::signal_child_notify()
{
  return Glib::SignalProxy2< void,const Glib::RefPtr<Actor>&,GParamSpec* >(this, &Container_signal_child_notify_info);
}


void Clutter::Container::on_actor_added(const Glib::RefPtr<Actor>& actor)
{
  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->actor_added)
    (*base->actor_added)(gobj(),Glib::unwrap(actor));
}
void Clutter::Container::on_actor_removed(const Glib::RefPtr<Actor>& actor)
{
  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->actor_removed)
    (*base->actor_removed)(gobj(),Glib::unwrap(actor));
}
void Clutter::Container::on_child_notify(const Glib::RefPtr<Actor>& actor, 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->child_notify)
    (*base->child_notify)(gobj(),Glib::unwrap(actor),pspec);
}

void Clutter::Container::add_vfunc(const Glib::RefPtr<Actor>& actor) 
{
  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->add)
    (*base->add)(gobj(),Glib::unwrap(actor));
}
void Clutter::Container::remove_vfunc(const Glib::RefPtr<Actor>& actor) 
{
  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->remove)
    (*base->remove)(gobj(),Glib::unwrap(actor));
}
void Clutter::Container::raise_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling) 
{
  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->raise)
    (*base->raise)(gobj(),Glib::unwrap(actor),Glib::unwrap(sibling));
}
void Clutter::Container::lower_vfunc(const Glib::RefPtr<Actor>& actor, const Glib::RefPtr<Actor>& sibling) 
{
  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->lower)
    (*base->lower)(gobj(),Glib::unwrap(actor),Glib::unwrap(sibling));
}
void Clutter::Container::sort_depth_order_vfunc() 
{
  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->sort_depth_order)
    (*base->sort_depth_order)(gobj());
}
void Clutter::Container::foreach_vfunc(ClutterCallback callback, gpointer user_data) 
{
  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->foreach)
    (*base->foreach)(gobj(),callback,user_data);
}
void Clutter::Container::create_child_meta_vfunc(const Glib::RefPtr<Actor>& actor) 
{
  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->create_child_meta)
    (*base->create_child_meta)(gobj(),Glib::unwrap(actor));
}
void Clutter::Container::destroy_child_meta_vfunc(const Glib::RefPtr<Actor>& actor) 
{
  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->destroy_child_meta)
    (*base->destroy_child_meta)(gobj(),Glib::unwrap(actor));
}
Glib::RefPtr<ChildMeta> Clutter::Container::get_child_meta_vfunc(const Glib::RefPtr<Actor>& actor) 
{
  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_child_meta)
    return Glib::wrap((*base->get_child_meta)(gobj(),Glib::unwrap(actor)));

  typedef Glib::RefPtr<ChildMeta> RType;
  return RType();
}


} // namespace Clutter


