protocol: wl_surface.frame needs wl_surface.commit
[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 frame request will take effect on the next wl_surface.commit.
711         The notification will only be posted for one frame unless
712         requested again.
713
714         A server should avoid signalling the frame callbacks if the
715         surface is not visible in any way, e.g. the surface is off-screen,
716         or completely obscured by other opaque surfaces.
717
718         A client can request a frame callback even without an attach,
719         damage, or any other state changes. wl_surface.commit triggers a
720         repaint, so the callback event will arrive after the next output
721         refresh where the surface is visible.
722       </description>
723
724       <arg name="callback" type="new_id" interface="wl_callback"/>
725     </request>
726
727     <request name="set_opaque_region">
728       <description summary="set opaque region">
729         This request sets the region of the surface that contains
730         opaque content.  The opaque region is an optimization hint for
731         the compositor that lets it optimize out redrawing of content
732         behind opaque regions.  Setting an opaque region is not
733         required for correct behaviour, but marking transparent
734         content as opaque will result in repaint artifacts.
735         The compositor ignores the parts of the opaque region that fall
736         outside of the surface.
737
738         Opaque region is double-buffered state, see wl_surface.commit.
739
740         wl_surface.set_opaque_region changes the pending opaque region.
741         wl_surface.commit copies the pending region to the current region.
742         Otherwise the pending and current regions are never changed.
743
744         The initial value for opaque region is empty. Setting the pending
745         opaque region has copy semantics, and the wl_region object can be
746         destroyed immediately. A nil wl_region causes the pending opaque
747         region to be set to empty.
748       </description>
749
750       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
751     </request>
752
753     <request name="set_input_region">
754       <description summary="set input region">
755         This request sets the region of the surface that can receive
756         pointer and touch events. Input events happening outside of
757         this region will try the next surface in the server surface
758         stack. The compositor ignores the parts of the input region that
759         fall outside of the surface.
760
761         Input region is double-buffered state, see wl_surface.commit.
762
763         wl_surface.set_input_region changes the pending input region.
764         wl_surface.commit copies the pending region to the current region.
765         Otherwise the pending and current regions are never changed,
766         except cursor and icon surfaces are special cases, see
767         wl_pointer.set_cursor and wl_data_device.start_drag.
768
769         The initial value for input region is infinite. That means the whole
770         surface will accept input. Setting the pending input region has copy
771         semantics, and the wl_region object can be destroyed immediately. A
772         nil wl_region causes the input region to be set to infinite.
773       </description>
774
775       <arg name="region" type="object" interface="wl_region" allow-null="true"/>
776     </request>
777
778     <request name="commit">
779       <description summary="commit pending surface state">
780         Surface state (input, opaque, and damage regions, attached buffers,
781         etc.) is double-buffered. Protocol requests modify the pending
782         state, as opposed to current state in use by the compositor. Commit
783         request atomically applies all pending state, replacing the current
784         state. After commit, the new pending state is as documented for each
785         related request.
786
787         On commit, a pending wl_buffer is applied first, all other state
788         second. This means that all coordinates in double-buffered state are
789         relative to the new wl_buffer coming into use, except for
790         wl_surface.attach itself. If the pending wl_buffer is none, the
791         coordinates are relative to the current surface contents.
792
793         All requests that need a commit to become effective are documented
794         to affect double-buffered state.
795
796         Other interfaces may add further double-buffered surface state.
797       </description>
798     </request>
799
800     <event name="enter">
801       <description summary="surface enters an output">
802         This is emitted whenever a surface's creation, movement, or resizing
803         results in some part of it being within the scanout region of an
804         output.
805       </description>
806       <arg name="output" type="object" interface="wl_output"/>
807     </event>
808
809     <event name="leave">
810       <description summary="surface leaves an output">
811         This is emitted whenever a surface's creation, movement, or resizing
812         results in it no longer having any part of it within the scanout region
813         of an output.
814       </description>
815       <arg name="output" type="object" interface="wl_output"/>
816     </event>
817   </interface>
818
819   <interface name="wl_seat" version="1">
820     <description summary="seat">
821       A group of keyboards, pointer (mice, for example) and touch
822       devices . This object is published as a global during start up,
823       or when such a device is hot plugged.  A seat typically has a
824       pointer and maintains a keyboard_focus and a pointer_focus.
825     </description>
826
827     <enum name="capability">
828       <description summary="seat capability bitmask">
829         This is a bitmask of capabilities this seat has; if a member is
830         set, then it is present on the seat.
831       </description>
832       <entry name="pointer" value="1" summary="wl_pointer"/>
833       <entry name="keyboard" value="2" summary="wl_keyboard"/>
834       <entry name="touch" value="4" summary="wl_touch"/>
835     </enum>
836
837
838     <event name="capabilities">
839       <description summary="seat capabilities changed">
840         This is emitted whenever a seat gains or loses the pointer,
841         keyboard or touch capabilities.  The argument is a wl_seat_caps_mask
842         enum containing the complete set of capabilities this seat has.
843       </description>
844       <arg name="capabilities" type="uint"/>
845     </event>
846
847     <request name="get_pointer">
848       <description summary="return pointer object">
849         The ID provided will be initialized to the wl_pointer interface
850         for this seat.
851       </description>
852       <arg name="id" type="new_id" interface="wl_pointer"/>
853     </request>
854
855     <request name="get_keyboard">
856       <description summary="return pointer object">
857         The ID provided will be initialized to the wl_keyboard interface
858         for this seat.
859       </description>
860       <arg name="id" type="new_id" interface="wl_keyboard"/>
861     </request>
862
863     <request name="get_touch">
864       <description summary="return pointer object">
865         The ID provided will be initialized to the wl_touch interface
866         for this seat.
867       </description>
868       <arg name="id" type="new_id" interface="wl_touch"/>
869     </request>
870   </interface>
871
872   <interface name="wl_pointer" version="1">
873     <request name="set_cursor">
874       <description summary="set the pointer surface">
875         Set the pointer surface, i.e., the surface that contains the
876         pointer image. This request only takes effect if the pointer
877         focus for this device is one of the requesting client surfaces
878         or the surface parameter is the current pointer surface. If
879         there was a previous surface set with this request it is
880         replaced. If surface is NULL, the pointer image is hidden.
881
882         The parameters hotspot_x and hotspot_y define the position of
883         the pointer surface relative to the pointer location. Its
884         top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
885         where (x, y) are the coordinates of the pointer location.
886
887         On surface.attach requests to the pointer surface, hotspot_x
888         and hotspot_y are decremented by the x and y parameters
889         passed to the request. Attach must be confirmed by
890         wl_surface.commit as usual.
891
892         The hotspot can also be updated by passing the current set
893         pointer surface to this request with new values for hotspot_x
894         and/or hotspot_y.
895
896         The current and pending input regions of the wl_surface are
897         cleared, and wl_surface.set_input_region is ignored until the
898         wl_surface is destroyed.
899       </description>
900
901       <arg name="serial" type="uint"/>
902       <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
903       <arg name="hotspot_x" type="int"/>
904       <arg name="hotspot_y" type="int"/>
905     </request>
906
907     <event name="enter">
908       <description summary="enter event">
909         Notification that this seat's pointer is focused on a certain
910         surface. When an seat's focus enters a surface, the pointer image
911         is undefined and a client should respond to this event by setting
912         an appropriate pointer image.
913       </description>
914
915       <arg name="serial" type="uint"/>
916       <arg name="surface" type="object" interface="wl_surface"/>
917       <arg name="surface_x" type="fixed"/>
918       <arg name="surface_y" type="fixed"/>
919     </event>
920
921     <event name="leave">
922       <description summary="leave event">
923       </description>
924       <arg name="serial" type="uint"/>
925       <arg name="surface" type="object" interface="wl_surface"/>
926     </event>
927
928     <event name="motion">
929       <description summary="pointer motion event">
930         Notification of pointer location change. The arguments surface_[xy]
931         are the location relative to the focused surface.
932       </description>
933
934       <arg name="time" type="uint"/>
935       <arg name="surface_x" type="fixed"/>
936       <arg name="surface_y" type="fixed"/>
937     </event>
938
939     <enum name="button_state">
940       <description summary="physical button state">
941         Describes the physical state of a button which provoked the button
942         event.
943       </description>
944       <entry name="released" value="0" summary="button is not pressed"/>
945       <entry name="pressed" value="1" summary="button is pressed"/>
946     </enum>
947
948     <event name="button">
949       <description summary="pointer button event">
950         Mouse button click and release notifications.  The location
951         of the click is given by the last motion or pointer_focus event.
952       </description>
953
954       <arg name="serial" type="uint"/>
955       <arg name="time" type="uint"/>
956       <arg name="button" type="uint"/>
957       <arg name="state" type="uint"/>
958     </event>
959
960     <enum name="axis">
961       <description summary="axis types"/>
962       <entry name="vertical_scroll" value="0"/>
963       <entry name="horizontal_scroll" value="1"/>
964     </enum>
965
966     <event name="axis">
967       <description summary="axis event">
968         Scroll and other axis notifications.
969       </description>
970
971       <arg name="time" type="uint"/>
972       <arg name="axis" type="uint"/>
973       <arg name="value" type="fixed"/>
974     </event>
975   </interface>
976
977   <interface name="wl_keyboard" version="1">
978     <description summary="keyboard input device">
979     </description>
980
981     <enum name="keymap_format">
982       <description summary="keyboard mapping format">
983         This enum specifies the format of the keymap provided to the client
984         with the wl_keyboard::keymap event.
985       </description>
986       <entry name="xkb_v1" value="1" description="libxkbcommon compatible"/>
987     </enum>
988
989     <event name="keymap">
990       <description summary="keyboard mapping">
991         This event provides a file descriptor to the client which can be
992         memory-mapped to provide a keyboard mapping description.
993       </description>
994       <arg name="format" type="uint"/>
995       <arg name="fd" type="fd"/>
996       <arg name="size" type="uint"/>
997     </event>
998
999     <event name="enter">
1000       <arg name="serial" type="uint"/>
1001       <arg name="surface" type="object" interface="wl_surface"/>
1002       <arg name="keys" type="array"/>
1003     </event>
1004
1005     <event name="leave">
1006       <arg name="serial" type="uint"/>
1007       <arg name="surface" type="object" interface="wl_surface"/>
1008     </event>
1009
1010     <enum name="key_state">
1011       <description summary="physical key state">
1012         Describes the physical state of a key which provoked the key event.
1013       </description>
1014       <entry name="released" value="0" summary="key is not pressed"/>
1015       <entry name="pressed" value="1" summary="key is pressed"/>
1016     </enum>
1017
1018     <event name="key">
1019       <description summary="key event">
1020         A key was pressed or released.
1021       </description>
1022
1023       <arg name="serial" type="uint"/>
1024       <arg name="time" type="uint"/>
1025       <arg name="key" type="uint"/>
1026       <arg name="state" type="uint"/>
1027     </event>
1028
1029     <event name="modifiers">
1030       <description summary="modifier and group state">
1031         Notifies clients that the modifier and/or group state has
1032         changed, and it should update its local state.
1033       </description>
1034
1035       <arg name="serial" type="uint"/>
1036       <arg name="mods_depressed" type="uint"/>
1037       <arg name="mods_latched" type="uint"/>
1038       <arg name="mods_locked" type="uint"/>
1039       <arg name="group" type="uint"/>
1040     </event>
1041   </interface>
1042
1043   <interface name="wl_touch" version="1">
1044     <description summary="touch screen input device">
1045     </description>
1046
1047     <event name="down">
1048       <arg name="serial" type="uint"/>
1049       <arg name="time" type="uint"/>
1050       <arg name="surface" type="object" interface="wl_surface"/>
1051       <arg name="id" type="int" />
1052       <arg name="x" type="fixed" />
1053       <arg name="y" type="fixed" />
1054     </event>
1055
1056     <event name="up">
1057       <arg name="serial" type="uint"/>
1058       <arg name="time" type="uint"/>
1059       <arg name="id" type="int" />
1060     </event>
1061
1062     <event name="motion">
1063       <arg name="time" type="uint"/>
1064       <arg name="id" type="int" />
1065       <arg name="x" type="fixed" />
1066       <arg name="y" type="fixed" />
1067     </event>
1068
1069     <event name="frame">
1070       <description summary="end of touch frame event">
1071         Indicates the end of a contact point list.
1072       </description>
1073     </event>
1074
1075     <event name="cancel">
1076       <description summary="touch session cancelled">
1077         Sent if the compositor decides the touch stream is a global
1078         gesture. No further events are sent to the clients from that
1079         particular gesture.
1080       </description>
1081     </event>
1082   </interface>
1083
1084
1085   <interface name="wl_output" version="1">
1086     <description summary="compositor output region">
1087       An output describes part of the compositor geometry.  The
1088       compositor work in the 'compositor coordinate system' and an
1089       output corresponds to rectangular area in that space that is
1090       actually visible.  This typically corresponds to a monitor that
1091       displays part of the compositor space.  This object is published
1092       as global during start up, or when a screen is hot plugged.
1093     </description>
1094
1095     <enum name="subpixel">
1096       <entry name="unknown" value="0"/>
1097       <entry name="none" value="1"/>
1098       <entry name="horizontal_rgb" value="2"/>
1099       <entry name="horizontal_bgr" value="3"/>
1100       <entry name="vertical_rgb" value="4"/>
1101       <entry name="vertical_bgr" value="5"/>
1102     </enum>
1103
1104     <enum name="transform">
1105       <description summary="transform from framebuffer to output">
1106         This describes the transform that a compositor will apply to a
1107         surface to compensate for the rotation or mirroring of an
1108         output device.
1109
1110         The flipped values correspond to an initial flip around a
1111         vertical axis followed by rotation.
1112
1113         The purpose is mainly to allow clients render accordingly and
1114         tell the compositor, so that for fullscreen surfaces, the
1115         compositor will still be able to scan out directly from client
1116         surfaces.
1117       </description>
1118
1119       <entry name="normal" value="0"/>
1120       <entry name="90" value="1"/>
1121       <entry name="180" value="2"/>
1122       <entry name="270" value="3"/>
1123       <entry name="flipped" value="4"/>
1124       <entry name="flipped_90" value="5"/>
1125       <entry name="flipped_180" value="6"/>
1126       <entry name="flipped_270" value="7"/>
1127     </enum>
1128
1129     <event name="geometry">
1130       <description summary="properties of the output"/>
1131       <arg name="x" type="int"
1132            summary="x position within the global compositor space"/>
1133       <arg name="y" type="int"
1134            summary="y position within the global compositor space"/>
1135       <arg name="physical_width" type="int"
1136            summary="width in millimeters of the output"/>
1137       <arg name="physical_height" type="int"
1138            summary="height in millimeters of the output"/>
1139       <arg name="subpixel" type="int"
1140            summary="subpixel orientation of the output"/>
1141       <arg name="make" type="string"
1142            summary="textual description of the manufacturer"/>
1143       <arg name="model" type="string"
1144            summary="textual description of the model"/>
1145       <arg name="transform" type="int"
1146            summary="transform that maps framebuffer to output"/>
1147     </event>
1148
1149     <enum name="mode">
1150       <description summary="values for the flags bitfield in the mode event"/>
1151       <entry name="current" value="0x1"
1152              summary="indicates this is the current mode"/>
1153       <entry name="preferred" value="0x2"
1154              summary="indicates this is the preferred mode"/>
1155     </enum>
1156       
1157     <event name="mode">
1158       <description summary="advertise available modes for the output">
1159         The mode event describes an available mode for the output.
1160         The event is sent when binding to the output object and there
1161         will always be one mode, the current mode.  The event is sent
1162         again if an output changes mode, for the mode that is now
1163         current.  In other words, the current mode is always the last
1164         mode that was received with the current flag set.
1165       </description>
1166       <arg name="flags" type="uint" summary="mask of wl_output_mode flags"/>
1167       <arg name="width" type="int" summary="width of the mode in pixels"/>
1168       <arg name="height" type="int" summary="height of the mode in pixels"/>
1169       <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/>
1170     </event>
1171   </interface>
1172
1173   <interface name="wl_region" version="1">
1174     <description summary="region interface">
1175       Region.
1176     </description>
1177
1178     <request name="destroy" type="destructor">
1179       <description summary="destroy region">
1180         Destroy the region.  This will invalidate the object id.
1181       </description>
1182     </request>
1183
1184     <request name="add">
1185       <description summary="add rectangle to region">
1186         Add the specified rectangle to the region
1187       </description>
1188
1189       <arg name="x" type="int"/>
1190       <arg name="y" type="int"/>
1191       <arg name="width" type="int"/>
1192       <arg name="height" type="int"/>
1193     </request>
1194
1195     <request name="subtract">
1196       <description summary="subtract rectangle from region">
1197         Subtract the specified rectangle from the region
1198       </description>
1199
1200       <arg name="x" type="int"/>
1201       <arg name="y" type="int"/>
1202       <arg name="width" type="int"/>
1203       <arg name="height" type="int"/>
1204     </request>
1205
1206   </interface>
1207
1208 </protocol>