ported ming-os graphics to linux framebuffer

This commit is contained in:
stjet
2024-10-12 06:18:05 +00:00
commit f595d4f43c
97 changed files with 2370 additions and 0 deletions

21
src/components/mod.rs Normal file
View File

@@ -0,0 +1,21 @@
use std::vec::Vec;
use crate::themes::ThemeInfo;
use crate::messages::WindowMessage;
use crate::window_manager::DrawInstructions;
pub mod toggle_button;
pub mod highlight_button;
pub trait Component<T> {
fn handle_message(&mut self, message: WindowMessage) -> Option<T>;
fn draw(&self, theme_info: &ThemeInfo) -> Vec<DrawInstructions>;
//properties
//focusing is a way for the *window* to know what component to send input, presses, etc
//focusing for components is purely to give a visual representation
fn focusable(&self) -> bool;
fn clickable(&self) -> bool;
fn name(&self) -> &String; //should be unique
}