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

ToggleButton::ToggleButton(const string &label,gfloat x,gfloat y)
  :     Button((GtkButton*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  add_label(label,x,y);
}

}

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

namespace Gtk {
ToggleButton_Class ToggleButton::toggle_button_class = {0};

Object* ToggleButton_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new ToggleButton((GtkToggleButton*)(o)));
    return cpp;
  }

bool ToggleButton::isA( Object *checkcast)
  {
    return GTK_IS_TOGGLE_BUTTON(checkcast->gtkobj());
  }

GtkType ToggleButton::get_type()
  {
    return toggle_button_class.get_type();
  }

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

const char* const ToggleButton::signal_names[]={
   "toggled",
   0};

void ToggleButton::initialize_class()
  {

     toggle_button_self=this;

  }

void ToggleButton_Class::class_init_function(GtkToggleButtonClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->toggled=toggled_callback;
  }

void ToggleButton_Class::object_init_function(GtkToggleButton *)
  {}

}

Gtk::ToggleButton::ToggleButton()
  :     Gtk::Button((GtkButton*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

Gtk::ToggleButton::ToggleButton(GtkToggleButton *castitem)
  :     Gtk::Button((GtkButton*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::ToggleButton::set_mode(bool draw_indicator)
  {
    gtk_toggle_button_set_mode(gtkobj(),(gboolean)draw_indicator);
  }

void Gtk::ToggleButton::set_active(bool is_active)
  {
    gtk_toggle_button_set_active(gtkobj(),(gboolean)is_active);
  }

void Gtk::ToggleButton_Class::toggled_callback(GtkToggleButton* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::ToggleButton::toggled_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->toggled)
      (base->toggled)(gtkobj());

  }

bool Gtk::ToggleButton::get_mode() const
  { return gtkobj()->draw_indicator; }

bool Gtk::ToggleButton::get_active() const
  { return gtkobj()->active; }
