| 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 |
/** "Press and Hold" gesture. |
| 25 |
* |
| 26 |
* This is a Gesture implementation able to recognize |
| 27 |
* long presses, triggering signal_pressed() after the |
| 28 |
* timeout is exceeded. |
| 29 |
* |
| 30 |
* If the touchpoint is lifted before the timeout passes, or if it drifts |
| 31 |
* too far of the initial press point, signal_cancelled() will be emitted. |
| 32 |
* |
| 33 |
* @newin{3,14} |
| 34 |
* |
| 35 |
* @ingroup Gestures |
| 36 |
*/ |
| 37 |
class GTKMM_API GestureLongPress : public GestureSingle |
| 38 |
{ |
| 39 |
_CLASS_GOBJECT(GestureLongPress, GtkGestureLongPress, GTK_GESTURE_LONG_PRESS, GestureSingle, GtkGestureSingle, , , GTKMM_API) |
| 40 |
|
| 41 |
protected: |
| 42 |
/** There is no create() method that corresponds to this constructor, |
| 43 |
* because this constructor shall only be used by derived classes. |
| 44 |
*/ |
| 45 |
_CTOR_DEFAULT |
| 46 |
|
| 47 |
/** Constructs a Gesture that recognizes long presses. |
| 48 |
*/ |
| 49 |
_WRAP_CTOR(GestureLongPress(Widget& widget), gtk_gesture_long_press_new) |
| 50 |
|
| 51 |
public: |
| 52 |
/** Creates a Gesture that recognizes long presses. |
| 53 |
* |
| 54 |
* @newin{3,14} |
| 55 |
* |
| 56 |
* @param widget Widget the gesture relates to. |
| 57 |
* @return A RefPtr to a new GestureLongPress. |
| 58 |
*/ |
| 59 |
_WRAP_CREATE(Widget& widget) |
| 60 |
|
| 61 |
// no_default_handler because GtkGestureLongPressClass is private. |
| 62 |
_WRAP_SIGNAL(void pressed(double x, double y), "pressed", no_default_handler) |
| 63 |
_WRAP_SIGNAL(void cancelled(), "cancelled", no_default_handler) |
| 64 |
|
| 65 |
_WRAP_PROPERTY("delay-factor", double, newin "3,20") |
| 66 |
|
| 67 |
// GestureLongPress has no methods |
| 68 |
}; |
| 69 |
|
| 70 |
} // namespace Gtk |