| 1 |
/* Copyright (C) 2014 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtkmm/gesturesingle.h> |
| 18 |
|
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/gesturesingle_p.h) |
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
/** Swipe gesture. |
| 25 |
* |
| 26 |
* This is a Gesture implementation able to recognize |
| 27 |
* swipes. After a press/move/.../move/release sequence happens, |
| 28 |
* signal_swipe() will be emitted, providing the velocity |
| 29 |
* and directionality of the sequence at the time it was lifted. |
| 30 |
* |
| 31 |
* If the velocity is desired in intermediate points, |
| 32 |
* get_velocity() can be called on eg. a |
| 33 |
* Gesture::signal_update() handler. |
| 34 |
* |
| 35 |
* All velocities are reported in pixels/sec units. |
| 36 |
* |
| 37 |
* @newin{3,14} |
| 38 |
* |
| 39 |
* @ingroup Gestures |
| 40 |
*/ |
| 41 |
class GTKMM_API GestureSwipe : public GestureSingle |
| 42 |
{ |
| 43 |
_CLASS_GOBJECT(GestureSwipe, GtkGestureSwipe, GTK_GESTURE_SWIPE, GestureSingle, GtkGestureSingle, , , GTKMM_API) |
| 44 |
|
| 45 |
protected: |
| 46 |
/** There is no create() method that corresponds to this constructor, |
| 47 |
* because this constructor shall only be used by derived classes. |
| 48 |
*/ |
| 49 |
_CTOR_DEFAULT |
| 50 |
|
| 51 |
/** Constructs a Gesture that recognizes swipes. |
| 52 |
*/ |
| 53 |
_WRAP_CTOR(GestureSwipe(Widget& widget), gtk_gesture_swipe_new) |
| 54 |
|
| 55 |
public: |
| 56 |
/** Creates a Gesture that recognizes swipes. |
| 57 |
* |
| 58 |
* @newin{3,14} |
| 59 |
* |
| 60 |
* @param widget Widget the gesture relates to. |
| 61 |
* @return A RefPtr to a new GestureSwipe. |
| 62 |
*/ |
| 63 |
_WRAP_CREATE(Widget& widget) |
| 64 |
|
| 65 |
_WRAP_METHOD(bool get_velocity(double& velocity_x, double& velocity_y) const, gtk_gesture_swipe_get_velocity) |
| 66 |
|
| 67 |
// no_default_handler because GtkGestureSwipeClass is private. |
| 68 |
_WRAP_SIGNAL(void swipe(double velocity_x, double velocity_y), "swipe", no_default_handler) |
| 69 |
|
| 70 |
// GestureSwipe has no properties |
| 71 |
}; |
| 72 |
|
| 73 |
} // namespace Gtk |