From f89eb17d5561b39bfee5f611518a545624d0cc87 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 20 Feb 2023 21:48:46 +0100 Subject: cursor-shape-v1: new protocol This is based on the Chromium protocol [1]. [1]: https://chromium.googlesource.com/chromium/src/+/main/third_party/wayland-protocols/unstable/cursor-shapes/cursor-shapes-unstable-v1.xml Signed-off-by: Simon Ser Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/58 References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/21 --- meson.build | 1 + staging/cursor-shape/README | 4 + staging/cursor-shape/cursor-shape-v1.xml | 147 +++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 staging/cursor-shape/README create mode 100644 staging/cursor-shape/cursor-shape-v1.xml diff --git a/meson.build b/meson.build index b69ce2b..3b97f85 100644 --- a/meson.build +++ b/meson.build @@ -37,6 +37,7 @@ unstable_protocols = { staging_protocols = { 'content-type': ['v1'], + 'cursor-shape': ['v1'], 'drm-lease': ['v1'], 'ext-foreign-toplevel-list': ['v1'], 'ext-idle-notify': ['v1'], diff --git a/staging/cursor-shape/README b/staging/cursor-shape/README new file mode 100644 index 0000000..45eb4a8 --- /dev/null +++ b/staging/cursor-shape/README @@ -0,0 +1,4 @@ +cursor-shape protocol + +Maintainers: +Simon Ser diff --git a/staging/cursor-shape/cursor-shape-v1.xml b/staging/cursor-shape/cursor-shape-v1.xml new file mode 100644 index 0000000..56f6a1a --- /dev/null +++ b/staging/cursor-shape/cursor-shape-v1.xml @@ -0,0 +1,147 @@ + + + + Copyright 2018 The Chromium Authors + Copyright 2023 Simon Ser + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + + This global offers an alternative, optional way to set cursor images. This + new way uses enumerated cursors instead of a wl_surface like + wl_pointer.set_cursor does. + + Warning! The protocol described in this file is currently in the testing + phase. Backward compatible changes may be added together with the + corresponding interface version bump. Backward incompatible changes can + only be done by creating a new major version of the extension. + + + + + Destroy the cursor shape manager. + + + + + + Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. + + + + + + + + Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. + + + + + + + + + This interface advertises the list of supported cursor shapes for a + device, and allows clients to set the cursor shape. + + + + + This enum describes cursor shapes. + + The names are taken from the CSS W3C specification: + https://w3c.github.io/csswg-drafts/css-ui/#cursor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Destroy the cursor shape device. + + The device cursor shape remains unchanged. + + + + + + Sets the device cursor to the specified shape. The compositor will + change the cursor image based on the specified shape. + + The cursor actually changes only if the input device focus is one of + the requesting client's surfaces. If any, the previous cursor image + (surface or shape) is replaced. + + The "shape" argument must be a valid enum entry, otherwise the + invalid_shape protocol error is raised. + + This is similar to the wl_pointer.set_cursor and + zwp_tablet_tool_v2.set_cursor requests, but this request accepts a + shape instead of contents in the form of a surface. Clients can mix + set_cursor and set_shape requests. + + The serial parameter must match the latest wl_pointer.enter or + zwp_tablet_tool_v2.proximity_in serial number sent to the client. + Otherwise the request will be ignored. + + + + + + -- cgit v1.2.3