diff options
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs index e78f16c..abec58f 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -58,21 +58,41 @@ impl Cell { pub fn bold(&self) -> bool { let Cell(cell_impl) = *self; - unsafe { ffi::vt100_wrapper_cell_bold(cell_impl) != 0 } + let prefix: *mut CellPrefix = unsafe { + std::mem::transmute(cell_impl) + }; + unsafe { + ffi::vt100_wrapper_cell_attrs_bold(&mut (*prefix).attrs) != 0 + } } pub fn italic(&self) -> bool { let Cell(cell_impl) = *self; - unsafe { ffi::vt100_wrapper_cell_italic(cell_impl) != 0 } + let prefix: *mut CellPrefix = unsafe { + std::mem::transmute(cell_impl) + }; + unsafe { + ffi::vt100_wrapper_cell_attrs_italic(&mut (*prefix).attrs) != 0 + } } pub fn underline(&self) -> bool { let Cell(cell_impl) = *self; - unsafe { ffi::vt100_wrapper_cell_underline(cell_impl) != 0 } + let prefix: *mut CellPrefix = unsafe { + std::mem::transmute(cell_impl) + }; + unsafe { + ffi::vt100_wrapper_cell_attrs_underline(&mut (*prefix).attrs) != 0 + } } pub fn inverse(&self) -> bool { let Cell(cell_impl) = *self; - unsafe { ffi::vt100_wrapper_cell_inverse(cell_impl) != 0 } + let prefix: *mut CellPrefix = unsafe { + std::mem::transmute(cell_impl) + }; + unsafe { + ffi::vt100_wrapper_cell_attrs_inverse(&mut (*prefix).attrs) != 0 + } } } |