diff --git a/proto/protocol.xml b/proto/protocol.xml
index 4b170d8..aaacf22 100644
--- a/proto/protocol.xml
+++ b/proto/protocol.xml
@@ -6,6 +6,7 @@
Copyright © 2010-2011 Intel Corporation
Copyright © 2012-2013 Collabora, Ltd.
Copyright © 2023 Red Hat, Inc.
+ Copyright © 2025 Wacom Co., Ltd.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@@ -771,6 +772,7 @@
- "ei_button"
- "ei_keyboard"
- "ei_touchscreen"
+ - "ei_stylus"
The interface version is equal or less to the client-supported
version in ei_handshake.interface_version for the respective interface.
@@ -1592,4 +1594,366 @@
+
+
+
+ Interface for stylus requests and events.
+
+ This interface is only provided once per device and where a client
+ requests ei_stylus.release the interface does not get re-initialized.
+ An EIS implmentation may adjust the behavior of the device
+ (including removing the device) if the interface is released.
+
+ Note that for a client to receive objects of this type, it must announce
+ support for the interface in ei_handshake.interface_version.
+
+ ## Overview
+ This interface describes a stylus. A stylus is an absolute pointing tool
+ providing precise location and associated properties (e.g. pressure,
+ tilt, etc.). A stylus object is only capable of representing a single
+ stylus in proximity at a time. If multiple styli need to be in
+ proximity simultaneously, multiple stylus objects must be created.
+
+ The stylus capability may be associated with either physical or virtual
+ ei_device objects. In all cases, styli are absolute devices and
+ require an ei_device.dimension or at least one ei_device.region.
+ All motion events are required to lie within the defined physical
+ dimensions or within regions. In the case of physical devices with an
+ "[out-of-bounds][OOB]" margin, this margin should not be included in
+ the ei_device.dimension. For example: a device with a 400mm x 225mm
+ in-bounds area surrounded by a 2mm out-of-bounds margin on all sides
+ should declare an ei_device.dimension of 400mm x 225mm and not send
+ motion events that occur in the out-of-bounds margin.
+
+ The stylus protocol is stateful and relies on ei_device.frame to
+ delimit state changes. Only those properties, axes, and other values
+ that have changed from one frame to the next are required to be sent.
+
+ The stylus protocol does not communicate any information about the
+ physical(or virtual) capabilities of an individual tool. Receivers
+ should be prepared to receive "any" type of data and must either
+ appropriately handle or ignore events as desired.
+
+ [OOB]: https://wayland.freedesktop.org/libinput/doc/latest/tablet-support.html#out-of-bounds-motion-events
+
+
+
+
+
+
+ Notification that the client is no longer interested in this stylus
+ object. The EIS implementation will release any resources related to
+ this object and send the ei_stylus.destroyed event once complete.
+
+
+
+
+
+ Notification that a stylus is entering proximity of its tablet. The
+ stylus object transitions from an "out of proximity" state to an "in
+ proximity" state once the following ei_device.frame request has been
+ processed.
+
+ It is a protocol violation to send this request while the stylus object
+ is already in or entering proximity. It is a protocol violation to send
+ ei_stylus.proximity_in and ei_device.proximity_out in the same
+ frame. It is a protocol violation to not include ei_stylus.motion in
+ the same frame.
+
+
+
+
+
+ Notification that the the stylus is leaving proximity of its tablet. The
+ stylus object transitions from an "in proximity" state to an "out of
+ proximity" state once the following ei_device.frame request has been
+ processed.
+
+ While a stylus is "out of proximity", all other state information
+ (e.g. tool type, up/down state, axis values) is invalid and must be
+ cleared on both the sending and receiving side.
+
+ It is a protocol violation to send this request while the stylus object
+ is already leaving or out of proximity. It is a protocol violation to
+ send ei_stylus.proximity_in and ei_device.proximity_out in the same
+ frame.
+
+
+
+
+
+ Notification of the type of stylus entering proximity. Tool types are
+ identified with standard Linux [kernel input event codes][event-codes].
+
+ Senders are not required to generate this request. Receivers are
+ required to recognize at least `BTN_TOOL_PEN` (0x140) and
+ `BTN_TOOL_RUBBER` (0x141). Receivers may choose to treat styli as
+ `BTN_TOOL_PEN` if they do not recognize the type or do not receive this
+ event.
+
+ This request may only be sent in the same ei_device.frame as the
+ ei_stylus.proximity_in event. It is a protocol violation to send this
+ request at any other time.
+
+ [event-codes]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/input-event-codes.h
+
+
+
+
+
+
+ Notification that the stylus has come into logical contact with the
+ tablet.
+
+ Senders are required to generate this request to signal logical contact.
+ Receivers are free to treat the stylus as "up" in the absence of this
+ event, regardless of other axis values that may be present
+ (e.g. pressure, distance).
+
+ This request may only be sent while the stylus is entering or in
+ proximity. It is a protocol violation to send this request at any other
+ time. It is a protocol violation to for ei_stylus.down and
+ ei_stylus.up to share the same ei_device.frame.
+
+
+
+
+
+ Notification that the stylus has left logical contact with the tablet.
+
+ Senders are required to generate this request to signal the loss of
+ logical contact. Receivers are free to treat the stylus as "down" in
+ the absence of this event, regardless of other axis values that may be
+ present(e.g. pressure, distance).
+
+ This request may only be sent while the stylus is in or leaving
+ proximity. It is a protocol violation to send this request at any other
+ time . It is a protocol violation to for ei_stylus.down and
+ ei_stylus.up to share the same ei_device.frame.
+
+
+
+
+
+ Notification that the stylus has been moved to the given absolute
+ coordinates. The interpretation of values depends on if the device is
+ physical (mm) or virtual (pixels). Fractional pixels are allowed.
+
+ Valid `(x, y)` locations are those that exist inside of the
+ ei_device.dimension (for physical devices) or one of the device’s
+ ei_device.region (for virtual devices). It is a client bug to send a
+ location that exists outside of these locations.The EIS implementation
+ may clamp out-of-range values and / or disconnect the client.
+
+ This request is required to be in the same frame as
+ ei_stylus.proximity_in. It may also be sent while the stylus is in or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+
+
+
+
+
+
+ Notification of the relative amount of pressure exerted on the stylus.
+
+ The valid range for pressure is `0.0 <= p <= 1.0`. It is a client
+ bug to send values outside of this range. The EIS implementation may
+ clamp out-of-range values and / or disconnect the client.
+
+ The value `p=0.0` indicates the stylus is experiencing "minimum" or "no"
+ pressure, and `p=1.0` indicates the stylus is measuring some
+ arbitrary "maximum pressure".
+
+ This request may only be sent while the stylus is entering, in, or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+ > [!IMPORTANT]
+ > Non-zero pressure does not imply logical contact, but logical
+ > contact _does_ imply a non-zero pressure. If a client chooses to send
+ > pressure values, it is a client bug to not ensure `p>0.0` when sending
+ > ei_stylus.down. The EIS implementation may correct illegal values
+ > and / or disconnect the client.
+
+
+
+
+
+
+ Notification of the relative distance between the stylus and tablet.
+
+ The valid range for distance is `0.0 <= d <= 1.0`. It is a client
+ bug to send values outside of this range. The EIS implementation may
+ clamp out-of-range values and / or disconnect the client.
+
+ The value `d=0.0` indicates the stylus is in physical contact with the
+ tablet and `d=1.0` indicates the stylus is at some arbitrary "maximum
+ distance".
+
+ This request may only be sent while the stylus is entering, in, or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+ > [!IMPORTANT]
+ > Physical contact does not imply logical contact, but logical
+ > contact _does_ imply physical contact. If a client chooses to send
+ > distance values, it is a client bug to not ensure that `d=0.0` when
+ > sending ei_stylus.down. The EIS implementation may correct illegal
+ > values and / or disconnect the client.
+
+
+
+
+
+
+ Notification of the stylus’s tilt angles.
+
+ The valid range for each tilt angle is `-90 <= tilt_[xy] <= +90`.
+ It is a client bug to send values outside of this range. The EIS
+ implementation may clamp out-of-range values and / or disconnect the
+ client.
+
+ Each tilt angle is measured relative to the tablet’s Z axis. The pair
+ `(tilt_x=0, tilt_y=0)` indicates the stylus is being held parallel to
+ the Z axis, while `(tilt_x=90, tilt_y=0)` and `(tilt_x=0, tilt_y=90)`
+ indicate the stylus parallel to the +X and +Y axes, respectively.
+
+ This request may only be sent while the stylus is entering, in, or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+
+
+
+
+
+
+ Notification of the stylus’s barrel rotation angle.
+
+ The valid range for barrel rotation is `0 <= r < 360`. It is a
+ client bug to send values outside of this range. The EIS implementation
+ may reduce out-of-range values modulo 360 and / or disconnect the
+ client.
+
+ The value `r=0` indicates the stylus is being held at its neutral
+ rotation angle. Angles increase in value as the stylus is rotated
+ clockwise while held.
+
+ This request may only be sent while the stylus is entering, in, or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+
+
+
+
+
+ Notification of the relative position of the stylus’s slider.
+
+ The valid range for slider position is `-1.0 <= s <= +1.0`. It is
+ a client bug to send values outside of this range. The EIS
+ implementation may clamp out-of-range values and / or disconnect the
+ client.
+
+ The value `s=0.0` indicates the slider is in its neutral position, while
+ `s=+1.0` indicates "full forward" and `s=-1.0` "full backward".
+
+ This request may only be sent while the stylus is entering, in, or
+ leaving proximity. It is a protocol violation to send this request at
+ any other time.
+
+
+
+
+
+
+
+
+ This object has been removed and a client should release all associated
+ resources.
+
+ This object will be destroyed by the EIS implementation immediately
+ after this event is sent and as such the client must not attempt to use
+ it after that point.
+
+
+
+
+
+
+ See the ei_stylus.proximity_in request for more details.
+
+
+
+
+
+ See the ei_stylus.proximity_out request for more details.
+
+
+
+
+
+ See the ei_stylus.tool_type request for more details.
+
+
+
+
+
+
+ See the ei_stylus.down request for more details.
+
+
+
+
+
+ See the ei_stylus.up request for more details.
+
+
+
+
+
+ See the ei_stylus.motion request for more details.
+
+
+
+
+
+
+
+ See the ei_stylus.pressure request for more details.
+
+
+
+
+
+
+ See the ei_stylus.distance request for more details.
+
+
+
+
+
+
+ See the ei_stylus.tilt request for more details.
+
+
+
+
+
+
+
+ See the ei_stylus.rotation request for more details.
+
+
+
+
+
+
+ See the ei_stylus.slider request for more details.
+
+
+
+