Commit Graph

35 Commits

Author SHA1 Message Date
Alexandre Bury
14fe6f3b36 Cargo fmt 2018-06-16 13:23:09 -07:00
Alexandre Bury
3f5b37951b Do not consume input before exit 2018-06-16 10:58:55 -07:00
Alexandre Bury
c8d39910ab Backend: add AtomicBool to stop input thread 2018-05-20 10:55:13 -07:00
Alexandre Bury
05e1212a50 Refactor Backend input model
Backends now have to send input to the given `chan::Sender<Event>`.
They send these events from a separate thread, allowing selection
between input and callbacks.

This currently breaks the BearLibTerminal backend, which requires all
calls to come from the UI thread.

This might not be super-safe for the ncurses backend also. We hope that
input and output are separate enough that they can run concurrently without
problem.
2018-05-20 09:59:35 -07:00
Alexandre Bury
fd09b5f806 Use Vec2 in backend methods 2018-04-02 18:08:12 -07:00
Alexandre Bury
126530b9a9 Cursive::new now takes the backend as argument 2018-04-01 16:39:03 -07:00
SEGFAULT
76d340f11d Making backend::Backend into a std::Boxable trait (#229)
* Making Backend into a Boxable Trait

* Fixed up some typos in the previous and modified some of the docs so they still compile.

* Minor Changes requested by @gyscos

* Whoops
2018-04-01 15:35:37 -07:00
Alexandre Bury
2d7f8295cf Add Effect::{Bold,Italic,Underline} 2018-01-05 13:57:39 +01:00
Alexandre Bury
e4cd68a4eb Rustfmt 2017-12-30 23:03:42 +01:00
Alexandre Bury
93982517ae Fix clippy warnings 2017-10-13 11:24:17 -07:00
Alexandre Bury
acd12326e1 Produce mouse events in termion backend 2017-10-12 21:24:17 -07:00
Alexandre Bury
a4ca7bbf1e Rustfmt 2017-10-12 16:43:59 -07:00
Alexandre Bury
7df4b06ef8 Backend::poll_event now takes &mut self
To manage an internal buffer, in case backend events and cursive events
don't match 1-for-1.

Planned uses: mouse support (translate click into Press+Release).
2017-10-08 16:02:43 -07:00
Alexandre Bury
2ffae1f524 Rename {Color,ColorStyle}::Default to TerminalDefault 2017-07-18 01:36:34 +02:00
hcpl
28d0db1bb6 Make use of colors preset by terminals 2017-07-16 16:05:04 +03:00
Alexandre Bury
2cdf546455 Fix pancurses backend 2017-06-13 23:30:55 -07:00
Alexandre Bury
98be066b4d Don't re-apply current color 2017-06-12 23:51:41 -07:00
Alexandre Bury
dea07d29cf Give the background color to the clear method. 2017-06-12 23:29:26 -07:00
Alexandre Bury
059812f427 Update termion backend 2017-06-12 18:31:08 -07:00
Alexandre Bury
5c42a59954 Refactor colors management
Do not register pairs with backend. Let backend cache color pairs if
needed.
2017-06-12 11:59:33 -07:00
Alexandre Bury
9e1a83f7cc Set up Custom color in termion and ncurses backends 2017-06-11 15:01:35 -07:00
quininer kel
440578c7d1 Add termion AlternateScreen support 2017-04-26 14:20:52 +08:00
Alexandre Bury
2cd2787119 Event::Unknown now carries the unknown bytes rather than a i32
And termion has been updated to use termion::Event::Unsupported
2017-03-25 11:01:25 -07:00
Alexandre Bury
dccce56f6e Fix off-by-1 errors on termion
Termion's Goto is 1-based, Cursive's print_at is 0-based
2017-01-19 13:44:49 -08:00
Casey Primozic
7ca9821145 Fixed issue with resetting background color for Termion backend
- Background color was being set back to the theme's background color rather than the terminal's background color when the backend was `finish()`ed.  This resets the background color to the default instead.
2017-01-10 19:22:05 -06:00
Alexandre Bury
858067ef6b Detect terminal resize in termion backend
Using the chan_signal crate
2016-12-13 22:10:00 -08:00
Alexandre Bury
ea3dde33ec Use async input for termion backend
This enables async refresh, fixing the `logs` and `progress` examples.
2016-12-13 20:54:18 -08:00
Alexandre Bury
508c9833e3 Add Esc support to termion backend 2016-11-04 16:24:52 -07:00
Alexandre Bury
ce009d0e5f Back to upstream termion
Just figured I could implement Color for a custom wrapper struct.
2016-11-04 10:30:06 -07:00
Alexandre Bury
60bddf7e8d Better input support in termion backend
Still many key combinations unsupported.
2016-10-24 11:16:56 -07:00
Alexandre Bury
965b32bd9b Bring colors to termion backend
Currently require termion fork for color storage support.
2016-10-21 17:18:26 -07:00
nabijaczleweli
c69db62844
Fix backend tests 2016-10-10 23:08:07 +02:00
nabijaczleweli
4c9c4b5568
Move back-end selection to backend::Concrete instead of ::B 2016-10-10 10:34:33 +02:00
Alexandre Bury
686de0831c Take &self in TermionBackend::clear() 2016-10-09 16:03:49 -07:00
Alexandre Bury
df4397a174 Add stub termion backend
Not supported: input, colors, effects, async
2016-10-09 16:02:26 -07:00