1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="wayland">
4 <!-- The core global object. This is a special singleton object.
5 It is used for internal wayland protocol features. -->
6 <interface name="display" version="1">
7 <!-- sync is an just an echo, which will reply with a sync event.
8 Since requests are handled in-order, this can be used as a
9 barrier to ensure all previous requests have ben handled.
10 The key argument can be used to correlate between multiple
13 <arg name="key" type="uint"/>
16 <!-- Request notification when the next frame is displayed.
17 Useful for throttling redrawing operations, and driving
18 animations. The notification will only be posted for one
19 frame unless requested again. -->
20 <request name="frame">
21 <arg name="key" type="uint"/>
24 <!-- A request addressed a non-existent object id. This is
25 tyipcally a fatal error. -->
26 <event name="invalid_object">
27 <arg name="object_id" type="uint"/>
30 <!-- A request tried to invoke an opcode out of range. This is
31 typically a fatal error. -->
32 <event name="invalid_method">
33 <arg name="object_id" type="uint"/>
34 <arg name="opcode" type="uint"/>
37 <!-- A request has failed due to an out of memory error. -->
38 <event name="no_memory"/>
40 <!-- Notify the client of global objects. These are objects that
41 are created by the server. Globals are published on the
42 initial client connection sequence, upon device hotplugs,
43 device disconnects, reconfiguration or other events. The
44 server will always announce an object before the object sends
47 <arg name="id" type="new_id" interface="object"/>
48 <arg name="name" type="string"/>
49 <arg name="version" type="uint"/>
52 <!-- Internal, deprecated, and will be changed. This is an object
53 IDs range that is used by the client to allocate object IDs
54 in "new_id" type arguments. The server sends range
55 allocations to the client before the next range is about to
58 <arg name="base" type="uint"/>
61 <!-- A reply to the frame or sync request. The key is the one
62 used in the request. time is in millisecond units, and
63 denotes the time when the frame was posted on the
64 display. time can be used to estimaate frame rate, determine
65 how much to advance animations and compensate for jitter. -->
67 <arg name="key" type="uint"/>
68 <arg name="time" type="uint"/>
73 <!-- A compositor. This object is a global. The compositor is in
74 charge of combining the contents of multiple surfaces into one
75 displayable output. -->
76 <interface name="compositor" version="1">
77 <!-- Factory request for a surface objects. A surface is akin to a
79 <request name="create_surface">
80 <arg name="id" type="new_id" interface="surface"/>
85 <!-- drm support. This object is created by the server and published
86 using the display's global event. -->
87 <interface name="drm" version="1">
88 <!-- Call this request with the magic received from drmGetMagic().
89 It will be passed on to the drmAuthMagic() or
90 DRIAuthConnection() call. This authentication must be
91 completed before create_buffer could be used. -->
92 <request name="authenticate">
93 <arg name="id" type="uint"/>
96 <!-- Create a wayland buffer for the named DRM buffer. The DRM
97 surface must have a name using the flink ioctl -->
98 <request name="create_buffer">
99 <arg name="id" type="new_id" interface="buffer"/>
100 <arg name="name" type="uint"/>
101 <arg name="width" type="int"/>
102 <arg name="height" type="int"/>
103 <arg name="stride" type="uint"/>
104 <arg name="visual" type="object" interface="visual"/>
107 <!-- Notification of the path of the drm device which is used by
108 the server. The client should use this device for creating
109 local buffers. Only buffers created from this device should
110 be be passed to the server using this drm object's
111 create_buffer request. -->
112 <event name="device">
113 <arg name="name" type="string"/>
116 <!-- Raised if the authenticate request succeeded -->
117 <event name="authenticated"/>
121 <!-- Shared memory support -->
122 <interface name="shm" version="1">
123 <!-- Transfer a shm buffer to the server. The allocated buffer
124 would include at least stride * height bytes starting at the
125 beginning of fd. The file descriptor is transferred over the
126 socket using AF_UNIX magical features. width, height, stride
127 and visual describe the respective properties of the pixel
128 data contained in the buffer. -->
129 <request name="create_buffer">
130 <arg name="id" type="new_id" interface="buffer"/>
131 <arg name="fd" type="fd"/>
132 <arg name="width" type="int"/>
133 <arg name="height" type="int"/>
134 <arg name="stride" type="uint"/>
135 <arg name="visual" type="object" interface="visual"/>
140 <!-- A pixel buffer. Created using the drm, shm or similar objects.
141 It has a size, visual and contents, but not a location on the
143 <interface name="buffer" version="1">
144 <!-- Abandon a buffer. This will invalidate the object id. -->
145 <request name="destroy" type="destructor"/>
148 <interface name="shell" version="1">
149 <request name="move">
150 <arg name="surface" type="object" interface="surface"/>
151 <arg name="input_device" type="object" interface="input_device"/>
152 <arg name="time" type="uint"/>
156 <entry name="none" value="0"/>
157 <entry name="top" value="1"/>
158 <entry name="bottom" value="2"/>
159 <entry name="left" value="4"/>
160 <entry name="top_left" value="5"/>
161 <entry name="bottom_left" value="6"/>
162 <entry name="right" value="8"/>
163 <entry name="top_right" value="9"/>
164 <entry name="bottom_right" value="10"/>
167 <request name="resize">
168 <arg name="surface" type="object" interface="surface"/>
169 <arg name="input_device" type="object" interface="input_device"/>
170 <arg name="time" type="uint"/>
171 <!-- edges is an enum, need to get the values in here -->
172 <arg name="edges" type="uint"/>
175 <request name="create_drag">
176 <arg name="id" type="new_id" interface="drag"/>
179 <request name="create_selection">
180 <arg name="id" type="new_id" interface="selection"/>
183 <!-- The configure event asks the client to resize its surface.
184 The size is a hint, in the sense that the client is free to
185 ignore it if it doesn't resize, pick a smaller size (to
186 satisfy aspect ration or resize in steps of NxM pixels). The
187 client is free to dismiss all but the last configure event it
189 <event name="configure">
190 <arg name="time" type="uint"/>
191 <arg name="edges" type="uint"/>
192 <arg name="surface" type="object" interface="surface"/>
193 <arg name="width" type="int"/>
194 <arg name="height" type="int"/>
198 <interface name="selection" version="1">
199 <!-- Add an offered mime type. Can be called several times to
200 offer multiple types, but must be called before 'activate'. -->
201 <request name="offer">
202 <arg name="type" type="string"/>
205 <!-- Can the selection be activated for multiple devices? -->
206 <request name="activate">
207 <arg name="input_device" type="object" interface="input_device"/>
208 <arg name="time" type="uint"/>
211 <!-- Destroy the selection. -->
212 <request name="destroy" type="destructor"/>
214 <!-- Another client pasted the selection, send the mime-type over
217 <arg name="mime_type" type="string"/>
218 <arg name="fd" type="fd"/>
221 <!-- Another selection became active. -->
222 <event name="cancelled"/>
225 <interface name="selection_offer" version="1">
226 <!-- Called to receive the selection data as the specified type.
227 Sends the pipe fd to the compositor, which forwards it to the
228 source in the 'send' event -->
229 <request name="receive">
230 <arg name="mime_type" type="string"/>
231 <arg name="fd" type="fd"/>
234 <!-- Sent before the keyboard_focus event to announce the types
235 offered. One event per offered mime type. A mime type of
236 NULL means the selection offer is going away. -->
238 <arg name="type" type="string"/>
241 <event name="keyboard_focus">
242 <arg name="input_device" type="object" interface="input_device"/>
246 <interface name="drag" version="1">
247 <!-- Add an offered mime type. Can be called several times to
248 offer multiple types, but must be called before 'activate'. -->
249 <request name="offer">
250 <arg name="type" type="string"/>
253 <request name="activate">
254 <arg name="surface" type="object" interface="surface"/>
255 <arg name="input_device" type="object" interface="input_device"/>
256 <arg name="time" type="uint"/>
259 <!-- Destroy the drag and cancel the session. -->
260 <request name="destroy" type="destructor"/>
262 <!-- Sent when a target accepts pointer_focus or motion events.
263 If a target does not accept any of the offered types, type is
265 <event name="target">
266 <arg name="mime_type" type="string"/>
269 <!-- Sent when the drag is finished. The final mime type is that
270 of the last target event. If that was NULL, no drag target
271 was valid when the drag finished, fd is undefined and the
272 source should not send data. The event is also sent in case
273 a drag source tries to activate a drag after the grab was
274 released, in which case mime_type will also be NULL. -->
275 <event name="finish">
276 <arg name="fd" type="fd"/>
279 <event name="reject"/>
283 <interface name="drag_offer" version="1">
284 <!-- Call to accept the offer of the given type -->
285 <request name="accept">
286 <arg name="time" type="uint"/>
287 <arg name="type" type="string"/>
290 <!-- Called to initiate the drag finish sequence. Sends the pipe
291 fd to the compositor, which forwards it to the source in the
293 <request name="receive">
294 <arg name="fd" type="fd"/>
297 <!-- Called to reject a drop -->
298 <request name="reject"/>
300 <!-- Sent before the pointer_focus event to announce the types
301 offered. One event per offered mime type. -->
303 <arg name="type" type="string"/>
306 <!-- Similar to device::pointer_focus. Sent to potential target
307 surfaces to offer drag data. If the device leaves the
308 window, the drag stops or the originator cancels the drag,
309 this event is sent with the NULL surface, at which point the
310 drag object may no longer be valid. -->
311 <event name="pointer_focus">
312 <arg name="time" type="uint"/>
313 <arg name="surface" type="object" interface="surface"/>
314 <arg name="x" type="int"/>
315 <arg name="y" type="int"/>
316 <arg name="surface_x" type="int"/>
317 <arg name="surface_y" type="int"/>
320 <!-- Similar to device::motion. Sent to potential target surfaces
321 as the drag pointer moves around in the surface. -->
322 <event name="motion">
323 <arg name="time" type="uint"/>
324 <arg name="x" type="int"/>
325 <arg name="y" type="int"/>
326 <arg name="surface_x" type="int"/>
327 <arg name="surface_y" type="int"/>
330 <!-- Sent to indicate that the drag is finishing. The last
331 motion/pointer_focus event gives the location of the drop.
332 Target must respond with the 'receive' request, which sends
333 an fd to the source for writing the drag data. -->
338 <!-- A surface. This is an image that is displayed on the screen.
339 It has a location, size and pixel contents. Similar to a window. -->
340 <interface name="surface" version="1">
341 <!-- Deletes the surface and invalidates its object id. -->
342 <request name="destroy" type="destructor"/>
344 <!-- Copy the contents of a buffer into this surface. The x and y
345 arguments specify the location of the new buffers upper left
346 corner, relative to the old buffers upper left corner. -->
347 <request name="attach">
348 <arg name="buffer" type="object" interface="buffer"/>
349 <arg name="x" type="int"/>
350 <arg name="y" type="int"/>
353 <!-- Make the surface visible as a toplevel window. -->
354 <request name="map_toplevel"/>
356 <!-- Map the surface relative to an existing surface. The x and y
357 arguments specify the locations of the upper left corner of
358 the surface relative to the upper left corner of the parent
359 surface. The flags argument controls overflow/clipping
360 behaviour when the surface would intersect a screen edge,
361 panel or such. And possibly whether the offset only
362 determines the initial position or if the surface is locked
363 to that relative position during moves. -->
364 <request name="map_transient">
365 <arg name="parent" type="object" interface="surface"/>
366 <arg name="x" type="int"/>
367 <arg name="y" type="int"/>
368 <arg name="flags" type="uint"/>
371 <!-- Map the surface as a fullscreen surface. There are a number
372 of options here: on which output? if the surface size doesn't
373 match the output size, do we scale, change resolution, or add
374 black borders? is that something the client controls? what
375 about transient surfaces, do they float on top of the
376 fullscreen? what if there's already a fullscreen surface on
377 the output, maybe you can only go fullscreen if you're
379 <request name="map_fullscreen"/>
381 <!-- Notify the server that the attached buffer's contents have
382 changed, and request a redraw. The arguments allow you to
383 damage only a part of the surface, but the server may ignore
384 it and redraw the entire contents of the surface. To
385 describe a more complicated area of damage, use this request
387 <request name="damage">
388 <arg name="x" type="int"/>
389 <arg name="y" type="int"/>
390 <arg name="width" type="int"/>
391 <arg name="height" type="int"/>
396 <!-- A group of keyboards and pointer devices (mice, for
397 example). This object is published as a global during start up,
398 or when such a device is hot plugged. A input_device group
399 typically has a pointer and maintains a keyboard_focus and a
401 <interface name="input_device" version="1">
402 <!-- Set the pointer's image. This request only takes effect if
403 the pointer focus for this device is one of the requesting
404 clients surfaces. -->
405 <request name="attach">
406 <arg name="time" type="uint"/>
407 <arg name="buffer" type="object" interface="buffer"/>
408 <arg name="hotspot_x" type="int"/>
409 <arg name="hotspot_y" type="int"/>
412 <!-- Notification of pointer location change.
413 x,y are the absolute location on the screen.
414 surface_[xy] are the location relative to the focused surface. -->
415 <event name="motion">
416 <arg name="time" type="uint"/>
417 <arg name="x" type="int"/>
418 <arg name="y" type="int"/>
419 <arg name="surface_x" type="int"/>
420 <arg name="surface_y" type="int"/>
423 <!-- Mouse button click and release notifications. The location
424 of the click is given by the last motion or pointer_focus
426 <event name="button">
427 <arg name="time" type="uint"/>
428 <arg name="button" type="uint"/>
429 <arg name="state" type="uint"/>
432 <!-- Keyboard press. -->
434 <arg name="time" type="uint"/>
435 <arg name="key" type="uint"/>
436 <arg name="state" type="uint"/>
439 <!-- Notification that this input device's pointer is focused on
440 certain surface. When an input_device enters a surface, the
441 pointer image is undefined and a client should respond to
442 this event by setting an apropriate pointer image. -->
443 <event name="pointer_focus">
444 <arg name="time" type="uint"/>
445 <arg name="surface" type="object" interface="surface"/>
446 <arg name="x" type="int"/>
447 <arg name="y" type="int"/>
448 <arg name="surface_x" type="int"/>
449 <arg name="surface_y" type="int"/>
452 <event name="keyboard_focus">
453 <arg name="time" type="uint"/>
454 <arg name="surface" type="object" interface="surface"/>
455 <arg name="keys" type="array"/>
460 <!-- An output describes part of the compositor geometry. The
461 compositor work in the 'compositor coordinate system' and an
462 output corresponds to rectangular area in that space that is
463 actually visible. This typically corresponds to a monitor that
464 displays part of the compositor space. This object is
465 published as global during start up, or when a screen is hot
467 <interface name="output" version="1">
468 <!-- Notification about the screen size. -->
469 <event name="geometry">
470 <arg name="x" type="int"/>
471 <arg name="y" type="int"/>
472 <arg name="width" type="int"/>
473 <arg name="height" type="int"/>
478 <!-- A visual is the pixel format. The different visuals are
479 currently only identified by the order they are advertised by
480 the 'global' events. We need something better. -->
481 <interface name="visual" version="1"/>