pub struct MouseCursorManager {
pub fallback_mouse_cursor: MouseCursorRef,
/* private fields */
}Expand description
Maintains the state of mouse cursors and manages how cursors are searched for.
This is typically created as a global singleton and owned by MouseTracker.
Fields§
§fallback_mouse_cursor: MouseCursorRefThe mouse cursor to use if all cursor candidates choose to defer.
See also:
MouseCursor.defer, the mouse cursor object to use to defer.
Implementations§
Source§impl MouseCursorManager
impl MouseCursorManager
Sourcepub fn new(fallback_mouse_cursor: MouseCursorRef) -> MouseCursorManager
pub fn new(fallback_mouse_cursor: MouseCursorRef) -> MouseCursorManager
Create a MouseCursorManager by specifying the fallback cursor.
The fallback_mouse_cursor must not be MouseCursor.defer.
Sourcepub fn debug_device_active_cursor(&self, device: i64) -> Option<MouseCursorRef>
pub fn debug_device_active_cursor(&self, device: i64) -> Option<MouseCursorRef>
Returns the active mouse cursor of a device.
The return value is the last MouseCursor activated onto this device,
even if the activation failed.
This function is only active in debug mode: in release it returns None.
Sourcepub fn handle_device_cursor_update(
&mut self,
platform: &dyn Platform,
view: ViewId,
device: i64,
triggering_event: Option<&PointerEvent>,
cursor_candidates: impl IntoIterator<Item = MouseCursorRef>,
)
pub fn handle_device_cursor_update( &mut self, platform: &dyn Platform, view: ViewId, device: i64, triggering_event: Option<&PointerEvent>, cursor_candidates: impl IntoIterator<Item = MouseCursorRef>, )
Handles the changes that cause a pointer device to have a new list of mouse cursor candidates.
This change can be caused by a pointer event, in which case
triggering_event should not be None, or by other changes, such as when a
widget has moved under a still mouse, which is detected after the current
frame is complete. In either case, cursor_candidates should be the list
of cursors at the location of the mouse in hit-test order.
view is the one the device is on, from its latest event: the cursor is that view’s
host’s to show, and the session asks it.