1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pub mod terminal;
mod ansi_terminal;
#[cfg(target_os = "windows")]
mod winapi_terminal;
use self::ansi_terminal::AnsiTerminal;
#[cfg(target_os = "windows")]
use self::winapi_terminal::WinApiTerminal;
pub use self::terminal::{terminal, Terminal};
use std::sync::Arc;
use super::functions;
use {Screen, TerminalOutput};
pub enum ClearType {
All,
FromCursorDown,
FromCursorUp,
CurrentLine,
UntilNewLine,
}
trait ITerminal {
fn clear(&self, clear_type: ClearType, stdout: &Arc<TerminalOutput>);
fn terminal_size(&self, stdout: &Arc<TerminalOutput>) -> (u16, u16);
fn scroll_up(&self, count: i16, stdout: &Arc<TerminalOutput>);
fn scroll_down(&self, count: i16, stdout: &Arc<TerminalOutput>);
fn set_size(&self, width: i16, height: i16, stdout: &Arc<TerminalOutput>);
fn exit(&self,stdout: &Arc<TerminalOutput>);
}