srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/core/src/monitor.rs
blob: aa25fba6808636c0e56653b304d2cc9b8a83c303 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::geometry::Rect;

pub type MonitorId = u32;

#[derive(Debug, Clone)]
pub struct Monitor {
    pub id: MonitorId,
    pub name: String,
    pub geometry: Rect,
    pub refresh_rate_mhz: u32,
    pub primary: bool,
}

impl Monitor {
    pub fn new(id: MonitorId, name: impl Into<String>, geometry: Rect) -> Self {
        Self { id, name: name.into(), geometry, refresh_rate_mhz: 60_000, primary: false }
    }
}