/* 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/gesture_p.h) namespace Gtk { /** Base class for mouse/single-touch gestures. * * This is a subclass of Gesture, optimized (although * not restricted) for dealing with mouse and single-touch gestures. Under * interaction, these gestures stick to the first interacting sequence, which * is accessible through get_current_sequence() while the * gesture is being interacted with. * * By default gestures react to both GDK_BUTTON_PRIMARY and touch * events. set_touch_only() can be used to change the * touch behavior. Callers may also specify a different mouse button number * to interact with through set_button(), or react to any * mouse button by setting it to 0. While the gesture is active, the button being * currently pressed can be known through get_current_button(). * * @newin{3,14} * * @ingroup Gestures */ class GTKMM_API GestureSingle : public Gesture { _CLASS_GOBJECT(GestureSingle, GtkGestureSingle, GTK_GESTURE_SINGLE, Gesture, GtkGesture, , , GTKMM_API) protected: /** There is no create() method that corresponds to this constructor, * because only derived classes shall be created. */ _CTOR_DEFAULT public: // No create() because only derived classes shall be instantiated. _WRAP_METHOD(bool get_touch_only() const, gtk_gesture_single_get_touch_only) _WRAP_METHOD(void set_touch_only(bool touch_only = true), gtk_gesture_single_set_touch_only) _WRAP_METHOD(bool get_exclusive() const, gtk_gesture_single_get_exclusive) _WRAP_METHOD(void set_exclusive(bool exclusive = true) const, gtk_gesture_single_set_exclusive) _WRAP_METHOD(unsigned int get_button() const, gtk_gesture_single_get_button) _WRAP_METHOD(void set_button(unsigned int button = 0), gtk_gesture_single_set_button) _WRAP_METHOD(unsigned int get_current_button() const, gtk_gesture_single_get_current_button) _WRAP_METHOD(GdkEventSequence* get_current_sequence(), gtk_gesture_single_get_current_sequence) _WRAP_METHOD(const GdkEventSequence* get_current_sequence() const, gtk_gesture_single_get_current_sequence, constversion) _WRAP_PROPERTY("touch-only", bool) _WRAP_PROPERTY("exclusive", bool) _WRAP_PROPERTY("button", unsigned int) // GestureSingle has no signals }; } // namespace Gtk