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 #[inline(always)]
22 fn default() -> Self {
23 Self {
24 window: WindowConfig::default(),
25 theme: T::default(),
26 graphics: V::Config::default(),
27 }
28 }
29}
30
31#[derive(Clone, Debug)]
33pub struct WindowConfig {
34 pub title: String,
36 pub size: Vector2<f64>,
38 pub min_size: Option<Vector2<f64>>,
40 pub max_size: Option<Vector2<f64>>,
42 pub resizable: bool,
44 pub maximized: bool,
46 pub mode: WindowMode,
48 pub level: WindowLevel,
50 pub visible: bool,
52 pub blur: bool,
54 pub transparent: bool,
56 pub position: Option<Point2<f64>>,
58 pub active: bool,
60 pub buttons: WindowButtons,
62 pub decorations: bool,
64 pub resize_increments: Option<Vector2<f64>>,
66 pub content_protected: bool,
68 pub icon: Option<WindowIcon>,
70 pub cursor: Cursor,
72 pub close_on_request: bool,
74}
75
76impl Default for WindowConfig {
77 #[inline(always)]
78 fn default() -> Self {
79 Self {
80 title: "New App".to_string(),
81 size: Vector2::new(800.0, 600.0),
82 min_size: None,
83 max_size: None,
84 resizable: true,
85 maximized: false,
86 mode: WindowMode::default(),
87 level: Default::default(),
88 visible: true,
89 blur: false,
90 transparent: false,
91 position: None,
92 active: true,
93 buttons: WindowButtons::all(),
94 decorations: true,
95 resize_increments: None,
96 content_protected: false,
97 icon: None,
98 cursor: Cursor::default(),
99 close_on_request: true,
100 }
101 }
102}
103
104#[derive(Clone, Debug, Default)]
106pub enum WindowMode {
107 #[default]
109 Windowed,
110 Borderless,
112 Fullscreen,
114}