1use crate::{Bounds, DisplayId, Pixels, PlatformDisplay, Point, px};
2use anyhow::{Ok, Result};
3
4#[derive(Debug)]
5pub(crate) struct TestDisplay {
6 id: DisplayId,
7 uuid: uuid::Uuid,
8 bounds: Bounds<Pixels>,
9}
10
11impl TestDisplay {
12 pub fn new() -> Self {
13 TestDisplay {
14 id: DisplayId(1),
15 uuid: uuid::Uuid::new_v4(),
16 bounds: Bounds::from_corners(Point::default(), Point::new(px(1920.), px(1080.))),
17 }
18 }
19}
20
21impl PlatformDisplay for TestDisplay {
22 fn id(&self) -> crate::DisplayId {
23 self.id
24 }
25
26 fn uuid(&self) -> Result<uuid::Uuid> {
27 Ok(self.uuid)
28 }
29
30 fn bounds(&self) -> crate::Bounds<crate::Pixels> {
31 self.bounds
32 }
33}