protocol: try to clarify wl_buffer doc
[profile/ivi/wayland.git] / protocol / wayland.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="wayland">
3
4   <copyright>
5     Copyright © 2008-2011 Kristian Høgsberg
6     Copyright © 2010-2011 Intel Corporation
7
8     Permission to use, copy, modify, distribute, and sell this
9     software and its documentation for any purpose is hereby granted
10     without fee, provided that the above copyright notice appear in
11     all copies and that both that copyright notice and this permission
12     notice appear in supporting documentation, and that the name of
13     the copyright holders not be used in advertising or publicity
14     pertaining to distribution of the software without specific,
15     written prior permission.  The copyright holders make no
16     representations about the suitability of this software for any
17     purpose.  It is provided "as is" without express or implied
18     warranty.
19
20     THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21     SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22     FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23     SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25     AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26     ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
27     THIS SOFTWARE.
28   </copyright>
29
30   <interface name="wl_display" version="1">
31     <description summary="core global object">
32       The core global object.  This is a special singleton object.  It
33       is used for internal Wayland protocol features.
34     </description>
35
36     <request name="sync">
37       <description summary="asynchronous roundtrip">
38         The sync request asks the server to emit the 'done' event
39         on the provided wl_callback object.  Since requests are
40         handled in-order, this can be used as a barrier to ensure all
41         previous requests have been handled.
42       </description>
43       <arg name="callback" type="new_id" interface="wl_callback"/>
44     </request>
45
46     <request name="get_registry">
47       <arg name="callback" type="new_id" interface="wl_registry"/>
48     </request>
49
50     <event name="error">
51       <description summary="fatal error event">
52         The error event is sent out when a fatal (non-recoverable)
53         error has occurred.
54       </description>
55       <arg name="object_id" type="object"/>
56       <arg name="code" type="uint"/>
57       <arg name="message" type="string"/>
58     </event>
59
60     <enum name="error">
61       <description summary="global error values">
62         These errors are global and can be emitted in response to any
63         server request.
64       </description>
65       <entry name="invalid_object" value="0"
66              summary="server couldn't find object"/>
67       <entry name="invalid_method" value="1"
68              summary="method doesn't exist on the specified interface"/>
69       <entry name="no_memory" value="2"
70              summary="server is out of memory"/>
71     </enum>
72
73     <event name="delete_id">
74       <description summary="acknowledge object id deletion">
75         Server has deleted the id and client can now reuse it.
76       </description>
77       <arg name="id" type="uint" />
78     </event>
79   </interface>
80
81   <interface name="wl_registry" version="1">
82     <request name="bind">
83       <description summary="bind an object to the display">
84         Binds a new, client-created object to the server using @name as
85         the identifier.
86       </description>
87       <arg name="name" type="uint" summary="unique number id for object"/>
88       <arg name="id" type="new_id"/>
89     </request>
90
91     <event name="global">
92       <description summary="announce global object">
93         Notify the client of global objects.  These are objects that
94         are created by the server.  Globals are published on the
95         initial client connection sequence, upon device hotplugs,
96         device disconnects, reconfiguration or other events.  A client
97         can 'bind' to a global object by using the bind request.  This
98         creates a client side handle that lets the object emit events
99         to the client and lets the client invoke requests on the
100         object.
101       </description>
102       <arg name="name" type="uint"/>
103       <arg name="interface" type="string"/>
104       <arg name="version" type="uint"/>
105     </event>
106
107     <event name="global_remove">
108       <description summary="announce removal of global object">
109         Notify the client of removed global objects.
110       </description>
111       <arg name="name" type="uint"/>
112     </event>
113   </interface>
114
115   <interface name="wl_callback" version="1">
116     <event name="done">
117       <arg name="serial" type="uint"/>
118     </event>
119   </interface>
120
121   <interface name="wl_compositor" version="1">
122     <description summary="the compositor singleton">
123       A compositor.  This object is a singleton global.  The
124       compositor is in charge of combining the contents of multiple
125       surfaces into one displayable output.
126     </description>
127
128     <request name="create_surface">
129       <description summary="create new surface">
130         Ask the compositor to create a new surface.
131       </description>
132       <arg name="id" type="new_id" interface="wl_surface"/>
133     </request>
134
135     <request name="create_region">
136       <description summary="create new region">
137         Ask the compositor to create a new region.
138       </description>
139       <arg name="id" type="new_id" interface="wl_region"/>
140     </request>
141   </interface>
142
143   <interface name="wl_shm_pool" version="1">
144     <description summary="a shared memory pool">
145       The wl_shm_pool object encapsulates a piece of memory shared
146       between the compositor and client.  Through the wl_shm_pool
147       object, the client can allocate shared memory wl_buffer objects.
148       The objects will share the same underlying mapped memory.
149       Reusing the mapped memory avoids the setup/teardown overhead and
150       is useful when interactively resizing a surface or for many
151       small buffers.
152     </description>
153
154     <request name="create_buffer">
155       <description summary="create wl_buffer from pool">
156         Create a wl_buffer from the pool.  The buffer is created a
157         offset bytes into the pool and has width and height as
158         specified.  The stride arguments specifies the number of bytes
159         from beginning of one row to the beginning of the next.  The
160         format is the pixel format of the buffer and must be one of
161         those advertised through the wl_shm.format event.
162
163         A buffer will keep a reference to the pool it was created from
164         so it is valid to destroy the pool immediately after creating
165         a buffer from it.
166       </description>
167
168       <arg name="id" type="new_id" interface="wl_buffer"/>
169       <arg name="offset" type="int"/>
170       <arg name="width" type="int"/>
171       <arg name="height" type="int"/>
172       <arg name="stride" type="int"/>
173       <arg name="format" type="uint"/>
174     </request>
175
176     <request name="destroy" type="destructor">
177       <description summary="destroy the pool">
178         Destroy the pool.
179       </description>
180     </request>
181
182     <request name="resize">
183       <description summary="change the size of the pool mapping">
184         This request will cause the server to remap the backing memory
185         for the pool from the fd passed when the pool was creating but
186         using the new size.
187       </description>
188
189       <arg name="size" type="int"/>
190     </request>
191   </interface>
192
193   <interface name="wl_shm" version="1">
194     <description summary="shared memory support">
195       Support for shared memory buffers.
196     </description>
197
198     <enum name="error">
199       <entry name="invalid_format" value="0"/>
200       <entry name="invalid_stride" value="1"/>
201       <entry name="invalid_fd" value="2"/>
202     </enum>
203
204     <enum name="format">
205       <entry name="argb8888" value="0"/>
206       <entry name="xrgb8888" value="1"/>
207     </enum>
208
209     <request name="create_pool">
210       <description summary="create a shm pool">
211         This creates wl_shm_pool object, which can be used to create
212         shared memory based wl_buffer objects.  The server will mmap
213         size bytes of the passed fd, to use as backing memory for then
214         pool.
215       </description>
216
217       <arg name="id" type="new_id" interface="wl_shm_pool"/>
218       <arg name="fd" type="fd"/>
219       <arg name="size" type="int"/>
220     </request>
221
222     <event name="format">
223       <arg name="format" type="uint"/>
224     </event>
225   </interface>
226
227   <interface name="wl_buffer" version="1">
228     <description summary="content for a wl_surface">
229       A buffer provides the content for a wl_surface. Buffers are
230       created through factory interfaces such as wl_drm, wl_shm or
231       similar. It has a width and a height and can be attached to a
232       wl_surface, but the mechanism by which a client provides and
233       updates the contents is defined by the buffer factory interface.
234     </description>
235
236     <request name="destroy" type="destructor">
237       <description summary="destroy a buffer">
238         Destroy a buffer. If and how you need to release the backing
239         storage is defined by the buffer factory interface.
240
241         For possible side-effects to a surface, see wl_surface.attach.
242       </description>
243     </request>
244
245     <event name="release">
246       <description summary="compositor releases buffer">
247         Sent when this wl_buffer is no longer used by the compositor.
248         The client is now free to re-use or destroy this buffer and its
249         backing storage.
250
251         If a client receives a release event before the frame callback
252         requested in the same wl_surface.commit that attaches this
253         wl_buffer to a surface, then the client is immediately free to
254         re-use the buffer and its backing storage, and does not need a
255         second buffer for the next surface content update. Typically
256         this is possible, when the compositor maintains a copy of the
257         wl_surface contents, e.g. as a GL texture. This is an important
258         optimization for GL(ES) compositors with wl_shm clients.
259       </description>
260     </event>
261   </interface>
262
263
264   <interface name="wl_data_offer" version="1">
265     <request name="accept">
266       <description summary="accept one of the offered mime-types">
267         Indicate that the client can accept the given mime-type, or
268         NULL for not accepted.  Use for feedback during drag and drop.
269       </description>
270
271       <arg name="serial" type="uint"/>
272       <arg name="type" type="string" allow-null="true"/>
273     </request>
274
275     <request name="receive">
276       <arg name="mime_type" type="string"/>
277       <arg name="fd" type="fd"/>
278     </request>
279
280     <request name="destroy" type="destructor"/>
281
282     <event name="offer">
283       <description summary="advertise offered mime-type">
284         Sent immediately after creating the wl_data_offer object.  One
285         event per offered mime type.
286       </description>
287
288       <arg name="type" type="string"/>
289     </event>
290   </interface>
291
292   <interface name="wl_data_source" version="1">
293     <request name="offer">
294       <description summary="add an offered mime type">
295         This request adds a mime-type to the set of mime-types
296         advertised to targets.  Can be called several times to offer
297         multiple types.
298       </description>
299       <arg name="type" type="string"/>
300     </request>
301
302     <request name="destroy" type="destructor">
303       <description summary="destroy the data source">
304         Destroy the data source.
305       </description>
306     </request>
307
308     <event name="target">
309       <description summary="a target accepts an offered mime-type">
310         Sent when a target accepts pointer_focus or motion events.  If
311         a target does not accept any of the offered types, type is NULL.
312       </description>
313
314       <arg name="mime_type" type="string" allow-null="true"/>
315     </event>
316
317     <event name="send">
318       <description summary="send the data">
319         Request for data from another client.  Send the data as the
320         specified mime-type over the passed fd, then close the fd.
321       </description>
322
323       <arg name="mime_type" type="string"/>
324       <arg name="fd" type="fd"/>
325     </event>
326
327     <event name="cancelled">
328       <description summary="selection was cancelled">
329         Another selection became active.
330       </description>
331     </event>
332
333   </interface>
334
335   <interface name="wl_data_device" version="1">
336     <request name="start_drag">
337       <description summary="start drag and drop operation">
338         This request asks the compositor to start a drag and drop
339         operation on behalf of the client.
340
341         The source argument is the data source that provides the data
342         for the eventual data transfer. If source is NULL, enter, leave
343         and motion events are sent only to the client that initiated the
344         drag and the client is expected to handle the data passing
345         internally.
346
347         The origin surface is the surface where the drag originates and
348         the client must have an active implicit grab that matches the
349         serial.
350
351         The icon surface is an optional (can be nil) surface that
352         provides an icon to be moved around with the cursor.  Initially,
353         the top-left corner of the icon surface is placed at the cursor
354         hotspot, but subsequent wl_surface.attach request can move the
355         relative position. Attach requests must be confirmed with
356         wl_surface.commit as usual.
357
358         The current and pending input regions of the icon wl_surface are
359         cleared, and wl_surface.set_input_region is ignored until the
360         wl_surface is no longer used as the icon surface. When the use
361         as an icon ends, the the current and pending input regions
362         become undefined, and the wl_surface is unmapped.
363       </description>
364       <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
365       <arg name="origin" type="object" interface="wl_surface"/>
366       <arg name="icon" type="object" interface="wl_surface" allow-null="true"/>
367       <arg name="serial" type="uint"/>
368     </request>
369
370     <request name="set_selection">
371       <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
372       <arg name="serial" type="uint"/>
373     </request>
374
375     <event name="data_offer">
376       <description summary="introduce a new wl_data_offer">
377         The data_offer event introduces a new wl_data_offer object,
378         which will subsequently be used in either the
379         data_device.enter event (for drag and drop) or the
380         data_device.selection event (for selections).  Immediately
381         following the data_device_data_offer event, the new data_offer
382         object will send out data_offer.offer events to describe the
383         mime-types it offers.
384       </description>
385
386       <arg name="id" type="new_id" interface="wl_data_offer"/>
387     </event>
388
389     <event name="enter">
390       <arg name="serial" type="uint"/>
391       <arg name="surface" type="object" interface="wl_surface"/>
392       <arg name="x" type="fixed"/>
393       <arg name="y" type="fixed"/>
394       <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
395     </event>
396
397     <event name="leave"/>
398
399     <event name="motion">
400       <arg name="time" type="uint"/>
401       <arg name="x" type="fixed"/>
402       <arg name="y" type="fixed"/>
403     </event>
404
405     <event name="drop"/>
406
407     <event name="selection">
408       <description summary="advertise new selection">
409         The selection event is sent out to notify the client of a new
410         wl_data_offer for the selection for this device.  The
411         data_device.data_offer and the data_offer.offer events are
412         sent out immediately before this event to introduce the data
413         offer object.  The selection event is sent to a client
414         immediately before receiving keyboard focus and when a new
415         selection is set while the client has keyboard focus.  The
416         data_offer is valid until a new data_offer or NULL is received
417         or until the client loses keyboard focus.
418       </description>
419       <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
420     </event>
421   </interface>
422
423   <interface name="wl_data_device_manager" version="1">
424     <request name="create_data_source">
425       <arg name="id" type="new_id" interface="wl_data_source"/>
426     </request>
427
428     <request name="get_data_device">
429       <arg name="id" type="new_id" interface="wl_data_device"/>
430       <arg name="seat" type="object" interface="wl_seat"/>
431     </request>
432   </interface>
433
434   <interface name="wl_shell" version="1">
435     <request name="get_shell_surface">
436       <arg name="id" type="new_id" interface="wl_shell_surface"/>
437       <arg name="surface" type="object" interface="wl_surface"/>
438     </request>
439   </interface>
440
441   <interface name="wl_shell_surface" version="1">
442
443     <description summary="desktop style meta data interface">
444       An interface implemented by a wl_surface.  On server side the
445       object is automatically destroyed when the related wl_surface is
446       destroyed.  On client side, wl_shell_surface_destroy() must be
447       called before destroying the wl_surface object.
448     </description>
449
450     <request name="pong">
451       <description summary="respond to a ping event">
452         A client must respond to a ping event with a pong request or
453         the client may be deemed unresponsive.
454       </description>
455       <arg name="serial" type="uint"/>
456     </request>
457
458     <request name="move">
459       <arg name="seat" type="object" interface="wl_seat"/>
460       <arg name="serial" type="uint"/>
461     </request>
462
463     <enum name="resize">
464       <entry name="none" value="0"/>
465       <entry name="top" value="1"/>
466       <entry name="bottom" value="2"/>
467       <entry name="left" value="4"/>
468       <entry name="top_left" value="5"/>
469       <entry name="bottom_left" value="6"/>
470       <entry name="right" value="8"/>
471       <entry name="top_right" value="9"/>
472       <entry name="bottom_right" value="10"/>
473     </enum>
474
475     <request name="resize">
476       <arg name="seat" type="object" interface="wl_seat"/>
477       <arg name="serial" type="uint"/>
478       <arg name="edges" type="uint"/>
479     </request>
480
481     <request name="set_toplevel">
482       <description summary="make the surface a top level surface">
483         Make the surface a toplevel window.
484       </description>
485     </request>
486
487     <enum name="transient">
488       <entry name="inactive" value="0x1" summary="do not set keyboard focus"/>
489     </enum>
490
491     <request name="set_transient">
492       <description summary="make the surface a transient surface">
493         Map the surface relative to an existing surface. The x and y
494         arguments specify the locations of the upper left corner of
495         the surface relative to the upper left corner of the parent
496         surface.  The flags argument controls overflow/clipping
497         behaviour when the surface would intersect a screen edge,
498         panel or such.  And possibly whether the offset only
499         determines the initial position or if the surface is locked to
500         that relative position during moves.
501       </description>
502
503       <arg name="parent" type="object" interface="wl_surface"/>
504       <arg name="x" type="int"/>
505       <arg name="y" type="int"/>
506       <arg name="flags" type="uint"/>
507     </request>
508
509     <request name="set_fullscreen">
510       <description summary="make the surface a fullscreen surface">
511         Map the surface as a fullscreen surface. If an output parameter is
512         given then the surface will be made fullscreen on that output. If the
513         client does not specify the output then the compositor will apply its
514         policy - usually choosing the output on which the surface has the
515         biggest surface area.
516
517         The client may specify a method to resolve a size conflict between the
518         output size and the surface size - this is provided through the
519         fullscreen_method parameter.
520
521         The framerate parameter is used only when the fullscreen_method is set
522         to "driver", to indicate the preferred framerate. framerate=0 indicates
523         that the app does not care about framerate.  The framerate is
524         specified in mHz, that is framerate of 60000 is 60Hz.
525
526         The compositor must reply to this request with a configure event with
527         the dimensions for the output on which the surface will be made fullscreen.
528       </description>
529       <arg name="method" type="uint"/>
530       <arg name="framerate" type="uint"/>
531       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
532     </request>
533
534     <enum name="fullscreen_method">
535       <description summary="different method to set the surface fullscreen">
536         Hints to indicate compositor how to deal with a conflict between the
537         dimensions for the surface and the dimensions of the output. As a hint
538         the compositor is free to ignore this parameter.
539
540         "default" The client has no preference on fullscreen behavior,
541         policies are determined by compositor.
542
543         "scale" The client prefers scaling by the compositor. Scaling would
544         always preserve surface's aspect ratio with surface centered on the
545         output
546
547         "driver" The client wants to switch video mode to the smallest mode
548         that can fit the client buffer. If the sizes do not match the
549         compositor must add black borders.
550
551         "fill" The surface is centered on the output on the screen with no
552         scaling. If the surface is of insufficient size the compositor must
553         add black borders.
554       </description>
555       <entry name="default" value="0"/>
556       <entry name="scale" value="1"/>
557       <entry name="driver" value="2"/>
558       <entry name="fill" value="3"/>
559     </enum>
560
561     <request name="set_popup">
562       <description summary="make the surface a popup surface">
563         Popup surfaces.  Will switch an implicit grab into
564         owner-events mode, and grab will continue after the implicit
565         grab ends (button released).  Once the implicit grab is over,
566         the popup grab continues until the window is destroyed or a
567         mouse button is pressed in any other clients window.  A click
568         in any of the clients surfaces is reported as normal, however,
569         clicks in other clients surfaces will be discarded and trigger
570         the callback.
571
572         TODO: Grab keyboard too, maybe just terminate on any click
573         inside or outside the surface?
574       </description>
575
576       <arg name="seat" type="object" interface="wl_seat"/>
577       <arg name="serial" type="uint"/>
578       <arg name="parent" type="object" interface="wl_surface"/>
579       <arg name="x" type="int"/>
580       <arg name="y" type="int"/>
581       <arg name="flags" type="uint"/>
582     </request>
583
584     <request name="set_maximized">
585       <description summary="make the surface a maximized surface">
586         A request from the client to notify the compositor the maximized
587         operation. The compositor will reply with a configure event telling
588         the expected new surface size. The operation is completed on the
589         next buffer attach to this surface.
590         A maximized client will fill the fullscreen of the output it is bound
591         to, except the panel area. This is the main difference between
592         a maximized shell surface and a fullscreen shell surface.
593       </description>
594       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
595     </request>
596
597     <request name="set_title">
598       <description summary="set surface title">
599       </description>
600       <arg name="title" type="string"/>
601     </request>
602
603     <request name="set_class">
604       <description summary="set surface class">
605         The surface class identifies the general class of applications
606         to which the surface belongs.  The class is the file name of
607         the applications .desktop file (absolute path if non-standard
608         location). 
609       </description>
610       <arg name="class_" type="string"/>
611     </request>
612
613     <event name="ping">
614       <description summary="ping client">
615         Ping a client to check if it is receiving events and sending
616         requests. A client is expected to reply with a pong request.
617       </description>
618       <arg name="serial" type="uint"/>
619     </event>
620
621     <event name="configure">
622       <description summary="suggest resize">
623         The configure event asks the client to resize its surface.
624         The size is a hint, in the sense that the client is free to
625         ignore it if it doesn't resize, pick a smaller size (to
626         satisfy aspect ratio or resize in steps of NxM pixels).  The
627         client is free to dismiss all but the last configure event it
628         received.
629       </description>
630
631       <arg name="edges" type="uint"/>
632       <arg name="width" type="int"/>
633       <arg name="height" type="int"/>
634     </event>
635
636     <event name="popup_done">
637       <description summary="popup interaction is done">
638         The popup_done event is sent out when a popup grab is broken,
639         that is, when the users clicks a surface that doesn't belong
640         to the client owning the popup surface.
641       </description>
642     </event>
643   </interface>
644
645   <interface name="wl_surface" version="1">
646     <description summary="an onscreen surface">
647       A surface.  This is an image that is displayed on the screen.
648       It has a location, size and pixel contents.
649     </description>
650
651     <request name="destroy" type="destructor">
652       <description summary="delete surface">
653         Deletes the surface and invalidates its object id.
654       </description>
655     </request>
656
657     <request name="attach">
658       <description summary="set the surface contents">
659         Set the contents of a buffer into this surface. The x and y
660         arguments specify the location of the new pending buffer's upper
661         left corner, relative to the current buffer's upper left corner. In
662         other words, the x and y, and the width and height of the wl_buffer
663         together define in which directions the surface's size changes.
664
665         Surface contents are double-buffered state, see wl_surface.commit.
666
667         The initial surface contents are void; there is no content.
668         wl_surface.attach assigns the given wl_buffer as the pending wl_buffer.
669         wl_surface.commit applies the pending wl_buffer as the new
670         surface contents, and the size of the surface becomes the size of
671         the wl_buffer. The wl_buffer is also kept as pending, until
672         changed by wl_surface.attach or the wl_buffer is destroyed.
673
674         Committing a pending wl_buffer allows the compositor to read the
675         pixels in the wl_buffer. The compositor may access the pixels at any
676         time after the wl_surface.commit request. When the compositor will
677         not access the pixels anymore, it will send the wl_buffer.release
678         event. Only after receiving wl_buffer.release, the client may re-use
679         the wl_buffer. A wl_buffer, that has been attached and then replaced
680         by another attach instead of committed, will not receive a release
681         event, and is not used by the compositor.
682
683         Destroying the wl_buffer after wl_buffer.release does not change the
684         surface contents, even if the wl_buffer is still pending for the
685         next commit. In such case, the next commit does not change the
686         surface contents. However, if the client destroys the wl_buffer
687         before receiving wl_buffer.release, the surface contents become
688         undefined immediately.
689
690         Only if wl_surface.attach is sent with a nil wl_buffer, the
691         following wl_surface.commit will remove the surface content.
692       </description>
693
694       <arg name="buffer" type="object" interface="wl_buffer" allow-null="true"/>
695       <arg name="x" type="int"/>
696       <arg name="y" type="int"/>
697     </request>
698
699     <request name="damage">
700       <description summary="mark part of the surface damaged">
701         This request is used to describe the regions where the pending
702         buffer (or if pending buffer is none, the current buffer as updated
703         in-place) on the next wl_surface.commit will be different from the
704         current buffer, and needs to be repainted. The pending buffer can be
705         set by wl_surface.attach. The compositor ignores the parts of the
706         damage that fall outside of the surface.
707
708         Damage is double-buffered state, see wl_surface.commit.
709
710         The initial value for pending damage is empty: no damage.
711         wl_surface.damage adds pending damage: the new pending damage is the
712         union of old pending damage and the given rectangle.
713         wl_surface.commit assigns pending damage as the current damage, and
714         clears pending damage. The server will clear the current damage as
715         it repaints the surface.
716       </description>
717
718       <arg name="x" type="int"/>
719       <arg name="y" type="int"/>
720       <arg name="width" type="int"/>
721       <arg name="height" type="int"/>
722     </request>
723
724     <request name="frame">
725       <description summary="request repaint feedback">
726         Request notification when the next frame is displayed. Useful
727         for throttling redrawing operations, and driving animations.
728         The frame request will take effect on the next wl_surface.commit.
729         The notification will only be posted for one frame unless
730         requested again.
731
732         A server should avoid signalling the frame callbacks if the
733         surface is not visible in any way, e.g. the surface is off-screen,
734         or completely obscured by other opaque surfaces.
735
736         A client can request a frame callback even without an attach,
737         damage, or any other state changes. wl_surface.commit triggers a
738         display update, so the callback event will arrive after the next
739         output refresh where the surface is visible.
740       </description>
741
742       <arg name="callback" type="new_id" interface="wl_callback"/>
743     </request>
744
745     <request name="set_opaque_region">
746       <description summary="set opaque region">
747         This request sets the region of the surface that contains
748         opaque content.  The opaque region is an optimization hint for
749         the compositor that lets it optimize out redrawing of content
750         behind opaque regions.  Setting an opaque region is not
751         required for correct behaviour, but marking transparent
752         content as opaque will result in repaint artifacts.
753         The compositor ignores the parts of the opaque region that fall
754         outside of the surface.
755
756         Opaque region is double-buffered state, see wl_surface.commit.
757
758         wl_surface.set_opaque_region changes the pending opaque region.
759         wl_surface.commit copies the pending region to the current region.
760         Otherwise the pending and current regions are never changed.
761
762         The initial value for opaque region is empty. Setting the pending
763         opaque region has copy semantics, and the wl_region object can be
764         destroyed immediately. A nil wl_region causes the pending opaque
765         region to be set to empty.
766       </description>
767
768       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
769     </request>
770
771     <request name="set_input_region">
772       <description summary="set input region">
773         This request sets the region of the surface that can receive
774         pointer and touch events. Input events happening outside of
775         this region will try the next surface in the server surface
776         stack. The compositor ignores the parts of the input region that
777         fall outside of the surface.
778
779         Input region is double-buffered state, see wl_surface.commit.
780
781         wl_surface.set_input_region changes the pending input region.
782         wl_surface.commit copies the pending region to the current region.
783         Otherwise the pending and current regions are never changed,
784         except cursor and icon surfaces are special cases, see
785         wl_pointer.set_cursor and wl_data_device.start_drag.
786
787         The initial value for input region is infinite. That means the whole
788         surface will accept input. Setting the pending input region has copy
789         semantics, and the wl_region object can be destroyed immediately. A
790         nil wl_region causes the input region to be set to infinite.
791       </description>
792
793       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
794     </request>
795
796     <request name="commit">
797       <description summary="commit pending surface state">
798         Surface state (input, opaque, and damage regions, attached buffers,
799         etc.) is double-buffered. Protocol requests modify the pending
800         state, as opposed to current state in use by the compositor. Commit
801         request atomically applies all pending state, replacing the current
802         state. After commit, the new pending state is as documented for each
803         related request.
804
805         On commit, a pending wl_buffer is applied first, all other state
806         second. This means that all coordinates in double-buffered state are
807         relative to the new wl_buffer coming into use, except for
808         wl_surface.attach itself. If the pending wl_buffer is none, the
809         coordinates are relative to the current surface contents.
810
811         All requests that need a commit to become effective are documented
812         to affect double-buffered state.
813
814         Other interfaces may add further double-buffered surface state.
815       </description>
816     </request>
817
818     <event name="enter">
819       <description summary="surface enters an output">
820         This is emitted whenever a surface's creation, movement, or resizing
821         results in some part of it being within the scanout region of an
822         output.
823       </description>
824       <arg name="output" type="object" interface="wl_output"/>
825     </event>
826
827     <event name="leave">
828       <description summary="surface leaves an output">
829         This is emitted whenever a surface's creation, movement, or resizing
830         results in it no longer having any part of it within the scanout region
831         of an output.
832       </description>
833       <arg name="output" type="object" interface="wl_output"/>
834     </event>
835   </interface>
836
837   <interface name="wl_seat" version="1">
838     <description summary="seat">
839       A group of keyboards, pointer (mice, for example) and touch
840       devices . This object is published as a global during start up,
841       or when such a device is hot plugged.  A seat typically has a
842       pointer and maintains a keyboard_focus and a pointer_focus.
843     </description>
844
845     <enum name="capability">
846       <description summary="seat capability bitmask">
847         This is a bitmask of capabilities this seat has; if a member is
848         set, then it is present on the seat.
849       </description>
850       <entry name="pointer" value="1" summary="wl_pointer"/>
851       <entry name="keyboard" value="2" summary="wl_keyboard"/>
852       <entry name="touch" value="4" summary="wl_touch"/>
853     </enum>
854
855
856     <event name="capabilities">
857       <description summary="seat capabilities changed">
858         This is emitted whenever a seat gains or loses the pointer,
859         keyboard or touch capabilities.  The argument is a wl_seat_caps_mask
860         enum containing the complete set of capabilities this seat has.
861       </description>
862       <arg name="capabilities" type="uint"/>
863     </event>
864
865     <request name="get_pointer">
866       <description summary="return pointer object">
867         The ID provided will be initialized to the wl_pointer interface
868         for this seat.
869       </description>
870       <arg name="id" type="new_id" interface="wl_pointer"/>
871     </request>
872
873     <request name="get_keyboard">
874       <description summary="return pointer object">
875         The ID provided will be initialized to the wl_keyboard interface
876         for this seat.
877       </description>
878       <arg name="id" type="new_id" interface="wl_keyboard"/>
879     </request>
880
881     <request name="get_touch">
882       <description summary="return pointer object">
883         The ID provided will be initialized to the wl_touch interface
884         for this seat.
885       </description>
886       <arg name="id" type="new_id" interface="wl_touch"/>
887     </request>
888   </interface>
889
890   <interface name="wl_pointer" version="1">
891     <request name="set_cursor">
892       <description summary="set the pointer surface">
893         Set the pointer surface, i.e., the surface that contains the
894         pointer image (cursor). This request only takes effect if the pointer
895         focus for this device is one of the requesting client's surfaces
896         or the surface parameter is the current pointer surface. If
897         there was a previous surface set with this request it is
898         replaced. If surface is NULL, the pointer image is hidden.
899
900         The parameters hotspot_x and hotspot_y define the position of
901         the pointer surface relative to the pointer location. Its
902         top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
903         where (x, y) are the coordinates of the pointer location.
904
905         On surface.attach requests to the pointer surface, hotspot_x
906         and hotspot_y are decremented by the x and y parameters
907         passed to the request. Attach must be confirmed by
908         wl_surface.commit as usual.
909
910         The hotspot can also be updated by passing the currently set
911         pointer surface to this request with new values for hotspot_x
912         and hotspot_y.
913
914         The current and pending input regions of the wl_surface are
915         cleared, and wl_surface.set_input_region is ignored until the
916         wl_surface is no longer used as the cursor. When the use as a
917         cursor ends, the current and pending input regions become
918         undefined, and the wl_surface is unmapped.
919       </description>
920
921       <arg name="serial" type="uint"/>
922       <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
923       <arg name="hotspot_x" type="int"/>
924       <arg name="hotspot_y" type="int"/>
925     </request>
926
927     <event name="enter">
928       <description summary="enter event">
929         Notification that this seat's pointer is focused on a certain
930         surface. When an seat's focus enters a surface, the pointer image
931         is undefined and a client should respond to this event by setting
932         an appropriate pointer image.
933       </description>
934
935       <arg name="serial" type="uint"/>
936       <arg name="surface" type="object" interface="wl_surface"/>
937       <arg name="surface_x" type="fixed"/>
938       <arg name="surface_y" type="fixed"/>
939     </event>
940
941     <event name="leave">
942       <description summary="leave event">
943       </description>
944       <arg name="serial" type="uint"/>
945       <arg name="surface" type="object" interface="wl_surface"/>
946     </event>
947
948     <event name="motion">
949       <description summary="pointer motion event">
950         Notification of pointer location change. The arguments surface_[xy]
951         are the location relative to the focused surface.
952       </description>
953
954       <arg name="time" type="uint"/>
955       <arg name="surface_x" type="fixed"/>
956       <arg name="surface_y" type="fixed"/>
957     </event>
958
959     <enum name="button_state">
960       <description summary="physical button state">
961         Describes the physical state of a button which provoked the button
962         event.
963       </description>
964       <entry name="released" value="0" summary="button is not pressed"/>
965       <entry name="pressed" value="1" summary="button is pressed"/>
966     </enum>
967
968     <event name="button">
969       <description summary="pointer button event">
970         Mouse button click and release notifications.  The location
971         of the click is given by the last motion or pointer_focus event.
972       </description>
973
974       <arg name="serial" type="uint"/>
975       <arg name="time" type="uint"/>
976       <arg name="button" type="uint"/>
977       <arg name="state" type="uint"/>
978     </event>
979
980     <enum name="axis">
981       <description summary="axis types"/>
982       <entry name="vertical_scroll" value="0"/>
983       <entry name="horizontal_scroll" value="1"/>
984     </enum>
985
986     <event name="axis">
987       <description summary="axis event">
988         Scroll and other axis notifications.
989
990         For scroll events (vertical and horizontal scroll axes), the
991         value parameter is the length of a vector along the specified
992         axis in a coordinate space identical to those of motion events,
993         representing a relative movement along the specified axis.
994
995         For devices that support movements non-parallel to axes multiple
996         axis events will be emitted.
997
998         When applicable, for example for touch pads, the server can
999         choose to emit scroll events where the motion vector is
1000         equivalent to a motion event vector.
1001
1002         When applicable, clients can transform its view relative to the
1003         scroll distance.
1004       </description>
1005
1006       <arg name="time" type="uint"/>
1007       <arg name="axis" type="uint"/>
1008       <arg name="value" type="fixed"/>
1009     </event>
1010   </interface>
1011
1012   <interface name="wl_keyboard" version="1">
1013     <description summary="keyboard input device">
1014     </description>
1015
1016     <enum name="keymap_format">
1017       <description summary="keyboard mapping format">
1018         This enum specifies the format of the keymap provided to the client
1019         with the wl_keyboard::keymap event.
1020       </description>
1021       <entry name="xkb_v1" value="1" description="libxkbcommon compatible"/>
1022     </enum>
1023
1024     <event name="keymap">
1025       <description summary="keyboard mapping">
1026         This event provides a file descriptor to the client which can be
1027         memory-mapped to provide a keyboard mapping description.
1028       </description>
1029       <arg name="format" type="uint"/>
1030       <arg name="fd" type="fd"/>
1031       <arg name="size" type="uint"/>
1032     </event>
1033
1034     <event name="enter">
1035       <arg name="serial" type="uint"/>
1036       <arg name="surface" type="object" interface="wl_surface"/>
1037       <arg name="keys" type="array"/>
1038     </event>
1039
1040     <event name="leave">
1041       <arg name="serial" type="uint"/>
1042       <arg name="surface" type="object" interface="wl_surface"/>
1043     </event>
1044
1045     <enum name="key_state">
1046       <description summary="physical key state">
1047         Describes the physical state of a key which provoked the key event.
1048       </description>
1049       <entry name="released" value="0" summary="key is not pressed"/>
1050       <entry name="pressed" value="1" summary="key is pressed"/>
1051     </enum>
1052
1053     <event name="key">
1054       <description summary="key event">
1055         A key was pressed or released.
1056       </description>
1057
1058       <arg name="serial" type="uint"/>
1059       <arg name="time" type="uint"/>
1060       <arg name="key" type="uint"/>
1061       <arg name="state" type="uint"/>
1062     </event>
1063
1064     <event name="modifiers">
1065       <description summary="modifier and group state">
1066         Notifies clients that the modifier and/or group state has
1067         changed, and it should update its local state.
1068       </description>
1069
1070       <arg name="serial" type="uint"/>
1071       <arg name="mods_depressed" type="uint"/>
1072       <arg name="mods_latched" type="uint"/>
1073       <arg name="mods_locked" type="uint"/>
1074       <arg name="group" type="uint"/>
1075     </event>
1076   </interface>
1077
1078   <interface name="wl_touch" version="1">
1079     <description summary="touch screen input device">
1080     </description>
1081
1082     <event name="down">
1083       <arg name="serial" type="uint"/>
1084       <arg name="time" type="uint"/>
1085       <arg name="surface" type="object" interface="wl_surface"/>
1086       <arg name="id" type="int" />
1087       <arg name="x" type="fixed" />
1088       <arg name="y" type="fixed" />
1089     </event>
1090
1091     <event name="up">
1092       <arg name="serial" type="uint"/>
1093       <arg name="time" type="uint"/>
1094       <arg name="id" type="int" />
1095     </event>
1096
1097     <event name="motion">
1098       <arg name="time" type="uint"/>
1099       <arg name="id" type="int" />
1100       <arg name="x" type="fixed" />
1101       <arg name="y" type="fixed" />
1102     </event>
1103
1104     <event name="frame">
1105       <description summary="end of touch frame event">
1106         Indicates the end of a contact point list.
1107       </description>
1108     </event>
1109
1110     <event name="cancel">
1111       <description summary="touch session cancelled">
1112         Sent if the compositor decides the touch stream is a global
1113         gesture. No further events are sent to the clients from that
1114         particular gesture.
1115       </description>
1116     </event>
1117   </interface>
1118
1119
1120   <interface name="wl_output" version="1">
1121     <description summary="compositor output region">
1122       An output describes part of the compositor geometry.  The
1123       compositor work in the 'compositor coordinate system' and an
1124       output corresponds to rectangular area in that space that is
1125       actually visible.  This typically corresponds to a monitor that
1126       displays part of the compositor space.  This object is published
1127       as global during start up, or when a screen is hot plugged.
1128     </description>
1129
1130     <enum name="subpixel">
1131       <entry name="unknown" value="0"/>
1132       <entry name="none" value="1"/>
1133       <entry name="horizontal_rgb" value="2"/>
1134       <entry name="horizontal_bgr" value="3"/>
1135       <entry name="vertical_rgb" value="4"/>
1136       <entry name="vertical_bgr" value="5"/>
1137     </enum>
1138
1139     <enum name="transform">
1140       <description summary="transform from framebuffer to output">
1141         This describes the transform that a compositor will apply to a
1142         surface to compensate for the rotation or mirroring of an
1143         output device.
1144
1145         The flipped values correspond to an initial flip around a
1146         vertical axis followed by rotation.
1147
1148         The purpose is mainly to allow clients render accordingly and
1149         tell the compositor, so that for fullscreen surfaces, the
1150         compositor will still be able to scan out directly from client
1151         surfaces.
1152       </description>
1153
1154       <entry name="normal" value="0"/>
1155       <entry name="90" value="1"/>
1156       <entry name="180" value="2"/>
1157       <entry name="270" value="3"/>
1158       <entry name="flipped" value="4"/>
1159       <entry name="flipped_90" value="5"/>
1160       <entry name="flipped_180" value="6"/>
1161       <entry name="flipped_270" value="7"/>
1162     </enum>
1163
1164     <event name="geometry">
1165       <description summary="properties of the output"/>
1166       <arg name="x" type="int"
1167            summary="x position within the global compositor space"/>
1168       <arg name="y" type="int"
1169            summary="y position within the global compositor space"/>
1170       <arg name="physical_width" type="int"
1171            summary="width in millimeters of the output"/>
1172       <arg name="physical_height" type="int"
1173            summary="height in millimeters of the output"/>
1174       <arg name="subpixel" type="int"
1175            summary="subpixel orientation of the output"/>
1176       <arg name="make" type="string"
1177            summary="textual description of the manufacturer"/>
1178       <arg name="model" type="string"
1179            summary="textual description of the model"/>
1180       <arg name="transform" type="int"
1181            summary="transform that maps framebuffer to output"/>
1182     </event>
1183
1184     <enum name="mode">
1185       <description summary="values for the flags bitfield in the mode event"/>
1186       <entry name="current" value="0x1"
1187              summary="indicates this is the current mode"/>
1188       <entry name="preferred" value="0x2"
1189              summary="indicates this is the preferred mode"/>
1190     </enum>
1191       
1192     <event name="mode">
1193       <description summary="advertise available modes for the output">
1194         The mode event describes an available mode for the output.
1195         The event is sent when binding to the output object and there
1196         will always be one mode, the current mode.  The event is sent
1197         again if an output changes mode, for the mode that is now
1198         current.  In other words, the current mode is always the last
1199         mode that was received with the current flag set.
1200       </description>
1201       <arg name="flags" type="uint" summary="mask of wl_output_mode flags"/>
1202       <arg name="width" type="int" summary="width of the mode in pixels"/>
1203       <arg name="height" type="int" summary="height of the mode in pixels"/>
1204       <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/>
1205     </event>
1206   </interface>
1207
1208   <interface name="wl_region" version="1">
1209     <description summary="region interface">
1210       Region.
1211     </description>
1212
1213     <request name="destroy" type="destructor">
1214       <description summary="destroy region">
1215         Destroy the region.  This will invalidate the object id.
1216       </description>
1217     </request>
1218
1219     <request name="add">
1220       <description summary="add rectangle to region">
1221         Add the specified rectangle to the region
1222       </description>
1223
1224       <arg name="x" type="int"/>
1225       <arg name="y" type="int"/>
1226       <arg name="width" type="int"/>
1227       <arg name="height" type="int"/>
1228     </request>
1229
1230     <request name="subtract">
1231       <description summary="subtract rectangle from region">
1232         Subtract the specified rectangle from the region
1233       </description>
1234
1235       <arg name="x" type="int"/>
1236       <arg name="y" type="int"/>
1237       <arg name="width" type="int"/>
1238       <arg name="height" type="int"/>
1239     </request>
1240
1241   </interface>
1242
1243 </protocol>