cursive/src/backend/mod.rs

30 lines
742 B
Rust
Raw Normal View History

use event;
use theme;
// Module is not named `ncurses` to avoir naming conflict
mod curses;
pub use self::curses::NcursesBackend;
pub trait Backend {
fn init() -> Self;
fn finish(&mut self);
fn clear();
fn refresh(&self);
fn has_colors(&self) -> bool;
fn init_color_style(&mut self, style: theme::ColorStyle,
foreground: &theme::Color, background: &theme::Color);
fn print_at(&self, (usize, usize), &str);
fn poll_event(&self) -> event::Event;
fn set_refresh_rate(&mut self, fps: u32);
fn screen_size(&self) -> (usize, usize);
fn with_color<F: FnOnce()>(&self, color: theme::ColorStyle, f: F);
fn with_effect<F: FnOnce()>(&self, effect: theme::Effect, f: F);
}