2018-04-01 23:39:03 +00:00
|
|
|
//! Dummy backend
|
|
|
|
use backend;
|
|
|
|
use event;
|
2018-06-11 06:29:10 +00:00
|
|
|
use theme;
|
2018-04-03 01:08:12 +00:00
|
|
|
use vec::Vec2;
|
2018-04-01 23:39:03 +00:00
|
|
|
|
2018-05-20 17:42:52 +00:00
|
|
|
use std::time::Duration;
|
2018-05-20 16:59:35 +00:00
|
|
|
|
|
|
|
use chan;
|
|
|
|
|
2018-04-01 23:39:03 +00:00
|
|
|
pub struct Backend;
|
|
|
|
|
|
|
|
impl Backend {
|
|
|
|
pub fn init() -> Box<backend::Backend>
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{
|
|
|
|
Box::new(Backend)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl backend::Backend for Backend {
|
|
|
|
fn finish(&mut self) {}
|
|
|
|
|
|
|
|
fn refresh(&mut self) {}
|
|
|
|
|
|
|
|
fn has_colors(&self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2018-04-03 01:08:12 +00:00
|
|
|
fn screen_size(&self) -> Vec2 {
|
|
|
|
(1, 1).into()
|
2018-04-01 23:39:03 +00:00
|
|
|
}
|
|
|
|
|
2018-06-16 20:23:09 +00:00
|
|
|
fn prepare_input(
|
|
|
|
&mut self, event_sink: &chan::Sender<event::Event>, _timeout: Duration,
|
|
|
|
) {
|
2018-05-20 17:42:52 +00:00
|
|
|
event_sink.send(event::Event::Exit)
|
2018-04-01 23:39:03 +00:00
|
|
|
}
|
|
|
|
|
2018-04-03 01:08:12 +00:00
|
|
|
fn print_at(&self, _: Vec2, _: &str) {}
|
2018-04-01 23:39:03 +00:00
|
|
|
|
|
|
|
fn clear(&self, _: theme::Color) {}
|
|
|
|
|
|
|
|
// This sets the Colours and returns the previous colours
|
|
|
|
// to allow you to set them back when you're done.
|
|
|
|
fn set_color(&self, colors: theme::ColorPair) -> theme::ColorPair {
|
|
|
|
colors
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_effect(&self, _: theme::Effect) {}
|
|
|
|
fn unset_effect(&self, _: theme::Effect) {}
|
|
|
|
}
|