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


#include <glibmm.h>

#include <gtkmm/notebook.h>
#include <gtkmm/private/notebook_p.h>

#include <gtk/gtk.h>

/* Copyright 1998-2002 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>
#include <gtkmm/label.h>
#include <gtkmm/selectionlistmodelimpl.h>
#include <algorithm>

namespace Gtk
{

int Notebook::prepend_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  return prepend_page(child, *pLabel);
}

int Notebook::prepend_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  auto pLabelMenu = Gtk::manage( new Label(menu_label, use_mnemonic) );
  return prepend_page(child, *pLabel, *pLabelMenu);
}

int Notebook::append_page(Widget& child, const Glib::ustring& tab_label, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  return append_page(child, *pLabel);
}

int Notebook::append_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  auto pLabelMenu = Gtk::manage( new Label(menu_label, use_mnemonic) );
  return append_page(child, *pLabel, *pLabelMenu);
}

int Notebook::insert_page(Widget& child, const Glib::ustring& tab_label, int position, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  return insert_page(child, *pLabel, position);
}

int Notebook::insert_page(Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, int position, bool use_mnemonic)
{
  auto pLabel = Gtk::manage( new Label(tab_label, use_mnemonic) );
  auto pLabelMenu = Gtk::manage( new Label(menu_label, use_mnemonic) );
  return insert_page(child, *pLabel, *pLabelMenu, position);
}

void Notebook::remove_page(Widget& child)
{
  int pos = page_num(child);
  if(pos != -1)
    remove_page(pos);
}

int Notebook::prepend_page(Widget& child)
{
  return gtk_notebook_prepend_page(gobj(), child.gobj(), nullptr /* see GTK+ docs */);
}

int Notebook::append_page(Widget& child)
{
  return gtk_notebook_append_page(gobj(), child.gobj(), nullptr /* see GTK+ docs */);
}

int Notebook::insert_page(Widget& child, int position)
{
  return gtk_notebook_insert_page(gobj(), child.gobj(), nullptr /* see GTK+ docs */, position);
}

Glib::RefPtr<Gio::ListModel> Notebook::get_pages()
{
  // gtk_notebook_get_pages() returns a pointer to a private GObject class
  // that implements GListModel and GtkSelectionModel.
  // Such an instance is wrapped in a Gtk::SelectionListModelImpl.
  // gtk_notebook_get_pages() gives us a ref (transfer full).
  GListModel* notebook_pages = gtk_notebook_get_pages(gobj());
  if (GTK_IS_SELECTION_MODEL(notebook_pages))
  {
    // Look up current C++ wrapper instance:
    Glib::ObjectBase* pCppObject = Glib::ObjectBase::_get_current_wrapper((GObject*)notebook_pages);
    if (!pCppObject)
      pCppObject = new SelectionListModelImpl((GObject*)notebook_pages);
    return Glib::make_refptr_for_instance<Gio::ListModel>(dynamic_cast<Gio::ListModel*>(pCppObject));
  }
  return Glib::wrap(notebook_pages);
}

} //namespace Gtk

