Split pointer_focus and keyboard_focus into enter and leave events
[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     <request name="bind">
36       <description summary="bind an object to the display">
37         Binds a new, client created object to the server using @name as
38         the identifier.
39       </description>
40       <arg name="name" type="uint" summary="unique number id for object"/>
41       <arg name="interface" type="string"/>
42       <arg name="version" type="uint"/>
43       <arg name="id" type="new_id" interface="wl_object"/>
44     </request>
45
46     <request name="sync">
47       <description summary="asynchronous roundtrip">
48         The sync request asks the server to invoke the 'done' request
49         on the provided wl_callback object.  Since requests are
50         handled in-order, this can be used as a barrier to ensure all
51         previous requests have been handled.
52       </description>
53       <arg name="callback" type="new_id" interface="wl_callback"/>
54     </request>
55
56     <event name="error">
57       <description summary="fatal error event">
58         The error event is sent out when a fatal (non-recoverable)
59         error has occurred.
60       </description>
61       <arg name="object_id" type="object" interface="wl_object"/>
62       <arg name="code" type="uint"/>
63       <arg name="message" type="string"/>
64     </event>
65
66     <enum name="error">
67       <description summary="global error values">
68         These errors are global and can be emitted in response to any
69         server request.
70       </description>
71       <entry name="invalid_object" value="0"
72              summary="server couldn't find object"/>
73       <entry name="invalid_method" value="1"
74              summary="method doesn't exist on the specified interface"/>
75       <entry name="no_memory" value="2"
76              summary="server is out of memory"/>
77     </enum>
78
79     <event name="global">
80       <description summary="announce global object">
81         Notify the client of global objects.  These are objects that
82         are created by the server.  Globals are published on the
83         initial client connection sequence, upon device hotplugs,
84         device disconnects, reconfiguration or other events.  A client
85         can 'bind' to a global object by using the bind request.  This
86         creates a client side handle that lets the object emit events
87         to the client and lets the client invoke requests on the
88         object.
89       </description>
90       <arg name="name" type="uint"/>
91       <arg name="interface" type="string"/>
92       <arg name="version" type="uint"/>
93     </event>
94
95     <event name="global_remove">
96       <description summary="announce removal of global object">
97         Notify the client of removed global objects.
98       </description>
99       <arg name="name" type="uint"/>
100     </event>
101
102     <event name="delete_id">
103       <description summary="acknowledge object id deletion">
104         Server has deleted the id and client can now reuse it.
105       </description>
106       <arg name="id" type="uint" />
107     </event>
108   </interface>
109
110   <interface name="wl_callback" version="1">
111     <event name="done">
112       <arg name="time" type="uint"/>
113     </event>
114   </interface>
115
116   <interface name="wl_compositor" version="1">
117     <description summary="the compositor singleton">
118       A compositor.  This object is a singleton global.  The
119       compositor is in charge of combining the contents of multiple
120       surfaces into one displayable output.
121     </description>
122
123     <request name="create_surface">
124       <description summary="create new surface">
125         Ask the compositor to create a new surface.
126       </description>
127       <arg name="id" type="new_id" interface="wl_surface"/>
128     </request>
129   </interface>
130
131   <interface name="wl_shm" version="1">
132     <description summary="shared memory support">
133       Support for shared memory buffers.
134     </description>
135
136     <enum name="error">
137       <entry name="invalid_format" value="0"/>
138       <entry name="invalid_stride" value="1"/>
139       <entry name="invalid_fd" value="2"/>
140     </enum>
141
142     <enum name="format">
143       <entry name="argb8888" value="0"/>
144       <entry name="xrgb8888" value="1"/>
145     </enum>
146
147     <request name="create_buffer">
148       <description summary="create a wl_buffer">
149         Transfer a shm buffer to the server.  The allocated buffer
150         would include at least stride * height bytes starting at the
151         beginning of fd.  The file descriptor is transferred over the
152         socket using AF_UNIX magical features. width, height, stride
153         and format describe the respective properties of the pixel
154         data contained in the buffer.
155       </description>
156
157       <arg name="id" type="new_id" interface="wl_buffer"/>
158       <arg name="fd" type="fd"/>
159       <arg name="width" type="int"/>
160       <arg name="height" type="int"/>
161       <arg name="stride" type="uint"/>
162       <arg name="format" type="uint"/>
163     </request>
164
165     <event name="format">
166       <arg name="format" type="uint"/>
167     </event>
168   </interface>
169
170   <interface name="wl_buffer" version="1">
171     <description summary="content for a wl_surface">
172       A buffer provides the content for a wl_surface.  Buffers are
173       created through factory interfaces such as wl_drm, wl_shm or
174       similar.  It has a width and a height and can be attached to a
175       wl_surface, but the mechanism by which a client provides and
176       updates the contents is defined by the buffer factory interface
177     </description>
178
179     <request name="damage">
180       <description summary="mark part of the buffer damaged">
181         Notify the server that the specified area of the buffers
182         contents have changed.  To describe a more complicated area of
183         damage, break down the region into rectangles and use this
184         request several times.
185       </description>
186
187       <arg name="x" type="int"/>
188       <arg name="y" type="int"/>
189       <arg name="width" type="int"/>
190       <arg name="height" type="int"/>
191     </request>
192
193     <request name="destroy" type="destructor">
194       <description summary="destroy a buffer">
195         Destroy a buffer.  This will invalidate the object id.
196       </description>
197     </request>
198
199     <event name="release">
200       <description summary="compositor releases buffer">
201         Sent when an attached buffer is no longer used by the compositor.
202       </description>
203     </event>
204   </interface>
205
206
207   <interface name="wl_data_offer" version="1">
208     <request name="accept">
209       <description summary="accept one of the offered mime-types">
210         Indicate that the client can accept the given mime-type, or
211         NULL for not accepted.  Use for feedback during drag and drop.
212       </description>
213
214       <arg name="time" type="uint"/>
215       <arg name="type" type="string"/>
216     </request>
217
218     <request name="receive">
219       <arg name="mime_type" type="string"/>
220       <arg name="fd" type="fd"/>
221     </request>
222
223     <request name="destroy" type="destructor"/>
224
225     <event name="offer">
226       <description summary="advertise offered mime-type">
227         Sent immediately after creating the wl_data_offer object.  One
228         event per offered mime type.
229       </description>
230
231       <arg name="type" type="string"/>
232     </event>
233   </interface>
234
235   <interface name="wl_data_source" version="1">
236     <request name="offer">
237       <description summary="add an offered mime type">
238         This request adds a mime-type to the set of mime-types
239         advertised to targets.  Can be called several times to offer
240         multiple types.
241       </description>
242       <arg name="type" type="string"/>
243     </request>
244
245     <request name="destroy" type="destructor">
246       <description summary="destroy the data source">
247         Destroy the data source.
248       </description>
249     </request>
250
251     <event name="target">
252       <description summary="a target accepts an offered mime-type">
253         Sent when a target accepts pointer_focus or motion events.  If
254         a target does not accept any of the offered types, type is NULL.
255       </description>
256
257       <arg name="mime_type" type="string"/>
258     </event>
259
260     <event name="send">
261       <description summary="send the data">
262         Request for data from another client.  Send the data as the
263         specified mime-type over the passed fd, then close the fd.
264       </description>
265
266       <arg name="mime_type" type="string"/>
267       <arg name="fd" type="fd"/>
268     </event>
269
270     <event name="cancelled">
271       <description summary="selection was cancelled">
272         Another selection became active.
273       </description>
274     </event>
275
276   </interface>
277
278   <interface name="wl_data_device" version="1">
279     <request name="start_drag">
280       <description summary="start drag and drop operation">
281         This request asks the compositor to start a drag and drop
282         operation on behalf of the client.  The source argument is the
283         data source that provides the data for the eventual data
284         transfer.  The origin surface is the surface where the drag
285         originates and the client must have an active implicit grab
286         that matches the timestamp.  The icon surface is an optional
287         (can be nil) surface that provides an icon to be moved around
288         with the cursor.  Initially, the top-left corner of the icon
289         surface is placed at the cursor hotspot, but subsequent
290         surface.attach request can move the relative position.
291       </description>
292       <arg name="source" type="object" interface="wl_data_source"/>
293       <arg name="origin" type="object" interface="wl_surface"/>
294       <arg name="icon" type="object" interface="wl_surface"/>
295       <arg name="time" type="uint"/>
296     </request>
297
298     <request name="set_selection">
299       <arg name="source" type="object" interface="wl_data_source"/>
300       <arg name="time" type="uint"/>
301     </request>
302
303     <event name="data_offer">
304       <description summary="introduce a new wl_data_offer">
305         The data_offer event introduces a new wl_data_offer object,
306         which will subsequently be used in either the
307         data_device.enter event (for drag and drop) or the
308         data_device.selection event (for selections).  Immediately
309         following the data_device_data_offer event, the new data_offer
310         object will send out data_offer.offer events to describe the
311         mime-types it offers.
312       </description>
313
314       <arg name="id" type="new_id" interface="wl_data_offer"/>
315     </event>
316
317     <event name="enter">
318       <arg name="time" type="uint"/>
319       <arg name="surface" type="object" interface="wl_surface"/>
320       <arg name="x" type="int"/>
321       <arg name="y" type="int"/>
322       <arg name="id" type="object" interface="wl_data_offer"/>
323     </event>
324
325     <event name="leave"/>
326
327     <event name="motion">
328       <arg name="time" type="uint"/>
329       <arg name="x" type="int"/>
330       <arg name="y" type="int"/>
331     </event>
332
333     <event name="drop"/>
334
335     <event name="selection">
336       <description summary="advertise new selection">
337         The selection event is sent out to notify the client of a new
338         wl_data_offer for the selection for this device.  The
339         data_device.data_offer and the data_offer.offer events are
340         sent out immediately before this event to introduce the data
341         offer object.  The selection event is sent to a client
342         immediately before receiving keyboard focus and when a new
343         selection is set while the client has keyboard focus.  The
344         data_offer is valid until a new data_offer or NULL is received
345         or until the client loses keyboard focus.
346       </description>
347       <arg name="id" type="object" interface="wl_data_offer"/>
348     </event>
349   </interface>
350
351   <interface name="wl_data_device_manager" version="1">
352     <request name="create_data_source">
353       <arg name="id" type="new_id" interface="wl_data_source"/>
354     </request>
355
356     <request name="get_data_device">
357       <arg name="id" type="new_id" interface="wl_data_device"/>
358       <arg name="input_device" type="object" interface="wl_input_device"/>
359     </request>
360   </interface>
361
362   <interface name="wl_shell" version="1">
363     <request name="get_shell_surface">
364       <arg name="id" type="new_id" interface="wl_shell_surface"/>
365       <arg name="surface" type="object" interface="wl_surface"/>
366     </request>
367   </interface>
368
369   <interface name="wl_shell_surface" version="1">
370
371     <description summary="desktop style meta data interface">
372       An interface implemented by a wl_surface.  On server side the
373       object is automatically destroyed when the related wl_surface is
374       destroyed.  On client side, wl_shell_surface_destroy() must be
375       called before destroying the wl_surface object.
376     </description>
377
378     <request name="move">
379       <arg name="input_device" type="object" interface="wl_input_device"/>
380       <arg name="time" type="uint"/>
381     </request>
382
383     <enum name="resize">
384       <entry name="none" value="0"/>
385       <entry name="top" value="1"/>
386       <entry name="bottom" value="2"/>
387       <entry name="left" value="4"/>
388       <entry name="top_left" value="5"/>
389       <entry name="bottom_left" value="6"/>
390       <entry name="right" value="8"/>
391       <entry name="top_right" value="9"/>
392       <entry name="bottom_right" value="10"/>
393     </enum>
394
395     <request name="resize">
396       <arg name="input_device" type="object" interface="wl_input_device"/>
397       <arg name="time" type="uint"/>
398       <arg name="edges" type="uint"/>
399     </request>
400
401     <request name="set_toplevel">
402       <description summary="make the surface a top level surface">
403         Make the surface a toplevel window.
404       </description>
405     </request>
406
407     <request name="set_transient">
408       <description summary="make the surface a transient surface">
409         Map the surface relative to an existing surface. The x and y
410         arguments specify the locations of the upper left corner of
411         the surface relative to the upper left corner of the parent
412         surface.  The flags argument controls overflow/clipping
413         behaviour when the surface would intersect a screen edge,
414         panel or such.  And possibly whether the offset only
415         determines the initial position or if the surface is locked to
416         that relative position during moves.
417       </description>
418
419       <arg name="parent" type="object" interface="wl_shell_surface"/>
420       <arg name="x" type="int"/>
421       <arg name="y" type="int"/>
422       <arg name="flags" type="uint"/>
423     </request>
424
425     <request name="set_fullscreen">
426       <description summary="make the surface a fullscreen surface">
427         Map the surface as a fullscreen surface. On the output the
428         surface is assigned to. The client can use different fulllscreen
429         method to fix the size mismatch issue: default, scale, driver
430         and fill. And the framerate parameter is used for "driver" method,
431         to indicate the preferred framerate. framerate=0 means that the
432         app does not care about framerate
433       </description>
434       <arg name="method" type="uint"/>
435       <arg name="framerate" type="uint"/>
436       <arg name="output" type="object" interface="wl_output"/>
437     </request>
438
439     <enum name="fullscreen_method">
440       <description summary="different method to set the surface fullscreen">
441         Hints to indicate compositor how to deal with this fullscreen surface.
442         "default" means the client has no preference on fullscreen
443                   behavior, policies are determined by compositor.
444         "scale"   means the client prefers scaling by the compositor.
445                   Scaling would always preserve surface's aspect ratio.
446                   And the surface is centered.
447         "driver"  means the client wants to switch video mode to the
448                   smallest mode that can fit the client buffer. If the
449                   sizes do not match, black borders are added.
450         "fill"    means the client wants to add blackborders to the
451                   surface. This would be preferring 1:1 pixel mapping
452                   in the monitor native video mode. The surface is
453                   centered.
454       </description>
455       <entry name="default" value="0"/>
456       <entry name="scale" value="1"/>
457       <entry name="driver" value="2"/>
458       <entry name="fill" value="3"/>
459     </enum>
460
461     <request name="set_popup">
462       <description summary="make the surface a popup surface">
463         Popup surfaces.  Will switch an implicit grab into
464         owner-events mode, and grab will continue after the implicit
465         grab ends (button released).  Once the implicit grab is over,
466         the popup grab continues until the window is destroyed or a
467         mouse button is pressed in any other clients window.  A click
468         in any of the clients surfaces is reported as normal, however,
469         clicks in other clients surfaces will be discarded and trigger
470         the callback.
471
472         TODO: Grab keyboard too, maybe just terminate on any click
473         inside or outside the surface?
474       </description>
475
476       <arg name="input_device" type="object" interface="wl_input_device"/>
477       <arg name="time" type="uint"/>
478       <arg name="parent" type="object" interface="wl_shell_surface"/>
479       <arg name="x" type="int"/>
480       <arg name="y" type="int"/>
481       <arg name="flags" type="uint"/>
482     </request>
483
484     <request name="set_maximized">
485       <description summary="make the surface a maximized surface">
486         A request from the client to notify the compositor the maximized
487         operation. The compositor will reply with a configure event telling
488         the expected new surface size. The operation is completed on the
489         next buffer attach to this surface.
490         A maximized client will fill the fullscreen of the output it is bound
491         to, except the panel area. This is the main difference between
492         a maximized shell surface and a fullscreen shell surface.
493       </description>
494       <arg name="output" type="object" interface="wl_output"/>
495     </request>
496
497     <event name="configure">
498       <description summary="suggest resize">
499         The configure event asks the client to resize its surface.
500         The size is a hint, in the sense that the client is free to
501         ignore it if it doesn't resize, pick a smaller size (to
502         satisfy aspect ration or resize in steps of NxM pixels).  The
503         client is free to dismiss all but the last configure event it
504         received.
505       </description>
506
507       <arg name="time" type="uint"/>
508       <arg name="edges" type="uint"/>
509       <arg name="width" type="int"/>
510       <arg name="height" type="int"/>
511     </event>
512
513     <event name="popup_done">
514       <description summary="popup interaction is done">
515         The popup_done event is sent out when a popup grab is broken,
516         that is, when the users clicks a surface that doesn't belong
517         to the client owning the popup surface.
518       </description>
519     </event>
520   </interface>
521
522   <interface name="wl_surface" version="1">
523     <description summary="an onscreen surface">
524       A surface.  This is an image that is displayed on the screen.
525       It has a location, size and pixel contents.
526     </description>
527
528     <request name="destroy" type="destructor">
529       <description summary="delete surface">
530         Deletes the surface and invalidates its object id.
531       </description>
532     </request>
533
534     <request name="attach">
535       <description summary="set the surface contents">
536         Copy the contents of a buffer into this surface. The x and y
537         arguments specify the location of the new buffers upper left
538         corner, relative to the old buffers upper left corner.
539       </description>
540
541       <arg name="buffer" type="object" interface="wl_buffer"/>
542       <arg name="x" type="int"/>
543       <arg name="y" type="int"/>
544     </request>
545
546     <request name="damage">
547       <description summary="mark part of the surface damaged">
548         After attaching a new buffer, this request is used to describe
549         the regions where the new buffer is different from the
550         previous buffer and needs to be repainted.  Coordinates are
551         relative to the new buffer.
552       </description>
553
554       <arg name="x" type="int"/>
555       <arg name="y" type="int"/>
556       <arg name="width" type="int"/>
557       <arg name="height" type="int"/>
558     </request>
559
560     <request name="frame">
561       <description summary="request repaint feedback">
562         Request notification when the next frame is displayed.  Useful
563         for throttling redrawing operations, and driving animations.
564         The notification will only be posted for one frame unless
565         requested again.
566       </description>
567
568       <arg name="callback" type="new_id" interface="wl_callback"/>
569     </request>
570
571   </interface>
572
573   <interface name="wl_input_device" version="1">
574     <description summary="input device group">
575       A group of keyboards and pointer devices (mice, for
576       example). This object is published as a global during start up,
577       or when such a device is hot plugged.  A input_device group
578       typically has a pointer and maintains a keyboard_focus and a
579       pointer_focus.
580     </description>
581
582     <request name="attach">
583       <description summary="set the pointer image">
584         Set the pointer's image.  This request only takes effect if
585         the pointer focus for this device is one of the requesting
586         clients surfaces.
587       </description>
588
589       <arg name="time" type="uint"/>
590       <arg name="buffer" type="object" interface="wl_buffer"/>
591       <arg name="hotspot_x" type="int"/>
592       <arg name="hotspot_y" type="int"/>
593     </request>
594
595     <event name="motion">
596       <description summary="pointer motion event">
597         Notification of pointer location change. The arguments surface_[xy]
598         are the location relative to the focused surface.
599       </description>
600
601       <arg name="time" type="uint"/>
602       <arg name="surface_x" type="int"/>
603       <arg name="surface_y" type="int"/>
604     </event>
605
606     <event name="button">
607       <description summary="pointer button event">
608         Mouse button click and release notifications.  The location
609         of the click is given by the last motion or pointer_focus event.
610       </description>
611
612       <arg name="time" type="uint"/>
613       <arg name="button" type="uint"/>
614       <arg name="state" type="uint"/>
615     </event>
616
617     <event name="key">
618       <description summary="key event">
619         A key was pressed or released.
620       </description>
621
622       <arg name="time" type="uint"/>
623       <arg name="key" type="uint"/>
624       <arg name="state" type="uint"/>
625     </event>
626
627     <event name="pointer_enter">
628       <description summary="pointer enter event">
629         Notification that this input device's pointer is focused on
630         certain surface. When an input_device enters a surface, the
631         pointer image is undefined and a client should respond to this
632         event by setting an appropriate pointer image.
633       </description>
634
635       <arg name="time" type="uint"/>
636       <arg name="surface" type="object" interface="wl_surface"/>
637       <arg name="surface_x" type="int"/>
638       <arg name="surface_y" type="int"/>
639     </event>
640
641     <event name="pointer_leave">
642       <description summary="pointer leave event">
643       </description>
644       <arg name="time" type="uint"/>
645       <arg name="surface" type="object" interface="wl_surface"/>
646     </event>
647
648     <event name="keyboard_enter">
649       <arg name="time" type="uint"/>
650       <arg name="surface" type="object" interface="wl_surface"/>
651       <arg name="keys" type="array"/>
652     </event>
653
654     <event name="keyboard_leave">
655       <arg name="time" type="uint"/>
656       <arg name="surface" type="object" interface="wl_surface"/>
657     </event>
658
659     <event name="touch_down">
660       <arg name="time" type="uint"/>
661       <arg name="surface" type="object" interface="wl_surface"/>
662       <arg name="id" type="int" />
663       <arg name="x" type="int" />
664       <arg name="y" type="int" />
665     </event>
666
667     <event name="touch_up">
668       <arg name="time" type="uint"/>
669       <arg name="id" type="int" />
670     </event>
671
672     <event name="touch_motion">
673       <arg name="time" type="uint"/>
674       <arg name="id" type="int" />
675       <arg name="x" type="int" />
676       <arg name="y" type="int" />
677     </event>
678
679     <event name="touch_frame">
680       <description summary="end of touch frame event">
681         Indicates the end of a contact point list.
682       </description>
683     </event>
684
685     <event name="touch_cancel">
686       <description summary="touch session cancelled">
687         Sent if the compositor decides the touch stream is a global
688         gesture. No further events are sent to the clients from that
689         particular gesture.
690       </description>
691     </event>
692   </interface>
693
694
695   <interface name="wl_output" version="1">
696     <description summary="compositor output region">
697       An output describes part of the compositor geometry.  The
698       compositor work in the 'compositor coordinate system' and an
699       output corresponds to rectangular area in that space that is
700       actually visible.  This typically corresponds to a monitor that
701       displays part of the compositor space.  This object is published
702       as global during start up, or when a screen is hot plugged.
703     </description>
704
705     <enum name="subpixel">
706       <entry name="unknown" value="0"/>
707       <entry name="none" value="1"/>
708       <entry name="horizontal_rgb" value="2"/>
709       <entry name="horizontal_bgr" value="3"/>
710       <entry name="vertical_rgb" value="4"/>
711       <entry name="vertical_bgr" value="5"/>
712     </enum>
713
714     <event name="geometry">
715       <arg name="x" type="int"/>
716       <arg name="y" type="int"/>
717       <arg name="physical_width" type="int"/>
718       <arg name="physical_height" type="int"/>
719       <arg name="subpixel" type="int"/>
720       <arg name="make" type="string"/>
721       <arg name="model" type="string"/>
722     </event>
723
724     <enum name="mode">
725       <description summary="values for the flags bitfield in the mode event"/>
726       <entry name="current" value="0x1"/>
727       <entry name="preferred" value="0x2"/>
728     </enum>
729       
730     <event name="mode">
731       <arg name="flags" type="uint"/>
732       <arg name="width" type="int"/>
733       <arg name="height" type="int"/>
734       <arg name="refresh" type="int"/>
735     </event>
736   </interface>
737
738 </protocol>