diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-10 22:44:13 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-11 20:23:41 -0800 |
commit | ed0b1cfff04903fe26f586340e036c38bbf30b33 (patch) | |
tree | eb4eb3545bee57ed401cb7727c9dc3f106fabe3b /src/term | |
parent | bbd8ddbfc055e85f8810285e71fd227cdd418221 (diff) | |
download | alacritty-ed0b1cfff04903fe26f586340e036c38bbf30b33.tar.gz alacritty-ed0b1cfff04903fe26f586340e036c38bbf30b33.zip |
Display manages window, renderer, rasterizer
This is part of an ongoing decoupling effort across the codebase and
tidying effort in main.rs. Everything to do with showing the window with
a grid of characters is now managed by the `Display` type. It owns the
window, the font rasterizer, and the renderer. The only info needed from
it are dimensions of characters and the window itself for sizing the
terminal properly. Additionally, the I/O loop has access to wake it up
when new data arrives.
Diffstat (limited to 'src/term')
-rw-r--r-- | src/term/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 979999a9..da5683e0 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -23,6 +23,20 @@ use grid::{Grid, ClearRegion}; use index::{Cursor, Column, Line}; use ansi::{Color, NamedColor}; +use tty::ToWinsize; +use libc::{self, winsize}; + +impl<'a> ToWinsize for &'a SizeInfo { + fn to_winsize(&self) -> winsize { + winsize { + ws_row: self.lines().0 as libc::c_ushort, + ws_col: self.cols().0 as libc::c_ushort, + ws_xpixel: self.width as libc::c_ushort, + ws_ypixel: self.height as libc::c_ushort, + } + } +} + pub mod cell; pub use self::cell::Cell; |