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

#define MAX_RATIO 10000.0
#define MIN_RATIO 0.0001

void
AspectFrame::construct(const char* label,
                           gfloat xalign,
                           gfloat yalign,
                           gfloat ratio,
                           bool obey_child)
{
  initialize_class();
  GtkAspectFrame *aspect_frame=(GtkAspectFrame*)gtkobject;
  aspect_frame->xalign = CLAMP (xalign, 0.0, 1.0);
  aspect_frame->yalign = CLAMP (yalign, 0.0, 1.0);
  aspect_frame->ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
  aspect_frame->obey_child = obey_child;

  gtk_frame_set_label (GTK_FRAME(aspect_frame), label);

}

AspectFrame::AspectFrame(const string &label,
				 gfloat xalign,
				 gfloat yalign,
				 gfloat ratio,
				 bool obey_child)
  : Frame((GtkFrame*)(gtk_object_new(get_type(),0)))
{
  construct(label.c_str(),xalign,yalign,ratio,obey_child);
}

AspectFrame::AspectFrame(gfloat xalign,
				 gfloat yalign,
				 gfloat ratio,
				 bool obey_child)
  : Frame((GtkFrame*)(gtk_object_new(get_type(),0)))
{
  construct((char*)0,xalign,yalign,ratio,obey_child);
}

}

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

namespace Gtk {
AspectFrame_Class AspectFrame::aspect_frame_class = {0};

Object* AspectFrame_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new AspectFrame((GtkAspectFrame*)(o)));
    return cpp;
  }

bool AspectFrame::isA( Object *checkcast)
  {
    return GTK_IS_ASPECT_FRAME(checkcast->gtkobj());
  }

GtkType AspectFrame::get_type()
  {
    return aspect_frame_class.get_type();
  }

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

const char* const AspectFrame::signal_names[]={
   0};

void AspectFrame::initialize_class()
  {

  }

void AspectFrame_Class::class_init_function(GtkAspectFrameClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
  }

void AspectFrame_Class::object_init_function(GtkAspectFrame *)
  {}

}

Gtk::AspectFrame::AspectFrame(GtkAspectFrame *castitem)
  :     Gtk::Frame((GtkFrame*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::AspectFrame::set(gfloat xalign,gfloat yalign,gfloat ratio,gint obey_child)
  {
    gtk_aspect_frame_set(gtkobj(),xalign,yalign,ratio,obey_child);
  }
