efl
244 строки · 10.6 Кб
1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="subsurface">3
4<copyright>5Copyright © 2012-2013 Collabora, Ltd.
6
7Permission to use, copy, modify, distribute, and sell this
8software and its documentation for any purpose is hereby granted
9without fee, provided that the above copyright notice appear in
10all copies and that both that copyright notice and this permission
11notice appear in supporting documentation, and that the name of
12the copyright holders not be used in advertising or publicity
13pertaining to distribution of the software without specific,
14written prior permission. The copyright holders make no
15representations about the suitability of this software for any
16purpose. It is provided "as is" without express or implied
17warranty.
18
19THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26THIS SOFTWARE.
27</copyright>28
29<interface name="wl_subcompositor" version="1">30<description summary="sub-surface compositing">31The global interface exposing sub-surface compositing capabilities.
32A wl_surface, that has sub-surfaces associated, is called the
33parent surface. Sub-surfaces can be arbitrarily nested and create
34a tree of sub-surfaces.
35
36The root surface in a tree of sub-surfaces is the main
37surface. The main surface cannot be a sub-surface, because
38sub-surfaces must always have a parent.
39
40A main surface with its sub-surfaces forms a (compound) window.
41For window management purposes, this set of wl_surface objects is
42to be considered as a single window, and it should also behave as
43such.
44
45The aim of sub-surfaces is to offload some of the compositing work
46within a window from clients to the compositor. A prime example is
47a video player with decorations and video in separate wl_surface
48objects. This should allow the compositor to pass YUV video buffer
49processing to dedicated overlay hardware when possible.
50</description>51
52<request name="destroy" type="destructor">53<description summary="unbind from the subcompositor interface">54Informs the server that the client will not be using this
55protocol object anymore. This does not affect any other
56objects, wl_subsurface objects included.
57</description>58</request>59
60<enum name="error">61<entry name="bad_surface" value="0"62summary="the to-be sub-surface is invalid"/>63</enum>64
65<request name="get_subsurface">66<description summary="give a surface the role sub-surface">67Create a sub-surface interface for the given surface, and
68associate it with the given parent surface. This turns a
69plain wl_surface into a sub-surface.
70
71The to-be sub-surface must not already have a dedicated
72purpose, like any shell surface type, cursor image, drag icon,
73or sub-surface. Otherwise a protocol error is raised.
74</description>75
76<arg name="id" type="new_id" interface="wl_subsurface"77summary="the new subsurface object id"/>78<arg name="surface" type="object" interface="wl_surface"79summary="the surface to be turned into a sub-surface"/>80<arg name="parent" type="object" interface="wl_surface"81summary="the parent surface"/>82</request>83</interface>84
85<interface name="wl_subsurface" version="1">86<description summary="sub-surface interface to a wl_surface">87An additional interface to a wl_surface object, which has been
88made a sub-surface. A sub-surface has one parent surface. A
89sub-surface's size and position are not limited to that of the parent.
90Particularly, a sub-surface is not automatically clipped to its
91parent's area.
92
93A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
94and the parent surface is mapped. The order of which one happens
95first is irrelevant. A sub-surface is hidden if the parent becomes
96hidden, or if a NULL wl_buffer is applied. These rules apply
97recursively through the tree of surfaces.
98
99The behaviour of wl_surface.commit request on a sub-surface
100depends on the sub-surface's mode. The possible modes are
101synchronized and desynchronized, see methods
102wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
103mode caches the wl_surface state to be applied when the parent's
104state gets applied, and desynchronized mode applies the pending
105wl_surface state directly. A sub-surface is initially in the
106synchronized mode.
107
108Sub-surfaces have also other kind of state, which is managed by
109wl_subsurface requests, as opposed to wl_surface requests. This
110state includes the sub-surface position relative to the parent
111surface (wl_subsurface.set_position), and the stacking order of
112the parent and its sub-surfaces (wl_subsurface.place_above and
113.place_below). This state is applied when the parent surface's
114wl_surface state is applied, regardless of the sub-surface's mode.
115As the exception, set_sync and set_desync are effective immediately.
116
117The main surface can be thought to be always in desynchronized mode,
118since it does not have a parent in the sub-surfaces sense.
119
120Even if a sub-surface is in desynchronized mode, it will behave as
121in synchronized mode, if its parent surface behaves as in
122synchronized mode. This rule is applied recursively throughout the
123tree of surfaces. This means, that one can set a sub-surface into
124synchronized mode, and then assume that all its child and grand-child
125sub-surfaces are synchronized, too, without explicitly setting them.
126
127If the wl_surface associated with the wl_subsurface is destroyed, the
128wl_subsurface object becomes inert. Note, that destroying either object
129takes effect immediately. If you need to synchronize the removal
130of a sub-surface to the parent surface update, unmap the sub-surface
131first by attaching a NULL wl_buffer, update parent, and then destroy
132the sub-surface.
133
134If the parent wl_surface object is destroyed, the sub-surface is
135unmapped.
136</description>137
138<request name="destroy" type="destructor">139<description summary="remove sub-surface interface">140The sub-surface interface is removed from the wl_surface object
141that was turned into a sub-surface with
142wl_subcompositor.get_subsurface request. The wl_surface's association
143to the parent is deleted, and the wl_surface loses its role as
144a sub-surface. The wl_surface is unmapped.
145</description>146</request>147
148<enum name="error">149<entry name="bad_surface" value="0"150summary="wl_surface is not a sibling or the parent"/>151</enum>152
153<request name="set_position">154<description summary="reposition the sub-surface">155This schedules a sub-surface position change.
156The sub-surface will be moved so, that its origin (top-left
157corner pixel) will be at the location x, y of the parent surface
158coordinate system. The coordinates are not restricted to the parent
159surface area. Negative values are allowed.
160
161The next wl_surface.commit on the parent surface will reset
162the sub-surface's position to the scheduled coordinates.
163
164The initial position is 0, 0.
165</description>166
167<arg name="x" type="int" summary="coordinate in the parent surface"/>168<arg name="y" type="int" summary="coordinate in the parent surface"/>169</request>170
171<request name="place_above">172<description summary="restack the sub-surface">173This sub-surface is taken from the stack, and put back just
174above the reference surface, changing the z-order of the sub-surfaces.
175The reference surface must be one of the sibling surfaces, or the
176parent surface. Using any other surface, including this sub-surface,
177will cause a protocol error.
178
179The z-order is double-buffered state, and will be applied on the
180next commit of the parent surface.
181See wl_surface.commit and wl_subcompositor.get_subsurface.
182
183A new sub-surface is initially added as the top-most in the stack
184of its siblings and parent.
185</description>186
187<arg name="sibling" type="object" interface="wl_surface"188summary="the reference surface"/>189</request>190
191<request name="place_below">192<description summary="restack the sub-surface">193The sub-surface is placed just below of the reference surface.
194See wl_subsurface.place_above.
195</description>196
197<arg name="sibling" type="object" interface="wl_surface"198summary="the reference surface"/>199</request>200
201<request name="set_sync">202<description summary="set sub-surface to synchronized mode">203Change the commit behaviour of the sub-surface to synchronized
204mode, also described as the parent dependent mode.
205
206In synchronized mode, wl_surface.commit on a sub-surface will
207accumulate the committed state in a cache, but the state will
208not be applied and hence will not change the compositor output.
209The cached state is applied to the sub-surface immediately after
210the parent surface's state is applied. This ensures atomic
211updates of the parent and all its synchronized sub-surfaces.
212Applying the cached state will invalidate the cache, so further
213parent surface commits do not (re-)apply old state.
214
215See wl_subsurface for the recursive effect of this mode.
216</description>217</request>218
219<request name="set_desync">220<description summary="set sub-surface to desynchronized mode">221Change the commit behaviour of the sub-surface to desynchronized
222mode, also described as independent or freely running mode.
223
224In desynchronized mode, wl_surface.commit on a sub-surface will
225apply the pending state directly, without caching, as happens
226normally with a wl_surface. Calling wl_surface.commit on the
227parent surface has no effect on the sub-surface's wl_surface
228state. This mode allows a sub-surface to be updated on its own.
229
230If cached state exists when wl_surface.commit is called in
231desynchronized mode, the pending state is added to the cached
232state, and applied as whole. This invalidates the cache.
233
234Note: even if a sub-surface is set to desynchronized, a parent
235sub-surface may override it to behave as synchronized. For details,
236see wl_subsurface.
237
238If a surface's parent surface behaves as desynchronized, then
239the cached state is applied on set_desync.
240</description>241</request>242
243</interface>244</protocol>245