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="name" type="uint" />
79 <!-- Server has deleted the id and client can now reuse it. -->
80 <event name="delete_id">
81 <arg name="id" type="uint" />
85 <interface name="wl_callback" version="1">
87 <arg name="time" type="uint"/>
91 <!-- A compositor. This object is a global. The compositor is in
92 charge of combining the contents of multiple surfaces into one
93 displayable output. -->
94 <interface name="wl_compositor" version="1">
95 <!-- Factory request for a surface objects. A surface is akin to a
97 <request name="create_surface">
98 <arg name="id" type="new_id" interface="wl_surface"/>
102 <!-- Shared memory support -->
103 <interface name="wl_shm" version="1">
105 <entry name="invalid_format" value="0"/>
106 <entry name="invalid_stride" value="1"/>
107 <entry name="invalid_fd" value="2"/>
111 <entry name="argb32" value="0"/>
112 <entry name="premultiplied_argb32" value="1"/>
113 <entry name="xrgb32" value="2"/>
116 <!-- Transfer a shm buffer to the server. The allocated buffer
117 would include at least stride * height bytes starting at the
118 beginning of fd. The file descriptor is transferred over the
119 socket using AF_UNIX magical features. width, height, stride
120 and format describe the respective properties of the pixel
121 data contained in the buffer. -->
122 <request name="create_buffer">
123 <arg name="id" type="new_id" interface="wl_buffer"/>
124 <arg name="fd" type="fd"/>
125 <arg name="width" type="int"/>
126 <arg name="height" type="int"/>
127 <arg name="stride" type="uint"/>
128 <arg name="format" type="uint"/>
131 <event name="format">
132 <arg name="format" type="uint"/>
137 <!-- A pixel buffer. Created using the drm, shm or similar objects.
138 It has a size, visual and contents, but not a location on the
140 <interface name="wl_buffer" version="1">
141 <!-- Notify the server that the specified area of the buffers
142 contents have changed. To describe a more complicated area
143 of damage, break down the region into rectangles and use this
144 request several times.
146 <request name="damage">
147 <arg name="x" type="int"/>
148 <arg name="y" type="int"/>
149 <arg name="width" type="int"/>
150 <arg name="height" type="int"/>
153 <!-- Destroy a buffer. This will invalidate the object id. -->
154 <request name="destroy" type="destructor"/>
156 <!-- Sent when an attached buffer is no longer used by the compositor. -->
157 <event name="release"/>
161 <interface name="wl_data_offer" version="1">
162 <!-- Indicate that the client can accept the given mime-type, or
163 NULL for not accepted. Use for feedback during drag and
165 <request name="accept">
166 <arg name="time" type="uint"/>
167 <arg name="type" type="string"/>
170 <request name="receive">
171 <arg name="mime_type" type="string"/>
172 <arg name="fd" type="fd"/>
175 <request name="destroy" type="destructor"/>
177 <!-- Sent immediately after creating the wl_data_offer object. One
178 event per offered mime type. -->
180 <arg name="type" type="string"/>
184 <interface name="wl_data_source" version="1">
185 <!-- Add an offered mime type. Can be called several times to
186 offer multiple types. -->
187 <request name="offer">
188 <arg name="type" type="string"/>
191 <!-- Destroy the selection. -->
192 <request name="destroy" type="destructor"/>
194 <!-- Sent when a target accepts pointer_focus or motion events.
195 If a target does not accept any of the offered types, type is
197 <event name="target">
198 <arg name="mime_type" type="string"/>
201 <!-- Request for data from another client. Send the data in the
202 specified mime-type over the passed fd, the close it. -->
204 <arg name="mime_type" type="string"/>
205 <arg name="fd" type="fd"/>
208 <!-- Another selection became active. -->
209 <event name="cancelled"/>
212 <interface name="wl_data_device" version="1">
213 <request name="start_drag">
214 <arg name="source" type="object" interface="wl_data_source"/>
215 <arg name="surface" type="object" interface="wl_surface"/>
216 <arg name="time" type="uint"/>
219 <request name="attach">
220 <arg name="time" type="uint"/>
221 <arg name="buffer" type="object" interface="wl_buffer"/>
222 <arg name="x" type="int"/>
223 <arg name="y" type="int"/>
226 <request name="set_selection">
227 <arg name="source" type="object" interface="wl_data_source"/>
228 <arg name="time" type="uint"/>
231 <!-- The data_offer event introduces a new wl_data_offer object,
232 which will subsequently be used in either the
233 data_device.enter event (for drag and drop) or the
234 data_device.selection event (for selections). Immediately
235 following the data_device_data_offer event, the new
236 data_offer object will send out data_offer.offer events to
237 describe the mime-types it offers. -->
238 <event name="data_offer">
239 <arg name="id" type="new_id" interface="wl_data_offer"/>
243 <arg name="time" type="uint"/>
244 <arg name="surface" type="object" interface="wl_surface"/>
245 <arg name="x" type="int"/>
246 <arg name="y" type="int"/>
247 <arg name="id" type="object" interface="wl_data_offer"/>
250 <event name="leave"/>
252 <event name="motion">
253 <arg name="time" type="uint"/>
254 <arg name="x" type="int"/>
255 <arg name="y" type="int"/>
260 <!-- The selection event is sent out to notify the client of a new
261 wl_data_offer for the selection for this device. The
262 data_device.data_offer and the data_offer.offer events are
263 sent out immediately before this event to introduce the data
264 offer object. The selection event is sent to a client
265 immediately before receiving keyboard focus and when a new
266 selection is set while the client has keyboard focus. The
267 data_offer is valid until a new data_offer or NULL is
268 received or until the client loses keyboard focus. -->
269 <event name="selection">
270 <arg name="id" type="object" interface="wl_data_offer"/>
274 <interface name="wl_data_device_manager" version="1">
275 <request name="create_data_source">
276 <arg name="id" type="new_id" interface="wl_data_source"/>
279 <request name="get_data_device">
280 <arg name="id" type="new_id" interface="wl_data_device"/>
281 <arg name="input_device" type="object" interface="wl_input_device"/>
285 <interface name="wl_shell" version="1">
286 <request name="get_shell_surface">
287 <arg name="id" type="new_id" interface="wl_shell_surface"/>
288 <arg name="surface" type="object" interface="wl_surface"/>
292 <!-- A wrapper interface for shell related actions on a wl_surface.
293 On server side the object is automatically destroyed when the
294 related wl_surface is destroyed.
295 On client side, wl_shell_surface_destroy() must be called
296 before destroying the wl_surface object. -->
297 <interface name="wl_shell_surface" version="1">
298 <request name="move">
299 <arg name="input_device" type="object" interface="wl_input_device"/>
300 <arg name="time" type="uint"/>
304 <entry name="none" value="0"/>
305 <entry name="top" value="1"/>
306 <entry name="bottom" value="2"/>
307 <entry name="left" value="4"/>
308 <entry name="top_left" value="5"/>
309 <entry name="bottom_left" value="6"/>
310 <entry name="right" value="8"/>
311 <entry name="top_right" value="9"/>
312 <entry name="bottom_right" value="10"/>
315 <request name="resize">
316 <arg name="input_device" type="object" interface="wl_input_device"/>
317 <arg name="time" type="uint"/>
318 <!-- edges is an enum, need to get the values in here -->
319 <arg name="edges" type="uint"/>
322 <!-- Make the surface visible as a toplevel window. -->
323 <request name="set_toplevel"/>
325 <!-- Map the surface relative to an existing surface. The x and y
326 arguments specify the locations of the upper left corner of
327 the surface relative to the upper left corner of the parent
328 surface. The flags argument controls overflow/clipping
329 behaviour when the surface would intersect a screen edge,
330 panel or such. And possibly whether the offset only
331 determines the initial position or if the surface is locked
332 to that relative position during moves. -->
333 <request name="set_transient">
334 <arg name="parent" type="object" interface="wl_shell_surface"/>
335 <arg name="x" type="int"/>
336 <arg name="y" type="int"/>
337 <arg name="flags" type="uint"/>
340 <!-- Map the surface as a fullscreen surface. There are a number
341 of options here: on which output? if the surface size doesn't
342 match the output size, do we scale, change resolution, or add
343 black borders? is that something the client controls? what
344 about transient surfaces, do they float on top of the
345 fullscreen? what if there's already a fullscreen surface on
346 the output, maybe you can only go fullscreen if you're
348 <request name="set_fullscreen"/>
350 <!-- The configure event asks the client to resize its surface.
351 The size is a hint, in the sense that the client is free to
352 ignore it if it doesn't resize, pick a smaller size (to
353 satisfy aspect ration or resize in steps of NxM pixels). The
354 client is free to dismiss all but the last configure event it
356 <event name="configure">
357 <arg name="time" type="uint"/>
358 <arg name="edges" type="uint"/>
359 <arg name="width" type="int"/>
360 <arg name="height" type="int"/>
365 <!-- A surface. This is an image that is displayed on the screen.
366 It has a location, size and pixel contents. Similar to a window. -->
367 <interface name="wl_surface" version="1">
368 <!-- Deletes the surface and invalidates its object id. -->
369 <request name="destroy" type="destructor"/>
371 <!-- Copy the contents of a buffer into this surface. The x and y
372 arguments specify the location of the new buffers upper left
373 corner, relative to the old buffers upper left corner. -->
374 <request name="attach">
375 <arg name="buffer" type="object" interface="wl_buffer"/>
376 <arg name="x" type="int"/>
377 <arg name="y" type="int"/>
380 <!-- After attaching a new buffer, this request is used to
381 describe the regions where the new buffer is different from
382 the previous buffer and needs to be repainted. Coordinates
383 are relative to the new buffer. -->
384 <request name="damage">
385 <arg name="x" type="int"/>
386 <arg name="y" type="int"/>
387 <arg name="width" type="int"/>
388 <arg name="height" type="int"/>
391 <!-- Request notification when the next frame is displayed.
392 Useful for throttling redrawing operations, and driving
393 animations. The notification will only be posted for one
394 frame unless requested again. -->
395 <request name="frame">
396 <arg name="callback" type="new_id" interface="wl_callback"/>
402 <!-- A group of keyboards and pointer devices (mice, for
403 example). This object is published as a global during start up,
404 or when such a device is hot plugged. A input_device group
405 typically has a pointer and maintains a keyboard_focus and a
407 <interface name="wl_input_device" version="1">
408 <!-- Set the pointer's image. This request only takes effect if
409 the pointer focus for this device is one of the requesting
410 clients surfaces. -->
411 <request name="attach">
412 <arg name="time" type="uint"/>
413 <arg name="buffer" type="object" interface="wl_buffer"/>
414 <arg name="hotspot_x" type="int"/>
415 <arg name="hotspot_y" type="int"/>
418 <!-- Notification of pointer location change.
419 x,y are the absolute location on the screen.
420 surface_[xy] are the location relative to the focused surface. -->
421 <event name="motion">
422 <arg name="time" type="uint"/>
423 <arg name="x" type="int"/>
424 <arg name="y" type="int"/>
425 <arg name="surface_x" type="int"/>
426 <arg name="surface_y" type="int"/>
429 <!-- Mouse button click and release notifications. The location
430 of the click is given by the last motion or pointer_focus
432 <event name="button">
433 <arg name="time" type="uint"/>
434 <arg name="button" type="uint"/>
435 <arg name="state" type="uint"/>
438 <!-- Keyboard press. -->
440 <arg name="time" type="uint"/>
441 <arg name="key" type="uint"/>
442 <arg name="state" type="uint"/>
445 <!-- Notification that this input device's pointer is focused on
446 certain surface. When an input_device enters a surface, the
447 pointer image is undefined and a client should respond to
448 this event by setting an apropriate pointer image. -->
449 <event name="pointer_focus">
450 <arg name="time" type="uint"/>
451 <arg name="surface" type="object" interface="wl_surface"/>
452 <arg name="x" type="int"/>
453 <arg name="y" type="int"/>
454 <arg name="surface_x" type="int"/>
455 <arg name="surface_y" type="int"/>
458 <event name="keyboard_focus">
459 <arg name="time" type="uint"/>
460 <arg name="surface" type="object" interface="wl_surface"/>
461 <arg name="keys" type="array"/>
464 <event name="touch_down">
465 <arg name="time" type="uint"/>
466 <arg name="id" type="int" />
467 <arg name="x" type="int" />
468 <arg name="y" type="int" />
471 <event name="touch_up">
472 <arg name="time" type="uint"/>
473 <arg name="id" type="int" />
476 <event name="touch_motion">
477 <arg name="time" type="uint"/>
478 <arg name="id" type="int" />
479 <arg name="x" type="int" />
480 <arg name="y" type="int" />
483 <!-- Indicates the end of a contact point list. -->
484 <event name="touch_frame"/>
486 <!-- Sent if the compositor decides the touch stream is a global
487 gesture. No further events are sent to the clients from that
488 particular gesture. -->
489 <event name="touch_cancel"/>
493 <!-- An output describes part of the compositor geometry. The
494 compositor work in the 'compositor coordinate system' and an
495 output corresponds to rectangular area in that space that is
496 actually visible. This typically corresponds to a monitor that
497 displays part of the compositor space. This object is
498 published as global during start up, or when a screen is hot
500 <interface name="wl_output" version="1">
502 <enum name="subpixel">
503 <entry name="unknown" value="0"/>
504 <entry name="none" value="1"/>
505 <entry name="horizontal_rgb" value="2"/>
506 <entry name="horizontal_bgr" value="3"/>
507 <entry name="vertical_rgb" value="4"/>
508 <entry name="vertical_bgr" value="5"/>
511 <event name="geometry">
512 <arg name="x" type="int"/>
513 <arg name="y" type="int"/>
514 <arg name="physical_width" type="int"/>
515 <arg name="physical_height" type="int"/>
516 <arg name="subpixel" type="int"/>
517 <arg name="make" type="string"/>
518 <arg name="model" type="string"/>
521 <!-- Values for the flags bitfield of the mode event. -->
523 <entry name="current" value="0x1"/>
524 <entry name="preferred" value="0x2"/>
528 <arg name="flags" type="uint"/>
529 <arg name="width" type="int"/>
530 <arg name="height" type="int"/>
531 <arg name="refresh" type="int"/>