On Web, never return a MonitorHandle (#3051)
This commit is contained in:
parent
48abf52aac
commit
a3cba838ea
7 changed files with 20 additions and 32 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::iter::Empty;
|
||||
|
||||
use crate::dpi::{PhysicalPosition, PhysicalSize};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
|
@ -5,30 +7,27 @@ pub struct MonitorHandle;
|
|||
|
||||
impl MonitorHandle {
|
||||
pub fn scale_factor(&self) -> f64 {
|
||||
1.0
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
pub fn position(&self) -> PhysicalPosition<i32> {
|
||||
PhysicalPosition { x: 0, y: 0 }
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
pub fn name(&self) -> Option<String> {
|
||||
None
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
pub fn refresh_rate_millihertz(&self) -> Option<u32> {
|
||||
None
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
pub fn size(&self) -> PhysicalSize<u32> {
|
||||
PhysicalSize {
|
||||
width: 0,
|
||||
height: 0,
|
||||
}
|
||||
unreachable!()
|
||||
}
|
||||
|
||||
pub fn video_modes(&self) -> impl Iterator<Item = VideoMode> {
|
||||
std::iter::empty()
|
||||
pub fn video_modes(&self) -> Empty<VideoMode> {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,18 +36,18 @@ pub struct VideoMode;
|
|||
|
||||
impl VideoMode {
|
||||
pub fn size(&self) -> PhysicalSize<u32> {
|
||||
unimplemented!();
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
pub fn bit_depth(&self) -> u16 {
|
||||
unimplemented!();
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
pub fn refresh_rate_millihertz(&self) -> u32 {
|
||||
32000
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
pub fn monitor(&self) -> MonitorHandle {
|
||||
MonitorHandle
|
||||
unreachable!();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue