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">
8 <arg name="id" type="uint"/>
9 <arg name="interface" type="string"/>
10 <arg name="version" type="uint"/>
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
19 <arg name="key" type="uint"/>
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="surface"/>
28 <arg name="key" type="uint"/>
31 <!-- A request addressed a non-existent object id. This is
32 tyipcally a fatal error. -->
33 <event name="invalid_object">
34 <arg name="object_id" type="uint"/>
37 <!-- A request tried to invoke an opcode out of range. This is
38 typically a fatal error. -->
39 <event name="invalid_method">
40 <arg name="object_id" type="uint"/>
41 <arg name="opcode" type="uint"/>
44 <!-- A request has failed due to an out of memory error. -->
45 <event name="no_memory"/>
47 <!-- Notify the client of global objects. These are objects that
48 are created by the server. Globals are published on the
49 initial client connection sequence, upon device hotplugs,
50 device disconnects, reconfiguration or other events. The
51 server will always announce an object before the object sends
54 <arg name="id" type="new_id" interface="object"/>
55 <arg name="name" type="string"/>
56 <arg name="version" type="uint"/>
59 <!-- Internal, deprecated, and will be changed. This is an object
60 IDs range that is used by the client to allocate object IDs
61 in "new_id" type arguments. The server sends range
62 allocations to the client before the next range is about to
65 <arg name="base" type="uint"/>
68 <!-- A reply to the frame or sync request. The key is the one
69 used in the request. time is in millisecond units, and
70 denotes the time when the frame was posted on the
71 display. time can be used to estimaate frame rate, determine
72 how much to advance animations and compensate for jitter. -->
74 <arg name="key" type="uint"/>
75 <arg name="time" type="uint"/>
80 <!-- A compositor. This object is a global. The compositor is in
81 charge of combining the contents of multiple surfaces into one
82 displayable output. -->
83 <interface name="compositor" version="1">
84 <!-- Factory request for a surface objects. A surface is akin to a
86 <request name="create_surface">
87 <arg name="id" type="new_id" interface="surface"/>
92 <!-- Shared memory support -->
93 <interface name="shm" version="1">
94 <!-- Transfer a shm buffer to the server. The allocated buffer
95 would include at least stride * height bytes starting at the
96 beginning of fd. The file descriptor is transferred over the
97 socket using AF_UNIX magical features. width, height, stride
98 and visual describe the respective properties of the pixel
99 data contained in the buffer. -->
100 <request name="create_buffer">
101 <arg name="id" type="new_id" interface="buffer"/>
102 <arg name="fd" type="fd"/>
103 <arg name="width" type="int"/>
104 <arg name="height" type="int"/>
105 <arg name="stride" type="uint"/>
106 <arg name="visual" type="object" interface="visual"/>
111 <!-- A pixel buffer. Created using the drm, shm or similar objects.
112 It has a size, visual and contents, but not a location on the
114 <interface name="buffer" version="1">
115 <!-- Abandon a buffer. This will invalidate the object id. -->
116 <request name="destroy" type="destructor"/>
119 <interface name="shell" version="1">
120 <request name="move">
121 <arg name="surface" type="object" interface="surface"/>
122 <arg name="input_device" type="object" interface="input_device"/>
123 <arg name="time" type="uint"/>
127 <entry name="none" value="0"/>
128 <entry name="top" value="1"/>
129 <entry name="bottom" value="2"/>
130 <entry name="left" value="4"/>
131 <entry name="top_left" value="5"/>
132 <entry name="bottom_left" value="6"/>
133 <entry name="right" value="8"/>
134 <entry name="top_right" value="9"/>
135 <entry name="bottom_right" value="10"/>
138 <request name="resize">
139 <arg name="surface" type="object" interface="surface"/>
140 <arg name="input_device" type="object" interface="input_device"/>
141 <arg name="time" type="uint"/>
142 <!-- edges is an enum, need to get the values in here -->
143 <arg name="edges" type="uint"/>
146 <request name="create_drag">
147 <arg name="id" type="new_id" interface="drag"/>
150 <request name="create_selection">
151 <arg name="id" type="new_id" interface="selection"/>
154 <!-- The configure event asks the client to resize its surface.
155 The size is a hint, in the sense that the client is free to
156 ignore it if it doesn't resize, pick a smaller size (to
157 satisfy aspect ration or resize in steps of NxM pixels). The
158 client is free to dismiss all but the last configure event it
160 <event name="configure">
161 <arg name="time" type="uint"/>
162 <arg name="edges" type="uint"/>
163 <arg name="surface" type="object" interface="surface"/>
164 <arg name="width" type="int"/>
165 <arg name="height" type="int"/>
169 <interface name="selection" version="1">
170 <!-- Add an offered mime type. Can be called several times to
171 offer multiple types, but must be called before 'activate'. -->
172 <request name="offer">
173 <arg name="type" type="string"/>
176 <!-- Can the selection be activated for multiple devices? -->
177 <request name="activate">
178 <arg name="input_device" type="object" interface="input_device"/>
179 <arg name="time" type="uint"/>
182 <!-- Destroy the selection. -->
183 <request name="destroy" type="destructor"/>
185 <!-- Another client pasted the selection, send the mime-type over
188 <arg name="mime_type" type="string"/>
189 <arg name="fd" type="fd"/>
192 <!-- Another selection became active. -->
193 <event name="cancelled"/>
196 <interface name="selection_offer" version="1">
197 <!-- Called to receive the selection data as the specified type.
198 Sends the pipe fd to the compositor, which forwards it to the
199 source in the 'send' event -->
200 <request name="receive">
201 <arg name="mime_type" type="string"/>
202 <arg name="fd" type="fd"/>
205 <!-- Sent before the keyboard_focus event to announce the types
206 offered. One event per offered mime type. A mime type of
207 NULL means the selection offer is going away. -->
209 <arg name="type" type="string"/>
212 <event name="keyboard_focus">
213 <arg name="input_device" type="object" interface="input_device"/>
217 <interface name="drag" version="1">
218 <!-- Add an offered mime type. Can be called several times to
219 offer multiple types, but must be called before 'activate'. -->
220 <request name="offer">
221 <arg name="type" type="string"/>
224 <request name="activate">
225 <arg name="surface" type="object" interface="surface"/>
226 <arg name="input_device" type="object" interface="input_device"/>
227 <arg name="time" type="uint"/>
230 <!-- Destroy the drag and cancel the session. -->
231 <request name="destroy" type="destructor"/>
233 <!-- Sent when a target accepts pointer_focus or motion events.
234 If a target does not accept any of the offered types, type is
236 <event name="target">
237 <arg name="mime_type" type="string"/>
240 <!-- Sent when the drag is finished. The final mime type is that
241 of the last target event. If that was NULL, no drag target
242 was valid when the drag finished, fd is undefined and the
243 source should not send data. The event is also sent in case
244 a drag source tries to activate a drag after the grab was
245 released, in which case mime_type will also be NULL. -->
246 <event name="finish">
247 <arg name="fd" type="fd"/>
250 <event name="reject"/>
254 <interface name="drag_offer" version="1">
255 <!-- Call to accept the offer of the given type -->
256 <request name="accept">
257 <arg name="time" type="uint"/>
258 <arg name="type" type="string"/>
261 <!-- Called to initiate the drag finish sequence. Sends the pipe
262 fd to the compositor, which forwards it to the source in the
264 <request name="receive">
265 <arg name="fd" type="fd"/>
268 <!-- Called to reject a drop -->
269 <request name="reject"/>
271 <!-- Sent before the pointer_focus event to announce the types
272 offered. One event per offered mime type. -->
274 <arg name="type" type="string"/>
277 <!-- Similar to device::pointer_focus. Sent to potential target
278 surfaces to offer drag data. If the device leaves the
279 window, the drag stops or the originator cancels the drag,
280 this event is sent with the NULL surface, at which point the
281 drag object may no longer be valid. -->
282 <event name="pointer_focus">
283 <arg name="time" type="uint"/>
284 <arg name="surface" type="object" interface="surface"/>
285 <arg name="x" type="int"/>
286 <arg name="y" type="int"/>
287 <arg name="surface_x" type="int"/>
288 <arg name="surface_y" type="int"/>
291 <!-- Similar to device::motion. Sent to potential target surfaces
292 as the drag pointer moves around in the surface. -->
293 <event name="motion">
294 <arg name="time" type="uint"/>
295 <arg name="x" type="int"/>
296 <arg name="y" type="int"/>
297 <arg name="surface_x" type="int"/>
298 <arg name="surface_y" type="int"/>
301 <!-- Sent to indicate that the drag is finishing. The last
302 motion/pointer_focus event gives the location of the drop.
303 Target must respond with the 'receive' request, which sends
304 an fd to the source for writing the drag data. -->
309 <!-- A surface. This is an image that is displayed on the screen.
310 It has a location, size and pixel contents. Similar to a window. -->
311 <interface name="surface" version="1">
312 <!-- Deletes the surface and invalidates its object id. -->
313 <request name="destroy" type="destructor"/>
315 <!-- Copy the contents of a buffer into this surface. The x and y
316 arguments specify the location of the new buffers upper left
317 corner, relative to the old buffers upper left corner. -->
318 <request name="attach">
319 <arg name="buffer" type="object" interface="buffer"/>
320 <arg name="x" type="int"/>
321 <arg name="y" type="int"/>
324 <!-- Make the surface visible as a toplevel window. -->
325 <request name="map_toplevel"/>
327 <!-- Map the surface relative to an existing surface. The x and y
328 arguments specify the locations of the upper left corner of
329 the surface relative to the upper left corner of the parent
330 surface. The flags argument controls overflow/clipping
331 behaviour when the surface would intersect a screen edge,
332 panel or such. And possibly whether the offset only
333 determines the initial position or if the surface is locked
334 to that relative position during moves. -->
335 <request name="map_transient">
336 <arg name="parent" type="object" interface="surface"/>
337 <arg name="x" type="int"/>
338 <arg name="y" type="int"/>
339 <arg name="flags" type="uint"/>
342 <!-- Map the surface as a fullscreen surface. There are a number
343 of options here: on which output? if the surface size doesn't
344 match the output size, do we scale, change resolution, or add
345 black borders? is that something the client controls? what
346 about transient surfaces, do they float on top of the
347 fullscreen? what if there's already a fullscreen surface on
348 the output, maybe you can only go fullscreen if you're
350 <request name="map_fullscreen"/>
352 <!-- Notify the server that the attached buffer's contents have
353 changed, and request a redraw. The arguments allow you to
354 damage only a part of the surface, but the server may ignore
355 it and redraw the entire contents of the surface. To
356 describe a more complicated area of damage, use this request
358 <request name="damage">
359 <arg name="x" type="int"/>
360 <arg name="y" type="int"/>
361 <arg name="width" type="int"/>
362 <arg name="height" type="int"/>
367 <!-- A group of keyboards and pointer devices (mice, for
368 example). This object is published as a global during start up,
369 or when such a device is hot plugged. A input_device group
370 typically has a pointer and maintains a keyboard_focus and a
372 <interface name="input_device" version="1">
373 <!-- Set the pointer's image. This request only takes effect if
374 the pointer focus for this device is one of the requesting
375 clients surfaces. -->
376 <request name="attach">
377 <arg name="time" type="uint"/>
378 <arg name="buffer" type="object" interface="buffer"/>
379 <arg name="hotspot_x" type="int"/>
380 <arg name="hotspot_y" type="int"/>
383 <!-- Notification of pointer location change.
384 x,y are the absolute location on the screen.
385 surface_[xy] are the location relative to the focused surface. -->
386 <event name="motion">
387 <arg name="time" type="uint"/>
388 <arg name="x" type="int"/>
389 <arg name="y" type="int"/>
390 <arg name="surface_x" type="int"/>
391 <arg name="surface_y" type="int"/>
394 <!-- Mouse button click and release notifications. The location
395 of the click is given by the last motion or pointer_focus
397 <event name="button">
398 <arg name="time" type="uint"/>
399 <arg name="button" type="uint"/>
400 <arg name="state" type="uint"/>
403 <!-- Keyboard press. -->
405 <arg name="time" type="uint"/>
406 <arg name="key" type="uint"/>
407 <arg name="state" type="uint"/>
410 <!-- Notification that this input device's pointer is focused on
411 certain surface. When an input_device enters a surface, the
412 pointer image is undefined and a client should respond to
413 this event by setting an apropriate pointer image. -->
414 <event name="pointer_focus">
415 <arg name="time" type="uint"/>
416 <arg name="surface" type="object" interface="surface"/>
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 <event name="keyboard_focus">
424 <arg name="time" type="uint"/>
425 <arg name="surface" type="object" interface="surface"/>
426 <arg name="keys" type="array"/>
431 <!-- An output describes part of the compositor geometry. The
432 compositor work in the 'compositor coordinate system' and an
433 output corresponds to rectangular area in that space that is
434 actually visible. This typically corresponds to a monitor that
435 displays part of the compositor space. This object is
436 published as global during start up, or when a screen is hot
438 <interface name="output" version="1">
439 <!-- Notification about the screen size. -->
440 <event name="geometry">
441 <arg name="x" type="int"/>
442 <arg name="y" type="int"/>
443 <arg name="width" type="int"/>
444 <arg name="height" type="int"/>
449 <!-- A visual is the pixel format. The different visuals are
450 currently only identified by the order they are advertised by
451 the 'global' events. We need something better. -->
452 <interface name="visual" version="1"/>