/* Copyright (C) 2014 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 .
*/
#include
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/gesturesingle_p.h)
namespace Gtk
{
/** Swipe gesture.
*
* This is a Gesture implementation able to recognize
* swipes. After a press/move/.../move/release sequence happens,
* signal_swipe() will be emitted, providing the velocity
* and directionality of the sequence at the time it was lifted.
*
* If the velocity is desired in intermediate points,
* get_velocity() can be called on eg. a
* Gesture::signal_update() handler.
*
* All velocities are reported in pixels/sec units.
*
* @newin{3,14}
*
* @ingroup Gestures
*/
class GTKMM_API GestureSwipe : public GestureSingle
{
_CLASS_GOBJECT(GestureSwipe, GtkGestureSwipe, GTK_GESTURE_SWIPE, GestureSingle, GtkGestureSingle, , , GTKMM_API)
protected:
/** There is no create() method that corresponds to this constructor,
* because this constructor shall only be used by derived classes.
*/
_CTOR_DEFAULT
/** Constructs a Gesture that recognizes swipes.
*/
_WRAP_CTOR(GestureSwipe(Widget& widget), gtk_gesture_swipe_new)
public:
/** Creates a Gesture that recognizes swipes.
*
* @newin{3,14}
*
* @param widget Widget the gesture relates to.
* @return A RefPtr to a new GestureSwipe.
*/
_WRAP_CREATE(Widget& widget)
_WRAP_METHOD(bool get_velocity(double& velocity_x, double& velocity_y) const, gtk_gesture_swipe_get_velocity)
// no_default_handler because GtkGestureSwipeClass is private.
_WRAP_SIGNAL(void swipe(double velocity_x, double velocity_y), "swipe", no_default_handler)
// GestureSwipe has no properties
};
} // namespace Gtk