Skip to content

Commit 4c28436

Browse files
authored
Merge pull request #38 from talex5/update-protocols
Update protocols
2 parents b273229 + 1a9ea56 commit 4c28436

File tree

6 files changed

+217
-68
lines changed

6 files changed

+217
-68
lines changed

example/test.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ let main ~net =
7474
inherit [_] Wl_surface.v1
7575
method on_enter _ ~output:_ = ()
7676
method on_leave _ ~output:_ = ()
77+
method on_preferred_buffer_scale _ ~factor:_ = ()
78+
method on_preferred_buffer_transform _ ~transform:_ = ()
7779
end
7880
in
7981
let seat = Registry.bind reg @@ object
@@ -111,6 +113,7 @@ let main ~net =
111113
method on_frame _ = ()
112114
method on_axis_stop _ ~time:_ ~axis:_ = ()
113115
method on_axis_value120 _ ~axis:_ ~value120:_ = ()
116+
method on_axis_relative_direction _ ~axis:_ ~direction:_ = ()
114117
end
115118
in
116119
let configured, set_configured = Promise.create () in

lib/wayland.xml

Lines changed: 149 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
</event>
191191
</interface>
192192

193-
<interface name="wl_compositor" version="5">
193+
<interface name="wl_compositor" version="6">
194194
<description summary="the compositor singleton">
195195
A compositor. This object is a singleton global. The
196196
compositor is in charge of combining the contents of multiple
@@ -262,11 +262,11 @@
262262
created, but using the new size. This request can only be
263263
used to make the pool bigger.
264264

265-
This request only changes the amount of bytes that are mmapped
266-
by the server and does not touch the file corresponding to the
267-
file descriptor passed at creation time. It is the client's
268-
responsibility to ensure that the file is at least as big as
269-
the new pool size.
265+
This request only changes the amount of bytes that are mmapped
266+
by the server and does not touch the file corresponding to the
267+
file descriptor passed at creation time. It is the client's
268+
responsibility to ensure that the file is at least as big as
269+
the new pool size.
270270
</description>
271271
<arg name="size" type="int" summary="new size of the pool, in bytes"/>
272272
</request>
@@ -419,6 +419,21 @@
419419
<entry name="xbgr16161616" value="0x38344258" summary="[63:0] x:B:G:R 16:16:16:16 little endian"/>
420420
<entry name="argb16161616" value="0x38345241" summary="[63:0] A:R:G:B 16:16:16:16 little endian"/>
421421
<entry name="abgr16161616" value="0x38344241" summary="[63:0] A:B:G:R 16:16:16:16 little endian"/>
422+
<entry name="c1" value="0x20203143" summary="[7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte"/>
423+
<entry name="c2" value="0x20203243" summary="[7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte"/>
424+
<entry name="c4" value="0x20203443" summary="[7:0] C0:C1 4:4 two pixels/byte"/>
425+
<entry name="d1" value="0x20203144" summary="[7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte"/>
426+
<entry name="d2" value="0x20203244" summary="[7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte"/>
427+
<entry name="d4" value="0x20203444" summary="[7:0] D0:D1 4:4 two pixels/byte"/>
428+
<entry name="d8" value="0x20203844" summary="[7:0] D"/>
429+
<entry name="r1" value="0x20203152" summary="[7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte"/>
430+
<entry name="r2" value="0x20203252" summary="[7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte"/>
431+
<entry name="r4" value="0x20203452" summary="[7:0] R0:R1 4:4 two pixels/byte"/>
432+
<entry name="r10" value="0x20303152" summary="[15:0] x:R 6:10 little endian"/>
433+
<entry name="r12" value="0x20323152" summary="[15:0] x:R 4:12 little endian"/>
434+
<entry name="avuy8888" value="0x59555641" summary="[31:0] A:Cr:Cb:Y 8:8:8:8 little endian"/>
435+
<entry name="xvuy8888" value="0x59555658" summary="[31:0] X:Cr:Cb:Y 8:8:8:8 little endian"/>
436+
<entry name="p030" value="0x30333050" summary="2x2 subsampled Cr:Cb plane 10 bits per channel packed"/>
422437
</enum>
423438

424439
<request name="create_pool">
@@ -454,8 +469,8 @@
454469
interface.
455470

456471
If the buffer uses a format that has an alpha channel, the alpha channel
457-
is assumed to be premultiplied in the color channels unless otherwise
458-
specified.
472+
is assumed to be premultiplied in the electrical color channel values
473+
(after transfer function encoding) unless otherwise specified.
459474