namespace
{


extern "C" {
static void Notebook_signal_switch_page_connect_callback(GtkNotebook* self, GtkWidget* p0,guint p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(Widget*, guint)>;

  auto obj = dynamic_cast<Notebook*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
, p1);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo Notebook_signal_switch_page_info =
{
  "switch_page",
  (GCallback) &Notebook_signal_switch_page_connect_callback,
  (GCallback) &Notebook_signal_switch_page_connect_callback
};


extern "C" {
static void Notebook_signal_page_reordered_connect_callback(GtkNotebook* self, GtkWidget* p0,guint p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(Widget*, guint)>;

  auto obj = dynamic_cast<Notebook*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
, p1);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo Notebook_signal_page_reordered_info =
{
  "page_reordered",
  (GCallback) &Notebook_signal_page_reordered_connect_callback,
  (GCallback) &Notebook_signal_page_reordered_connect_callback
};


extern "C" {
static void Notebook_signal_page_removed_connect_callback(GtkNotebook* self, GtkWidget* p0,guint p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(Widget*, guint)>;

  auto obj = dynamic_cast<Notebook*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
, p1);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo Notebook_signal_page_removed_info =
{
  "page_removed",
  (GCallback) &Notebook_signal_page_removed_connect_callback,
  (GCallback) &Notebook_signal_page_removed_connect_callback
};


extern "C" {
static void Notebook_signal_page_added_connect_callback(GtkNotebook* self, GtkWidget* p0,guint p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(Widget*, guint)>;

  auto obj = dynamic_cast<Notebook*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(Glib::wrap(p0)
, p1);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo Notebook_signal_page_added_info =
{
  "page_added",
  (GCallback) &Notebook_signal_page_added_connect_callback,
  (GCallback) &Notebook_signal_page_added_connect_callback
};


} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& Notebook_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_ = &Notebook_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_notebook_get_type());

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

  }

  return *this;
}


void Notebook_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* Notebook_Class::wrap_new(GObject* o)
{
  return manage(new Notebook((GtkNotebook*)(o)));

}


/* The implementation: */

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

Notebook::Notebook(GtkNotebook* castitem)
:
  Gtk::Widget((GtkWidget*)(castitem))
{
  }


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

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

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

Notebook::CppClassType Notebook::notebook_class_; // initialize static member

GType Notebook::get_type()
{
  return notebook_class_.init().get_type();
}


GType Notebook::get_base_type()
{
  return gtk_notebook_get_type();
}


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

}

int Notebook::prepend_page(Widget& child, Widget& tab_label)
{
  return gtk_notebook_prepend_page(gobj(), (child).gobj(), (tab_label).gobj());
}

int Notebook::prepend_page(Widget& child, Widget& tab_label, Widget& menu_label)
{
  return gtk_notebook_prepend_page_menu(gobj(), (child).gobj(), (tab_label).gobj(), (menu_label).gobj());
}

int Notebook::append_page(Widget& child, Widget& tab_label)
{
  return gtk_notebook_append_page(gobj(), (child).gobj(), (tab_label).gobj());
}

int Notebook::append_page(Widget& child, Widget& tab_label, Widget& menu_label)
{
  return gtk_notebook_append_page_menu(gobj(), (child).gobj(), (tab_label).gobj(), (menu_label).gobj());
}

int Notebook::insert_page(Widget& child, Widget& tab_label, int position)
{
  return gtk_notebook_insert_page(gobj(), (child).gobj(), (tab_label).gobj(), position);
}

int Notebook::insert_page(Widget& child, Widget& tab_label, Widget& menu_label, int position)
{
  return gtk_notebook_insert_page_menu(gobj(), (child).gobj(), (tab_label).gobj(), (menu_label).gobj(), position);
}

void Notebook::remove_page(int page_number)
{
  gtk_notebook_remove_page(gobj(), page_number);
}

void Notebook::set_group_name(const Glib::ustring& group_name)
{
  gtk_notebook_set_group_name(gobj(), group_name.c_str());
}

Glib::ustring Notebook::get_group_name() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_notebook_get_group_name(const_cast<GtkNotebook*>(gobj())));
}

int Notebook::get_current_page() const
{
  return gtk_notebook_get_current_page(const_cast<GtkNotebook*>(gobj()));
}

Widget* Notebook::get_nth_page(int page_number)
{
  return Glib::wrap(gtk_notebook_get_nth_page(gobj(), page_number));
}

const Widget* Notebook::get_nth_page(int page_number) const
{
  return const_cast<Notebook*>(this)->get_nth_page(page_number);
}

int Notebook::get_n_pages() const
{
  return gtk_notebook_get_n_pages(const_cast<GtkNotebook*>(gobj()));
}

int Notebook::page_num(const Widget& child) const
{
  return gtk_notebook_page_num(const_cast<GtkNotebook*>(gobj()), const_cast<GtkWidget*>((child).gobj()));
}

void Notebook::set_current_page(int page_number)
{
  gtk_notebook_set_current_page(gobj(), page_number);
}

void Notebook::next_page()
{
  gtk_notebook_next_page(gobj());
}

