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