Merge branch 'ios-support-wip' into feature/touch-support

This commit is contained in:
Héctor Ramón Jiménez 2020-12-15 06:13:19 +01:00
commit 09110a93b0
11 changed files with 186 additions and 41 deletions

35
native/src/touch.rs Normal file
View file

@ -0,0 +1,35 @@
//! Build touch events.
use crate::Point;
/// A touch interaction.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Touch {
/// The finger of the touch.
pub finger: Finger,
/// The position of the touch.
pub position: Point,
/// The state of the touch.
pub phase: Phase,
}
/// A unique identifier representing a finger on a touch interaction.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Finger(pub u64);
/// The state of a touch interaction.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Phase {
/// A touch interaction was started.
Started,
/// An on-going touch interaction was moved.
Moved,
/// A touch interaction was ended.
Ended,
/// A touch interaction was canceled.
Canceled,
}