void Notebook::prev_page()
{
  gtk_notebook_prev_page(gobj());
}

void Notebook::set_show_border(bool show_border)
{
  gtk_notebook_set_show_border(gobj(), static_cast<int>(show_border));
}

bool Notebook::get_show_border() const
{
  return gtk_notebook_get_show_border(const_cast<GtkNotebook*>(gobj()));
}

void Notebook::set_show_tabs(bool show_tabs)
{
  gtk_notebook_set_show_tabs(gobj(), static_cast<int>(show_tabs));
}

bool Notebook::get_show_tabs() const
{
  return gtk_notebook_get_show_tabs(const_cast<GtkNotebook*>(gobj()));
}

void Notebook::set_tab_pos(PositionType pos)
{
  gtk_notebook_set_tab_pos(gobj(), static_cast<GtkPositionType>(pos));
}

PositionType Notebook::get_tab_pos() const
{
  return static_cast<PositionType>(gtk_notebook_get_tab_pos(const_cast<GtkNotebook*>(gobj())));
}

void Notebook::set_scrollable(bool scrollable)
{
  gtk_notebook_set_scrollable(gobj(), static_cast<int>(scrollable));
}

bool Notebook::get_scrollable() const
{
  return gtk_notebook_get_scrollable(const_cast<GtkNotebook*>(gobj()));
}

void Notebook::popup_enable()
{
  gtk_notebook_popup_enable(gobj());
}

void Notebook::popup_disable()
{
  gtk_notebook_popup_disable(gobj());
}

Widget* Notebook::get_tab_label(Widget& child)
{
  return Glib::wrap(gtk_notebook_get_tab_label(gobj(), (child).gobj()));
}

const Widget* Notebook::get_tab_label(Widget& child) const
{
  return const_cast<Notebook*>(this)->get_tab_label(child);
}

void Notebook::set_tab_label(Widget& child, Widget& tab_label)
{
  gtk_notebook_set_tab_label(gobj(), (child).gobj(), (tab_label).gobj());
}

void Notebook::set_tab_label_text(Widget& child, const Glib::ustring& tab_text)
{
  gtk_notebook_set_tab_label_text(gobj(), (child).gobj(), tab_text.c_str());
}

Glib::ustring Notebook::get_tab_label_text(Widget& child) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_notebook_get_tab_label_text(const_cast<GtkNotebook*>(gobj()), (child).gobj()));
}

Widget* Notebook::get_menu_label(Widget& child)
{
  return Glib::wrap(gtk_notebook_get_menu_label(gobj(), (child).gobj()));
}

const Widget* Notebook::get_menu_label(Widget& child) const
{
  return const_cast<Notebook*>(this)->get_menu_label(child);
}

void Notebook::set_menu_label(Widget& child, Widget& menu_label)
{
  gtk_notebook_set_menu_label(gobj(), (child).gobj(), (menu_label).gobj());
}

void Notebook::set_menu_label_text(Widget& child, const Glib::ustring& menu_text)
{
  gtk_notebook_set_menu_label_text(gobj(), (child).gobj(), menu_text.c_str());
}

Glib::ustring Notebook::get_menu_label_text(Widget& child) const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_notebook_get_menu_label_text(const_cast<GtkNotebook*>(gobj()), (child).gobj()));
}

void Notebook::reorder_child(Widget& child, int position)
{
  gtk_notebook_reorder_child(gobj(), (child).gobj(), position);
}

bool Notebook::get_tab_reorderable(Widget& child) const
{
  return gtk_notebook_get_tab_reorderable(const_cast<GtkNotebook*>(gobj()), (child).gobj());
}

void Notebook::set_tab_reorderable(Widget& child, bool reorderable)
{
  gtk_notebook_set_tab_reorderable(gobj(), (child).gobj(), static_cast<int>(reorderable));
}

bool Notebook::get_tab_detachable(Widget& child) const
{
  return gtk_notebook_get_tab_detachable(const_cast<GtkNotebook*>(gobj()), (child).gobj());
}

