1 //! Unstable protocols from wayland-protocols 2 //! 3 //! The protocols described in this module are experimental and 4 //! backward incompatible changes may be made. Backward compatible 5 //! changes may be added together with the corresponding interface 6 //! version bump. 7 //! 8 //! Backward incompatible changes are done by bumping the version 9 //! number in the protocol and interface names and resetting the 10 //! interface version. Once the protocol is to be declared stable, 11 //! the 'z' prefix and the version number in the protocol and 12 //! interface names are removed and the interface version number is 13 //! reset. 14 15 #![cfg_attr(rustfmt, rustfmt_skip)] 16 17 pub mod fullscreen_shell { 18 //! Fullscreen shell protocol 19 20 wayland_protocol_versioned!( 21 "fullscreen-shell", 22 [v1], 23 [ 24 (wl_surface, wl_surface_interface), 25 (wl_output, wl_output_interface) 26 ], 27 [] 28 ); 29 } 30 31 pub mod idle_inhibit { 32 //! Screensaver inhibition protocol 33 34 wayland_protocol_versioned!( 35 "idle-inhibit", 36 [v1], 37 [(wl_surface, wl_surface_interface)], 38 [] 39 ); 40 } 41 42 43 pub mod input_method { 44 //! Input method protocol 45 46 wayland_protocol_versioned!( 47 "input-method", 48 [v1], 49 [ 50 (wl_surface, wl_surface_interface), 51 (wl_output, wl_output_interface), 52 (wl_keyboard, wl_keyboard_interface) 53 ], 54 [] 55 ); 56 } 57 58 pub mod keyboard_shortcuts_inhibit { 59 //! Protocol for inhibiting the compositor keyboard shortcuts 60 //! 61 //! This protocol specifies a way for a client to request the compositor 62 //! to ignore its own keyboard shortcuts for a given seat, so that all 63 //! key events from that seat get forwarded to a surface. 64 65 wayland_protocol_versioned!( 66 "keyboard-shortcuts-inhibit", 67 [v1], 68 [ 69 (wl_seat, wl_seat_interface), 70 (wl_surface, wl_surface_interface) 71 ], 72 [] 73 ); 74 } 75 76 pub mod linux_dmabuf { 77 //! Linux DMA-BUF protocol 78 79 wayland_protocol_versioned!( 80 "linux-dmabuf", 81 [v1], 82 [(wl_buffer, wl_buffer_interface)], 83 [] 84 ); 85 } 86 87 pub mod pointer_constraints { 88 //! protocol for constraining pointer motions 89 //! 90 //! This protocol specifies a set of interfaces used for adding constraints to 91 //! the motion of a pointer. Possible constraints include confining pointer 92 //! motions to a given region, or locking it to its current position. 93 //! 94 //! In order to constrain the pointer, a client must first bind the global 95 //! interface "wp_pointer_constraints" which, if a compositor supports pointer 96 //! constraints, is exposed by the registry. Using the bound global object, the 97 //! client uses the request that corresponds to the type of constraint it wants 98 //! to make. See wp_pointer_constraints for more details. 99 100 wayland_protocol_versioned!( 101 "pointer-constraints", 102 [v1], 103 [ 104 (wl_surface, wl_surface_interface), 105 (wl_pointer, wl_pointer_interface), 106 (wl_region, wl_region_interface) 107 ], 108 [] 109 ); 110 } 111 112 pub mod pointer_gestures { 113 //! Pointer gestures protocol 114 115 wayland_protocol_versioned!( 116 "pointer-gestures", 117 [v1], 118 [ 119 (wl_surface, wl_surface_interface), 120 (wl_pointer, wl_pointer_interface) 121 ], 122 [] 123 ); 124 } 125 126 pub mod relative_pointer { 127 //! protocol for relative pointer motion events 128 //! 129 //! This protocol specifies a set of interfaces used for making clients able to 130 //! receive relative pointer events not obstructed by barriers (such as the 131 //! monitor edge or other pointer barriers). 132 //! 133 //! To start receiving relative pointer events, a client must first bind the 134 //! global interface "wp_relative_pointer_manager" which, if a compositor 135 //! supports relative pointer motion events, is exposed by the registry. After 136 //! having created the relative pointer manager proxy object, the client uses 137 //! it to create the actual relative pointer object using the 138 //! "get_relative_pointer" request given a wl_pointer. The relative pointer 139 //! motion events will then, when applicable, be transmitted via the proxy of 140 //! the newly created relative pointer object. See the documentation of the 141 //! relative pointer interface for more details. 142 143 wayland_protocol_versioned!( 144 "relative-pointer", 145 [v1], 146 [(wl_pointer, wl_pointer_interface)], 147 [] 148 ); 149 } 150 151 pub mod tablet { 152 //! Wayland protocol for graphics tablets 153 //! 154 //! This description provides a high-level overview of the interplay between 155 //! the interfaces defined this protocol. For details, see the protocol 156 //! specification. 157 //! 158 //! More than one tablet may exist, and device-specifics matter. Tablets are 159 //! not represented by a single virtual device like wl_pointer. A client 160 //! binds to the tablet manager object which is just a proxy object. From 161 //! that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat) 162 //! and that returns the actual interface that has all the tablets. With 163 //! this indirection, we can avoid merging wp_tablet into the actual Wayland 164 //! protocol, a long-term benefit. 165 //! 166 //! The wp_tablet_seat sends a "tablet added" event for each tablet 167 //! connected. That event is followed by descriptive events about the 168 //! hardware; currently that includes events for name, vid/pid and 169 //! a wp_tablet.path event that describes a local path. This path can be 170 //! used to uniquely identify a tablet or get more information through 171 //! libwacom. Emulated or nested tablets can skip any of those, e.g. a 172 //! virtual tablet may not have a vid/pid. The sequence of descriptive 173 //! events is terminated by a wp_tablet.done event to signal that a client 174 //! may now finalize any initialization for that tablet. 175 //! 176 //! Events from tablets require a tool in proximity. Tools are also managed 177 //! by the tablet seat; a "tool added" event is sent whenever a tool is new 178 //! to the compositor. That event is followed by a number of descriptive 179 //! events about the hardware; currently that includes capabilities, 180 //! hardware id and serial number, and tool type. Similar to the tablet 181 //! interface, a wp_tablet_tool.done event is sent to terminate that initial 182 //! sequence. 183 //! 184 //! Any event from a tool happens on the wp_tablet_tool interface. When the 185 //! tool gets into proximity of the tablet, a proximity_in event is sent on 186 //! the wp_tablet_tool interface, listing the tablet and the surface. That 187 //! event is followed by a motion event with the coordinates. After that, 188 //! it's the usual motion, axis, button, etc. events. The protocol's 189 //! serialisation means events are grouped by wp_tablet_tool.frame events. 190 //! 191 //! Two special events (that don't exist in X) are down and up. They signal 192 //! "tip touching the surface". For tablets without real proximity 193 //! detection, the sequence is: proximity_in, motion, down, frame. 194 //! 195 //! When the tool leaves proximity, a proximity_out event is sent. If any 196 //! button is still down, a button release event is sent before this 197 //! proximity event. These button events are sent in the same frame as the 198 //! proximity event to signal to the client that the buttons were held when 199 //! the tool left proximity. 200 //! 201 //! If the tool moves out of the surface but stays in proximity (i.e. 202 //! between windows), compositor-specific grab policies apply. This usually 203 //! means that the proximity-out is delayed until all buttons are released. 204 //! 205 //! Moving a tool physically from one tablet to the other has no real effect 206 //! on the protocol, since we already have the tool object from the "tool 207 //! added" event. All the information is already there and the proximity 208 //! events on both tablets are all a client needs to reconstruct what 209 //! happened. 210 //! 211 //! Some extra axes are normalized, i.e. the client knows the range as 212 //! specified in the protocol (e.g. [0, 65535]), the granularity however is 213 //! unknown. The current normalized axes are pressure, distance, and slider. 214 //! 215 //! Other extra axes are in physical units as specified in the protocol. 216 //! The current extra axes with physical units are tilt, rotation and 217 //! wheel rotation. 218 //! 219 //! Since tablets work independently of the pointer controlled by the mouse, 220 //! the focus handling is independent too and controlled by proximity. 221 //! The wp_tablet_tool.set_cursor request sets a tool-specific cursor. 222 //! This cursor surface may be the same as the mouse cursor, and it may be 223 //! the same across tools but it is possible to be more fine-grained. For 224 //! example, a client may set different cursors for the pen and eraser. 225 //! 226 //! Tools are generally independent of tablets and it is 227 //! compositor-specific policy when a tool can be removed. Common approaches 228 //! will likely include some form of removing a tool when all tablets the 229 //! tool was used on are removed. 230 231 wayland_protocol_versioned!( 232 "tablet", 233 [v1, v2], 234 [ 235 (wl_seat, wl_seat_interface), 236 (wl_surface, wl_surface_interface) 237 ], 238 [] 239 ); 240 } 241 242 pub mod text_input { 243 //! Text input protocol 244 245 wayland_protocol_versioned!( 246 "text-input", 247 [v1], 248 [ 249 (wl_seat, wl_seat_interface), 250 (wl_surface, wl_surface_interface) 251 ], 252 [] 253 ); 254 } 255 256 pub mod xdg_decoration { 257 //! This interface allows a compositor to announce support for server-side 258 //! decorations. 259 260 //! A window decoration is a set of window controls as deemed appropriate by 261 //! the party managing them, such as user interface components used to move, 262 //! resize and change a window's state. 263 264 //! A client can use this protocol to request being decorated by a supporting 265 //! compositor. 266 267 //! If compositor and client do not negotiate the use of a server-side 268 //! decoration using this protocol, clients continue to self-decorate as they 269 //! see fit. 270 271 wayland_protocol_versioned!( 272 "xdg-decoration", 273 [v1], 274 [], 275 [ 276 (xdg_shell, xdg_toplevel, xdg_toplevel_interface) 277 ] 278 ); 279 } 280 281 pub mod xdg_foreign { 282 //! Protocol for exporting xdg surface handles 283 //! 284 //! This protocol specifies a way for making it possible to reference a surface 285 //! of a different client. With such a reference, a client can, by using the 286 //! interfaces provided by this protocol, manipulate the relationship between 287 //! its own surfaces and the surface of some other client. For example, stack 288 //! some of its own surface above the other clients surface. 289 //! 290 //! In order for a client A to get a reference of a surface of client B, client 291 //! B must first export its surface using xdg_exporter.export. Upon doing this, 292 //! client B will receive a handle (a unique string) that it may share with 293 //! client A in some way (for example D-Bus). After client A has received the 294 //! handle from client B, it may use xdg_importer.import to create a reference 295 //! to the surface client B just exported. See the corresponding requests for 296 //! details. 297 //! 298 //! A possible use case for this is out-of-process dialogs. For example when a 299 //! sandboxed client without file system access needs the user to select a file 300 //! on the file system, given sandbox environment support, it can export its 301 //! surface, passing the exported surface handle to an unsandboxed process that 302 //! can show a file browser dialog and stack it above the sandboxed client's 303 //! surface. 304 305 wayland_protocol_versioned!( 306 "xdg-foreign", 307 [v1, v2], 308 [(wl_surface, wl_surface_interface)], 309 [] 310 ); 311 } 312 313 pub mod xdg_output { 314 //! Protocol to describe output regions 315 //! 316 //! This protocol aims at describing outputs in a way which is more in line 317 //! with the concept of an output on desktop oriented systems. 318 //! 319 //! Some information are more specific to the concept of an output for 320 //! a desktop oriented system and may not make sense in other applications, 321 //! such as IVI systems for example. 322 //! 323 //! Typically, the global compositor space on a desktop system is made of 324 //! a contiguous or overlapping set of rectangular regions. 325 //! 326 //! Some of the information provided in this protocol might be identical 327 //! to their counterparts already available from wl_output, in which case 328 //! the information provided by this protocol should be preferred to their 329 //! equivalent in wl_output. The goal is to move the desktop specific 330 //! concepts (such as output location within the global compositor space, 331 //! the connector name and types, etc.) out of the core wl_output protocol. 332 333 wayland_protocol_versioned!( 334 "xdg-output", 335 [v1], 336 [(wl_output, wl_output_interface)], 337 [] 338 ); 339 } 340 341 pub mod xdg_shell { 342 //! XDG Shell protocol 343 //! 344 //! These are the old, unstable versions of the now stable XDG Shell protocol. 345 //! 346 //! They remain here for compatibility reasons, allowing you to support older 347 //! clients/server not yet implementing the new protocol. 348 349 wayland_protocol_versioned!( 350 "xdg-shell", 351 [v5, v6], 352 [ 353 (wl_surface, wl_surface_interface), 354 (wl_output, wl_output_interface), 355 (wl_seat, wl_seat_interface) 356 ], 357 [] 358 ); 359 } 360 361 pub mod xwayland_keyboard_grab { 362 //! Protocol for grabbing the keyboard from Xwayland 363 //! 364 //! This protocol is application-specific to meet the needs of the X11 365 //! protocol through Xwayland. It provides a way for Xwayland to request 366 //! all keyboard events to be forwarded to a surface even when the 367 //! surface does not have keyboard focus. 368 //! 369 //! In the X11 protocol, a client may request an "active grab" on the 370 //! keyboard. On success, all key events are reported only to the 371 //! grabbing X11 client. For details, see XGrabKeyboard(3). 372 //! 373 //! The core Wayland protocol does not have a notion of an active 374 //! keyboard grab. When running in Xwayland, X11 applications may 375 //! acquire an active grab inside Xwayland but that cannot be translated 376 //! to the Wayland compositor who may set the input focus to some other 377 //! surface. In doing so, it breaks the X11 client assumption that all 378 //! key events are reported to the grabbing client. 379 //! 380 //! This protocol specifies a way for Xwayland to request all keyboard 381 //! be directed to the given surface. The protocol does not guarantee 382 //! that the compositor will honor this request and it does not 383 //! prescribe user interfaces on how to handle the respond. For example, 384 //! a compositor may inform the user that all key events are now 385 //! forwarded to the given client surface, or it may ask the user for 386 //! permission to do so. 387 //! 388 //! Compositors are required to restrict access to this application 389 //! specific protocol to Xwayland alone. 390 391 wayland_protocol_versioned!( 392 "xwayland-keyboard-grab", 393 [v1], 394 [ 395 (wl_seat, wl_seat_interface), 396 (wl_surface, wl_surface_interface) 397 ], 398 [] 399 ); 400 } 401