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 <!-- Notify the client of removed global objects. -->
57 <event name="global_remove">
58 <arg name="id" type="uint" />
61 <!-- Internal, deprecated, and will be changed. This is an object
62 IDs range that is used by the client to allocate object IDs
63 in "new_id" type arguments. The server sends range
64 allocations to the client before the next range is about to
67 <arg name="base" type="uint"/>
70 <!-- A reply to the frame or sync request. The key is the one
71 used in the request. time is in millisecond units, and
72 denotes the time when the frame was posted on the
73 display. time can be used to estimaate frame rate, determine
74 how much to advance animations and compensate for jitter. -->
76 <arg name="key" type="uint"/>
77 <arg name="time" type="uint"/>
82 <!-- A compositor. This object is a global. The compositor is in
83 charge of combining the contents of multiple surfaces into one
84 displayable output. -->
85 <interface name="wl_compositor" version="1">
86 <!-- Factory request for a surface objects. A surface is akin to a
88 <request name="create_surface">
89 <arg name="id" type="new_id" interface="wl_surface"/>
93 <entry name="argb32" value="0"/>
94 <entry name="premultiplied_argb32" value="1"/>
95 <entry name="xrgb32" value="2"/>
98 <event name="token_visual">
99 <arg name="id" type="new_id" interface="wl_object"/>
100 <arg name="token" type="uint"/>
104 <!-- Shared memory support -->
105 <interface name="wl_shm" version="1">
107 <entry name="invalid_visual" value="0"/>
108 <entry name="invalid_stride" value="1"/>
109 <entry name="invalid_fd" value="2"/>
112 <!-- Transfer a shm buffer to the server. The allocated buffer
113 would include at least stride * height bytes starting at the
114 beginning of fd. The file descriptor is transferred over the
115 socket using AF_UNIX magical features. width, height, stride
116 and visual describe the respective properties of the pixel
117 data contained in the buffer. -->
118 <request name="create_buffer">
119 <arg name="id" type="new_id" interface="wl_buffer"/>
120 <arg name="fd" type="fd"/>
121 <arg name="width" type="int"/>
122 <arg name="height" type="int"/>
123 <arg name="stride" type="uint"/>
124 <arg name="visual" type="object" interface="wl_visual"/>
129 <!-- A pixel buffer. Created using the drm, shm or similar objects.
130 It has a size, visual and contents, but not a location on the
132 <interface name="wl_buffer" version="1">
133 <!-- Notify the server that the specified area of the buffers
134 contents have changed. To describe a more complicated area
135 of damage, break down the region into rectangles and use this
136 request several times.
138 <request name="damage">
139 <arg name="x" type="int"/>
140 <arg name="y" type="int"/>
141 <arg name="width" type="int"/>
142 <arg name="height" type="int"/>
145 <!-- Destroy a buffer. This will invalidate the object id. -->
146 <request name="destroy" type="destructor"/>
149 <interface name="wl_shell" version="1">
150 <request name="move">
151 <arg name="surface" type="object" interface="wl_surface"/>
152 <arg name="input_device" type="object" interface="wl_input_device"/>
153 <arg name="time" type="uint"/>
157 <entry name="none" value="0"/>
158 <entry name="top" value="1"/>
159 <entry name="bottom" value="2"/>
160 <entry name="left" value="4"/>
161 <entry name="top_left" value="5"/>
162 <entry name="bottom_left" value="6"/>
163 <entry name="right" value="8"/>
164 <entry name="top_right" value="9"/>
165 <entry name="bottom_right" value="10"/>
168 <request name="resize">
169 <arg name="surface" type="object" interface="wl_surface"/>
170 <arg name="input_device" type="object" interface="wl_input_device"/>
171 <arg name="time" type="uint"/>
172 <!-- edges is an enum, need to get the values in here -->
173 <arg name="edges" type="uint"/>
176 <request name="create_drag">
177 <arg name="id" type="new_id" interface="wl_drag"/>
180 <request name="create_selection">
181 <arg name="id" type="new_id" interface="wl_selection"/>
184 <!-- Make the surface visible as a toplevel window. -->
185 <request name="set_toplevel">
186 <arg name="surface" type="object" interface="wl_surface"/>
189 <!-- Map the surface relative to an existing surface. The x and y
190 arguments specify the locations of the upper left corner of
191 the surface relative to the upper left corner of the parent
192 surface. The flags argument controls overflow/clipping
193 behaviour when the surface would intersect a screen edge,
194 panel or such. And possibly whether the offset only
195 determines the initial position or if the surface is locked
196 to that relative position during moves. -->
197 <request name="set_transient">
198 <arg name="surface" type="object" interface="wl_surface"/>
199 <arg name="parent" type="object" interface="wl_surface"/>
200 <arg name="x" type="int"/>
201 <arg name="y" type="int"/>
202 <arg name="flags" type="uint"/>
205 <!-- Map the surface as a fullscreen surface. There are a number
206 of options here: on which output? if the surface size doesn't
207 match the output size, do we scale, change resolution, or add
208 black borders? is that something the client controls? what
209 about transient surfaces, do they float on top of the
210 fullscreen? what if there's already a fullscreen surface on
211 the output, maybe you can only go fullscreen if you're
213 <request name="set_fullscreen">
214 <arg name="surface" type="object" interface="wl_surface"/>
217 <!-- The configure event asks the client to resize its surface.
218 The size is a hint, in the sense that the client is free to
219 ignore it if it doesn't resize, pick a smaller size (to
220 satisfy aspect ration or resize in steps of NxM pixels). The
221 client is free to dismiss all but the last configure event it
223 <event name="configure">
224 <arg name="time" type="uint"/>
225 <arg name="edges" type="uint"/>
226 <arg name="surface" type="object" interface="wl_surface"/>
227 <arg name="width" type="int"/>
228 <arg name="height" type="int"/>
232 <interface name="wl_selection" version="1">
233 <!-- Add an offered mime type. Can be called several times to
234 offer multiple types, but must be called before 'activate'. -->
235 <request name="offer">
236 <arg name="type" type="string"/>
239 <!-- Can the selection be activated for multiple devices? -->
240 <request name="activate">
241 <arg name="input_device" type="object" interface="wl_input_device"/>
242 <arg name="time" type="uint"/>
245 <!-- Destroy the selection. -->
246 <request name="destroy" type="destructor"/>
248 <!-- Another client pasted the selection, send the mime-type over
251 <arg name="mime_type" type="string"/>
252 <arg name="fd" type="fd"/>
255 <!-- Another selection became active. -->
256 <event name="cancelled"/>
259 <interface name="wl_selection_offer" version="1">
260 <!-- Called to receive the selection data as the specified type.
261 Sends the pipe fd to the compositor, which forwards it to the
262 source in the 'send' event -->
263 <request name="receive">
264 <arg name="mime_type" type="string"/>
265 <arg name="fd" type="fd"/>
268 <!-- Sent before the keyboard_focus event to announce the types
269 offered. One event per offered mime type. A mime type of
270 NULL means the selection offer is going away. -->
272 <arg name="type" type="string"/>
275 <event name="keyboard_focus">
276 <arg name="input_device" type="object" interface="wl_input_device"/>
280 <interface name="wl_drag" version="1">
281 <!-- Add an offered mime type. Can be called several times to
282 offer multiple types, but must be called before 'activate'. -->
283 <request name="offer">
284 <arg name="type" type="string"/>
287 <request name="activate">
288 <arg name="surface" type="object" interface="wl_surface"/>
289 <arg name="input_device" type="object" interface="wl_input_device"/>
290 <arg name="time" type="uint"/>
293 <!-- Destroy the drag and cancel the session. -->
294 <request name="destroy" type="destructor"/>
296 <!-- Sent when a target accepts pointer_focus or motion events.
297 If a target does not accept any of the offered types, type is
299 <event name="target">
300 <arg name="mime_type" type="string"/>
303 <!-- Sent when the drag is finished. The final mime type is that
304 of the last target event. If that was NULL, no drag target
305 was valid when the drag finished, fd is undefined and the
306 source should not send data. The event is also sent in case
307 a drag source tries to activate a drag after the grab was
308 released, in which case mime_type will also be NULL. -->
309 <event name="finish">
310 <arg name="fd" type="fd"/>
313 <event name="reject"/>
317 <interface name="wl_drag_offer" version="1">
318 <!-- Call to accept the offer of the given type -->
319 <request name="accept">
320 <arg name="time" type="uint"/>
321 <arg name="type" type="string"/>
324 <!-- Called to initiate the drag finish sequence. Sends the pipe
325 fd to the compositor, which forwards it to the source in the
327 <request name="receive">
328 <arg name="fd" type="fd"/>
331 <!-- Called to reject a drop -->
332 <request name="reject"/>
334 <!-- Sent before the pointer_focus event to announce the types
335 offered. One event per offered mime type. -->
337 <arg name="type" type="string"/>
340 <!-- Similar to device::pointer_focus. Sent to potential target
341 surfaces to offer drag data. If the device leaves the
342 window, the drag stops or the originator cancels the drag,
343 this event is sent with the NULL surface, at which point the
344 drag object may no longer be valid. -->
345 <event name="pointer_focus">
346 <arg name="time" type="uint"/>
347 <arg name="surface" type="object" interface="wl_surface"/>
348 <arg name="x" type="int"/>
349 <arg name="y" type="int"/>
350 <arg name="surface_x" type="int"/>
351 <arg name="surface_y" type="int"/>
354 <!-- Similar to device::motion. Sent to potential target surfaces
355 as the drag pointer moves around in the surface. -->
356 <event name="motion">
357 <arg name="time" type="uint"/>
358 <arg name="x" type="int"/>
359 <arg name="y" type="int"/>
360 <arg name="surface_x" type="int"/>
361 <arg name="surface_y" type="int"/>
364 <!-- Sent to indicate that the drag is finishing. The last
365 motion/pointer_focus event gives the location of the drop.
366 Target must respond with the 'receive' request, which sends
367 an fd to the source for writing the drag data. -->
372 <!-- A surface. This is an image that is displayed on the screen.
373 It has a location, size and pixel contents. Similar to a window. -->
374 <interface name="wl_surface" version="1">
375 <!-- Deletes the surface and invalidates its object id. -->
376 <request name="destroy" type="destructor"/>
378 <!-- Copy the contents of a buffer into this surface. The x and y
379 arguments specify the location of the new buffers upper left
380 corner, relative to the old buffers upper left corner. -->
381 <request name="attach">
382 <arg name="buffer" type="object" interface="wl_buffer"/>
383 <arg name="x" type="int"/>
384 <arg name="y" type="int"/>
387 <!-- After attaching a new buffer, this request is used to
388 describe the regions where the new buffer is different from
389 the previous buffer and needs to be repainted. Coordinates
390 are relative to the new buffer. -->
391 <request name="damage">
392 <arg name="x" type="int"/>
393 <arg name="y" type="int"/>
394 <arg name="width" type="int"/>
395 <arg name="height" type="int"/>
400 <!-- A group of keyboards and pointer devices (mice, for
401 example). This object is published as a global during start up,
402 or when such a device is hot plugged. A input_device group
403 typically has a pointer and maintains a keyboard_focus and a
405 <interface name="wl_input_device" version="1">
406 <!-- Set the pointer's image. This request only takes effect if
407 the pointer focus for this device is one of the requesting
408 clients surfaces. -->
409 <request name="attach">
410 <arg name="time" type="uint"/>
411 <arg name="buffer" type="object" interface="wl_buffer"/>
412 <arg name="hotspot_x" type="int"/>
413 <arg name="hotspot_y" type="int"/>
416 <!-- Notification of pointer location change.
417 x,y are the absolute location on the screen.
418 surface_[xy] are the location relative to the focused surface. -->
419 <event name="motion">
420 <arg name="time" type="uint"/>
421 <arg name="x" type="int"/>
422 <arg name="y" type="int"/>
423 <arg name="surface_x" type="int"/>
424 <arg name="surface_y" type="int"/>
427 <!-- Mouse button click and release notifications. The location
428 of the click is given by the last motion or pointer_focus
430 <event name="button">
431 <arg name="time" type="uint"/>
432 <arg name="button" type="uint"/>
433 <arg name="state" type="uint"/>
436 <!-- Keyboard press. -->
438 <arg name="time" type="uint"/>
439 <arg name="key" type="uint"/>
440 <arg name="state" type="uint"/>
443 <!-- Notification that this input device's pointer is focused on
444 certain surface. When an input_device enters a surface, the
445 pointer image is undefined and a client should respond to
446 this event by setting an apropriate pointer image. -->
447 <event name="pointer_focus">
448 <arg name="time" type="uint"/>
449 <arg name="surface" type="object" interface="wl_surface"/>
450 <arg name="x" type="int"/>
451 <arg name="y" type="int"/>
452 <arg name="surface_x" type="int"/>
453 <arg name="surface_y" type="int"/>
456 <event name="keyboard_focus">
457 <arg name="time" type="uint"/>
458 <arg name="surface" type="object" interface="wl_surface"/>
459 <arg name="keys" type="array"/>
464 <!-- An output describes part of the compositor geometry. The
465 compositor work in the 'compositor coordinate system' and an
466 output corresponds to rectangular area in that space that is
467 actually visible. This typically corresponds to a monitor that
468 displays part of the compositor space. This object is
469 published as global during start up, or when a screen is hot
471 <interface name="wl_output" version="1">
472 <!-- Notification about the screen size. -->
473 <event name="geometry">
474 <arg name="x" type="int"/>
475 <arg name="y" type="int"/>
476 <arg name="width" type="int"/>
477 <arg name="height" type="int"/>
482 <!-- A visual is the pixel format. The different visuals are
483 currently only identified by the order they are advertised by
484 the 'global' events. We need something better. -->
485 <interface name="wl_visual" version="1"/>