// -*- c++ -*-
//  Generated by gtkmmproc from ./../layout.gen_h -- DO NOT MODIFY!
#include <gtk--/layout.h>
#include <gtk--/private/layout_p.h>
namespace Gtk
{

/* layout.cc
 *
 * Copyright (C) 1998 EMC Capital Management Inc.
 * Developed by Havoc Pennington <hp@pobox.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

Layout::Layout()
  : Container((GtkContainer*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  set_hadjustment();
  set_vadjustment();
}

Layout::Layout(Adjustment &hadjustment,
		       Adjustment &vadjustment)
  : Container((GtkContainer*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  set_hadjustment(hadjustment);
  set_vadjustment(vadjustment);
}

}

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

namespace Gtk {
Layout_Class Layout::layout_class = {0};

Object* Layout_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Layout((GtkLayout*)(o)));
    return cpp;
  }

bool Layout::isA( Object *checkcast)
  {
    return GTK_IS_LAYOUT(checkcast->gtkobj());
  }

GtkType Layout::get_type()
  {
    return layout_class.get_type();
  }

GtkType Layout_Class::get_type()
  {
    if (!type)
      {
        CppClassParent::CppObjectType::get_type();
        GtkTypeInfo info =
          {
            "Gtk__Layout",
            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_layout_get_type(), &info);
      }
    return type;
  }

const char* const Layout::signal_names[]={
   "set_scroll_adjustments",
   0};

void Layout::initialize_class()
  {

     layout_self=this;

  }

void Layout_Class::class_init_function(GtkLayoutClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->set_scroll_adjustments=set_scroll_adjustments_callback;
  }

void Layout_Class::object_init_function(GtkLayout *)
  {}

}

void gtk_layout_set_scroll_adjustments(GtkLayout* layout,GtkAdjustment* p1,GtkAdjustment* p2)
  {
    static guint signum=gtk_signal_lookup("set_scroll_adjustments",gtk_layout_get_type());
    g_return_if_fail (layout != NULL);
    g_return_if_fail (GTK_LAYOUT (layout));

    gtk_signal_emit(GTK_OBJECT(layout),signum,p1,p2);
  }

Gtk::Layout::Layout(GtkLayout *castitem)
  :     Gtk::Container((GtkContainer*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::Layout::put(Gtk::Widget& widget,gint x,gint y)
  {
    gtk_layout_put(gtkobj(),widget.gtkobj(),x,y);
  }

void Gtk::Layout::move(Gtk::Widget& widget,gint x,gint y)
  {
    gtk_layout_move(gtkobj(),widget.gtkobj(),x,y);
  }

void Gtk::Layout::set_size(guint width,guint height)
  {
    gtk_layout_set_size(gtkobj(),width,height);
  }

void Gtk::Layout::freeze()
  {
    gtk_layout_freeze(gtkobj());
  }

void Gtk::Layout::thaw()
  {
    gtk_layout_thaw(gtkobj());
  }

void Gtk::Layout::set_hadjustment(Gtk::Adjustment* hadj)
  {
    gtk_layout_set_hadjustment(gtkobj(),(GtkAdjustment*)Gtk::unwrap(hadj));
  }

void Gtk::Layout::set_vadjustment(Gtk::Adjustment* vadj)
  {
    gtk_layout_set_vadjustment(gtkobj(),(GtkAdjustment*)Gtk::unwrap(vadj));
  }

void Gtk::Layout::set_hadjustment(Gtk::Adjustment& hadj)
  {
    gtk_layout_set_hadjustment(gtkobj(),hadj.gtkobj());
  }

void Gtk::Layout::set_vadjustment(Gtk::Adjustment& vadj)
  {
    gtk_layout_set_vadjustment(gtkobj(),vadj.gtkobj());
  }

void Gtk::Layout_Class::set_scroll_adjustments_callback(GtkLayout* p0,GtkAdjustment* p1,GtkAdjustment* p2)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)p0,Gtk::quark_)));

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

  }

void Gtk::Layout::set_scroll_adjustments_impl(Gtk::Adjustment* p0,Gtk::Adjustment* p1)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->set_scroll_adjustments)
      (base->set_scroll_adjustments)(gtkobj(),(GtkAdjustment*)Gtk::unwrap(p0),(GtkAdjustment*)Gtk::unwrap(p1));

  }

namespace {
static void set_scroll_adjustments_convert_func(SigC::Callback2<void,Gtk::Adjustment*,Gtk::Adjustment*> *s,GtkAdjustment* p1,GtkAdjustment* p2)
  {
     s->call(Gtk::wrap(p1),Gtk::wrap(p2));
  }

}

SigC::Connection
Gtk::Layout::Proxy_set_scroll_adjustments::connect(const SigC::Slot2<void,Gtk::Adjustment*,Gtk::Adjustment*> &s)
   {
    return BaseType::connect(SigC::convert(s,&set_scroll_adjustments_convert_func));
   }

void Gtk::Layout::Proxy_set_scroll_adjustments::operator()(Gtk::Adjustment* p0,Gtk::Adjustment* p1)
  {
     BaseType::emit((GtkAdjustment*)Gtk::unwrap(p0),(GtkAdjustment*)Gtk::unwrap(p1));
  }

void Gtk::Layout::Proxy_set_scroll_adjustments::emit(Gtk::Adjustment* p0,Gtk::Adjustment* p1)
  {
     BaseType::emit((GtkAdjustment*)Gtk::unwrap(p0),(GtkAdjustment*)Gtk::unwrap(p1));
  }

Gtk::Adjustment* Gtk::Layout::get_hadjustment() const
  { return Gtk::wrap(gtkobj()->hadjustment); }

Gtk::Adjustment* Gtk::Layout::get_vadjustment() const
  { return Gtk::wrap(gtkobj()->vadjustment); }
