// -*- c++ -*-
//  Generated by gtkmmproc from ./../container.gen_h -- DO NOT MODIFY!
#include <gtk--/container.h>
#include <gtk--/private/container_p.h>
#include <gtk--/adjustment.h>

namespace {

void foreach_callback_(GtkWidget* w, gpointer data)
  {
    Gtk::Container::ForeachCallback *s=(Gtk::Container::ForeachCallback*)data;
    if (!w) return;
    s->call(*Gtk::wrap(w));
  }

}

void Gtk::Container::foreach(const ForeachCallback& s)
  {
     gtk_container_foreach(gtkobj(),
                           &foreach_callback_,
                           (void*)(&s));
  }

namespace Gtk {
Gtk::Container *wrap (GtkContainer *o)
  {
    return static_cast<Gtk::Container *> (Gtk::wrap_auto ((GtkObject *) (o)));
  }
}

namespace Gtk {
Container_Class Container::container_class = {0};

Object* Container_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Container((GtkContainer*)(o)));
    return cpp;
  }

bool Container::isA( Object *checkcast)
  {
    return GTK_IS_CONTAINER(checkcast->gtkobj());
  }

GtkType Container::get_type()
  {
    return container_class.get_type();
  }

GtkType Container_Class::get_type()
  {
    if (!type)
      {
        CppClassParent::CppObjectType::get_type();
        GtkTypeInfo info =
          {
            "Gtk__Container",
            sizeof(BaseObjectType),
            sizeof(BaseClassType),
            (GtkClassInitFunc) class_init_function,
            (GtkObjectInitFunc) object_init_function,
            /* reserved_1 */ NULL,
            /* reserved_2 */ NULL,
            /*base_class_init_func */ (GtkClassInitFunc) NULL
          };
        type=gtk_type_unique(gtk_container_get_type(), &info);
      }
    return type;
  }

const char* const Container::signal_names[]={
   "add",
   "remove",
   "check_resize",
   "focus",
   "set_focus_child",
   "child_type",
   0};

void Container::initialize_class()
  {

     container_self=this;

  }

void Container_Class::class_init_function(GtkContainerClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->add=add_callback;
    klass->remove=remove_callback;
    klass->check_resize=check_resize_callback;
    klass->focus=focus_callback;
    klass->set_focus_child=set_focus_child_callback;
    klass->child_type=child_type_callback;
  }

void Container_Class::object_init_function(GtkContainer *)
  {}

}

Gtk::Container::Container(GtkContainer *castitem)
  :     Gtk::Widget((GtkWidget*)(castitem))
  {
    initialize_class();
  }

Gtk::Container::~Container() { destroy_(); }

void Gtk::Container::set_border_width(guint width)
  {
    gtk_container_set_border_width(gtkobj(),width);
  }

void Gtk::Container::add(Gtk::Widget& p0)
  {
    gtk_container_add(gtkobj(),p0.gtkobj());
  }

void Gtk::Container::remove(Gtk::Widget& p0)
  {
    gtk_container_remove(gtkobj(),p0.gtkobj());
  }

void Gtk::Container::set_resize_mode(GtkResizeMode resize_mode)
  {
    gtk_container_set_resize_mode(gtkobj(),resize_mode);
  }

void Gtk::Container::foreach_(GtkCallback callback,gpointer data)
  {
    gtk_container_foreach(gtkobj(),callback,data);
  }

void Gtk::Container::foreach_full_(GtkCallback callback,GtkCallbackMarshal marshal,gpointer data,GtkDestroyNotify notify)
  {
    gtk_container_foreach_full(gtkobj(),callback,marshal,data,notify);
  }

void Gtk::Container::set_focus_child(Gtk::Widget* p0)
  {
    gtk_container_set_focus_child(gtkobj(),(GtkWidget*)Gtk::unwrap(p0));
  }

