diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cell.rs | 26 | ||||
-rw-r--r-- | src/ffi.c | 25 | ||||
-rw-r--r-- | src/ffi.rs | 5 |
3 files changed, 56 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs index 4c0d6fb..ef12756 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -2,6 +2,7 @@ use libc; use std; use color; +use ffi; use types; pub struct Cell(*mut types::CellImpl); @@ -56,4 +57,29 @@ impl Cell { let attrs = unsafe { &(*prefix).attrs }; color::Color::new(&attrs.bgcolor) } + + pub fn is_wide(&self) -> bool { + let Cell(cell_impl) = *self; + unsafe { ffi::vt100_wrapper_cell_is_wide(cell_impl) != 0 } + } + + pub fn bold(&self) -> bool { + let Cell(cell_impl) = *self; + unsafe { ffi::vt100_wrapper_cell_bold(cell_impl) != 0 } + } + + pub fn italic(&self) -> bool { + let Cell(cell_impl) = *self; + unsafe { ffi::vt100_wrapper_cell_italic(cell_impl) != 0 } + } + + pub fn underline(&self) -> bool { + let Cell(cell_impl) = *self; + unsafe { ffi::vt100_wrapper_cell_underline(cell_impl) != 0 } + } + + pub fn inverse(&self) -> bool { + let Cell(cell_impl) = *self; + unsafe { ffi::vt100_wrapper_cell_inverse(cell_impl) != 0 } + } } @@ -10,3 +10,28 @@ int vt100_wrapper_cols(VT100Screen *vt) { return vt->grid->max.col; } + +int vt100_wrapper_cell_is_wide(struct vt100_cell *cell) +{ + return cell->is_wide; +} + +int vt100_wrapper_cell_bold(struct vt100_cell *cell) +{ + return cell->attrs.bold; +} + +int vt100_wrapper_cell_italic(struct vt100_cell *cell) +{ + return cell->attrs.italic; +} + +int vt100_wrapper_cell_underline(struct vt100_cell *cell) +{ + return cell->attrs.underline; +} + +int vt100_wrapper_cell_inverse(struct vt100_cell *cell) +{ + return cell->attrs.inverse; +} @@ -40,6 +40,11 @@ extern "C" { pub fn vt100_wrapper_rows(screen: *mut types::ScreenImpl) -> libc::c_int; pub fn vt100_wrapper_cols(screen: *mut types::ScreenImpl) -> libc::c_int; + pub fn vt100_wrapper_cell_is_wide(cell: *mut types::CellImpl) -> libc::c_int; + pub fn vt100_wrapper_cell_bold(cell: *mut types::CellImpl) -> libc::c_int; + pub fn vt100_wrapper_cell_italic(cell: *mut types::CellImpl) -> libc::c_int; + pub fn vt100_wrapper_cell_underline(cell: *mut types::CellImpl) -> libc::c_int; + pub fn vt100_wrapper_cell_inverse(cell: *mut types::CellImpl) -> libc::c_int; } #[cfg(test)] |