1
0
Fork 0
forked from wry/wry

autocommit 2022-04-04 00:28:58 CEST

This commit is contained in:
Julian Orth 2022-04-04 00:28:58 +02:00
parent 9ec1c5c995
commit 1f71290dab
21 changed files with 1217 additions and 132 deletions

View file

@ -9,14 +9,25 @@ pub trait Backend {
fn switch_to(&self, vtnr: u32);
}
pub trait Output {
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
pub struct Mode {
pub width: i32,
pub height: i32,
pub refresh_rate: u32,
}
pub trait Connector {
fn id(&self) -> OutputId;
fn removed(&self) -> bool;
fn width(&self) -> i32;
fn height(&self) -> i32;
fn event(&self) -> Option<ConnectorEvent>;
fn on_change(&self, cb: Rc<dyn Fn()>);
}
#[derive(Debug)]
pub enum ConnectorEvent {
Removed,
ModeChanged(Mode),
}
pub trait InputDevice {
fn id(&self) -> InputDeviceId;
fn removed(&self) -> bool;
@ -49,7 +60,7 @@ pub enum InputDeviceAccelProfile {
}
pub enum BackendEvent {
NewOutput(Rc<dyn Output>),
NewConnector(Rc<dyn Connector>),
NewInputDevice(Rc<dyn InputDevice>),
}