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