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


#include <glibmm.h>

#include <gdkmm/seat.h>
#include <gdkmm/private/seat_p.h>


/* Copyright (C) 2015 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 <gdkmm/devicetool.h>
#include <gdkmm/display.h>
#include <gdkmm/surface.h>

using Capabilities = Gdk::Seat::Capabilities;

namespace
{


static void Seat_signal_device_added_callback(GdkSeat* self, GdkDevice* p0,void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Device>&)>;

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

static const Glib::SignalProxyInfo Seat_signal_device_added_info =
{
  "device-added",
  (GCallback) &Seat_signal_device_added_callback,
  (GCallback) &Seat_signal_device_added_callback
};


static void Seat_signal_device_removed_callback(GdkSeat* self, GdkDevice* p0,void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Device>&)>;

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

static const Glib::SignalProxyInfo Seat_signal_device_removed_info =
{
  "device-removed",
  (GCallback) &Seat_signal_device_removed_callback,
  (GCallback) &Seat_signal_device_removed_callback
};


static void Seat_signal_tool_added_callback(GdkSeat* self, GdkDeviceTool* p0,void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<DeviceTool>&)>;

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

static const Glib::SignalProxyInfo Seat_signal_tool_added_info =
{
  "tool-added",
  (GCallback) &Seat_signal_tool_added_callback,
  (GCallback) &Seat_signal_tool_added_callback
};


static void Seat_signal_tool_removed_callback(GdkSeat* self, GdkDeviceTool* p0,void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<DeviceTool>&)>;

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

static const Glib::SignalProxyInfo Seat_signal_tool_removed_info =
{
  "tool-removed",
  (GCallback) &Seat_signal_tool_removed_callback,
  (GCallback) &Seat_signal_tool_removed_callback
};


} // anonymous namespace

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


namespace Glib
{

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

} /* namespace Glib */


namespace Gdk
{


/* The *_Class implementation: */

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

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

  }

  return *this;
}


void Seat_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* Seat_Class::wrap_new(GObject* object)
{
  return new Seat((GdkSeat*)object);
}


/* The implementation: */

GdkSeat* Seat::gobj_copy()
{
  reference();
  return gobj();
}

Seat::Seat(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Seat::Seat(GdkSeat* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Seat::Seat(Seat&& src) noexcept
: Glib::Object(std::move(src))
{}

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


Seat::~Seat() noexcept
{}


Seat::CppClassType Seat::seat_class_; // initialize static member

GType Seat::get_type()
{
  return seat_class_.init().get_type();
}


GType Seat::get_base_type()
{
  return gdk_seat_get_type();
}


Seat::Seat()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(seat_class_.init()))
{
  

}

Glib::RefPtr<Display> Seat::get_display()
{
  auto retvalue = Glib::wrap(gdk_seat_get_display(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Display> Seat::get_display() const
{
  return const_cast<Seat*>(this)->get_display();
}

Capabilities Seat::get_capabilities() const
{
  return static_cast<Capabilities>(gdk_seat_get_capabilities(const_cast<GdkSeat*>(gobj())));
}

std::vector<Glib::RefPtr<Device>> Seat::get_devices(Capabilities capabilities)
{
  return Glib::ListHandler<Glib::RefPtr<Device>>::list_to_vector(gdk_seat_get_devices(gobj(), static_cast<GdkSeatCapabilities>(capabilities)), Glib::OWNERSHIP_SHALLOW);
}

std::vector<Glib::RefPtr<const Device>> Seat::get_devices(Capabilities capabilities) const
{
  return Glib::ListHandler<Glib::RefPtr<const Device>>::list_to_vector(gdk_seat_get_devices(const_cast<GdkSeat*>(gobj()), static_cast<GdkSeatCapabilities>(capabilities)), Glib::OWNERSHIP_SHALLOW);
}

std::vector<Glib::RefPtr<DeviceTool>> Seat::get_tools()
{
  return Glib::ListHandler<Glib::RefPtr<DeviceTool>>::list_to_vector(gdk_seat_get_tools(gobj()), Glib::OWNERSHIP_SHALLOW);
}

std::vector<Glib::RefPtr<const DeviceTool>> Seat::get_tools() const
{
  return Glib::ListHandler<Glib::RefPtr<const DeviceTool>>::list_to_vector(gdk_seat_get_tools(const_cast<GdkSeat*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

Glib::RefPtr<Device> Seat::get_pointer()
{
  auto retvalue = Glib::wrap(gdk_seat_get_pointer(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Device> Seat::get_pointer() const
{
  return const_cast<Seat*>(this)->get_pointer();
}

Glib::RefPtr<Device> Seat::get_keyboard()
{
  auto retvalue = Glib::wrap(gdk_seat_get_keyboard(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Device> Seat::get_keyboard() const
{
  return const_cast<Seat*>(this)->get_keyboard();
}


Glib::SignalProxy<void(const Glib::RefPtr<Device>&)> Seat::signal_device_added()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Device>&) >(this, &Seat_signal_device_added_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Device>&)> Seat::signal_device_removed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Device>&) >(this, &Seat_signal_device_removed_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&)> Seat::signal_tool_added()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&) >(this, &Seat_signal_tool_added_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&)> Seat::signal_tool_removed()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&) >(this, &Seat_signal_tool_removed_info);
}


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

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> > Seat::property_display() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> >(this, "display");
}


} // namespace Gdk


