// Generated by gmmproc 2.63.1 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/menubutton.h>
#include <gtkmm/private/menubutton_p.h>


/* Copyright (C) 2012 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gtk/gtk.h>

namespace
{

void SignalProxy_MenuButton_create_popup_callback(
  GtkMenuButton* /* menu_button */, gpointer user_data)
{
  auto the_slot = static_cast<Gtk::MenuButton::SlotCreatePopup*>(user_data);

  try
  {
    (*the_slot)();
  }
  catch (...)
  {
    Glib::exception_handlers_invoke();
  }
  return;
}

} // anonymous namespace

namespace Gtk
{

void MenuButton::unset_popover()
{
  gtk_menu_button_set_popover(gobj(), nullptr);
}

void MenuButton::unset_menu_model()
{
  gtk_menu_button_set_menu_model(gobj(), nullptr);
}

void MenuButton::set_create_popup_func(const SlotCreatePopup& slot)
{
  // Create a copy of the slot object. A pointer to this will be passed
  // through the callback's user_data parameter. It will be deleted
  // when Glib::destroy_notify_delete<SlotCreatePopup> is called.
  auto slot_copy = new SlotCreatePopup(slot);

  gtk_menu_button_set_create_popup_func(gobj(),
    &SignalProxy_MenuButton_create_popup_callback, slot_copy,
    &Glib::destroy_notify_delete<SlotCreatePopup>);
}

void MenuButton::unset_create_popup_func()
{
  gtk_menu_button_set_create_popup_func(gobj(), nullptr, nullptr, nullptr);
}

} //namespace Gtk

namespace
{
} // anonymous namespace


namespace Glib
{

Gtk::MenuButton* wrap(GtkMenuButton* object, bool take_copy)
{
  return dynamic_cast<Gtk::MenuButton *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& MenuButton_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &MenuButton_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gtk_menu_button_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void MenuButton_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* MenuButton_Class::wrap_new(GObject* o)
{
  return manage(new MenuButton((GtkMenuButton*)(o)));

}


/* The implementation: */

MenuButton::MenuButton(const Glib::ConstructParams& construct_params)
:
  Gtk::Widget(construct_params)
{
  }

MenuButton::MenuButton(GtkMenuButton* castitem)
:
  Gtk::Widget((GtkWidget*)(castitem))
{
  }


MenuButton::MenuButton(MenuButton&& src) noexcept
: Gtk::Widget(std::move(src))
{}

MenuButton& MenuButton::operator=(MenuButton&& src) noexcept
{
  Gtk::Widget::operator=(std::move(src));
  return *this;
}

MenuButton::~MenuButton() noexcept
{
  destroy_();
}

MenuButton::CppClassType MenuButton::menubutton_class_; // initialize static member

GType MenuButton::get_type()
{
  return menubutton_class_.init().get_type();
}


GType MenuButton::get_base_type()
{
  return gtk_menu_button_get_type();
}


MenuButton::MenuButton()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Widget(Glib::ConstructParams(menubutton_class_.init()))
{
  

}

void MenuButton::set_popover(Popover& popover)
{
  gtk_menu_button_set_popover(gobj(), (popover).Gtk::Widget::gobj());
}

Popover* MenuButton::get_popover()
{
  return Glib::wrap(gtk_menu_button_get_popover(gobj()));
}

const Popover* MenuButton::get_popover() const
{
  return const_cast<MenuButton*>(this)->get_popover();
}

void MenuButton::set_direction(ArrowType direction)
{
  gtk_menu_button_set_direction(gobj(), static_cast<GtkArrowType>(direction));
}

ArrowType MenuButton::get_direction() const
{
  return static_cast<ArrowType>(gtk_menu_button_get_direction(const_cast<GtkMenuButton*>(gobj())));
}

void MenuButton::set_menu_model(const Glib::RefPtr<const Gio::MenuModel>& menu_model)
{
  gtk_menu_button_set_menu_model(gobj(), const_cast<GMenuModel*>(Glib::unwrap(menu_model)));
}

Glib::RefPtr<Gio::MenuModel> MenuButton::get_menu_model()
{
  auto retvalue = Glib::wrap(gtk_menu_button_get_menu_model(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gio::MenuModel> MenuButton::get_menu_model() const
{
  return const_cast<MenuButton*>(this)->get_menu_model();
}

void MenuButton::set_align_widget(Widget& align_widget)
{
  gtk_menu_button_set_align_widget(gobj(), (align_widget).gobj());
}

Widget* MenuButton::get_align_widget()
{
  return Glib::wrap(gtk_menu_button_get_align_widget(gobj()));
}

const Widget* MenuButton::get_align_widget() const
{
  return const_cast<MenuButton*>(this)->get_align_widget();
}

void MenuButton::set_icon_name(const Glib::ustring& icon_name)
{
  gtk_menu_button_set_icon_name(gobj(), icon_name.c_str());
}

Glib::ustring MenuButton::get_icon_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_menu_button_get_icon_name(const_cast<GtkMenuButton*>(gobj())));
}

void MenuButton::set_label(const Glib::ustring& label)
{
  gtk_menu_button_set_label(gobj(), label.c_str());
}

Glib::ustring MenuButton::get_label() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_menu_button_get_label(const_cast<GtkMenuButton*>(gobj())));
}

void MenuButton::set_relief(ReliefStyle relief)
{
  gtk_menu_button_set_relief(gobj(), static_cast<GtkReliefStyle>(relief));
}

ReliefStyle MenuButton::get_relief() const
{
  return static_cast<ReliefStyle>(gtk_menu_button_get_relief(const_cast<GtkMenuButton*>(gobj())));
}

void MenuButton::popup()
{
  gtk_menu_button_popup(gobj());
}

void MenuButton::popdown()
{
  gtk_menu_button_popdown(gobj());
}


static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Glib::RefPtr<Gio::MenuModel>>::value,
  "Type Glib::RefPtr<Gio::MenuModel> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Glib::RefPtr<Gio::MenuModel> > MenuButton::property_menu_model() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gio::MenuModel> >(this, "menu-model");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::MenuModel> > MenuButton::property_menu_model() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::MenuModel> >(this, "menu-model");
}