460475
Note, because wl_buffer objects are created from multiple independent
461476
factory interfaces, the wl_buffer interface is frozen at version 1.
@@ -630,8 +645,9 @@
630645
<event name="source_actions" since="3">
631646
<description summary="notify the source-side available actions">
632647
This event indicates the actions offered by the data source. It
633-
will be sent right after wl_data_device.enter, or anytime the source
634-
side changes its offered actions through wl_data_source.set_actions.
648+
will be sent immediately after creating the wl_data_offer object,
649+
or anytime the source side changes its offered actions through
650+
wl_data_source.set_actions.
635651
</description>
636652
<arg name="source_actions" type="uint" summary="actions offered by the data source"
637653
enum="wl_data_device_manager.dnd_action"/>
@@ -846,6 +862,7 @@
846862

847863
<enum name="error">
848864
<entry name="role" value="0" summary="given wl_surface has another role"/>
865+
<entry name="used_source" value="1" summary="source has already been used"/>
849866
</enum>
850867

851868
<request name="start_drag">
@@ -873,11 +890,12 @@
873890
a drag-and-drop icon. If the icon surface already has another role,
874891
it raises a protocol error.
875892

876-
The current and pending input regions of the icon wl_surface are
877-
cleared, and wl_surface.set_input_region is ignored until the
878-
wl_surface is no longer used as the icon surface. When the use
879-
as an icon ends, the current and pending input regions become
880-
undefined, and the wl_surface is unmapped.
893+
The input region is ignored for wl_surfaces with the role of a
894+
drag-and-drop icon.
895+
896+
The given source may not be used in any further set_selection or
897+
start_drag requests. Attempting to reuse a previously-used source
898+
may send a used_source error.
881899
</description>
882900
<arg name="source" type="object" interface="wl_data_source" allow-null="true" summary="data source for the eventual transfer"/>
883901
<arg name="origin" type="object" interface="wl_surface" summary="surface where the drag originates"/>
@@ -891,6 +909,10 @@
891909
to the data from the source on behalf of the client.
892910

893911
To unset the selection, set the source to NULL.
912+
913+
The given source may not be used in any further set_selection or
914+
start_drag requests. Attempting to reuse a previously-used source
915+
may send a used_source error.
894916
</description>
895917
<arg name="source" type="object" interface="wl_data_source" allow-null="true" summary="data source for the selection"/>
896918
<arg name="serial" type="uint" summary="serial number of the event that triggered this request"/>
@@ -1358,7 +1380,7 @@
13581380
</event>
13591381
</interface>
13601382

1361-
<interface name="wl_surface" version="5">
1383+
<interface name="wl_surface" version="6">
13621384
<description summary="an onscreen surface">
13631385
A surface is a rectangular area that may be displayed on zero
13641386
or more outputs, and shown any number of times at the compositor's
@@ -1413,7 +1435,7 @@
14131435
<entry name="invalid_size" value="2" summary="buffer size is invalid"/>
14141436
<entry name="invalid_offset" value="3" summary="buffer offset is invalid"/>
14151437
<entry name="defunct_role_object" value="4"
1416-
summary="surface was destroyed before its role object"/>
1438+
summary="surface was destroyed before its role object"/>
14171439
</enum>
14181440

14191441
<request name="destroy" type="destructor">
@@ -1442,7 +1464,8 @@
14421464

14431465
When the bound wl_surface version is 5 or higher, passing any
14441466
non-zero x or y is a protocol violation, and will result in an
1445-
'invalid_offset' error being raised. To achieve equivalent semantics,
1467+
'invalid_offset' error being raised. The x and y arguments are ignored
1468+
and do not change the pending state. To achieve equivalent semantics,
14461469
use wl_surface.offset.
14471470

14481471
Surface contents are double-buffered state, see wl_surface.commit.
@@ -1795,9 +1818,37 @@
17951818
<arg name="x" type="int" summary="surface-local x coordinate"/>
17961819
<arg name="y" type="int" summary="surface-local y coordinate"/>
17971820
</request>
1821+
1822+
<!-- Version 6 additions -->
1823+
1824+
<event name="preferred_buffer_scale" since="6">
1825+
<description summary="preferred buffer scale for the surface">
1826+
This event indicates the preferred buffer scale for this surface. It is
1827+
sent whenever the compositor's preference changes.
1828+
1829+
It is intended that scaling aware clients use this event to scale their
1830+
content and use wl_surface.set_buffer_scale to indicate the scale they
1831+
have rendered with. This allows clients to supply a higher detail
1832+
buffer.
1833+
</description>
1834+
<arg name="factor" type="int" summary="preferred scaling factor"/>
1835+
</event>
1836+
1837+
<event name="preferred_buffer_transform" since="6">
1838+
<description summary="preferred buffer transform for the surface">
1839+
This event indicates the preferred buffer transform for this surface.
1840+
It is sent whenever the compositor's preference changes.
1841+
1842+
It is intended that transform aware clients use this event to apply the
1843+
transform to their content and use wl_surface.set_buffer_transform to
1844+
indicate the transform they have rendered with.
1845+
</description>
1846+
<arg name="transform" type="uint" enum="wl_output.transform"
1847+
summary="preferred transform"/>
1848+
</event>
17981849
</interface>
17991850