void Notebook::set_tab_detachable(Widget& child, bool detachable)
{
  gtk_notebook_set_tab_detachable(gobj(), (child).gobj(), static_cast<int>(detachable));
}

void Notebook::detach_tab(Widget& child)
{
  gtk_notebook_detach_tab(gobj(), (child).gobj());
}

Widget* Notebook::get_action_widget(PackType pack_type)
{
  return Glib::wrap(gtk_notebook_get_action_widget(gobj(), static_cast<GtkPackType>(pack_type)));
}

void Notebook::set_action_widget(Widget* widget, PackType pack_type)
{
  gtk_notebook_set_action_widget(gobj(), (GtkWidget*)Glib::unwrap(widget), static_cast<GtkPackType>(pack_type));
}

Glib::RefPtr<NotebookPage> Notebook::get_page(Widget& child)
{
  auto retvalue = Glib::wrap(gtk_notebook_get_page(gobj(), (child).gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const NotebookPage> Notebook::get_page(const Widget& child) const
{
  auto retvalue = Glib::wrap(gtk_notebook_get_page(const_cast<GtkNotebook*>(gobj()), const_cast<GtkWidget*>((child).gobj())));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gio::ListModel> Notebook::get_pages() const
{
  return const_cast<Notebook*>(this)->get_pages();
}


Glib::SignalProxy<void(Widget*, guint)> Notebook::signal_switch_page()
{
  return Glib::SignalProxy<void(Widget*, guint) >(this, &Notebook_signal_switch_page_info);
}


Glib::SignalProxy<void(Widget*, guint)> Notebook::signal_page_reordered()
{
  return Glib::SignalProxy<void(Widget*, guint) >(this, &Notebook_signal_page_reordered_info);
}


Glib::SignalProxy<void(Widget*, guint)> Notebook::signal_page_removed()
{
  return Glib::SignalProxy<void(Widget*, guint) >(this, &Notebook_signal_page_removed_info);
}


Glib::SignalProxy<void(Widget*, guint)> Notebook::signal_page_added()
{
  return Glib::SignalProxy<void(Widget*, guint) >(this, &Notebook_signal_page_added_info);
}


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

Glib::PropertyProxy< PositionType > Notebook::property_tab_pos() 
{
  return Glib::PropertyProxy< PositionType >(this, "tab-pos");
}

Glib::PropertyProxy_ReadOnly< PositionType > Notebook::property_tab_pos() const
{
  return Glib::PropertyProxy_ReadOnly< PositionType >(this, "tab-pos");
}

Glib::PropertyProxy< bool > Notebook::property_show_tabs() 
{
  return Glib::PropertyProxy< bool >(this, "show-tabs");
}

Glib::PropertyProxy_ReadOnly< bool > Notebook::property_show_tabs() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "show-tabs");
}

Glib::PropertyProxy< bool > Notebook::property_show_border() 
{
  return Glib::PropertyProxy< bool >(this, "show-border");
}

Glib::PropertyProxy_ReadOnly< bool > Notebook::property_show_border() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "show-border");
}

Glib::PropertyProxy< bool > Notebook::property_scrollable() 
{
  return Glib::PropertyProxy< bool >(this, "scrollable");
}

Glib::PropertyProxy_ReadOnly< bool > Notebook::property_scrollable() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "scrollable");
}

Glib::PropertyProxy< int > Notebook::property_page() 
{
  return Glib::PropertyProxy< int >(this, "page");
}

Glib::PropertyProxy_ReadOnly< int > Notebook::property_page() const
{
  return Glib::PropertyProxy_ReadOnly< int >(this, "page");
}

Glib::PropertyProxy< Glib::ustring > Notebook::property_group_name() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "group-name");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > Notebook::property_group_name() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "group-name");
}

Glib::PropertyProxy< bool > Notebook::property_enable_popup() 
{
  return Glib::PropertyProxy< bool >(this, "enable-popup");
}

Glib::PropertyProxy_ReadOnly< bool > Notebook::property_enable_popup() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "enable-popup");
}

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

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::ListModel> > Notebook::property_pages() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::ListModel> >(this, "pages");
}


} // namespace Gtk


