scanner: Support documentation elements
[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\n 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   <!-- The core global object. This is a special singleton object.
31        It is used for internal wayland protocol features. -->
32   <interface name="wl_display" version="1">
33     <description summary="core global object">
34       The core global object. This is a special singleton object.
35       It is used for internal wayland protocol features.
36     </description>
37     <request name="bind">
38       <description summary="bind an object to the display">
39       </description>
40       <arg name="name" type="uint"/>
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     <!-- sync is an just an echo, which will reply with a key event.
47          Since requests are handled in-order, this can be used as a
48          barrier to ensure all previous requests have been handled.
49          The key argument can be used to correlate between multiple
50          sync invocations. -->
51     <request name="sync">
52       <arg name="callback" type="new_id" interface="wl_callback"/>
53     </request>
54
55     <!-- A fatal error has occurred. -->
56     <event name="error">
57       <arg name="object_id" type="object" interface="wl_object"/>
58       <arg name="code" type="uint"/>
59       <arg name="message" type="string"/>
60     </event>
61
62     <enum name="error">
63       <description summary="global error values">
64         These errors are global and can be emitted in response to any
65         server request.
66       </description>
67       <entry name="invalid_object" value="0"
68              summary="server couldn't find object"/>
69       <entry name="invalid_method" value="1"
70              summary="method doesn't exist on the specified interface"/>
71       <entry name="no_memory" value="2"
72              summary="server is out of memory"/>
73     </enum>
74
75     <!-- Notify the client of global objects. These are objects that
76          are created by the server. Globals are published on the
77          initial client connection sequence, upon device hotplugs,
78          device disconnects, reconfiguration or other events.  The
79          server will always announce an object before the object sends
80          out events. -->
81     <event name="global">
82       <arg name="name" type="uint"/>
83       <arg name="interface" type="string"/>
84       <arg name="version" type="uint"/>
85     </event>
86
87     <!-- Notify the client of removed global objects. -->
88     <event name="global_remove">
89       <arg name="name" type="uint" />
90     </event>
91
92     <!-- Server has deleted the id and client can now reuse it. -->
93     <event name="delete_id">
94       <arg name="id" type="uint" />
95     </event>
96   </interface>
97
98   <interface name="wl_callback" version="1">
99     <event name="done">
100       <arg name="time" type="uint"/>
101     </event>
102   </interface>
103
104   <!-- A compositor. This object is a global.  The compositor is in
105        charge of combining the contents of multiple surfaces into one
106        displayable output. -->
107   <interface name="wl_compositor" version="1">
108     <!-- Factory request for a surface objects. A surface is akin to a
109          window. -->
110     <request name="create_surface">
111       <arg name="id" type="new_id" interface="wl_surface"/>
112     </request>
113   </interface>
114
115   <!-- Shared memory support -->
116   <interface name="wl_shm" version="1">
117     <enum name="error">
118       <entry name="invalid_format" value="0"/>
119       <entry name="invalid_stride" value="1"/>
120       <entry name="invalid_fd" value="2"/>
121     </enum>
122
123     <enum name="format">
124       <entry name="argb8888" value="0"/>
125       <entry name="xrgb8888" value="1"/>
126     </enum>
127
128     <!-- Transfer a shm buffer to the server.  The allocated buffer
129          would include at least stride * height bytes starting at the
130          beginning of fd.  The file descriptor is transferred over the
131          socket using AF_UNIX magical features. width, height, stride
132          and format describe the respective properties of the pixel
133          data contained in the buffer. -->
134     <request name="create_buffer">
135       <arg name="id" type="new_id" interface="wl_buffer"/>
136       <arg name="fd" type="fd"/>
137       <arg name="width" type="int"/>
138       <arg name="height" type="int"/>
139       <arg name="stride" type="uint"/>
140       <arg name="format" type="uint"/>
141     </request>
142
143     <event name="format">
144       <arg name="format" type="uint"/>
145     </event>
146   </interface>
147
148
149   <!-- A pixel buffer. Created using the drm, shm or similar objects.
150        It has a size, visual and contents, but not a location on the
151        screen. -->
152   <interface name="wl_buffer" version="1">
153     <!-- Notify the server that the specified area of the buffers
154          contents have changed.  To describe a more complicated area
155          of damage, break down the region into rectangles and use this
156          request several times.
157     -->
158     <request name="damage">
159       <arg name="x" type="int"/>
160       <arg name="y" type="int"/>
161       <arg name="width" type="int"/>
162       <arg name="height" type="int"/>
163     </request>
164
165     <!-- Destroy a buffer.  This will invalidate the object id. -->
166     <request name="destroy" type="destructor"/>
167
168     <!-- Sent when an attached buffer is no longer used by the compositor. -->
169     <event name="release"/>
170   </interface>
171
172
173   <interface name="wl_data_offer" version="1">
174     <!-- Indicate that the client can accept the given mime-type, or
175          NULL for not accepted.  Use for feedback during drag and
176          drop. -->
177     <request name="accept">
178       <arg name="time" type="uint"/>
179       <arg name="type" type="string"/>
180     </request>
181
182     <request name="receive">
183       <arg name="mime_type" type="string"/>
184       <arg name="fd" type="fd"/>
185     </request>
186
187     <request name="destroy" type="destructor"/>
188
189     <!-- Sent immediately after creating the wl_data_offer object.  One
190          event per offered mime type. -->
191     <event name="offer">
192       <arg name="type" type="string"/>
193     </event>
194   </interface>
195
196   <interface name="wl_data_source" version="1">
197     <!-- Add an offered mime type.  Can be called several times to
198          offer multiple types. -->
199     <request name="offer">
200       <arg name="type" type="string"/>
201     </request>
202
203     <!-- Destroy the selection. -->
204     <request name="destroy" type="destructor"/>
205
206     <!-- Sent when a target accepts pointer_focus or motion events.
207          If a target does not accept any of the offered types, type is
208          NULL -->
209     <event name="target">
210       <arg name="mime_type" type="string"/>
211     </event>
212
213     <!-- Request for data from another client.  Send the data in the
214          specified mime-type over the passed fd, the close it. -->
215     <event name="send">
216       <arg name="mime_type" type="string"/>
217       <arg name="fd" type="fd"/>
218     </event>
219
220     <!-- Another selection became active. -->
221     <event name="cancelled"/>
222   </interface>
223
224   <interface name="wl_data_device" version="1">
225     <request name="start_drag">
226       <arg name="source" type="object" interface="wl_data_source"/>
227       <arg name="surface" type="object" interface="wl_surface"/>
228       <arg name="time" type="uint"/>
229     </request>
230
231     <request name="attach">
232       <arg name="time" type="uint"/>
233       <arg name="buffer" type="object" interface="wl_buffer"/>
234       <arg name="x" type="int"/>
235       <arg name="y" type="int"/>
236     </request>
237
238     <request name="set_selection">
239       <arg name="source" type="object" interface="wl_data_source"/>
240       <arg name="time" type="uint"/>
241     </request>
242
243     <!-- The data_offer event introduces a new wl_data_offer object,
244          which will subsequently be used in either the
245          data_device.enter event (for drag and drop) or the
246          data_device.selection event (for selections).  Immediately
247          following the data_device_data_offer event, the new
248          data_offer object will send out data_offer.offer events to
249          describe the mime-types it offers. -->
250     <event name="data_offer">
251       <arg name="id" type="new_id" interface="wl_data_offer"/>
252     </event>
253
254     <event name="enter">
255       <arg name="time" type="uint"/>
256       <arg name="surface" type="object" interface="wl_surface"/>
257       <arg name="x" type="int"/>
258       <arg name="y" type="int"/>
259       <arg name="id" type="object" interface="wl_data_offer"/>
260     </event>
261
262     <event name="leave"/>
263
264     <event name="motion">
265       <arg name="time" type="uint"/>
266       <arg name="x" type="int"/>
267       <arg name="y" type="int"/>
268     </event>
269
270     <event name="drop"/>
271
272     <!-- The selection event is sent out to notify the client of a new
273          wl_data_offer for the selection for this device.  The
274          data_device.data_offer and the data_offer.offer events are
275          sent out immediately before this event to introduce the data
276          offer object.  The selection event is sent to a client
277          immediately before receiving keyboard focus and when a new
278          selection is set while the client has keyboard focus.  The
279          data_offer is valid until a new data_offer or NULL is
280          received or until the client loses keyboard focus. -->
281     <event name="selection">
282       <arg name="id" type="object" interface="wl_data_offer"/>
283     </event>
284   </interface>
285
286   <interface name="wl_data_device_manager" version="1">
287     <request name="create_data_source">
288       <arg name="id" type="new_id" interface="wl_data_source"/>
289     </request>
290
291     <request name="get_data_device">
292       <arg name="id" type="new_id" interface="wl_data_device"/>
293       <arg name="input_device" type="object" interface="wl_input_device"/>
294     </request>
295   </interface>
296
297   <interface name="wl_shell" version="1">
298     <request name="get_shell_surface">
299       <arg name="id" type="new_id" interface="wl_shell_surface"/>
300       <arg name="surface" type="object" interface="wl_surface"/>
301     </request>
302   </interface>
303
304   <!-- A wrapper interface for shell related actions on a wl_surface.
305        On server side the object is automatically destroyed when the
306        related wl_surface is destroyed.
307        On client side, wl_shell_surface_destroy() must be called
308        before destroying the wl_surface object. -->
309   <interface name="wl_shell_surface" version="1">
310     <request name="move">
311       <arg name="input_device" type="object" interface="wl_input_device"/>
312       <arg name="time" type="uint"/>
313     </request>
314
315     <enum name="resize">
316       <entry name="none" value="0"/>
317       <entry name="top" value="1"/>
318       <entry name="bottom" value="2"/>
319       <entry name="left" value="4"/>
320       <entry name="top_left" value="5"/>
321       <entry name="bottom_left" value="6"/>
322       <entry name="right" value="8"/>
323       <entry name="top_right" value="9"/>
324       <entry name="bottom_right" value="10"/>
325     </enum>
326
327     <request name="resize">
328       <arg name="input_device" type="object" interface="wl_input_device"/>
329       <arg name="time" type="uint"/>
330       <!-- edges is an enum, need to get the values in here -->
331       <arg name="edges" type="uint"/>
332     </request>
333
334     <!-- Make the surface visible as a toplevel window. -->
335     <request name="set_toplevel"/>
336
337     <!-- Map the surface relative to an existing surface. The x and y
338          arguments specify the locations of the upper left corner of
339          the surface relative to the upper left corner of the parent
340          surface.  The flags argument controls overflow/clipping
341          behaviour when the surface would intersect a screen edge,
342          panel or such.  And possibly whether the offset only
343          determines the initial position or if the surface is locked
344          to that relative position during moves. -->
345     <request name="set_transient">
346       <arg name="parent" type="object" interface="wl_shell_surface"/>
347       <arg name="x" type="int"/>
348       <arg name="y" type="int"/>
349       <arg name="flags" type="uint"/>
350     </request>
351
352     <!-- Map the surface as a fullscreen surface.  There are a number
353          of options here: on which output? if the surface size doesn't
354          match the output size, do we scale, change resolution, or add
355          black borders? is that something the client controls?  what
356          about transient surfaces, do they float on top of the
357          fullscreen? what if there's already a fullscreen surface on
358          the output, maybe you can only go fullscreen if you're
359          active?  -->
360     <request name="set_fullscreen"/>
361
362     <!-- Popup surfaces.  Will switch an implicit grab into
363          owner-events mode, and grab will continue after the implicit
364          grab ends (button released).  Once the implicit grab is over,
365          the popup grab continues until the window is destroyed or a
366          mouse button is pressed in any other clients window.  A click
367          in any of the clients surfaces is reported as normal,
368          however, clicks in other clients surfaces will be discarded
369          and trigger the callback. 
370
371          TODO: Grab keyboard too, maybe just terminate on any click
372          inside or outside the surface?
373     -->
374     <request name="set_popup">
375       <arg name="input_device" type="object" interface="wl_input_device"/>
376       <arg name="time" type="uint"/>
377       <arg name="parent" type="object" interface="wl_shell_surface"/>
378       <arg name="x" type="int"/>
379       <arg name="y" type="int"/>
380       <arg name="flags" type="uint"/>
381     </request>
382
383     <!-- The configure event asks the client to resize its surface.
384          The size is a hint, in the sense that the client is free to
385          ignore it if it doesn't resize, pick a smaller size (to
386          satisfy aspect ration or resize in steps of NxM pixels).  The
387          client is free to dismiss all but the last configure event it
388          received. -->
389     <event name="configure">
390       <arg name="time" type="uint"/>
391       <arg name="edges" type="uint"/>
392       <arg name="width" type="int"/>
393       <arg name="height" type="int"/>
394     </event>
395
396     <!-- The popup_done event is sent out when a popup grab is broken,
397          that is, when the users clicks a surface that doesn't belong
398          to the client owning the popup surface. -->
399     <event name="popup_done"/>
400   </interface>
401
402
403   <!-- A surface. This is an image that is displayed on the screen.
404        It has a location, size and pixel contents. Similar to a window. -->
405   <interface name="wl_surface" version="1">
406     <!-- Deletes the surface and invalidates its object id. -->
407     <request name="destroy" type="destructor"/>
408
409     <!-- Copy the contents of a buffer into this surface. The x and y
410          arguments specify the location of the new buffers upper left
411          corner, relative to the old buffers upper left corner. -->
412     <request name="attach">
413       <arg name="buffer" type="object" interface="wl_buffer"/>
414       <arg name="x" type="int"/>
415       <arg name="y" type="int"/>
416     </request>
417
418     <!-- After attaching a new buffer, this request is used to
419          describe the regions where the new buffer is different from
420          the previous buffer and needs to be repainted.  Coordinates
421          are relative to the new buffer. -->
422     <request name="damage">
423       <arg name="x" type="int"/>
424       <arg name="y" type="int"/>
425       <arg name="width" type="int"/>
426       <arg name="height" type="int"/>
427     </request>
428
429     <!-- Request notification when the next frame is displayed.
430          Useful for throttling redrawing operations, and driving
431          animations.  The notification will only be posted for one
432          frame unless requested again. -->
433     <request name="frame">
434       <arg name="callback" type="new_id" interface="wl_callback"/>
435     </request>
436
437   </interface>
438
439
440   <!-- A group of keyboards and pointer devices (mice, for
441        example). This object is published as a global during start up,
442        or when such a device is hot plugged.  A input_device group
443        typically has a pointer and maintains a keyboard_focus and a
444        pointer_focus.  -->
445   <interface name="wl_input_device" version="1">
446     <!-- Set the pointer's image.  This request only takes effect if
447          the pointer focus for this device is one of the requesting
448          clients surfaces.  -->
449     <request name="attach">
450       <arg name="time" type="uint"/>
451       <arg name="buffer" type="object" interface="wl_buffer"/>
452       <arg name="hotspot_x" type="int"/>
453       <arg name="hotspot_y" type="int"/>
454     </request>
455
456     <!-- Notification of pointer location change.
457          x,y are the absolute location on the screen.
458          surface_[xy] are the location relative to the focused surface. -->
459     <event name="motion">
460       <arg name="time" type="uint"/>
461       <arg name="x" type="int"/>
462       <arg name="y" type="int"/>
463       <arg name="surface_x" type="int"/>
464       <arg name="surface_y" type="int"/>
465     </event>
466
467     <!-- Mouse button click and release notifications.  The location
468          of the click is given by the last motion or pointer_focus
469          event. -->
470     <event name="button">
471       <arg name="time" type="uint"/>
472       <arg name="button" type="uint"/>
473       <arg name="state" type="uint"/>
474     </event>
475
476     <!-- Keyboard press. -->
477     <event name="key">
478       <arg name="time" type="uint"/>
479       <arg name="key" type="uint"/>
480       <arg name="state" type="uint"/>
481     </event>
482
483     <!-- Notification that this input device's pointer is focused on
484          certain surface. When an input_device enters a surface, the
485          pointer image is undefined and a client should respond to
486          this event by setting an apropriate pointer image. -->
487     <event name="pointer_focus">
488       <arg name="time" type="uint"/>
489       <arg name="surface" type="object" interface="wl_surface"/>
490       <arg name="x" type="int"/>
491       <arg name="y" type="int"/>
492       <arg name="surface_x" type="int"/>
493       <arg name="surface_y" type="int"/>
494     </event>
495
496     <event name="keyboard_focus">
497       <arg name="time" type="uint"/>
498       <arg name="surface" type="object" interface="wl_surface"/>
499       <arg name="keys" type="array"/>
500     </event>
501
502     <event name="touch_down">
503       <arg name="time" type="uint"/>
504       <arg name="surface" type="object" interface="wl_surface"/>
505       <arg name="id" type="int" />
506       <arg name="x" type="int" />
507       <arg name="y" type="int" />
508     </event>
509
510     <event name="touch_up">
511       <arg name="time" type="uint"/>
512       <arg name="id" type="int" />
513     </event>
514
515     <event name="touch_motion">
516       <arg name="time" type="uint"/>
517       <arg name="id" type="int" />
518       <arg name="x" type="int" />
519       <arg name="y" type="int" />
520     </event>
521
522     <!-- Indicates the end of a contact point list. -->
523     <event name="touch_frame"/>
524
525     <!-- Sent if the compositor decides the touch stream is a global
526          gesture. No further events are sent to the clients from that
527          particular gesture. -->
528     <event name="touch_cancel"/>
529   </interface>
530
531
532   <!-- An output describes part of the compositor geometry.  The
533        compositor work in the 'compositor coordinate system' and an
534        output corresponds to rectangular area in that space that is
535        actually visible.  This typically corresponds to a monitor that
536        displays part of the compositor space.  This object is
537        published as global during start up, or when a screen is hot
538        plugged.  -->
539   <interface name="wl_output" version="1">
540
541     <enum name="subpixel">
542       <entry name="unknown" value="0"/>
543       <entry name="none" value="1"/>
544       <entry name="horizontal_rgb" value="2"/>
545       <entry name="horizontal_bgr" value="3"/>
546       <entry name="vertical_rgb" value="4"/>
547       <entry name="vertical_bgr" value="5"/>
548     </enum>
549
550     <event name="geometry">
551       <arg name="x" type="int"/>
552       <arg name="y" type="int"/>
553       <arg name="physical_width" type="int"/>
554       <arg name="physical_height" type="int"/>
555       <arg name="subpixel" type="int"/>
556       <arg name="make" type="string"/>
557       <arg name="model" type="string"/>
558     </event>
559
560     <!-- Values for the flags bitfield of the mode event. -->
561     <enum name="mode">
562       <entry name="current" value="0x1"/>
563       <entry name="preferred" value="0x2"/>
564     </enum>
565       
566     <event name="mode">
567       <arg name="flags" type="uint"/>
568       <arg name="width" type="int"/>
569       <arg name="height" type="int"/>
570       <arg name="refresh" type="int"/>
571     </event>
572   </interface>
573
574 </protocol>