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