mod.rs 729 Bytes
Newer Older
Jeremy Soller's avatar
Jeremy Soller committed
1 2 3
pub use self::graphic::GraphicScreen;
pub use self::text::TextScreen;

Jeremy Soller's avatar
Jeremy Soller committed
4 5 6
use orbclient::Event;
use syscall::Result;

Jeremy Soller's avatar
Jeremy Soller committed
7 8 9
mod graphic;
mod text;

Jeremy Soller's avatar
Jeremy Soller committed
10 11 12 13 14
pub trait Screen {
    fn width(&self) -> usize;

    fn height(&self) -> usize;

Jeremy Soller's avatar
Jeremy Soller committed
15 16
    fn resize(&mut self, width: usize, height: usize);

Jeremy Soller's avatar
Jeremy Soller committed
17 18
    fn event(&mut self, flags: usize) -> Result<usize>;

19 20
    fn map(&self, offset: usize, size: usize) -> Result<usize>;

Jeremy Soller's avatar
Jeremy Soller committed
21 22 23 24
    fn input(&mut self, event: &Event);

    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;

25
    fn can_read(&self) -> Option<usize>;
Jeremy Soller's avatar
Jeremy Soller committed
26 27 28 29 30 31 32 33

    fn write(&mut self, buf: &[u8], sync: bool) -> Result<usize>;

    fn seek(&mut self, pos: usize, whence: usize) -> Result<usize>;

    fn sync(&mut self);

    fn redraw(&mut self);
Jeremy Soller's avatar
Jeremy Soller committed
34
}