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

Button::Button(const string &label,gfloat x,gfloat y)
  : Bin((GtkBin*)(gtk_object_new(get_type(),0)))

{
  initialize_class();
  add_label(label,x,y);
}

}

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

namespace Gtk {
Button_Class Button::button_class = {0};

Object* Button_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Button((GtkButton*)(o)));
    return cpp;
  }

bool Button::isA( Object *checkcast)
  {
    return GTK_IS_BUTTON(checkcast->gtkobj());
  }

GtkType Button::get_type()
  {
    return button_class.get_type();
  }

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

const char* const Button::signal_names[]={
   "pressed",
   "released",
   "clicked",
   "enter",
   "leave",
   0};

void Button::initialize_class()
  {

     button_self=this;

  }

void Button_Class::class_init_function(GtkButtonClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->pressed=pressed_callback;
    klass->released=released_callback;
    klass->clicked=clicked_callback;
    klass->enter=enter_callback;
    klass->leave=leave_callback;
  }

void Button_Class::object_init_function(GtkButton *)
  {}

}

Gtk::Button::Button()
  :     Gtk::Bin((GtkBin*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

Gtk::Button::Button(GtkButton *castitem)
  :     Gtk::Bin((GtkBin*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::Button::set_relief(GtkReliefStyle newstyle)
  {
    gtk_button_set_relief(gtkobj(),newstyle);
  }

GtkReliefStyle Gtk::Button::get_relief() const
  {
    return gtk_button_get_relief(const_cast<GtkButton*>(gtkobj()));
  }

void Gtk::Button_Class::pressed_callback(GtkButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::Button::pressed_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->pressed)
      (base->pressed)(gtkobj());

  }

void Gtk::Button_Class::released_callback(GtkButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::Button::released_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->released)
      (base->released)(gtkobj());

  }

void Gtk::Button_Class::clicked_callback(GtkButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::Button::clicked_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->clicked)
      (base->clicked)(gtkobj());

  }

void Gtk::Button_Class::enter_callback(GtkButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::Button::enter_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->enter)
      (base->enter)(gtkobj());

  }

void Gtk::Button_Class::leave_callback(GtkButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::Button::leave_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->leave)
      (base->leave)(gtkobj());

  }
