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


#include <glibmm.h>

#include <gdkmm/toplevel.h>
#include <gdkmm/private/toplevel_p.h>


/* Copyright (C) 2020 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 <http://www.gnu.org/licenses/>.
 */

#include <gdk/gdk.h>

using State = Gdk::Toplevel::State;
using Capabilities = Gdk::Toplevel::Capabilities;

namespace
{
extern "C"
{
// Hand-coded because the slot can't be called with a non-const temporary ToplevelSize.
static void Toplevel_signal_compute_size_callback(GdkToplevel* self, GdkToplevelSize* p0, void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(ToplevelSize&)>;

  auto obj = dynamic_cast<Toplevel*>(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))
      {
        // This works because Gdk::ToplevelSize neither copies nor deletes *p0.
        ToplevelSize toplevelsize(p0);
        (*static_cast<SlotType*>(slot))(toplevelsize);
      }
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"
} // anonymous namespace

namespace
{


static const Glib::SignalProxyInfo Toplevel_signal_compute_size_info =
{
  "compute-size",
  (GCallback) &Toplevel_signal_compute_size_callback,
  (GCallback) &Toplevel_signal_compute_size_callback
};


} // anonymous namespace

// static
GType Glib::Value<Gdk::SurfaceEdge>::value_type()
{
  return gdk_surface_edge_get_type();
}

// static
GType Glib::Value<Gdk::FullscreenMode>::value_type()
{
  return gdk_fullscreen_mode_get_type();
}

// static
GType Glib::Value<Gdk::TitlebarGesture>::value_type()
{
  return gdk_titlebar_gesture_get_type();
}

// static
GType Glib::Value<Gdk::Toplevel::State>::value_type()
{
  return gdk_toplevel_state_get_type();
}

// static
GType Glib::Value<Gdk::Toplevel::Capabilities>::value_type()
{
  return gdk_toplevel_capabilities_get_type();
}


namespace Glib
{

Glib::RefPtr<Gdk::Toplevel> wrap(GdkToplevel* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gdk::Toplevel>( dynamic_cast<Gdk::Toplevel*> (Glib::wrap_auto_interface<Gdk::Toplevel> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Gdk
{


/* The *_Class implementation: */

const Glib::Interface_Class& Toplevel_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &Toplevel_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = gdk_toplevel_get_type();
  }

  return *this;
}

void Toplevel_Class::iface_init_function(void* g_iface, void*)
{
  const auto klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != nullptr);


}


Glib::ObjectBase* Toplevel_Class::wrap_new(GObject* object)
{
  return new Toplevel((GdkToplevel*)(object));
}


/* The implementation: */

Toplevel::Toplevel()
:
  Glib::Interface(toplevel_class_.init())
{}

Toplevel::Toplevel(GdkToplevel* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

Toplevel::Toplevel(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

Toplevel::Toplevel(Toplevel&& src) noexcept
: Glib::Interface(std::move(src))
{}

Toplevel& Toplevel::operator=(Toplevel&& src) noexcept
{
  Glib::Interface::operator=(std::move(src));
  return *this;
}

Toplevel::~Toplevel() noexcept
{}

// static
void Toplevel::add_interface(GType gtype_implementer)
{
  toplevel_class_.init().add_interface(gtype_implementer);
}

Toplevel::CppClassType Toplevel::toplevel_class_; // initialize static member

GType Toplevel::get_type()
{
  return toplevel_class_.init().get_type();
}


GType Toplevel::get_base_type()
{
  return gdk_toplevel_get_type();
}


void Toplevel::present(const Glib::RefPtr<ToplevelLayout>& layout)
{
  gdk_toplevel_present(gobj(), Glib::unwrap(layout));
}

bool Toplevel::minimize()
{
  return gdk_toplevel_minimize(gobj());
}

bool Toplevel::lower()
{
  return gdk_toplevel_lower(gobj());
}

void Toplevel::focus(guint32 timestamp)
{
  gdk_toplevel_focus(gobj(), timestamp);
}

State Toplevel::get_state() const
{
  return static_cast<State>(gdk_toplevel_get_state(const_cast<GdkToplevel*>(gobj())));
}

void Toplevel::set_title(const Glib::ustring& title)
{
  gdk_toplevel_set_title(gobj(), title.c_str());
}

void Toplevel::set_startup_id(const Glib::ustring& startup_id)
{
  gdk_toplevel_set_startup_id(gobj(), startup_id.c_str());
}

void Toplevel::set_transient_for(const Glib::RefPtr<Surface>& parent)
{
  gdk_toplevel_set_transient_for(gobj(), Glib::unwrap(parent));
}

void Toplevel::set_modal(bool modal)
{
  gdk_toplevel_set_modal(gobj(), static_cast<int>(modal));
}

void Toplevel::set_icon_list(const std::vector<Glib::RefPtr<Texture>>& surfaces)
{
  gdk_toplevel_set_icon_list(gobj(), Glib::ListHandler<Glib::RefPtr<Texture>>::vector_to_list(surfaces).data());
}

bool Toplevel::show_window_menu(const Glib::RefPtr<Event>& event)
{
  return gdk_toplevel_show_window_menu(gobj(), Glib::unwrap(event));
}

void Toplevel::set_decorated(bool decorated)
{
  gdk_toplevel_set_decorated(gobj(), static_cast<int>(decorated));
}

void Toplevel::set_deletable(bool deletable)
{
  gdk_toplevel_set_deletable(gobj(), static_cast<int>(deletable));
}

bool Toplevel::supports_edge_constraints() const
{
  return gdk_toplevel_supports_edge_constraints(const_cast<GdkToplevel*>(gobj()));
}

void Toplevel::inhibit_system_shortcuts(const Glib::RefPtr<Event>& event)
{
  gdk_toplevel_inhibit_system_shortcuts(gobj(), Glib::unwrap(event));
}

void Toplevel::restore_system_shortcuts()
{
  gdk_toplevel_restore_system_shortcuts(gobj());
}

void Toplevel::begin_resize(SurfaceEdge edge, const Glib::RefPtr<Device>& device, int button, double x, double y, guint32 timestamp)
{
  gdk_toplevel_begin_resize(gobj(), static_cast<GdkSurfaceEdge>(edge), Glib::unwrap(device), button, x, y, timestamp);
}

void Toplevel::begin_move(const Glib::RefPtr<Device>& device, int button, double x, double y, guint32 timestamp)
{
  gdk_toplevel_begin_move(gobj(), Glib::unwrap(device), button, x, y, timestamp);
}

bool Toplevel::titlebar_gesture(TitlebarGesture gesture)
{
  return gdk_toplevel_titlebar_gesture(gobj(), static_cast<GdkTitlebarGesture>(gesture));
}

Capabilities Toplevel::get_capabilities() const
{
  return static_cast<Capabilities>(gdk_toplevel_get_capabilities(const_cast<GdkToplevel*>(gobj())));
}

Gravity Toplevel::get_gravity() const
{
  return static_cast<Gravity>(gdk_toplevel_get_gravity(const_cast<GdkToplevel*>(gobj())));
}

void Toplevel::set_gravity(Gravity gravity)
{
  gdk_toplevel_set_gravity(gobj(), static_cast<GdkGravity>(gravity));
}


Glib::SignalProxy<void(ToplevelSize&)> Toplevel::signal_compute_size()
{
  return Glib::SignalProxy<void(ToplevelSize&) >(this, &Toplevel_signal_compute_size_info);
}


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

Glib::PropertyProxy_ReadOnly< State > Toplevel::property_state() const
{
  return Glib::PropertyProxy_ReadOnly< State >(this, "state");
}

Glib::PropertyProxy< Glib::ustring > Toplevel::property_title() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "title");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > Toplevel::property_title() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "title");
}

Glib::PropertyProxy< Glib::ustring > Toplevel::property_startup_id() 
{
  return Glib::PropertyProxy< Glib::ustring >(this, "startup-id");
}

Glib::PropertyProxy_ReadOnly< Glib::ustring > Toplevel::property_startup_id() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "startup-id");
}

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