void Gtk::Container::set_focus_child(Gtk::Widget& p0)
  {
    gtk_container_set_focus_child(gtkobj(),p0.gtkobj());
  }

void Gtk::Container::set_focus_vadjustment(Gtk::Adjustment& adjustment)
  {
    gtk_container_set_focus_vadjustment(gtkobj(),adjustment.gtkobj());
  }

void Gtk::Container::set_focus_hadjustment(Gtk::Adjustment& adjustment)
  {
    gtk_container_set_focus_hadjustment(gtkobj(),adjustment.gtkobj());
  }

void Gtk::Container::register_toplevel()
  {
    gtk_container_register_toplevel(gtkobj());
  }

void Gtk::Container::unregister_toplevel()
  {
    gtk_container_unregister_toplevel(gtkobj());
  }

void Gtk::Container::resize_children()
  {
    gtk_container_resize_children(gtkobj());
  }

GtkType Gtk::Container::child_type()
  {
    return gtk_container_child_type(gtkobj());
  }

Gtk::Container::Container()
  :     Gtk::Widget((GtkWidget*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

void Gtk::Container_Class::add_callback(GtkContainer* p0,GtkWidget* p1)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)p0,Gtk::quark_)));

    g_return_if_fail(p1!=0);
    if (obj)
      obj->add_impl(*Gtk::wrap(p1));
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)p0)->klass->type));
        if (base->add)
          (base->add)(p0,p1);
      }

  }

void Gtk::Container::add_impl(Gtk::Widget& p0)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->add)
      (base->add)(gtkobj(),p0.gtkobj());

  }

void Gtk::Container_Class::remove_callback(GtkContainer* p0,GtkWidget* p1)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)p0,Gtk::quark_)));

    g_return_if_fail(p1!=0);
    if (obj)
      obj->remove_impl(*Gtk::wrap(p1));
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)p0)->klass->type));
        if (base->remove)
          (base->remove)(p0,p1);
      }

  }

void Gtk::Container::remove_impl(Gtk::Widget& p0)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->remove)
      (base->remove)(gtkobj(),p0.gtkobj());

  }

void Gtk::Container_Class::check_resize_callback(GtkContainer* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

    if (obj)
      obj->check_resize_impl();
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)o_)->klass->type));
        if (base->check_resize)
          (base->check_resize)(o_);
      }

  }

void Gtk::Container::check_resize_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->check_resize)
      (base->check_resize)(gtkobj());

  }

gint Gtk::Container_Class::focus_callback(GtkContainer* o_,GtkDirectionType p0)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

    if (obj)
      return obj->focus_impl(p0);
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)o_)->klass->type));
        if (base->focus)
          return (base->focus)(o_,p0);
        gtkmm_set_ignore();
      }
    return 0;

  }

gint Gtk::Container::focus_impl(GtkDirectionType p0)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->focus)
      return (base->focus)(gtkobj(),p0);
    gtkmm_set_ignore();
    return 0;

  }

void Gtk::Container_Class::set_focus_child_callback(GtkContainer* p0,GtkWidget* p1)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)p0,Gtk::quark_)));

    if (obj)
      obj->set_focus_child_impl(Gtk::wrap(p1));
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)p0)->klass->type));
        if (base->set_focus_child)
          (base->set_focus_child)(p0,p1);
      }

  }

void Gtk::Container::set_focus_child_impl(Gtk::Widget* p0)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->set_focus_child)
      (base->set_focus_child)(gtkobj(),(GtkWidget*)Gtk::unwrap(p0));

  }

GtkType Gtk::Container_Class::child_type_callback(GtkContainer* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

    if (obj)
      return obj->child_type_impl();
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)o_)->klass->type));
        if (base->child_type)
          return (base->child_type)(o_);
        gtkmm_set_ignore();
      }
    return 0;

  }

GtkType Gtk::Container::child_type_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->child_type)
      return (base->child_type)(gtkobj());
    gtkmm_set_ignore();
    return 0;

  }
