diff --git a/.gitignore b/.gitignore index fe8848221..e1610a5f6 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,8 @@ src/gtk-shell-protocol.c src/gtk-shell-server-protocol.h src/xdg-shell-protocol.c src/xdg-shell-server-protocol.h +src/pointer-gestures-protocol.c +src/pointer-gestures-server-protocol.h src/xserver-protocol.c src/xserver-server-protocol.h src/meta/meta-version.h diff --git a/src/Makefile.am b/src/Makefile.am index c02fe6ac5..1425f7cc9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -45,6 +45,8 @@ mutter_built_sources = \ if HAVE_WAYLAND mutter_built_sources += \ + pointer-gestures-protocol.c \ + pointer-gestures-server-protocol.h \ gtk-shell-protocol.c \ gtk-shell-server-protocol.h \ xdg-shell-protocol.c \ @@ -53,6 +55,7 @@ mutter_built_sources += \ endif wayland_protocols = \ + wayland/protocol/pointer-gestures.xml \ wayland/protocol/gtk-shell.xml \ wayland/protocol/xdg-shell.xml \ $(NULL) diff --git a/src/wayland/protocol/pointer-gestures.xml b/src/wayland/protocol/pointer-gestures.xml new file mode 100644 index 000000000..1bca8f7ed --- /dev/null +++ b/src/wayland/protocol/pointer-gestures.xml @@ -0,0 +1,172 @@ + + + + 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. + + + + + Create a swipe gesture object. See the + wl_pointer_gesture_swipe interface for details. + + + + + + + + Create a pinch gesture object. See the + wl_pointer_gesture_pinch interface for details. + + + + + + + + + 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. + + + + + + + + + This event is sent when a multi-finger swipe gesture is detected + on the device. + + + + + + + + + + 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. + + + + + + + + + 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. + + + + + + + + + + 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. + + + + + + + + + This event is sent when a multi-finger pinch gesture is detected + on the device. + + + + + + + + + + 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. + + + + + + + + + + + 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. + + + + + + +