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