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="wl_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="wl_surface"/>
28 <arg name="key" type="uint"/>
31 <!-- A fatal error has occurred. -->
33 <arg name="object_id" type="object" interface="wl_object"/>
34 <arg name="code" type="uint"/>
35 <arg name="message" type="string"/>
39 <entry name="invalid_object" value="0"/>
40 <entry name="invalid_method" value="1"/>
41 <entry name="no_memory" value="2"/>
44 <!-- Notify the client of global objects. These are objects that
45 are created by the server. Globals are published on the
46 initial client connection sequence, upon device hotplugs,
47 device disconnects, reconfiguration or other events. The
48 server will always announce an object before the object sends
51 <arg name="id" type="new_id" interface="wl_object"/>
52 <arg name="name" type="string"/>
53 <arg name="version" type="uint"/>
56 <!-- Internal, deprecated, and will be changed. This is an object
57 IDs range that is used by the client to allocate object IDs
58 in "new_id" type arguments. The server sends range
59 allocations to the client before the next range is about to
62 <arg name="base" type="uint"/>
65 <!-- A reply to the frame or sync request. The key is the one
66 used in the request. time is in millisecond units, and
67 denotes the time when the frame was posted on the
68 display. time can be used to estimaate frame rate, determine
69 how much to advance animations and compensate for jitter. -->
71 <arg name="key" type="uint"/>
72 <arg name="time" type="uint"/>
77 <!-- A compositor. This object is a global. The compositor is in
78 charge of combining the contents of multiple surfaces into one
79 displayable output. -->
80 <interface name="wl_compositor" version="1">
81 <!-- Factory request for a surface objects. A surface is akin to a
83 <request name="create_surface">
84 <arg name="id" type="new_id" interface="wl_surface"/>
88 <entry name="argb32" value="0"/>
89 <entry name="premultiplied_argb32" value="1"/>
90 <entry name="xrgb32" value="2"/>
93 <event name="token_visual">
94 <arg name="id" type="new_id" interface="wl_object"/>
95 <arg name="token" type="uint"/>
99 <!-- Shared memory support -->
100 <interface name="wl_shm" version="1">
102 <entry name="invalid_visual" value="0"/>
103 <entry name="invalid_stride" value="1"/>
104 <entry name="invalid_fd" value="2"/>
107 <!-- Transfer a shm buffer to the server. The allocated buffer
108 would include at least stride * height bytes starting at the
109 beginning of fd. The file descriptor is transferred over the
110 socket using AF_UNIX magical features. width, height, stride
111 and visual describe the respective properties of the pixel
112 data contained in the buffer. -->
113 <request name="create_buffer">
114 <arg name="id" type="new_id" interface="wl_buffer"/>
115 <arg name="fd" type="fd"/>
116 <arg name="width" type="int"/>
117 <arg name="height" type="int"/>
118 <arg name="stride" type="uint"/>
119 <arg name="visual" type="object" interface="wl_visual"/>
124 <!-- A pixel buffer. Created using the drm, shm or similar objects.
125 It has a size, visual and contents, but not a location on the
127 <interface name="wl_buffer" version="1">
128 <!-- Notify the server that the specified area of the buffers
129 contents have changed. To describe a more complicated area
130 of damage, break down the region into rectangles and use this
131 request several times.
133 <request name="damage">
134 <arg name="x" type="int"/>
135 <arg name="y" type="int"/>
136 <arg name="width" type="int"/>
137 <arg name="height" type="int"/>
140 <!-- Destroy a buffer. This will invalidate the object id. -->
141 <request name="destroy" type="destructor"/>
144 <interface name="wl_shell" version="1">
145 <request name="move">
146 <arg name="surface" type="object" interface="wl_surface"/>
147 <arg name="input_device" type="object" interface="wl_input_device"/>
148 <arg name="time" type="uint"/>
152 <entry name="none" value="0"/>
153 <entry name="top" value="1"/>
154 <entry name="bottom" value="2"/>
155 <entry name="left" value="4"/>
156 <entry name="top_left" value="5"/>
157 <entry name="bottom_left" value="6"/>
158 <entry name="right" value="8"/>
159 <entry name="top_right" value="9"/>
160 <entry name="bottom_right" value="10"/>
163 <request name="resize">
164 <arg name="surface" type="object" interface="wl_surface"/>
165 <arg name="input_device" type="object" interface="wl_input_device"/>
166 <arg name="time" type="uint"/>
167 <!-- edges is an enum, need to get the values in here -->
168 <arg name="edges" type="uint"/>
171 <request name="create_drag">
172 <arg name="id" type="new_id" interface="wl_drag"/>
175 <request name="create_selection">
176 <arg name="id" type="new_id" interface="wl_selection"/>
179 <!-- The configure event asks the client to resize its surface.
180 The size is a hint, in the sense that the client is free to
181 ignore it if it doesn't resize, pick a smaller size (to
182 satisfy aspect ration or resize in steps of NxM pixels). The
183 client is free to dismiss all but the last configure event it
185 <event name="configure">
186 <arg name="time" type="uint"/>
187 <arg name="edges" type="uint"/>
188 <arg name="surface" type="object" interface="wl_surface"/>
189 <arg name="width" type="int"/>
190 <arg name="height" type="int"/>
194 <interface name="wl_selection" version="1">
195 <!-- Add an offered mime type. Can be called several times to
196 offer multiple types, but must be called before 'activate'. -->
197 <request name="offer">
198 <arg name="type" type="string"/>
201 <!-- Can the selection be activated for multiple devices? -->
202 <request name="activate">
203 <arg name="input_device" type="object" interface="wl_input_device"/>
204 <arg name="time" type="uint"/>
207 <!-- Destroy the selection. -->
208 <request name="destroy" type="destructor"/>
210 <!-- Another client pasted the selection, send the mime-type over
213 <arg name="mime_type" type="string"/>
214 <arg name="fd" type="fd"/>
217 <!-- Another selection became active. -->
218 <event name="cancelled"/>
221 <interface name="wl_selection_offer" version="1">
222 <!-- Called to receive the selection data as the specified type.
223 Sends the pipe fd to the compositor, which forwards it to the
224 source in the 'send' event -->
225 <request name="receive">
226 <arg name="mime_type" type="string"/>
227 <arg name="fd" type="fd"/>
230 <!-- Sent before the keyboard_focus event to announce the types
231 offered. One event per offered mime type. A mime type of
232 NULL means the selection offer is going away. -->
234 <arg name="type" type="string"/>
237 <event name="keyboard_focus">
238 <arg name="input_device" type="object" interface="wl_input_device"/>
242 <interface name="wl_drag" version="1">
243 <!-- Add an offered mime type. Can be called several times to
244 offer multiple types, but must be called before 'activate'. -->
245 <request name="offer">
246 <arg name="type" type="string"/>
249 <request name="activate">
250 <arg name="surface" type="object" interface="wl_surface"/>
251 <arg name="input_device" type="object" interface="wl_input_device"/>
252 <arg name="time" type="uint"/>
255 <!-- Destroy the drag and cancel the session. -->
256 <request name="destroy" type="destructor"/>
258 <!-- Sent when a target accepts pointer_focus or motion events.
259 If a target does not accept any of the offered types, type is
261 <event name="target">
262 <arg name="mime_type" type="string"/>
265 <!-- Sent when the drag is finished. The final mime type is that
266 of the last target event. If that was NULL, no drag target
267 was valid when the drag finished, fd is undefined and the
268 source should not send data. The event is also sent in case
269 a drag source tries to activate a drag after the grab was
270 released, in which case mime_type will also be NULL. -->
271 <event name="finish">
272 <arg name="fd" type="fd"/>
275 <event name="reject"/>
279 <interface name="wl_drag_offer" version="1">
280 <!-- Call to accept the offer of the given type -->
281 <request name="accept">
282 <arg name="time" type="uint"/>
283 <arg name="type" type="string"/>
286 <!-- Called to initiate the drag finish sequence. Sends the pipe
287 fd to the compositor, which forwards it to the source in the
289 <request name="receive">
290 <arg name="fd" type="fd"/>
293 <!-- Called to reject a drop -->
294 <request name="reject"/>
296 <!-- Sent before the pointer_focus event to announce the types
297 offered. One event per offered mime type. -->
299 <arg name="type" type="string"/>
302 <!-- Similar to device::pointer_focus. Sent to potential target
303 surfaces to offer drag data. If the device leaves the
304 window, the drag stops or the originator cancels the drag,
305 this event is sent with the NULL surface, at which point the
306 drag object may no longer be valid. -->
307 <event name="pointer_focus">
308 <arg name="time" type="uint"/>
309 <arg name="surface" type="object" interface="wl_surface"/>
310 <arg name="x" type="int"/>
311 <arg name="y" type="int"/>
312 <arg name="surface_x" type="int"/>
313 <arg name="surface_y" type="int"/>
316 <!-- Similar to device::motion. Sent to potential target surfaces
317 as the drag pointer moves around in the surface. -->
318 <event name="motion">
319 <arg name="time" type="uint"/>
320 <arg name="x" type="int"/>
321 <arg name="y" type="int"/>
322 <arg name="surface_x" type="int"/>
323 <arg name="surface_y" type="int"/>
326 <!-- Sent to indicate that the drag is finishing. The last
327 motion/pointer_focus event gives the location of the drop.
328 Target must respond with the 'receive' request, which sends
329 an fd to the source for writing the drag data. -->
334 <!-- A surface. This is an image that is displayed on the screen.
335 It has a location, size and pixel contents. Similar to a window. -->
336 <interface name="wl_surface" version="1">
337 <!-- Deletes the surface and invalidates its object id. -->
338 <request name="destroy" type="destructor"/>
340 <!-- Copy the contents of a buffer into this surface. The x and y
341 arguments specify the location of the new buffers upper left
342 corner, relative to the old buffers upper left corner. -->
343 <request name="attach">
344 <arg name="buffer" type="object" interface="wl_buffer"/>
345 <arg name="x" type="int"/>
346 <arg name="y" type="int"/>
349 <!-- Make the surface visible as a toplevel window. -->
350 <request name="map_toplevel"/>
352 <!-- Map the surface relative to an existing surface. The x and y
353 arguments specify the locations of the upper left corner of
354 the surface relative to the upper left corner of the parent
355 surface. The flags argument controls overflow/clipping
356 behaviour when the surface would intersect a screen edge,
357 panel or such. And possibly whether the offset only
358 determines the initial position or if the surface is locked
359 to that relative position during moves. -->
360 <request name="map_transient">
361 <arg name="parent" type="object" interface="wl_surface"/>
362 <arg name="x" type="int"/>
363 <arg name="y" type="int"/>
364 <arg name="flags" type="uint"/>
367 <!-- Map the surface as a fullscreen surface. There are a number
368 of options here: on which output? if the surface size doesn't
369 match the output size, do we scale, change resolution, or add
370 black borders? is that something the client controls? what
371 about transient surfaces, do they float on top of the
372 fullscreen? what if there's already a fullscreen surface on
373 the output, maybe you can only go fullscreen if you're
375 <request name="map_fullscreen"/>
377 <!-- After attaching a new buffer, this request is used to
378 describe the regions where the new buffer is different from
379 the previous buffer and needs to be repainted. Coordinates
380 are relative to the new buffer. -->
381 <request name="damage">
382 <arg name="x" type="int"/>
383 <arg name="y" type="int"/>
384 <arg name="width" type="int"/>
385 <arg name="height" type="int"/>
390 <!-- A group of keyboards and pointer devices (mice, for
391 example). This object is published as a global during start up,
392 or when such a device is hot plugged. A input_device group
393 typically has a pointer and maintains a keyboard_focus and a
395 <interface name="wl_input_device" version="1">
396 <!-- Set the pointer's image. This request only takes effect if
397 the pointer focus for this device is one of the requesting
398 clients surfaces. -->
399 <request name="attach">
400 <arg name="time" type="uint"/>
401 <arg name="buffer" type="object" interface="wl_buffer"/>
402 <arg name="hotspot_x" type="int"/>
403 <arg name="hotspot_y" type="int"/>
406 <!-- Notification of pointer location change.
407 x,y are the absolute location on the screen.
408 surface_[xy] are the location relative to the focused surface. -->
409 <event name="motion">
410 <arg name="time" type="uint"/>
411 <arg name="x" type="int"/>
412 <arg name="y" type="int"/>
413 <arg name="surface_x" type="int"/>
414 <arg name="surface_y" type="int"/>
417 <!-- Mouse button click and release notifications. The location
418 of the click is given by the last motion or pointer_focus
420 <event name="button">
421 <arg name="time" type="uint"/>
422 <arg name="button" type="uint"/>
423 <arg name="state" type="uint"/>
426 <!-- Keyboard press. -->
428 <arg name="time" type="uint"/>
429 <arg name="key" type="uint"/>
430 <arg name="state" type="uint"/>
433 <!-- Notification that this input device's pointer is focused on
434 certain surface. When an input_device enters a surface, the
435 pointer image is undefined and a client should respond to
436 this event by setting an apropriate pointer image. -->
437 <event name="pointer_focus">
438 <arg name="time" type="uint"/>
439 <arg name="surface" type="object" interface="wl_surface"/>
440 <arg name="x" type="int"/>
441 <arg name="y" type="int"/>
442 <arg name="surface_x" type="int"/>
443 <arg name="surface_y" type="int"/>
446 <event name="keyboard_focus">
447 <arg name="time" type="uint"/>
448 <arg name="surface" type="object" interface="wl_surface"/>
449 <arg name="keys" type="array"/>
454 <!-- An output describes part of the compositor geometry. The
455 compositor work in the 'compositor coordinate system' and an
456 output corresponds to rectangular area in that space that is
457 actually visible. This typically corresponds to a monitor that
458 displays part of the compositor space. This object is
459 published as global during start up, or when a screen is hot
461 <interface name="wl_output" version="1">
462 <!-- Notification about the screen size. -->
463 <event name="geometry">
464 <arg name="x" type="int"/>
465 <arg name="y" type="int"/>
466 <arg name="width" type="int"/>
467 <arg name="height" type="int"/>
472 <!-- A visual is the pixel format. The different visuals are
473 currently only identified by the order they are advertised by
474 the 'global' events. We need something better. -->
475 <interface name="wl_visual" version="1"/>