pub struct PointerInnerHandle<'a, D: SeatHandler> { /* private fields */ }Expand description
This inner handle is accessed from inside a pointer grab logic, and directly sends event to the client
Implementations§
Source§impl<D: SeatHandler + 'static> PointerInnerHandle<'_, D>
impl<D: SeatHandler + 'static> PointerInnerHandle<'_, D>
Sourcepub fn set_grab<G: PointerGrab<D> + 'static>(
&mut self,
handler: &mut dyn PointerGrab<D>,
data: &mut D,
serial: Serial,
focus: Focus,
grab: G,
)
pub fn set_grab<G: PointerGrab<D> + 'static>( &mut self, handler: &mut dyn PointerGrab<D>, data: &mut D, serial: Serial, focus: Focus, grab: G, )
Change the current grab on this pointer to the provided grab
Overwrites any current grab.
Sourcepub fn unset_grab(
&mut self,
handler: &mut dyn PointerGrab<D>,
data: &mut D,
serial: Serial,
time: u32,
restore_focus: bool,
)
pub fn unset_grab( &mut self, handler: &mut dyn PointerGrab<D>, data: &mut D, serial: Serial, time: u32, restore_focus: bool, )
Remove any current grab on this pointer, resetting it to the default behavior
This will also restore the focus of the underlying pointer if restore_focus
is true
Sourcepub fn current_focus(
&self,
) -> Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>
pub fn current_focus( &self, ) -> Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>
Access the current focus of this pointer
Sourcepub fn current_location(&self) -> Point<f64, Logical>
pub fn current_location(&self) -> Point<f64, Logical>
Access the current location of this pointer in the global space
Sourcepub fn current_pressed(&self) -> &[u32]
pub fn current_pressed(&self) -> &[u32]
A list of the currently physically pressed buttons
This still includes buttons that your grab have intercepted and not sent to the client.
Sourcepub fn motion(
&mut self,
data: &mut D,
focus: Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &MotionEvent,
)
pub fn motion( &mut self, data: &mut D, focus: Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>, event: &MotionEvent, )
Notify that the pointer moved
You provide the new location of the pointer, in the form of:
- The coordinates of the pointer in the global compositor space
- The surface on top of which the cursor is, and the coordinates of its
origin in the global compositor space (or
Noneof the pointer is not on top of a client surface).
This will internally take care of notifying the appropriate client objects of enter/motion/leave events.
Sourcepub fn relative_motion(
&mut self,
data: &mut D,
focus: Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>,
event: &RelativeMotionEvent,
)
pub fn relative_motion( &mut self, data: &mut D, focus: Option<(<D as SeatHandler>::PointerFocus, Point<f64, Logical>)>, event: &RelativeMotionEvent, )
Notify about relative pointer motion
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the relative pointer protocol.
Notify that a button was pressed
This will internally send the appropriate button event to the client objects matching with the currently focused surface.
Sourcepub fn axis(&mut self, data: &mut D, details: AxisFrame)
pub fn axis(&mut self, data: &mut D, details: AxisFrame)
Notify that an axis was scrolled
This will internally send the appropriate axis events to the client objects matching with the currently focused surface.
Sourcepub fn frame(&mut self, data: &mut D)
pub fn frame(&mut self, data: &mut D)
End of a pointer frame
This will internally send the appropriate frame event to the client objects matching with the currently focused surface.
Sourcepub fn gesture_swipe_begin(
&mut self,
data: &mut D,
event: &GestureSwipeBeginEvent,
)
pub fn gesture_swipe_begin( &mut self, data: &mut D, event: &GestureSwipeBeginEvent, )
Notify about swipe gesture begin
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_swipe_update(
&mut self,
data: &mut D,
event: &GestureSwipeUpdateEvent,
)
pub fn gesture_swipe_update( &mut self, data: &mut D, event: &GestureSwipeUpdateEvent, )
Notify about swipe gesture update
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_swipe_end(&mut self, data: &mut D, event: &GestureSwipeEndEvent)
pub fn gesture_swipe_end(&mut self, data: &mut D, event: &GestureSwipeEndEvent)
Notify about swipe gesture end
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_pinch_begin(
&mut self,
data: &mut D,
event: &GesturePinchBeginEvent,
)
pub fn gesture_pinch_begin( &mut self, data: &mut D, event: &GesturePinchBeginEvent, )
Notify about pinch gesture begin
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_pinch_update(
&mut self,
data: &mut D,
event: &GesturePinchUpdateEvent,
)
pub fn gesture_pinch_update( &mut self, data: &mut D, event: &GesturePinchUpdateEvent, )
Notify about pinch gesture update
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_pinch_end(&mut self, data: &mut D, event: &GesturePinchEndEvent)
pub fn gesture_pinch_end(&mut self, data: &mut D, event: &GesturePinchEndEvent)
Notify about pinch gesture end
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_hold_begin(
&mut self,
data: &mut D,
event: &GestureHoldBeginEvent,
)
pub fn gesture_hold_begin( &mut self, data: &mut D, event: &GestureHoldBeginEvent, )
Notify about hold gesture begin
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Sourcepub fn gesture_hold_end(&mut self, data: &mut D, event: &GestureHoldEndEvent)
pub fn gesture_hold_end(&mut self, data: &mut D, event: &GestureHoldEndEvent)
Notify about hold gesture end
This will internally send the appropriate button event to the client objects matching with the currently focused surface, if the client uses the pointer gestures protocol.
Trait Implementations§
Auto Trait Implementations§
impl<'a, D> Freeze for PointerInnerHandle<'a, D>
impl<'a, D> !RefUnwindSafe for PointerInnerHandle<'a, D>
impl<'a, D> Send for PointerInnerHandle<'a, D>
impl<'a, D> !Sync for PointerInnerHandle<'a, D>
impl<'a, D> Unpin for PointerInnerHandle<'a, D>
impl<'a, D> !UnwindSafe for PointerInnerHandle<'a, D>
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.