#[non_exhaustive]
pub enum Event { Activate, Deactivate, SurroundingText { text: String, cursor: u32, anchor: u32, }, TextChangeCause { cause: ChangeCause, }, ContentType { hint: ContentHint, purpose: ContentPurpose, }, Done, Unavailable, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Activate

input method has been requested

Notification that a text input focused on this seat requested the input method to be activated.

This event serves the purpose of providing the compositor with an active input method.

This event resets all state associated with previous enable, disable, surrounding_text, text_change_cause, and content_type events, as well as the state associated with set_preedit_string, commit_string, and delete_surrounding_text requests. In addition, it marks the zwp_input_method_v2 object as active, and makes any existing zwp_input_popup_surface_v2 objects visible.

The surrounding_text, and content_type events must follow before the next done event if the text input supports the respective functionality.

State set with this event is double-buffered. It will get applied on the next zwp_input_method_v2.done event, and stay valid until changed.

§

Deactivate

deactivate event

Notification that no focused text input currently needs an active input method on this seat.

This event marks the zwp_input_method_v2 object as inactive. The compositor must make all existing zwp_input_popup_surface_v2 objects invisible until the next activate event.

State set with this event is double-buffered. It will get applied on the next zwp_input_method_v2.done event, and stay valid until changed.

§

SurroundingText

surrounding text event

Updates the surrounding plain text around the cursor, excluding the preedit text.

If any preedit text is present, it is replaced with the cursor for the purpose of this event.

The argument text is a buffer containing the preedit string, and must include the cursor position, and the complete selection. It should contain additional characters before and after these. There is a maximum length of wayland messages, so text can not be longer than 4000 bytes.

cursor is the byte offset of the cursor within the text buffer.

anchor is the byte offset of the selection anchor within the text buffer. If there is no selected text, anchor must be the same as cursor.

If this event does not arrive before the first done event, the input method may assume that the text input does not support this functionality and ignore following surrounding_text events.

Values set with this event are double-buffered. They will get applied and set to initial values on the next zwp_input_method_v2.done event.

The initial state for affected fields is empty, meaning that the text input does not support sending surrounding text. If the empty values get applied, subsequent attempts to change them may have no effect.

Fields

§text: String
§cursor: u32
§anchor: u32
§

TextChangeCause

indicates the cause of surrounding text change

Tells the input method why the text surrounding the cursor changed.

Whenever the client detects an external change in text, cursor, or anchor position, it must issue this request to the compositor. This request is intended to give the input method a chance to update the preedit text in an appropriate way, e.g. by removing it when the user starts typing with a keyboard.

cause describes the source of the change.

The value set with this event is double-buffered. It will get applied and set to its initial value on the next zwp_input_method_v2.done event.

The initial value of cause is input_method.

Fields

§

ContentType

content purpose and hint

Indicates the content type and hint for the current zwp_input_method_v2 instance.

Values set with this event are double-buffered. They will get applied on the next zwp_input_method_v2.done event.

The initial value for hint is none, and the initial value for purpose is normal.

Fields

§

Done

apply state

Atomically applies state changes recently sent to the client.

The done event establishes and updates the state of the client, and must be issued after any changes to apply them.

Text input state (content purpose, content hint, surrounding text, and change cause) is conceptually double-buffered within an input method context.

Events modify the pending state, as opposed to the current state in use by the input method. A done event atomically applies all pending state, replacing the current state. After done, the new pending state is as documented for each related request.

Events must be applied in the order of arrival.

Neither current nor pending state are modified unless noted otherwise.

§

Unavailable

input method unavailable

The input method ceased to be available.

The compositor must issue this event as the only event on the object if there was another input_method object associated with the same seat at the time of its creation.

The compositor must issue this request when the object is no longer usable, e.g. due to seat removal.

The input method context becomes inert and should be destroyed after deactivation is handled. Any further requests and events except for the destroy request must be ignored.

Trait Implementations§

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MessageGroup for Event

Source§

const MESSAGES: &'static [MessageDesc]

Wire representation of this MessageGroup
Source§

type Map = ProxyMap

The wrapper type for ObjectMap allowing the mapping of Object and NewId arguments to the object map during parsing.
Source§

fn is_destructor(&self) -> bool

Whether this message is a destructor Read more
Source§

fn opcode(&self) -> u16

The opcode of this message
Source§

fn since(&self) -> u32

The minimal object version for which this message exists
Source§

fn child<Meta: ObjectMetadata>( opcode: u16, version: u32, meta: &Meta, ) -> Option<Object<Meta>>

Retrieve the child Object associated with this message if any
Source§

fn from_raw(msg: Message, map: &mut Self::Map) -> Result<Self, ()>

Construct a message from its raw representation
Source§

fn into_raw(self, sender_id: u32) -> Message

Turn this message into its raw representation
Source§

unsafe fn from_raw_c( obj: *mut c_void, opcode: u32, args: *const wl_argument, ) -> Result<Event, ()>

Construct a message of this group from its C representation Read more
Source§

fn as_raw_c_in<F, T>(self, f: F) -> T
where F: FnOnce(u32, &mut [wl_argument]) -> T,

Build a C representation of this message Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.