Glib::PropertyProxy< Glib::RefPtr<Surface> > Toplevel::property_transient_for() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Surface> >(this, "transient-for");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Surface> > Toplevel::property_transient_for() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Surface> >(this, "transient-for");
}

Glib::PropertyProxy< bool > Toplevel::property_modal() 
{
  return Glib::PropertyProxy< bool >(this, "modal");
}

Glib::PropertyProxy_ReadOnly< bool > Toplevel::property_modal() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "modal");
}

Glib::PropertyProxy< bool > Toplevel::property_decorated() 
{
  return Glib::PropertyProxy< bool >(this, "decorated");
}

Glib::PropertyProxy_ReadOnly< bool > Toplevel::property_decorated() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "decorated");
}

Glib::PropertyProxy< bool > Toplevel::property_deletable() 
{
  return Glib::PropertyProxy< bool >(this, "deletable");
}

Glib::PropertyProxy_ReadOnly< bool > Toplevel::property_deletable() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "deletable");
}

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

Glib::PropertyProxy< FullscreenMode > Toplevel::property_fullscreen_mode() 
{
  return Glib::PropertyProxy< FullscreenMode >(this, "fullscreen-mode");
}

Glib::PropertyProxy_ReadOnly< FullscreenMode > Toplevel::property_fullscreen_mode() const
{
  return Glib::PropertyProxy_ReadOnly< FullscreenMode >(this, "fullscreen-mode");
}

Glib::PropertyProxy_ReadOnly< bool > Toplevel::property_shortcuts_inhibited() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "shortcuts-inhibited");
}

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

Glib::PropertyProxy_ReadOnly< Capabilities > Toplevel::property_capabilities() const
{
  return Glib::PropertyProxy_ReadOnly< Capabilities >(this, "capabilities");
}

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

Glib::PropertyProxy< Gravity > Toplevel::property_gravity() 
{
  return Glib::PropertyProxy< Gravity >(this, "gravity");
}

Glib::PropertyProxy_ReadOnly< Gravity > Toplevel::property_gravity() const
{
  return Glib::PropertyProxy_ReadOnly< Gravity >(this, "gravity");
}


} // namespace Gdk


