diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-04-27 02:51:35 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-04-27 03:03:46 -0400 |
commit | ea0444f2bb0ad94431a597e29f15d61cfa237508 (patch) | |
tree | 6a12efd1cc30a7d936306bc40a9860a22f047fcb /src/cell.rs | |
parent | df328c13903d5a0e595d27b14f79e2a61f66f8fc (diff) | |
download | vt100-rust-ea0444f2bb0ad94431a597e29f15d61cfa237508.tar.gz vt100-rust-ea0444f2bb0ad94431a597e29f15d61cfa237508.zip |
implement the rest of the cell attrs
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 26 |
1 files changed, 26 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 } + } } |