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