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