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