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


#include <glibmm.h>

#include <gtkmm/applicationwindow.h>
#include <gtkmm/private/applicationwindow_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, see <https://www.gnu.org/licenses/>.
 */

#include <gtkmm/applicationwindow.h>
#ifndef GTKMM_DISABLE_DEPRECATED
#include <gtkmm/shortcutswindow.h>
#endif

namespace Gtk
{
ApplicationWindow::ApplicationWindow(const Glib::RefPtr<Application>& application)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Window(Glib::ConstructParams(applicationwindow_class_.init()))
{
  // Don't set the "application" property in ConstructParams. It would result in
  // an attempt to set two C++ wrappers on the GApplicationWindow C object,
  // if "application" is not a plain Gtk::Application, but derived from it.
  // Like so:
  // - Glib::Object::Object(const Glib::ConstructParams& construct_params) calls
  //   g_object_newv() to create a new GApplicationWindow.
  // - In gtk+, gtk_application_add_window() is called. It emits the window_added
  //   signal with the new GApplicationWindow as a parameter.
  // - Application_signal_window_added_callback() calls Glib::wrap(GWindow*)
  //   before *this has been set as the wrapper. Glib::wrap() then creates a
  //   wrapper (not *this).
  // - Glib::Object::Object() calls Glib::ObjectBase::initialize(), which calls
  //   Glib::ObjectBase::_set_current_wrapper() to set *this as the C++ wrapper,
  //   but by then another wrapper has already been set.
  // https://bugzilla.gnome.org/show_bug.cgi?id=758813

  if (application)
    application->add_window(*this);
}

#ifndef GTKMM_DISABLE_DEPRECATED

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void ApplicationWindow::unset_help_overlay()
{
  gtk_application_window_set_help_overlay(gobj(), nullptr);
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED


} // namespace Gtk

namespace
{


extern "C" {
static gboolean ApplicationWindow_signal_save_state_connect_callback(GtkApplicationWindow* self, GVariantDict* dict,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<bool(const Glib::RefPtr<Glib::VariantDict>&)>;

  auto obj = dynamic_cast<ApplicationWindow*>(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))
        return static_cast<int>((*static_cast<SlotType*>(slot))(Glib::wrap(dict, true)
));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static gboolean ApplicationWindow_signal_save_state_notify_callback(GtkApplicationWindow* self, GVariantDict* dict, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Glib::VariantDict>&)>;

  auto obj = dynamic_cast<ApplicationWindow*>(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(dict, true)
);
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}
} // extern "C"

static const Glib::SignalProxyInfo ApplicationWindow_signal_save_state_info =
{
  "save-state",
  (GCallback) &ApplicationWindow_signal_save_state_connect_callback,
  (GCallback) &ApplicationWindow_signal_save_state_notify_callback
};


} // anonymous namespace


namespace Glib
{

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

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

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

    // Add derived versions of interfaces, if the C type implements any interfaces:
  Gio::ActionGroup::add_interface(get_type());
  Gio::ActionMap::add_interface(get_type());

  }

  return *this;
}


void ApplicationWindow_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* ApplicationWindow_Class::wrap_new(GObject* o)
{
  return new ApplicationWindow((GtkApplicationWindow*)(o)); //top-level windows can not be manage()ed.

}


/* The implementation: */

ApplicationWindow::ApplicationWindow(const Glib::ConstructParams& construct_params)
:
  Gtk::Window(construct_params)
{
  }

ApplicationWindow::ApplicationWindow(GtkApplicationWindow* castitem)
:
  Gtk::Window((GtkWindow*)(castitem))
{
  }


ApplicationWindow::ApplicationWindow(ApplicationWindow&& src) noexcept
: Gtk::Window(std::move(src))
  , Gio::ActionGroup(std::move(src))
  , Gio::ActionMap(std::move(src))
{}

ApplicationWindow& ApplicationWindow::operator=(ApplicationWindow&& src) noexcept
{
  Gtk::Window::operator=(std::move(src));
  Gio::ActionGroup::operator=(std::move(src));
  Gio::ActionMap::operator=(std::move(src));
  return *this;
}

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

ApplicationWindow::CppClassType ApplicationWindow::applicationwindow_class_; // initialize static member

GType ApplicationWindow::get_type()
{
  return applicationwindow_class_.init().get_type();
}


GType ApplicationWindow::get_base_type()
{
  return gtk_application_window_get_type();
}


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

}

void ApplicationWindow::set_show_menubar(bool show_menubar)
{
  gtk_application_window_set_show_menubar(gobj(), static_cast<int>(show_menubar));
}

bool ApplicationWindow::get_show_menubar() const
{
  return gtk_application_window_get_show_menubar(const_cast<GtkApplicationWindow*>(gobj()));
}

guint ApplicationWindow::get_id() const
{
  return gtk_application_window_get_id(const_cast<GtkApplicationWindow*>(gobj()));
}

#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
void ApplicationWindow::set_help_overlay(ShortcutsWindow& help_overlay)
{
  gtk_application_window_set_help_overlay(gobj(), (help_overlay).gobj());
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED

#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
ShortcutsWindow* ApplicationWindow::get_help_overlay()
{
  return Glib::wrap(gtk_application_window_get_help_overlay(gobj()));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED

#ifndef GTKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
const ShortcutsWindow* ApplicationWindow::get_help_overlay() const
{
  return const_cast<ApplicationWindow*>(this)->get_help_overlay();
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GTKMM_DISABLE_DEPRECATED


Glib::SignalProxy<bool(const Glib::RefPtr<Glib::VariantDict>&)> ApplicationWindow::signal_save_state()
{
  return Glib::SignalProxy<bool(const Glib::RefPtr<Glib::VariantDict>&) >(this, &ApplicationWindow_signal_save_state_info);
}


Glib::PropertyProxy< bool > ApplicationWindow::property_show_menubar() 
{
  return Glib::PropertyProxy< bool >(this, "show-menubar");
}

Glib::PropertyProxy_ReadOnly< bool > ApplicationWindow::property_show_menubar() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "show-menubar");
}


} // namespace Gtk


