diff --git a/nested/Cargo.toml b/nested/Cargo.toml index 4bd049b..d8a83d0 100644 --- a/nested/Cargo.toml +++ b/nested/Cargo.toml @@ -1,4 +1,3 @@ - [package] authors = ["Michael Sippel "] edition = "2018" @@ -7,10 +6,11 @@ version = "0.1.0" [dependencies] no_deadlocks = "*" -cgmath = "0.17.0" +cgmath = { version = "0.18.0", features = ["serde"] } termion = "1.5.5" signal-hook = "0.3.1" signal-hook-async-std = "0.2.0" +serde = { version = "1.0", features = ["derive"] } [dependencies.async-std] version = "1.7.0" diff --git a/nested/src/lib.rs b/nested/src/lib.rs index 66e9d4e..abee199 100644 --- a/nested/src/lib.rs +++ b/nested/src/lib.rs @@ -1,3 +1,38 @@ +#![feature(trait_alias)] + +pub mod core; +pub mod index; +pub mod grid; +pub mod sequence; +pub mod singleton; +pub mod terminal; +pub mod projection; +pub mod string_editor; +pub mod leveled_term_view; + +/* maybe? +pub use { + cgmath::{Vector2, Point2}, + termion::event::{Event, Key}, + crate::{ + core::{View, Observer, ObserverExt, ObserverBroadcast, ViewPort, OuterViewPort}, + index::{ImplIndexView}, + terminal::{ + TerminalView, + TerminalAtom, + TerminalStyle, + TerminalEvent, + Terminal, + TerminalCompositor + }, + sequence::{VecBuffer, SequenceView}, + grid::{GridOffset, GridWindowIterator}, + singleton::{SingletonView, SingletonBuffer}, + string_editor::{StringEditor, insert_view::StringInsertView}, + leveled_term_view::LeveledTermView + } +}; + */ pub fn magic_header() { eprintln!("<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>"); diff --git a/nested/src/terminal/atom.rs b/nested/src/terminal/atom.rs index 1cf48e9..26460cd 100644 --- a/nested/src/terminal/atom.rs +++ b/nested/src/terminal/atom.rs @@ -1,7 +1,9 @@ +use { + super::TerminalStyle, + serde::{Serialize, Deserialize} +}; -use super::TerminalStyle; - -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Serialize, Deserialize, Debug)] pub struct TerminalAtom { pub c: Option, pub style: TerminalStyle diff --git a/nested/src/terminal/style.rs b/nested/src/terminal/style.rs index 3e9d6eb..4b1d983 100644 --- a/nested/src/terminal/style.rs +++ b/nested/src/terminal/style.rs @@ -1,5 +1,6 @@ +use serde::{Serialize, Deserialize}; -#[derive(Default, Copy, Clone, PartialEq)] +#[derive(Default, Copy, Clone, PartialEq, Serialize, Deserialize, Debug)] pub struct TerminalStyle { pub fg_color: Option<(u8, u8, u8)>, pub bg_color: Option<(u8, u8, u8)>,