/* 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/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 GTKMM_API GestureDrag : public GestureSingle
{
_CLASS_GOBJECT(GestureDrag, GtkGestureDrag, GTK_GESTURE_DRAG, GestureSingle, GtkGestureSingle, , , GTKMM_API)
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