Add graphite-editor library skeleton (#34)

This commit is contained in:
TrueDoctor
2021-03-21 18:02:14 +01:00
committed by Keavon Chambers
parent 17a1043d07
commit 1b8c71d2b3
8 changed files with 192 additions and 0 deletions
@@ -0,0 +1,34 @@
use crate::EditorError;
type PanelId = usize;
struct LayoutRoot {
hovered_panel: PanelId,
root: PanelGroup,
}
impl LayoutRoot {
// add panel / panel group
// delete panel / panel group
// move panel / panel group
// get_serialized_layout()
}
struct PanelGroup {
contents: Vec<Contents>,
layout_direction: LayoutDirection,
}
enum Contents {
PanelArea(PanelArea),
Group(PanelGroup),
}
struct PanelArea {
panels: Vec<PanelId>,
active: PanelId,
}
enum LayoutDirection {
Horizontal,
Vertical,
}