pub struct TouchHandler {
webview_id: WebViewId,
pub current_sequence_id: TouchSequenceId,
touch_sequence_map: FxHashMap<TouchSequenceId, TouchSequenceInfo>,
pub(crate) pending_touch_input_events: RefCell<FxHashMap<InputEventId, PendingTouchInputEvent>>,
observing_frames_for_fling: Cell<bool>,
}Fields§
§webview_id: WebViewIdThe WebViewId of the WebView this TouchHandler is associated with.
current_sequence_id: TouchSequenceId§touch_sequence_map: FxHashMap<TouchSequenceId, TouchSequenceInfo>§pending_touch_input_events: RefCell<FxHashMap<InputEventId, PendingTouchInputEvent>>A set of InputEventIds for touch events that have been sent to the Constellation
and have not been handled yet.
observing_frames_for_fling: Cell<bool>Whether or not the FlingRefreshDriverObserver is currently observing frames for fling.
Implementations§
Source§impl TouchHandler
impl TouchHandler
pub(crate) fn new(webview_id: WebViewId) -> Self
pub(crate) fn set_handling_touch_move_for_touch_id( &mut self, sequence_id: TouchSequenceId, touch_id: TouchId, flag: TouchIdMoveTracking, )
pub(crate) fn is_handling_touch_move_for_touch_id( &self, sequence_id: TouchSequenceId, touch_id: TouchId, ) -> bool
pub(crate) fn prevent_click(&mut self, sequence_id: TouchSequenceId)
pub(crate) fn prevent_move(&mut self, sequence_id: TouchSequenceId)
Sourcepub(crate) fn move_allowed(&self, sequence_id: TouchSequenceId) -> bool
pub(crate) fn move_allowed(&self, sequence_id: TouchSequenceId) -> bool
Returns true if default move actions are allowed, false if prevented or the result is still pending.,
pub(crate) fn take_pending_touch_move_actions( &mut self, sequence_id: TouchSequenceId, ) -> Vec<ScrollZoomEvent>
pub(crate) fn remove_pending_touch_move_actions( &mut self, sequence_id: TouchSequenceId, )
pub(crate) fn try_remove_touch_sequence(&mut self, sequence_id: TouchSequenceId)
pub(crate) fn remove_touch_sequence(&mut self, sequence_id: TouchSequenceId)
fn get_current_touch_sequence_mut(&mut self) -> &mut TouchSequenceInfo
fn try_get_current_touch_sequence(&self) -> Option<&TouchSequenceInfo>
fn try_get_current_touch_sequence_mut( &mut self, ) -> Option<&mut TouchSequenceInfo>
fn get_touch_sequence(&self, sequence_id: TouchSequenceId) -> &TouchSequenceInfo
pub(crate) fn get_touch_sequence_mut( &mut self, sequence_id: TouchSequenceId, ) -> Option<&mut TouchSequenceInfo>
pub(crate) fn on_touch_down( &mut self, touch_id: TouchId, point: Point2D<f32, DevicePixel>, )
pub(crate) fn notify_new_frame_start(&mut self) -> Option<FlingAction>
pub(crate) fn stop_fling_if_needed(&mut self)
pub(crate) fn on_touch_move( &mut self, touch_id: TouchId, point: Point2D<f32, DevicePixel>, scale: f32, ) -> Option<ScrollZoomEvent>
pub(crate) fn on_touch_up( &mut self, touch_id: TouchId, point: Point2D<f32, DevicePixel>, )
pub(crate) fn on_touch_cancel( &mut self, touch_id: TouchId, _point: Point2D<f32, DevicePixel>, )
pub(crate) fn get_hit_test_result_cache_value( &self, ) -> Option<PaintHitTestResult>
pub(crate) fn set_hit_test_result_cache_value( &mut self, value: PaintHitTestResult, device_pixels_per_page: Scale<f32, CSSPixel, DevicePixel>, )
pub(crate) fn add_pending_touch_input_event( &self, id: InputEventId, touch_id: TouchId, event_type: TouchEventType, )
pub(crate) fn take_pending_touch_input_event( &self, id: InputEventId, ) -> Option<PendingTouchInputEvent>
pub(crate) fn add_touch_move_refresh_observer_if_necessary( &self, refresh_driver: Rc<BaseRefreshDriver>, repaint_reason: &Cell<RepaintReason>, )
Auto Trait Implementations§
impl !Freeze for TouchHandler
impl !RefUnwindSafe for TouchHandler
impl Send for TouchHandler
impl !Sync for TouchHandler
impl Unpin for TouchHandler
impl UnsafeUnpin for TouchHandler
impl UnwindSafe for TouchHandler
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert