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