| 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 |
/** Drag gesture. |
| 25 |
* |
| 26 |
* This is a Gesture implementation that recognizes drag |
| 27 |
* operations. The drag operation itself can be tracked through |
| 28 |
* signal_drag_begin(), signal_drag_update() and |
| 29 |
* signal_drag_end(), or the relevant coordinates be |
| 30 |
* extracted through get_offset() and get_start_point(). |
| 31 |
* |
| 32 |
* @newin{3,14} |
| 33 |
* |
| 34 |
* @ingroup Gestures |
| 35 |
*/ |
| 36 |
class GTKMM_API GestureDrag : public GestureSingle |
| 37 |
{ |
| 38 |
_CLASS_GOBJECT(GestureDrag, GtkGestureDrag, GTK_GESTURE_DRAG, GestureSingle, GtkGestureSingle, , , GTKMM_API) |
| 39 |
|
| 40 |
protected: |
| 41 |
/** There is no create() method that corresponds to this constructor, |
| 42 |
* because this constructor shall only be used by derived classes. |
| 43 |
*/ |
| 44 |
_CTOR_DEFAULT |
| 45 |
|
| 46 |
/** Constructs a Gesture that recognizes drags. |
| 47 |
*/ |
| 48 |
_WRAP_CTOR(GestureDrag(Widget& widget), gtk_gesture_drag_new) |
| 49 |
|
| 50 |
public: |
| 51 |
/** Creates a Gesture that recognizes drags. |
| 52 |
* |
| 53 |
* @newin{3,14} |
| 54 |
* |
| 55 |
* @param widget Widget the gesture relates to. |
| 56 |
* @return A RefPtr to a new GestureDrag. |
| 57 |
*/ |
| 58 |
_WRAP_CREATE(Widget& widget) |
| 59 |
|
| 60 |
_WRAP_METHOD(bool get_start_point(double& x, double& y) const, gtk_gesture_drag_get_start_point) |
| 61 |
_WRAP_METHOD(bool get_offset(double& x, double& y) const, gtk_gesture_drag_get_offset) |
| 62 |
|
| 63 |
// no_default_handler because GtkGestureDragClass is private. |
| 64 |
_WRAP_SIGNAL(void drag_begin(double start_x, double start_y), "drag-begin", no_default_handler) |
| 65 |
_WRAP_SIGNAL(void drag_update(double offset_x, double offset_y), "drag-update", no_default_handler) |
| 66 |
_WRAP_SIGNAL(void drag_end(double offset_x, double offset_y), "drag-end", no_default_handler) |
| 67 |
|
| 68 |
// GestureDrag has no properties |
| 69 |
}; |
| 70 |
|
| 71 |
} // namespace Gtk |