1800-
<interface name="wl_seat" version="8">
1851+
<interface name="wl_seat" version="9">
18011852
<description summary="group of input devices">
18021853
A seat is a group of keyboards, pointer and touch devices. This
18031854
object is published as a global during start up, or when such a
@@ -1930,7 +1981,7 @@
19301981

19311982
</interface>
19321983

1933-
<interface name="wl_pointer" version="8">
1984+
<interface name="wl_pointer" version="9">
19341985
<description summary="pointer input device">
19351986
The wl_pointer interface represents one or more input devices,
19361987
such as mice, which control the pointer location and pointer_focus
@@ -1965,20 +2016,18 @@
19652016
where (x, y) are the coordinates of the pointer location, in
19662017
surface-local coordinates.
19672018

1968-
On surface.attach requests to the pointer surface, hotspot_x
2019+
On wl_surface.offset requests to the pointer surface, hotspot_x
19692020
and hotspot_y are decremented by the x and y parameters
1970-
passed to the request. Attach must be confirmed by
2021+
passed to the request. The offset must be applied by
19712022
wl_surface.commit as usual.
19722023

19732024
The hotspot can also be updated by passing the currently set
19742025
pointer surface to this request with new values for hotspot_x
19752026
and hotspot_y.
19762027

1977-
The current and pending input regions of the wl_surface are
1978-
cleared, and wl_surface.set_input_region is ignored until the
1979-
wl_surface is no longer used as the cursor. When the use as a
1980-
cursor ends, the current and pending input regions become
1981-
undefined, and the wl_surface is unmapped.
2028+
The input region is ignored for wl_surfaces with the role of
2029+
a cursor. When the use as a cursor ends, the wl_surface is
2030+
unmapped.
19822031

