1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="wayland">
5 Copyright © 2008-2011 Kristian Høgsberg
6 Copyright © 2010-2011 Intel Corporation
8 Permission to use, copy, modify, distribute, and sell this
9 software and its documentation for any purpose is hereby granted
10 without fee, provided that\n the above copyright notice appear in
11 all copies and that both that copyright notice and this permission
12 notice appear in supporting documentation, and that the name of
13 the copyright holders not be used in advertising or publicity
14 pertaining to distribution of the software without specific,
15 written prior permission. The copyright holders make no
16 representations about the suitability of this software for any
17 purpose. It is provided "as is" without express or implied
20 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22 FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
30 <!-- The core global object. This is a special singleton object.
31 It is used for internal wayland protocol features. -->
32 <interface name="wl_display" version="1">
34 <arg name="name" type="uint"/>
35 <arg name="interface" type="string"/>
36 <arg name="version" type="uint"/>
37 <arg name="id" type="new_id" interface="wl_object"/>
40 <!-- sync is an just an echo, which will reply with a key event.
41 Since requests are handled in-order, this can be used as a
42 barrier to ensure all previous requests have been handled.
43 The key argument can be used to correlate between multiple
46 <arg name="callback" type="new_id" interface="wl_callback"/>
49 <!-- A fatal error has occurred. -->
51 <arg name="object_id" type="object" interface="wl_object"/>
52 <arg name="code" type="uint"/>
53 <arg name="message" type="string"/>
57 <entry name="invalid_object" value="0"/>
58 <entry name="invalid_method" value="1"/>
59 <entry name="no_memory" value="2"/>
62 <!-- Notify the client of global objects. These are objects that
63 are created by the server. Globals are published on the
64 initial client connection sequence, upon device hotplugs,
65 device disconnects, reconfiguration or other events. The
66 server will always announce an object before the object sends
69 <arg name="name" type="uint"/>
70 <arg name="interface" type="string"/>
71 <arg name="version" type="uint"/>
74 <!-- Notify the client of removed global objects. -->
75 <event name="global_remove">
76 <arg name="id" type="uint" />
81 <interface name="wl_callback" version="1">
83 <arg name="time" type="uint"/>
87 <!-- A compositor. This object is a global. The compositor is in
88 charge of combining the contents of multiple surfaces into one
89 displayable output. -->
90 <interface name="wl_compositor" version="1">
91 <!-- Factory request for a surface objects. A surface is akin to a
93 <request name="create_surface">
94 <arg name="id" type="new_id" interface="wl_surface"/>
98 <!-- Shared memory support -->
99 <interface name="wl_shm" version="1">
101 <entry name="invalid_format" value="0"/>
102 <entry name="invalid_stride" value="1"/>
103 <entry name="invalid_fd" value="2"/>
107 <entry name="argb32" value="0"/>
108 <entry name="premultiplied_argb32" value="1"/>
109 <entry name="xrgb32" value="2"/>
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 format 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="format" type="uint"/>
127 <event name="format">
128 <arg name="format" type="uint"/>
133 <!-- A pixel buffer. Created using the drm, shm or similar objects.
134 It has a size, visual and contents, but not a location on the
136 <interface name="wl_buffer" version="1">
137 <!-- Notify the server that the specified area of the buffers
138 contents have changed. To describe a more complicated area
139 of damage, break down the region into rectangles and use this
140 request several times.
142 <request name="damage">
143 <arg name="x" type="int"/>
144 <arg name="y" type="int"/>
145 <arg name="width" type="int"/>
146 <arg name="height" type="int"/>
149 <!-- Destroy a buffer. This will invalidate the object id. -->
150 <request name="destroy" type="destructor"/>
152 <!-- Sent when an attached buffer is no longer used by the compositor. -->
153 <event name="release"/>
156 <interface name="wl_shell" version="1">
157 <request name="move">
158 <arg name="surface" type="object" interface="wl_surface"/>
159 <arg name="input_device" type="object" interface="wl_input_device"/>
160 <arg name="time" type="uint"/>
164 <entry name="none" value="0"/>
165 <entry name="top" value="1"/>
166 <entry name="bottom" value="2"/>
167 <entry name="left" value="4"/>
168 <entry name="top_left" value="5"/>
169 <entry name="bottom_left" value="6"/>
170 <entry name="right" value="8"/>
171 <entry name="top_right" value="9"/>
172 <entry name="bottom_right" value="10"/>
175 <request name="resize">
176 <arg name="surface" type="object" interface="wl_surface"/>
177 <arg name="input_device" type="object" interface="wl_input_device"/>
178 <arg name="time" type="uint"/>
179 <!-- edges is an enum, need to get the values in here -->
180 <arg name="edges" type="uint"/>
183 <request name="create_drag">
184 <arg name="id" type="new_id" interface="wl_drag"/>
187 <request name="create_selection">
188 <arg name="id" type="new_id" interface="wl_selection"/>
191 <!-- Make the surface visible as a toplevel window. -->
192 <request name="set_toplevel">
193 <arg name="surface" type="object" interface="wl_surface"/>
196 <!-- Map the surface relative to an existing surface. The x and y
197 arguments specify the locations of the upper left corner of
198 the surface relative to the upper left corner of the parent
199 surface. The flags argument controls overflow/clipping
200 behaviour when the surface would intersect a screen edge,
201 panel or such. And possibly whether the offset only
202 determines the initial position or if the surface is locked
203 to that relative position during moves. -->
204 <request name="set_transient">
205 <arg name="surface" type="object" interface="wl_surface"/>
206 <arg name="parent" type="object" interface="wl_surface"/>
207 <arg name="x" type="int"/>
208 <arg name="y" type="int"/>
209 <arg name="flags" type="uint"/>
212 <!-- Map the surface as a fullscreen surface. There are a number
213 of options here: on which output? if the surface size doesn't
214 match the output size, do we scale, change resolution, or add
215 black borders? is that something the client controls? what
216 about transient surfaces, do they float on top of the
217 fullscreen? what if there's already a fullscreen surface on
218 the output, maybe you can only go fullscreen if you're
220 <request name="set_fullscreen">
221 <arg name="surface" type="object" interface="wl_surface"/>
224 <!-- The configure event asks the client to resize its surface.
225 The size is a hint, in the sense that the client is free to
226 ignore it if it doesn't resize, pick a smaller size (to
227 satisfy aspect ration or resize in steps of NxM pixels). The
228 client is free to dismiss all but the last configure event it
230 <event name="configure">
231 <arg name="time" type="uint"/>
232 <arg name="edges" type="uint"/>
233 <arg name="surface" type="object" interface="wl_surface"/>
234 <arg name="width" type="int"/>
235 <arg name="height" type="int"/>
239 <interface name="wl_selection" version="1">
240 <!-- Add an offered mime type. Can be called several times to
241 offer multiple types, but must be called before 'activate'. -->
242 <request name="offer">
243 <arg name="type" type="string"/>
246 <!-- Can the selection be activated for multiple devices? -->
247 <request name="activate">
248 <arg name="input_device" type="object" interface="wl_input_device"/>
249 <arg name="time" type="uint"/>
252 <!-- Destroy the selection. -->
253 <request name="destroy" type="destructor"/>
255 <!-- Another client pasted the selection, send the mime-type over
258 <arg name="mime_type" type="string"/>
259 <arg name="fd" type="fd"/>
262 <!-- Another selection became active. -->
263 <event name="cancelled"/>
266 <interface name="wl_selection_offer" version="1">
267 <!-- Called to receive the selection data as the specified type.
268 Sends the pipe fd to the compositor, which forwards it to the
269 source in the 'send' event -->
270 <request name="receive">
271 <arg name="mime_type" type="string"/>
272 <arg name="fd" type="fd"/>
275 <!-- Sent before the keyboard_focus event to announce the types
276 offered. One event per offered mime type. A mime type of
277 NULL means the selection offer is going away. -->
279 <arg name="type" type="string"/>
282 <event name="keyboard_focus">
283 <arg name="input_device" type="object" interface="wl_input_device"/>
287 <interface name="wl_drag" version="1">
288 <!-- Add an offered mime type. Can be called several times to
289 offer multiple types, but must be called before 'activate'. -->
290 <request name="offer">
291 <arg name="type" type="string"/>
294 <request name="activate">
295 <arg name="surface" type="object" interface="wl_surface"/>
296 <arg name="input_device" type="object" interface="wl_input_device"/>
297 <arg name="time" type="uint"/>
300 <!-- Destroy the drag and cancel the session. -->
301 <request name="destroy" type="destructor"/>
303 <!-- Sent when a target accepts pointer_focus or motion events.
304 If a target does not accept any of the offered types, type is
306 <event name="target">
307 <arg name="mime_type" type="string"/>
310 <!-- Sent when the drag is finished. The final mime type is that
311 of the last target event. If that was NULL, no drag target
312 was valid when the drag finished, fd is undefined and the
313 source should not send data. The event is also sent in case
314 a drag source tries to activate a drag after the grab was
315 released, in which case mime_type will also be NULL. -->
316 <event name="finish">
317 <arg name="fd" type="fd"/>
320 <event name="reject"/>
324 <interface name="wl_drag_offer" version="1">
325 <!-- Call to accept the offer of the given type -->
326 <request name="accept">
327 <arg name="time" type="uint"/>
328 <arg name="type" type="string"/>
331 <!-- Called to initiate the drag finish sequence. Sends the pipe
332 fd to the compositor, which forwards it to the source in the
334 <request name="receive">
335 <arg name="fd" type="fd"/>
338 <!-- Called to reject a drop -->
339 <request name="reject"/>
341 <!-- Sent before the pointer_focus event to announce the types
342 offered. One event per offered mime type. -->
344 <arg name="type" type="string"/>
347 <!-- Similar to device::pointer_focus. Sent to potential target
348 surfaces to offer drag data. If the device leaves the
349 window, the drag stops or the originator cancels the drag,
350 this event is sent with the NULL surface, at which point the
351 drag object may no longer be valid. -->
352 <event name="pointer_focus">
353 <arg name="time" type="uint"/>
354 <arg name="surface" type="object" interface="wl_surface"/>
355 <arg name="x" type="int"/>
356 <arg name="y" type="int"/>
357 <arg name="surface_x" type="int"/>
358 <arg name="surface_y" type="int"/>
361 <!-- Similar to device::motion. Sent to potential target surfaces
362 as the drag pointer moves around in the surface. -->
363 <event name="motion">
364 <arg name="time" type="uint"/>
365 <arg name="x" type="int"/>
366 <arg name="y" type="int"/>
367 <arg name="surface_x" type="int"/>
368 <arg name="surface_y" type="int"/>
371 <!-- Sent to indicate that the drag is finishing. The last
372 motion/pointer_focus event gives the location of the drop.
373 Target must respond with the 'receive' request, which sends
374 an fd to the source for writing the drag data. -->
379 <!-- A surface. This is an image that is displayed on the screen.
380 It has a location, size and pixel contents. Similar to a window. -->
381 <interface name="wl_surface" version="1">
382 <!-- Deletes the surface and invalidates its object id. -->
383 <request name="destroy" type="destructor"/>
385 <!-- Copy the contents of a buffer into this surface. The x and y
386 arguments specify the location of the new buffers upper left
387 corner, relative to the old buffers upper left corner. -->
388 <request name="attach">
389 <arg name="buffer" type="object" interface="wl_buffer"/>
390 <arg name="x" type="int"/>
391 <arg name="y" type="int"/>
394 <!-- After attaching a new buffer, this request is used to
395 describe the regions where the new buffer is different from
396 the previous buffer and needs to be repainted. Coordinates
397 are relative to the new buffer. -->
398 <request name="damage">
399 <arg name="x" type="int"/>
400 <arg name="y" type="int"/>
401 <arg name="width" type="int"/>
402 <arg name="height" type="int"/>
405 <!-- Request notification when the next frame is displayed.
406 Useful for throttling redrawing operations, and driving
407 animations. The notification will only be posted for one
408 frame unless requested again. -->
409 <request name="frame">
410 <arg name="callback" type="new_id" interface="wl_callback"/>
416 <!-- A group of keyboards and pointer devices (mice, for
417 example). This object is published as a global during start up,
418 or when such a device is hot plugged. A input_device group
419 typically has a pointer and maintains a keyboard_focus and a
421 <interface name="wl_input_device" version="1">
422 <!-- Set the pointer's image. This request only takes effect if
423 the pointer focus for this device is one of the requesting
424 clients surfaces. -->
425 <request name="attach">
426 <arg name="time" type="uint"/>
427 <arg name="buffer" type="object" interface="wl_buffer"/>
428 <arg name="hotspot_x" type="int"/>
429 <arg name="hotspot_y" type="int"/>
432 <!-- Notification of pointer location change.
433 x,y are the absolute location on the screen.
434 surface_[xy] are the location relative to the focused surface. -->
435 <event name="motion">
436 <arg name="time" type="uint"/>
437 <arg name="x" type="int"/>
438 <arg name="y" type="int"/>
439 <arg name="surface_x" type="int"/>
440 <arg name="surface_y" type="int"/>
443 <!-- Mouse button click and release notifications. The location
444 of the click is given by the last motion or pointer_focus
446 <event name="button">
447 <arg name="time" type="uint"/>
448 <arg name="button" type="uint"/>
449 <arg name="state" type="uint"/>
452 <!-- Keyboard press. -->
454 <arg name="time" type="uint"/>
455 <arg name="key" type="uint"/>
456 <arg name="state" type="uint"/>
459 <!-- Notification that this input device's pointer is focused on
460 certain surface. When an input_device enters a surface, the
461 pointer image is undefined and a client should respond to
462 this event by setting an apropriate pointer image. -->
463 <event name="pointer_focus">
464 <arg name="time" type="uint"/>
465 <arg name="surface" type="object" interface="wl_surface"/>
466 <arg name="x" type="int"/>
467 <arg name="y" type="int"/>
468 <arg name="surface_x" type="int"/>
469 <arg name="surface_y" type="int"/>
472 <event name="keyboard_focus">
473 <arg name="time" type="uint"/>
474 <arg name="surface" type="object" interface="wl_surface"/>
475 <arg name="keys" type="array"/>
478 <event name="touch_down">
479 <arg name="time" type="uint"/>
480 <arg name="id" type="int" />
481 <arg name="x" type="int" />
482 <arg name="y" type="int" />
485 <event name="touch_up">
486 <arg name="time" type="uint"/>
487 <arg name="id" type="int" />
490 <event name="touch_motion">
491 <arg name="time" type="uint"/>
492 <arg name="id" type="int" />
493 <arg name="x" type="int" />
494 <arg name="y" type="int" />
497 <!-- Indicates the end of a contact point list. -->
498 <event name="touch_frame"/>
500 <!-- Sent if the compositor decides the touch stream is a global
501 gesture. No further events are sent to the clients from that
502 particular gesture. -->
503 <event name="touch_cancel"/>
507 <!-- An output describes part of the compositor geometry. The
508 compositor work in the 'compositor coordinate system' and an
509 output corresponds to rectangular area in that space that is
510 actually visible. This typically corresponds to a monitor that
511 displays part of the compositor space. This object is
512 published as global during start up, or when a screen is hot
514 <interface name="wl_output" version="1">
516 <enum name="subpixel">
517 <entry name="unknown" value="0"/>
518 <entry name="none" value="1"/>
519 <entry name="horizontal_rgb" value="2"/>
520 <entry name="horizontal_bgr" value="3"/>
521 <entry name="vertical_rgb" value="4"/>
522 <entry name="vertical_bgr" value="5"/>
525 <event name="geometry">
526 <arg name="x" type="int"/>
527 <arg name="y" type="int"/>
528 <arg name="physical_width" type="int"/>
529 <arg name="physical_height" type="int"/>
530 <arg name="subpixel" type="int"/>
531 <arg name="make" type="string"/>
532 <arg name="model" type="string"/>
535 <!-- Values for the flags bitfield of the mode event. -->
537 <entry name="current" value="0x1"/>
538 <entry name="preferred" value="0x2"/>
542 <arg name="flags" type="uint"/>
543 <arg name="width" type="int"/>
544 <arg name="height" type="int"/>
545 <arg name="refresh" type="int"/>