1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! `WindowHost` — capabilities the L3 `LayoutManager` asks the host
//! (window manager / runtime) to perform.
//!
//! Implemented by L4 runtimes (uzor-desktop, uzor-web, uzor-mobile).
//! L3 calls this trait rather than touching winit / platform APIs directly.
use crate::platform::types::ResizeDirection;
use crate::framework::multi_window::WindowSpec;
/// Capabilities a window manager must provide to the L3 layout layer.
///
/// Default implementations are no-ops so that stub / test hosts can
/// implement only the methods they care about.
pub trait WindowHost {
/// Begin an OS-level window drag from the current cursor position.
fn drag_window(&mut self) {}
/// Begin an OS-level resize drag in the given direction.
fn drag_resize_window(&mut self, _dir: ResizeDirection) {}
/// Set the window minimized state.
fn set_minimized(&mut self, _on: bool) {}
/// Set the window maximized state.
fn set_maximized(&mut self, _on: bool) {}
/// Query whether the window is currently maximized.
fn is_maximized(&self) -> bool { false }
/// Request that this window be closed.
fn close_window(&mut self) {}
/// Request that the entire application be closed (all windows).
fn close_app(&mut self) {}
/// Request that the runtime spawn a new window from a `WindowSpec`.
fn request_spawn_window(&mut self, _spec: WindowSpec) {}
/// Ask the OS to schedule a redraw for this window.
fn request_redraw(&mut self) {}
}