agl-shell: Add an explicit set_app_split
[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="6">
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="split_orientation" since="6">
75       <entry name="none" value="0"/>
76       <entry name="top" value="1"/>
77       <entry name="bottom" value="2"/>
78       <entry name="left" value="3"/>
79       <entry name="right" value="4"/>
80     </enum>
81
82     <enum name="app_role" since="4">
83       <entry name="float" value="0"/>
84       <entry name="remote" value="1"/>
85       <entry name="split" value="2" since="6"/>
86     </enum>
87
88     <request name="ready">
89       <description summary="client is ready to be shown">
90         Tell the server that this client is ready to be shown. The server
91         will delay presentation during start-up until all shell clients are
92         ready to be shown, and will display a black screen instead.
93         This gives the client an opportunity to set up and configure several
94         surfaces into a coherent interface.
95
96         The client that binds to this interface must send this request, otherwise
97         they may stall the compositor unnecessarily.
98
99         If this request is called after the compositor has already finished
100         start-up, no operation is performed.
101       </description>
102     </request>
103
104     <request name="set_background">
105       <description summary="set surface as output's background">
106         Set the surface to act as the background of an output. After this
107         request, the server will immediately send a configure event with
108         the dimensions the client should use to cover the entire output.
109
110         The surface must have a "desktop" surface role, as supported by
111         libweston-desktop.
112
113         Only a single surface may be the background for any output. If a
114         background surface already exists, a protocol error is raised.
115       </description>
116       <arg name="surface" type="object" interface="wl_surface"/>
117       <arg name="output" type="object" interface="wl_output"/>
118     </request>
119
120     <request name="set_panel">
121       <description summary="set surface as panel">
122         Set the surface to act as a panel of an output. The 'edge' argument
123         says what edge of the output the surface will be anchored to.
124         After this request, the server will send a configure event with the
125         corresponding width/height that the client should use, and 0 for the
126         other dimension. E.g. if the edge is 'top', the width will be the
127         output's width, and the height will be 0.
128
129         The surface must have a "desktop" surface role, as supported by
130         libweston-desktop.
131
132         The compositor will take the panel's window geometry into account when
133         positioning other windows, so the panels are not covered.
134
135         XXX: What happens if e.g. both top and left are used at the same time?
136         Who gets to have the corner?
137
138         Only a single surface may be the panel for an output's edge. If a
139         surface already exists on an edge, a protocol error is raised.
140       </description>
141       <arg name="surface" type="object" interface="wl_surface"/>
142       <arg name="output" type="object" interface="wl_output"/>
143       <arg name="edge" type="uint" enum="edge"/>
144     </request>
145
146     <request name="activate_app">
147       <description summary="make client current window">
148         Ask the compositor to make a toplevel to become the current/focused
149         window for window management purposes.
150
151         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
152         description of app_id.
153
154         If multiple toplevels have the same app_id, the result is unspecified.
155
156         XXX: Do we need feedback to say it didn't work? (e.g. client does
157         not exist)
158       </description>
159       <arg name="app_id" type="string"/>
160       <arg name="output" type="object" interface="wl_output"/>
161     </request>
162
163     <request name="deactivate_app" since="3">
164       <description summary="de-activate/hide window identified by app_id">
165         Ask the compositor to hide the toplevel window for window
166         management purposes. Depending on the window role, this request
167         will either display the previously active window (or the background
168         in case there's no previously active surface) or temporarily (or
169         until a 'activate_app' is called upon) hide the surface. All
170         the surfaces are identifiable by using the app_id, and no actions are
171         taken in case the app_id is not/was not present.
172
173         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
174         description of app_id.
175       </description>
176       <arg name="app_id" type="string"/>
177     </request>
178
179     <event name="bound_ok" since="2">
180      <description>
181         Informs the client that it was able to bind the agl_shell
182         interface succesfully. Clients are required to wait for this
183         event before continuing further.
184      </description>
185     </event>
186
187     <event name="bound_fail" since="2">
188       <description>
189         Informs the client that binding to the agl_shell interface was
190         unsuccesfull. Clients are required to wait for this event for
191         continuing further.
192       </description>
193     </event>
194
195     <event name="app_state" since="4">
196       <description summary="event sent when application has suffered state modification">
197         Notifies application(s) when other application have suffered state modifications.
198       </description>
199       <arg name="app_id" type="string"/>
200       <arg name="state" type="uint" enum="app_state"/>
201       <arg name="role" type="uint" enum="app_role"/>
202     </event>
203
204     <request name="set_app_float" since="5">
205       <description summary="set the application floating">
206         The agl-shell protocol makes the windows by default maximized to the
207         output area, taking into consideration the panel sizes.
208
209         If certain client would want be behave like a pop-up type, always sticky
210         window, when switching between applications, it can use this request
211         to do so.
212
213         If the application, specified with the app_id string,
214         is not currently running, it will be added it to a pending list.
215
216         If, at a later point in time, that application does come up it will
217         apply the floating state to it. Note that once that happens, and a later
218         point in time that application is stopped, these changes will not apply
219         anymore. To keep a permanent state see also set_app_property_mode().
220
221         Another use-case is for applications that want to be started from the
222         beginning as floating, so they the client must call this request before
223         doing the initial wl_surface.commit().
224
225         Application can also transit from float to maximized and vice-versa
226         using this request or the set_app_unfloat to go back to an
227         initial maximized state.
228
229         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
230         description of app_id.
231       </description>
232       <arg name="app_id" type="string"/>
233       <arg name="x" type="int"/>
234       <arg name="y" type="int"/>
235     </request>
236
237     <request name="set_app_unfloat" since="5">
238       <description summary="set the application back to maximized mode">
239         This undoes the effect of the 'set_app_float' request
240         in case the client wants to go from floating back to the maximized
241         state. If there's no app_id present this request will obviously do
242         nothing.
243
244         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
245         description of app_id.
246       </description>
247       <arg name="app_id" type="string"/>
248     </request>
249
250     <request name="set_app_remote" since="5">
251       <description summary="set the application remoting on another output">
252         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
253         description of app_id.
254       </description>
255       <arg name="app_id" type="string"/>
256       <arg name="output" type="object" interface="wl_output"/>
257     </request>
258
259     <request name="set_app_property_mode" since="5">
260       <description summary="Request to change the application properties lifetime">
261         Use this request to inform the compositor to maintain a pending state
262         for an app_id being set with set_app_float/set_app_remote request.
263
264         Any subsequent application matching that app_id would survive a
265         potential application destruction. Note that this request will
266         take effect globally on all applications.
267
268         To turn it on, or off, use the 'permanent' argument. Initially,
269         the compositor will have this option set to off. Note that it
270         doesn't matter the order of this request with respect to
271         set_app_property() request, as the changes will only take effect
272         when the application itself does the commit with an app_id set,
273         therefore the only requirement is to call this request before
274         the app_id client does its first commit.
275       </description>
276       <arg name="permanent" type="uint"/>
277     </request>
278
279     <request name="set_app_split" since="6">
280       <description summary="set the application split">
281         Request changes the application from the original mode (whatever that
282         might be) to a split, tiled orientation mode defined in the orientation
283         split_orientation enum. This request only handles a single level of
284         orientation for practical reasons.
285
286         If there's no app_id with the supplied name this request does nothing.
287
288         A none orientation type would make the window go back to the original
289         maximized mode. This implies that either the background surface will
290         displayed or in case there are more than one applications being
291         shown, the other application will be returned to the original,
292         maximized state.
293
294         The tiled orientation could be applied independently of each other,
295         such that a client can transition from one tiled orientation to
296         another. Any other window already present would switch places with
297         the currently one being changed.
298
299         In case there's already a client that's already active at that time,
300         it will be attributed automatically the opposite tiled orientation,
301         such that two concurrent applications can be displayed at the same
302         time.
303
304         The orientation tiles can not be combined, and only state at a time
305         can be active, which means we can't have a top left orientation, or
306         any combination like that.
307
308         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
309         description of app_id.
310       </description>
311       <arg name="app_id" type="string"/>
312       <arg name="orientation" type="uint" enum="split_orientation"/>
313     </request>
314
315   </interface>
316 </protocol>