[gtkmm] Add Gtk::EventController and Gtk::Gesture* classes.



commit 80f04135ef3f3585fe9f7e0743333b75f6f282f1
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sun Jun 29 18:55:11 2014 +0200

    Add Gtk::EventController and Gtk::Gesture* classes.
    
    * gtk/src/eventcontroller.[hg|ccg]:
    * gtk/src/gesture.[hg|ccg]:
    * gtk/src/gesturedrag.[hg|ccg]:
    * gtk/src/gesturelongpress.[hg|ccg]:
    * gtk/src/gesturemultipress.[hg|ccg]:
    * gtk/src/gesturepan.[hg|ccg]:
    * gtk/src/gesturerotate.[hg|ccg]:
    * gtk/src/gesturesingle.[hg|ccg]:
    * gtk/src/gestureswipe.[hg|ccg]:
    * gtk/src/gesturezoom.[hg|ccg]: New files.
    * gtk/src/filelist.am:
    * gtk/gtkmm.h: Add new files.
    * tools/m4/convert_gtk.m4: Add conversions for new enums.
    * .gitignore: Add new files in gtk/gtkmm.

 .gitignore                    |   20 +++++
 gtk/gtkmm.h                   |   10 ++
 gtk/src/eventcontroller.ccg   |   17 ++++
 gtk/src/eventcontroller.hg    |   62 ++++++++++++++
 gtk/src/filelist.am           |   10 ++
 gtk/src/gesture.ccg           |   41 +++++++++
 gtk/src/gesture.hg            |  184 +++++++++++++++++++++++++++++++++++++++++
 gtk/src/gesturedrag.ccg       |   17 ++++
 gtk/src/gesturedrag.hg        |   69 +++++++++++++++
 gtk/src/gesturelongpress.ccg  |   17 ++++
 gtk/src/gesturelongpress.hg   |   66 +++++++++++++++
 gtk/src/gesturemultipress.ccg |   27 ++++++
 gtk/src/gesturemultipress.hg  |   81 ++++++++++++++++++
 gtk/src/gesturepan.ccg        |   17 ++++
 gtk/src/gesturepan.hg         |   79 ++++++++++++++++++
 gtk/src/gesturerotate.ccg     |   17 ++++
 gtk/src/gesturerotate.hg      |   64 ++++++++++++++
 gtk/src/gesturesingle.ccg     |   17 ++++
 gtk/src/gesturesingle.hg      |   68 +++++++++++++++
 gtk/src/gestureswipe.ccg      |   17 ++++
 gtk/src/gestureswipe.hg       |   71 ++++++++++++++++
 gtk/src/gesturezoom.ccg       |   17 ++++
 gtk/src/gesturezoom.hg        |   66 +++++++++++++++
 tools/m4/convert_gtk.m4       |    3 +
 24 files changed, 1057 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 264ce7e..1fa59ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -226,6 +226,8 @@ gtk/gtkmm/enums.cc
 gtk/gtkmm/enums.h
 gtk/gtkmm/eventbox.cc
 gtk/gtkmm/eventbox.h
+gtk/gtkmm/eventcontroller.cc
+gtk/gtkmm/eventcontroller.h
 gtk/gtkmm/expander.cc
 gtk/gtkmm/expander.h
 gtk/gtkmm/filechooser.cc
@@ -256,6 +258,24 @@ gtk/gtkmm/fontselection.cc
 gtk/gtkmm/fontselection.h
 gtk/gtkmm/frame.cc
 gtk/gtkmm/frame.h
+gtk/gtkmm/gesture.cc
+gtk/gtkmm/gesture.h
+gtk/gtkmm/gesturedrag.cc
+gtk/gtkmm/gesturedrag.h
+gtk/gtkmm/gesturelongpress.cc
+gtk/gtkmm/gesturelongpress.h
+gtk/gtkmm/gesturemultipress.cc
+gtk/gtkmm/gesturemultipress.h
+gtk/gtkmm/gesturepan.cc
+gtk/gtkmm/gesturepan.h
+gtk/gtkmm/gesturerotate.cc
+gtk/gtkmm/gesturerotate.h
+gtk/gtkmm/gesturesingle.cc
+gtk/gtkmm/gesturesingle.h
+gtk/gtkmm/gestureswipe.cc
+gtk/gtkmm/gestureswipe.h
+gtk/gtkmm/gesturezoom.cc
+gtk/gtkmm/gesturezoom.h
 gtk/gtkmm/grid.cc
 gtk/gtkmm/grid.h
 gtk/gtkmm/handlebox.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 9f4dda1..886d8ca 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -149,6 +149,7 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/expander.h>
 #include <gtkmm/enums.h>
 #include <gtkmm/eventbox.h>
