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"/>
148 <!-- Sent when an attached buffer is no longer used by the compositor. -->
149 <event name="release"/>
152 <interface name="wl_shell" version="1">
153 <request name="move">
154 <arg name="surface" type="object" interface="wl_surface"/>
155 <arg name="input_device" type="object" interface="wl_input_device"/>
156 <arg name="time" type="uint"/>
160 <entry name="none" value="0"/>
161 <entry name="top" value="1"/>
162 <entry name="bottom" value="2"/>
163 <entry name="left" value="4"/>
164 <entry name="top_left" value="5"/>
165 <entry name="bottom_left" value="6"/>
166 <entry name="right" value="8"/>
167 <entry name="top_right" value="9"/>
168 <entry name="bottom_right" value="10"/>
171 <request name="resize">
172 <arg name="surface" type="object" interface="wl_surface"/>
173 <arg name="input_device" type="object" interface="wl_input_device"/>
174 <arg name="time" type="uint"/>
175 <!-- edges is an enum, need to get the values in here -->
176 <arg name="edges" type="uint"/>
179 <request name="create_drag">
180 <arg name="id" type="new_id" interface="wl_drag"/>
183 <request name="create_selection">
184 <arg name="id" type="new_id" interface="wl_selection"/>
187 <!-- Make the surface visible as a toplevel window. -->
188 <request name="set_toplevel">
189 <arg name="surface" type="object" interface="wl_surface"/>
192 <!-- Map the surface relative to an existing surface. The x and y
193 arguments specify the locations of the upper left corner of
194 the surface relative to the upper left corner of the parent
195 surface. The flags argument controls overflow/clipping
196 behaviour when the surface would intersect a screen edge,
197 panel or such. And possibly whether the offset only
198 determines the initial position or if the surface is locked
199 to that relative position during moves. -->
200 <request name="set_transient">
201 <arg name="surface" type="object" interface="wl_surface"/>
202 <arg name="parent" type="object" interface="wl_surface"/>
203 <arg name="x" type="int"/>
204 <arg name="y" type="int"/>
205 <arg name="flags" type="uint"/>
208 <!-- Map the surface as a fullscreen surface. There are a number
209 of options here: on which output? if the surface size doesn't
210 match the output size, do we scale, change resolution, or add
211 black borders? is that something the client controls? what
212 about transient surfaces, do they float on top of the
213 fullscreen? what if there's already a fullscreen surface on
214 the output, maybe you can only go fullscreen if you're
216 <request name="set_fullscreen">
217 <arg name="surface" type="object" interface="wl_surface"/>
220 <!-- The configure event asks the client to resize its surface.
221 The size is a hint, in the sense that the client is free to
222 ignore it if it doesn't resize, pick a smaller size (to
223 satisfy aspect ration or resize in steps of NxM pixels). The
224 client is free to dismiss all but the last configure event it
226 <event name="configure">
227 <arg name="time" type="uint"/>
228 <arg name="edges" type="uint"/>
229 <arg name="surface" type="object" interface="wl_surface"/>
230 <arg name="width" type="int"/>
231 <arg name="height" type="int"/>
235 <interface name="wl_selection" version="1">
236 <!-- Add an offered mime type. Can be called several times to
237 offer multiple types, but must be called before 'activate'. -->
238 <request name="offer">
239 <arg name="type" type="string"/>
242 <!-- Can the selection be activated for multiple devices? -->
243 <request name="activate">
244 <arg name="input_device" type="object" interface="wl_input_device"/>
245 <arg name="time" type="uint"/>
248 <!-- Destroy the selection. -->
249 <request name="destroy" type="destructor"/>
251 <!-- Another client pasted the selection, send the mime-type over
254 <arg name="mime_type" type="string"/>
255 <arg name="fd" type="fd"/>
258 <!-- Another selection became active. -->
259 <event name="cancelled"/>
262 <interface name="wl_selection_offer" version="1">
263 <!-- Called to receive the selection data as the specified type.
264 Sends the pipe fd to the compositor, which forwards it to the
265 source in the 'send' event -->
266 <request name="receive">
267 <arg name="mime_type" type="string"/>
268 <arg name="fd" type="fd"/>
271 <!-- Sent before the keyboard_focus event to announce the types
272 offered. One event per offered mime type. A mime type of
273 NULL means the selection offer is going away. -->
275 <arg name="type" type="string"/>
278 <event name="keyboard_focus">
279 <arg name="input_device" type="object" interface="wl_input_device"/>
283 <interface name="wl_drag" version="1">
284 <!-- Add an offered mime type. Can be called several times to
285 offer multiple types, but must be called before 'activate'. -->
286 <request name="offer">
287 <arg name="type" type="string"/>
290 <request name="activate">
291 <arg name="surface" type="object" interface="wl_surface"/>
292 <arg name="input_device" type="object" interface="wl_input_device"/>
293 <arg name="time" type="uint"/>
296 <!-- Destroy the drag and cancel the session. -->
297 <request name="destroy" type="destructor"/>
299 <!-- Sent when a target accepts pointer_focus or motion events.
300 If a target does not accept any of the offered types, type is
302 <event name="target">
303 <arg name="mime_type" type="string"/>
306 <!-- Sent when the drag is finished. The final mime type is that
307 of the last target event. If that was NULL, no drag target
308 was valid when the drag finished, fd is undefined and the
309 source should not send data. The event is also sent in case
310 a drag source tries to activate a drag after the grab was
311 released, in which case mime_type will also be NULL. -->
312 <event name="finish">
313 <arg name="fd" type="fd"/>
316 <event name="reject"/>
320 <interface name="wl_drag_offer" version="1">
321 <!-- Call to accept the offer of the given type -->
322 <request name="accept">
323 <arg name="time" type="uint"/>
324 <arg name="type" type="string"/>
327 <!-- Called to initiate the drag finish sequence. Sends the pipe
328 fd to the compositor, which forwards it to the source in the
330 <request name="receive">
331 <arg name="fd" type="fd"/>
334 <!-- Called to reject a drop -->
335 <request name="reject"/>
337 <!-- Sent before the pointer_focus event to announce the types
338 offered. One event per offered mime type. -->
340 <arg name="type" type="string"/>
343 <!-- Similar to device::pointer_focus. Sent to potential target
344 surfaces to offer drag data. If the device leaves the
345 window, the drag stops or the originator cancels the drag,
346 this event is sent with the NULL surface, at which point the
347 drag object may no longer be valid. -->
348 <event name="pointer_focus">
349 <arg name="time" type="uint"/>
350 <arg name="surface" type="object" interface="wl_surface"/>
351 <arg name="x" type="int"/>
352 <arg name="y" type="int"/>
353 <arg name="surface_x" type="int"/>
354 <arg name="surface_y" type="int"/>
357 <!-- Similar to device::motion. Sent to potential target surfaces
358 as the drag pointer moves around in the surface. -->
359 <event name="motion">
360 <arg name="time" type="uint"/>
361 <arg name="x" type="int"/>
362 <arg name="y" type="int"/>
363 <arg name="surface_x" type="int"/>
364 <arg name="surface_y" type="int"/>
367 <!-- Sent to indicate that the drag is finishing. The last
368 motion/pointer_focus event gives the location of the drop.
369 Target must respond with the 'receive' request, which sends
370 an fd to the source for writing the drag data. -->
375 <!-- A surface. This is an image that is displayed on the screen.
376 It has a location, size and pixel contents. Similar to a window. -->
377 <interface name="wl_surface" version="1">
378 <!-- Deletes the surface and invalidates its object id. -->
379 <request name="destroy" type="destructor"/>
381 <!-- Copy the contents of a buffer into this surface. The x and y
382 arguments specify the location of the new buffers upper left
383 corner, relative to the old buffers upper left corner. -->
384 <request name="attach">
385 <arg name="buffer" type="object" interface="wl_buffer"/>
386 <arg name="x" type="int"/>
387 <arg name="y" type="int"/>
390 <!-- After attaching a new buffer, this request is used to
391 describe the regions where the new buffer is different from
392 the previous buffer and needs to be repainted. Coordinates
393 are relative to the new buffer. -->
394 <request name="damage">
395 <arg name="x" type="int"/>
396 <arg name="y" type="int"/>
397 <arg name="width" type="int"/>
398 <arg name="height" type="int"/>
403 <!-- A group of keyboards and pointer devices (mice, for
404 example). This object is published as a global during start up,
405 or when such a device is hot plugged. A input_device group
406 typically has a pointer and maintains a keyboard_focus and a
408 <interface name="wl_input_device" version="1">
409 <!-- Set the pointer's image. This request only takes effect if
410 the pointer focus for this device is one of the requesting
411 clients surfaces. -->
412 <request name="attach">
413 <arg name="time" type="uint"/>
414 <arg name="buffer" type="object" interface="wl_buffer"/>
415 <arg name="hotspot_x" type="int"/>
416 <arg name="hotspot_y" type="int"/>
419 <!-- Notification of pointer location change.
420 x,y are the absolute location on the screen.
421 surface_[xy] are the location relative to the focused surface. -->
422 <event name="motion">
423 <arg name="time" type="uint"/>
424 <arg name="x" type="int"/>
425 <arg name="y" type="int"/>
426 <arg name="surface_x" type="int"/>
427 <arg name="surface_y" type="int"/>
430 <!-- Mouse button click and release notifications. The location
431 of the click is given by the last motion or pointer_focus
433 <event name="button">
434 <arg name="time" type="uint"/>
435 <arg name="button" type="uint"/>
436 <arg name="state" type="uint"/>
439 <!-- Keyboard press. -->
441 <arg name="time" type="uint"/>
442 <arg name="key" type="uint"/>
443 <arg name="state" type="uint"/>
446 <!-- Notification that this input device's pointer is focused on
447 certain surface. When an input_device enters a surface, the
448 pointer image is undefined and a client should respond to
449 this event by setting an apropriate pointer image. -->
450 <event name="pointer_focus">
451 <arg name="time" type="uint"/>
452 <arg name="surface" type="object" interface="wl_surface"/>
453 <arg name="x" type="int"/>
454 <arg name="y" type="int"/>
455 <arg name="surface_x" type="int"/>
456 <arg name="surface_y" type="int"/>
459 <event name="keyboard_focus">
460 <arg name="time" type="uint"/>
461 <arg name="surface" type="object" interface="wl_surface"/>
462 <arg name="keys" type="array"/>
467 <!-- An output describes part of the compositor geometry. The
468 compositor work in the 'compositor coordinate system' and an
469 output corresponds to rectangular area in that space that is
470 actually visible. This typically corresponds to a monitor that
471 displays part of the compositor space. This object is
472 published as global during start up, or when a screen is hot
474 <interface name="wl_output" version="1">
476 <enum name="subpixel">
477 <entry name="unknown" value="0"/>
478 <entry name="none" value="1"/>
479 <entry name="horizontal_rgb" value="2"/>
480 <entry name="horizontal_bgr" value="3"/>
481 <entry name="vertical_rgb" value="4"/>
482 <entry name="vertical_bgr" value="5"/>
485 <event name="geometry">
486 <arg name="x" type="int"/>
487 <arg name="y" type="int"/>
488 <arg name="physical_width" type="int"/>
489 <arg name="physical_height" type="int"/>
490 <arg name="subpixel" type="int"/>
491 <arg name="make" type="string"/>
492 <arg name="model" type="string"/>
495 <!-- Values for the flags bitfield of the mode event. -->
497 <entry name="current" value="0x1"/>
498 <entry name="preferred" value="0x2"/>
502 <arg name="flags" type="uint"/>
503 <arg name="width" type="int"/>
504 <arg name="height" type="int"/>
505 <arg name="refresh" type="int"/>
510 <!-- A visual is the pixel format. The different visuals are
511 currently only identified by the order they are advertised by
512 the 'global' events. We need something better. -->
513 <interface name="wl_visual" version="1"/>