use crate::{
platform::windowing::WindowError,
prelude::{Buffer, WindowHelper, WindowSettings},
};
pub const trait NewWindow {
fn new(
title: &str,
settings: WindowSettings,
) -> Result<Self, WindowError>
where
Self: Sized;
}
pub const trait Window: WindowHelper {
fn update_raw(
&mut self,
pixels: &[u32],
width: usize,
height: usize,
) -> Result<(), WindowError>;
fn is_open(&self) -> bool;
fn close_and_clean_up(&mut self);
}
pub const trait ExtendedWindow {
fn set_title(&mut self, title: &str);
}
#[cfg(feature = "system")]
pub const trait GetWindowHandle {
fn get_window_handle(&self) -> raw_window_handle::RawWindowHandle;
}
pub const trait IconControl {
fn set_icon(&mut self, buffer: &Buffer) -> Result<(), WindowError>;
}