autocommit 2022-04-04 00:28:58 CEST
This commit is contained in:
parent
9ec1c5c995
commit
1f71290dab
21 changed files with 1217 additions and 132 deletions
|
|
@ -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>),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue