Skip to main content

euv_core/app/gesture/
enum.rs

1use super::*;
2
3/// Exclusive gesture owner currently holding the active pointer stream in `GestureArena`.
4#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
5pub enum ActiveGesture {
6    /// No pointer gesture is currently active.
7    #[default]
8    Idle,
9    /// Primary contact began and stays within touch slop awaiting tap or directional disambiguation.
10    Pending,
11    /// Exclusive vertical scroll ownership claimed by the target scrollable container.
12    VerticalScroll(NodeId),
13    /// Exclusive horizontal scroll ownership claimed by the target scrollable container.
14    HorizontalScroll(NodeId),
15    /// Exclusive horizontal route or page swipe gesture driving `Context::swipe_drag_offset`.
16    RouteSwipe,
17    /// Exclusive direct drag interaction claimed by a slider, drawer/sheet grabber, or canvas control.
18    DirectDrag(NodeId),
19    /// Exclusive desktop scrollbar thumb drag claimed by a scroll container.
20    ScrollbarDrag(NodeId),
21    /// Exclusive pointer text-selection drag claimed by a selectable `NodeKind::Text` node.
22    TextSelection(NodeId),
23    /// Active multi-touch pinch gesture involving two or more simultaneous contacts.
24    Pinch,
25}
26
27/// Arbitration outcome produced when evaluating touch movement against `GestureArena`.
28#[derive(Clone, Copy, Debug, Eq, PartialEq)]
29pub(crate) enum GestureResolution {
30    /// Contact remains within touch slop or awaits dominant-axis hysteresis.
31    StillPending,
32    /// An exclusive gesture won ownership and competing press/tap/hover targets must cancel immediately.
33    Won(ActiveGesture),
34    /// Contact exceeded slop with no scroll or swipe winner, cancelling pending tap/click cleanly.
35    CancelPending,
36}