mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
3a1e694c2f
* Begin implementing DPI generics * Fix multithreaded example * Format * Fix serde test * hopefully fix most of the errors * Fix dpi module errors * More error fixings * Format * fix macos errors * Another error pass * Replace bad type signatures * more fixins
40 lines
980 B
Rust
40 lines
980 B
Rust
#![cfg(feature = "serde")]
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
use winit::{
|
|
dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize},
|
|
event::{
|
|
ElementState, KeyboardInput, ModifiersState, MouseButton, MouseScrollDelta, TouchPhase,
|
|
VirtualKeyCode,
|
|
},
|
|
window::CursorIcon,
|
|
};
|
|
|
|
#[allow(dead_code)]
|
|
fn needs_serde<S: Serialize + Deserialize<'static>>() {}
|
|
|
|
#[test]
|
|
fn window_serde() {
|
|
needs_serde::<CursorIcon>();
|
|
}
|
|
|
|
#[test]
|
|
fn events_serde() {
|
|
needs_serde::<KeyboardInput>();
|
|
needs_serde::<TouchPhase>();
|
|
needs_serde::<ElementState>();
|
|
needs_serde::<MouseButton>();
|
|
needs_serde::<MouseScrollDelta>();
|
|
needs_serde::<VirtualKeyCode>();
|
|
needs_serde::<ModifiersState>();
|
|
}
|
|
|
|
#[test]
|
|
fn dpi_serde() {
|
|
needs_serde::<LogicalPosition<f64>>();
|
|
needs_serde::<PhysicalPosition<i32>>();
|
|
needs_serde::<PhysicalPosition<f64>>();
|
|
needs_serde::<LogicalSize<f64>>();
|
|
needs_serde::<PhysicalSize<u32>>();
|
|
}
|