Struct SeatState
pub struct SeatState { /* private fields */ }wayland and Linux only.Implementations§
§impl SeatState
impl SeatState
pub fn get_keyboard_with_repeat<D, T>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
rmlvo: Option<RMLVO>,
loop_handle: LoopHandle<'static, T>,
callback: Box<dyn FnMut(&mut T, &WlKeyboard, KeyEvent)>,
) -> Result<WlKeyboard, KeyboardError>
pub fn get_keyboard_with_repeat<D, T>( &mut self, qh: &QueueHandle<D>, seat: &WlSeat, rmlvo: Option<RMLVO>, loop_handle: LoopHandle<'static, T>, callback: Box<dyn FnMut(&mut T, &WlKeyboard, KeyEvent)>, ) -> Result<WlKeyboard, KeyboardError>
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.
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: Box<dyn FnMut(&mut <U as KeyboardDataExt>::State, &WlKeyboard, KeyEvent)>,
) -> Result<WlKeyboard, KeyboardError>
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: Box<dyn FnMut(&mut <U as KeyboardDataExt>::State, &WlKeyboard, KeyEvent)>, ) -> Result<WlKeyboard, KeyboardError>
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.
§impl SeatState
impl SeatState
pub fn get_keyboard<D, T>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
rmlvo: Option<RMLVO>,
) -> Result<WlKeyboard, KeyboardError>where
T: 'static,
D: Dispatch<WlKeyboard, KeyboardData<T>> + SeatHandler + KeyboardHandler + 'static,
pub fn get_keyboard<D, T>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
rmlvo: Option<RMLVO>,
) -> Result<WlKeyboard, KeyboardError>where
T: 'static,
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.
This keyboard only sends key repeats if they are issued by the compositor. See wl_keyboard version 10.
§Errors
This will return SeatError::UnsupportedCapability if the seat does not support a keyboard.
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,
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.
§impl SeatState
impl SeatState
pub fn new<D>(global_list: &GlobalList, qh: &QueueHandle<D>) -> SeatState
pub 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.
pub 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.
pub fn get_pointer_with_theme<D, S>(
&mut self,
qh: &QueueHandle<D>,
seat: &WlSeat,
shm: &WlShm,
surface: WlSurface,
theme: ThemeSpec<'_>,
) -> Result<ThemedPointer, 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, 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.
pub 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.
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,
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.
pub 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.
pub 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§
§impl<D, U> Dispatch<WlKeyboard, U, D> for SeatState
impl<D, U> Dispatch<WlKeyboard, U, D> for SeatState
§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> ⓘ
§impl<D, U> Dispatch<WlPointer, U, D> for SeatState
impl<D, U> Dispatch<WlPointer, U, D> for SeatState
§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> ⓘ
§impl<D> Dispatch<WlSeat, SeatData, D> for SeatState
impl<D> Dispatch<WlSeat, SeatData, D> for SeatState
§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> ⓘ
§impl<D, U> Dispatch<WlTouch, U, D> for SeatState
impl<D, U> Dispatch<WlTouch, U, D> for SeatState
§fn event(
data: &mut D,
touch: &WlTouch,
event: Event,
udata: &U,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( data: &mut D, touch: &WlTouch, 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> ⓘ
§impl Dispatch<WpCursorShapeDeviceV1, GlobalData, WinitState> for SeatState
impl Dispatch<WpCursorShapeDeviceV1, GlobalData, WinitState> for SeatState
§fn event(
_: &mut WinitState,
_: &WpCursorShapeDeviceV1,
_: <WpCursorShapeDeviceV1 as Proxy>::Event,
_: &GlobalData,
_: &Connection,
_: &QueueHandle<WinitState>,
)
fn event( _: &mut WinitState, _: &WpCursorShapeDeviceV1, _: <WpCursorShapeDeviceV1 as Proxy>::Event, _: &GlobalData, _: &Connection, _: &QueueHandle<WinitState>, )
§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData> ⓘ
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData> ⓘ
§impl Dispatch<WpCursorShapeManagerV1, GlobalData, WinitState> for SeatState
impl Dispatch<WpCursorShapeManagerV1, GlobalData, WinitState> for SeatState
§fn event(
_: &mut WinitState,
_: &WpCursorShapeManagerV1,
_: <WpCursorShapeManagerV1 as Proxy>::Event,
_: &GlobalData,
_: &Connection,
_: &QueueHandle<WinitState>,
)
fn event( _: &mut WinitState, _: &WpCursorShapeManagerV1, _: <WpCursorShapeManagerV1 as Proxy>::Event, _: &GlobalData, _: &Connection, _: &QueueHandle<WinitState>, )
§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData> ⓘ
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData> ⓘ
§impl<D> RegistryHandler<D> for SeatState
impl<D> RegistryHandler<D> for SeatState
§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, )
§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 UnsafeUnpin for SeatState
impl !UnwindSafe for SeatState
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> 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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more