Add buffer.damage request to the protocol
[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 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="wl_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="wl_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="wl_surface"/>
88     </request>
89   </interface>
90
91
92   <!-- Shared memory support -->
93   <interface name="wl_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="wl_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="wl_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="wl_buffer" version="1">
115     <!-- Notify the server that the specified area of the buffers
116          contents have changed.  To describe a more complicated area
117          of damage, break down the region into rectangles and use this
118          request several times.
119     -->
120     <request name="damage">
121       <arg name="x" type="int"/>
122       <arg name="y" type="int"/>
123       <arg name="width" type="int"/>
124       <arg name="height" type="int"/>
125     </request>
126
127     <!-- Destroy a buffer.  This will invalidate the object id. -->
128     <request name="destroy" type="destructor"/>
129   </interface>
130
131   <interface name="wl_shell" version="1">
132     <request name="move">
133       <arg name="surface" type="object" interface="wl_surface"/>
134       <arg name="input_device" type="object" interface="wl_input_device"/>
135       <arg name="time" type="uint"/>
136     </request>
137
138     <enum name="resize">
139       <entry name="none" value="0"/>
140       <entry name="top" value="1"/>
141       <entry name="bottom" value="2"/>
142       <entry name="left" value="4"/>
143       <entry name="top_left" value="5"/>
144       <entry name="bottom_left" value="6"/>
145       <entry name="right" value="8"/>
146       <entry name="top_right" value="9"/>
147       <entry name="bottom_right" value="10"/>
148     </enum>
149
150     <request name="resize">
151       <arg name="surface" type="object" interface="wl_surface"/>
152       <arg name="input_device" type="object" interface="wl_input_device"/>
153       <arg name="time" type="uint"/>
154       <!-- edges is an enum, need to get the values in here -->
155       <arg name="edges" type="uint"/>
156     </request>
157
158     <request name="create_drag">
159       <arg name="id" type="new_id" interface="wl_drag"/>
160     </request>
161
162     <request name="create_selection">
163       <arg name="id" type="new_id" interface="wl_selection"/>
164     </request>
165
166     <!-- The configure event asks the client to resize its surface.
167          The size is a hint, in the sense that the client is free to
168          ignore it if it doesn't resize, pick a smaller size (to
169          satisfy aspect ration or resize in steps of NxM pixels).  The
170          client is free to dismiss all but the last configure event it
171          received. -->
172     <event name="configure">
173       <arg name="time" type="uint"/>
174       <arg name="edges" type="uint"/>
175       <arg name="surface" type="object" interface="wl_surface"/>
176       <arg name="width" type="int"/>
177       <arg name="height" type="int"/>
178     </event>
179   </interface>
180
181   <interface name="wl_selection" version="1">
182     <!-- Add an offered mime type.  Can be called several times to
183          offer multiple types, but must be called before 'activate'. -->
184     <request name="offer">
185       <arg name="type" type="string"/>
186     </request>
187
188     <!-- Can the selection be activated for multiple devices? -->
189     <request name="activate">
190       <arg name="input_device" type="object" interface="wl_input_device"/>
191       <arg name="time" type="uint"/>
192     </request>
193
194     <!-- Destroy the selection. -->
195     <request name="destroy" type="destructor"/>
196
197     <!-- Another client pasted the selection, send the mime-type over
198          the passed fd. -->
199     <event name="send">
200       <arg name="mime_type" type="string"/>
201       <arg name="fd" type="fd"/>
202     </event>
203
204     <!-- Another selection became active. -->
205     <event name="cancelled"/>
206   </interface>
207
208   <interface name="wl_selection_offer" version="1">
209     <!-- Called to receive the selection data as the specified type.
210          Sends the pipe fd to the compositor, which forwards it to the
211          source in the 'send' event -->
212     <request name="receive">
213       <arg name="mime_type" type="string"/>
214       <arg name="fd" type="fd"/>
215     </request>
216
217     <!-- Sent before the keyboard_focus event to announce the types
218          offered.  One event per offered mime type.  A mime type of
219          NULL means the selection offer is going away.  -->
220     <event name="offer">
221       <arg name="type" type="string"/>
222     </event>
223
224     <event name="keyboard_focus">
225       <arg name="input_device" type="object" interface="wl_input_device"/>
226     </event>
227   </interface>
228
229   <interface name="wl_drag" version="1">
230     <!-- Add an offered mime type.  Can be called several times to
231          offer multiple types, but must be called before 'activate'. -->
232     <request name="offer">
233       <arg name="type" type="string"/>
234     </request>
235
236     <request name="activate">
237       <arg name="surface" type="object" interface="wl_surface"/>
238       <arg name="input_device" type="object" interface="wl_input_device"/>
239       <arg name="time" type="uint"/>
240     </request>
241
242     <!-- Destroy the drag and cancel the session. -->
243     <request name="destroy" type="destructor"/>
244
245     <!-- Sent when a target accepts pointer_focus or motion events.
246          If a target does not accept any of the offered types, type is
247          NULL -->
248     <event name="target">
249       <arg name="mime_type" type="string"/>
250     </event>
251
252     <!-- Sent when the drag is finished.  The final mime type is that
253          of the last target event.  If that was NULL, no drag target
254          was valid when the drag finished, fd is undefined and the
255          source should not send data.  The event is also sent in case
256          a drag source tries to activate a drag after the grab was
257          released, in which case mime_type will also be NULL. -->
258     <event name="finish">
259       <arg name="fd" type="fd"/>
260     </event>
261
262     <event name="reject"/>
263   </interface>
264
265
266   <interface name="wl_drag_offer" version="1">
267     <!-- Call to accept the offer of the given type -->
268     <request name="accept">
269       <arg name="time" type="uint"/>
270       <arg name="type" type="string"/>
271     </request>
272
273     <!-- Called to initiate the drag finish sequence.  Sends the pipe
274          fd to the compositor, which forwards it to the source in the
275          'finish' event -->
276     <request name="receive">
277       <arg name="fd" type="fd"/>
278     </request>
279
280     <!-- Called to reject a drop  -->
281     <request name="reject"/>
282
283     <!-- Sent before the pointer_focus event to announce the types
284          offered.  One event per offered mime type. -->
285     <event name="offer">
286       <arg name="type" type="string"/>
287     </event>
288
289     <!-- Similar to device::pointer_focus.  Sent to potential target
290          surfaces to offer drag data.  If the device leaves the
291          window, the drag stops or the originator cancels the drag,
292          this event is sent with the NULL surface, at which point the
293          drag object may no longer be valid. -->
294     <event name="pointer_focus">
295       <arg name="time" type="uint"/>
296       <arg name="surface" type="object" interface="wl_surface"/>
297       <arg name="x" type="int"/>
298       <arg name="y" type="int"/>
299       <arg name="surface_x" type="int"/>
300       <arg name="surface_y" type="int"/>
301     </event>
302
303     <!-- Similar to device::motion.  Sent to potential target surfaces
304          as the drag pointer moves around in the surface. -->
305     <event name="motion">
306       <arg name="time" type="uint"/>
307       <arg name="x" type="int"/>
308       <arg name="y" type="int"/>
309       <arg name="surface_x" type="int"/>
310       <arg name="surface_y" type="int"/>
311     </event>
312
313     <!-- Sent to indicate that the drag is finishing.  The last
314          motion/pointer_focus event gives the location of the drop.
315          Target must respond with the 'receive' request, which sends
316          an fd to the source for writing the drag data. -->
317     <event name="drop"/>
318   </interface>
319
320
321   <!-- A surface. This is an image that is displayed on the screen.
322        It has a location, size and pixel contents. Similar to a window. -->
323   <interface name="wl_surface" version="1">
324     <!-- Deletes the surface and invalidates its object id. -->
325     <request name="destroy" type="destructor"/>
326
327     <!-- Copy the contents of a buffer into this surface. The x and y
328          arguments specify the location of the new buffers upper left
329          corner, relative to the old buffers upper left corner. -->
330     <request name="attach">
331       <arg name="buffer" type="object" interface="wl_buffer"/>
332       <arg name="x" type="int"/>
333       <arg name="y" type="int"/>
334     </request>
335
336     <!-- Make the surface visible as a toplevel window. -->
337     <request name="map_toplevel"/>
338
339     <!-- Map the surface relative to an existing surface. The x and y
340          arguments specify the locations of the upper left corner of
341          the surface relative to the upper left corner of the parent
342          surface.  The flags argument controls overflow/clipping
343          behaviour when the surface would intersect a screen edge,
344          panel or such.  And possibly whether the offset only
345          determines the initial position or if the surface is locked
346          to that relative position during moves. -->
347     <request name="map_transient">
348       <arg name="parent" type="object" interface="wl_surface"/>
349       <arg name="x" type="int"/>
350       <arg name="y" type="int"/>
351       <arg name="flags" type="uint"/>
352     </request>
353
354     <!-- Map the surface as a fullscreen surface.  There are a number
355          of options here: on which output? if the surface size doesn't
356          match the output size, do we scale, change resolution, or add
357          black borders? is that something the client controls?  what
358          about transient surfaces, do they float on top of the
359          fullscreen? what if there's already a fullscreen surface on
360          the output, maybe you can only go fullscreen if you're
361          active?  -->
362     <request name="map_fullscreen"/>
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   </interface>
375
376
377   <!-- A group of keyboards and pointer devices (mice, for
378        example). This object is published as a global during start up,
379        or when such a device is hot plugged.  A input_device group
380        typically has a pointer and maintains a keyboard_focus and a
381        pointer_focus.  -->
382   <interface name="wl_input_device" version="1">
383     <!-- Set the pointer's image.  This request only takes effect if
384          the pointer focus for this device is one of the requesting
385          clients surfaces.  -->
386     <request name="attach">
387       <arg name="time" type="uint"/>
388       <arg name="buffer" type="object" interface="wl_buffer"/>
389       <arg name="hotspot_x" type="int"/>
390       <arg name="hotspot_y" type="int"/>
391     </request>
392
393     <!-- Notification of pointer location change.
394          x,y are the absolute location on the screen.
395          surface_[xy] are the location relative to the focused surface. -->
396     <event name="motion">
397       <arg name="time" type="uint"/>
398       <arg name="x" type="int"/>
399       <arg name="y" type="int"/>
400       <arg name="surface_x" type="int"/>
401       <arg name="surface_y" type="int"/>
402     </event>
403
404     <!-- Mouse button click and release notifications.  The location
405          of the click is given by the last motion or pointer_focus
406          event. -->
407     <event name="button">
408       <arg name="time" type="uint"/>
409       <arg name="button" type="uint"/>
410       <arg name="state" type="uint"/>
411     </event>
412
413     <!-- Keyboard press. -->
414     <event name="key">
415       <arg name="time" type="uint"/>
416       <arg name="key" type="uint"/>
417       <arg name="state" type="uint"/>
418     </event>
419
420     <!-- Notification that this input device's pointer is focused on
421          certain surface. When an input_device enters a surface, the
422          pointer image is undefined and a client should respond to
423          this event by setting an apropriate pointer image. -->
424     <event name="pointer_focus">
425       <arg name="time" type="uint"/>
426       <arg name="surface" type="object" interface="wl_surface"/>
427       <arg name="x" type="int"/>
428       <arg name="y" type="int"/>
429       <arg name="surface_x" type="int"/>
430       <arg name="surface_y" type="int"/>
431     </event>
432
433     <event name="keyboard_focus">
434       <arg name="time" type="uint"/>
435       <arg name="surface" type="object" interface="wl_surface"/>
436       <arg name="keys" type="array"/>
437     </event>
438   </interface>
439
440
441   <!-- An output describes part of the compositor geometry.  The
442        compositor work in the 'compositor coordinate system' and an
443        output corresponds to rectangular area in that space that is
444        actually visible.  This typically corresponds to a monitor that
445        displays part of the compositor space.  This object is
446        published as global during start up, or when a screen is hot
447        plugged.  -->
448   <interface name="wl_output" version="1">
449     <!-- Notification about the screen size. -->
450     <event name="geometry">
451       <arg name="x" type="int"/>
452       <arg name="y" type="int"/>
453       <arg name="width" type="int"/>
454       <arg name="height" type="int"/>
455     </event>
456   </interface>
457
458
459   <!-- A visual is the pixel format.  The different visuals are
460        currently only identified by the order they are advertised by
461        the 'global' events.  We need something better.  -->
462   <interface name="wl_visual" version="1"/>
463
464 </protocol>