1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/ableos/src/experiments/y_compositor/window.rs

40 lines
781 B
Rust
Raw Normal View History

2021-11-16 00:09:27 -06:00
use crate::driver_traits::graphics::Point;
2022-01-07 10:31:47 -06:00
use alloc::string::String;
use alloc::vec::Vec;
pub struct MenuOption {
symbol: char,
}
pub type MenuBar = Vec<MenuOption>;
2021-11-16 00:09:27 -06:00
pub struct Window {
2022-01-07 10:31:47 -06:00
title: String,
2021-11-16 00:09:27 -06:00
position: Point,
fullscreen: bool,
}
// all of these should return a result
impl Window {
2022-01-07 10:31:47 -06:00
pub fn new(title: String, position: Point, fullscreen: bool) -> Self {
Self {
title,
position,
fullscreen,
}
}
pub fn fullscreen(&mut self) {
2021-11-16 00:09:27 -06:00
self.fullscreen = true;
}
pub fn revert_fullscreen(&mut self) {
self.fullscreen = false;
}
pub fn set_title(&mut self) {
todo!();
}
pub fn set_position(&mut self, pos: Point) {
self.position = pos;
}
}