// -*- c++ -*-
//  Generated by gtkmmproc from ./../menu.gen_h -- DO NOT MODIFY!
#include <gtk--/menu.h>
#include <gtk--/private/menu_p.h>
#include <gtk/gtkdnd.h>
#include <gtk--/accelgroup.h>

namespace Gtk
{

void
Menu::popup                        (GtkMenuPositionFunc func,
				      gpointer data,
				      guint button,
				      guint32 activate_time)
  {
    gtk_menu_popup(gtkobj(), 0, 0,
		   func, data, button, activate_time);
  }

void
Menu::popup                        ( guint button,
                                      guint32 activate_time)
  {
    gtk_menu_popup(gtkobj(), 0, 0, 0, 0, button, activate_time);
  }


#if GTK_VERSION_GT_MICRO(1,2,0)
AccelGroup*
Menu::get_uline_accel_group() const
  {
    return wrap((GtkAccelGroup*)(gtk_menu_get_uline_accel_group(const_cast<GtkMenu*>(gtkobj()))));
  }

AccelGroup*
Menu::ensure_uline_accel_group() const
  {
    return wrap((GtkAccelGroup*)(
				 gtk_menu_ensure_uline_accel_group(const_cast<GtkMenu*>(gtkobj()))
				 ));
  }
#endif

void
Menu::reorder_child(const MenuItem &child, gint position)
  {
    gtk_menu_reorder_child(gtkobj(),
			   const_cast<GtkWidget*>(GTK_WIDGET(child.gtkobj())),
			   position);
  }

} /* namespace Gtk */

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

namespace Gtk {
Menu_Class Menu::menu_class = {0};

Object* Menu_Class::wrap_new(GtkObject* o)
  {
    Object* cpp=manage(new Menu((GtkMenu*)(o)));
    return cpp;
  }

bool Menu::isA( Object *checkcast)
  {
    return GTK_IS_MENU(checkcast->gtkobj());
  }

GtkType Menu::get_type()
  {
    return menu_class.get_type();
  }

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

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

void Menu::initialize_class()
  {

  }

void Menu_Class::class_init_function(GtkMenuClass *klass)
  {
    CppClassParent::class_init_function((BaseClassParent*)klass);
  }

void Menu_Class::object_init_function(GtkMenu *)
  {}

}

Gtk::Menu::Menu()
  :     Gtk::MenuShell((GtkMenuShell*)(gtk_object_new(get_type(),0)))
  {
    initialize_class();
  }

Gtk::Menu::Menu(GtkMenu *castitem)
  :     Gtk::MenuShell((GtkMenuShell*)(castitem))
  {
    initialize_class();
  }

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

void Gtk::Menu::popup(Gtk::MenuShell& parent_menu_shell,Gtk::MenuItem& parent_menu_item,GtkMenuPositionFunc func,gpointer data,guint button,guint32 activate_time)
  {
    gtk_menu_popup(gtkobj(),parent_menu_shell.Widget::gtkobj(),parent_menu_item.Widget::gtkobj(),func,data,button,activate_time);
  }

void Gtk::Menu::popdown()
  {
    gtk_menu_popdown(gtkobj());
  }

Gtk::MenuItem* Gtk::Menu::get_active() const
  {
    return Gtk::wrap((GtkMenuItem*)(gtk_menu_get_active(const_cast<GtkMenu*>(gtkobj()))));
  }

void Gtk::Menu::set_active(gint index)
  {
    gtk_menu_set_active(gtkobj(),index);
  }

void Gtk::Menu::reposition()
  {
    gtk_menu_reposition(gtkobj());
  }

void Gtk::Menu::set_accel_group(Gtk::AccelGroup* accel_group)
  {
    gtk_menu_set_accel_group(gtkobj(),(GtkAccelGroup*)Gtk::unwrap(accel_group));
  }

void Gtk::Menu::set_accel_group(Gtk::AccelGroup& accel_group)
  {
    gtk_menu_set_accel_group(gtkobj(),accel_group.gtkobj());
  }

void Gtk::Menu::set_tearoff_state(bool torn_off)
  {
    gtk_menu_set_tearoff_state(gtkobj(),torn_off);
  }

void Gtk::Menu::set_title(const nstring& title)
  {
    gtk_menu_set_title(gtkobj(),title.gc_str());
  }

void Gtk::Menu::attach_to_widget(Gtk::Widget& widget,GtkMenuDetachFunc detacher)
  {
    gtk_menu_attach_to_widget(gtkobj(),widget.gtkobj(),detacher);
  }

Gtk::Widget* Gtk::Menu::get_attach_widget() const
  {
    return Gtk::wrap(gtk_menu_get_attach_widget(const_cast<GtkMenu*>(gtkobj())));
  }

void Gtk::Menu::detach()
  {
    gtk_menu_detach(gtkobj());
  }

Gtk::AccelGroup* Gtk::Menu::get_accel_group() const
  { return Gtk::wrap(gtkobj()->accel_group); }
