1b877906bSopenharmony_ci<?xml version="1.0" encoding="UTF-8"?>
2b877906bSopenharmony_ci<protocol name="xdg_decoration_unstable_v1">
3b877906bSopenharmony_ci  <copyright>
4b877906bSopenharmony_ci    Copyright © 2018 Simon Ser
5b877906bSopenharmony_ci
6b877906bSopenharmony_ci    Permission is hereby granted, free of charge, to any person obtaining a
7b877906bSopenharmony_ci    copy of this software and associated documentation files (the "Software"),
8b877906bSopenharmony_ci    to deal in the Software without restriction, including without limitation
9b877906bSopenharmony_ci    the rights to use, copy, modify, merge, publish, distribute, sublicense,
10b877906bSopenharmony_ci    and/or sell copies of the Software, and to permit persons to whom the
11b877906bSopenharmony_ci    Software is furnished to do so, subject to the following conditions:
12b877906bSopenharmony_ci
13b877906bSopenharmony_ci    The above copyright notice and this permission notice (including the next
14b877906bSopenharmony_ci    paragraph) shall be included in all copies or substantial portions of the
15b877906bSopenharmony_ci    Software.
16b877906bSopenharmony_ci
17b877906bSopenharmony_ci    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18b877906bSopenharmony_ci    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19b877906bSopenharmony_ci    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20b877906bSopenharmony_ci    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21b877906bSopenharmony_ci    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22b877906bSopenharmony_ci    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23b877906bSopenharmony_ci    DEALINGS IN THE SOFTWARE.
24b877906bSopenharmony_ci  </copyright>
25b877906bSopenharmony_ci
26b877906bSopenharmony_ci  <interface name="zxdg_decoration_manager_v1" version="1">
27b877906bSopenharmony_ci    <description summary="window decoration manager">
28b877906bSopenharmony_ci      This interface allows a compositor to announce support for server-side
29b877906bSopenharmony_ci      decorations.
30b877906bSopenharmony_ci
31b877906bSopenharmony_ci      A window decoration is a set of window controls as deemed appropriate by
32b877906bSopenharmony_ci      the party managing them, such as user interface components used to move,
33b877906bSopenharmony_ci      resize and change a window's state.
34b877906bSopenharmony_ci
35b877906bSopenharmony_ci      A client can use this protocol to request being decorated by a supporting
36b877906bSopenharmony_ci      compositor.
37b877906bSopenharmony_ci
38b877906bSopenharmony_ci      If compositor and client do not negotiate the use of a server-side
39b877906bSopenharmony_ci      decoration using this protocol, clients continue to self-decorate as they
40b877906bSopenharmony_ci      see fit.
41b877906bSopenharmony_ci
42b877906bSopenharmony_ci      Warning! The protocol described in this file is experimental and
43b877906bSopenharmony_ci      backward incompatible changes may be made. Backward compatible changes
44b877906bSopenharmony_ci      may be added together with the corresponding interface version bump.
45b877906bSopenharmony_ci      Backward incompatible changes are done by bumping the version number in
46b877906bSopenharmony_ci      the protocol and interface names and resetting the interface version.
47b877906bSopenharmony_ci      Once the protocol is to be declared stable, the 'z' prefix and the
48b877906bSopenharmony_ci      version number in the protocol and interface names are removed and the
49b877906bSopenharmony_ci      interface version number is reset.
50b877906bSopenharmony_ci    </description>
51b877906bSopenharmony_ci
52b877906bSopenharmony_ci    <request name="destroy" type="destructor">
53b877906bSopenharmony_ci      <description summary="destroy the decoration manager object">
54b877906bSopenharmony_ci        Destroy the decoration manager. This doesn't destroy objects created
55b877906bSopenharmony_ci        with the manager.
56b877906bSopenharmony_ci      </description>
57b877906bSopenharmony_ci    </request>
58b877906bSopenharmony_ci
59b877906bSopenharmony_ci    <request name="get_toplevel_decoration">
60b877906bSopenharmony_ci      <description summary="create a new toplevel decoration object">
61b877906bSopenharmony_ci        Create a new decoration object associated with the given toplevel.
62b877906bSopenharmony_ci
63b877906bSopenharmony_ci        Creating an xdg_toplevel_decoration from an xdg_toplevel which has a
64b877906bSopenharmony_ci        buffer attached or committed is a client error, and any attempts by a
65b877906bSopenharmony_ci        client to attach or manipulate a buffer prior to the first
66b877906bSopenharmony_ci        xdg_toplevel_decoration.configure event must also be treated as
67b877906bSopenharmony_ci        errors.
68b877906bSopenharmony_ci      </description>
69b877906bSopenharmony_ci      <arg name="id" type="new_id" interface="zxdg_toplevel_decoration_v1"/>
70b877906bSopenharmony_ci      <arg name="toplevel" type="object" interface="xdg_toplevel"/>
71b877906bSopenharmony_ci    </request>
72b877906bSopenharmony_ci  </interface>
73b877906bSopenharmony_ci
74b877906bSopenharmony_ci  <interface name="zxdg_toplevel_decoration_v1" version="1">
75b877906bSopenharmony_ci    <description summary="decoration object for a toplevel surface">
76b877906bSopenharmony_ci      The decoration object allows the compositor to toggle server-side window
77b877906bSopenharmony_ci      decorations for a toplevel surface. The client can request to switch to
78b877906bSopenharmony_ci      another mode.
79b877906bSopenharmony_ci
80b877906bSopenharmony_ci      The xdg_toplevel_decoration object must be destroyed before its
81b877906bSopenharmony_ci      xdg_toplevel.
82b877906bSopenharmony_ci    </description>
83b877906bSopenharmony_ci
84b877906bSopenharmony_ci    <enum name="error">
85b877906bSopenharmony_ci      <entry name="unconfigured_buffer" value="0"
86b877906bSopenharmony_ci        summary="xdg_toplevel has a buffer attached before configure"/>
87b877906bSopenharmony_ci      <entry name="already_constructed" value="1"
88b877906bSopenharmony_ci        summary="xdg_toplevel already has a decoration object"/>
89b877906bSopenharmony_ci      <entry name="orphaned" value="2"
90b877906bSopenharmony_ci        summary="xdg_toplevel destroyed before the decoration object"/>
91b877906bSopenharmony_ci    </enum>
92b877906bSopenharmony_ci
93b877906bSopenharmony_ci    <request name="destroy" type="destructor">
94b877906bSopenharmony_ci      <description summary="destroy the decoration object">
95b877906bSopenharmony_ci        Switch back to a mode without any server-side decorations at the next
96b877906bSopenharmony_ci        commit.
97b877906bSopenharmony_ci      </description>
98b877906bSopenharmony_ci    </request>
99b877906bSopenharmony_ci
100b877906bSopenharmony_ci    <enum name="mode">
101b877906bSopenharmony_ci      <description summary="window decoration modes">
102b877906bSopenharmony_ci        These values describe window decoration modes.
103b877906bSopenharmony_ci      </description>
104b877906bSopenharmony_ci      <entry name="client_side" value="1"
105b877906bSopenharmony_ci        summary="no server-side window decoration"/>
106b877906bSopenharmony_ci      <entry name="server_side" value="2"
107b877906bSopenharmony_ci        summary="server-side window decoration"/>
108b877906bSopenharmony_ci    </enum>
109b877906bSopenharmony_ci
110b877906bSopenharmony_ci    <request name="set_mode">
111b877906bSopenharmony_ci      <description summary="set the decoration mode">
112b877906bSopenharmony_ci        Set the toplevel surface decoration mode. This informs the compositor
113b877906bSopenharmony_ci        that the client prefers the provided decoration mode.
114b877906bSopenharmony_ci
115b877906bSopenharmony_ci        After requesting a decoration mode, the compositor will respond by
116b877906bSopenharmony_ci        emitting an xdg_surface.configure event. The client should then update
117b877906bSopenharmony_ci        its content, drawing it without decorations if the received mode is
118b877906bSopenharmony_ci        server-side decorations. The client must also acknowledge the configure
119b877906bSopenharmony_ci        when committing the new content (see xdg_surface.ack_configure).
120b877906bSopenharmony_ci
121b877906bSopenharmony_ci        The compositor can decide not to use the client's mode and enforce a
122b877906bSopenharmony_ci        different mode instead.
123b877906bSopenharmony_ci
124b877906bSopenharmony_ci        Clients whose decoration mode depend on the xdg_toplevel state may send
125b877906bSopenharmony_ci        a set_mode request in response to an xdg_surface.configure event and wait
126b877906bSopenharmony_ci        for the next xdg_surface.configure event to prevent unwanted state.
127b877906bSopenharmony_ci        Such clients are responsible for preventing configure loops and must
128b877906bSopenharmony_ci        make sure not to send multiple successive set_mode requests with the
129b877906bSopenharmony_ci        same decoration mode.
130b877906bSopenharmony_ci      </description>
131b877906bSopenharmony_ci      <arg name="mode" type="uint" enum="mode" summary="the decoration mode"/>
132b877906bSopenharmony_ci    </request>
133b877906bSopenharmony_ci
134b877906bSopenharmony_ci    <request name="unset_mode">
135b877906bSopenharmony_ci      <description summary="unset the decoration mode">
136b877906bSopenharmony_ci        Unset the toplevel surface decoration mode. This informs the compositor
137b877906bSopenharmony_ci        that the client doesn't prefer a particular decoration mode.
138b877906bSopenharmony_ci
139b877906bSopenharmony_ci        This request has the same semantics as set_mode.
140b877906bSopenharmony_ci      </description>
141b877906bSopenharmony_ci    </request>
142b877906bSopenharmony_ci
143b877906bSopenharmony_ci    <event name="configure">
144b877906bSopenharmony_ci      <description summary="suggest a surface change">
145b877906bSopenharmony_ci        The configure event asks the client to change its decoration mode. The
146b877906bSopenharmony_ci        configured state should not be applied immediately. Clients must send an
147b877906bSopenharmony_ci        ack_configure in response to this event. See xdg_surface.configure and
148b877906bSopenharmony_ci        xdg_surface.ack_configure for details.
149b877906bSopenharmony_ci
150b877906bSopenharmony_ci        A configure event can be sent at any time. The specified mode must be
151b877906bSopenharmony_ci        obeyed by the client.
152b877906bSopenharmony_ci      </description>
153b877906bSopenharmony_ci      <arg name="mode" type="uint" enum="mode" summary="the decoration mode"/>
154b877906bSopenharmony_ci    </event>
155b877906bSopenharmony_ci  </interface>
156b877906bSopenharmony_ci</protocol>
157