protocol: introduce wl_shell_surface
[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
161   <interface name="wl_data_offer" version="1">
162     <!-- Indicate that the client can accept the given mime-type, or
163          NULL for not accepted.  Use for feedback during drag and
164          drop. -->
165     <request name="accept">
166       <arg name="time" type="uint"/>
167       <arg name="type" type="string"/>
168     </request>
169
170     <request name="receive">
171       <arg name="mime_type" type="string"/>
172       <arg name="fd" type="fd"/>
173     </request>
174
175     <request name="destroy" type="destructor"/>
176
177     <!-- Sent immediately after creating the wl_data_offer object.  One
178          event per offered mime type. -->
179     <event name="offer">
180       <arg name="type" type="string"/>
181     </event>
182   </interface>
183
184   <interface name="wl_data_source" version="1">
185     <!-- Add an offered mime type.  Can be called several times to
186          offer multiple types. -->
187     <request name="offer">
188       <arg name="type" type="string"/>
189     </request>
190
191     <!-- Destroy the selection. -->
192     <request name="destroy" type="destructor"/>
193
194     <!-- Sent when a target accepts pointer_focus or motion events.
195          If a target does not accept any of the offered types, type is
196          NULL -->
197     <event name="target">
198       <arg name="mime_type" type="string"/>
199     </event>
200
201     <!-- Request for data from another client.  Send the data in the
202          specified mime-type over the passed fd, the close it. -->
203     <event name="send">
204       <arg name="mime_type" type="string"/>
205       <arg name="fd" type="fd"/>
206     </event>
207
208     <!-- Another selection became active. -->
209     <event name="cancelled"/>
210   </interface>
211
212   <interface name="wl_data_device" version="1">
213     <request name="start_drag">
214       <arg name="source" type="object" interface="wl_data_source"/>
215       <arg name="surface" type="object" interface="wl_surface"/>
216       <arg name="time" type="uint"/>
217     </request>
218
219     <request name="attach">
220       <arg name="time" type="uint"/>
221       <arg name="buffer" type="object" interface="wl_buffer"/>
222       <arg name="x" type="int"/>
223       <arg name="y" type="int"/>
224     </request>
225
226     <request name="set_selection">
227       <arg name="source" type="object" interface="wl_data_source"/>
228       <arg name="time" type="uint"/>
229     </request>
230
231     <event name="data_offer">
232       <arg name="id" type="new_id" interface="wl_data_offer"/>
233     </event>
234
235     <event name="enter">
236       <arg name="time" type="uint"/>
237       <arg name="surface" type="object" interface="wl_surface"/>
238       <arg name="x" type="int"/>
239       <arg name="y" type="int"/>
240       <arg name="id" type="object" interface="wl_data_offer"/>
241     </event>
242
243     <event name="leave"/>
244
245     <event name="motion">
246       <arg name="time" type="uint"/>
247       <arg name="x" type="int"/>
248       <arg name="y" type="int"/>
249     </event>
250
251     <event name="drop"/>
252
253     <event name="selection">
254       <arg name="id" type="object" interface="wl_data_offer"/>
255     </event>
256   </interface>
257
258   <interface name="wl_data_device_manager" version="1">
259     <request name="create_data_source">
260       <arg name="id" type="new_id" interface="wl_data_source"/>
261     </request>
262
263     <request name="get_data_device">
264       <arg name="id" type="new_id" interface="wl_data_device"/>
265       <arg name="input_device" type="object" interface="wl_input_device"/>
266     </request>
267   </interface>
268
269   <interface name="wl_shell" version="1">
270     <request name="get_shell_surface">
271       <arg name="id" type="new_id" interface="wl_shell_surface"/>
272       <arg name="surface" type="object" interface="wl_surface"/>
273     </request>
274   </interface>
275
276   <!-- A wrapper interface for shell related actions on a wl_surface.
277        On server side the object is automatically destroyed when the
278        related wl_surface is destroyed.
279        On client side, wl_shell_surface_destroy() must be called
280        before destroying the wl_surface object. -->
281   <interface name="wl_shell_surface" version="1">
282     <request name="move">
283       <arg name="input_device" type="object" interface="wl_input_device"/>
284       <arg name="time" type="uint"/>
285     </request>
286
287     <enum name="resize">
288       <entry name="none" value="0"/>
289       <entry name="top" value="1"/>
290       <entry name="bottom" value="2"/>
291       <entry name="left" value="4"/>
292       <entry name="top_left" value="5"/>
293       <entry name="bottom_left" value="6"/>
294       <entry name="right" value="8"/>
295       <entry name="top_right" value="9"/>
296       <entry name="bottom_right" value="10"/>
297     </enum>
298
299     <request name="resize">
300       <arg name="input_device" type="object" interface="wl_input_device"/>
301       <arg name="time" type="uint"/>
302       <!-- edges is an enum, need to get the values in here -->
303       <arg name="edges" type="uint"/>
304     </request>
305
306     <!-- Make the surface visible as a toplevel window. -->
307     <request name="set_toplevel"/>
308
309     <!-- Map the surface relative to an existing surface. The x and y
310          arguments specify the locations of the upper left corner of
311          the surface relative to the upper left corner of the parent
312          surface.  The flags argument controls overflow/clipping
313          behaviour when the surface would intersect a screen edge,
314          panel or such.  And possibly whether the offset only
315          determines the initial position or if the surface is locked
316          to that relative position during moves. -->
317     <request name="set_transient">
318       <arg name="parent" type="object" interface="wl_shell_surface"/>
319       <arg name="x" type="int"/>
320       <arg name="y" type="int"/>
321       <arg name="flags" type="uint"/>
322     </request>
323
324     <!-- Map the surface as a fullscreen surface.  There are a number
325          of options here: on which output? if the surface size doesn't
326          match the output size, do we scale, change resolution, or add
327          black borders? is that something the client controls?  what
328          about transient surfaces, do they float on top of the
329          fullscreen? what if there's already a fullscreen surface on
330          the output, maybe you can only go fullscreen if you're
331          active?  -->
332     <request name="set_fullscreen"/>
333
334     <!-- The configure event asks the client to resize its surface.
335          The size is a hint, in the sense that the client is free to
336          ignore it if it doesn't resize, pick a smaller size (to
337          satisfy aspect ration or resize in steps of NxM pixels).  The
338          client is free to dismiss all but the last configure event it
339          received. -->
340     <event name="configure">
341       <arg name="time" type="uint"/>
342       <arg name="edges" type="uint"/>
343       <arg name="width" type="int"/>
344       <arg name="height" type="int"/>
345     </event>
346   </interface>
347
348
349   <!-- A surface. This is an image that is displayed on the screen.
350        It has a location, size and pixel contents. Similar to a window. -->
351   <interface name="wl_surface" version="1">
352     <!-- Deletes the surface and invalidates its object id. -->
353     <request name="destroy" type="destructor"/>
354
355     <!-- Copy the contents of a buffer into this surface. The x and y
356          arguments specify the location of the new buffers upper left
357          corner, relative to the old buffers upper left corner. -->
358     <request name="attach">
359       <arg name="buffer" type="object" interface="wl_buffer"/>
360       <arg name="x" type="int"/>
361       <arg name="y" type="int"/>
362     </request>
363
364     <!-- After attaching a new buffer, this request is used to
365          describe the regions where the new buffer is different from
366          the previous buffer and needs to be repainted.  Coordinates
367          are relative to the new buffer. -->
368     <request name="damage">
369       <arg name="x" type="int"/>
370       <arg name="y" type="int"/>
371       <arg name="width" type="int"/>
372       <arg name="height" type="int"/>
373     </request>
374
375     <!-- Request notification when the next frame is displayed.
376          Useful for throttling redrawing operations, and driving
377          animations.  The notification will only be posted for one
378          frame unless requested again. -->
379     <request name="frame">
380       <arg name="callback" type="new_id" interface="wl_callback"/>
381     </request>
382
383   </interface>
384
385
386   <!-- A group of keyboards and pointer devices (mice, for
387        example). This object is published as a global during start up,
388        or when such a device is hot plugged.  A input_device group
389        typically has a pointer and maintains a keyboard_focus and a
390        pointer_focus.  -->
391   <interface name="wl_input_device" version="1">
392     <!-- Set the pointer's image.  This request only takes effect if
393          the pointer focus for this device is one of the requesting
394          clients surfaces.  -->
395     <request name="attach">
396       <arg name="time" type="uint"/>
397       <arg name="buffer" type="object" interface="wl_buffer"/>
398       <arg name="hotspot_x" type="int"/>
399       <arg name="hotspot_y" type="int"/>
400     </request>
401
402     <!-- Notification of pointer location change.
403          x,y are the absolute location on the screen.
404          surface_[xy] are the location relative to the focused surface. -->
405     <event name="motion">
406       <arg name="time" type="uint"/>
407       <arg name="x" type="int"/>
408       <arg name="y" type="int"/>
409       <arg name="surface_x" type="int"/>
410       <arg name="surface_y" type="int"/>
411     </event>
412
413     <!-- Mouse button click and release notifications.  The location
414          of the click is given by the last motion or pointer_focus
415          event. -->
416     <event name="button">
417       <arg name="time" type="uint"/>
418       <arg name="button" type="uint"/>
419       <arg name="state" type="uint"/>
420     </event>
421
422     <!-- Keyboard press. -->
423     <event name="key">
424       <arg name="time" type="uint"/>
425       <arg name="key" type="uint"/>
426       <arg name="state" type="uint"/>
427     </event>
428
429     <!-- Notification that this input device's pointer is focused on
430          certain surface. When an input_device enters a surface, the
431          pointer image is undefined and a client should respond to
432          this event by setting an apropriate pointer image. -->
433     <event name="pointer_focus">
434       <arg name="time" type="uint"/>
435       <arg name="surface" type="object" interface="wl_surface"/>
436       <arg name="x" type="int"/>
437       <arg name="y" type="int"/>
438       <arg name="surface_x" type="int"/>
439       <arg name="surface_y" type="int"/>
440     </event>
441
442     <event name="keyboard_focus">
443       <arg name="time" type="uint"/>
444       <arg name="surface" type="object" interface="wl_surface"/>
445       <arg name="keys" type="array"/>
446     </event>
447
448     <event name="touch_down">
449       <arg name="time" type="uint"/>
450       <arg name="id" type="int" />
451       <arg name="x" type="int" />
452       <arg name="y" type="int" />
453     </event>
454
455     <event name="touch_up">
456       <arg name="time" type="uint"/>
457       <arg name="id" type="int" />
458     </event>
459
460     <event name="touch_motion">
461       <arg name="time" type="uint"/>
462       <arg name="id" type="int" />
463       <arg name="x" type="int" />
464       <arg name="y" type="int" />
465     </event>
466
467     <!-- Indicates the end of a contact point list. -->
468     <event name="touch_frame"/>
469
470     <!-- Sent if the compositor decides the touch stream is a global
471          gesture. No further events are sent to the clients from that
472          particular gesture. -->
473     <event name="touch_cancel"/>
474   </interface>
475
476
477   <!-- An output describes part of the compositor geometry.  The
478        compositor work in the 'compositor coordinate system' and an
479        output corresponds to rectangular area in that space that is
480        actually visible.  This typically corresponds to a monitor that
481        displays part of the compositor space.  This object is
482        published as global during start up, or when a screen is hot
483        plugged.  -->
484   <interface name="wl_output" version="1">
485
486     <enum name="subpixel">
487       <entry name="unknown" value="0"/>
488       <entry name="none" value="1"/>
489       <entry name="horizontal_rgb" value="2"/>
490       <entry name="horizontal_bgr" value="3"/>
491       <entry name="vertical_rgb" value="4"/>
492       <entry name="vertical_bgr" value="5"/>
493     </enum>
494
495     <event name="geometry">
496       <arg name="x" type="int"/>
497       <arg name="y" type="int"/>
498       <arg name="physical_width" type="int"/>
499       <arg name="physical_height" type="int"/>
500       <arg name="subpixel" type="int"/>
501       <arg name="make" type="string"/>
502       <arg name="model" type="string"/>
503     </event>
504
505     <!-- Values for the flags bitfield of the mode event. -->
506     <enum name="mode">
507       <entry name="current" value="0x1"/>
508       <entry name="preferred" value="0x2"/>
509     </enum>
510       
511     <event name="mode">
512       <arg name="flags" type="uint"/>
513       <arg name="width" type="int"/>
514       <arg name="height" type="int"/>
515       <arg name="refresh" type="int"/>
516     </event>
517   </interface>
518
519 </protocol>