/* Copyright (C) 2018 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 <gtkmm/eventcontroller.h>
#include <gdkmm/enums.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/eventcontroller_p.h)

namespace Gtk
{
class Widget;

/** Event controller for motion events.
 *
 * %Gtk::EventControllerMotion is an event controller meant for situations
 * where you need to track the position of the pointer.
 * 
 * @newin{3,94}
 *
 * @ingroup Gestures
 */
class EventControllerMotion : public EventController
{
  _CLASS_GOBJECT(EventControllerMotion, GtkEventControllerMotion, GTK_EVENT_CONTROLLER_MOTION, EventController, GtkEventController)

protected:
  _CTOR_DEFAULT

public:
  _WRAP_CREATE()

  _WRAP_METHOD(Widget* get_pointer_origin(), gtk_event_controller_motion_get_pointer_origin)
  _WRAP_METHOD(const Widget* get_pointer_origin() const, gtk_event_controller_motion_get_pointer_origin, constversion)
  _WRAP_METHOD(Widget* get_pointer_target(), gtk_event_controller_motion_get_pointer_target)
  _WRAP_METHOD(const Widget* get_pointer_target() const, gtk_event_controller_motion_get_pointer_target, constversion)

  // no_default_handler because GtkEventControllerMotionClass is private.
  _WRAP_SIGNAL(void enter(double x, double y, Gdk::CrossingMode mode, Gdk::NotifyType detail),
    "enter", no_default_handler)
  _WRAP_SIGNAL(void leave(Gdk::CrossingMode mode, Gdk::NotifyType detail),
    "leave", no_default_handler)
  _WRAP_SIGNAL(void motion(double x, double y), "motion", no_default_handler)

  _WRAP_PROPERTY("is-pointer-focus", bool)
  _WRAP_PROPERTY("contains-pointer-focus", bool)
};

} // namespace Gtk
