summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-07-20 17:22:33 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-08-09 17:52:52 +0200
commitcc963ba9bae2cc46b032b7cfebc89ec1c2ba21ee (patch)
treeb51028e5c3c300e5470c94f7746621c2ba1ea4a4
parent548a9d2d691efbe68925d4d918c588aa07305405 (diff)
downloadgtk+-cc963ba9bae2cc46b032b7cfebc89ec1c2ba21ee.tar.gz
wayland: Add touchpad gestures protocol
-rw-r--r--gdk/wayland/Makefile.am3
-rw-r--r--gdk/wayland/protocol/pointer-gestures.xml172
2 files changed, 175 insertions, 0 deletions
diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am
index 1a779f098b..93d099fb4c 100644
--- a/gdk/wayland/Makefile.am
+++ b/gdk/wayland/Makefile.am
@@ -20,6 +20,8 @@ noinst_LTLIBRARIES = \
libgdk-wayland.la
BUILT_SOURCES = \
+ pointer-gestures-client-protocol.h \
+ pointer-gestures-protocol.c \
xdg-shell-client-protocol.h \
xdg-shell-protocol.c \
gtk-shell-client-protocol.h \
@@ -70,6 +72,7 @@ libgdkwaylandinclude_HEADERS = \
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
EXTRA_DIST += \
+ protocol/pointer-gestures.xml \
protocol/xdg-shell.xml \
protocol/gtk-shell.xml
diff --git a/gdk/wayland/protocol/pointer-gestures.xml b/gdk/wayland/protocol/pointer-gestures.xml
new file mode 100644
index 0000000000..1bca8f7ed2
--- /dev/null
+++ b/gdk/wayland/protocol/pointer-gestures.xml
@@ -0,0 +1,172 @@
+<protocol name="pointer_gestures">
+ <interface name="_wl_pointer_gestures" version="1">
+ <description summary="touchpad gestures">
+ A global interface to provide semantic touchpad gestures for a given
+ pointer.
+
+ Two gestures are currently supported: swipe and zoom/rotate.
+ All gestures follow a three-stage cycle: begin, update, end and
+ are identified by a unique id.
+
+ Warning! The protocol described in this file is experimental. Each
+ version of this protocol should be considered incompatible with any
+ other version, and a client binding to a version different to the one
+ advertised will be terminated. Once the protocol is declared stable,
+ compatibility is guaranteed, the '_' prefix will be removed from the
+ name and the version will be reset to 1.
+ </description>
+
+ <request name="get_swipe_gesture">
+ <description summary="get swipe gesture">
+ Create a swipe gesture object. See the
+ wl_pointer_gesture_swipe interface for details.
+ </description>
+ <arg name="id" type="new_id" interface="_wl_pointer_gesture_swipe"/>
+ <arg name="pointer" type="object" interface="wl_pointer"/>
+ </request>
+
+ <request name="get_pinch_gesture">
+ <description summary="get pinch gesture">
+ Create a pinch gesture object. See the
+ wl_pointer_gesture_pinch interface for details.
+ </description>
+ <arg name="id" type="new_id" interface="_wl_pointer_gesture_pinch"/>
+ <arg name="pointer" type="object" interface="wl_pointer"/>
+ </request>
+ </interface>
+
+ <interface name="_wl_pointer_gesture_swipe" version="1">
+ <description summary="a swipe gesture object">
+ A swipe gesture object notifies a client about a multi-finger swipe
+ gesture detected on an indirect input device such as a touchpad.
+ The gesture is usually initiated by multiple fingers moving in the
+ same direction but once initiated the direction may change.
+ The precise conditions of when such a gesture is detected are
+ implementation-dependent.
+
+ A gesture consists of three stages: begin, update (optional) and end.
+ There cannot be multiple simultaneous pinch or swipe gestures on a
+ same pointer/seat, how compositors prevent these situations is
+ implementation-dependent.
+
+ A gesture may be cancelled by the compositor or the hardware.
+ Clients should not consider performing permanent or irreversible
+ actions until the end of a gesture has been received.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pointer swipe gesture object"/>
+ </request>
+
+ <event name="begin">
+ <description summary="multi-finger swipe begin">
+ This event is sent when a multi-finger swipe gesture is detected
+ on the device.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="fingers" type="uint" summary="number of fingers"/>
+ </event>
+
+ <event name="update">
+ <description summary="multi-finger swipe motion">
+ This event is sent when a multi-finger swipe gesture changes the
+ position of the logical center.
+
+ The dx and dy coordinates are relative coordinates of the logical
+ center of the gesture compared to the previous event.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
+ </event>
+
+ <event name="end">
+ <description summary="multi-finger swipe end">
+ This event is sent when a multi-finger swipe gesture ceases to
+ be valid. This may happen when one or more finger is lifted or
+ the gesture is cancelled.
+
+ When a gesture is cancelled, the client should undo state changes
+ caused by this gesture. What causes a gesture to be cancelled is
+ implementation-dependent.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
+ </event>
+ </interface>
+
+ <interface name="_wl_pointer_gesture_pinch" version="1">
+ <description summary="a pinch gesture object">
+ A pinch gesture object notifies a client about a multi-finger pinch
+ gesture detected on an indirect input device such as a touchpad.
+ The gesture is usually initiated by multiple fingers moving towards
+ each other or away from each other, or by two or more fingers rotating
+ around a logical center of gravity. The precise conditions of when
+ such a gesture is detected are implementation-dependent.
+
+ A gesture consists of three stages: begin, update (optional) and end.
+ There cannot be multiple simultaneous pinch or swipe gestures on a
+ same pointer/seat, how compositors prevent these situations is
+ implementation-dependent.
+
+ A gesture may be cancelled by the compositor or the hardware.
+ Clients should not consider performing permanent or irreversible
+ actions until the end of a gesture has been received.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pinch gesture object"/>
+ </request>
+
+ <event name="begin">
+ <description summary="multi-finger pinch begin">
+ This event is sent when a multi-finger pinch gesture is detected
+ on the device.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="fingers" type="uint" summary="number of fingers"/>
+ </event>
+
+ <event name="update">
+ <description summary="multi-finger pinch motion">
+ This event is sent when a multi-finger pinch gesture changes the
+ position of the logical center, the rotation or the relative scale.
+
+ The dx and dy coordinates are relative coordinates in the
+ surface coordinate space of the logical center of the gesture.
+
+ The scale factor is an absolute scale compared to the
+ pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
+ are now twice as far apart as on pointer_gesture_pinch.begin.
+
+ The rotation is the relative angle in degrees clockwise compared to the previous
+ pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
+ <arg name="scale" type="fixed" summary="scale relative to the initial finger position"/>
+ <arg name="rotation" type="fixed" summary="angle in degrees cw relative to the previous event"/>
+ </event>
+
+ <event name="end">
+ <description summary="multi-finger pinch end">
+ This event is sent when a multi-finger pinch gesture ceases to
+ be valid. This may happen when one or more finger is lifted or
+ the gesture is cancelled.
+
+ When a gesture is cancelled, the client should undo state changes
+ caused by this gesture. What causes a gesture to be cancelled is
+ implementation-dependent.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
+ </event>
+ </interface>
+</protocol>