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