e99f86f4d317dd12619dffc61b5d169e9b8c788d
[src/agl-compositor.git] / protocol / agl-shell.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="agl_shell">
3   <copyright>
4     Copyright © 2019, 2022 Collabora, Ltd.
5
6     Permission is hereby granted, free of charge, to any person obtaining a
7     copy of this software and associated documentation files (the "Software"),
8     to deal in the Software without restriction, including without limitation
9     the rights to use, copy, modify, merge, publish, distribute, sublicense,
10     and/or sell copies of the Software, and to permit persons to whom the
11     Software is furnished to do so, subject to the following conditions:
12
13     The above copyright notice and this permission notice (including the next
14     paragraph) shall be included in all copies or substantial portions of the
15     Software.
16
17     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23     DEALINGS IN THE SOFTWARE.
24   </copyright>
25   <interface name="agl_shell" version="4">
26     <description summary="user interface for Automotive Grade Linux platform">
27       Starting with version 2 of the protocol, the client is required to wait
28       for the 'bound_ok' or 'bound_fail' events in order to proceed further.
29
30       In case the client gets a 'bound_fail' event then it should consider that
31       there's another client already bound to the agl_shell protocol.
32       A client that receives a 'bound_ok' event should consider that there's
33       no other client already bound to the interface and can proceed further.
34
35       If the client uses an older version of the protocol it will receive
36       automatically an error and the compositor will terminate the connection,
37       if there's another client already bound the interface.
38
39       If the client receives the 'bound_fail' event and attempts to use the
40       interface further it will receive an error and the compositor will
41       terminate the connection. After the 'bound_fail' event was received the
42       client should call the destructor, which has been added with version 2
43       of the protocol. The client is free to try at a later point in time to
44       see if it will receive the 'bound_ok' event, but there's no explicit way
45       of finding out when that event will delivered. It is assumed that it can
46       infer that information through other means/other channels.
47     </description>
48
49     <request name="destroy" type="destructor" since="2">
50       <description summary="destroys the factory object">
51       </description>
52     </request>
53
54     <enum name="error">
55       <entry name="invalid_argument" value="0"/>
56       <entry name="background_exists" value="1"/>
57       <entry name="panel_exists" value="2"/>
58     </enum>
59
60     <enum name="edge">
61       <entry name="top" value="0"/>
62       <entry name="bottom" value="1"/>
63       <entry name="left" value="2"/>
64       <entry name="right" value="3"/>
65     </enum>
66
67     <enum name="app_state" since="4">
68       <entry name="started" value="0"/>
69       <entry name="activated" value="1"/>
70       <entry name="deactivated" value="2"/>
71       <entry name="destroyed" value="3"/>
72     </enum>
73
74     <enum name="app_role" since="4">
75       <entry name="float" value="0"/>
76       <entry name="remote" value="1"/>
77     </enum>
78
79     <request name="ready">
80       <description summary="client is ready to be shown">
81         Tell the server that this client is ready to be shown. The server
82         will delay presentation during start-up until all shell clients are
83         ready to be shown, and will display a black screen instead.
84         This gives the client an opportunity to set up and configure several
85         surfaces into a coherent interface.
86
87         The client that binds to this interface must send this request, otherwise
88         they may stall the compositor unnecessarily.
89
90         If this request is called after the compositor has already finished
91         start-up, no operation is performed.
92       </description>
93     </request>
94
95     <request name="set_background">
96       <description summary="set surface as output's background">
97         Set the surface to act as the background of an output. After this
98         request, the server will immediately send a configure event with
99         the dimensions the client should use to cover the entire output.
100
101         The surface must have a "desktop" surface role, as supported by
102         libweston-desktop.
103
104         Only a single surface may be the background for any output. If a
105         background surface already exists, a protocol error is raised.
106       </description>
107       <arg name="surface" type="object" interface="wl_surface"/>
108       <arg name="output" type="object" interface="wl_output"/>
109     </request>
110
111     <request name="set_panel">
112       <description summary="set surface as panel">
113         Set the surface to act as a panel of an output. The 'edge' argument
114         says what edge of the output the surface will be anchored to.
115         After this request, the server will send a configure event with the
116         corresponding width/height that the client should use, and 0 for the
117         other dimension. E.g. if the edge is 'top', the width will be the
118         output's width, and the height will be 0.
119
120         The surface must have a "desktop" surface role, as supported by
121         libweston-desktop.
122
123         The compositor will take the panel's window geometry into account when
124         positioning other windows, so the panels are not covered.
125
126         XXX: What happens if e.g. both top and left are used at the same time?
127         Who gets to have the corner?
128
129         Only a single surface may be the panel for an output's edge. If a
130         surface already exists on an edge, a protocol error is raised.
131       </description>
132       <arg name="surface" type="object" interface="wl_surface"/>
133       <arg name="output" type="object" interface="wl_output"/>
134       <arg name="edge" type="uint" enum="edge"/>
135     </request>
136
137     <request name="activate_app">
138       <description summary="make client current window">
139         Ask the compositor to make a toplevel to become the current/focused
140         window for window management purposes.
141
142         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
143         description of app_id.
144
145         If multiple toplevels have the same app_id, the result is unspecified.
146
147         XXX: Do we need feedback to say it didn't work? (e.g. client does
148         not exist)
149       </description>
150       <arg name="app_id" type="string"/>
151       <arg name="output" type="object" interface="wl_output"/>
152     </request>
153
154     <request name="deactivate_app" since="3">
155       <description summary="de-activate/hide window identified by app_id">
156         Ask the compositor to hide the toplevel window for window
157         management purposes. Depending on the window role, this request
158         will either display the previously active window (or the background
159         in case there's no previously active surface) or temporarily (or
160         until a 'activate_app' is called upon) hide the surface. All
161         the surfaces are identifiable by using the app_id, and no actions are
162         taken in case the app_id is not/was not present.
163
164         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
165         description of app_id.
166       </description>
167       <arg name="app_id" type="string"/>
168     </request>
169
170     <event name="bound_ok" since="2">
171      <description>
172         Informs the client that it was able to bind the agl_shell
173         interface succesfully. Clients are required to wait for this
174         event before continuing further.
175      </description>
176     </event>
177
178     <event name="bound_fail" since="2">
179       <description>
180         Informs the client that binding to the agl_shell interface was
181         unsuccesfull. Clients are required to wait for this event for
182         continuing further.
183       </description>
184     </event>
185
186     <event name="app_state" since="4">
187       <description summary="event sent when application has suffered state modification">
188         Notifies application(s) when other application have suffered state modifications.
189       </description>
190       <arg name="app_id" type="string"/>
191       <arg name="state" type="uint" enum="app_state"/>
192       <arg name="role" type="uint" enum="app_role"/>
193     </event>
194
195   </interface>
196 </protocol>