layer_shika_composition/
shell_runtime.rs

1use layer_shika_adapters::platform::slint_interpreter::ComponentInstance;
2
3/// Default surface name used internally
4pub const DEFAULT_SURFACE_NAME: &str = "main";
5
6/// Trait providing runtime access to shell components and event loop
7pub trait ShellRuntime {
8    type LoopHandle;
9    type Context<'a>;
10
11    fn event_loop_handle(&self) -> Self::LoopHandle;
12
13    fn with_component<F>(&self, name: &str, f: F)
14    where
15        F: FnMut(&ComponentInstance);
16
17    fn with_all_components<F>(&self, f: F)
18    where
19        F: FnMut(&str, &ComponentInstance);
20
21    fn run(&mut self) -> crate::Result<()>;
22}