Struct smithay_client_toolkit::seat::SeatState

source ·
pub struct SeatState { /* private fields */ }

Implementations§

source§

impl SeatState

source

pub fn get_keyboard_with_repeat<D, T>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, rmlvo: Option<RMLVO>, loop_handle: LoopHandle<'static, T>, callback: RepeatCallback<T>, ) -> Result<WlKeyboard, KeyboardError>
where D: Dispatch<WlKeyboard, KeyboardData<T>> + KeyboardHandler + 'static, T: 'static,

Creates a keyboard from a seat.

This function returns an EventSource that indicates when a key press is going to repeat.

This keyboard implementation uses libxkbcommon for the keymap.

Typically the compositor will provide a keymap, but you may specify your own keymap using the rmlvo field.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a keyboard.

source

pub fn get_keyboard_with_repeat_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, udata: U, loop_handle: LoopHandle<'static, <U as KeyboardDataExt>::State>, callback: RepeatCallback<<U as KeyboardDataExt>::State>, ) -> Result<WlKeyboard, KeyboardError>
where D: Dispatch<WlKeyboard, U> + KeyboardHandler + 'static, U: KeyboardDataExt + 'static,

Creates a keyboard from a seat.

This function returns an EventSource that indicates when a key press is going to repeat.

This keyboard implementation uses libxkbcommon for the keymap.

Typically the compositor will provide a keymap, but you may specify your own keymap using the rmlvo field.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a keyboard.

source§

impl SeatState

source

pub fn get_keyboard<D, T: 'static>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, rmlvo: Option<RMLVO>, ) -> Result<WlKeyboard, KeyboardError>
where D: Dispatch<WlKeyboard, KeyboardData<T>> + SeatHandler + KeyboardHandler + 'static,

Creates a keyboard from a seat.

This keyboard implementation uses libxkbcommon for the keymap.

Typically the compositor will provide a keymap, but you may specify your own keymap using the rmlvo field.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a keyboard.

source

pub fn get_keyboard_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, udata: U, ) -> Result<WlKeyboard, KeyboardError>
where D: Dispatch<WlKeyboard, U> + SeatHandler + KeyboardHandler + 'static, U: KeyboardDataExt + 'static,

Creates a keyboard from a seat.

This keyboard implementation uses libxkbcommon for the keymap.

Typically the compositor will provide a keymap, but you may specify your own keymap using the rmlvo field.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a keyboard.

source§

impl SeatState

source

pub fn new<D: Dispatch<WlSeat, SeatData> + 'static>( global_list: &GlobalList, qh: &QueueHandle<D>, ) -> SeatState

source

pub fn seats(&self) -> impl Iterator<Item = WlSeat>

Returns an iterator over all the seats.

source

pub fn info(&self, seat: &WlSeat) -> Option<SeatInfo>

Returns information about a seat.

This will return None if the seat is dead.

source

pub fn get_pointer<D>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, ) -> Result<WlPointer, SeatError>
where D: Dispatch<WlPointer, PointerData> + PointerHandler + 'static,

Creates a pointer from a seat.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a pointer.

source

pub fn get_pointer_with_theme<D, S>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, shm: &WlShm, surface: WlSurface, theme: ThemeSpec<'_>, ) -> Result<ThemedPointer<PointerData>, SeatError>
where D: Dispatch<WlPointer, PointerData> + Dispatch<WlSurface, S> + Dispatch<WpCursorShapeManagerV1, GlobalData> + Dispatch<WpCursorShapeDeviceV1, GlobalData> + PointerHandler + 'static, S: SurfaceDataExt + 'static,

Creates a pointer from a seat with the provided theme.

This will use CursorShapeManager under the hood when it’s available.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a pointer.

source

pub fn get_pointer_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, pointer_data: U, ) -> Result<WlPointer, SeatError>
where D: Dispatch<WlPointer, U> + PointerHandler + 'static, U: PointerDataExt + 'static,

Creates a pointer from a seat.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a pointer.

source

pub fn get_pointer_with_theme_and_data<D, S, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, shm: &WlShm, surface: WlSurface, theme: ThemeSpec<'_>, pointer_data: U, ) -> Result<ThemedPointer<U>, SeatError>
where D: Dispatch<WlPointer, U> + Dispatch<WlSurface, S> + Dispatch<WpCursorShapeManagerV1, GlobalData> + Dispatch<WpCursorShapeDeviceV1, GlobalData> + PointerHandler + 'static, S: SurfaceDataExt + 'static, U: PointerDataExt + 'static,

Creates a pointer from a seat with the provided theme and data.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support a pointer.

source

pub fn get_touch<D>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, ) -> Result<WlTouch, SeatError>
where D: Dispatch<WlTouch, TouchData> + TouchHandler + 'static,

Creates a touch handle from a seat.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support touch.

source

pub fn get_touch_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, udata: U, ) -> Result<WlTouch, SeatError>
where D: Dispatch<WlTouch, U> + TouchHandler + 'static, U: TouchDataExt + 'static,

Creates a touch handle from a seat.

§Errors

This will return SeatError::UnsupportedCapability if the seat does not support touch.

Trait Implementations§

source§

impl Debug for SeatState

source§

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

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

impl<D, U> Dispatch<WlKeyboard, U, D> for SeatState
where D: Dispatch<WlKeyboard, U> + KeyboardHandler, U: KeyboardDataExt,

source§

fn event( data: &mut D, keyboard: &WlKeyboard, event: Event, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )

Called when an event from the server is processed Read more
§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl<D, U> Dispatch<WlPointer, U, D> for SeatState
where D: Dispatch<WlPointer, U> + PointerHandler, U: PointerDataExt,

source§

fn event( data: &mut D, pointer: &WlPointer, event: Event, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )

Called when an event from the server is processed Read more
§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl<D> Dispatch<WlSeat, SeatData, D> for SeatState
where D: Dispatch<WlSeat, SeatData> + SeatHandler,

source§

fn event( state: &mut D, seat: &WlSeat, event: Event, data: &SeatData, conn: &Connection, qh: &QueueHandle<D>, )

Called when an event from the server is processed Read more
§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl<D, U> Dispatch<WlTouch, U, D> for SeatState
where D: Dispatch<WlTouch, U> + TouchHandler, U: TouchDataExt,

source§

fn event( data: &mut D, touch: &WlTouch, event: TouchEvent, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )

Called when an event from the server is processed Read more
§

fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>

Method used to initialize the user-data of objects created by events Read more
source§

impl<D> RegistryHandler<D> for SeatState
where D: Dispatch<WlSeat, SeatData> + SeatHandler + ProvidesRegistryState + 'static,

source§

fn new_global( state: &mut D, conn: &Connection, qh: &QueueHandle<D>, name: u32, interface: &str, _: u32, )

Called when a new global has been advertised by the compositor. Read more
source§

fn remove_global( state: &mut D, conn: &Connection, qh: &QueueHandle<D>, name: u32, interface: &str, )

Called when a global has been destroyed by the compositor. Read more

Auto Trait Implementations§

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
§

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

§

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.
§

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.
§

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.
§

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.
§

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

§

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

§

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>,

§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more