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

typedef Statusbar_Helpers::MsgList MsgList;
typedef MsgList::iterator msg_iterator;

GSList*& MsgList::glist() const
  { return parent_->gtkobj()->messages; }

msg_iterator MsgList::begin()
  { return iterator(glist()); }
msg_iterator MsgList::end()
  { return iterator((GSList*)0); }

void MsgList::push_front(const Statusbar_Helpers::Element& e)
  { parent_->push(e.context_id,e.message); }

MsgList::size_type MsgList::size(void) const
  { return g_slist_length(glist()); }

msg_iterator MsgList::erase(iterator i)
  {
    iterator next=i;
    ++next;
    remove(*i);
    return next;
  }

void MsgList::erase(msg_iterator start, msg_iterator stop)
  { while (start!=stop) erase(start++); }

void MsgList::remove(const_reference r)
  { if (r) parent_->remove_message(r->get_context_id(),r->get_message_id()); }


}

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

namespace Gtk {
Statusbar_Class Statusbar::statusbar_class = {0};

Object* Statusbar_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Statusbar((GtkStatusbar*)(o)));
    return cpp;
  }

bool Statusbar::isA( Object *checkcast)
  {
    return GTK_IS_STATUSBAR(checkcast->gtkobj());
  }

GtkType Statusbar::get_type()
  {
    return statusbar_class.get_type();
  }

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

const char* const Statusbar::signal_names[]={
   "text_pushed",
   "text_popped",
   0};

void Statusbar::initialize_class()
  {

     statusbar_self=this;

  }

void Statusbar_Class::class_init_function(GtkStatusbarClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->text_pushed=text_pushed_callback;
    klass->text_popped=text_popped_callback;
  }

void Statusbar_Class::object_init_function(GtkStatusbar *)
  {}

}

Gtk::Statusbar::Statusbar(GtkStatusbar *castitem)
  :     Gtk::HBox((GtkHBox*)(castitem))
  {
    initialize_class();
  }

Gtk::Statusbar::Statusbar()
  :     Gtk::HBox((GtkHBox*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

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

guint Gtk::Statusbar::get_context_id(const nstring& context_description) const
  {
    return gtk_statusbar_get_context_id(const_cast<GtkStatusbar*>(gtkobj()),context_description.gc_str());
  }

guint Gtk::Statusbar::push(guint context_id,const nstring& text)
  {
    return gtk_statusbar_push(gtkobj(),context_id,text.gc_str());
  }

void Gtk::Statusbar::pop(guint context_id)
  {
    gtk_statusbar_pop(gtkobj(),context_id);
  }

void Gtk::Statusbar::remove_message(guint context_id,guint message_id)
  {
    gtk_statusbar_remove(gtkobj(),context_id,message_id);
  }

void Gtk::Statusbar_Class::text_pushed_callback(GtkStatusbar* o_,guint p0,const gchar* p1)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

    if (obj)
      obj->text_pushed_impl(p0,p1);
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)o_)->klass->type));
        if (base->text_pushed)
          (base->text_pushed)(o_,p0,p1);
      }

  }

void Gtk::Statusbar::text_pushed_impl(guint p0,const gchar* p1)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->text_pushed)
      (base->text_pushed)(gtkobj(),p0,p1);

  }

void Gtk::Statusbar_Class::text_popped_callback(GtkStatusbar* o_,guint p0,const gchar* p1)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

    if (obj)
      obj->text_popped_impl(p0,p1);
    else
      {
        BaseClassType* base=
          static_cast<BaseClassType*>(
            gtk_type_parent_class(((GtkObject*)o_)->klass->type));
        if (base->text_popped)
          (base->text_popped)(o_,p0,p1);
      }

  }

void Gtk::Statusbar::text_popped_impl(guint p0,const gchar* p1)
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->text_popped)
      (base->text_popped)(gtkobj(),p0,p1);

  }