+#include <gtkmm/eventcontroller.h>
 #include <gtkmm/filechooser.h>
 #include <gtkmm/filechooserbutton.h>
 #include <gtkmm/filechooserdialog.h>
@@ -163,6 +164,15 @@ extern const int gtkmm_micro_version;
 #include <gtkmm/fontchooserwidget.h>
 #include <gtkmm/fontselection.h>
 #include <gtkmm/frame.h>
+#include <gtkmm/gesture.h>
+#include <gtkmm/gesturedrag.h>
+#include <gtkmm/gesturelongpress.h>
+#include <gtkmm/gesturemultipress.h>
+#include <gtkmm/gesturepan.h>
+#include <gtkmm/gesturerotate.h>
+#include <gtkmm/gesturesingle.h>
+#include <gtkmm/gestureswipe.h>
+#include <gtkmm/gesturezoom.h>
 #include <gtkmm/grid.h>
 #include <gtkmm/handlebox.h>
 #include <gtkmm/headerbar.h>
diff --git a/gtk/src/eventcontroller.ccg b/gtk/src/eventcontroller.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/eventcontroller.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/eventcontroller.hg b/gtk/src/eventcontroller.hg
new file mode 100644
index 0000000..3723d59
--- /dev/null
+++ b/gtk/src/eventcontroller.hg
@@ -0,0 +1,62 @@
+/* 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 <glibmm/object.h>
+#include <gtkmm/widget.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gtk
+{
+_WRAP_ENUM(PropagationPhase, GtkPropagationPhase)
+
+/** Self-contained handler of series of events.
+ *
+ * This is an abstract base class, low-level implementation for event
+ * controllers. Those react to a series of GdkEvent%s, and possibly trigger
+ * actions as a consequence of those.
+ *
+ * @newin{3,14}
+ */
+class EventController : public Glib::Object
+{
+  _CLASS_GOBJECT(EventController, GtkEventController, GTK_EVENT_CONTROLLER, Glib::Object, GObject)
+
+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.
+  _IGNORE(gtk_event_controller_get_event_mask, gtk_event_controller_set_event_mask) dnl// private
+
+  _WRAP_METHOD(Widget* get_widget(), gtk_event_controller_get_widget)
+  _WRAP_METHOD(const Widget* get_widget() const, gtk_event_controller_get_widget, constversion)
+  _WRAP_METHOD(bool handle_event(const GdkEvent* event), gtk_event_controller_handle_event)
+  _WRAP_METHOD(void reset(), gtk_event_controller_reset)
+  _WRAP_METHOD(PropagationPhase get_propagation_phase() const, gtk_event_controller_get_propagation_phase)
+  _WRAP_METHOD(void set_propagation_phase(PropagationPhase phase), 
gtk_event_controller_set_propagation_phase)
+
+  _WRAP_PROPERTY("widget", Widget*)
+  _WRAP_PROPERTY("propagation-phase", PropagationPhase)
+
+  // EventController has no signals
+};
+
+} // namespace Gtk
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 48f8e6f..8ab5526 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -70,6 +70,7 @@ gtkmm_files_any_hg =          \
        entrybuffer.hg          \
        enums.hg                \
        eventbox.hg             \
+       eventcontroller.hg              \
        expander.hg             \
        filechooser.hg          \
        filechooserbutton.hg    \
@@ -84,6 +85,15 @@ gtkmm_files_any_hg =         \
        fontchooserdialog.hg    \
        fontchooserwidget.hg    \
        frame.hg                \
