Trait tuikit::canvas::Canvas [−][src]
Required methods
fn size(&self) -> Result<(usize, usize)>
[src]
Get the canvas size (width, height)
fn clear(&mut self) -> Result<()>
[src]
clear the canvas
fn put_cell(&mut self, row: usize, col: usize, cell: Cell) -> Result<usize>
[src]
change a cell of position (row, col)
to cell
if (row, col)
is out of boundary, Ok
is returned, but no operation is taken
return the width of the character/cell
fn set_cursor(&mut self, row: usize, col: usize) -> Result<()>
[src]
move cursor position (row, col) and show cursor
fn show_cursor(&mut self, show: bool) -> Result<()>
[src]
show/hide cursor, set show
to false
to hide the cursor
Provided methods
fn put_char_with_attr(
&mut self,
row: usize,
col: usize,
ch: char,
attr: Attr
) -> Result<usize>
[src]
&mut self,
row: usize,
col: usize,
ch: char,
attr: Attr
) -> Result<usize>
just like put_cell, except it accept (char & attr) return the width of the character/cell
fn print_with_attr(
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>
[src]
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>
print content
starting with position (row, col)
with attr
- canvas should NOT wrap to y+1 if the content is too long
- canvas should handle wide characters return the printed width of the content
fn print(&mut self, row: usize, col: usize, content: &str) -> Result<usize>
[src]
print content
starting with position (row, col)
with default attribute
Implementors
impl Canvas for Screen
[src]
fn size(&self) -> Result<(usize, usize)>
[src]
Get the canvas size (width, height)
fn clear(&mut self) -> Result<()>
[src]
clear the screen buffer
fn put_cell(&mut self, row: usize, col: usize, cell: Cell) -> Result<usize>
[src]
change a cell of position (row, col)
to cell
fn set_cursor(&mut self, row: usize, col: usize) -> Result<()>
[src]
move cursor position (row, col) and show cursor
fn show_cursor(&mut self, show: bool) -> Result<()>
[src]
show/hide cursor, set show
to false
to hide the cursor
impl<'a> Canvas for BoundedCanvas<'a>
[src]
fn size(&self) -> Result<(usize, usize)>
[src]
fn clear(&mut self) -> Result<()>
[src]
fn put_cell(&mut self, row: usize, col: usize, cell: Cell) -> Result<usize>
[src]
fn set_cursor(&mut self, row: usize, col: usize) -> Result<()>
[src]
fn show_cursor(&mut self, show: bool) -> Result<()>
[src]
impl<'a, UserEvent: Send + 'static> Canvas for TermCanvas<'a, UserEvent>
[src]
fn size(&self) -> Result<(usize, usize)>
[src]
fn clear(&mut self) -> Result<()>
[src]
fn put_cell(&mut self, row: usize, col: usize, cell: Cell) -> Result<usize>
[src]
fn print_with_attr(
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>
[src]
&mut self,
row: usize,
col: usize,
content: &str,
attr: Attr
) -> Result<usize>