1
0
Fork 0
forked from wry/wry

seat: add framework to select toplevels

This commit is contained in:
Julian Orth 2024-04-18 13:43:44 +02:00
parent e4e090d3a2
commit 17a0dfed5e
31 changed files with 603 additions and 131 deletions

View file

@ -100,6 +100,12 @@ impl FindTreeResult {
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
pub enum FindTreeUsecase {
None,
SelectToplevel,
}
pub trait Node: 'static {
fn node_id(&self) -> NodeId;
fn node_seat_state(&self) -> &NodeSeatState;
@ -122,10 +128,17 @@ pub trait Node: 'static {
let _ = active;
}
fn node_find_tree_at(&self, x: i32, y: i32, tree: &mut Vec<FoundNode>) -> FindTreeResult {
fn node_find_tree_at(
&self,
x: i32,
y: i32,
tree: &mut Vec<FoundNode>,
usecase: FindTreeUsecase,
) -> FindTreeResult {
let _ = x;
let _ = y;
let _ = tree;
let _ = usecase;
FindTreeResult::Other
}
@ -296,6 +309,10 @@ pub trait Node: 'static {
None
}
fn node_into_toplevel(self: Rc<Self>) -> Option<Rc<dyn ToplevelNode>> {
None
}
// TYPE CHECKERS
fn node_is_container(&self) -> bool {