| 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/gesture.h> |
| 18 |
|
| 19 |
_DEFS(gtkmm,gtk) |
| 20 |
_PINCLUDE(gtkmm/private/gesture_p.h) |
| 21 |
|
| 22 |
namespace Gtk |
| 23 |
{ |
| 24 |
/** Base class for mouse/single-touch gestures. |
| 25 |
* |
| 26 |
* This is a subclass of Gesture, optimized (although |
| 27 |
* not restricted) for dealing with mouse and single-touch gestures. Under |
| 28 |
* interaction, these gestures stick to the first interacting sequence, which |
| 29 |
* is accessible through get_current_sequence() while the |
| 30 |
* gesture is being interacted with. |
| 31 |
* |
| 32 |
* By default gestures react to both GDK_BUTTON_PRIMARY and touch |
| 33 |
* events. set_touch_only() can be used to change the |
| 34 |
* touch behavior. Callers may also specify a different mouse button number |
| 35 |
* to interact with through set_button(), or react to any |
| 36 |
* mouse button by setting it to 0. While the gesture is active, the button being |
| 37 |
* currently pressed can be known through get_current_button(). |
| 38 |
* |
| 39 |
* @newin{3,14} |
| 40 |
* |
| 41 |
* @ingroup Gestures |
| 42 |
*/ |
| 43 |
class GTKMM_API GestureSingle : public Gesture |
| 44 |
{ |
| 45 |
_CLASS_GOBJECT(GestureSingle, GtkGestureSingle, GTK_GESTURE_SINGLE, Gesture, GtkGesture, , , GTKMM_API) |
| 46 |
|
| 47 |
protected: |
| 48 |
/** There is no create() method that corresponds to this constructor, |
| 49 |
* because only derived classes shall be created. |
| 50 |
*/ |
| 51 |
_CTOR_DEFAULT |
| 52 |
|
| 53 |
public: |
| 54 |
// No create() because only derived classes shall be instantiated. |
| 55 |
|
| 56 |
_WRAP_METHOD(bool get_touch_only() const, gtk_gesture_single_get_touch_only) |
| 57 |
_WRAP_METHOD(void set_touch_only(bool touch_only = true), gtk_gesture_single_set_touch_only) |
| 58 |
_WRAP_METHOD(bool get_exclusive() const, gtk_gesture_single_get_exclusive) |
| 59 |
_WRAP_METHOD(void set_exclusive(bool exclusive = true) const, gtk_gesture_single_set_exclusive) |
| 60 |
_WRAP_METHOD(unsigned int get_button() const, gtk_gesture_single_get_button) |
| 61 |
_WRAP_METHOD(void set_button(unsigned int button = 0), gtk_gesture_single_set_button) |
| 62 |
_WRAP_METHOD(unsigned int get_current_button() const, gtk_gesture_single_get_current_button) |
| 63 |
_WRAP_METHOD(GdkEventSequence* get_current_sequence(), gtk_gesture_single_get_current_sequence) |
| 64 |
_WRAP_METHOD(const GdkEventSequence* get_current_sequence() const, gtk_gesture_single_get_current_sequence, constversion) |
| 65 |
|
| 66 |
_WRAP_PROPERTY("touch-only", bool) |
| 67 |
_WRAP_PROPERTY("exclusive", bool) |
| 68 |
_WRAP_PROPERTY("button", unsigned int) |
| 69 |
|
| 70 |
// GestureSingle has no signals |
| 71 |
}; |
| 72 |
|
| 73 |
} // namespace Gtk |