19832032
The serial parameter must match the latest wl_pointer.enter
19842033
serial number sent to the client. Otherwise the request will be
@@ -2287,9 +2336,65 @@
22872336
<arg name="axis" type="uint" enum="axis" summary="axis type"/>
22882337
<arg name="value120" type="int" summary="scroll distance as fraction of 120"/>
22892338
</event>
2339+
2340+
<!-- Version 9 additions -->
2341+
2342+
<enum name="axis_relative_direction">
2343+
<description summary="axis relative direction">
2344+
This specifies the direction of the physical motion that caused a
2345+
wl_pointer.axis event, relative to the wl_pointer.axis direction.
2346+
</description>
2347+
<entry name="identical" value="0"
2348+
summary="physical motion matches axis direction"/>
2349+
<entry name="inverted" value="1"
2350+
summary="physical motion is the inverse of the axis direction"/>
2351+
</enum>
2352+
2353+
<event name="axis_relative_direction" since="9">
2354+
<description summary="axis relative physical direction event">
2355+
Relative directional information of the entity causing the axis
2356+
motion.
2357+
2358+
For a wl_pointer.axis event, the wl_pointer.axis_relative_direction
2359+
event specifies the movement direction of the entity causing the
2360+
wl_pointer.axis event. For example:
2361+
- if a user's fingers on a touchpad move down and this
2362+
causes a wl_pointer.axis vertical_scroll down event, the physical
2363+
direction is 'identical'
2364+
- if a user's fingers on a touchpad move down and this causes a
2365+
wl_pointer.axis vertical_scroll up scroll up event ('natural
2366+
scrolling'), the physical direction is 'inverted'.
2367+
2368+
A client may use this information to adjust scroll motion of
2369+
components. Specifically, enabling natural scrolling causes the
2370+
content to change direction compared to traditional scrolling.
2371+
Some widgets like volume control sliders should usually match the
2372+
physical direction regardless of whether natural scrolling is
2373+
active. This event enables clients to match the scroll direction of
2374+
a widget to the physical direction.
2375+
2376+
This event does not occur on its own, it is coupled with a
2377+
wl_pointer.axis event that represents this axis value.
2378+
The protocol guarantees that each axis_relative_direction event is
2379+
always followed by exactly one axis event with the same
2380+
axis number within the same wl_pointer.frame. Note that the protocol
2381+
allows for other events to occur between the axis_relative_direction
2382+
and its coupled axis event.
2383+
2384+
The axis number is identical to the axis number in the associated
2385+
axis event.
2386+
2387+
The order of wl_pointer.axis_relative_direction,
2388+
wl_pointer.axis_discrete and wl_pointer.axis_source is not
2389+
guaranteed.
2390+
</description>
2391+
<arg name="axis" type="uint" enum="axis" summary="axis type"/>
2392+
<arg name="direction" type="uint" enum="axis_relative_direction"
2393+
summary="physical direction relative to axis motion"/>
2394+
</event>
22902395
</interface>
22912396

2292-
<interface name="wl_keyboard" version="8">
2397+
<interface name="wl_keyboard" version="9">
22932398
<description summary="keyboard input device">
22942399
The wl_keyboard interface represents one or more keyboards
22952400
associated with a seat.
@@ -2341,8 +2446,10 @@
23412446
The leave notification is sent before the enter notification
23422447
for the new focus.
23432448

2344-
After this event client must assume that all keys, including modifiers,
2345-
are lifted and also it must stop key repeating if there's some going on.
2449+
After this event client must assume that no keys are pressed,
2450+
it must stop key repeating if there's some going on and until
2451+
it receives the next wl_keyboard.modifiers event, the client
2452+
must also assume no modifiers are active.
23462453
</description>
23472454
<arg name="serial" type="uint" summary="serial number of the leave event"/>
23482455
<arg name="surface" type="object" interface="wl_surface" summary="surface that lost keyboard focus"/>
@@ -2367,6 +2474,9 @@
23672474

23682475
If this event produces a change in modifiers, then the resulting
23692476
wl_keyboard.modifiers event must be sent after this event.
2477+
2478+
The compositor must not send this event without a surface of the client
2479+
having keyboard focus.
23702480
</description>
23712481
<arg name="serial" type="uint" summary="serial number of the key event"/>
23722482
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
@@ -2378,6 +2488,14 @@
23782488
<description summary="modifier and group state">
23792489
Notifies clients that the modifier and/or group state has
23802490
changed, and it should update its local state.
2491+
2492+
The compositor may send this event without a surface of the client
2493+
having keyboard focus, for example to tie modifier information to
2494+
pointer focus instead. If a modifier event with pressed modifiers is sent
2495+
without a prior enter event, the client can assume the modifier state is
2496+
valid until it receives the next wl_keyboard.modifiers event. In order to
2497+
reset the modifier state again, the compositor can send a
2498+
wl_keyboard.modifiers event with no pressed modifiers.
23812499
</description>
23822500
<arg name="serial" type="uint" summary="serial number of the modifiers event"/>
23832501
<arg name="mods_depressed" type="uint" summary="depressed modifiers"/>
@@ -2416,7 +2534,7 @@
24162534
</event>
24172535
</interface>
24182536

2419-
<interface name="wl_touch" version="8">
2537+
<interface name="wl_touch" version="9">
24202538
<description summary="touchscreen input device">
24212539
The wl_touch interface represents a touchscreen
24222540
associated with a seat.

protocols/linux-dmabuf-unstable-v1.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@
8686
For all DRM formats and unless specified in another protocol extension,
8787
pre-multiplied alpha is used for pixel values.
8888

89+
Unless specified otherwise in another protocol extension, implicit
90+
synchronization is used. In other words, compositors and clients must
91+
wait and signal fences implicitly passed via the DMA-BUF's reservation
92+
mechanism.
93+
8994
Warning! The protocol described in this file is experimental and
9095
backward incompatible changes may be made. Backward compatible changes
9196
may be added together with the corresponding interface version bump.
@@ -344,7 +349,7 @@
344349
successful. It provides the new wl_buffer referencing the dmabuf(s).
345350

346351
Upon receiving this event, the client should destroy the
347-
zlinux_dmabuf_params object.
352+
zwp_linux_buffer_params_v1 object.
348353
</description>
349354
<arg name="buffer" type="new_id" interface="wl_buffer"
350355
summary="the newly created wl_buffer"/>
@@ -357,7 +362,7 @@
357362
has not been fulfilled.
358363

359364
Upon receiving this event, the client should destroy the
360-
zlinux_buffer_params object.
365+
zwp_linux_buffer_params_v1 object.
361366
</description>
362367
</event>
363368

0 commit comments

Comments
 (0)