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