protocol: double-buffered state for wl_surface
[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.  This will invalidate the object id.
239       </description>
240     </request>
241
242     <event name="release">
243       <description summary="compositor releases buffer">
244         Sent when an attached buffer is no longer used by the compositor.
245       </description>
246     </event>
247   </interface>
248
249
250   <interface name="wl_data_offer" version="1">
251     <request name="accept">
252       <description summary="accept one of the offered mime-types">
253         Indicate that the client can accept the given mime-type, or
254         NULL for not accepted.  Use for feedback during drag and drop.
255       </description>
256
257       <arg name="serial" type="uint"/>
258       <arg name="type" type="string" allow-null="true"/>
259     </request>
260
261     <request name="receive">
262       <arg name="mime_type" type="string"/>
263       <arg name="fd" type="fd"/>
264     </request>
265
266     <request name="destroy" type="destructor"/>
267
268     <event name="offer">
269       <description summary="advertise offered mime-type">
270         Sent immediately after creating the wl_data_offer object.  One
271         event per offered mime type.
272       </description>
273
274       <arg name="type" type="string"/>
275     </event>
276   </interface>
277
278   <interface name="wl_data_source" version="1">
279     <request name="offer">
280       <description summary="add an offered mime type">
281         This request adds a mime-type to the set of mime-types
282         advertised to targets.  Can be called several times to offer
283         multiple types.
284       </description>
285       <arg name="type" type="string"/>
286     </request>
287
288     <request name="destroy" type="destructor">
289       <description summary="destroy the data source">
290         Destroy the data source.
291       </description>
292     </request>
293
294     <event name="target">
295       <description summary="a target accepts an offered mime-type">
296         Sent when a target accepts pointer_focus or motion events.  If
297         a target does not accept any of the offered types, type is NULL.
298       </description>
299
300       <arg name="mime_type" type="string" allow-null="true"/>
301     </event>
302
303     <event name="send">
304       <description summary="send the data">
305         Request for data from another client.  Send the data as the
306         specified mime-type over the passed fd, then close the fd.
307       </description>
308
309       <arg name="mime_type" type="string"/>
310       <arg name="fd" type="fd"/>
311     </event>
312
313     <event name="cancelled">
314       <description summary="selection was cancelled">
315         Another selection became active.
316       </description>
317     </event>
318
319   </interface>
320
321   <interface name="wl_data_device" version="1">
322     <request name="start_drag">
323       <description summary="start drag and drop operation">
324         This request asks the compositor to start a drag and drop
325         operation on behalf of the client.
326
327         The source argument is the data source that provides the data
328         for the eventual data transfer. If source is NULL, enter, leave
329         and motion events are sent only to the client that initiated the
330         drag and the client is expected to handle the data passing
331         internally.
332
333         The origin surface is the surface where the drag originates and
334         the client must have an active implicit grab that matches the
335         serial.
336
337         The icon surface is an optional (can be nil) surface that
338         provides an icon to be moved around with the cursor.  Initially,
339         the top-left corner of the icon surface is placed at the cursor
340         hotspot, but subsequent surface.attach request can move the
341         relative position.
342       </description>
343       <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
344       <arg name="origin" type="object" interface="wl_surface"/>
345       <arg name="icon" type="object" interface="wl_surface" allow-null="true"/>
346       <arg name="serial" type="uint"/>
347     </request>
348
349     <request name="set_selection">
350       <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
351       <arg name="serial" type="uint"/>
352     </request>
353
354     <event name="data_offer">
355       <description summary="introduce a new wl_data_offer">
356         The data_offer event introduces a new wl_data_offer object,
357         which will subsequently be used in either the
358         data_device.enter event (for drag and drop) or the
359         data_device.selection event (for selections).  Immediately
360         following the data_device_data_offer event, the new data_offer
361         object will send out data_offer.offer events to describe the
362         mime-types it offers.
363       </description>
364
365       <arg name="id" type="new_id" interface="wl_data_offer"/>
366     </event>
367
368     <event name="enter">
369       <arg name="serial" type="uint"/>
370       <arg name="surface" type="object" interface="wl_surface"/>
371       <arg name="x" type="fixed"/>
372       <arg name="y" type="fixed"/>
373       <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
374     </event>
375
376     <event name="leave"/>
377
378     <event name="motion">
379       <arg name="time" type="uint"/>
380       <arg name="x" type="fixed"/>
381       <arg name="y" type="fixed"/>
382     </event>
383
384     <event name="drop"/>
385
386     <event name="selection">
387       <description summary="advertise new selection">
388         The selection event is sent out to notify the client of a new
389         wl_data_offer for the selection for this device.  The
390         data_device.data_offer and the data_offer.offer events are
391         sent out immediately before this event to introduce the data
392         offer object.  The selection event is sent to a client
393         immediately before receiving keyboard focus and when a new
394         selection is set while the client has keyboard focus.  The
395         data_offer is valid until a new data_offer or NULL is received
396         or until the client loses keyboard focus.
397       </description>
398       <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
399     </event>
400   </interface>
401
402   <interface name="wl_data_device_manager" version="1">
403     <request name="create_data_source">
404       <arg name="id" type="new_id" interface="wl_data_source"/>
405     </request>
406
407     <request name="get_data_device">
408       <arg name="id" type="new_id" interface="wl_data_device"/>
409       <arg name="seat" type="object" interface="wl_seat"/>
410     </request>
411   </interface>
412
413   <interface name="wl_shell" version="1">
414     <request name="get_shell_surface">
415       <arg name="id" type="new_id" interface="wl_shell_surface"/>
416       <arg name="surface" type="object" interface="wl_surface"/>
417     </request>
418   </interface>
419
420   <interface name="wl_shell_surface" version="1">
421
422     <description summary="desktop style meta data interface">
423       An interface implemented by a wl_surface.  On server side the
424       object is automatically destroyed when the related wl_surface is
425       destroyed.  On client side, wl_shell_surface_destroy() must be
426       called before destroying the wl_surface object.
427     </description>
428
429     <request name="pong">
430       <description summary="respond to a ping event">
431         A client must respond to a ping event with a pong request or
432         the client may be deemed unresponsive.
433       </description>
434       <arg name="serial" type="uint"/>
435     </request>
436
437     <request name="move">
438       <arg name="seat" type="object" interface="wl_seat"/>
439       <arg name="serial" type="uint"/>
440     </request>
441
442     <enum name="resize">
443       <entry name="none" value="0"/>
444       <entry name="top" value="1"/>
445       <entry name="bottom" value="2"/>
446       <entry name="left" value="4"/>
447       <entry name="top_left" value="5"/>
448       <entry name="bottom_left" value="6"/>
449       <entry name="right" value="8"/>
450       <entry name="top_right" value="9"/>
451       <entry name="bottom_right" value="10"/>
452     </enum>
453
454     <request name="resize">
455       <arg name="seat" type="object" interface="wl_seat"/>
456       <arg name="serial" type="uint"/>
457       <arg name="edges" type="uint"/>
458     </request>
459
460     <request name="set_toplevel">
461       <description summary="make the surface a top level surface">
462         Make the surface a toplevel window.
463       </description>
464     </request>
465
466     <enum name="transient">
467       <entry name="inactive" value="0x1" summary="do not set keyboard focus"/>
468     </enum>
469
470     <request name="set_transient">
471       <description summary="make the surface a transient surface">
472         Map the surface relative to an existing surface. The x and y
473         arguments specify the locations of the upper left corner of
474         the surface relative to the upper left corner of the parent
475         surface.  The flags argument controls overflow/clipping
476         behaviour when the surface would intersect a screen edge,
477         panel or such.  And possibly whether the offset only
478         determines the initial position or if the surface is locked to
479         that relative position during moves.
480       </description>
481
482       <arg name="parent" type="object" interface="wl_surface"/>
483       <arg name="x" type="int"/>
484       <arg name="y" type="int"/>
485       <arg name="flags" type="uint"/>
486     </request>
487
488     <request name="set_fullscreen">
489       <description summary="make the surface a fullscreen surface">
490         Map the surface as a fullscreen surface. If an output parameter is
491         given then the surface will be made fullscreen on that output. If the
492         client does not specify the output then the compositor will apply its
493         policy - usually choosing the output on which the surface has the
494         biggest surface area.
495
496         The client may specify a method to resolve a size conflict between the
497         output size and the surface size - this is provided through the
498         fullscreen_method parameter.
499
500         The framerate parameter is used only when the fullscreen_method is set
501         to "driver", to indicate the preferred framerate. framerate=0 indicates
502         that the app does not care about framerate.  The framerate is
503         specified in mHz, that is framerate of 60000 is 60Hz.
504
505         The compositor must reply to this request with a configure event with
506         the dimensions for the output on which the surface will be made fullscreen.
507       </description>
508       <arg name="method" type="uint"/>
509       <arg name="framerate" type="uint"/>
510       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
511     </request>
512
513     <enum name="fullscreen_method">
514       <description summary="different method to set the surface fullscreen">
515         Hints to indicate compositor how to deal with a conflict between the
516         dimensions for the surface and the dimensions of the output. As a hint
517         the compositor is free to ignore this parameter.
518
519         "default" The client has no preference on fullscreen behavior,
520         policies are determined by compositor.
521
522         "scale" The client prefers scaling by the compositor. Scaling would
523         always preserve surface's aspect ratio with surface centered on the
524         output
525
526         "driver" The client wants to switch video mode to the smallest mode
527         that can fit the client buffer. If the sizes do not match the
528         compositor must add black borders.
529
530         "fill" The surface is centered on the output on the screen with no
531         scaling. If the surface is of insufficient size the compositor must
532         add black borders.
533       </description>
534       <entry name="default" value="0"/>
535       <entry name="scale" value="1"/>
536       <entry name="driver" value="2"/>
537       <entry name="fill" value="3"/>
538     </enum>
539
540     <request name="set_popup">
541       <description summary="make the surface a popup surface">
542         Popup surfaces.  Will switch an implicit grab into
543         owner-events mode, and grab will continue after the implicit
544         grab ends (button released).  Once the implicit grab is over,
545         the popup grab continues until the window is destroyed or a
546         mouse button is pressed in any other clients window.  A click
547         in any of the clients surfaces is reported as normal, however,
548         clicks in other clients surfaces will be discarded and trigger
549         the callback.
550
551         TODO: Grab keyboard too, maybe just terminate on any click
552         inside or outside the surface?
553       </description>
554
555       <arg name="seat" type="object" interface="wl_seat"/>
556       <arg name="serial" type="uint"/>
557       <arg name="parent" type="object" interface="wl_surface"/>
558       <arg name="x" type="int"/>
559       <arg name="y" type="int"/>
560       <arg name="flags" type="uint"/>
561     </request>
562
563     <request name="set_maximized">
564       <description summary="make the surface a maximized surface">
565         A request from the client to notify the compositor the maximized
566         operation. The compositor will reply with a configure event telling
567         the expected new surface size. The operation is completed on the
568         next buffer attach to this surface.
569         A maximized client will fill the fullscreen of the output it is bound
570         to, except the panel area. This is the main difference between
571         a maximized shell surface and a fullscreen shell surface.
572       </description>
573       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
574     </request>
575
576     <request name="set_title">
577       <description summary="set surface title">
578       </description>
579       <arg name="title" type="string"/>
580     </request>
581
582     <request name="set_class">
583       <description summary="set surface class">
584         The surface class identifies the general class of applications
585         to which the surface belongs.  The class is the file name of
586         the applications .desktop file (absolute path if non-standard
587         location). 
588       </description>
589       <arg name="class_" type="string"/>
590     </request>
591
592     <event name="ping">
593       <description summary="ping client">
594         Ping a client to check if it is receiving events and sending
595         requests. A client is expected to reply with a pong request.
596       </description>
597       <arg name="serial" type="uint"/>
598     </event>
599
600     <event name="configure">
601       <description summary="suggest resize">
602         The configure event asks the client to resize its surface.
603         The size is a hint, in the sense that the client is free to
604         ignore it if it doesn't resize, pick a smaller size (to
605         satisfy aspect ratio or resize in steps of NxM pixels).  The
606         client is free to dismiss all but the last configure event it
607         received.
608       </description>
609
610       <arg name="edges" type="uint"/>
611       <arg name="width" type="int"/>
612       <arg name="height" type="int"/>
613     </event>
614
615     <event name="popup_done">
616       <description summary="popup interaction is done">
617         The popup_done event is sent out when a popup grab is broken,
618         that is, when the users clicks a surface that doesn't belong
619         to the client owning the popup surface.
620       </description>
621     </event>
622   </interface>
623
624   <interface name="wl_surface" version="1">
625     <description summary="an onscreen surface">
626       A surface.  This is an image that is displayed on the screen.
627       It has a location, size and pixel contents.
628     </description>
629
630     <request name="destroy" type="destructor">
631       <description summary="delete surface">
632         Deletes the surface and invalidates its object id.
633       </description>
634     </request>
635
636     <request name="attach">
637       <description summary="set the surface contents">
638         Set the contents of a buffer into this surface. The x and y
639         arguments specify the location of the new pending buffer's upper
640         left corner, relative to the current buffer's upper left corner. In
641         other words, the x and y, and the width and height of the wl_buffer
642         together define in which directions the surface's size changes.
643
644         Surface contents are double-buffered state, see wl_surface.commit.
645
646         The initial surface contents are void; there is no content.
647         wl_surface.attach assigns the given wl_buffer as the pending wl_buffer.
648         wl_surface.commit applies the pending wl_buffer as the new
649         surface contents, and the size of the surface becomes the size of
650         the wl_buffer. The wl_buffer is also kept as pending, until
651         changed by wl_surface.attach or the wl_buffer is destroyed.
652
653         Committing a pending wl_buffer allows the compositor to read the
654         pixels in the wl_buffer. The compositor may access the pixels at any
655         time after the wl_surface.commit request. When the compositor will
656         not access the pixels anymore, it will send the wl_buffer.release
657         event. Only after receiving wl_buffer.release, the client may re-use
658         the wl_buffer.
659
660         Destroying the wl_buffer after wl_buffer.release does not change the
661         surface contents, even if the wl_buffer is still pending for the
662         next commit. In such case, the next commit does not change the
663         surface contents. However, if the client destroys the wl_buffer
664         before receiving wl_buffer.release, the surface contents become
665         undefined immediately.
666
667         Only if wl_surface.attach is sent with a nil wl_buffer, the
668         following wl_surface.commit will remove the surface content.
669       </description>
670
671       <arg name="buffer" type="object" interface="wl_buffer" allow-null="true"/>
672       <arg name="x" type="int"/>
673       <arg name="y" type="int"/>
674     </request>
675
676     <request name="damage">
677       <description summary="mark part of the surface damaged">
678         This request is used to describe the regions where the pending
679         buffer (or if pending buffer is none, the current buffer as updated
680         in-place) on the next wl_surface.commit will be different from the
681         current buffer, and needs to be repainted. The pending buffer can be
682         set by wl_surface.attach. The compositor ignores the parts of the
683         damage that fall outside of the surface.
684
685         Damage is double-buffered state, see wl_surface.commit.
686
687         The initial value for pending damage is empty: no damage.
688         wl_surface.damage adds pending damage: the new pending damage is the
689         union of old pending damage and the given rectangle.
690         wl_surface.commit assigns pending damage as the current damage, and
691         clears pending damage. The server will clear the current damage as
692         it repaints the surface.
693       </description>
694
695       <arg name="x" type="int"/>
696       <arg name="y" type="int"/>
697       <arg name="width" type="int"/>
698       <arg name="height" type="int"/>
699     </request>
700
701     <request name="frame">
702       <description summary="request repaint feedback">
703         Request notification when the next frame is displayed.  Useful
704         for throttling redrawing operations, and driving animations.
705         The notification will only be posted for one frame unless
706         requested again.
707       </description>
708
709       <arg name="callback" type="new_id" interface="wl_callback"/>
710     </request>
711
712     <request name="set_opaque_region">
713       <description summary="set opaque region">
714         This request sets the region of the surface that contains
715         opaque content.  The opaque region is an optimization hint for
716         the compositor that lets it optimize out redrawing of content
717         behind opaque regions.  Setting an opaque region is not
718         required for correct behaviour, but marking transparent
719         content as opaque will result in repaint artifacts.
720         The compositor ignores the parts of the opaque region that fall
721         outside of the surface.
722
723         Opaque region is double-buffered state, see wl_surface.commit.
724
725         wl_surface.set_opaque_region changes the pending opaque region.
726         wl_surface.commit copies the pending region to the current region.
727         Otherwise the pending and current regions are never changed.
728
729         The initial value for opaque region is empty. Setting the pending
730         opaque region has copy semantics, and the wl_region object can be
731         destroyed immediately. A nil wl_region causes the pending opaque
732         region to be set to empty.
733       </description>
734
735       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
736     </request>
737
738     <request name="set_input_region">
739       <description summary="set input region">
740         This request sets the region of the surface that can receive
741         pointer and touch events. Input events happening outside of
742         this region will try the next surface in the server surface
743         stack. The compositor ignores the parts of the input region that
744         fall outside of the surface.
745
746         Input region is double-buffered state, see wl_surface.commit.
747
748         wl_surface.set_input_region changes the pending input region.
749         wl_surface.commit copies the pending region to the current region.
750         Otherwise the pending and current regions are never changed.
751
752         The initial value for input region is infinite. That means the whole
753         surface will accept input. Setting the pending input region has copy
754         semantics, and the wl_region object can be destroyed immediately. A
755         nil wl_region causes the input region to be set to infinite.
756       </description>
757
758       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
759     </request>
760
761     <request name="commit">
762       <description summary="commit pending surface state">
763         Surface state (input, opaque, and damage regions, attached buffers,
764         etc.) is double-buffered. Protocol requests modify the pending
765         state, as opposed to current state in use by the compositor. Commit
766         request atomically applies all pending state, replacing the current
767         state. After commit, the new pending state is as documented for each
768         related request.
769
770         On commit, a pending wl_buffer is applied first, all other state
771         second. This means that all coordinates in double-buffered state are
772         relative to the new wl_buffer coming into use, except for
773         wl_surface.attach itself. If the pending wl_buffer is none, the
774         coordinates are relative to the current surface contents.
775
776         All requests that need a commit to become effective are documented
777         to affect double-buffered state.
778
779         Other interfaces may add further double-buffered surface state.
780       </description>
781     </request>
782
783     <event name="enter">
784       <description summary="surface enters an output">
785         This is emitted whenever a surface's creation, movement, or resizing
786         results in some part of it being within the scanout region of an
787         output.
788       </description>
789       <arg name="output" type="object" interface="wl_output"/>
790     </event>
791
792     <event name="leave">
793       <description summary="surface leaves an output">
794         This is emitted whenever a surface's creation, movement, or resizing
795         results in it no longer having any part of it within the scanout region
796         of an output.
797       </description>
798       <arg name="output" type="object" interface="wl_output"/>
799     </event>
800   </interface>
801
802   <interface name="wl_seat" version="1">
803     <description summary="seat">
804       A group of keyboards, pointer (mice, for example) and touch
805       devices . This object is published as a global during start up,
806       or when such a device is hot plugged.  A seat typically has a
807       pointer and maintains a keyboard_focus and a pointer_focus.
808     </description>
809
810     <enum name="capability">
811       <description summary="seat capability bitmask">
812         This is a bitmask of capabilities this seat has; if a member is
813         set, then it is present on the seat.
814       </description>
815       <entry name="pointer" value="1" summary="wl_pointer"/>
816       <entry name="keyboard" value="2" summary="wl_keyboard"/>
817       <entry name="touch" value="4" summary="wl_touch"/>
818     </enum>
819
820
821     <event name="capabilities">
822       <description summary="seat capabilities changed">
823         This is emitted whenever a seat gains or loses the pointer,
824         keyboard or touch capabilities.  The argument is a wl_seat_caps_mask
825         enum containing the complete set of capabilities this seat has.
826       </description>
827       <arg name="capabilities" type="uint"/>
828     </event>
829
830     <request name="get_pointer">
831       <description summary="return pointer object">
832         The ID provided will be initialized to the wl_pointer interface
833         for this seat.
834       </description>
835       <arg name="id" type="new_id" interface="wl_pointer"/>
836     </request>
837
838     <request name="get_keyboard">
839       <description summary="return pointer object">
840         The ID provided will be initialized to the wl_keyboard interface
841         for this seat.
842       </description>
843       <arg name="id" type="new_id" interface="wl_keyboard"/>
844     </request>
845
846     <request name="get_touch">
847       <description summary="return pointer object">
848         The ID provided will be initialized to the wl_touch interface
849         for this seat.
850       </description>
851       <arg name="id" type="new_id" interface="wl_touch"/>
852     </request>
853   </interface>
854
855   <interface name="wl_pointer" version="1">
856     <request name="set_cursor">
857       <description summary="set the pointer surface">
858         Set the pointer surface, i.e., the surface that contains the
859         pointer image. This request only takes effect if the pointer
860         focus for this device is one of the requesting client surfaces
861         or the surface parameter is the current pointer surface. If
862         there was a previous surface set with this request it is
863         replaced. If surface is NULL, the pointer image is hidden.
864
865         The parameters hotspot_x and hotspot_y define the position of
866         the pointer surface relative to the pointer location. Its
867         top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
868         where (x, y) are the coordinates of the pointer location.
869
870         On surface.attach requests to the pointer surface, hotspot_x
871         and hotspot_y are decremented by the x and y parameters
872         passed to the request.
873
874         The hotspot can also be updated by passing the current set
875         pointer surface to this request with new values for hotspot_x
876         and/or hotspot_y.
877       </description>
878
879       <arg name="serial" type="uint"/>
880       <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
881       <arg name="hotspot_x" type="int"/>
882       <arg name="hotspot_y" type="int"/>
883     </request>
884
885     <event name="enter">
886       <description summary="enter event">
887         Notification that this seat's pointer is focused on a certain
888         surface. When an seat's focus enters a surface, the pointer image
889         is undefined and a client should respond to this event by setting
890         an appropriate pointer image.
891       </description>
892
893       <arg name="serial" type="uint"/>
894       <arg name="surface" type="object" interface="wl_surface"/>
895       <arg name="surface_x" type="fixed"/>
896       <arg name="surface_y" type="fixed"/>
897     </event>
898
899     <event name="leave">
900       <description summary="leave event">
901       </description>
902       <arg name="serial" type="uint"/>
903       <arg name="surface" type="object" interface="wl_surface"/>
904     </event>
905
906     <event name="motion">
907       <description summary="pointer motion event">
908         Notification of pointer location change. The arguments surface_[xy]
909         are the location relative to the focused surface.
910       </description>
911
912       <arg name="time" type="uint"/>
913       <arg name="surface_x" type="fixed"/>
914       <arg name="surface_y" type="fixed"/>
915     </event>
916
917     <enum name="button_state">
918       <description summary="physical button state">
919         Describes the physical state of a button which provoked the button
920         event.
921       </description>
922       <entry name="released" value="0" summary="button is not pressed"/>
923       <entry name="pressed" value="1" summary="button is pressed"/>
924     </enum>
925
926     <event name="button">
927       <description summary="pointer button event">
928         Mouse button click and release notifications.  The location
929         of the click is given by the last motion or pointer_focus event.
930       </description>
931
932       <arg name="serial" type="uint"/>
933       <arg name="time" type="uint"/>
934       <arg name="button" type="uint"/>
935       <arg name="state" type="uint"/>
936     </event>
937
938     <enum name="axis">
939       <description summary="axis types"/>
940       <entry name="vertical_scroll" value="0"/>
941       <entry name="horizontal_scroll" value="1"/>
942     </enum>
943
944     <event name="axis">
945       <description summary="axis event">
946         Scroll and other axis notifications.
947       </description>
948
949       <arg name="time" type="uint"/>
950       <arg name="axis" type="uint"/>
951       <arg name="value" type="fixed"/>
952     </event>
953   </interface>
954
955   <interface name="wl_keyboard" version="1">
956     <description summary="keyboard input device">
957     </description>
958
959     <enum name="keymap_format">
960       <description summary="keyboard mapping format">
961         This enum specifies the format of the keymap provided to the client
962         with the wl_keyboard::keymap event.
963       </description>
964       <entry name="xkb_v1" value="1" description="libxkbcommon compatible"/>
965     </enum>
966
967     <event name="keymap">
968       <description summary="keyboard mapping">
969         This event provides a file descriptor to the client which can be
970         memory-mapped to provide a keyboard mapping description.
971       </description>
972       <arg name="format" type="uint"/>
973       <arg name="fd" type="fd"/>
974       <arg name="size" type="uint"/>
975     </event>
976
977     <event name="enter">
978       <arg name="serial" type="uint"/>
979       <arg name="surface" type="object" interface="wl_surface"/>
980       <arg name="keys" type="array"/>
981     </event>
982
983     <event name="leave">
984       <arg name="serial" type="uint"/>
985       <arg name="surface" type="object" interface="wl_surface"/>
986     </event>
987
988     <enum name="key_state">
989       <description summary="physical key state">
990         Describes the physical state of a key which provoked the key event.
991       </description>
992       <entry name="released" value="0" summary="key is not pressed"/>
993       <entry name="pressed" value="1" summary="key is pressed"/>
994     </enum>
995
996     <event name="key">
997       <description summary="key event">
998         A key was pressed or released.
999       </description>
1000
1001       <arg name="serial" type="uint"/>
1002       <arg name="time" type="uint"/>
1003       <arg name="key" type="uint"/>
1004       <arg name="state" type="uint"/>
1005     </event>
1006
1007     <event name="modifiers">
1008       <description summary="modifier and group state">
1009         Notifies clients that the modifier and/or group state has
1010         changed, and it should update its local state.
1011       </description>
1012
1013       <arg name="serial" type="uint"/>
1014       <arg name="mods_depressed" type="uint"/>
1015       <arg name="mods_latched" type="uint"/>
1016       <arg name="mods_locked" type="uint"/>
1017       <arg name="group" type="uint"/>
1018     </event>
1019   </interface>
1020
1021   <interface name="wl_touch" version="1">
1022     <description summary="touch screen input device">
1023     </description>
1024
1025     <event name="down">
1026       <arg name="serial" type="uint"/>
1027       <arg name="time" type="uint"/>
1028       <arg name="surface" type="object" interface="wl_surface"/>
1029       <arg name="id" type="int" />
1030       <arg name="x" type="fixed" />
1031       <arg name="y" type="fixed" />
1032     </event>
1033
1034     <event name="up">
1035       <arg name="serial" type="uint"/>
1036       <arg name="time" type="uint"/>
1037       <arg name="id" type="int" />
1038     </event>
1039
1040     <event name="motion">
1041       <arg name="time" type="uint"/>
1042       <arg name="id" type="int" />
1043       <arg name="x" type="fixed" />
1044       <arg name="y" type="fixed" />
1045     </event>
1046
1047     <event name="frame">
1048       <description summary="end of touch frame event">
1049         Indicates the end of a contact point list.
1050       </description>
1051     </event>
1052
1053     <event name="cancel">
1054       <description summary="touch session cancelled">
1055         Sent if the compositor decides the touch stream is a global
1056         gesture. No further events are sent to the clients from that
1057         particular gesture.
1058       </description>
1059     </event>
1060   </interface>
1061
1062
1063   <interface name="wl_output" version="1">
1064     <description summary="compositor output region">
1065       An output describes part of the compositor geometry.  The
1066       compositor work in the 'compositor coordinate system' and an
1067       output corresponds to rectangular area in that space that is
1068       actually visible.  This typically corresponds to a monitor that
1069       displays part of the compositor space.  This object is published
1070       as global during start up, or when a screen is hot plugged.
1071     </description>
1072
1073     <enum name="subpixel">
1074       <entry name="unknown" value="0"/>
1075       <entry name="none" value="1"/>
1076       <entry name="horizontal_rgb" value="2"/>
1077       <entry name="horizontal_bgr" value="3"/>
1078       <entry name="vertical_rgb" value="4"/>
1079       <entry name="vertical_bgr" value="5"/>
1080     </enum>
1081
1082     <enum name="transform">
1083       <description summary="transform from framebuffer to output">
1084         This describes the transform that a compositor will apply to a
1085         surface to compensate for the rotation or mirroring of an
1086         output device.
1087
1088         The flipped values correspond to an initial flip around a
1089         vertical axis followed by rotation.
1090
1091         The purpose is mainly to allow clients render accordingly and
1092         tell the compositor, so that for fullscreen surfaces, the
1093         compositor will still be able to scan out directly from client
1094         surfaces.
1095       </description>
1096
1097       <entry name="normal" value="0"/>
1098       <entry name="90" value="1"/>
1099       <entry name="180" value="2"/>
1100       <entry name="270" value="3"/>
1101       <entry name="flipped" value="4"/>
1102       <entry name="flipped_90" value="5"/>
1103       <entry name="flipped_180" value="6"/>
1104       <entry name="flipped_270" value="7"/>
1105     </enum>
1106
1107     <event name="geometry">
1108       <description summary="properties of the output"/>
1109       <arg name="x" type="int"
1110            summary="x position within the global compositor space"/>
1111       <arg name="y" type="int"
1112            summary="y position within the global compositor space"/>
1113       <arg name="physical_width" type="int"
1114            summary="width in millimeters of the output"/>
1115       <arg name="physical_height" type="int"
1116            summary="height in millimeters of the output"/>
1117       <arg name="subpixel" type="int"
1118            summary="subpixel orientation of the output"/>
1119       <arg name="make" type="string"
1120            summary="textual description of the manufacturer"/>
1121       <arg name="model" type="string"
1122            summary="textual description of the model"/>
1123       <arg name="transform" type="int"
1124            summary="transform that maps framebuffer to output"/>
1125     </event>
1126
1127     <enum name="mode">
1128       <description summary="values for the flags bitfield in the mode event"/>
1129       <entry name="current" value="0x1"
1130              summary="indicates this is the current mode"/>
1131       <entry name="preferred" value="0x2"
1132              summary="indicates this is the preferred mode"/>
1133     </enum>
1134       
1135     <event name="mode">
1136       <description summary="advertise available modes for the output">
1137         The mode event describes an available mode for the output.
1138         The event is sent when binding to the output object and there
1139         will always be one mode, the current mode.  The event is sent
1140         again if an output changes mode, for the mode that is now
1141         current.  In other words, the current mode is always the last
1142         mode that was received with the current flag set.
1143       </description>
1144       <arg name="flags" type="uint" summary="mask of wl_output_mode flags"/>
1145       <arg name="width" type="int" summary="width of the mode in pixels"/>
1146       <arg name="height" type="int" summary="height of the mode in pixels"/>
1147       <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/>
1148     </event>
1149   </interface>
1150
1151   <interface name="wl_region" version="1">
1152     <description summary="region interface">
1153       Region.
1154     </description>
1155
1156     <request name="destroy" type="destructor">
1157       <description summary="destroy region">
1158         Destroy the region.  This will invalidate the object id.
1159       </description>
1160     </request>
1161
1162     <request name="add">
1163       <description summary="add rectangle to region">
1164         Add the specified rectangle to the region
1165       </description>
1166
1167       <arg name="x" type="int"/>
1168       <arg name="y" type="int"/>
1169       <arg name="width" type="int"/>
1170       <arg name="height" type="int"/>
1171     </request>
1172
1173     <request name="subtract">
1174       <description summary="subtract rectangle from region">
1175         Subtract the specified rectangle from the region
1176       </description>
1177
1178       <arg name="x" type="int"/>
1179       <arg name="y" type="int"/>
1180       <arg name="width" type="int"/>
1181       <arg name="height" type="int"/>
1182     </request>
1183
1184   </interface>
1185
1186 </protocol>