diff options
author | Jonathan Schleußer <paradoxspiral@riseup.net> | 2017-08-30 20:43:37 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-09-05 09:07:00 -0700 |
commit | a3d35ec1859802a2440d29ac24d87bf347a6144e (patch) | |
tree | 909c86e052cf52fcac86b241739508965e2dcf02 /src | |
parent | 967393a31c4b722266e9bc4e74b89d0a23a82dbb (diff) | |
download | alacritty-a3d35ec1859802a2440d29ac24d87bf347a6144e.tar.gz alacritty-a3d35ec1859802a2440d29ac24d87bf347a6144e.zip |
Update most remaining deps
Diffstat (limited to 'src')
-rw-r--r-- | src/event_loop.rs | 25 | ||||
-rw-r--r-- | src/lib.rs | 1 | ||||
-rw-r--r-- | src/term/cell.rs | 20 | ||||
-rw-r--r-- | src/term/mod.rs | 30 |
4 files changed, 41 insertions, 35 deletions
diff --git a/src/event_loop.rs b/src/event_loop.rs index 56d8b992..5095f359 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -7,7 +7,10 @@ use std::os::unix::io::AsRawFd; use std::sync::Arc; use mio::{self, Events, PollOpt, Ready}; +#[cfg(unix)] +use mio::unix::UnixReady; use mio::unix::EventedFd; +use mio_more::channel::{self, Sender, Receiver}; use ansi; use display; @@ -33,8 +36,8 @@ pub enum Msg { pub struct EventLoop<Io> { poll: mio::Poll, pty: Io, - rx: mio::channel::Receiver<Msg>, - tx: mio::channel::Sender<Msg>, + rx: Receiver<Msg>, + tx: Sender<Msg>, terminal: Arc<FairMutex<Term>>, display: display::Notifier, ref_test: bool, @@ -76,7 +79,7 @@ pub struct State { parser: ansi::Processor, } -pub struct Notifier(pub ::mio::channel::Sender<Msg>); +pub struct Notifier(pub Sender<Msg>); impl event::Notify for Notifier { fn notify<B>(&mut self, bytes: B) @@ -174,7 +177,7 @@ impl<Io> EventLoop<Io> pty: Io, ref_test: bool, ) -> EventLoop<Io> { - let (tx, rx) = ::mio::channel::channel(); + let (tx, rx) = channel::channel(); EventLoop { poll: mio::Poll::new().expect("create mio Poll"), pty: pty, @@ -186,7 +189,7 @@ impl<Io> EventLoop<Io> } } - pub fn channel(&self) -> mio::channel::Sender<Msg> { + pub fn channel(&self) -> Sender<Msg> { self.tx.clone() } @@ -384,13 +387,15 @@ impl<Io> EventLoop<Io> } }, PTY => { - let kind = event.kind(); + let ready = event.readiness(); - if kind.is_hup() { - break 'event_loop; + #[cfg(unix)] { + if UnixReady::from(ready).is_hup() { + break 'event_loop; + } } - if kind.is_readable() { + if ready.is_readable() { if let Err(err) = self.pty_read(&mut state, &mut buf, pipe.as_mut()) { error!("Event loop exitting due to error: {} [{}:{}]", err, file!(), line!()); @@ -402,7 +407,7 @@ impl<Io> EventLoop<Io> } } - if kind.is_writable() { + if ready.is_writable() { if let Err(err) = self.pty_write(&mut state) { error!("Event loop exitting due to error: {} [{}:{}]", err, file!(), line!()); @@ -39,6 +39,7 @@ extern crate font; extern crate glutin; extern crate libc; extern crate mio; +extern crate mio_more; extern crate notify; extern crate parking_lot; extern crate serde; diff --git a/src/term/cell.rs b/src/term/cell.rs index d1c6877b..cc1848d3 100644 --- a/src/term/cell.rs +++ b/src/term/cell.rs @@ -17,16 +17,16 @@ use index::Column; bitflags! { #[derive(Serialize, Deserialize)] - pub flags Flags: u32 { - const INVERSE = 0b00000001, - const BOLD = 0b00000010, - const ITALIC = 0b00000100, - const UNDERLINE = 0b00001000, - const WRAPLINE = 0b00010000, - const WIDE_CHAR = 0b00100000, - const WIDE_CHAR_SPACER = 0b01000000, - const DIM = 0b10000000, - const DIM_BOLD = 0b10000010, + pub struct Flags: u32 { + const INVERSE = 0b00000001; + const BOLD = 0b00000010; + const ITALIC = 0b00000100; + const UNDERLINE = 0b00001000; + const WRAPLINE = 0b00010000; + const WIDE_CHAR = 0b00100000; + const WIDE_CHAR_SPACER = 0b01000000; + const DIM = 0b10000000; + const DIM_BOLD = 0b10000010; } } diff --git a/src/term/mod.rs b/src/term/mod.rs index a7892e6a..027feaf1 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -390,21 +390,21 @@ impl<'a> Iterator for RenderableCellsIter<'a> { pub mod mode { bitflags! { - pub flags TermMode: u16 { - const SHOW_CURSOR = 0b000000000001, - const APP_CURSOR = 0b000000000010, - const APP_KEYPAD = 0b000000000100, - const MOUSE_REPORT_CLICK = 0b000000001000, - const BRACKETED_PASTE = 0b000000010000, - const SGR_MOUSE = 0b000000100000, - const MOUSE_MOTION = 0b000001000000, - const LINE_WRAP = 0b000010000000, - const LINE_FEED_NEW_LINE = 0b000100000000, - const ORIGIN = 0b001000000000, - const INSERT = 0b010000000000, - const FOCUS_IN_OUT = 0b100000000000, - const ANY = 0b111111111111, - const NONE = 0, + pub struct TermMode: u16 { + const SHOW_CURSOR = 0b000000000001; + const APP_CURSOR = 0b000000000010; + const APP_KEYPAD = 0b000000000100; + const MOUSE_REPORT_CLICK = 0b000000001000; + const BRACKETED_PASTE = 0b000000010000; + const SGR_MOUSE = 0b000000100000; + const MOUSE_MOTION = 0b000001000000; + const LINE_WRAP = 0b000010000000; + const LINE_FEED_NEW_LINE = 0b000100000000; + const ORIGIN = 0b001000000000; + const INSERT = 0b010000000000; + const FOCUS_IN_OUT = 0b100000000000; + const ANY = 0b111111111111; + const NONE = 0; } } |