use crate::prelude::*;
pub mod thehlayout;
pub mod thelistlayout;
pub mod thergbalayout;
pub mod therowlistlayout;
pub mod thesharedhlayout;
pub mod thesharedvlayout;
pub mod thesnapperlayout;
pub mod thestacklayout;
pub mod thetablayout;
pub mod thetextlayout;
pub mod thetreelayout;
pub mod thevlayout;
pub mod prelude {
pub use crate::theui::thelayout::thehlayout::{TheHLayout, TheHLayoutMode, TheHLayoutTrait};
pub use crate::theui::thelayout::thelistlayout::{TheListLayout, TheListLayoutTrait};
pub use crate::theui::thelayout::thergbalayout::{TheRGBALayout, TheRGBALayoutTrait};
pub use crate::theui::thelayout::therowlistlayout::{TheRowListLayout, TheRowListLayoutTrait};
pub use crate::theui::thelayout::thesharedhlayout::*;
pub use crate::theui::thelayout::thesharedvlayout::*;
pub use crate::theui::thelayout::thesnapperlayout::{TheSnapperLayout, TheSnapperLayoutTrait};
pub use crate::theui::thelayout::thestacklayout::{TheStackLayout, TheStackLayoutTrait};
pub use crate::theui::thelayout::thetablayout::{TheTabLayout, TheTabLayoutTrait};
pub use crate::theui::thelayout::thetextlayout::{TheTextLayout, TheTextLayoutTrait};
pub use crate::theui::thelayout::thetreelayout::{
TheTreeLayout, TheTreeLayoutTrait, TheTreeNode,
};
pub use crate::theui::thelayout::thevlayout::{TheVLayout, TheVLayoutMode, TheVLayoutTrait};
pub use crate::theui::thelayout::TheLayout;
}
#[allow(unused)]
pub trait TheLayout: Send {
fn new(id: TheId) -> Self
where
Self: Sized;
fn id(&self) -> &TheId;
fn dim(&self) -> &TheDim;
fn dim_mut(&mut self) -> &mut TheDim;
fn set_dim(&mut self, dim: TheDim, ctx: &mut TheContext) {}
fn limiter(&self) -> &TheSizeLimiter;
fn limiter_mut(&mut self) -> &mut TheSizeLimiter;
fn set_margin(&mut self, margin: Vec4<i32>) {}
fn set_padding(&mut self, padding: i32) {}
fn set_background_color(&mut self, color: Option<TheThemeColors>) {}
fn needs_redraw(&mut self) -> bool {
for w in self.widgets() {
if w.needs_redraw() {
return true;
}
}
false
}
fn supports_mouse_wheel(&self) -> bool {
false
}
fn mouse_wheel_scroll(&mut self, coord: Vec2<i32>) {}
fn relayout(&mut self, ctx: &mut TheContext) {}
fn get_layout(
&mut self,
name: Option<&String>,
uuid: Option<&Uuid>,
) -> Option<&mut Box<dyn TheLayout>> {
None
}
fn get_widget(
&mut self,
name: Option<&String>,
uuid: Option<&Uuid>,
) -> Option<&mut Box<dyn TheWidget>>;
fn get_layout_at_coord(&mut self, coord: Vec2<i32>) -> Option<TheId> {
None
}
fn get_widget_at_coord(&mut self, coord: Vec2<i32>) -> Option<&mut Box<dyn TheWidget>>;
fn widgets(&mut self) -> &mut Vec<Box<dyn TheWidget>>;
fn redirected_widget_value(
&mut self,
widget_id: &TheId,
value: &TheValue,
ctx: &mut TheContext,
) {
}
fn draw(
&mut self,
buffer: &mut TheRGBABuffer,
style: &mut Box<dyn TheStyle>,
ctx: &mut TheContext,
);
fn as_stack_layout(&mut self) -> Option<&mut dyn TheStackLayoutTrait> {
None
}
fn as_list_layout(&mut self) -> Option<&mut dyn TheListLayoutTrait> {
None
}
fn as_rowlist_layout(&mut self) -> Option<&mut dyn TheRowListLayoutTrait> {
None
}
fn as_rgba_layout(&mut self) -> Option<&mut dyn TheRGBALayoutTrait> {
None
}
fn as_tab_layout(&mut self) -> Option<&mut dyn TheTabLayoutTrait> {
None
}
fn as_sharedhlayout(&mut self) -> Option<&mut dyn TheSharedHLayoutTrait> {
None
}
fn as_sharedvlayout(&mut self) -> Option<&mut dyn TheSharedVLayoutTrait> {
None
}
fn as_hlayout(&mut self) -> Option<&mut dyn TheHLayoutTrait> {
None
}
fn as_vlayout(&mut self) -> Option<&mut dyn TheVLayoutTrait> {
None
}
fn as_text_layout(&mut self) -> Option<&mut dyn TheTextLayoutTrait> {
None
}
fn as_tree_layout(&mut self) -> Option<&mut dyn TheTreeLayoutTrait> {
None
}
}