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

TreeItem::TreeItem(const string &label,gfloat x,gfloat y)
  :     Item((GtkItem*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  add_label(label,x,y);
}

TreeItem::TreeItem(const Gdk_Pixmap &pixmap,
                    const Gdk_Bitmap &bitmap,
                    const string &label,
                    gfloat x,
                    gfloat y)
  :     Item((GtkItem*)(gtk_object_new(get_type(),0)))
{
  initialize_class();
  add_pixlabel(pixmap,bitmap,label,x,y);
}

}

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

namespace Gtk {
TreeItem_Class TreeItem::tree_item_class = {0};

Object* TreeItem_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new TreeItem((GtkTreeItem*)(o)));
    return cpp;
  }

bool TreeItem::isA( Object *checkcast)
  {
    return GTK_IS_TREE_ITEM(checkcast->gtkobj());
  }

GtkType TreeItem::get_type()
  {
    return tree_item_class.get_type();
  }

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

const char* const TreeItem::signal_names[]={
   "expand",
   "collapse",
   0};

void TreeItem::initialize_class()
  {

     tree_item_self=this;

  }

void TreeItem_Class::class_init_function(GtkTreeItemClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
    klass->expand=expand_callback;
    klass->collapse=collapse_callback;
  }

void TreeItem_Class::object_init_function(GtkTreeItem *)
  {}

}

Gtk::TreeItem::TreeItem(GtkTreeItem *castitem)
  :     Gtk::Item((GtkItem*)(castitem))
  {
    initialize_class();
  }

Gtk::TreeItem::TreeItem()
  :     Gtk::Item((GtkItem*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

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

void Gtk::TreeItem::set_subtree(Gtk::Widget& subtree)
  {
    gtk_tree_item_set_subtree(gtkobj(),subtree.gtkobj());
  }

void Gtk::TreeItem::remove_subtree()
  {
    gtk_tree_item_remove_subtree(gtkobj());
  }

void Gtk::TreeItem_Class::expand_callback(GtkTreeItem* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::TreeItem::expand_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->expand)
      (base->expand)(gtkobj());

  }

void Gtk::TreeItem_Class::collapse_callback(GtkTreeItem* o_)
  {
    CppObjectType *obj=
      static_cast<CppObjectType *>(static_cast<Gtk::Object *>(
        gtk_object_get_data_by_id((GtkObject*)o_,Gtk::quark_)));

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

  }

void Gtk::TreeItem::collapse_impl()
  {
    BaseClassType* base=
      static_cast<BaseClassType*>(
        gtk_type_parent_class(gtkobject->klass->type));
    if (base->collapse)
      (base->collapse)(gtkobj());

  }

Gtk::Tree* Gtk::TreeItem::get_subtree() const
  { return Gtk::wrap((GtkTree*)(gtkobj()->subtree)); }
