1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="swc_snap">
3 <interface name="swc_snap" version="2">
4 <description summary="raw screen capture into client buffers">
5 gives a screen capture capability where the client supplies a
6 wl_shm buffer and the compositor fills it with a raw frame.
7 </description>
8
9 <enum name="flags" bitfield="true">
10 <entry name="overlay_cursor" value="1"
11 summary="composite the current cursor into the frame"/>
12 </enum>
13
14 <enum name="pixel_format">
15 <entry name="xrgb8888" value="0"
16 summary="WL_SHM_FORMAT_XRGB8888"/>
17 <entry name="argb8888" value="1"
18 summary="WL_SHM_FORMAT_ARGB8888"/>
19 </enum>
20
21 <enum name="failure_reason">
22 <entry name="no_screen" value="0"
23 summary="no captureable screen is available"/>
24 <entry name="unsupported_buffer" value="1"
25 summary="buffer is not a wl_shm xrgb/argb8888 buffer"/>
26 <entry name="size_mismatch" value="2"
27 summary="buffer dimensions are too small for the screen"/>
28 <entry name="internal" value="3"
29 summary="compositor capture failed"/>
30 </enum>
31
32 <request name="destroy" type="destructor">
33 <description summary="destroy the capture object"/>
34 </request>
35
36 <request name="capture">
37 <description summary="capture a frame into a client buffer">
38 captures the current primary screen into the supplied wl_shm
39 buffer. The compositor writes raw pixels and reports ready or
40 failed state
41 </description>
42 <arg name="buffer" type="object" interface="wl_buffer"
43 summary="client-provided wl_shm buffer to fill"/>
44 <arg name="flags" type="uint" summary="bitmask of swc_snap.flags"/>
45 </request>
46
47 <event name="buffer">
48 <description summary="current capture frame metadata">
49 describes the current frame geometry and pixel format expected
50 by the capture stream
51 </description>
52 <arg name="width" type="uint"/>
53 <arg name="height" type="uint"/>
54 <arg name="format" type="uint"
55 summary="swc_snap.pixel_format value"/>
56 </event>
57
58 <event name="ready">
59 <description summary="capture complete">
60 the requested buffer has been filled and is ready for client
61 </description>
62 <arg name="tv_sec" type="uint" summary="CLOCK_MONOTONIC seconds"/>
63 <arg name="tv_nsec" type="uint" summary="CLOCK_MONOTONIC nanoseconds"/>
64 </event>
65
66 <event name="failed">
67 <description summary="capture failed">
68 the capture request failed, the object still usable and the
69 client may retry with another buffer or after a mode change
70 </description>
71 <arg name="reason" type="uint"
72 summary="swc_snap.failure_reason value"/>
73 </event>
74 </interface>
75</protocol>