1use nalgebra::{Point2, Vector2};
2pub use winit::window::{
3 BadIcon, Cursor, CursorIcon, CustomCursor, Icon as WindowIcon, WindowButtons, WindowLevel,
4};
5
6use crate::vgi::VectorGraphicsInterface;
7use maycoon_theme::theme::Theme;
8
9#[derive(Clone, Debug)]
11pub struct MayConfig<T: Theme, V: VectorGraphicsInterface> {
12 pub window: WindowConfig,
14 pub theme: T,
16 pub graphics: V::Config,
18}
19
20impl<T: Default + Theme, V: VectorGraphicsInterface> Default for MayConfig<T, V> {
21 fn default() -> Self {
22 Self {
23 window: WindowConfig::default(),
24 theme: T::default(),
25 graphics: V::Config::default(),
26 }
27 }
28}
29
30#[derive(Clone, Debug)]
32pub struct WindowConfig {
33 pub title: String,
35 pub size: Vector2<f64>,
37 pub min_size: Option<Vector2<f64>>,
39 pub max_size: Option<Vector2<f64>>,
41 pub resizable: bool,
43 pub maximized: bool,
45 pub mode: WindowMode,
47 pub level: WindowLevel,
49 pub visible: bool,
51 pub blur: bool,
53 pub transparent: bool,
55 pub position: Option<Point2<f64>>,
57 pub active: bool,
59 pub buttons: WindowButtons,
61 pub decorations: bool,
63 pub resize_increments: Option<Vector2<f64>>,
65 pub content_protected: bool,
67 pub icon: Option<WindowIcon>,
69 pub cursor: Cursor,
71 pub close_on_request: bool,
73}
74
75impl Default for WindowConfig {
76 fn default() -> Self {
77 Self {
78 title: "New App".to_string(),
79 size: Vector2::new(800.0, 600.0),
80 min_size: None,
81 max_size: None,
82 resizable: true,
83 maximized: false,
84 mode: WindowMode::default(),
85 level: Default::default(),
86 visible: true,
87 blur: false,
88 transparent: false,
89 position: None,
90 active: true,
91 buttons: WindowButtons::all(),
92 decorations: true,
93 resize_increments: None,
94 content_protected: false,
95 icon: None,
96 cursor: Cursor::default(),
97 close_on_request: true,
98 }
99 }
100}
101
102#[derive(Clone, Debug, Default)]
104pub enum WindowMode {
105 #[default]
107 Windowed,
108 Borderless,
110 Fullscreen,
112}