compositor: Use stdint for specifing integer storage
[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="11">
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 be delivered.
46       It is assumed that it can infer that information through other
47       means/other channels.
48     </description>
49
50     <enum name="error">
51       <entry name="invalid_argument" value="0"/>
52       <entry name="background_exists" value="1"/>
53       <entry name="panel_exists" value="2"/>
54     </enum>
55
56     <enum name="edge">
57       <entry name="top" value="0"/>
58       <entry name="bottom" value="1"/>
59       <entry name="left" value="2"/>
60       <entry name="right" value="3"/>
61     </enum>
62
63     <enum name="app_state" since="3">
64       <entry name="started" value="0"/>
65       <entry name="terminated" value="1"/>
66       <entry name="activated" value="2"/>
67       <entry name="deactivated" value="3"/>
68     </enum>
69
70     <enum name="tile_orientation" since="11">
71       <entry name="none" value="0"/>
72       <entry name="left" value="1"/>
73       <entry name="right" value="2"/>
74       <entry name="top" value="3"/>
75       <entry name="bottom" value="4"/>
76     </enum>
77
78     <request name="ready">
79       <description summary="client is ready to be shown">
80         Tell the server that this client is ready to be shown. The server
81         will delay presentation during start-up until all shell clients are
82         ready to be shown, and will display a black screen instead.
83         This gives the client an opportunity to set up and configure several
84         surfaces into a coherent interface.
85
86         The client that binds to this interface must send this request, otherwise
87         they may stall the compositor unnecessarily.
88
89         If this request is called after the compositor has already finished
90         start-up, no operation is performed.
91       </description>
92     </request>
93
94     <request name="set_background">
95       <description summary="set surface as output's background">
96         Set the surface to act as the background of an output. After this
97         request, the server will immediately send a configure event with
98         the dimensions the client should use to cover the entire output.
99
100         The surface must have a "desktop" surface role, as supported by
101         libweston-desktop.
102
103         Only a single surface may be the background for any output. If a
104         background surface already exists, a protocol error is raised.
105       </description>
106       <arg name="surface" type="object" interface="wl_surface"/>
107       <arg name="output" type="object" interface="wl_output"/>
108     </request>
109
110     <request name="set_panel">
111       <description summary="set surface as panel">
112         Set the surface to act as a panel of an output. The 'edge' argument
113         says what edge of the output the surface will be anchored to.
114         After this request, the server will send a configure event with the
115         corresponding width/height that the client should use, and 0 for the
116         other dimension. E.g. if the edge is 'top', the width will be the
117         output's width, and the height will be 0.
118
119         The surface must have a "desktop" surface role, as supported by
120         libweston-desktop.
121
122         The compositor will take the panel's window geometry into account when
123         positioning other windows, so the panels are not covered.
124
125         XXX: What happens if e.g. both top and left are used at the same time?
126         Who gets to have the corner?
127
128         Only a single surface may be the panel for an output's edge. If a
129         surface already exists on an edge, a protocol error is raised.
130       </description>
131       <arg name="surface" type="object" interface="wl_surface"/>
132       <arg name="output" type="object" interface="wl_output"/>
133       <arg name="edge" type="uint" enum="edge"/>
134     </request>
135
136     <request name="activate_app">
137       <description summary="make client current window">
138         Ask the compositor to make a toplevel to become the current/focused
139         window for window management purposes.
140
141         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
142         description of app_id.
143
144         If multiple toplevels have the same app_id, the result is unspecified.
145
146         XXX: Do we need feedback to say it didn't work? (e.g. client does
147         not exist)
148       </description>
149       <arg name="app_id" type="string"/>
150       <arg name="output" type="object" interface="wl_output"/>
151     </request>
152
153     <event name="bound_ok" since="2">
154      <description summary="event sent if binding was ok">
155         Informs the client that it was able to bind the agl_shell
156         interface succesfully. Clients are required to wait for this
157         event before continuing further.
158      </description>
159     </event>
160
161     <event name="bound_fail" since="2">
162       <description summary="event sent if binding was nok">
163         Informs the client that binding to the agl_shell interface was
164         unsuccesfull. Clients are required to wait for this event for
165         continuing further.
166       </description>
167     </event>
168
169     <request name="destroy" type="destructor" since="2">
170       <description summary="destroys the factory object">
171       </description>
172     </request>
173
174     <event name="app_state" since="3">
175       <description summary="event sent when an application suffered state modification">
176         Informs the client that an application has changed its state to another,
177         specified by the app_state enum. Client can use this event to track
178         current application state. For instance to know when the application has
179         started, or when terminated/stopped.
180       </description>
181       <arg name="app_id" type="string"/>
182       <arg name="state" type="uint" enum="app_state"/>
183     </event>
184
185     <request name="set_activate_region" since="4">
186       <description summary="sets a specific region to activate">
187       A hint for the compositor to use a custom area, rather than
188       inferring the activation area. If any panels are used
189       the compositor computes the activation area by subtracting the
190       panels geometry area. If no panels are used then the entire output
191       is being used. This request changes that as to hint the compositor
192       to use the supplied rectangle and ignore any potential panels
193       that might been set-up previously.
194
195       In order for this request to take effect it will need to happen
196       before the 'ready' request in order for the compositor to make use of it.
197       Note that any 'set_panel' request be will not be honored, if this request
198       has been called.
199
200       The x and y coordinates use the top-left corner as the origin. The
201       rectangle area shouldn't exceed the output area, while an area smaller
202       than the output, would basically result in showing up the background
203       surface.
204       </description>
205       <arg name="output" type="object" interface="wl_output"/>
206       <arg name="x" type="int" summary="x position of rectangle"/>
207       <arg name="y" type="int" summary="y position of rectangle"/>
208       <arg name="width" type="int" summary="width of rectangle"/>
209       <arg name="height" type="int" summary="height of rectangle"/>
210     </request>
211
212     <request name="deactivate_app" since="5">
213       <description summary="de-activate/hide window identified by app_id">
214         Ask the compositor to hide the toplevel window for window
215         management purposes. Depending on the window role, this request
216         will either display the previously active window (or the background
217         in case there's no previously active surface) or temporarily (or
218         until a 'activate_app' is called upon) hide the surface.
219
220         All the surfaces are identifiable by using the app_id, and no actions
221         are taken in case the app_id is not/was not present.
222
223         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
224         description of app_id.
225       </description>
226       <arg name="app_id" type="string"/>
227     </request>
228
229     <request name="set_app_float" since="6">
230       <description summary="set the window identified by app_id as float">
231         Makes the application identified by app_id as floating. If the
232         application's window is already mapped, in a maximized, normal state,
233         it would transition to the float state.
234
235         For applications that want to modify their own state, this request
236         must be done before the initial surface commit in order to take effect.
237
238         If the application is already in floating state, this request wouldn't
239         do anything.
240
241         There's no persistence of this request, once the application terminated
242         you'll to issue this request again for that particular app_id.
243
244         The x, and y values would be initial position of the window where the
245         window surface will be placed.
246
247         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
248         description of app_id.
249       </description>
250       <arg name="app_id" type="string"/>
251       <arg name="x" type="int" summary="x position"/>
252       <arg name="y" type="int" summary="y position"/>
253     </request>
254
255     <request name="set_app_normal" since="6">
256       <description summary="set the window identified by app_id as normally started">
257       Returns the application identified by app_id as it was in the normal state.
258       This is useful to come back from other states to the maximized state, the
259       normal state applications are started.
260       </description>
261       <arg name="app_id" type="string"/>
262     </request>
263
264     <request name="set_app_fullscreen" since="7">
265       <description summary="">
266         Makes the application identified by app_id as fullscreen. If the
267         application's window is already mapped, in a maximized, normal state,
268         it would transition to the fullscreen state.
269
270         For applications that want to modify their own state, this request
271         must be done before the initial surface commit in order to take effect.
272
273         If the application is already in fullscreen state, this request wouldn't
274         do anything.
275
276         There's no persistence of this request, once the application terminated
277         you'll to issue this request again for that particular app_id.
278
279         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
280         description of app_id.
281       </description>
282       <arg name="app_id" type="string"/>
283     </request>
284
285     <request name="set_app_output" since="8">
286       <description summary="assign an application to a particular output">
287         this would allow the compositor to place an application on a particular
288         output, if that output is indeed available. this can happen before
289         application is started which would make the application start on that
290         particular output. if the application is already started it would
291         move the application to that output.
292
293         there's no persistence of this request, once the application terminated
294         you'll need to issue this request again for that particular app_id.
295
296         see xdg_toplevel.set_app_id from the xdg-shell protocol for a
297         description of app_id.
298       </description>
299       <arg name="app_id" type="string"/>
300       <arg name="output" type="object" interface="wl_output"/>
301     </request>
302
303     <event name="app_on_output" since="8">
304       <description summary="Event sent as a reponse to set_app_output">
305         Clients can use this event to be notified when an application
306         wants to be displayed on a certain output. This event is sent in
307         response to the set_app_output request.
308
309         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
310         description of app_id.
311       </description>
312       <arg name="app_id" type="string"/>
313       <arg name="output_name" type="string"/>
314     </event>
315
316     <request name="set_app_position" since="9">
317       <description summary="move window to a specific position">
318         Clients can inform the compositor to position a floating type of window
319         at the specific location, pointed by x and y value. If the window is
320         not a floating type, the request will be discarded. Note that
321         positioning doesn't take output into consideration nor does orientation
322         of the outpus. It is expected that the client knows already where the
323         position is localed in global coordonate space. If the window doesn't
324         exist the compositor will ignore the request. For this request to
325         function properly the window would first to be set as floating and then
326         it can be moved using this request.
327
328         see xdg_toplevel.set_app_id from the xdg-shell protocol for a
329         description of app_id.
330       </description>
331       <arg name="app_id" type="string"/>
332       <arg name="x" type="int"/>
333       <arg name="y" type="int"/>
334     </request>
335
336     <request name="set_app_scale" since="10">
337       <description summary="scale window to a specific rectangle">
338         Clients can inform the compositor to scale a floating type of window
339         to the values specified in width and height. If the window is
340         not a floating type, the request will be discarded. If the window
341         doesn't exist the compositor will ignore the request. For this request
342         to function properly the window would first to be set as floating
343         and then it can be moved using this request.
344
345
346         see xdg_toplevel.set_app_id from the xdg-shell protocol for a
347         description of app_id.
348       </description>
349       <arg name="app_id" type="string"/>
350       <arg name="width" type="int"/>
351       <arg name="height" type="int"/>
352     </request>
353
354     <request name="set_app_split" since="11">
355       <description summary="set the application with a split orientation">
356         This requests asks the compositor to change the application from the
357         original mode (whatever that might be) to a split, tiled orientation
358         mode defined in the tile orientation enum.
359         Clients need to implement resizing (to handle xdg-shell configure
360         events) for this to work correctly.
361
362         This request only handles a single level of tiling for practical
363         reasons: to keep implementation simple and straight forward. The
364         compositor will ignore requests if there are already two windows
365         present. The client can verify this request succeed by checking the
366         xdg-shell configure event and with it, the states sent
367         by the compositor.
368
369         If there's no app_id with the supplied name, the compositor will add
370         the app to a pending list in order to be applied when an application
371         gets started, or if the application sets its application after the
372         initial wl_surface.commit request.
373
374         Applications can use this approach if they want to be started in a
375         tiled orientation position, before creating the xdg-shell toplevel role.
376
377         A none orientation type would make the window go back to the original
378         maximized mode. If two windows are side by side, returning one of them
379         back the original mode would mean the other one will be made hidden
380         and the one doing the request for the none orientation will become
381         the currently active window. A further activation, using activate_app
382         request for the other window would make that one active.
383
384         Closing the window in the tiled orientation state implies that either
385         the background surface will displayed, or in case there was another
386         applications being shown at that time, will make that application be
387         returned to the original, maximized state.
388
389         The tiled orientation could be applied independently of each other,
390         such that a client can transition from one tiled orientation to
391         another. Note that any other window already present would literally
392         take the opposite orientation with the one currently being changed. So
393         tiled orientation modification automatically implies a tile orientation
394         for any other application already present/active at that time.
395
396         In case there's already a client active at that time, it will be
397         attributed automatically the opposite tiled orientation, such that two
398         concurrent applications can be displayed at the same time.
399
400         The orientation tiles can not be combined, and only state at a time
401         can be active. Only horizontal and vertical tiling is possible. A
402         horizontal and vertical tile orientation simultaneously is not
403         possible.
404
405         Input focus is being delivered to the last started/activated window,
406         such that users can cycle between that one or the other, assumes there's
407         another window in the first place.
408
409         A width size can also be specified for the split window. Note that this
410         width can't exceed the output width value, or the compositor can choose
411         to ignore this value.
412
413         Making the split window sticky would inform the compositor that the
414         window should always be active when switching or when activating between
415         other windows. This would allow navigating, starting and activating other
416         windows while keeping the current window always in a split state.
417
418         See xdg_toplevel.set_app_id from the xdg-shell protocol for a
419         description of app_id.
420       </description>
421       <arg name="app_id" type="string"/>
422       <arg name="orientation" type="uint" enum="tile_orientation"/>
423       <arg name="width" type="int" summary="width of the window being split"/>
424       <arg name="sticky" type="int" summary="make the split window stiky"/>
425       <arg name="output" type="object" interface="wl_output"/>
426     </request>
427   </interface>
428
429   <interface name="agl_shell_ext" version="1">
430     <description summary="extended user interface for Automotive Grade Linux platform">
431       This interface allows another client bind to the agl_shell interface,
432       while there's another shell client already present.
433
434       The client should first bind to this interface and then inform the
435       compositor with the 'doas_shell_client' request and it wants to bind to
436       the agl_shell interface. The client is still expected, if using a new
437       version of the agl_shell interface, to wait for the 'bound_ok' and
438       'bound_fail' events before issueing any other requests/events.
439
440       Note that this interface has its limitations, and the compositor would
441       still refuse the act for 'set_panel' or 'set_background' requests
442       of the agl_shell interface if there's already a client that used them.
443
444       Any other requests or events should be delievered and handled as it would
445       a client bound to the agl_shell interface.
446     </description>
447
448     <enum name="doas_shell_client_status">
449       <entry name="success" value="0"/>
450       <entry name="failed" value="1"/>
451     </enum>
452
453     <request name="destroy" type="destructor">
454       <description summary="destroys the factory object">
455         Call the destructor once you're ready with agl_shell_ext interface.
456         This would reset the state and would make any requests made
457         on the agl_shell interface be terminated. The client would need 
458         to bind again the agl_shell_ext and issue a 'doas_shell_client'
459         request.
460       </description>
461     </request>
462
463     <request name="doas_shell_client">
464       <description summary="Informs the compositor it wants to bind to the
465       agl_shell interface">
466         Prior to binding to agl_shell interface, this request would inform
467         the compositor that it wants to gain access the agl_shell interface.
468         The client is expected to wait for 'doas_shell_client_done' event and 
469         check for a successful status before going further with binding to
470         the agl_shell interface.
471       </description>
472     </request>
473
474     <event name="doas_done">
475       <description summary="event sent as a reply to doas_shell_client">
476         The client should check the status event to verify that the
477         compositor was able to handle the request.
478       </description>
479       <arg name="status" type="uint" enum="doas_shell_client_status"/>
480     </event>
481   </interface>
482 </protocol>