Introduce display.bind to request events from a global
[profile/ivi/wayland.git] / protocol / wayland.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="wayland">
3
4   <!-- The core global object. This is a special singleton object.
5        It is used for internal wayland protocol features. -->
6   <interface name="display" version="1">
7     <request name="bind">
8       <arg name="id" type="uint"/>
9       <arg name="interface" type="string"/>
10       <arg name="version" type="uint"/>
11     </request>
12
13     <!-- sync is an just an echo, which will reply with a sync event.
14          Since requests are handled in-order, this can be used as a
15          barrier to ensure all previous requests have ben handled.
16          The key argument can be used to correlate between multiple
17          sync invocations. -->
18     <request name="sync">
19       <arg name="key" type="uint"/>
20     </request>
21
22     <!-- Request notification when the next frame is displayed.
23          Useful for throttling redrawing operations, and driving
24          animations.  The notification will only be posted for one
25          frame unless requested again. -->
26     <request name="frame">
27       <arg name="surface" type="object" interface="surface"/>
28       <arg name="key" type="uint"/>
29     </request>
30
31     <!-- A request addressed a non-existent object id. This is
32          tyipcally a fatal error. -->
33     <event name="invalid_object">
34       <arg name="object_id" type="uint"/>
35     </event>
36
37     <!-- A request tried to invoke an opcode out of range.  This is
38          typically a fatal error. -->
39     <event name="invalid_method">
40       <arg name="object_id" type="uint"/>
41       <arg name="opcode" type="uint"/>
42     </event>
43
44     <!-- A request has failed due to an out of memory error. -->
45     <event name="no_memory"/>
46
47     <!-- Notify the client of global objects. These are objects that
48          are created by the server. Globals are published on the
49          initial client connection sequence, upon device hotplugs,
50          device disconnects, reconfiguration or other events.  The
51          server will always announce an object before the object sends
52          out events. -->
53     <event name="global">
54       <arg name="id" type="new_id" interface="object"/>
55       <arg name="name" type="string"/>
56       <arg name="version" type="uint"/>
57     </event>
58
59     <!-- Internal, deprecated, and will be changed.  This is an object
60          IDs range that is used by the client to allocate object IDs
61          in "new_id" type arguments.  The server sends range
62          allocations to the client before the next range is about to
63          be depleted. -->
64     <event name="range">
65       <arg name="base" type="uint"/>
66     </event>
67
68     <!-- A reply to the frame or sync request.  The key is the one
69          used in the request.  time is in millisecond units, and
70          denotes the time when the frame was posted on the
71          display. time can be used to estimaate frame rate, determine
72          how much to advance animations and compensate for jitter. -->
73     <event name="key">
74       <arg name="key" type="uint"/>
75       <arg name="time" type="uint"/>
76     </event>
77   </interface>
78
79
80   <!-- A compositor. This object is a global.  The compositor is in
81        charge of combining the contents of multiple surfaces into one
82        displayable output. -->
83   <interface name="compositor" version="1">
84     <!-- Factory request for a surface objects. A surface is akin to a
85          window. -->
86     <request name="create_surface">
87       <arg name="id" type="new_id" interface="surface"/>
88     </request>
89   </interface>
90
91
92   <!-- Shared memory support -->
93   <interface name="shm" version="1">
94     <!-- Transfer a shm buffer to the server.  The allocated buffer
95          would include at least stride * height bytes starting at the
96          beginning of fd.  The file descriptor is transferred over the
97          socket using AF_UNIX magical features. width, height, stride
98          and visual describe the respective properties of the pixel
99          data contained in the buffer. -->
100     <request name="create_buffer">
101       <arg name="id" type="new_id" interface="buffer"/>
102       <arg name="fd" type="fd"/>
103       <arg name="width" type="int"/>
104       <arg name="height" type="int"/>
105       <arg name="stride" type="uint"/>
106       <arg name="visual" type="object" interface="visual"/>
107     </request>
108   </interface>
109
110
111   <!-- A pixel buffer. Created using the drm, shm or similar objects.
112        It has a size, visual and contents, but not a location on the
113        screen -->
114   <interface name="buffer" version="1">
115     <!-- Abandon a buffer.  This will invalidate the object id. -->
116     <request name="destroy" type="destructor"/>
117   </interface>
118
119   <interface name="shell" version="1">
120     <request name="move">
121       <arg name="surface" type="object" interface="surface"/>
122       <arg name="input_device" type="object" interface="input_device"/>
123       <arg name="time" type="uint"/>
124     </request>
125
126     <enum name="resize">
127       <entry name="none" value="0"/>
128       <entry name="top" value="1"/>
129       <entry name="bottom" value="2"/>
130       <entry name="left" value="4"/>
131       <entry name="top_left" value="5"/>
132       <entry name="bottom_left" value="6"/>
133       <entry name="right" value="8"/>
134       <entry name="top_right" value="9"/>
135       <entry name="bottom_right" value="10"/>
136     </enum>
137
138     <request name="resize">
139       <arg name="surface" type="object" interface="surface"/>
140       <arg name="input_device" type="object" interface="input_device"/>
141       <arg name="time" type="uint"/>
142       <!-- edges is an enum, need to get the values in here -->
143       <arg name="edges" type="uint"/>
144     </request>
145
146     <request name="create_drag">
147       <arg name="id" type="new_id" interface="drag"/>
148     </request>
149
150     <request name="create_selection">
151       <arg name="id" type="new_id" interface="selection"/>
152     </request>
153
154     <!-- The configure event asks the client to resize its surface.
155          The size is a hint, in the sense that the client is free to
156          ignore it if it doesn't resize, pick a smaller size (to
157          satisfy aspect ration or resize in steps of NxM pixels).  The
158          client is free to dismiss all but the last configure event it
159          received. -->
160     <event name="configure">
161       <arg name="time" type="uint"/>
162       <arg name="edges" type="uint"/>
163       <arg name="surface" type="object" interface="surface"/>
164       <arg name="width" type="int"/>
165       <arg name="height" type="int"/>
166     </event>
167   </interface>
168
169   <interface name="selection" version="1">
170     <!-- Add an offered mime type.  Can be called several times to
171          offer multiple types, but must be called before 'activate'. -->
172     <request name="offer">
173       <arg name="type" type="string"/>
174     </request>
175
176     <!-- Can the selection be activated for multiple devices? -->
177     <request name="activate">
178       <arg name="input_device" type="object" interface="input_device"/>
179       <arg name="time" type="uint"/>
180     </request>
181
182     <!-- Destroy the selection. -->
183     <request name="destroy" type="destructor"/>
184
185     <!-- Another client pasted the selection, send the mime-type over
186          the passed fd. -->
187     <event name="send">
188       <arg name="mime_type" type="string"/>
189       <arg name="fd" type="fd"/>
190     </event>
191
192     <!-- Another selection became active. -->
193     <event name="cancelled"/>
194   </interface>
195
196   <interface name="selection_offer" version="1">
197     <!-- Called to receive the selection data as the specified type.
198          Sends the pipe fd to the compositor, which forwards it to the
199          source in the 'send' event -->
200     <request name="receive">
201       <arg name="mime_type" type="string"/>
202       <arg name="fd" type="fd"/>
203     </request>
204
205     <!-- Sent before the keyboard_focus event to announce the types
206          offered.  One event per offered mime type.  A mime type of
207          NULL means the selection offer is going away.  -->
208     <event name="offer">
209       <arg name="type" type="string"/>
210     </event>
211
212     <event name="keyboard_focus">
213       <arg name="input_device" type="object" interface="input_device"/>
214     </event>
215   </interface>
216
217   <interface name="drag" version="1">
218     <!-- Add an offered mime type.  Can be called several times to
219          offer multiple types, but must be called before 'activate'. -->
220     <request name="offer">
221       <arg name="type" type="string"/>
222     </request>
223
224     <request name="activate">
225       <arg name="surface" type="object" interface="surface"/>
226       <arg name="input_device" type="object" interface="input_device"/>
227       <arg name="time" type="uint"/>
228     </request>
229
230     <!-- Destroy the drag and cancel the session. -->
231     <request name="destroy" type="destructor"/>
232
233     <!-- Sent when a target accepts pointer_focus or motion events.
234          If a target does not accept any of the offered types, type is
235          NULL -->
236     <event name="target">
237       <arg name="mime_type" type="string"/>
238     </event>
239
240     <!-- Sent when the drag is finished.  The final mime type is that
241          of the last target event.  If that was NULL, no drag target
242          was valid when the drag finished, fd is undefined and the
243          source should not send data.  The event is also sent in case
244          a drag source tries to activate a drag after the grab was
245          released, in which case mime_type will also be NULL. -->
246     <event name="finish">
247       <arg name="fd" type="fd"/>
248     </event>
249
250     <event name="reject"/>
251   </interface>
252
253
254   <interface name="drag_offer" version="1">
255     <!-- Call to accept the offer of the given type -->
256     <request name="accept">
257       <arg name="time" type="uint"/>
258       <arg name="type" type="string"/>
259     </request>
260
261     <!-- Called to initiate the drag finish sequence.  Sends the pipe
262          fd to the compositor, which forwards it to the source in the
263          'finish' event -->
264     <request name="receive">
265       <arg name="fd" type="fd"/>
266     </request>
267
268     <!-- Called to reject a drop  -->
269     <request name="reject"/>
270
271     <!-- Sent before the pointer_focus event to announce the types
272          offered.  One event per offered mime type. -->
273     <event name="offer">
274       <arg name="type" type="string"/>
275     </event>
276
277     <!-- Similar to device::pointer_focus.  Sent to potential target
278          surfaces to offer drag data.  If the device leaves the
279          window, the drag stops or the originator cancels the drag,
280          this event is sent with the NULL surface, at which point the
281          drag object may no longer be valid. -->
282     <event name="pointer_focus">
283       <arg name="time" type="uint"/>
284       <arg name="surface" type="object" interface="surface"/>
285       <arg name="x" type="int"/>
286       <arg name="y" type="int"/>
287       <arg name="surface_x" type="int"/>
288       <arg name="surface_y" type="int"/>
289     </event>
290
291     <!-- Similar to device::motion.  Sent to potential target surfaces
292          as the drag pointer moves around in the surface. -->
293     <event name="motion">
294       <arg name="time" type="uint"/>
295       <arg name="x" type="int"/>
296       <arg name="y" type="int"/>
297       <arg name="surface_x" type="int"/>
298       <arg name="surface_y" type="int"/>
299     </event>
300
301     <!-- Sent to indicate that the drag is finishing.  The last
302          motion/pointer_focus event gives the location of the drop.
303          Target must respond with the 'receive' request, which sends
304          an fd to the source for writing the drag data. -->
305     <event name="drop"/>
306   </interface>
307
308
309   <!-- A surface. This is an image that is displayed on the screen.
310        It has a location, size and pixel contents. Similar to a window. -->
311   <interface name="surface" version="1">
312     <!-- Deletes the surface and invalidates its object id. -->
313     <request name="destroy" type="destructor"/>
314
315     <!-- Copy the contents of a buffer into this surface. The x and y
316          arguments specify the location of the new buffers upper left
317          corner, relative to the old buffers upper left corner. -->
318     <request name="attach">
319       <arg name="buffer" type="object" interface="buffer"/>
320       <arg name="x" type="int"/>
321       <arg name="y" type="int"/>
322     </request>
323
324     <!-- Make the surface visible as a toplevel window. -->
325     <request name="map_toplevel"/>
326
327     <!-- Map the surface relative to an existing surface. The x and y
328          arguments specify the locations of the upper left corner of
329          the surface relative to the upper left corner of the parent
330          surface.  The flags argument controls overflow/clipping
331          behaviour when the surface would intersect a screen edge,
332          panel or such.  And possibly whether the offset only
333          determines the initial position or if the surface is locked
334          to that relative position during moves. -->
335     <request name="map_transient">
336       <arg name="parent" type="object" interface="surface"/>
337       <arg name="x" type="int"/>
338       <arg name="y" type="int"/>
339       <arg name="flags" type="uint"/>
340     </request>
341
342     <!-- Map the surface as a fullscreen surface.  There are a number
343          of options here: on which output? if the surface size doesn't
344          match the output size, do we scale, change resolution, or add
345          black borders? is that something the client controls?  what
346          about transient surfaces, do they float on top of the
347          fullscreen? what if there's already a fullscreen surface on
348          the output, maybe you can only go fullscreen if you're
349          active?  -->
350     <request name="map_fullscreen"/>
351
352     <!-- Notify the server that the attached buffer's contents have
353          changed, and request a redraw. The arguments allow you to
354          damage only a part of the surface, but the server may ignore
355          it and redraw the entire contents of the surface.  To
356          describe a more complicated area of damage, use this request
357          several times. -->
358     <request name="damage">
359       <arg name="x" type="int"/>
360       <arg name="y" type="int"/>
361       <arg name="width" type="int"/>
362       <arg name="height" type="int"/>
363     </request>
364   </interface>
365
366
367   <!-- A group of keyboards and pointer devices (mice, for
368        example). This object is published as a global during start up,
369        or when such a device is hot plugged.  A input_device group
370        typically has a pointer and maintains a keyboard_focus and a
371        pointer_focus.  -->
372   <interface name="input_device" version="1">
373     <!-- Set the pointer's image.  This request only takes effect if
374          the pointer focus for this device is one of the requesting
375          clients surfaces.  -->
376     <request name="attach">
377       <arg name="time" type="uint"/>
378       <arg name="buffer" type="object" interface="buffer"/>
379       <arg name="hotspot_x" type="int"/>
380       <arg name="hotspot_y" type="int"/>
381     </request>
382
383     <!-- Notification of pointer location change.
384          x,y are the absolute location on the screen.
385          surface_[xy] are the location relative to the focused surface. -->
386     <event name="motion">
387       <arg name="time" type="uint"/>
388       <arg name="x" type="int"/>
389       <arg name="y" type="int"/>
390       <arg name="surface_x" type="int"/>
391       <arg name="surface_y" type="int"/>
392     </event>
393
394     <!-- Mouse button click and release notifications.  The location
395          of the click is given by the last motion or pointer_focus
396          event. -->
397     <event name="button">
398       <arg name="time" type="uint"/>
399       <arg name="button" type="uint"/>
400       <arg name="state" type="uint"/>
401     </event>
402
403     <!-- Keyboard press. -->
404     <event name="key">
405       <arg name="time" type="uint"/>
406       <arg name="key" type="uint"/>
407       <arg name="state" type="uint"/>
408     </event>
409
410     <!-- Notification that this input device's pointer is focused on
411          certain surface. When an input_device enters a surface, the
412          pointer image is undefined and a client should respond to
413          this event by setting an apropriate pointer image. -->
414     <event name="pointer_focus">
415       <arg name="time" type="uint"/>
416       <arg name="surface" type="object" interface="surface"/>
417       <arg name="x" type="int"/>
418       <arg name="y" type="int"/>
419       <arg name="surface_x" type="int"/>
420       <arg name="surface_y" type="int"/>
421     </event>
422
423     <event name="keyboard_focus">
424       <arg name="time" type="uint"/>
425       <arg name="surface" type="object" interface="surface"/>
426       <arg name="keys" type="array"/>
427     </event>
428   </interface>
429
430
431   <!-- An output describes part of the compositor geometry.  The
432        compositor work in the 'compositor coordinate system' and an
433        output corresponds to rectangular area in that space that is
434        actually visible.  This typically corresponds to a monitor that
435        displays part of the compositor space.  This object is
436        published as global during start up, or when a screen is hot
437        plugged.  -->
438   <interface name="output" version="1">
439     <!-- Notification about the screen size. -->
440     <event name="geometry">
441       <arg name="x" type="int"/>
442       <arg name="y" type="int"/>
443       <arg name="width" type="int"/>
444       <arg name="height" type="int"/>
445     </event>
446   </interface>
447
448
449   <!-- A visual is the pixel format.  The different visuals are
450        currently only identified by the order they are advertised by
451        the 'global' events.  We need something better.  -->
452   <interface name="visual" version="1"/>
453
454 </protocol>