move GridView & GridOffset into separate grid module
This commit is contained in:
parent
f76a56f7b9
commit
c574bf6ad2
6 changed files with 12 additions and 39 deletions
|
@ -10,35 +10,13 @@ use {
|
|||
}
|
||||
};
|
||||
|
||||
pub mod offset;
|
||||
pub use offset::GridOffset;
|
||||
|
||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||
|
||||
pub trait GridView = IndexView<Point2<i16>>;
|
||||
|
||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||
/*
|
||||
pub trait ImplGridView : Send + Sync {
|
||||
type Item;
|
||||
|
||||
fn get(&self, pos: &Point2<i16>) -> Self::Item;
|
||||
|
||||
fn range(&self) -> Option<Range<Point2<i16>>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl<V: ImplGridView> ImplIndexView for V {
|
||||
type Key = Point2<i16>;
|
||||
type Value = V::Item;
|
||||
|
||||
fn get(&self, pos: &Point2<i16>) -> V::Item {
|
||||
(self as &V).get(pos)
|
||||
}
|
||||
|
||||
fn range(&self) -> Option<Range<Point2<i16>>> {
|
||||
(self as &V).range()
|
||||
}
|
||||
}
|
||||
*/
|
||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||
|
||||
pub struct GridWindowIterator {
|
|
@ -13,10 +13,10 @@ use {
|
|||
InnerViewPort
|
||||
},
|
||||
view::{
|
||||
index::{IndexView, ImplIndexView},
|
||||
index::IndexView
|
||||
},
|
||||
grid::{GridView, GridWindowIterator}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
pub struct GridOffset<V: GridView + ?Sized> {
|
|
@ -8,7 +8,8 @@ use {
|
|||
cgmath::Point2,
|
||||
crate::{
|
||||
core::{View, ViewPort, InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast},
|
||||
view::{ImplIndexView, grid::GridWindowIterator},
|
||||
view::{ImplIndexView},
|
||||
grid::{GridWindowIterator},
|
||||
terminal::{TerminalAtom, TerminalView}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -12,11 +12,7 @@ pub use {
|
|||
|
||||
use {
|
||||
crate::{
|
||||
core::View,
|
||||
view::{
|
||||
IndexView,
|
||||
GridView
|
||||
}
|
||||
grid::GridView
|
||||
},
|
||||
cgmath::Point2,
|
||||
std::ops::Range
|
||||
|
|
|
@ -27,9 +27,9 @@ use {
|
|||
}
|
||||
},
|
||||
view::{
|
||||
IndexView,
|
||||
grid::GridWindowIterator
|
||||
}
|
||||
IndexView
|
||||
},
|
||||
grid::{GridView, GridWindowIterator}
|
||||
},
|
||||
super::{
|
||||
TerminalStyle,
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
pub mod singleton;
|
||||
pub mod index;
|
||||
pub mod sequence;
|
||||
pub mod grid;
|
||||
|
||||
pub use {
|
||||
singleton::SingletonView,
|
||||
index::{IndexView, ImplIndexView},
|
||||
sequence::SequenceView,
|
||||
grid::GridView,
|
||||
crate::core::View
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue