1 //! Misc protocols 2 //! 3 //! This module contains protocols that are not clearly packaged by their maintainers, 4 //! often being implementation details of desktop environment, but can be used by external 5 //! tools for interoperability. 6 //! 7 //! Given they are not clearly packaged, the maintainers of this crate cannot guarantee 8 //! anything when it comes to them being up to date or the stability of their interface. 9 //! Pull requests for updating them will be welcomed, but we won't actively check if they 10 //! have received any updates. 11 12 #![cfg_attr(rustfmt, rustfmt_skip)] 13 14 pub mod gtk_primary_selection { 15 //! Gtk primary selection protocol 16 //! 17 //! This protocol provides the ability to have a primary selection device to 18 //! match that of the X server. This primary selection is a shortcut to the 19 //! common clipboard selection, where text just needs to be selected in order 20 //! to allow copying it elsewhere. The de facto way to perform this action 21 //! is the middle mouse button, although it is not limited to this one. 22 //! 23 //! Clients wishing to honor primary selection should create a primary 24 //! selection source and set it as the selection through 25 //! `wp_primary_selection_device.set_selection` whenever the text selection 26 //! changes. In order to minimize calls in pointer-driven text selection, 27 //! it should happen only once after the operation finished. Similarly, 28 //! a NULL source should be set when text is unselected. 29 //! 30 //! `wp_primary_selection_offer` objects are first announced through the 31 //! `wp_primary_selection_device.data_offer` event. Immediately after this event, 32 //! the primary data offer will emit `wp_primary_selection_offer.offer` events 33 //! to let know of the mime types being offered. 34 //! 35 //! When the primary selection changes, the client with the keyboard focus 36 //! will receive `wp_primary_selection_device.selection` events. Only the client 37 //! with the keyboard focus will receive such events with a non-NULL 38 //! `wp_primary_selection_offer`. Across keyboard focus changes, previously 39 //! focused clients will receive `wp_primary_selection_device.events` with a 40 //! NULL `wp_primary_selection_offer`. 41 //! 42 //! In order to request the primary selection data, the client must pass 43 //! a recent serial pertaining to the press event that is triggering the 44 //! operation, if the compositor deems the serial valid and recent, the 45 //! `wp_primary_selection_source.send` event will happen in the other end 46 //! to let the transfer begin. The client owning the primary selection 47 //! should write the requested data, and close the file descriptor 48 //! immediately. 49 //! 50 //! If the primary selection owner client disappeared during the transfer, 51 //! the client reading the data will receive a 52 //! `wp_primary_selection_device.selection` event with a NULL 53 //! `wp_primary_selection_offer`, the client should take this as a hint 54 //! to finish the reads related to the no longer existing offer. 55 //! 56 //! The primary selection owner should be checking for errors during 57 //! writes, merely cancelling the ongoing transfer if any happened. 58 59 wayland_protocol!("./misc/gtk-primary-selection.xml", []); 60 } 61 62 #[cfg(feature = "unstable_protocols")] 63 pub mod zwp_input_method_v2 { 64 //! Input method v2 unstable 65 //! 66 //! This protocol allows applications to act as input methods for compositors. 67 //! 68 //! An input method context is used to manage the state of the input method. 69 //! 70 //! Text strings are UTF-8 encoded, their indices and lengths are in bytes. 71 //! 72 //! This document adheres to the RFC 2119 when using words like "must", 73 //! "should", "may", etc. 74 //! 75 //! Warning! The protocol described in this file is experimental and 76 //! backward incompatible changes may be made. Backward compatible changes 77 //! may be added together with the corresponding interface version bump. 78 //! Backward incompatible changes are done by bumping the version number in 79 //! the protocol and interface names and resetting the interface version. 80 //! Once the protocol is to be declared stable, the 'z' prefix and the 81 //! version number in the protocol and interface names are removed and the 82 //! interface version number is reset. 83 84 wayland_protocol!("./misc/input-method-unstable-v2.xml", [crate::unstable::text_input::v3]); 85 } 86 87 pub mod server_decoration{ 88 //! KDE server decoration protocol 89 //! 90 //! This interface allows to coordinate whether the server should create 91 //! a server-side window decoration around a wl_surface representing a 92 //! shell surface (wl_shell_surface or similar). By announcing support 93 //! for this interface the server indicates that it supports server 94 //! side decorations. 95 //! 96 //! Use in conjunction with zxdg_decoration_manager_v1 is undefined. 97 wayland_protocol!("./misc/server-decoration.xml", []); 98 } 99