// Generated by gmmproc 2.77.0 -- 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
{
extern "C"
{
static 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;
}

static void SignalProxy_MenuButton_create_popup_callback_destroy(void* data)
{
  delete static_cast<Gtk::MenuButton::SlotCreatePopup*>(data);
}
} // extern "C"
} // 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 SignalProxy_MenuButton_create_popup_callback_destroy() is called.
  auto slot_copy = new SlotCreatePopup(slot);

  gtk_menu_button_set_create_popup_func(gobj(),
    &SignalProxy_MenuButton_create_popup_callback, slot_copy,
    &SignalProxy_MenuButton_create_popup_callback_destroy);
}

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

void MenuButton::unset_child()
{
  gtk_menu_button_set_child(gobj(), 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_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_always_show_arrow(bool always_show_arrow)
{
  gtk_menu_button_set_always_show_arrow(gobj(), static_cast<int>(always_show_arrow));
}

bool MenuButton::get_always_show_arrow() const
{
  return gtk_menu_button_get_always_show_arrow(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_use_underline(bool use_underline)
{
  gtk_menu_button_set_use_underline(gobj(), static_cast<int>(use_underline));
}

bool MenuButton::get_use_underline() const
{
  return gtk_menu_button_get_use_underline(const_cast<GtkMenuButton*>(gobj()));
}

void MenuButton::set_has_frame(bool has_frame)
{
  gtk_menu_button_set_has_frame(gobj(), static_cast<int>(has_frame));
}

bool MenuButton::get_has_frame() const
{
  return gtk_menu_button_get_has_frame(const_cast<GtkMenuButton*>(gobj()));
}

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

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

void MenuButton::set_primary(bool primary)
{
  gtk_menu_button_set_primary(gobj(), static_cast<int>(primary));
}

bool MenuButton::get_primary() const
{
  return gtk_menu_button_get_primary(const_cast<GtkMenuButton*>(gobj()));
}

void MenuButton::set_child(Widget& child)
{
  gtk_menu_button_set_child(gobj(), (child).gobj());
}

Widget* MenuButton::get_child()
{
  return Glib::wrap(gtk_menu_button_get_child(gobj()));
}

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

void MenuButton::set_active(bool active)
{
  gtk_menu_button_set_active(gobj(), static_cast<int>(active));
}

bool MenuButton::get_active() const
{
  return gtk_menu_button_get_active(const_cast<GtkMenuButton*>(gobj()));
}

void MenuButton::set_can_chrink(bool can_shrink)
{
  gtk_menu_button_set_can_shrink(gobj(), static_cast<int>(can_shrink));
}

bool MenuButton::get_can_shrink() const
{
  return gtk_menu_button_get_can_shrink(const_cast<GtkMenuButton*>(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");
}

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< bool > MenuButton::property_always_show_arrow() 
{
  return Glib::PropertyProxy< bool >(this, "always-show-arrow");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_always_show_arrow() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "always-show-arrow");
}

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");
}

Glib::PropertyProxy< bool > MenuButton::property_use_underline() 
{
  return Glib::PropertyProxy< bool >(this, "use-underline");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_use_underline() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "use-underline");
}

Glib::PropertyProxy< bool > MenuButton::property_has_frame() 
{
  return Glib::PropertyProxy< bool >(this, "has-frame");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_has_frame() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "has-frame");
}

Glib::PropertyProxy< bool > MenuButton::property_primary() 
{
  return Glib::PropertyProxy< bool >(this, "primary");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_primary() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "primary");
}

Glib::PropertyProxy< Widget* > MenuButton::property_child() 
{
  return Glib::PropertyProxy< Widget* >(this, "child");
}

Glib::PropertyProxy_ReadOnly< Widget* > MenuButton::property_child() const
{
  return Glib::PropertyProxy_ReadOnly< Widget* >(this, "child");
}

Glib::PropertyProxy< bool > MenuButton::property_active() 
{
  return Glib::PropertyProxy< bool >(this, "active");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_active() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "active");
}

Glib::PropertyProxy< bool > MenuButton::property_can_shrink() 
{
  return Glib::PropertyProxy< bool >(this, "can-shrink");
}

Glib::PropertyProxy_ReadOnly< bool > MenuButton::property_can_shrink() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "can-shrink");
}


} // namespace Gtk


