pub struct ZwpInputMethodContextV1 { /* private fields */ }Expand description
input method context
Corresponds to a text input on the input method side. An input method context is created on text input activation on the input method side. It allows receiving information about the text input from the application via events. Input method contexts do not keep state after deactivation and should be destroyed after deactivation is handled.
Text is generally UTF-8 encoded, indices and lengths are in bytes.
Serials are used to synchronize the state between the text input and an input method. New serials are sent by the text input in the commit_state request and are used by the input method to indicate the known text input state in events like preedit_string, commit_string, and keysym. The text input can then ignore events from the input method which are based on an outdated state (for example after a reset).
Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the ‘z’ prefix and the version number in the protocol and interface names are removed and the interface version number is reset.
See also the Request enum for this interface.
Implementations§
Source§impl ZwpInputMethodContextV1
impl ZwpInputMethodContextV1
Sourcepub fn surrounding_text(&self, text: String, cursor: u32, anchor: u32)
pub fn surrounding_text(&self, text: String, cursor: u32, anchor: u32)
surrounding text event
The plain surrounding text around the input position. Cursor is the position in bytes within the surrounding text relative to the beginning of the text. Anchor is the position in bytes of the selection anchor within the surrounding text relative to the beginning of the text. If there is no selected text then anchor is the same as cursor.
pub fn reset(&self)
pub fn content_type(&self, hint: u32, purpose: u32)
pub fn invoke_action(&self, button: u32, index: u32)
pub fn commit_state(&self, serial: u32)
pub fn preferred_language(&self, language: String)
Trait Implementations§
Source§impl Borrow<ObjectId> for ZwpInputMethodContextV1
impl Borrow<ObjectId> for ZwpInputMethodContextV1
Source§impl Clone for ZwpInputMethodContextV1
impl Clone for ZwpInputMethodContextV1
Source§fn clone(&self) -> ZwpInputMethodContextV1
fn clone(&self) -> ZwpInputMethodContextV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more