wayland_protocols_misc/
lib.rs

1//! This crate provides Wayland object definitions for various orphan or deprecated protocol extensions.
2//! 
3//! This crate provides bindings for protocols that are generally not officially supported,
4//! but are *de facto* used by a non-negligible number of projets in the wayland ecosystem.
5//!
6//! These bindings are built on top of the crates wayland-client and wayland-server.
7//!
8//! Each protocol module contains a `client` and a `server` submodules, for each side of the
9//! protocol. The creation of these modules (and the dependency on the associated crate) is
10//! controlled by the two cargo features `client` and `server`.
11
12#![warn(missing_docs)]
13#![forbid(improper_ctypes, unsafe_op_in_unsafe_fn)]
14#![cfg_attr(docsrs, feature(doc_auto_cfg))]
15#![cfg_attr(rustfmt, rustfmt_skip)]
16
17#[macro_use]
18mod protocol_macro;
19
20pub mod gtk_primary_selection {
21    //! Gtk primary selection protocol
22    //!
23    //! This protocol provides the ability to have a primary selection device to
24    //! match that of the X server. This primary selection is a shortcut to the
25    //! common clipboard selection, where text just needs to be selected in order
26    //! to allow copying it elsewhere. The de facto way to perform this action
27    //! is the middle mouse button, although it is not limited to this one.
28    //!
29    //! Clients wishing to honor primary selection should create a primary
30    //! selection source and set it as the selection through
31    //! `wp_primary_selection_device.set_selection` whenever the text selection
32    //! changes. In order to minimize calls in pointer-driven text selection,
33    //! it should happen only once after the operation finished. Similarly,
34    //! a NULL source should be set when text is unselected.
35    //!
36    //! `wp_primary_selection_offer` objects are first announced through the
37    //! `wp_primary_selection_device.data_offer` event. Immediately after this event,
38    //! the primary data offer will emit `wp_primary_selection_offer.offer` events
39    //! to let know of the mime types being offered.
40    //!
41    //! When the primary selection changes, the client with the keyboard focus
42    //! will receive `wp_primary_selection_device.selection` events. Only the client
43    //! with the keyboard focus will receive such events with a non-NULL
44    //! `wp_primary_selection_offer`. Across keyboard focus changes, previously
45    //! focused clients will receive `wp_primary_selection_device.events` with a
46    //! NULL `wp_primary_selection_offer`.
47    //!
48    //! In order to request the primary selection data, the client must pass
49    //! a recent serial pertaining to the press event that is triggering the
50    //! operation, if the compositor deems the serial valid and recent, the
51    //! `wp_primary_selection_source.send` event will happen in the other end
52    //! to let the transfer begin. The client owning the primary selection
53    //! should write the requested data, and close the file descriptor
54    //! immediately.
55    //!
56    //! If the primary selection owner client disappeared during the transfer,
57    //! the client reading the data will receive a
58    //! `wp_primary_selection_device.selection` event with a NULL
59    //! `wp_primary_selection_offer`, the client should take this as a hint
60    //! to finish the reads related to the no longer existing offer.
61    //!
62    //! The primary selection owner should be checking for errors during
63    //! writes, merely cancelling the ongoing transfer if any happened.
64
65    wayland_protocol!("./protocols/gtk-primary-selection.xml", []);
66}
67
68pub mod zwp_input_method_v2 {
69    //! Input method v2 unstable
70    //! 
71    //! This protocol allows applications to act as input methods for compositors.
72    //!
73    //! An input method context is used to manage the state of the input method.
74    //!
75    //! Text strings are UTF-8 encoded, their indices and lengths are in bytes.
76    //!
77    //! This document adheres to the RFC 2119 when using words like "must",
78    //! "should", "may", etc.
79    //!
80    //! Warning! The protocol described in this file is experimental and
81    //! backward incompatible changes may be made. Backward compatible changes
82    //! may be added together with the corresponding interface version bump.
83    //! Backward incompatible changes are done by bumping the version number in
84    //! the protocol and interface names and resetting the interface version.
85    //! Once the protocol is to be declared stable, the 'z' prefix and the
86    //! version number in the protocol and interface names are removed and the
87    //! interface version number is reset.
88
89    wayland_protocol!("./protocols/input-method-unstable-v2.xml", [wayland_protocols::wp::text_input::zv3]);
90}
91
92pub mod zwp_virtual_keyboard_v1 {
93    //! Virtual keyboard v1 unstable
94    //!
95    //! The virtual keyboard provides an application with requests which emulate
96    //! the behaviour of a physical keyboard.
97    //!
98    //! This interface can be used by clients on its own to provide raw input
99    //! events, or it can accompany the input method protocol.
100
101    wayland_protocol!("./protocols/virtual-keyboard-unstable-v1.xml", []);
102}
103
104pub mod server_decoration {
105    //! KDE server decoration protocol
106    //!
107    //! This interface allows to coordinate whether the server should create
108    //! a server-side window decoration around a wl_surface representing a
109    //! shell surface (wl_shell_surface or similar). By announcing support
110    //! for this interface the server indicates that it supports server
111    //! side decorations.
112    //!
113    //! Use in conjunction with zxdg_decoration_manager_v1 is undefined.
114
115    wayland_protocol!("./protocols/server-decoration.xml", []);
116}