winit/src/platform_impl/web/monitor.rs

54 lines
1.1 KiB
Rust
Raw Normal View History

2019-06-25 03:15:34 +02:00
use crate::dpi::{PhysicalPosition, PhysicalSize};
use crate::monitor::{MonitorHandle as RootMonitorHandle, VideoMode as RootVideoMode};
2019-06-25 03:15:34 +02:00
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MonitorHandle;
2019-06-25 03:15:34 +02:00
impl MonitorHandle {
pub fn scale_factor(&self) -> f64 {
2019-06-25 03:15:34 +02:00
1.0
}
pub fn position(&self) -> PhysicalPosition<i32> {
PhysicalPosition { x: 0, y: 0 }
2019-06-25 03:15:34 +02:00
}
pub fn name(&self) -> Option<String> {
None
2019-06-25 03:15:34 +02:00
}
pub fn size(&self) -> PhysicalSize<u32> {
PhysicalSize {
width: 0,
height: 0,
}
2019-06-25 03:15:34 +02:00
}
pub fn video_modes(&self) -> impl Iterator<Item = RootVideoMode> {
std::iter::empty()
}
2019-06-25 03:15:34 +02:00
}
2019-09-24 19:39:13 -04:00
2019-10-13 14:36:54 -04:00
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct VideoMode;
2019-09-24 19:39:13 -04:00
impl VideoMode {
pub fn size(&self) -> PhysicalSize<u32> {
2019-09-24 19:39:13 -04:00
unimplemented!();
}
pub fn bit_depth(&self) -> u16 {
unimplemented!();
}
pub fn refresh_rate(&self) -> u16 {
32
}
pub fn monitor(&self) -> RootMonitorHandle {
RootMonitorHandle {
inner: MonitorHandle,
}
2019-09-24 19:39:13 -04:00
}
}