mirror of
https://github.com/storytold/winit.git
synced 2026-11-23 12:50:47 +01:00
* fix: use a 'static lifetime for the web backend's `Event` types * implement hidpi for stdweb (web-sys wip?) * fix: make all canvas resizes go through backend::set_canvas_size * update Window docs for web, make `inner/outer_position` return the position in the viewport
52 lines
1.0 KiB
Rust
52 lines
1.0 KiB
Rust
use crate::dpi::{PhysicalPosition, PhysicalSize};
|
|
use crate::monitor::{MonitorHandle, VideoMode};
|
|
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
|
pub struct Handle;
|
|
|
|
impl Handle {
|
|
pub fn hidpi_factor(&self) -> f64 {
|
|
1.0
|
|
}
|
|
|
|
pub fn position(&self) -> PhysicalPosition<i32> {
|
|
PhysicalPosition { x: 0, y: 0 }
|
|
}
|
|
|
|
pub fn name(&self) -> Option<String> {
|
|
None
|
|
}
|
|
|
|
pub fn size(&self) -> PhysicalSize<u32> {
|
|
PhysicalSize {
|
|
width: 0,
|
|
height: 0,
|
|
}
|
|
}
|
|
|
|
pub fn video_modes(&self) -> impl Iterator<Item = VideoMode> {
|
|
std::iter::empty()
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
|
pub struct Mode;
|
|
|
|
impl Mode {
|
|
pub fn size(&self) -> PhysicalSize<u32> {
|
|
unimplemented!();
|
|
}
|
|
|
|
pub fn bit_depth(&self) -> u16 {
|
|
unimplemented!();
|
|
}
|
|
|
|
pub fn refresh_rate(&self) -> u16 {
|
|
32
|
|
}
|
|
|
|
pub fn monitor(&self) -> MonitorHandle {
|
|
MonitorHandle { inner: Handle }
|
|
}
|
|
}
|