- add ncdirect_canget_cursor
- made ncplane_notcurses require a non-mutable reference.
pull/1792/head
joseLuís 3 years ago
parent 9f8a00560c
commit 391c58e4ed

@ -162,6 +162,7 @@ pub use ffi::{
pub use ffi::{
// functions
ncdirect_box,
ncdirect_canget_cursor,
ncdirect_canopen_images,
ncdirect_canutf8,
ncdirect_check_pixel_support,

@ -93,7 +93,14 @@ impl NcDirect {
max_x: NcDim,
) -> NcResult<&'a mut NcDirectV> {
let res = unsafe {
crate::ncdirect_render_frame(self, cstring![filename], blitter, scale, max_y as i32, max_x as i32)
crate::ncdirect_render_frame(
self,
cstring![filename],
blitter,
scale,
max_y as i32,
max_x as i32,
)
};
error_ref_mut![
res,
@ -276,6 +283,14 @@ impl NcDirect {
/// ## NcDirect methods: capabilities, cursor, dimensions
impl NcDirect {
/// Is there support for acquiring the cursor's current position?
///
/// Requires the u7 terminfo capability, and that we are connected to an
/// actual terminal.
pub fn canget_cursor(&self) -> bool {
unsafe { crate::ncdirect_canget_cursor(self) }
}
/// Can we reliably use Unicode braille?
///
/// *C style function: [ncdirect_canbraille()][crate::ncdirect_canbraille].*

@ -1,15 +1,15 @@
//! `NcDirect`
// total: 61
// total: 62
// ---------------------------------------------------
// (X) 1 : wont do
// (~) 3 : TODO / WIP
//
// (f) 45 : unsafe ffi function exported by bindgen
// (f) 46 : unsafe ffi function exported by bindgen
// (w) 1 : safely wrapped ffi function
// (r) 11 : static function manually reimplemented
//
// (m) 45 : method implemented
// (m) 55 : method implemented
//
// (t) 0 : unit test done for the function
// (T) 0 : unit test done also for the method
@ -18,14 +18,15 @@
// fm ncdirect_bg_palindex
// fm ncdirect_bg_rgb
// fm ncdirect_box
// r ncdirect_canbraille
// r ncdirect_canchangecolor
// r ncdirect_canfade
// r ncdirect_canhalfblock
// rm ncdirect_canbraille
// rm ncdirect_canchangecolor
// fm ncdirect_canget_cursor
// rm ncdirect_canfade
// rm ncdirect_canhalfblock
// fm ncdirect_canopen_images
// rm ncdirect_canopen_videos
// r ncdirect_canquadrant
// r ncdirect_cantruecolor
// rm ncdirect_canquadrant
// rm ncdirect_cantruecolor
// fm ncdirect_canutf8
// wm ncdirect_capabilities
// fm ncdirect_check_pixel_support
@ -41,7 +42,7 @@
// fm ncdirect_cursor_right
// fm ncdirect_cursor_up
// fm ncdirect_cursor_yx
// ncdirect_detected_terminal
// fm ncdirect_detected_terminal
// fm ncdirect_dim_x
// fm ncdirect_dim_y
// fm ncdirect_double_box

@ -1171,7 +1171,7 @@ impl NcPlane {
/// Gets a mutable reference to the [`Nc`] context of this NcPlane.
///
/// *C style function: [ncplane_notcurses()][crate::ncplane_notcurses].*
pub fn notcurses<'a>(&mut self) -> NcResult<&'a mut Nc> {
pub fn notcurses<'a>(&self) -> NcResult<&'a mut Nc> {
error_ref_mut![
unsafe { crate::ncplane_notcurses(self) },
"NcPlane.notcurses()"

Loading…
Cancel
Save