1
0
Fork 0
forked from wry/wry

autocommit 2022-01-06 19:08:32 CET

This commit is contained in:
Julian Orth 2022-01-06 19:08:32 +01:00
parent cbbc41a463
commit 4a939477a2
51 changed files with 3438 additions and 207 deletions

30
src/backend.rs Normal file
View 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),
}