Struct wayland_protocols::unstable::text_input::v3::server::zwp_text_input_v3::ZwpTextInputV3
source · [−]pub struct ZwpTextInputV3(_);
Implementations
sourceimpl ZwpTextInputV3
impl ZwpTextInputV3
sourcepub fn enter(&self, surface: &WlSurface)
pub fn enter(&self, surface: &WlSurface)
enter event
Notification that this seat’s text-input focus is on a certain surface.
If client has created multiple text input objects, compositor must send this event to all of them.
When the seat has the keyboard capability the text-input focus follows the keyboard focus. This event sets the current surface for the text-input object.
sourcepub fn leave(&self, surface: &WlSurface)
pub fn leave(&self, surface: &WlSurface)
leave event
Notification that this seat’s text-input focus is no longer on a certain surface. The client should reset any preedit string previously set.
The leave notification clears the current surface. It is sent before the enter notification for the new focus. After leave event, compositor must ignore requests from any text input instances until next enter event.
When the seat has the keyboard capability the text-input focus follows the keyboard focus.
sourcepub fn preedit_string(
&self,
text: Option<String>,
cursor_begin: i32,
cursor_end: i32
)
pub fn preedit_string(
&self,
text: Option<String>,
cursor_begin: i32,
cursor_end: i32
)
pre-edit
Notify when a new composing text (pre-edit) should be set at the current cursor position. Any previously set composing text must be removed. Any previously existing selected text must be removed.
The argument text contains the pre-edit string buffer.
The parameters cursor_begin and cursor_end are counted in bytes relative to the beginning of the submitted text buffer. Cursor should be hidden when both are equal to -1.
They could be represented by the client as a line if both values are the same, or as a text highlight otherwise.
Values set with this event are double-buffered. They must be applied and reset to initial on the next zwp_text_input_v3.done event.
The initial value of text is an empty string, and cursor_begin, cursor_end and cursor_hidden are all 0.
sourcepub fn commit_string(&self, text: Option<String>)
pub fn commit_string(&self, text: Option<String>)
text commit
Notify when text should be inserted into the editor widget. The text to commit could be either just a single character after a key press or the result of some composing (pre-edit).
Values set with this event are double-buffered. They must be applied and reset to initial on the next zwp_text_input_v3.done event.
The initial value of text is an empty string.
sourcepub fn delete_surrounding_text(&self, before_length: u32, after_length: u32)
pub fn delete_surrounding_text(&self, before_length: u32, after_length: u32)
delete surrounding text
Notify when the text around the current cursor position should be deleted.
Before_length and after_length are the number of bytes before and after the current cursor index (excluding the selection) to delete.
If a preedit text is present, in effect before_length is counted from the beginning of it, and after_length from its end (see done event sequence).
Values set with this event are double-buffered. They must be applied and reset to initial on the next zwp_text_input_v3.done event.
The initial values of both before_length and after_length are 0.
sourcepub fn done(&self, serial: u32)
pub fn done(&self, serial: u32)
apply changes
Instruct the application to apply changes to state requested by the preedit_string, commit_string and delete_surrounding_text events. The state relating to these events is double-buffered, and each one modifies the pending state. This event replaces the current state with the pending state.
The application must proceed by evaluating the changes in the following order:
- Replace existing preedit string with the cursor.
- Delete requested surrounding text.
- Insert commit string with the cursor at its end.
- Calculate surrounding text to send.
- Insert new preedit text in cursor position.
- Place cursor inside preedit text.
The serial number reflects the last state of the zwp_text_input_v3 object known to the compositor. The value of the serial argument must be equal to the number of commit requests already issued on that object. When the client receives a done event with a serial different than the number of past commit requests, it must proceed as normal, except it should not change the current state of the zwp_text_input_v3 object.
Trait Implementations
sourceimpl AsRef<Resource<ZwpTextInputV3>> for ZwpTextInputV3
impl AsRef<Resource<ZwpTextInputV3>> for ZwpTextInputV3
sourceimpl Clone for ZwpTextInputV3
impl Clone for ZwpTextInputV3
sourcefn clone(&self) -> ZwpTextInputV3
fn clone(&self) -> ZwpTextInputV3
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ZwpTextInputV3
impl Debug for ZwpTextInputV3
sourceimpl From<Resource<ZwpTextInputV3>> for ZwpTextInputV3
impl From<Resource<ZwpTextInputV3>> for ZwpTextInputV3
sourceimpl From<ZwpTextInputV3> for Resource<ZwpTextInputV3>
impl From<ZwpTextInputV3> for Resource<ZwpTextInputV3>
sourcefn from(value: ZwpTextInputV3) -> Self
fn from(value: ZwpTextInputV3) -> Self
Converts to this type from the input type.
sourceimpl Interface for ZwpTextInputV3
impl Interface for ZwpTextInputV3
sourcefn c_interface() -> *const wl_interface
fn c_interface() -> *const wl_interface
Pointer to the C representation of this interface
sourceimpl PartialEq<ZwpTextInputV3> for ZwpTextInputV3
impl PartialEq<ZwpTextInputV3> for ZwpTextInputV3
sourcefn eq(&self, other: &ZwpTextInputV3) -> bool
fn eq(&self, other: &ZwpTextInputV3) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Eq for ZwpTextInputV3
impl StructuralEq for ZwpTextInputV3
impl StructuralPartialEq for ZwpTextInputV3
Auto Trait Implementations
impl !RefUnwindSafe for ZwpTextInputV3
impl Send for ZwpTextInputV3
impl Sync for ZwpTextInputV3
impl Unpin for ZwpTextInputV3
impl !UnwindSafe for ZwpTextInputV3
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
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. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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. Read more