+       gesture.hg      \
+       gesturedrag.hg  \
+       gesturelongpress.hg     \
+       gesturemultipress.hg    \
+       gesturepan.hg   \
+       gesturerotate.hg        \
+       gesturesingle.hg        \
+       gestureswipe.hg \
+       gesturezoom.hg  \
        grid.hg                 \
        headerbar.hg    \
        hvbox.hg                \
diff --git a/gtk/src/gesture.ccg b/gtk/src/gesture.ccg
new file mode 100644
index 0000000..926360d
--- /dev/null
+++ b/gtk/src/gesture.ccg
@@ -0,0 +1,41 @@
+/* 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 <gtk/gtk.h>
+
+namespace Gtk
+{
+// Glib::ListHandler is not well suited for this case, where the contents
+// of the GList shall not be converted to a C++ type.
+std::vector<const GdkEventSequence*> Gesture::get_sequences() const
+{
+  std::vector<const GdkEventSequence*> sequences;
+  GList* list = g_list_first(gtk_gesture_get_sequences(const_cast<GtkGesture*>(gobj())));
+
+  for (GList* node = list; node; node = g_list_next(node))
+    sequences.push_back(static_cast<GdkEventSequence*>(node->data));
+
+  g_list_free(list);
+
+  return sequences;
+}
+
+void Gesture::unset_window()
+{
+  gtk_gesture_set_window(gobj(), 0);
+}
+
+} //namespace Gtk
diff --git a/gtk/src/gesture.hg b/gtk/src/gesture.hg
new file mode 100644
index 0000000..9f671b8
--- /dev/null
+++ b/gtk/src/gesture.hg
@@ -0,0 +1,184 @@
+/* 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 <vector>
+#include <gtkmm/eventcontroller.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/eventcontroller_p.h)
+
+namespace Gtk
+{
+_WRAP_ENUM(EventSequenceState, GtkEventSequenceState)
+
+/** Abstract base class for gestures.
+ *
+ * This is the base object for gesture recognition. Although this
+ * object is quite generalized to serve as a base for multi-touch gestures,
+ * it is suitable to implement single-touch and pointer-based gestures (using
+ * the special GdkEventSequence value for these).
+ *
+ * The number of touches that a Gesture need to be recognized is controlled
+ * by the n-points property. If a gesture is keeping track of less
+ * or more than that number of sequences, it won't check whether the gesture
+ * is recognized.
+ *
+ * As soon as the gesture has the expected number of touches, the gesture will
+ * run check signal regularly on input events until the gesture
+ * is recognized. The criteria to consider a gesture as "recognized" is left to
+ * Gesture subclasses.
+ *
+ * A recognized gesture will then emit the following signals:
+ * - signal_begin() when the gesture is recognized.
+ * - A number of signal_update(), whenever an input event is processed.
+ * - signal_end() when the gesture is no longer recognized.
+ *
+ * <h2>Event propagation</h2>
+ *
+ * In order to receive events, a gesture needs to either set a propagation phase
+ * through EventController::set_propagation_phase(), or feed those manually
+ * through EventController::handle_event().
+ *
+ * In the capture phase, events are propagated from the toplevel down to the
+ * target widget, and gestures that are attached to containers above the widget
+ * get a chance to interact with the event before it reaches the target.
+ *
+ * After the capture phase, GTK+ emits the traditional Widget::signal_button_press_event(),
+ * Widget::signal_button_release_event(), Widget::signal_touch_event(), etc. Gestures
+ * with the Gtk::PHASE_TARGET phase are fed events from the default
+ * Widget::signal_event() handlers.
+ *
+ * In the bubble phase, events are propagated up from the target widget to the
+ * toplevel, and gestures that are attached to containers above the widget get
+ * a chance to interact with events that have not been handled yet.
+ *
+ * <h2>States of a sequence</h2>
+ *
+ * Whenever input interaction happens, a single event may trigger a cascade of
+ * Gesture%s, both across the parents of the widget receiving the
+ * event and parallelly within an individual widget. It is a responsibility of the
+ * widgets using those gestures to set the state of touch sequences accordingly
+ * in order to enable cooperation of gestures around the GdkEventSequence%s
+ * triggering those.
+ *
+ * Within a widget, gestures can be grouped through group().
+ * Grouped gestures synchronize the state of sequences, so calling
+ * set_sequence_state() on one will effectively propagate
+ * the state throughout the group.
+ *
+ * By default, all sequences start out in the Gtk::EVENT_SEQUENCE_NONE state.
+ * Sequences in this state trigger the gesture event handler, but event
+ * propagation will continue unstopped by gestures.
+ *
+ * If a sequence enters into the Gtk::EVENT_SEQUENCE_DENIED state, the gesture
+ * group will effectively ignore the sequence, letting events go unstopped
+ * through the gesture, but the "slot" will still remain occupied while
+ * the touch is active.
+ *
+ * If a sequence enters in the Gtk::EVENT_SEQUENCE_CLAIMED state, the gesture
+ * group will grab all interaction on the sequence, by:
+ * - Setting the same sequence to Gtk::EVENT_SEQUENCE_DENIED on every other gesture
+ *   group within the widget, and every gesture on parent widgets in the propagation
+ *   chain.
+ * - emitting signal_cancel() on every gesture in widgets underneath in the
+ *   propagation chain.
+ * - Stopping event propagation after the gesture group handles the event.
+ *
+ * @note If a sequence is set early to Gtk::EVENT_SEQUENCE_CLAIMED on
+ * Gdk::TOUCH_BEGIN/Gdk::BUTTON_PRESS (so those events are captured before
+ * reaching the event widget, this implies Gtk::PHASE_CAPTURE), one similar
+ * event will be emulated if the sequence changes to Gtk::EVENT_SEQUENCE_DENIED.
+ * This way event coherence is preserved before event propagation is unstopped
+ * again.
+ *
+ * Sequence states can't be changed freely, see set_sequence_state()
+ * to know about the possible lifetimes of a GdkEventSequence.
+ *
+ * @newin{3,14}
+ */
+class Gesture : public EventController
+{
+  _CLASS_GOBJECT(Gesture, GtkGesture, GTK_GESTURE, EventController, GtkEventController)
+
+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(Glib::RefPtr<Gdk::Device> get_device(), gtk_gesture_get_device, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Device> get_device() const, gtk_gesture_get_device, refreturn, 
constversion)
+  _WRAP_METHOD(bool set_state(EventSequenceState state), gtk_gesture_set_state)
+  _WRAP_METHOD(EventSequenceState get_sequence_state(GdkEventSequence* sequence) const, 
gtk_gesture_get_sequence_state)
+  _WRAP_METHOD(bool set_sequence_state(GdkEventSequence* sequence, EventSequenceState state), 
gtk_gesture_set_sequence_state)
+
+  /** Returns the list of GdkEventSequence%s currently being interpreted.
+   *
+   * @newin{3,14}
+   *
+   * @return A std::vector of GdkEventSequence pointers.
+   *         The GdkEventSequence%s are owned by GTK+ and must not be freed or modified.
+   */
+  std::vector<const GdkEventSequence*> get_sequences() const;
+  _IGNORE(gtk_gesture_get_sequences)
+
+  _WRAP_METHOD(GdkEventSequence* get_last_updated_sequence(), gtk_gesture_get_last_updated_sequence)
+  _WRAP_METHOD(const GdkEventSequence* get_last_updated_sequence() const, 
gtk_gesture_get_last_updated_sequence, constversion)
+  _WRAP_METHOD(bool handles_sequence(GdkEventSequence* sequence) const, gtk_gesture_handles_sequence)
+  _WRAP_METHOD(const GdkEvent* get_last_event(GdkEventSequence* sequence) const, gtk_gesture_get_last_event)
+  _WRAP_METHOD(bool get_point(GdkEventSequence* sequence, double& x, double& y) const, gtk_gesture_get_point)
+  _WRAP_METHOD(bool get_bounding_box(Gdk::Rectangle& rect) const, gtk_gesture_get_bounding_box)
+  _WRAP_METHOD(bool get_bounding_box_center(double& x, double& y) const, gtk_gesture_get_bounding_box_center)
+  _WRAP_METHOD(bool is_active() const, gtk_gesture_is_active)
+  _WRAP_METHOD(bool is_recognized() const, gtk_gesture_is_recognized)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_window(), gtk_gesture_get_window, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_window() const, gtk_gesture_get_window, refreturn, 
constversion)
+  _WRAP_METHOD(void set_window(const Glib::RefPtr<Gdk::Window>& window), gtk_gesture_set_window)
+
+  /** Undoes the effect of previous calls to set_window(),
+   * so the gesture will handle events targeting any Gdk::Window that pertains
+   * to Gtk::EventController::get_widget().
+   *
+   * @newin{3,14}
+   */
+  void unset_window();
+
+#m4 _CONVERSION(`const Glib::RefPtr<Gesture>&',`GtkGesture*',__CONVERT_REFPTR_TO_P($3))
+  _WRAP_METHOD(void group(const Glib::RefPtr<Gesture>& group_gesture), gtk_gesture_group)
+  _WRAP_METHOD(void ungroup(), gtk_gesture_ungroup)
+
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Gesture> >',`Glib::ListHandler< Glib::RefPtr<Gesture> 
::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+  _WRAP_METHOD(std::vector< Glib::RefPtr<Gesture> > get_group(), gtk_gesture_get_group)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Gesture> >',`Glib::ListHandler< Glib::RefPtr<const 
Gesture> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+  _WRAP_METHOD(std::vector< Glib::RefPtr<const Gesture> > get_group() const, gtk_gesture_get_group)
+
+  _WRAP_METHOD(bool is_grouped_with(const Glib::RefPtr<Gesture>& other) const, gtk_gesture_is_grouped_with)
+
+  // no_default_handler because GtkGestureClass is private.
+  _WRAP_SIGNAL(void begin(GdkEventSequence* sequence), "begin", no_default_handler)
+  _WRAP_SIGNAL(void end(GdkEventSequence* sequence), "end", no_default_handler)
+  _WRAP_SIGNAL(void update(GdkEventSequence* sequence), "update", no_default_handler)
+  _WRAP_SIGNAL(void cancel(GdkEventSequence* sequence), "cancel", no_default_handler)
+  _WRAP_SIGNAL(void sequence_state_changed(GdkEventSequence* sequence, EventSequenceState state), 
"sequence_state_changed", no_default_handler)
+
+  _WRAP_PROPERTY("n-points", unsigned int)
+  _WRAP_PROPERTY("window", Glib::RefPtr<Gdk::Window>)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturedrag.ccg b/gtk/src/gesturedrag.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturedrag.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturedrag.hg b/gtk/src/gesturedrag.hg
new file mode 100644
index 0000000..f1ae989
--- /dev/null
+++ b/gtk/src/gesturedrag.hg
@@ -0,0 +1,69 @@
+/* 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}
+ */
+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
diff --git a/gtk/src/gesturelongpress.ccg b/gtk/src/gesturelongpress.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturelongpress.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturelongpress.hg b/gtk/src/gesturelongpress.hg
new file mode 100644
index 0000000..5ccbfcf
--- /dev/null
+++ b/gtk/src/gesturelongpress.hg
@@ -0,0 +1,66 @@
+/* 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
+{
+/** "Press and Hold" gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * long presses, triggering signal_pressed() after the
+ * timeout is exceeded.
+ *
+ * If the touchpoint is lifted before the timeout passes, or if it drifts
+ * too far of the initial press point, signal_cancelled() will be emitted.
+ *
+ * @newin{3,14}
+ */
+class GestureLongPress : public GestureSingle
+{
+  _CLASS_GOBJECT(GestureLongPress, GtkGestureLongPress, GTK_GESTURE_LONG_PRESS, 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 long presses.
+   */
+  _WRAP_CTOR(GestureLongPress(Widget& widget), gtk_gesture_long_press_new)
+
+public:
+  /** Creates a Gesture that recognizes long presses.
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @return A RefPtr to a new GestureLongPress.
+   */
+  _WRAP_CREATE(Widget& widget)
+
+  // no_default_handler because GtkGestureLongPressClass is private.
+  _WRAP_SIGNAL(void pressed(double x, double y), "pressed", no_default_handler)
+  _WRAP_SIGNAL(void cancelled(), "cancelled", no_default_handler)
+
+  // GestureLongPress has no properties and no methods
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturemultipress.ccg b/gtk/src/gesturemultipress.ccg
new file mode 100644
index 0000000..7fdaf1d
--- /dev/null
+++ b/gtk/src/gesturemultipress.ccg
@@ -0,0 +1,27 @@
+/* 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 <gtk/gtk.h>
+
+namespace Gtk
+{
+
+void GestureMultiPress::unset_area()
+{
+  gtk_gesture_multi_press_set_area(gobj(), 0);
+}
+
+} //namespace Gtk
diff --git a/gtk/src/gesturemultipress.hg b/gtk/src/gesturemultipress.hg
new file mode 100644
index 0000000..38b15fc
--- /dev/null
+++ b/gtk/src/gesturemultipress.hg
@@ -0,0 +1,81 @@
+/* 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>
+#include <gdkmm/rectangle.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/gesturesingle_p.h)
+
+namespace Gtk
+{
+/** Multipress gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * multiple clicks on a nearby zone, which can be listened for through
+ * signal_pressed(). Whenever time or distance between
+ * clicks exceed the GTK+ defaults, signal_stopped() is emitted,
+ * and the click counter is reset.
+ *
+ * Callers may also restrict the area that is considered valid for a >1
+ * touch/button press through set_area(), so any
+ * click happening outside that area is considered to be a first click of
+ * its own.
+ *
+ * @newin{3,14}
+ */
+class GestureMultiPress : public GestureSingle
+{
+  _CLASS_GOBJECT(GestureMultiPress, GtkGestureMultiPress, GTK_GESTURE_MULTI_PRESS, 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 single and multiple presses.
+   */
+  _WRAP_CTOR(GestureMultiPress(Widget& widget), gtk_gesture_multi_press_new)
+
+public:
+  /** Creates a Gesture that recognizes single and multiple presses.
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @return A RefPtr to a new GestureMultiPress.
+   */
+  _WRAP_CREATE(Widget& widget)
+
+  _WRAP_METHOD(bool get_area(Gdk::Rectangle& rect) const, gtk_gesture_multi_press_get_area)
+  _WRAP_METHOD(void set_area(const Gdk::Rectangle& rect), gtk_gesture_multi_press_set_area)
+
+  /** Resets the press area to an unrestricted state.
+   *
+   * @newin{3,14}
+   */
+  void unset_area();
+
+  // no_default_handler because GtkGestureMultiPressClass is private.
+  _WRAP_SIGNAL(void pressed(int n_press, double x, double y), "pressed", no_default_handler)
+  _WRAP_SIGNAL(void released(int n_press, double x, double y), "released", no_default_handler)
+  _WRAP_SIGNAL(void stopped(), "stopped", no_default_handler)
+
+  // GestureMultiPress has no properties
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturepan.ccg b/gtk/src/gesturepan.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturepan.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturepan.hg b/gtk/src/gesturepan.hg
new file mode 100644
index 0000000..9dccba9
--- /dev/null
+++ b/gtk/src/gesturepan.hg
@@ -0,0 +1,79 @@
+/* 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/gesturedrag.h>
+#include <gtkmm/enums.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/gesturedrag_p.h)
+
+namespace Gtk
+{
+_WRAP_ENUM(PanDirection, GtkPanDirection)
+
+/** Pan gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * pan gestures. Those are drags that are locked to happen along one
+ * axis. The axis that a GesturePan handles is defined at
+ * construct time, and can be changed through set_orientation().
+ *
+ * When the gesture starts to be recognized, GesturePan will
+ * attempt to determine as early as possible whether the sequence
+ * is moving in the expected direction, and denying the sequence if
+ * this does not happen.
+ *
+ * Once a panning gesture along the expected axis is recognized,
+ * signal_pan() will be emitted as input events
+ * are received, containing the offset in the given axis.
+ *
+ * @newin{3,14}
+ */
+class GesturePan : public GestureDrag
+{
+  _CLASS_GOBJECT(GesturePan, GtkGesturePan, GTK_GESTURE_PAN, GestureDrag, GtkGestureDrag)
+
+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 pan gestures.
+   */
+  _WRAP_CTOR(GesturePan(Widget& widget, Orientation orientation), gtk_gesture_pan_new)
+
+public:
+  /** Creates a Gesture that recognizes pan gestures.
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @param orientation Expected orientation.
+   * @return A RefPtr to a new GesturePan.
+   */
+  _WRAP_CREATE(Widget& widget, Orientation orientation)
+
+  _WRAP_METHOD(Orientation get_orientation() const, gtk_gesture_pan_get_orientation)
+  _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_gesture_pan_set_orientation)
+
+  // no_default_handler because GtkGesturePanClass is private.
+  _WRAP_SIGNAL(void pan(PanDirection direction, double offset), "pan", no_default_handler)
+
+  _WRAP_PROPERTY("orientation", Orientation)
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturerotate.ccg b/gtk/src/gesturerotate.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturerotate.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturerotate.hg b/gtk/src/gesturerotate.hg
new file mode 100644
index 0000000..1a4687e
--- /dev/null
+++ b/gtk/src/gesturerotate.hg
@@ -0,0 +1,64 @@
+/* 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/gesture.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/gesture_p.h)
+
+namespace Gtk
+{
+/** Rotate gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * 2-finger rotations. Whenever the angle between both handled sequences
+ * changes, signal_angle_changed() is emitted.
+
+ * @newin{3,14}
+ */
+class GestureRotate : public Gesture
+{
+  _CLASS_GOBJECT(GestureRotate, GtkGestureRotate, GTK_GESTURE_ROTATE, Gesture, GtkGesture)
+
+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 2-touch rotation gestures.
+   */
+  _WRAP_CTOR(GestureRotate(Widget& widget), gtk_gesture_rotate_new)
+
+public:
+  /** Creates a Gesture that recognizes 2-touch rotation gestures.
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @return A RefPtr to a new GestureRotate.
+   */
+  _WRAP_CREATE(Widget& widget)
+
+  _WRAP_METHOD(double get_angle_delta() const, gtk_gesture_rotate_get_angle_delta)
+
+  // no_default_handler because GtkGestureRotateClass is private.
+  _WRAP_SIGNAL(void angle_changed(double angle, double angle_delta), "angle-changed", no_default_handler)
+
+  // GestureRotate has no properties
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturesingle.ccg b/gtk/src/gesturesingle.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturesingle.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturesingle.hg b/gtk/src/gesturesingle.hg
new file mode 100644
index 0000000..bde467f
--- /dev/null
+++ b/gtk/src/gesturesingle.hg
@@ -0,0 +1,68 @@
+/* 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/gesture.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/gesture_p.h)
+
+namespace Gtk
+{
+/** Abstract 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 only react to touch events. set_touch_only()
+ * can be used to change this default behavior. Callers may also specify
+ * a mouse button number to interact with through set_button().
+ *
+ * @newin{3,14}
+ */
+class GestureSingle : public Gesture
+{
+  _CLASS_GOBJECT(GestureSingle, GtkGestureSingle, GTK_GESTURE_SINGLE, Gesture, GtkGesture)
+
+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
diff --git a/gtk/src/gestureswipe.ccg b/gtk/src/gestureswipe.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gestureswipe.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gestureswipe.hg b/gtk/src/gestureswipe.hg
new file mode 100644
index 0000000..5ad1871
--- /dev/null
+++ b/gtk/src/gestureswipe.hg
@@ -0,0 +1,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
+{
+/** Swipe gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * swipes. After a press/move/.../move/release sequence happens,
+ * signal_swipe() will be emitted, providing the velocity
+ * and directionality of the sequence at the time it was lifted.
+ *
+ * If the velocity is desired in intermediate points,
+ * get_velocity() can be called on eg. a
+ * Gesture::signal_update() handler.
+ *
+ * All velocities are reported in pixels/sec units.
+ *
+ * @newin{3,14}
+ */
+class GestureSwipe : public GestureSingle
+{
+  _CLASS_GOBJECT(GestureSwipe, GtkGestureSwipe, GTK_GESTURE_SWIPE, 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 swipes.
+   */
+  _WRAP_CTOR(GestureSwipe(Widget& widget), gtk_gesture_swipe_new)
+
+public:
+  /** Creates a Gesture that recognizes swipes.
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @return A RefPtr to a new GestureSwipe.
+   */
+  _WRAP_CREATE(Widget& widget)
+
+  _WRAP_METHOD(bool get_velocity(double& velocity_x, double& velocity_y) const, 
gtk_gesture_swipe_get_velocity)
+
+  // no_default_handler because GtkGestureSwipeClass is private.
+  _WRAP_SIGNAL(void swipe(double velocity_x, double velocity_y), "swipe", no_default_handler)
+
+  // GestureSwipe has no properties
+};
+
+} // namespace Gtk
diff --git a/gtk/src/gesturezoom.ccg b/gtk/src/gesturezoom.ccg
new file mode 100644
index 0000000..1738356
--- /dev/null
+++ b/gtk/src/gesturezoom.ccg
@@ -0,0 +1,17 @@
+/* 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 <gtk/gtk.h>
diff --git a/gtk/src/gesturezoom.hg b/gtk/src/gesturezoom.hg
new file mode 100644
index 0000000..1a128a4
--- /dev/null
+++ b/gtk/src/gesturezoom.hg
@@ -0,0 +1,66 @@
+/* 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/gesture.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/gesture_p.h)
+
+namespace Gtk
+{
+/** Zoom gesture.
+ *
+ * This is a Gesture implementation able to recognize
+ * pinch/zoom gestures. Whenever the distance between both tracked
+ * sequences changes, signal_scale_changed() is emitted to report the scale factor.
+ *
+ * @newin{3,14}
+ */
+class GestureZoom : public Gesture
+{
+  _CLASS_GOBJECT(GestureZoom, GtkGestureZoom, GTK_GESTURE_ZOOM, Gesture, GtkGesture)
+
+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 zoom in/out gestures
+   * (usually known as pinch/zoom).
+   */
+  _WRAP_CTOR(GestureZoom(Widget& widget), gtk_gesture_zoom_new)
+
+public:
+  /** Creates a Gesture that recognizes zoom in/out gestures
+   * (usually known as pinch/zoom).
+   *
+   * @newin{3,14}
+   *
+   * @param widget Widget the gesture relates to.
+   * @return A RefPtr to a new GestureZoom.
+   */
+  _WRAP_CREATE(Widget& widget)
+
+  _WRAP_METHOD(double get_scale_delta() const, gtk_gesture_zoom_get_scale_delta)
+
+  // no_default_handler because GtkGestureZoomClass is private.
+  _WRAP_SIGNAL(void scale_changed(double scale), "scale-changed", no_default_handler)
+
+  // GestureZoom has no properties
+};
+
+} // namespace Gtk
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 4965a9a..17880e0 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -79,6 +79,7 @@ _CONV_ENUM(Gtk,CurveType)
 _CONV_ENUM(Gtk,DeleteType)
 _CONV_ENUM(Gtk,DestDefaults)
 _CONV_ENUM(Gtk,DirectionType)
+_CONV_ENUM(Gtk,EventSequenceState)
 _CONV_ENUM(Gtk,ExpanderStyle)
 _CONV_ENUM(Gtk,ImageType)
 _CONV_ENUM(Gtk,Justification)
@@ -90,12 +91,14 @@ _CONV_ENUM(Gtk,NotebookTab)
 _CONV_ENUM(Gtk,Orientation)
 _CONV_ENUM(Gtk,PackType)
 _CONV_ENUM(Gtk,PackDirection)
+_CONV_ENUM(Gtk,PanDirection)
 _CONV_ENUM(Gtk,PlacesOpenFlags)
 _CONV_ENUM(Gtk,PolicyType)
 _CONV_ENUM(Gtk,PositionType)
 _CONV_ENUM(Gtk,PreviewType)
 _CONV_ENUM(Gtk,ProgressBarOrientation)
 _CONV_ENUM(Gtk,ProgressBarStyle)
+_CONV_ENUM(Gtk,PropagationPhase)
 _CONV_ENUM(Gtk,ReliefStyle)
 _CONV_ENUM(Gtk,ResizeMode)
 _CONV_ENUM(Gtk,RevealerTransitionType)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]