srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/core/src/monitor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/src/monitor.rs')
-rw-r--r--crates/core/src/monitor.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/core/src/monitor.rs b/crates/core/src/monitor.rs
new file mode 100644
index 0000000..aa25fba
--- /dev/null
+++ b/crates/core/src/monitor.rs
@@ -0,0 +1,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 }
+ }
+}