Glib::PropertyProxy< Widget* > MenuButton::property_align_widget() 
{
  return Glib::PropertyProxy< Widget* >(this, "align-widget");
}

Glib::PropertyProxy_ReadOnly< Widget* > MenuButton::property_align_widget() const
{
  return Glib::PropertyProxy_ReadOnly< Widget* >(this, "align-widget");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<ArrowType>::value,
  "Type ArrowType cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< ArrowType > MenuButton::property_direction() 
{
  return Glib::PropertyProxy< ArrowType >(this, "direction");
}

Glib::PropertyProxy_ReadOnly< ArrowType > MenuButton::property_direction() const
{
  return Glib::PropertyProxy_ReadOnly< ArrowType >(this, "direction");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Popover*>::value,
  "Type Popover* cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Popover* > MenuButton::property_popover() 
{
  return Glib::PropertyProxy< Popover* >(this, "popover");
}

Glib::PropertyProxy_ReadOnly< Popover* > MenuButton::property_popover() const
{
  return Glib::PropertyProxy_ReadOnly< Popover* >(this, "popover");
}

Glib::PropertyProxy< Glib::ustring > MenuButton::property_icon_name() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "icon-name");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > MenuButton::property_icon_name() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "icon-name");
}

Glib::PropertyProxy< Glib::ustring > MenuButton::property_label() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "label");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > MenuButton::property_label() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "label");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<ReliefStyle>::value,
  "Type ReliefStyle cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< ReliefStyle > MenuButton::property_relief() 
{
  return Glib::PropertyProxy< ReliefStyle >(this, "relief");
}

Glib::PropertyProxy_ReadOnly< ReliefStyle > MenuButton::property_relief() const
{
  return Glib::PropertyProxy_ReadOnly< ReliefStyle >(this, "relief");
}


} // namespace Gtk


