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>where
D: Dispatch<WlKeyboard, KeyboardData<T>> + KeyboardHandler + 'static,
T: 'static,
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.
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>where
D: Dispatch<WlKeyboard, U> + KeyboardHandler + 'static,
U: KeyboardDataExt + 'static,
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
impl SeatState
sourcepub fn get_keyboard<D, T: 'static>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
rmlvo: Option<RMLVO>,
) -> Result<WlKeyboard, KeyboardError>
pub fn get_keyboard<D, T: 'static>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, rmlvo: Option<RMLVO>, ) -> Result<WlKeyboard, KeyboardError>
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,
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
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>where
D: Dispatch<WlPointer, PointerData> + PointerHandler + 'static,
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.
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>where
D: Dispatch<WlPointer, U> + PointerHandler + 'static,
U: PointerDataExt + 'static,
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.
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>where
D: Dispatch<WlTouch, TouchData> + TouchHandler + 'static,
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.
sourcepub 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,
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<D, U> Dispatch<WlKeyboard, U, D> for SeatStatewhere
D: Dispatch<WlKeyboard, U> + KeyboardHandler,
U: KeyboardDataExt,
impl<D, U> Dispatch<WlKeyboard, U, D> for SeatStatewhere
D: Dispatch<WlKeyboard, U> + KeyboardHandler,
U: KeyboardDataExt,
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>, )
§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 SeatStatewhere
D: Dispatch<WlPointer, U> + PointerHandler,
U: PointerDataExt,
impl<D, U> Dispatch<WlPointer, U, D> for SeatStatewhere
D: Dispatch<WlPointer, U> + PointerHandler,
U: PointerDataExt,
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>, )
§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 SeatStatewhere
D: Dispatch<WlSeat, SeatData> + SeatHandler,
impl<D> Dispatch<WlSeat, SeatData, D> for SeatStatewhere
D: Dispatch<WlSeat, SeatData> + SeatHandler,
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>, )
§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 SeatStatewhere
D: Dispatch<WlTouch, U> + TouchHandler,
U: TouchDataExt,
impl<D, U> Dispatch<WlTouch, U, D> for SeatStatewhere
D: Dispatch<WlTouch, U> + TouchHandler,
U: TouchDataExt,
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>, )
§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.