Struct smithay_client_toolkit::seat::SeatState
source · pub struct SeatState { /* private fields */ }
Implementations§
source§impl SeatState
impl SeatState
sourcepub 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>
Available on crate features xkbcommon
and calloop
only.
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>
xkbcommon
and calloop
only.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.
sourcepub 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>
Available on crate features xkbcommon
and calloop
only.
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>
xkbcommon
and calloop
only.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
impl SeatState
sourcepub fn get_keyboard<D, T: 'static>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
rmlvo: Option<RMLVO>,
) -> Result<WlKeyboard, KeyboardError>
Available on crate feature xkbcommon
only.
pub fn get_keyboard<D, T: 'static>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, rmlvo: Option<RMLVO>, ) -> Result<WlKeyboard, KeyboardError>
xkbcommon
only.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.
sourcepub 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,
Available on crate feature xkbcommon
only.
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,
xkbcommon
only.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
impl SeatState
pub fn new<D: Dispatch<WlSeat, SeatData> + 'static>( global_list: &GlobalList, qh: &QueueHandle<D>, ) -> SeatState
sourcepub fn info(&self, seat: &WlSeat) -> Option<SeatInfo>
pub fn info(&self, seat: &WlSeat) -> Option<SeatInfo>
Returns information about a seat.
This will return None
if the seat is dead.
sourcepub fn get_pointer<D>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
) -> Result<WlPointer, SeatError>
pub fn get_pointer<D>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, ) -> Result<WlPointer, SeatError>
Creates a pointer from a seat.
§Errors
This will return SeatError::UnsupportedCapability
if the seat does not support a pointer.
sourcepub 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,
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.
sourcepub fn get_pointer_with_data<D, U>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
pointer_data: U,
) -> Result<WlPointer, SeatError>
pub fn get_pointer_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, pointer_data: U, ) -> Result<WlPointer, SeatError>
Creates a pointer from a seat.
§Errors
This will return SeatError::UnsupportedCapability
if the seat does not support a pointer.
sourcepub 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,
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.
sourcepub fn get_touch<D>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
) -> Result<WlTouch, SeatError>
pub fn get_touch<D>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, ) -> Result<WlTouch, SeatError>
Creates a touch handle from a seat.
§Errors
This will return SeatError::UnsupportedCapability
if the seat does not support touch.
sourcepub fn get_touch_with_data<D, U>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
udata: U,
) -> Result<WlTouch, SeatError>
pub fn get_touch_with_data<D, U>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, udata: U, ) -> Result<WlTouch, SeatError>
Creates a touch handle from a seat.
§Errors
This will return SeatError::UnsupportedCapability
if the seat does not support touch.
Trait Implementations§
source§impl<D, U> Dispatch<WlKeyboard, U, D> for SeatState
Available on crate feature xkbcommon
only.
impl<D, U> Dispatch<WlKeyboard, U, D> for SeatState
xkbcommon
only.source§fn event(
data: &mut D,
keyboard: &WlKeyboard,
event: Event,
udata: &U,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( data: &mut D, keyboard: &WlKeyboard, event: Event, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )
source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
source§impl<D, U> Dispatch<WlPointer, U, D> for SeatState
impl<D, U> Dispatch<WlPointer, U, D> for SeatState
source§fn event(
data: &mut D,
pointer: &WlPointer,
event: Event,
udata: &U,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( data: &mut D, pointer: &WlPointer, event: Event, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )
source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
source§impl<D> Dispatch<WlSeat, SeatData, D> for SeatState
impl<D> Dispatch<WlSeat, SeatData, D> for SeatState
source§fn event(
state: &mut D,
seat: &WlSeat,
event: Event,
data: &SeatData,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( state: &mut D, seat: &WlSeat, event: Event, data: &SeatData, conn: &Connection, qh: &QueueHandle<D>, )
source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
source§impl<D, U> Dispatch<WlTouch, U, D> for SeatState
impl<D, U> Dispatch<WlTouch, U, D> for SeatState
source§fn event(
data: &mut D,
touch: &WlTouch,
event: TouchEvent,
udata: &U,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( data: &mut D, touch: &WlTouch, event: TouchEvent, udata: &U, conn: &Connection, qh: &QueueHandle<D>, )
source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
source§impl<D> RegistryHandler<D> for SeatState
impl<D> RegistryHandler<D> for SeatState
source§fn new_global(
state: &mut D,
conn: &Connection,
qh: &QueueHandle<D>,
name: u32,
interface: &str,
_: u32,
)
fn new_global( state: &mut D, conn: &Connection, qh: &QueueHandle<D>, name: u32, interface: &str, _: u32, )
source§fn remove_global(
state: &mut D,
conn: &Connection,
qh: &QueueHandle<D>,
name: u32,
interface: &str,
)
fn remove_global( state: &mut D, conn: &Connection, qh: &QueueHandle<D>, name: u32, interface: &str, )
Auto Trait Implementations§
impl Freeze for SeatState
impl !RefUnwindSafe for SeatState
impl Send for SeatState
impl Sync for SeatState
impl Unpin for SeatState
impl !UnwindSafe for SeatState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.