SDL
1178 строк · 50.3 Кб
1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="tablet_v2">3
4<copyright>5Copyright 2014 © Stephen "Lyude" Chandler Paul
6Copyright 2015-2016 © Red Hat, Inc.
7
8Permission is hereby granted, free of charge, to any person
9obtaining a copy of this software and associated documentation files
10(the "Software"), to deal in the Software without restriction,
11including without limitation the rights to use, copy, modify, merge,
12publish, distribute, sublicense, and/or sell copies of the Software,
13and to permit persons to whom the Software is furnished to do so,
14subject to the following conditions:
15
16The above copyright notice and this permission notice (including the
17next paragraph) shall be included in all copies or substantial
18portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
24BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27SOFTWARE.
28</copyright>29
30<description summary="Wayland protocol for graphics tablets">31This description provides a high-level overview of the interplay between
32the interfaces defined this protocol. For details, see the protocol
33specification.
34
35More than one tablet may exist, and device-specifics matter. Tablets are
36not represented by a single virtual device like wl_pointer. A client
37binds to the tablet manager object which is just a proxy object. From
38that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat)
39and that returns the actual interface that has all the tablets. With
40this indirection, we can avoid merging wp_tablet into the actual Wayland
41protocol, a long-term benefit.
42
43The wp_tablet_seat sends a "tablet added" event for each tablet
44connected. That event is followed by descriptive events about the
45hardware; currently that includes events for name, vid/pid and
46a wp_tablet.path event that describes a local path. This path can be
47used to uniquely identify a tablet or get more information through
48libwacom. Emulated or nested tablets can skip any of those, e.g. a
49virtual tablet may not have a vid/pid. The sequence of descriptive
50events is terminated by a wp_tablet.done event to signal that a client
51may now finalize any initialization for that tablet.
52
53Events from tablets require a tool in proximity. Tools are also managed
54by the tablet seat; a "tool added" event is sent whenever a tool is new
55to the compositor. That event is followed by a number of descriptive
56events about the hardware; currently that includes capabilities,
57hardware id and serial number, and tool type. Similar to the tablet
58interface, a wp_tablet_tool.done event is sent to terminate that initial
59sequence.
60
61Any event from a tool happens on the wp_tablet_tool interface. When the
62tool gets into proximity of the tablet, a proximity_in event is sent on
63the wp_tablet_tool interface, listing the tablet and the surface. That
64event is followed by a motion event with the coordinates. After that,
65it's the usual motion, axis, button, etc. events. The protocol's
66serialisation means events are grouped by wp_tablet_tool.frame events.
67
68Two special events (that don't exist in X) are down and up. They signal
69"tip touching the surface". For tablets without real proximity
70detection, the sequence is: proximity_in, motion, down, frame.
71
72When the tool leaves proximity, a proximity_out event is sent. If any
73button is still down, a button release event is sent before this
74proximity event. These button events are sent in the same frame as the
75proximity event to signal to the client that the buttons were held when
76the tool left proximity.
77
78If the tool moves out of the surface but stays in proximity (i.e.
79between windows), compositor-specific grab policies apply. This usually
80means that the proximity-out is delayed until all buttons are released.
81
82Moving a tool physically from one tablet to the other has no real effect
83on the protocol, since we already have the tool object from the "tool
84added" event. All the information is already there and the proximity
85events on both tablets are all a client needs to reconstruct what
86happened.
87
88Some extra axes are normalized, i.e. the client knows the range as
89specified in the protocol (e.g. [0, 65535]), the granularity however is
90unknown. The current normalized axes are pressure, distance, and slider.
91
92Other extra axes are in physical units as specified in the protocol.
93The current extra axes with physical units are tilt, rotation and
94wheel rotation.
95
96Since tablets work independently of the pointer controlled by the mouse,
97the focus handling is independent too and controlled by proximity.
98The wp_tablet_tool.set_cursor request sets a tool-specific cursor.
99This cursor surface may be the same as the mouse cursor, and it may be
100the same across tools but it is possible to be more fine-grained. For
101example, a client may set different cursors for the pen and eraser.
102
103Tools are generally independent of tablets and it is
104compositor-specific policy when a tool can be removed. Common approaches
105will likely include some form of removing a tool when all tablets the
106tool was used on are removed.
107</description>108
109<interface name="zwp_tablet_manager_v2" version="1">110<description summary="controller object for graphic tablet devices">111An object that provides access to the graphics tablets available on this
112system. All tablets are associated with a seat, to get access to the
113actual tablets, use wp_tablet_manager.get_tablet_seat.
114</description>115
116<request name="get_tablet_seat">117<description summary="get the tablet seat">118Get the wp_tablet_seat object for the given seat. This object
119provides access to all graphics tablets in this seat.
120</description>121<arg name="tablet_seat" type="new_id" interface="zwp_tablet_seat_v2"/>122<arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the tablets for" />123</request>124
125<request name="destroy" type="destructor">126<description summary="release the memory for the tablet manager object">127Destroy the wp_tablet_manager object. Objects created from this
128object are unaffected and should be destroyed separately.
129</description>130</request>131</interface>132
133<interface name="zwp_tablet_seat_v2" version="1">134<description summary="controller object for graphic tablet devices of a seat">135An object that provides access to the graphics tablets available on this
136seat. After binding to this interface, the compositor sends a set of
137wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events.
138</description>139
140<request name="destroy" type="destructor">141<description summary="release the memory for the tablet seat object">142Destroy the wp_tablet_seat object. Objects created from this
143object are unaffected and should be destroyed separately.
144</description>145</request>146
147<event name="tablet_added">148<description summary="new device notification">149This event is sent whenever a new tablet becomes available on this
150seat. This event only provides the object id of the tablet, any
151static information about the tablet (device name, vid/pid, etc.) is
152sent through the wp_tablet interface.
153</description>154<arg name="id" type="new_id" interface="zwp_tablet_v2" summary="the newly added graphics tablet"/>155</event>156
157<event name="tool_added">158<description summary="a new tool has been used with a tablet">159This event is sent whenever a tool that has not previously been used
160with a tablet comes into use. This event only provides the object id
161of the tool; any static information about the tool (capabilities,
162type, etc.) is sent through the wp_tablet_tool interface.
163</description>164<arg name="id" type="new_id" interface="zwp_tablet_tool_v2" summary="the newly added tablet tool"/>165</event>166
167<event name="pad_added">168<description summary="new pad notification">169This event is sent whenever a new pad is known to the system. Typically,
170pads are physically attached to tablets and a pad_added event is
171sent immediately after the wp_tablet_seat.tablet_added.
172However, some standalone pad devices logically attach to tablets at
173runtime, and the client must wait for wp_tablet_pad.enter to know
174the tablet a pad is attached to.
175
176This event only provides the object id of the pad. All further
177features (buttons, strips, rings) are sent through the wp_tablet_pad
178interface.
179</description>180<arg name="id" type="new_id" interface="zwp_tablet_pad_v2" summary="the newly added pad"/>181</event>182</interface>183
184<interface name="zwp_tablet_tool_v2" version="1">185<description summary="a physical tablet tool">186An object that represents a physical tool that has been, or is
187currently in use with a tablet in this seat. Each wp_tablet_tool
188object stays valid until the client destroys it; the compositor
189reuses the wp_tablet_tool object to indicate that the object's
190respective physical tool has come into proximity of a tablet again.
191
192A wp_tablet_tool object's relation to a physical tool depends on the
193tablet's ability to report serial numbers. If the tablet supports
194this capability, then the object represents a specific physical tool
195and can be identified even when used on multiple tablets.
196
197A tablet tool has a number of static characteristics, e.g. tool type,
198hardware_serial and capabilities. These capabilities are sent in an
199event sequence after the wp_tablet_seat.tool_added event before any
200actual events from this tool. This initial event sequence is
201terminated by a wp_tablet_tool.done event.
202
203Tablet tool events are grouped by wp_tablet_tool.frame events.
204Any events received before a wp_tablet_tool.frame event should be
205considered part of the same hardware state change.
206</description>207
208<request name="set_cursor">209<description summary="set the tablet tool's surface">210Sets the surface of the cursor used for this tool on the given
211tablet. This request only takes effect if the tool is in proximity
212of one of the requesting client's surfaces or the surface parameter
213is the current pointer surface. If there was a previous surface set
214with this request it is replaced. If surface is NULL, the cursor
215image is hidden.
216
217The parameters hotspot_x and hotspot_y define the position of the
218pointer surface relative to the pointer location. Its top-left corner
219is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the
220coordinates of the pointer location, in surface-local coordinates.
221
222On surface.attach requests to the pointer surface, hotspot_x and
223hotspot_y are decremented by the x and y parameters passed to the
224request. Attach must be confirmed by wl_surface.commit as usual.
225
226The hotspot can also be updated by passing the currently set pointer
227surface to this request with new values for hotspot_x and hotspot_y.
228
229The current and pending input regions of the wl_surface are cleared,
230and wl_surface.set_input_region is ignored until the wl_surface is no
231longer used as the cursor. When the use as a cursor ends, the current
232and pending input regions become undefined, and the wl_surface is
233unmapped.
234
235This request gives the surface the role of a wp_tablet_tool cursor. A
236surface may only ever be used as the cursor surface for one
237wp_tablet_tool. If the surface already has another role or has
238previously been used as cursor surface for a different tool, a
239protocol error is raised.
240</description>241<arg name="serial" type="uint" summary="serial of the proximity_in event"/>242<arg name="surface" type="object" interface="wl_surface" allow-null="true"/>243<arg name="hotspot_x" type="int" summary="surface-local x coordinate"/>244<arg name="hotspot_y" type="int" summary="surface-local y coordinate"/>245</request>246
247<request name="destroy" type="destructor">248<description summary="destroy the tool object">249This destroys the client's resource for this tool object.
250</description>251</request>252
253<enum name="type">254<description summary="a physical tool type">255Describes the physical type of a tool. The physical type of a tool
256generally defines its base usage.
257
258The mouse tool represents a mouse-shaped tool that is not a relative
259device but bound to the tablet's surface, providing absolute
260coordinates.
261
262The lens tool is a mouse-shaped tool with an attached lens to
263provide precision focus.
264</description>265<entry name="pen" value="0x140" summary="Pen"/>266<entry name="eraser" value="0x141" summary="Eraser"/>267<entry name="brush" value="0x142" summary="Brush"/>268<entry name="pencil" value="0x143" summary="Pencil"/>269<entry name="airbrush" value="0x144" summary="Airbrush"/>270<entry name="finger" value="0x145" summary="Finger"/>271<entry name="mouse" value="0x146" summary="Mouse"/>272<entry name="lens" value="0x147" summary="Lens"/>273</enum>274
275<event name="type">276<description summary="tool type">277The tool type is the high-level type of the tool and usually decides
278the interaction expected from this tool.
279
280This event is sent in the initial burst of events before the
281wp_tablet_tool.done event.
282</description>283<arg name="tool_type" type="uint" enum="type" summary="the physical tool type"/>284</event>285
286<event name="hardware_serial">287<description summary="unique hardware serial number of the tool">288If the physical tool can be identified by a unique 64-bit serial
289number, this event notifies the client of this serial number.
290
291If multiple tablets are available in the same seat and the tool is
292uniquely identifiable by the serial number, that tool may move
293between tablets.
294
295Otherwise, if the tool has no serial number and this event is
296missing, the tool is tied to the tablet it first comes into
297proximity with. Even if the physical tool is used on multiple
298tablets, separate wp_tablet_tool objects will be created, one per
299tablet.
300
301This event is sent in the initial burst of events before the
302wp_tablet_tool.done event.
303</description>304<arg name="hardware_serial_hi" type="uint" summary="the unique serial number of the tool, most significant bits"/>305<arg name="hardware_serial_lo" type="uint" summary="the unique serial number of the tool, least significant bits"/>306</event>307
308<event name="hardware_id_wacom">309<description summary="hardware id notification in Wacom's format">310This event notifies the client of a hardware id available on this tool.
311
312The hardware id is a device-specific 64-bit id that provides extra
313information about the tool in use, beyond the wl_tool.type
314enumeration. The format of the id is specific to tablets made by
315Wacom Inc. For example, the hardware id of a Wacom Grip
316Pen (a stylus) is 0x802.
317
318This event is sent in the initial burst of events before the
319wp_tablet_tool.done event.
320</description>321<arg name="hardware_id_hi" type="uint" summary="the hardware id, most significant bits"/>322<arg name="hardware_id_lo" type="uint" summary="the hardware id, least significant bits"/>323</event>324
325<enum name="capability">326<description summary="capability flags for a tool">327Describes extra capabilities on a tablet.
328
329Any tool must provide x and y values, extra axes are
330device-specific.
331</description>332<entry name="tilt" value="1" summary="Tilt axes"/>333<entry name="pressure" value="2" summary="Pressure axis"/>334<entry name="distance" value="3" summary="Distance axis"/>335<entry name="rotation" value="4" summary="Z-rotation axis"/>336<entry name="slider" value="5" summary="Slider axis"/>337<entry name="wheel" value="6" summary="Wheel axis"/>338</enum>339
340<event name="capability">341<description summary="tool capability notification">342This event notifies the client of any capabilities of this tool,
343beyond the main set of x/y axes and tip up/down detection.
344
345One event is sent for each extra capability available on this tool.
346
347This event is sent in the initial burst of events before the
348wp_tablet_tool.done event.
349</description>350<arg name="capability" type="uint" enum="capability" summary="the capability"/>351</event>352
353<event name="done">354<description summary="tool description events sequence complete">355This event signals the end of the initial burst of descriptive
356events. A client may consider the static description of the tool to
357be complete and finalize initialization of the tool.
358</description>359</event>360
361<event name="removed">362<description summary="tool removed">363This event is sent when the tool is removed from the system and will
364send no further events. Should the physical tool come back into
365proximity later, a new wp_tablet_tool object will be created.
366
367It is compositor-dependent when a tool is removed. A compositor may
368remove a tool on proximity out, tablet removal or any other reason.
369A compositor may also keep a tool alive until shutdown.
370
371If the tool is currently in proximity, a proximity_out event will be
372sent before the removed event. See wp_tablet_tool.proximity_out for
373the handling of any buttons logically down.
374
375When this event is received, the client must wp_tablet_tool.destroy
376the object.
377</description>378</event>379
380<event name="proximity_in">381<description summary="proximity in event">382Notification that this tool is focused on a certain surface.
383
384This event can be received when the tool has moved from one surface to
385another, or when the tool has come back into proximity above the
386surface.
387
388If any button is logically down when the tool comes into proximity,
389the respective button event is sent after the proximity_in event but
390within the same frame as the proximity_in event.
391</description>392<arg name="serial" type="uint"/>393<arg name="tablet" type="object" interface="zwp_tablet_v2" summary="The tablet the tool is in proximity of"/>394<arg name="surface" type="object" interface="wl_surface" summary="The current surface the tablet tool is over"/>395</event>396
397<event name="proximity_out">398<description summary="proximity out event">399Notification that this tool has either left proximity, or is no
400longer focused on a certain surface.
401
402When the tablet tool leaves proximity of the tablet, button release
403events are sent for each button that was held down at the time of
404leaving proximity. These events are sent before the proximity_out
405event but within the same wp_tablet.frame.
406
407If the tool stays within proximity of the tablet, but the focus
408changes from one surface to another, a button release event may not
409be sent until the button is actually released or the tool leaves the
410proximity of the tablet.
411</description>412</event>413
414<event name="down">415<description summary="tablet tool is making contact">416Sent whenever the tablet tool comes in contact with the surface of the
417tablet.
418
419If the tool is already in contact with the tablet when entering the
420input region, the client owning said region will receive a
421wp_tablet.proximity_in event, followed by a wp_tablet.down
422event and a wp_tablet.frame event.
423
424Note that this event describes logical contact, not physical
425contact. On some devices, a compositor may not consider a tool in
426logical contact until a minimum physical pressure threshold is
427exceeded.
428</description>429<arg name="serial" type="uint"/>430</event>431
432<event name="up">433<description summary="tablet tool is no longer making contact">434Sent whenever the tablet tool stops making contact with the surface of
435the tablet, or when the tablet tool moves out of the input region
436and the compositor grab (if any) is dismissed.
437
438If the tablet tool moves out of the input region while in contact
439with the surface of the tablet and the compositor does not have an
440ongoing grab on the surface, the client owning said region will
441receive a wp_tablet.up event, followed by a wp_tablet.proximity_out
442event and a wp_tablet.frame event. If the compositor has an ongoing
443grab on this device, this event sequence is sent whenever the grab
444is dismissed in the future.
445
446Note that this event describes logical contact, not physical
447contact. On some devices, a compositor may not consider a tool out
448of logical contact until physical pressure falls below a specific
449threshold.
450</description>451</event>452
453<event name="motion">454<description summary="motion event">455Sent whenever a tablet tool moves.
456</description>457<arg name="x" type="fixed" summary="surface-local x coordinate"/>458<arg name="y" type="fixed" summary="surface-local y coordinate"/>459</event>460
461<event name="pressure">462<description summary="pressure change event">463Sent whenever the pressure axis on a tool changes. The value of this
464event is normalized to a value between 0 and 65535.
465
466Note that pressure may be nonzero even when a tool is not in logical
467contact. See the down and up events for more details.
468</description>469<arg name="pressure" type="uint" summary="The current pressure value"/>470</event>471
472<event name="distance">473<description summary="distance change event">474Sent whenever the distance axis on a tool changes. The value of this
475event is normalized to a value between 0 and 65535.
476
477Note that distance may be nonzero even when a tool is not in logical
478contact. See the down and up events for more details.
479</description>480<arg name="distance" type="uint" summary="The current distance value"/>481</event>482
483<event name="tilt">484<description summary="tilt change event">485Sent whenever one or both of the tilt axes on a tool change. Each tilt
486value is in degrees, relative to the z-axis of the tablet.
487The angle is positive when the top of a tool tilts along the
488positive x or y axis.
489</description>490<arg name="tilt_x" type="fixed" summary="The current value of the X tilt axis"/>491<arg name="tilt_y" type="fixed" summary="The current value of the Y tilt axis"/>492</event>493
494<event name="rotation">495<description summary="z-rotation change event">496Sent whenever the z-rotation axis on the tool changes. The
497rotation value is in degrees clockwise from the tool's
498logical neutral position.
499</description>500<arg name="degrees" type="fixed" summary="The current rotation of the Z axis"/>501</event>502
503<event name="slider">504<description summary="Slider position change event">505Sent whenever the slider position on the tool changes. The
506value is normalized between -65535 and 65535, with 0 as the logical
507neutral position of the slider.
508
509The slider is available on e.g. the Wacom Airbrush tool.
510</description>511<arg name="position" type="int" summary="The current position of slider"/>512</event>513
514<event name="wheel">515<description summary="Wheel delta event">516Sent whenever the wheel on the tool emits an event. This event
517contains two values for the same axis change. The degrees value is
518in the same orientation as the wl_pointer.vertical_scroll axis. The
519clicks value is in discrete logical clicks of the mouse wheel. This
520value may be zero if the movement of the wheel was less
521than one logical click.
522
523Clients should choose either value and avoid mixing degrees and
524clicks. The compositor may accumulate values smaller than a logical
525click and emulate click events when a certain threshold is met.
526Thus, wl_tablet_tool.wheel events with non-zero clicks values may
527have different degrees values.
528</description>529<arg name="degrees" type="fixed" summary="The wheel delta in degrees"/>530<arg name="clicks" type="int" summary="The wheel delta in discrete clicks"/>531</event>532
533<enum name="button_state">534<description summary="physical button state">535Describes the physical state of a button that produced the button event.
536</description>537<entry name="released" value="0" summary="button is not pressed"/>538<entry name="pressed" value="1" summary="button is pressed"/>539</enum>540
541<event name="button">542<description summary="button event">543Sent whenever a button on the tool is pressed or released.
544
545If a button is held down when the tool moves in or out of proximity,
546button events are generated by the compositor. See
547wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
548details.
549</description>550<arg name="serial" type="uint"/>551<arg name="button" type="uint" summary="The button whose state has changed"/>552<arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/>553</event>554
555<event name="frame">556<description summary="frame event">557Marks the end of a series of axis and/or button updates from the
558tablet. The Wayland protocol requires axis updates to be sent
559sequentially, however all events within a frame should be considered
560one hardware event.
561</description>562<arg name="time" type="uint" summary="The time of the event with millisecond granularity"/>563</event>564
565<enum name="error">566<entry name="role" value="0" summary="given wl_surface has another role"/>567</enum>568</interface>569
570<interface name="zwp_tablet_v2" version="1">571<description summary="graphics tablet device">572The wp_tablet interface represents one graphics tablet device. The
573tablet interface itself does not generate events; all events are
574generated by wp_tablet_tool objects when in proximity above a tablet.
575
576A tablet has a number of static characteristics, e.g. device name and
577pid/vid. These capabilities are sent in an event sequence after the
578wp_tablet_seat.tablet_added event. This initial event sequence is
579terminated by a wp_tablet.done event.
580</description>581
582<request name="destroy" type="destructor">583<description summary="destroy the tablet object">584This destroys the client's resource for this tablet object.
585</description>586</request>587
588<event name="name">589<description summary="tablet device name">590A descriptive name for the tablet device.
591
592If the device has no descriptive name, this event is not sent.
593
594This event is sent in the initial burst of events before the
595wp_tablet.done event.
596</description>597<arg name="name" type="string" summary="the device name"/>598</event>599
600<event name="id">601<description summary="tablet device USB vendor/product id">602The USB vendor and product IDs for the tablet device.
603
604If the device has no USB vendor/product ID, this event is not sent.
605This can happen for virtual devices or non-USB devices, for instance.
606
607This event is sent in the initial burst of events before the
608wp_tablet.done event.
609</description>610<arg name="vid" type="uint" summary="USB vendor id"/>611<arg name="pid" type="uint" summary="USB product id"/>612</event>613
614<event name="path">615<description summary="path to the device">616A system-specific device path that indicates which device is behind
617this wp_tablet. This information may be used to gather additional
618information about the device, e.g. through libwacom.
619
620A device may have more than one device path. If so, multiple
621wp_tablet.path events are sent. A device may be emulated and not
622have a device path, and in that case this event will not be sent.
623
624The format of the path is unspecified, it may be a device node, a
625sysfs path, or some other identifier. It is up to the client to
626identify the string provided.
627
628This event is sent in the initial burst of events before the
629wp_tablet.done event.
630</description>631<arg name="path" type="string" summary="path to local device"/>632</event>633
634<event name="done">635<description summary="tablet description events sequence complete">636This event is sent immediately to signal the end of the initial
637burst of descriptive events. A client may consider the static
638description of the tablet to be complete and finalize initialization
639of the tablet.
640</description>641</event>642
643<event name="removed">644<description summary="tablet removed event">645Sent when the tablet has been removed from the system. When a tablet
646is removed, some tools may be removed.
647
648When this event is received, the client must wp_tablet.destroy
649the object.
650</description>651</event>652</interface>653
654<interface name="zwp_tablet_pad_ring_v2" version="1">655<description summary="pad ring">656A circular interaction area, such as the touch ring on the Wacom Intuos
657Pro series tablets.
658
659Events on a ring are logically grouped by the wl_tablet_pad_ring.frame
660event.
661</description>662
663<request name="set_feedback">664<description summary="set compositor feedback">665Request that the compositor use the provided feedback string
666associated with this ring. This request should be issued immediately
667after a wp_tablet_pad_group.mode_switch event from the corresponding
668group is received, or whenever the ring is mapped to a different
669action. See wp_tablet_pad_group.mode_switch for more details.
670
671Clients are encouraged to provide context-aware descriptions for
672the actions associated with the ring; compositors may use this
673information to offer visual feedback about the button layout
674(eg. on-screen displays).
675
676The provided string 'description' is a UTF-8 encoded string to be
677associated with this ring, and is considered user-visible; general
678internationalization rules apply.
679
680The serial argument will be that of the last
681wp_tablet_pad_group.mode_switch event received for the group of this
682ring. Requests providing other serials than the most recent one will be
683ignored.
684</description>685<arg name="description" type="string" summary="ring description"/>686<arg name="serial" type="uint" summary="serial of the mode switch event"/>687</request>688
689<request name="destroy" type="destructor">690<description summary="destroy the ring object">691This destroys the client's resource for this ring object.
692</description>693</request>694
695<enum name="source">696<description summary="ring axis source">697Describes the source types for ring events. This indicates to the
698client how a ring event was physically generated; a client may
699adjust the user interface accordingly. For example, events
700from a "finger" source may trigger kinetic scrolling.
701</description>702<entry name="finger" value="1" summary="finger"/>703</enum>704
705<event name="source">706<description summary="ring event source">707Source information for ring events.
708
709This event does not occur on its own. It is sent before a
710wp_tablet_pad_ring.frame event and carries the source information
711for all events within that frame.
712
713The source specifies how this event was generated. If the source is
714wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event
715will be sent when the user lifts the finger off the device.
716
717This event is optional. If the source is unknown for an interaction,
718no event is sent.
719</description>720<arg name="source" type="uint" enum="source" summary="the event source"/>721</event>722
723<event name="angle">724<description summary="angle changed">725Sent whenever the angle on a ring changes.
726
727The angle is provided in degrees clockwise from the logical
728north of the ring in the pad's current rotation.
729</description>730<arg name="degrees" type="fixed" summary="the current angle in degrees"/>731</event>732
733<event name="stop">734<description summary="interaction stopped">735Stop notification for ring events.
736
737For some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop
738event is sent to notify a client that the interaction with the ring
739has terminated. This enables the client to implement kinetic scrolling.
740See the wp_tablet_pad_ring.source documentation for information on
741when this event may be generated.
742
743Any wp_tablet_pad_ring.angle events with the same source after this
744event should be considered as the start of a new interaction.
745</description>746</event>747
748<event name="frame">749<description summary="end of a ring event sequence">750Indicates the end of a set of ring events that logically belong
751together. A client is expected to accumulate the data in all events
752within the frame before proceeding.
753
754All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong
755logically together. For example, on termination of a finger interaction
756on a ring the compositor will send a wp_tablet_pad_ring.source event,
757a wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event.
758
759A wp_tablet_pad_ring.frame event is sent for every logical event
760group, even if the group only contains a single wp_tablet_pad_ring
761event. Specifically, a client may get a sequence: angle, frame,
762angle, frame, etc.
763</description>764<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>765</event>766</interface>767
768<interface name="zwp_tablet_pad_strip_v2" version="1">769<description summary="pad strip">770A linear interaction area, such as the strips found in Wacom Cintiq
771models.
772
773Events on a strip are logically grouped by the wl_tablet_pad_strip.frame
774event.
775</description>776
777<request name="set_feedback">778<description summary="set compositor feedback">779Requests the compositor to use the provided feedback string
780associated with this strip. This request should be issued immediately
781after a wp_tablet_pad_group.mode_switch event from the corresponding
782group is received, or whenever the strip is mapped to a different
783action. See wp_tablet_pad_group.mode_switch for more details.
784
785Clients are encouraged to provide context-aware descriptions for
786the actions associated with the strip, and compositors may use this
787information to offer visual feedback about the button layout
788(eg. on-screen displays).
789
790The provided string 'description' is a UTF-8 encoded string to be
791associated with this ring, and is considered user-visible; general
792internationalization rules apply.
793
794The serial argument will be that of the last
795wp_tablet_pad_group.mode_switch event received for the group of this
796strip. Requests providing other serials than the most recent one will be
797ignored.
798</description>799<arg name="description" type="string" summary="strip description"/>800<arg name="serial" type="uint" summary="serial of the mode switch event"/>801</request>802
803<request name="destroy" type="destructor">804<description summary="destroy the strip object">805This destroys the client's resource for this strip object.
806</description>807</request>808
809<enum name="source">810<description summary="strip axis source">811Describes the source types for strip events. This indicates to the
812client how a strip event was physically generated; a client may
813adjust the user interface accordingly. For example, events
814from a "finger" source may trigger kinetic scrolling.
815</description>816<entry name="finger" value="1" summary="finger"/>817</enum>818
819<event name="source">820<description summary="strip event source">821Source information for strip events.
822
823This event does not occur on its own. It is sent before a
824wp_tablet_pad_strip.frame event and carries the source information
825for all events within that frame.
826
827The source specifies how this event was generated. If the source is
828wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event
829will be sent when the user lifts their finger off the device.
830
831This event is optional. If the source is unknown for an interaction,
832no event is sent.
833</description>834<arg name="source" type="uint" enum="source" summary="the event source"/>835</event>836
837<event name="position">838<description summary="position changed">839Sent whenever the position on a strip changes.
840
841The position is normalized to a range of [0, 65535], the 0-value
842represents the top-most and/or left-most position of the strip in
843the pad's current rotation.
844</description>845<arg name="position" type="uint" summary="the current position"/>846</event>847
848<event name="stop">849<description summary="interaction stopped">850Stop notification for strip events.
851
852For some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop
853event is sent to notify a client that the interaction with the strip
854has terminated. This enables the client to implement kinetic
855scrolling. See the wp_tablet_pad_strip.source documentation for
856information on when this event may be generated.
857
858Any wp_tablet_pad_strip.position events with the same source after this
859event should be considered as the start of a new interaction.
860</description>861</event>862
863<event name="frame">864<description summary="end of a strip event sequence">865Indicates the end of a set of events that represent one logical
866hardware strip event. A client is expected to accumulate the data
867in all events within the frame before proceeding.
868
869All wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong
870logically together. For example, on termination of a finger interaction
871on a strip the compositor will send a wp_tablet_pad_strip.source event,
872a wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame
873event.
874
875A wp_tablet_pad_strip.frame event is sent for every logical event
876group, even if the group only contains a single wp_tablet_pad_strip
877event. Specifically, a client may get a sequence: position, frame,
878position, frame, etc.
879</description>880<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>881</event>882</interface>883
884<interface name="zwp_tablet_pad_group_v2" version="1">885<description summary="a set of buttons, rings and strips">886A pad group describes a distinct (sub)set of buttons, rings and strips
887present in the tablet. The criteria of this grouping is usually positional,
888eg. if a tablet has buttons on the left and right side, 2 groups will be
889presented. The physical arrangement of groups is undisclosed and may
890change on the fly.
891
892Pad groups will announce their features during pad initialization. Between
893the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the
894pad group will announce the buttons, rings and strips contained in it,
895plus the number of supported modes.
896
897Modes are a mechanism to allow multiple groups of actions for every element
898in the pad group. The number of groups and available modes in each is
899persistent across device plugs. The current mode is user-switchable, it
900will be announced through the wp_tablet_pad_group.mode_switch event both
901whenever it is switched, and after wp_tablet_pad.enter.
902
903The current mode logically applies to all elements in the pad group,
904although it is at clients' discretion whether to actually perform different
905actions, and/or issue the respective .set_feedback requests to notify the
906compositor. See the wp_tablet_pad_group.mode_switch event for more details.
907</description>908
909<request name="destroy" type="destructor">910<description summary="destroy the pad object">911Destroy the wp_tablet_pad_group object. Objects created from this object
912are unaffected and should be destroyed separately.
913</description>914</request>915
916<event name="buttons">917<description summary="buttons announced">918Sent on wp_tablet_pad_group initialization to announce the available
919buttons in the group. Button indices start at 0, a button may only be
920in one group at a time.
921
922This event is first sent in the initial burst of events before the
923wp_tablet_pad_group.done event.
924
925Some buttons are reserved by the compositor. These buttons may not be
926assigned to any wp_tablet_pad_group. Compositors may broadcast this
927event in the case of changes to the mapping of these reserved buttons.
928If the compositor happens to reserve all buttons in a group, this event
929will be sent with an empty array.
930</description>931<arg name="buttons" type="array" summary="buttons in this group"/>932</event>933
934<event name="ring">935<description summary="ring announced">936Sent on wp_tablet_pad_group initialization to announce available rings.
937One event is sent for each ring available on this pad group.
938
939This event is sent in the initial burst of events before the
940wp_tablet_pad_group.done event.
941</description>942<arg name="ring" type="new_id" interface="zwp_tablet_pad_ring_v2"/>943</event>944
945<event name="strip">946<description summary="strip announced">947Sent on wp_tablet_pad initialization to announce available strips.
948One event is sent for each strip available on this pad group.
949
950This event is sent in the initial burst of events before the
951wp_tablet_pad_group.done event.
952</description>953<arg name="strip" type="new_id" interface="zwp_tablet_pad_strip_v2"/>954</event>955
956<event name="modes">957<description summary="mode-switch ability announced">958Sent on wp_tablet_pad_group initialization to announce that the pad
959group may switch between modes. A client may use a mode to store a
960specific configuration for buttons, rings and strips and use the
961wl_tablet_pad_group.mode_switch event to toggle between these
962configurations. Mode indices start at 0.
963
964Switching modes is compositor-dependent. See the
965wp_tablet_pad_group.mode_switch event for more details.
966
967This event is sent in the initial burst of events before the
968wp_tablet_pad_group.done event. This event is only sent when more than
969more than one mode is available.
970</description>971<arg name="modes" type="uint" summary="the number of modes"/>972</event>973
974<event name="done">975<description summary="tablet group description events sequence complete">976This event is sent immediately to signal the end of the initial
977burst of descriptive events. A client may consider the static
978description of the tablet to be complete and finalize initialization
979of the tablet group.
980</description>981</event>982
983<event name="mode_switch">984<description summary="mode switch event">985Notification that the mode was switched.
986
987A mode applies to all buttons, rings and strips in a group
988simultaneously, but a client is not required to assign different actions
989for each mode. For example, a client may have mode-specific button
990mappings but map the ring to vertical scrolling in all modes. Mode
991indices start at 0.
992
993Switching modes is compositor-dependent. The compositor may provide
994visual cues to the client about the mode, e.g. by toggling LEDs on
995the tablet device. Mode-switching may be software-controlled or
996controlled by one or more physical buttons. For example, on a Wacom
997Intuos Pro, the button inside the ring may be assigned to switch
998between modes.
999
1000The compositor will also send this event after wp_tablet_pad.enter on
1001each group in order to notify of the current mode. Groups that only
1002feature one mode will use mode=0 when emitting this event.
1003
1004If a button action in the new mode differs from the action in the
1005previous mode, the client should immediately issue a
1006wp_tablet_pad.set_feedback request for each changed button.
1007
1008If a ring or strip action in the new mode differs from the action
1009in the previous mode, the client should immediately issue a
1010wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request
1011for each changed ring or strip.
1012</description>1013<arg name="time" type="uint" summary="the time of the event with millisecond granularity"/>1014<arg name="serial" type="uint"/>1015<arg name="mode" type="uint" summary="the new mode of the pad"/>1016</event>1017</interface>1018
1019<interface name="zwp_tablet_pad_v2" version="1">1020<description summary="a set of buttons, rings and strips">1021A pad device is a set of buttons, rings and strips
1022usually physically present on the tablet device itself. Some
1023exceptions exist where the pad device is physically detached, e.g. the
1024Wacom ExpressKey Remote.
1025
1026Pad devices have no axes that control the cursor and are generally
1027auxiliary devices to the tool devices used on the tablet surface.
1028
1029A pad device has a number of static characteristics, e.g. the number
1030of rings. These capabilities are sent in an event sequence after the
1031wp_tablet_seat.pad_added event before any actual events from this pad.
1032This initial event sequence is terminated by a wp_tablet_pad.done
1033event.
1034
1035All pad features (buttons, rings and strips) are logically divided into
1036groups and all pads have at least one group. The available groups are
1037notified through the wp_tablet_pad.group event; the compositor will
1038emit one event per group before emitting wp_tablet_pad.done.
1039
1040Groups may have multiple modes. Modes allow clients to map multiple
1041actions to a single pad feature. Only one mode can be active per group,
1042although different groups may have different active modes.
1043</description>1044
1045<request name="set_feedback">1046<description summary="set compositor feedback">1047Requests the compositor to use the provided feedback string
1048associated with this button. This request should be issued immediately
1049after a wp_tablet_pad_group.mode_switch event from the corresponding
1050group is received, or whenever a button is mapped to a different
1051action. See wp_tablet_pad_group.mode_switch for more details.
1052
1053Clients are encouraged to provide context-aware descriptions for
1054the actions associated with each button, and compositors may use
1055this information to offer visual feedback on the button layout
1056(e.g. on-screen displays).
1057
1058Button indices start at 0. Setting the feedback string on a button
1059that is reserved by the compositor (i.e. not belonging to any
1060wp_tablet_pad_group) does not generate an error but the compositor
1061is free to ignore the request.
1062
1063The provided string 'description' is a UTF-8 encoded string to be
1064associated with this ring, and is considered user-visible; general
1065internationalization rules apply.
1066
1067The serial argument will be that of the last
1068wp_tablet_pad_group.mode_switch event received for the group of this
1069button. Requests providing other serials than the most recent one will
1070be ignored.
1071</description>1072<arg name="button" type="uint" summary="button index"/>1073<arg name="description" type="string" summary="button description"/>1074<arg name="serial" type="uint" summary="serial of the mode switch event"/>1075</request>1076
1077<request name="destroy" type="destructor">1078<description summary="destroy the pad object">1079Destroy the wp_tablet_pad object. Objects created from this object
1080are unaffected and should be destroyed separately.
1081</description>1082</request>1083
1084<event name="group">1085<description summary="group announced">1086Sent on wp_tablet_pad initialization to announce available groups.
1087One event is sent for each pad group available.
1088
1089This event is sent in the initial burst of events before the
1090wp_tablet_pad.done event. At least one group will be announced.
1091</description>1092<arg name="pad_group" type="new_id" interface="zwp_tablet_pad_group_v2"/>1093</event>1094
1095<event name="path">1096<description summary="path to the device">1097A system-specific device path that indicates which device is behind
1098this wp_tablet_pad. This information may be used to gather additional
1099information about the device, e.g. through libwacom.
1100
1101The format of the path is unspecified, it may be a device node, a
1102sysfs path, or some other identifier. It is up to the client to
1103identify the string provided.
1104
1105This event is sent in the initial burst of events before the
1106wp_tablet_pad.done event.
1107</description>1108<arg name="path" type="string" summary="path to local device"/>1109</event>1110
1111<event name="buttons">1112<description summary="buttons announced">1113Sent on wp_tablet_pad initialization to announce the available
1114buttons.
1115
1116This event is sent in the initial burst of events before the
1117wp_tablet_pad.done event. This event is only sent when at least one
1118button is available.
1119</description>1120<arg name="buttons" type="uint" summary="the number of buttons"/>1121</event>1122
1123<event name="done">1124<description summary="pad description event sequence complete">1125This event signals the end of the initial burst of descriptive
1126events. A client may consider the static description of the pad to
1127be complete and finalize initialization of the pad.
1128</description>1129</event>1130
1131<enum name="button_state">1132<description summary="physical button state">1133Describes the physical state of a button that caused the button
1134event.
1135</description>1136<entry name="released" value="0" summary="the button is not pressed"/>1137<entry name="pressed" value="1" summary="the button is pressed"/>1138</enum>1139
1140<event name="button">1141<description summary="physical button state">1142Sent whenever the physical state of a button changes.
1143</description>1144<arg name="time" type="uint" summary="the time of the event with millisecond granularity"/>1145<arg name="button" type="uint" summary="the index of the button that changed state"/>1146<arg name="state" type="uint" enum="button_state"/>1147</event>1148
1149<event name="enter">1150<description summary="enter event">1151Notification that this pad is focused on the specified surface.
1152</description>1153<arg name="serial" type="uint" summary="serial number of the enter event"/>1154<arg name="tablet" type="object" interface="zwp_tablet_v2" summary="the tablet the pad is attached to"/>1155<arg name="surface" type="object" interface="wl_surface" summary="surface the pad is focused on"/>1156</event>1157
1158<event name="leave">1159<description summary="leave event">1160Notification that this pad is no longer focused on the specified
1161surface.
1162</description>1163<arg name="serial" type="uint" summary="serial number of the leave event"/>1164<arg name="surface" type="object" interface="wl_surface" summary="surface the pad is no longer focused on"/>1165</event>1166
1167<event name="removed">1168<description summary="pad removed event">1169Sent when the pad has been removed from the system. When a tablet
1170is removed its pad(s) will be removed too.
1171
1172When this event is received, the client must destroy all rings, strips
1173and groups that were offered by this pad, and issue wp_tablet_pad.destroy
1174the pad itself.
1175</description>1176</event>1177</interface>1178</protocol>1179