autocommit 2022-01-06 19:08:32 CET
This commit is contained in:
parent
cbbc41a463
commit
4a939477a2
51 changed files with 3438 additions and 207 deletions
30
src/backend.rs
Normal file
30
src/backend.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use std::rc::Rc;
|
||||
use crate::fixed::Fixed;
|
||||
|
||||
linear_ids!(OutputIds, OutputId);
|
||||
linear_ids!(SeatIds, SeatId);
|
||||
|
||||
pub trait Output {
|
||||
fn id(&self) -> OutputId;
|
||||
fn removed(&self) -> bool;
|
||||
fn width(&self) -> u32;
|
||||
fn height(&self) -> u32;
|
||||
fn on_change(&self, cb: Rc<dyn Fn()>);
|
||||
}
|
||||
|
||||
pub trait Seat {
|
||||
fn id(&self) -> SeatId;
|
||||
fn removed(&self) -> bool;
|
||||
fn event(&self) -> Option<SeatEvent>;
|
||||
fn on_change(&self, cb: Rc<dyn Fn()>);
|
||||
}
|
||||
|
||||
pub enum BackendEvent {
|
||||
NewOutput(Rc<dyn Output>),
|
||||
NewSeat(Rc<dyn Seat>),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SeatEvent {
|
||||
Motion(OutputId, Fixed, Fixed),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue