compositor: Use stdint for specifing integer storage
[src/agl-compositor.git] / protocol / agl-screenshooter.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="agl_screenshooter">
3
4   <copyright>
5     Copyright © 2020 Collabora. Ltd,
6
7     Permission is hereby granted, free of charge, to any person obtaining a
8     copy of this software and associated documentation files (the "Software"),
9     to deal in the Software without restriction, including without limitation
10     the rights to use, copy, modify, merge, publish, distribute, sublicense,
11     and/or sell copies of the Software, and to permit persons to whom the
12     Software is furnished to do so, subject to the following conditions:
13
14     The above copyright notice and this permission notice (including the next
15     paragraph) shall be included in all copies or substantial portions of the
16     Software.
17
18     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24     DEALINGS IN THE SOFTWARE.
25   </copyright>
26
27   <interface name="agl_screenshooter" version="1">
28     <description summary="agl screenshooter">
29       agl compositor extension that performs a screenshot of the output, which
30       is represented by a 'wl_output' object.
31
32       A client would call 'take_shot' request and wait until the compositor
33       finishes to write the data to a wayland buffer, moment in which signals
34       back the client with the help of the 'done' event. Clients should wait
35       until the 'done' event is received, if they want to take another
36       screenshot, or take another screnshot of a different output.
37
38       The client must provide a wl_shm-based wl_buffer of the correct size when
39       taking a shot. The compositor will write the shot into the wl_buffer and then
40       send the 'done' event that signals completion of writing the data.
41
42       Once the compositor has finished to transfer the data back into the supplied
43       wayland buffer, the client should be able to transfer it to a popular
44       file format on the disk.
45     </description>
46
47     <enum name="done_status">
48       <entry name="success" value="0"/>
49       <entry name="no_memory" value="1"/>
50       <entry name="bad_buffer" value="2"/>
51     </enum>
52
53     <request name="take_shot">
54       <description summary="performs a screenshot">
55         Takes a screenshot of the wayland output represented by a 'wl_output'
56         object. Clients should first retrieve it using global registry, as well
57         as the 'wl_shm' object in order to create a wayland buffer type of
58         object ('wl_buffer').
59
60         Clients can derive the stride and size from the 'wl_output' object, and
61         later on use those when creating shm-based 'wl_buffer', as well as supplying
62         the pixel format.
63       </description>
64
65       <arg name="output" type="object" interface="wl_output"/>
66       <arg name="buffer" type="object" interface="wl_buffer"/>
67     </request>
68
69     <event name="done">
70       <description summary="sent when 'take_shot' finished">
71          Even sent back to notify client 'take_shot' request has completed.
72       </description>
73       <arg name="status" type="uint" enum="done_status" />
74     </event>
75
76     <request name="destroy" type="destructor">
77       <description summary="destroy main object">
78         Destroys the 'weston_screenshooter' interface.
79       </description>
80     </request>
81
82   </interface>
83
84 </protocol>