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