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 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 <interface name="wl_display" version="1">
31 <description summary="core global object">
32 The core global object. This is a special singleton object. It
33 is used for internal wayland protocol features.
36 <description summary="bind an object to the display">
37 Binds a new, client-created object to the server using @name as
40 <arg name="name" type="uint" summary="unique number id for object"/>
41 <arg name="interface" type="string"/>
42 <arg name="version" type="uint"/>
43 <arg name="id" type="new_id" interface="wl_object"/>
47 <description summary="asynchronous roundtrip">
48 The sync request asks the server to invoke the 'done' request
49 on the provided wl_callback object. Since requests are
50 handled in-order, this can be used as a barrier to ensure all
51 previous requests have been handled.
53 <arg name="callback" type="new_id" interface="wl_callback"/>
57 <description summary="fatal error event">
58 The error event is sent out when a fatal (non-recoverable)
61 <arg name="object_id" type="object" interface="wl_object"/>
62 <arg name="code" type="uint"/>
63 <arg name="message" type="string"/>
67 <description summary="global error values">
68 These errors are global and can be emitted in response to any
71 <entry name="invalid_object" value="0"
72 summary="server couldn't find object"/>
73 <entry name="invalid_method" value="1"
74 summary="method doesn't exist on the specified interface"/>
75 <entry name="no_memory" value="2"
76 summary="server is out of memory"/>
80 <description summary="announce global object">
81 Notify the client of global objects. These are objects that
82 are created by the server. Globals are published on the
83 initial client connection sequence, upon device hotplugs,
84 device disconnects, reconfiguration or other events. A client
85 can 'bind' to a global object by using the bind request. This
86 creates a client side handle that lets the object emit events
87 to the client and lets the client invoke requests on the
90 <arg name="name" type="uint"/>
91 <arg name="interface" type="string"/>
92 <arg name="version" type="uint"/>
95 <event name="global_remove">
96 <description summary="announce removal of global object">
97 Notify the client of removed global objects.
99 <arg name="name" type="uint"/>
102 <event name="delete_id">
103 <description summary="acknowledge object id deletion">
104 Server has deleted the id and client can now reuse it.
106 <arg name="id" type="uint" />
110 <interface name="wl_callback" version="1">
112 <arg name="time" type="uint"/>
116 <interface name="wl_compositor" version="1">
117 <description summary="the compositor singleton">
118 A compositor. This object is a singleton global. The
119 compositor is in charge of combining the contents of multiple
120 surfaces into one displayable output.
123 <request name="create_surface">
124 <description summary="create new surface">
125 Ask the compositor to create a new surface.
127 <arg name="id" type="new_id" interface="wl_surface"/>
130 <request name="create_region">
131 <description summary="create new region">
132 Ask the compositor to create a new region.
134 <arg name="id" type="new_id" interface="wl_region"/>
138 <interface name="wl_shm" version="1">
139 <description summary="shared memory support">
140 Support for shared memory buffers.
144 <entry name="invalid_format" value="0"/>
145 <entry name="invalid_stride" value="1"/>
146 <entry name="invalid_fd" value="2"/>
150 <entry name="argb8888" value="0"/>
151 <entry name="xrgb8888" value="1"/>
154 <request name="create_buffer">
155 <description summary="create a wl_buffer">
156 Transfer a shm buffer to the server. The allocated buffer
157 would include at least stride * height bytes starting at the
158 beginning of fd. The file descriptor is transferred over the
159 socket using AF_UNIX magical features. width, height, stride
160 and format describe the respective properties of the pixel
161 data contained in the buffer.
164 <arg name="id" type="new_id" interface="wl_buffer"/>
165 <arg name="fd" type="fd"/>
166 <arg name="width" type="int"/>
167 <arg name="height" type="int"/>
168 <arg name="stride" type="uint"/>
169 <arg name="format" type="uint"/>
172 <event name="format">
173 <arg name="format" type="uint"/>
177 <interface name="wl_buffer" version="1">
178 <description summary="content for a wl_surface">
179 A buffer provides the content for a wl_surface. Buffers are
180 created through factory interfaces such as wl_drm, wl_shm or
181 similar. It has a width and a height and can be attached to a
182 wl_surface, but the mechanism by which a client provides and
183 updates the contents is defined by the buffer factory interface
186 <request name="destroy" type="destructor">
187 <description summary="destroy a buffer">
188 Destroy a buffer. This will invalidate the object id.
192 <event name="release">
193 <description summary="compositor releases buffer">
194 Sent when an attached buffer is no longer used by the compositor.
200 <interface name="wl_data_offer" version="1">
201 <request name="accept">
202 <description summary="accept one of the offered mime-types">
203 Indicate that the client can accept the given mime-type, or
204 NULL for not accepted. Use for feedback during drag and drop.
207 <arg name="time" type="uint"/>
208 <arg name="type" type="string"/>
211 <request name="receive">
212 <arg name="mime_type" type="string"/>
213 <arg name="fd" type="fd"/>
216 <request name="destroy" type="destructor"/>
219 <description summary="advertise offered mime-type">
220 Sent immediately after creating the wl_data_offer object. One
221 event per offered mime type.
224 <arg name="type" type="string"/>
228 <interface name="wl_data_source" version="1">
229 <request name="offer">
230 <description summary="add an offered mime type">
231 This request adds a mime-type to the set of mime-types
232 advertised to targets. Can be called several times to offer
235 <arg name="type" type="string"/>
238 <request name="destroy" type="destructor">
239 <description summary="destroy the data source">
240 Destroy the data source.
244 <event name="target">
245 <description summary="a target accepts an offered mime-type">
246 Sent when a target accepts pointer_focus or motion events. If
247 a target does not accept any of the offered types, type is NULL.
250 <arg name="mime_type" type="string"/>
254 <description summary="send the data">
255 Request for data from another client. Send the data as the
256 specified mime-type over the passed fd, then close the fd.
259 <arg name="mime_type" type="string"/>
260 <arg name="fd" type="fd"/>
263 <event name="cancelled">
264 <description summary="selection was cancelled">
265 Another selection became active.
271 <interface name="wl_data_device" version="1">
272 <request name="start_drag">
273 <description summary="start drag and drop operation">
274 This request asks the compositor to start a drag and drop
275 operation on behalf of the client. The source argument is the
276 data source that provides the data for the eventual data
277 transfer. The origin surface is the surface where the drag
278 originates and the client must have an active implicit grab
279 that matches the timestamp. The icon surface is an optional
280 (can be nil) surface that provides an icon to be moved around
281 with the cursor. Initially, the top-left corner of the icon
282 surface is placed at the cursor hotspot, but subsequent
283 surface.attach request can move the relative position.
285 <arg name="source" type="object" interface="wl_data_source"/>
286 <arg name="origin" type="object" interface="wl_surface"/>
287 <arg name="icon" type="object" interface="wl_surface"/>
288 <arg name="time" type="uint"/>
291 <request name="set_selection">
292 <arg name="source" type="object" interface="wl_data_source"/>
293 <arg name="time" type="uint"/>
296 <event name="data_offer">
297 <description summary="introduce a new wl_data_offer">
298 The data_offer event introduces a new wl_data_offer object,
299 which will subsequently be used in either the
300 data_device.enter event (for drag and drop) or the
301 data_device.selection event (for selections). Immediately
302 following the data_device_data_offer event, the new data_offer
303 object will send out data_offer.offer events to describe the
304 mime-types it offers.
307 <arg name="id" type="new_id" interface="wl_data_offer"/>
311 <arg name="time" type="uint"/>
312 <arg name="surface" type="object" interface="wl_surface"/>
313 <arg name="x" type="int"/>
314 <arg name="y" type="int"/>
315 <arg name="id" type="object" interface="wl_data_offer"/>
318 <event name="leave"/>
320 <event name="motion">
321 <arg name="time" type="uint"/>
322 <arg name="x" type="int"/>
323 <arg name="y" type="int"/>
328 <event name="selection">
329 <description summary="advertise new selection">
330 The selection event is sent out to notify the client of a new
331 wl_data_offer for the selection for this device. The
332 data_device.data_offer and the data_offer.offer events are
333 sent out immediately before this event to introduce the data
334 offer object. The selection event is sent to a client
335 immediately before receiving keyboard focus and when a new
336 selection is set while the client has keyboard focus. The
337 data_offer is valid until a new data_offer or NULL is received
338 or until the client loses keyboard focus.
340 <arg name="id" type="object" interface="wl_data_offer"/>
344 <interface name="wl_data_device_manager" version="1">
345 <request name="create_data_source">
346 <arg name="id" type="new_id" interface="wl_data_source"/>
349 <request name="get_data_device">
350 <arg name="id" type="new_id" interface="wl_data_device"/>
351 <arg name="input_device" type="object" interface="wl_input_device"/>
355 <interface name="wl_shell" version="1">
356 <request name="get_shell_surface">
357 <arg name="id" type="new_id" interface="wl_shell_surface"/>
358 <arg name="surface" type="object" interface="wl_surface"/>
362 <interface name="wl_shell_surface" version="1">
364 <description summary="desktop style meta data interface">
365 An interface implemented by a wl_surface. On server side the
366 object is automatically destroyed when the related wl_surface is
367 destroyed. On client side, wl_shell_surface_destroy() must be
368 called before destroying the wl_surface object.
371 <request name="move">
372 <arg name="input_device" type="object" interface="wl_input_device"/>
373 <arg name="time" type="uint"/>
377 <entry name="none" value="0"/>
378 <entry name="top" value="1"/>
379 <entry name="bottom" value="2"/>
380 <entry name="left" value="4"/>
381 <entry name="top_left" value="5"/>
382 <entry name="bottom_left" value="6"/>
383 <entry name="right" value="8"/>
384 <entry name="top_right" value="9"/>
385 <entry name="bottom_right" value="10"/>
388 <request name="resize">
389 <arg name="input_device" type="object" interface="wl_input_device"/>
390 <arg name="time" type="uint"/>
391 <arg name="edges" type="uint"/>
394 <request name="set_toplevel">
395 <description summary="make the surface a top level surface">
396 Make the surface a toplevel window.
400 <request name="set_transient">
401 <description summary="make the surface a transient surface">
402 Map the surface relative to an existing surface. The x and y
403 arguments specify the locations of the upper left corner of
404 the surface relative to the upper left corner of the parent
405 surface. The flags argument controls overflow/clipping
406 behaviour when the surface would intersect a screen edge,
407 panel or such. And possibly whether the offset only
408 determines the initial position or if the surface is locked to
409 that relative position during moves.
412 <arg name="parent" type="object" interface="wl_shell_surface"/>
413 <arg name="x" type="int"/>
414 <arg name="y" type="int"/>
415 <arg name="flags" type="uint"/>
418 <request name="set_fullscreen">
419 <description summary="make the surface a fullscreen surface">
420 Map the surface as a fullscreen surface. If an output parameter is
421 given then the surface will be made fullscreen on that output. If the
422 client does not specify the output then the compositor will apply its
423 policy - usually choosing the output on which the surface has the
424 biggest surface area.
426 The client may specify a method to resolve a size conflict between the
427 output size and the surface size - this is provided through the
428 fullscreen_method parameter.
430 The framerate parameter is used only when the fullscreen_method is set
431 to "driver", to indicate the preferred framerate. framerate=0 indicates
432 that the app does not care about framerate.
434 The compositor must reply to this request with a configure event with
435 the dimensions for the output on which the surface will be made fullscreen.
437 <arg name="method" type="uint"/>
438 <arg name="framerate" type="uint"/>
439 <arg name="output" type="object" interface="wl_output"/>
442 <enum name="fullscreen_method">
443 <description summary="different method to set the surface fullscreen">
444 Hints to indicate compositor how to deal with a conflict between the
445 dimensions for the surface and the dimensions of the output. As a hint
446 the compositor is free to ignore this parameter.
448 "default" The client has no preference on fullscreen behavior,
449 policies are determined by compositor.
451 "scale" The client prefers scaling by the compositor. Scaling would
452 always preserve surface's aspect ratio with surface centered on the
455 "driver" The client wants to switch video mode to the smallest mode
456 that can fit the client buffer. If the sizes do not match the
457 compositor must add black borders.
459 "fill" The surface is centered on the output on the screen with no
460 scaling. If the surface is of insufficient size the compositor must
463 <entry name="default" value="0"/>
464 <entry name="scale" value="1"/>
465 <entry name="driver" value="2"/>
466 <entry name="fill" value="3"/>
469 <request name="set_popup">
470 <description summary="make the surface a popup surface">
471 Popup surfaces. Will switch an implicit grab into
472 owner-events mode, and grab will continue after the implicit
473 grab ends (button released). Once the implicit grab is over,
474 the popup grab continues until the window is destroyed or a
475 mouse button is pressed in any other clients window. A click
476 in any of the clients surfaces is reported as normal, however,
477 clicks in other clients surfaces will be discarded and trigger
480 TODO: Grab keyboard too, maybe just terminate on any click
481 inside or outside the surface?
484 <arg name="input_device" type="object" interface="wl_input_device"/>
485 <arg name="time" type="uint"/>
486 <arg name="parent" type="object" interface="wl_shell_surface"/>
487 <arg name="x" type="int"/>
488 <arg name="y" type="int"/>
489 <arg name="flags" type="uint"/>
492 <request name="set_maximized">
493 <description summary="make the surface a maximized surface">
494 A request from the client to notify the compositor the maximized
495 operation. The compositor will reply with a configure event telling
496 the expected new surface size. The operation is completed on the
497 next buffer attach to this surface.
498 A maximized client will fill the fullscreen of the output it is bound
499 to, except the panel area. This is the main difference between
500 a maximized shell surface and a fullscreen shell surface.
502 <arg name="output" type="object" interface="wl_output"/>
505 <event name="configure">
506 <description summary="suggest resize">
507 The configure event asks the client to resize its surface.
508 The size is a hint, in the sense that the client is free to
509 ignore it if it doesn't resize, pick a smaller size (to
510 satisfy aspect ration or resize in steps of NxM pixels). The
511 client is free to dismiss all but the last configure event it
515 <arg name="time" type="uint"/>
516 <arg name="edges" type="uint"/>
517 <arg name="width" type="int"/>
518 <arg name="height" type="int"/>
521 <event name="popup_done">
522 <description summary="popup interaction is done">
523 The popup_done event is sent out when a popup grab is broken,
524 that is, when the users clicks a surface that doesn't belong
525 to the client owning the popup surface.
530 <interface name="wl_surface" version="1">
531 <description summary="an onscreen surface">
532 A surface. This is an image that is displayed on the screen.
533 It has a location, size and pixel contents.
536 <request name="destroy" type="destructor">
537 <description summary="delete surface">
538 Deletes the surface and invalidates its object id.
542 <request name="attach">
543 <description summary="set the surface contents">
544 Copy the contents of a buffer into this surface. The x and y
545 arguments specify the location of the new buffers upper left
546 corner, relative to the old buffers upper left corner.
549 <arg name="buffer" type="object" interface="wl_buffer"/>
550 <arg name="x" type="int"/>
551 <arg name="y" type="int"/>
554 <request name="damage">
555 <description summary="mark part of the surface damaged">
556 After attaching a new buffer, this request is used to describe
557 the regions where the new buffer is different from the
558 previous buffer and needs to be repainted. Coordinates are
559 relative to the new buffer.
562 <arg name="x" type="int"/>
563 <arg name="y" type="int"/>
564 <arg name="width" type="int"/>
565 <arg name="height" type="int"/>
568 <request name="frame">
569 <description summary="request repaint feedback">
570 Request notification when the next frame is displayed. Useful
571 for throttling redrawing operations, and driving animations.
572 The notification will only be posted for one frame unless
576 <arg name="callback" type="new_id" interface="wl_callback"/>
579 <request name="set_opaque_region">
580 <description summary="set opaque region">
581 This requests sets the region of the surface that contain
582 opaque content. The opaque region is an optimization hint for
583 the compositor that lets it optimize out redrawing of content
584 behind opaque regions. Setting an opaque region is not
585 required for correct behaviour, but marking transparent
586 content as opaque will result in repaint artifacts.
588 The region will be clipped to the extents of the current
589 surface size. Setting the region has copy semantics, and the
590 region object can be destroyed immediately after setting the
591 opaque region. If a buffer of a different size is attached or
592 if a nil region is set, the opaque region will revert back to
593 default. The default opaque region is empty.
596 <arg name="region" type="object" interface="wl_region"/>
599 <request name="set_input_region">
600 <description summary="set input region">
601 This requests sets the region of the surface that can receive
602 pointer and touch events. The region will be clipped to the
603 extents of the current surface size. Setting the region has
604 copy semantics, and the region object can be destroyed
605 immediately after setting the input region. If a buffer of a
606 different size is attached or if a nil region is passed, the
607 input region will revert back to default. The default input
608 region is the entire surface.
611 <arg name="region" type="object" interface="wl_region"/>
615 <interface name="wl_input_device" version="1">
616 <description summary="input device group">
617 A group of keyboards and pointer devices (mice, for
618 example). This object is published as a global during start up,
619 or when such a device is hot plugged. A input_device group
620 typically has a pointer and maintains a keyboard_focus and a
624 <request name="attach">
625 <description summary="set the pointer image">
626 Set the pointer's image. This request only takes effect if
627 the pointer focus for this device is one of the requesting
631 <arg name="time" type="uint"/>
632 <arg name="buffer" type="object" interface="wl_buffer"/>
633 <arg name="hotspot_x" type="int"/>
634 <arg name="hotspot_y" type="int"/>
637 <event name="motion">
638 <description summary="pointer motion event">
639 Notification of pointer location change. The arguments surface_[xy]
640 are the location relative to the focused surface.
643 <arg name="time" type="uint"/>
644 <arg name="surface_x" type="int"/>
645 <arg name="surface_y" type="int"/>
648 <event name="button">
649 <description summary="pointer button event">
650 Mouse button click and release notifications. The location
651 of the click is given by the last motion or pointer_focus event.
654 <arg name="time" type="uint"/>
655 <arg name="button" type="uint"/>
656 <arg name="state" type="uint"/>
660 <description summary="axis types"/>
661 <entry name="vertical_scroll" value="0"/>
662 <entry name="horizontal_scroll" value="1"/>
666 <description summary="axis event">
667 Scroll and other axis notifications.
670 <arg name="time" type="uint"/>
671 <arg name="axis" type="uint"/>
672 <arg name="value" type="int"/>
676 <description summary="key event">
677 A key was pressed or released.
680 <arg name="time" type="uint"/>
681 <arg name="key" type="uint"/>
682 <arg name="state" type="uint"/>
685 <event name="pointer_enter">
686 <description summary="pointer enter event">
687 Notification that this input device's pointer is focused on
688 certain surface. When an input_device enters a surface, the
689 pointer image is undefined and a client should respond to this
690 event by setting an appropriate pointer image.
693 <arg name="time" type="uint"/>
694 <arg name="surface" type="object" interface="wl_surface"/>
695 <arg name="surface_x" type="int"/>
696 <arg name="surface_y" type="int"/>
699 <event name="pointer_leave">
700 <description summary="pointer leave event">
702 <arg name="time" type="uint"/>
703 <arg name="surface" type="object" interface="wl_surface"/>
706 <event name="keyboard_enter">
707 <arg name="time" type="uint"/>
708 <arg name="surface" type="object" interface="wl_surface"/>
709 <arg name="keys" type="array"/>
712 <event name="keyboard_leave">
713 <arg name="time" type="uint"/>
714 <arg name="surface" type="object" interface="wl_surface"/>
717 <event name="touch_down">
718 <arg name="time" type="uint"/>
719 <arg name="surface" type="object" interface="wl_surface"/>
720 <arg name="id" type="int" />
721 <arg name="x" type="int" />
722 <arg name="y" type="int" />
725 <event name="touch_up">
726 <arg name="time" type="uint"/>
727 <arg name="id" type="int" />
730 <event name="touch_motion">
731 <arg name="time" type="uint"/>
732 <arg name="id" type="int" />
733 <arg name="x" type="int" />
734 <arg name="y" type="int" />
737 <event name="touch_frame">
738 <description summary="end of touch frame event">
739 Indicates the end of a contact point list.
743 <event name="touch_cancel">
744 <description summary="touch session cancelled">
745 Sent if the compositor decides the touch stream is a global
746 gesture. No further events are sent to the clients from that
753 <interface name="wl_output" version="1">
754 <description summary="compositor output region">
755 An output describes part of the compositor geometry. The
756 compositor work in the 'compositor coordinate system' and an
757 output corresponds to rectangular area in that space that is
758 actually visible. This typically corresponds to a monitor that
759 displays part of the compositor space. This object is published
760 as global during start up, or when a screen is hot plugged.
763 <enum name="subpixel">
764 <entry name="unknown" value="0"/>
765 <entry name="none" value="1"/>
766 <entry name="horizontal_rgb" value="2"/>
767 <entry name="horizontal_bgr" value="3"/>
768 <entry name="vertical_rgb" value="4"/>
769 <entry name="vertical_bgr" value="5"/>
772 <event name="geometry">
773 <arg name="x" type="int"/>
774 <arg name="y" type="int"/>
775 <arg name="physical_width" type="int"/>
776 <arg name="physical_height" type="int"/>
777 <arg name="subpixel" type="int"/>
778 <arg name="make" type="string"/>
779 <arg name="model" type="string"/>
783 <description summary="values for the flags bitfield in the mode event"/>
784 <entry name="current" value="0x1"/>
785 <entry name="preferred" value="0x2"/>
789 <arg name="flags" type="uint"/>
790 <arg name="width" type="int"/>
791 <arg name="height" type="int"/>
792 <arg name="refresh" type="int"/>
796 <interface name="wl_region" version="1">
797 <description summary="region interface">
801 <request name="destroy" type="destructor">
802 <description summary="destroy region">
803 Destroy the region. This will invalidate the object id.
808 <description summary="add rectangle to region">
809 Add the specified rectangle to the region
812 <arg name="x" type="int"/>
813 <arg name="y" type="int"/>
814 <arg name="width" type="int"/>
815 <arg name="height" type="int"/>
818 <request name="subtract">
819 <description summary="subtract rectangle from region">
820 Subtract the specified rectangle from the region
823 <arg name="x" type="int"/>
824 <arg name="y" type="int"/>
825 <arg name="width" type="int"/>
826 <arg name="height" type="int"/>