/* 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 <vector>
#include <glibmm/object.h>
#include <gdkmm/cursor.h>
#include <gdkmm/device.h>
#include <gdkmm/event.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{

class GDKMM_API DeviceTool;
class GDKMM_API Display;
class GDKMM_API Surface;

/** A Gdk::Seat object represents a collection of input devices that belong to a user.
 *
 * @newin{3,20}
 */
class GDKMM_API Seat : public Glib::Object
{
  _CLASS_GOBJECT(Seat, GdkSeat, GDK_SEAT, Glib::Object, GObject, , , GDKMM_API)

protected:
  _CTOR_DEFAULT()

public:
  _WRAP_ENUM(Capabilities, GdkSeatCapabilities, decl_prefix GDKMM_API)

  _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_seat_get_display, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_seat_get_display, refreturn, constversion)
  _WRAP_METHOD(Capabilities get_capabilities() const, gdk_seat_get_capabilities)

#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Device>>',`Glib::ListHandler<Glib::RefPtr<Device>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector<Glib::RefPtr<Device>> get_devices(Capabilities capabilities), gdk_seat_get_devices)
#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<const Device>>',`Glib::ListHandler<Glib::RefPtr<const Device>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector<Glib::RefPtr<const Device>> get_devices(Capabilities capabilities) const, gdk_seat_get_devices)

#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<DeviceTool>>',`Glib::ListHandler<Glib::RefPtr<DeviceTool>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector<Glib::RefPtr<DeviceTool>> get_tools(), gdk_seat_get_tools)
#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<const DeviceTool>>',`Glib::ListHandler<Glib::RefPtr<const DeviceTool>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector<Glib::RefPtr<const DeviceTool>> get_tools() const, gdk_seat_get_tools)

  _WRAP_METHOD(Glib::RefPtr<Device> get_pointer(), gdk_seat_get_pointer, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Device> get_pointer() const, gdk_seat_get_pointer, refreturn, constversion)
  _WRAP_METHOD(Glib::RefPtr<Device> get_keyboard(), gdk_seat_get_keyboard, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Device> get_keyboard() const, gdk_seat_get_keyboard, refreturn, constversion)

  // We use no_default_handler because GdkSeatClass is private.
#m4 _CONVERSION(`GdkDevice*',`const Glib::RefPtr<Device>&', Glib::wrap($3, true))
  _WRAP_SIGNAL(void device_added(const Glib::RefPtr<Device>& device), "device-added", no_default_handler)
  _WRAP_SIGNAL(void device_removed(const Glib::RefPtr<Device>& device), "device-removed", no_default_handler)

#m4 _CONVERSION(`GdkDeviceTool*',`const Glib::RefPtr<DeviceTool>&', Glib::wrap($3, true))
  _WRAP_SIGNAL(void tool_added(const Glib::RefPtr<DeviceTool>& device), "tool-added", no_default_handler, newin "3,94")
  _WRAP_SIGNAL(void tool_removed(const Glib::RefPtr<DeviceTool>& device), "tool-removed", no_default_handler, newin "3,94")

  _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
};

} // namespace Gdk
