chore: remove platform DeviceId

The same as for `WindowId`.
This commit is contained in:
Kirill Chibisov 2024-10-11 11:15:54 +03:00 committed by GitHub
parent da2268ae22
commit 4e3165f3d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 79 additions and 123 deletions

View file

@ -585,7 +585,25 @@ impl From<MouseButton> for ButtonSource {
/// on-screen cursor and keyboard focus) or physical. Virtual devices typically aggregate inputs
/// from multiple physical devices.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId(pub(crate) platform_impl::DeviceId);
pub struct DeviceId(i64);
impl DeviceId {
/// Convert the [`DeviceId`] into the underlying integer.
///
/// This is useful if you need to pass the ID across an FFI boundary, or store it in an atomic.
#[allow(dead_code)]
pub(crate) const fn into_raw(self) -> i64 {
self.0
}
/// Construct a [`DeviceId`] from the underlying integer.
///
/// This should only be called with integers returned from [`DeviceId::into_raw`].
#[allow(dead_code)]
pub(crate) const fn from_raw(id: i64) -> Self {
Self(id)
}
}
/// Identifier of a finger in a touch event.
///