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

Viewport::Viewport()
  : Bin((GtkBin*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  set_hadjustment();
  set_vadjustment();
}

Viewport::Viewport( Adjustment &hadjustment,
			    Adjustment &vadjustment)
  :     Bin((GtkBin*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  set_hadjustment(hadjustment);
  set_vadjustment(vadjustment);
}

}

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

namespace Gtk {
Viewport_Class Viewport::viewport_class = {0};

Object* Viewport_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Viewport((GtkViewport*)(o)));
    return cpp;
  }

bool Viewport::isA( Object *checkcast)
  {
    return GTK_IS_VIEWPORT(checkcast->gtkobj());
  }

GtkType Viewport::get_type()
  {
    return viewport_class.get_type();
  }

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

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

void Viewport::initialize_class()
  {

     viewport_self=this;

  }

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

void Viewport_Class::object_init_function(GtkViewport *)
  {}

}

void gtk_viewport_set_scroll_adjustments(GtkViewport* viewport,GtkAdjustment* p1,GtkAdjustment* p2)
  {
    static guint signum=gtk_signal_lookup("set_scroll_adjustments",gtk_viewport_get_type());
    g_return_if_fail (viewport != NULL);
    g_return_if_fail (GTK_VIEWPORT (viewport));

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

Gtk::Viewport::Viewport(GtkViewport *castitem)
  :     Gtk::Bin((GtkBin*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::Viewport::set_hadjustment(Gtk::Adjustment* adjustment)
  {
    gtk_viewport_set_hadjustment(gtkobj(),(GtkAdjustment*)Gtk::unwrap(adjustment));
  }

void Gtk::Viewport::set_vadjustment(Gtk::Adjustment* adjustment)
  {
    gtk_viewport_set_vadjustment(gtkobj(),(GtkAdjustment*)Gtk::unwrap(adjustment));
  }

void Gtk::Viewport::set_hadjustment(Gtk::Adjustment& adjustment)
  {
    gtk_viewport_set_hadjustment(gtkobj(),adjustment.gtkobj());
  }

void Gtk::Viewport::set_vadjustment(Gtk::Adjustment& adjustment)
  {
    gtk_viewport_set_vadjustment(gtkobj(),adjustment.gtkobj());
  }

void Gtk::Viewport::set_shadow_type(GtkShadowType type)
  {
    gtk_viewport_set_shadow_type(gtkobj(),type);
  }

void Gtk::Viewport_Class::set_scroll_adjustments_callback(GtkViewport* 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::Viewport::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::Viewport::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::Viewport::Proxy_set_scroll_adjustments::operator()(Gtk::Adjustment* p0,Gtk::Adjustment* p1)
  {
     BaseType::emit((GtkAdjustment*)Gtk::unwrap(p0),(GtkAdjustment*)Gtk::unwrap(p1));
  }

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

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

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

GtkShadowType Gtk::Viewport::get_shadow_type() const
  { return gtkobj()->shadow_type; }
