mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
rust: more improvements
- fix bindings module, by not making public the wrapped bindgen types - add notcurses_stddim_yx_const() - fix return types of TODO - add plane constructor new() wrapping ncpile_create() - add plane constructor new_bound() wrapping ncplane_create() - add plane constructor new_termsize() wrapping ncpile_create() with the terminal size - add plane doc comment
This commit is contained in:
parent
47d5347f01
commit
059007bd50
@ -42,34 +42,34 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// blitset ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
blitset
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// blitset
|
||||
|
||||
// cell ------------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
cell,
|
||||
|
||||
// constants
|
||||
CELL_ALPHA_BLEND,
|
||||
CELL_ALPHA_HIGHCONTRAST,
|
||||
CELL_ALPHA_OPAQUE,
|
||||
CELL_ALPHA_TRANSPARENT,
|
||||
CELL_BGDEFAULT_MASK,
|
||||
CELL_BG_ALPHA_MASK,
|
||||
CELL_BG_PALETTE,
|
||||
CELL_BG_RGB_MASK,
|
||||
CELL_FGDEFAULT_MASK,
|
||||
CELL_FG_ALPHA_MASK,
|
||||
CELL_FG_PALETTE,
|
||||
CELL_FG_RGB_MASK,
|
||||
CELL_NOBACKGROUND_MASK,
|
||||
CELL_WIDEASIAN_MASK,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// cell,
|
||||
//
|
||||
// // constants
|
||||
// CELL_ALPHA_BLEND,
|
||||
// CELL_ALPHA_HIGHCONTRAST,
|
||||
// CELL_ALPHA_OPAQUE,
|
||||
// CELL_ALPHA_TRANSPARENT,
|
||||
// CELL_BGDEFAULT_MASK,
|
||||
// CELL_BG_ALPHA_MASK,
|
||||
// CELL_BG_PALETTE,
|
||||
// CELL_BG_RGB_MASK,
|
||||
// CELL_FGDEFAULT_MASK,
|
||||
// CELL_FG_ALPHA_MASK,
|
||||
// CELL_FG_PALETTE,
|
||||
// CELL_FG_RGB_MASK,
|
||||
// CELL_NOBACKGROUND_MASK,
|
||||
// CELL_WIDEASIAN_MASK,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -83,42 +83,42 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// channel ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// constants
|
||||
CHANNEL_ALPHA_MASK
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // constants
|
||||
// CHANNEL_ALPHA_MASK
|
||||
|
||||
// ncalign ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// type definitions
|
||||
ncalign_e,
|
||||
|
||||
// constants
|
||||
ncalign_e_NCALIGN_CENTER,
|
||||
ncalign_e_NCALIGN_LEFT,
|
||||
ncalign_e_NCALIGN_RIGHT,
|
||||
ncalign_e_NCALIGN_UNALIGNED,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // type definitions
|
||||
// ncalign_e,
|
||||
//
|
||||
// // constants
|
||||
// ncalign_e_NCALIGN_CENTER,
|
||||
// ncalign_e_NCALIGN_LEFT,
|
||||
// ncalign_e_NCALIGN_RIGHT,
|
||||
// ncalign_e_NCALIGN_UNALIGNED,
|
||||
|
||||
// ncblitter -------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// type definitions
|
||||
ncblitter_e,
|
||||
|
||||
// constants
|
||||
ncblitter_e_NCBLIT_1x1,
|
||||
ncblitter_e_NCBLIT_2x1,
|
||||
ncblitter_e_NCBLIT_2x2,
|
||||
ncblitter_e_NCBLIT_3x2,
|
||||
ncblitter_e_NCBLIT_4x1,
|
||||
ncblitter_e_NCBLIT_8x1,
|
||||
ncblitter_e_NCBLIT_BRAILLE,
|
||||
ncblitter_e_NCBLIT_DEFAULT,
|
||||
ncblitter_e_NCBLIT_SIXEL,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // type definitions
|
||||
// ncblitter_e,
|
||||
//
|
||||
// // constants
|
||||
// ncblitter_e_NCBLIT_1x1,
|
||||
// ncblitter_e_NCBLIT_2x1,
|
||||
// ncblitter_e_NCBLIT_2x2,
|
||||
// ncblitter_e_NCBLIT_3x2,
|
||||
// ncblitter_e_NCBLIT_4x1,
|
||||
// ncblitter_e_NCBLIT_8x1,
|
||||
// ncblitter_e_NCBLIT_BRAILLE,
|
||||
// ncblitter_e_NCBLIT_DEFAULT,
|
||||
// ncblitter_e_NCBLIT_SIXEL,
|
||||
|
||||
// ncbox -----------------------------------------------------------------------
|
||||
|
||||
@ -138,15 +138,15 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncdirect --------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncdirect,
|
||||
|
||||
// constants
|
||||
NCDIRECT_OPTION_INHIBIT_CBREAK,
|
||||
NCDIRECT_OPTION_INHIBIT_SETLOCALE,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncdirect,
|
||||
//
|
||||
// // constants
|
||||
// NCDIRECT_OPTION_INHIBIT_CBREAK,
|
||||
// NCDIRECT_OPTION_INHIBIT_SETLOCALE,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -193,11 +193,11 @@ pub use bindgen::{
|
||||
|
||||
|
||||
// ncfadectx -------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncfadectx,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncfadectx,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -208,37 +208,37 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncinput ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncinput,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncinput,
|
||||
|
||||
// ncloglevel ------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// type definitions
|
||||
ncloglevel_e,
|
||||
|
||||
// constants
|
||||
ncloglevel_e_NCLOGLEVEL_DEBUG,
|
||||
ncloglevel_e_NCLOGLEVEL_ERROR,
|
||||
ncloglevel_e_NCLOGLEVEL_FATAL,
|
||||
ncloglevel_e_NCLOGLEVEL_INFO,
|
||||
ncloglevel_e_NCLOGLEVEL_PANIC,
|
||||
ncloglevel_e_NCLOGLEVEL_SILENT,
|
||||
ncloglevel_e_NCLOGLEVEL_TRACE,
|
||||
ncloglevel_e_NCLOGLEVEL_VERBOSE,
|
||||
ncloglevel_e_NCLOGLEVEL_WARNING,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // type definitions
|
||||
// ncloglevel_e,
|
||||
//
|
||||
// // constants
|
||||
// ncloglevel_e_NCLOGLEVEL_DEBUG,
|
||||
// ncloglevel_e_NCLOGLEVEL_ERROR,
|
||||
// ncloglevel_e_NCLOGLEVEL_FATAL,
|
||||
// ncloglevel_e_NCLOGLEVEL_INFO,
|
||||
// ncloglevel_e_NCLOGLEVEL_PANIC,
|
||||
// ncloglevel_e_NCLOGLEVEL_SILENT,
|
||||
// ncloglevel_e_NCLOGLEVEL_TRACE,
|
||||
// ncloglevel_e_NCLOGLEVEL_VERBOSE,
|
||||
// ncloglevel_e_NCLOGLEVEL_WARNING,
|
||||
|
||||
// ncfdplane -------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncfdplane,
|
||||
ncfdplane_options,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncfdplane,
|
||||
// ncfdplane_options,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -249,18 +249,18 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncmenu ----------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncmenu,
|
||||
ncmenu_item,
|
||||
ncmenu_options,
|
||||
ncmenu_section,
|
||||
|
||||
// constants
|
||||
NCMENU_OPTION_BOTTOM,
|
||||
NCMENU_OPTION_HIDING,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncmenu,
|
||||
// ncmenu_item,
|
||||
// ncmenu_options,
|
||||
// ncmenu_section,
|
||||
//
|
||||
// // constants
|
||||
// NCMENU_OPTION_BOTTOM,
|
||||
// NCMENU_OPTION_HIDING,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -281,16 +281,16 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncmetric --------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// constants
|
||||
PREFIXCOLUMNS,
|
||||
PREFIXSTRLEN,
|
||||
BPREFIXCOLUMNS,
|
||||
BPREFIXSTRLEN,
|
||||
IPREFIXCOLUMNS,
|
||||
IPREFIXSTRLEN,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // constants
|
||||
// PREFIXCOLUMNS,
|
||||
// PREFIXSTRLEN,
|
||||
// BPREFIXCOLUMNS,
|
||||
// BPREFIXSTRLEN,
|
||||
// IPREFIXCOLUMNS,
|
||||
// IPREFIXSTRLEN,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -299,13 +299,13 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncmultiselector -------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncmultiselector,
|
||||
ncmselector_item,
|
||||
ncmultiselector_options,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncmultiselector,
|
||||
// ncmselector_item,
|
||||
// ncmultiselector_options,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -328,15 +328,15 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncplane ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncplane,
|
||||
ncplane_options,
|
||||
|
||||
// constants
|
||||
NCPLANE_OPTION_HORALIGNED,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncplane,
|
||||
// ncplane_options,
|
||||
//
|
||||
// // constants
|
||||
// NCPLANE_OPTION_HORALIGNED,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -442,20 +442,20 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncplot ----------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncdplot, // f64
|
||||
ncuplot, // u64
|
||||
ncplot_options,
|
||||
|
||||
// constants
|
||||
NCPLOT_OPTION_DETECTMAXONLY,
|
||||
NCPLOT_OPTION_EXPONENTIALD,
|
||||
NCPLOT_OPTION_LABELTICKSD,
|
||||
NCPLOT_OPTION_NODEGRADE,
|
||||
NCPLOT_OPTION_VERTICALI,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncdplot, // f64
|
||||
// ncuplot, // u64
|
||||
// ncplot_options,
|
||||
//
|
||||
// // constants
|
||||
// NCPLOT_OPTION_DETECTMAXONLY,
|
||||
// NCPLOT_OPTION_EXPONENTIALD,
|
||||
// NCPLOT_OPTION_LABELTICKSD,
|
||||
// NCPLOT_OPTION_NODEGRADE,
|
||||
// NCPLOT_OPTION_VERTICALI,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -476,18 +476,18 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncreader --------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncreader,
|
||||
ncreader_options,
|
||||
|
||||
// constants
|
||||
NCREADER_OPTION_CURSOR,
|
||||
NCREADER_OPTION_HORSCROLL,
|
||||
NCREADER_OPTION_NOCMDKEYS,
|
||||
NCREADER_OPTION_VERSCROLL,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncreader,
|
||||
// ncreader_options,
|
||||
//
|
||||
// // constants
|
||||
// NCREADER_OPTION_CURSOR,
|
||||
// NCREADER_OPTION_HORSCROLL,
|
||||
// NCREADER_OPTION_NOCMDKEYS,
|
||||
// NCREADER_OPTION_VERSCROLL,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -506,16 +506,16 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncreel ----------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncreel,
|
||||
ncreel_options,
|
||||
|
||||
// constants
|
||||
NCREEL_OPTION_CIRCULAR,
|
||||
NCREEL_OPTION_INFINITESCROLL,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncreel,
|
||||
// ncreel_options,
|
||||
//
|
||||
// // constants
|
||||
// NCREEL_OPTION_CIRCULAR,
|
||||
// NCREEL_OPTION_INFINITESCROLL,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -534,25 +534,25 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncscale ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// type definitions
|
||||
ncscale_e,
|
||||
|
||||
// constants
|
||||
ncscale_e_NCSCALE_NONE,
|
||||
ncscale_e_NCSCALE_SCALE,
|
||||
ncscale_e_NCSCALE_STRETCH,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // type definitions
|
||||
// ncscale_e,
|
||||
//
|
||||
// // constants
|
||||
// ncscale_e_NCSCALE_NONE,
|
||||
// ncscale_e_NCSCALE_SCALE,
|
||||
// ncscale_e_NCSCALE_STRETCH,
|
||||
|
||||
// ncselector ------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncselector,
|
||||
ncselector_item,
|
||||
ncselector_options,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncselector,
|
||||
// ncselector_item,
|
||||
// ncselector_options,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -569,11 +569,11 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncstats ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncstats,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncstats,
|
||||
|
||||
// ncstyle ---------------------------------------------------------------------
|
||||
|
||||
@ -595,11 +595,11 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// nctablet --------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
nctablet,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// nctablet,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -609,16 +609,16 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// ncvisual --------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
ncvisual,
|
||||
ncvisual_options,
|
||||
|
||||
// constants
|
||||
NCVISUAL_OPTION_BLEND,
|
||||
NCVISUAL_OPTION_NODEGRADE,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// ncvisual,
|
||||
// ncvisual_options,
|
||||
//
|
||||
// // constants
|
||||
// NCVISUAL_OPTION_BLEND,
|
||||
// NCVISUAL_OPTION_NODEGRADE,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -643,21 +643,21 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// notcurses -------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
notcurses,
|
||||
notcurses_options,
|
||||
|
||||
// constants
|
||||
NCOPTION_INHIBIT_SETLOCALE,
|
||||
NCOPTION_NO_ALTERNATE_SCREEN,
|
||||
NCOPTION_NO_FONT_CHANGES,
|
||||
NCOPTION_NO_QUIT_SIGHANDLERS,
|
||||
NCOPTION_NO_WINCH_SIGHANDLER,
|
||||
NCOPTION_SUPPRESS_BANNERS,
|
||||
NCOPTION_VERIFY_SIXEL,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// notcurses,
|
||||
// notcurses_options,
|
||||
//
|
||||
// // constants
|
||||
// NCOPTION_INHIBIT_SETLOCALE,
|
||||
// NCOPTION_NO_ALTERNATE_SCREEN,
|
||||
// NCOPTION_NO_FONT_CHANGES,
|
||||
// NCOPTION_NO_QUIT_SIGHANDLERS,
|
||||
// NCOPTION_NO_WINCH_SIGHANDLER,
|
||||
// NCOPTION_SUPPRESS_BANNERS,
|
||||
// NCOPTION_VERIFY_SIXEL,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
@ -704,11 +704,11 @@ pub use bindgen::{
|
||||
};
|
||||
|
||||
// palette ---------------------------------------------------------------------
|
||||
|
||||
pub(crate) use bindgen::{
|
||||
// structs
|
||||
palette256,
|
||||
};
|
||||
//
|
||||
// already wrapped:
|
||||
//
|
||||
// // structs
|
||||
// palette256,
|
||||
|
||||
#[doc(inline)]
|
||||
pub use bindgen::{
|
||||
|
@ -49,7 +49,7 @@
|
||||
//+ notcurses_getc_blocking
|
||||
//+ notcurses_getc_nblock
|
||||
//+ notcurses_stddim_yx
|
||||
// notcurses_stddim_yx_const
|
||||
//+ notcurses_stddim_yx_const
|
||||
//+ notcurses_term_dim_yx
|
||||
|
||||
use core::ptr::{null, null_mut};
|
||||
@ -58,11 +58,7 @@ use crate::{
|
||||
// NOTE: can't use libc::timespec nor libc::sigset_t
|
||||
// with notcurses_getc(()
|
||||
bindings::{sigemptyset, sigfillset, sigset_t, timespec},
|
||||
ncplane_dim_yx,
|
||||
notcurses_getc,
|
||||
notcurses_init,
|
||||
notcurses_stdplane,
|
||||
notcurses_stdplane_const,
|
||||
ncplane_dim_yx, notcurses_getc, notcurses_init, notcurses_stdplane, notcurses_stdplane_const,
|
||||
types::{
|
||||
NcAlign, NcInput, NcLogLevel, NcPlane, Notcurses, NotcursesOptions, NCALIGN_CENTER,
|
||||
NCALIGN_LEFT, NCOPTION_NO_ALTERNATE_SCREEN, NCOPTION_SUPPRESS_BANNERS,
|
||||
@ -220,11 +216,24 @@ pub fn notcurses_stddim_yx(nc: &mut Notcurses, y: &mut i32, x: &mut i32) -> NcPl
|
||||
}
|
||||
}
|
||||
|
||||
/// notcurses_stdplane_const(), plus free bonus dimensions written to non-NULL y/x!
|
||||
#[inline]
|
||||
pub fn notcurses_stddim_yx_const(nc: &Notcurses, y: &mut i32, x: &mut i32) -> NcPlane {
|
||||
unsafe {
|
||||
let s = notcurses_stdplane_const(nc);
|
||||
ncplane_dim_yx(s, y, x);
|
||||
*s
|
||||
}
|
||||
}
|
||||
|
||||
/// Return our current idea of the terminal dimensions in rows and cols.
|
||||
#[inline]
|
||||
pub fn notcurses_term_dim_yx(nc: &Notcurses, rows: &mut i32, cols: &mut i32) {
|
||||
pub fn notcurses_term_dim_yx(nc: &Notcurses, rows: &mut u32, cols: &mut u32) {
|
||||
unsafe {
|
||||
ncplane_dim_yx(notcurses_stdplane_const(nc), rows, cols);
|
||||
let mut irows = *rows as i32;
|
||||
let mut icols = *cols as i32;
|
||||
ncplane_dim_yx(
|
||||
notcurses_stdplane_const(nc), &mut irows, &mut icols);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,7 @@ use crate::{
|
||||
ncplane_cursor_move_yx, ncplane_cursor_yx, ncplane_dim_yx, ncplane_gradient,
|
||||
ncplane_hline_interp, ncplane_putc_yx, ncplane_putegc_yx, ncplane_putnstr_yx,
|
||||
ncplane_putstr_yx, ncplane_resize, ncplane_vline_interp, ncplane_vprintf_yx, notcurses_align,
|
||||
notcurses_term_dim_yx,
|
||||
types::{
|
||||
NcAlign, NcAlphaBits, NcCell, NcChannel, NcChannels, NcColor, NcPlane,
|
||||
NcPlaneOptions, NcResult, NcStyleMask, Notcurses, NCPLANE_OPTION_HORALIGNED,
|
||||
@ -205,15 +206,26 @@ impl NcPlaneOptions {
|
||||
}
|
||||
|
||||
impl NcPlane {
|
||||
/// `NcPlane` constructor
|
||||
pub unsafe fn new<'a>(bound_to: &mut NcPlane, options: &NcPlaneOptions) -> &'a mut NcPlane {
|
||||
|
||||
/// `NcPlane` constructor.
|
||||
///
|
||||
/// The returned plane will be the top, bottom, and root of this new pile.
|
||||
pub unsafe fn new<'a>(nc: &mut Notcurses, options: &NcPlaneOptions) -> &'a mut NcPlane {
|
||||
&mut *ncpile_create(nc, options)
|
||||
}
|
||||
|
||||
/// `NcPlane` constructor, bound to another plane
|
||||
pub unsafe fn new_bound<'a>(bound_to: &mut NcPlane, options: &NcPlaneOptions) -> &'a mut NcPlane {
|
||||
&mut *ncplane_create(bound_to, options)
|
||||
}
|
||||
|
||||
/// `NcPlane` constructor.
|
||||
/// `NcPlane` constructor, with the full size of the terminal.
|
||||
///
|
||||
/// The returned plane will be the top, bottom, and root of this new pile.
|
||||
pub unsafe fn new_pile<'a>(nc: &mut Notcurses, options: &NcPlaneOptions) -> &'a mut NcPlane {
|
||||
&mut *ncpile_create(nc, options)
|
||||
pub unsafe fn new_termsize<'a>(nc: &mut Notcurses) -> &'a mut NcPlane {
|
||||
let (mut trows, mut tcols) = (0,0);
|
||||
notcurses_term_dim_yx(nc, &mut trows, &mut tcols);
|
||||
&mut *ncpile_create(nc, &NcPlaneOptions::new(0, 0, trows as u32, tcols as u32))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,54 +85,54 @@ use crate::NcPlane;
|
||||
///
|
||||
/// `type in C: cell (struct)`
|
||||
///
|
||||
pub type NcCell = crate::cell;
|
||||
pub type NcCell = crate::bindings::bindgen::cell;
|
||||
|
||||
///
|
||||
pub const NCCELL_ALPHA_BLEND: u32 = crate::bindings::CELL_ALPHA_BLEND;
|
||||
pub const NCCELL_ALPHA_BLEND: u32 = crate::bindings::bindgen::CELL_ALPHA_BLEND;
|
||||
|
||||
/// Background cannot be highcontrast, only foreground
|
||||
pub const NCCELL_ALPHA_HIGHCONTRAST: u32 = crate::bindings::CELL_ALPHA_HIGHCONTRAST;
|
||||
pub const NCCELL_ALPHA_HIGHCONTRAST: u32 = crate::bindings::bindgen::CELL_ALPHA_HIGHCONTRAST;
|
||||
|
||||
///
|
||||
pub const NCCELL_ALPHA_OPAQUE: u32 = crate::bindings::CELL_ALPHA_OPAQUE;
|
||||
pub const NCCELL_ALPHA_OPAQUE: u32 = crate::bindings::bindgen::CELL_ALPHA_OPAQUE;
|
||||
|
||||
///
|
||||
pub const NCCELL_ALPHA_TRANSPARENT: u32 = crate::bindings::CELL_ALPHA_TRANSPARENT;
|
||||
pub const NCCELL_ALPHA_TRANSPARENT: u32 = crate::bindings::bindgen::CELL_ALPHA_TRANSPARENT;
|
||||
|
||||
/// If this bit is set, we are *not* using the default background color
|
||||
pub const NCCELL_BGDEFAULT_MASK: u32 = crate::bindings::CELL_BGDEFAULT_MASK;
|
||||
pub const NCCELL_BGDEFAULT_MASK: u32 = crate::bindings::bindgen::CELL_BGDEFAULT_MASK;
|
||||
|
||||
/// Extract these bits to get the background alpha mask
|
||||
pub const NCCELL_BG_ALPHA_MASK: u32 = crate::bindings::CELL_BG_ALPHA_MASK;
|
||||
pub const NCCELL_BG_ALPHA_MASK: u32 = crate::bindings::bindgen::CELL_BG_ALPHA_MASK;
|
||||
|
||||
/// If this bit *and* [`CELL_BGDEFAULT_MASK`] are set, we're using a
|
||||
/// palette-indexed background color
|
||||
pub const NCCELL_BG_PALETTE: u32 = crate::bindings::CELL_BG_PALETTE;
|
||||
pub const NCCELL_BG_PALETTE: u32 = crate::bindings::bindgen::CELL_BG_PALETTE;
|
||||
|
||||
/// Extract these bits to get the background RGB value
|
||||
pub const NCCELL_BG_RGB_MASK: u32 = crate::bindings::CELL_BG_RGB_MASK;
|
||||
pub const NCCELL_BG_RGB_MASK: u32 = crate::bindings::bindgen::CELL_BG_RGB_MASK;
|
||||
|
||||
/// If this bit is set, we are *not* using the default foreground color
|
||||
pub const NCCELL_FGDEFAULT_MASK: u64 = crate::bindings::CELL_FGDEFAULT_MASK;
|
||||
pub const NCCELL_FGDEFAULT_MASK: u64 = crate::bindings::bindgen::CELL_FGDEFAULT_MASK;
|
||||
|
||||
/// Extract these bits to get the foreground alpha mask
|
||||
pub const NCCELL_FG_ALPHA_MASK: u64 = crate::bindings::CELL_FG_ALPHA_MASK;
|
||||
pub const NCCELL_FG_ALPHA_MASK: u64 = crate::bindings::bindgen::CELL_FG_ALPHA_MASK;
|
||||
|
||||
/// If this bit *and* [`CELL_BGDEFAULT_MASK`] are set, we're using a
|
||||
/// palette-indexed background color
|
||||
pub const NCCELL_FG_PALETTE: u64 = crate::bindings::CELL_FG_PALETTE;
|
||||
pub const NCCELL_FG_PALETTE: u64 = crate::bindings::bindgen::CELL_FG_PALETTE;
|
||||
|
||||
/// Extract these bits to get the foreground RGB value
|
||||
pub const NCCELL_FG_RGB_MASK: u64 = crate::bindings::CELL_FG_RGB_MASK;
|
||||
pub const NCCELL_FG_RGB_MASK: u64 = crate::bindings::bindgen::CELL_FG_RGB_MASK;
|
||||
|
||||
///
|
||||
pub const NCCELL_NOBACKGROUND_MASK: u64 = crate::bindings::CELL_NOBACKGROUND_MASK;
|
||||
pub const NCCELL_NOBACKGROUND_MASK: u64 = crate::bindings::bindgen::CELL_NOBACKGROUND_MASK;
|
||||
|
||||
/// If this bit is set, the cell is part of a multicolumn glyph.
|
||||
///
|
||||
/// Whether a cell is the left or right side of the glyph can be determined
|
||||
/// by checking whether ->gcluster is zero.
|
||||
pub const NCCELL_WIDEASIAN_MASK: u64 = crate::bindings::CELL_WIDEASIAN_MASK as u64;
|
||||
pub const NCCELL_WIDEASIAN_MASK: u64 = crate::bindings::bindgen::CELL_WIDEASIAN_MASK as u64;
|
||||
|
||||
// NcChar
|
||||
//
|
||||
|
@ -22,7 +22,7 @@ use crate::NcChar;
|
||||
pub type NcChannel = u32;
|
||||
|
||||
/// Extract these bits to get a channel's alpha value
|
||||
pub const NCCHANNEL_ALPHA_MASK: u32 = crate::bindings::CHANNEL_ALPHA_MASK;
|
||||
pub const NCCHANNEL_ALPHA_MASK: u32 = crate::bindings::bindgen::CHANNEL_ALPHA_MASK;
|
||||
|
||||
// NcAlphaBits
|
||||
//
|
||||
@ -153,14 +153,14 @@ pub type NcPixel = u32;
|
||||
///
|
||||
/// `type in C: ncpalette256 (struct)`
|
||||
///
|
||||
pub type NcPalette = crate::palette256;
|
||||
pub type NcPalette = crate::bindings::bindgen::palette256;
|
||||
|
||||
/// 8-bit value used for indexing into a [`NcPalette`]
|
||||
///
|
||||
pub type NcPaletteIndex = u8;
|
||||
|
||||
/// Context for a palette fade operation
|
||||
pub type NcFadeCtx = crate::ncfadectx;
|
||||
pub type NcFadeCtx = crate::bindings::bindgen::ncfadectx;
|
||||
|
||||
/// the [`NcChar`] which form the various levels
|
||||
/// of a given geometry.
|
||||
@ -173,4 +173,4 @@ pub type NcFadeCtx = crate::ncfadectx;
|
||||
///
|
||||
/// `type in C: blitset (struct)`
|
||||
///
|
||||
pub type NcBlitSet = crate::blitset;
|
||||
pub type NcBlitSet = crate::bindings::bindgen::blitset;
|
||||
|
@ -8,7 +8,7 @@ pub type NcResult = i32;
|
||||
|
||||
// time -----------------------------------------------------------------------
|
||||
|
||||
pub type NcTime = crate::bindings::timespec;
|
||||
pub type NcTime = crate::bindings::bindgen::timespec;
|
||||
|
||||
// ncmetric --------------------------------------------------------------------
|
||||
|
||||
@ -21,27 +21,27 @@ pub type NcTime = crate::bindings::timespec;
|
||||
//
|
||||
// to set up a printf()-style maximum field width,
|
||||
// you should use [IB]PREFIXFMT (see below).
|
||||
pub const NCMETRIC_PREFIXCOLUMNS: u32 = crate::bindings::PREFIXCOLUMNS;
|
||||
pub const NCMETRIC_PREFIXCOLUMNS: u32 = crate::bindings::bindgen::PREFIXCOLUMNS;
|
||||
|
||||
// The maximum number of columns used by a mult == 1000 (standard)
|
||||
// ncmetric() call.
|
||||
pub const NCMETRIC_BPREFIXCOLUMNS: u32 = crate::bindings::BPREFIXCOLUMNS;
|
||||
pub const NCMETRIC_BPREFIXCOLUMNS: u32 = crate::bindings::bindgen::BPREFIXCOLUMNS;
|
||||
|
||||
// IPREFIXCOLUMNS is the maximum number of columns used by a mult == 1024
|
||||
// (digital information) ncmetric().
|
||||
pub const NCMETRIC_IPREFIXCOLUMNS: u32 = crate::bindings::IPREFIXCOLUMNS;
|
||||
pub const NCMETRIC_IPREFIXCOLUMNS: u32 = crate::bindings::bindgen::IPREFIXCOLUMNS;
|
||||
|
||||
//
|
||||
// Does not include a '\0' (xxx.xxU)
|
||||
pub const NCMETRIC_PREFIXSTRLEN: u32 = crate::bindings::PREFIXSTRLEN;
|
||||
pub const NCMETRIC_PREFIXSTRLEN: u32 = crate::bindings::bindgen::PREFIXSTRLEN;
|
||||
|
||||
// The maximum number of columns used by a mult == 1024 call making use of
|
||||
// the 'i' suffix.
|
||||
// Does not include a '\0' (xxxx.xxUi), i == prefix
|
||||
pub const NCMETRIC_BPREFIXSTRLEN: u32 = crate::bindings::BPREFIXSTRLEN;
|
||||
pub const NCMETRIC_BPREFIXSTRLEN: u32 = crate::bindings::bindgen::BPREFIXSTRLEN;
|
||||
|
||||
// Does not include a '\0' (xxxx.xxU)
|
||||
pub const NCMETRIC_IPREFIXSTRLEN: u32 = crate::bindings::IPREFIXSTRLEN;
|
||||
pub const NCMETRIC_IPREFIXSTRLEN: u32 = crate::bindings::bindgen::IPREFIXSTRLEN;
|
||||
|
||||
// TODO:?
|
||||
// WCHAR_MAX_UTF8BYTES
|
||||
|
@ -33,7 +33,8 @@ pub use channel::{
|
||||
};
|
||||
pub use file::NcFile;
|
||||
pub use misc::{
|
||||
NcResult, NCMETRIC_BPREFIXCOLUMNS, NCMETRIC_BPREFIXSTRLEN, NCMETRIC_IPREFIXCOLUMNS, NCMETRIC_IPREFIXSTRLEN, NCMETRIC_PREFIXCOLUMNS, NCMETRIC_PREFIXSTRLEN,
|
||||
NcResult, NCMETRIC_BPREFIXCOLUMNS, NCMETRIC_BPREFIXSTRLEN, NCMETRIC_IPREFIXCOLUMNS,
|
||||
NCMETRIC_IPREFIXSTRLEN, NCMETRIC_PREFIXCOLUMNS, NCMETRIC_PREFIXSTRLEN,
|
||||
};
|
||||
pub use plane::{
|
||||
NCBLIT_1x1, NCBLIT_2x1, NCBLIT_2x2, NCBLIT_3x2, NCBLIT_4x1, NCBLIT_8x1, NcAlign, NcBlitter,
|
||||
|
@ -5,83 +5,115 @@ use crate::NCCELL_ALPHA_BLEND;
|
||||
/// Fundamental drawing surface.
|
||||
///
|
||||
/// Unites a:
|
||||
///
|
||||
/// - CellMatrix
|
||||
/// - EgcPool
|
||||
///
|
||||
/// `type in C: ncplane (struct)`
|
||||
pub type NcPlane = crate::ncplane;
|
||||
///
|
||||
///
|
||||
/// ## Piles
|
||||
///
|
||||
/// A single notcurses context is made up of one or more piles.
|
||||
///
|
||||
/// A pile is a set of one or more ncplanes, including the partial orderings
|
||||
/// made up of their binding and z-axis pointers.
|
||||
///
|
||||
/// A pile has a top and bottom ncplane (this might be a single plane),
|
||||
/// and one or more root planes (planes which are bound to themselves).
|
||||
///
|
||||
/// Multiple threads can concurrently operate on distinct piles, even changing
|
||||
/// one while rendering another.
|
||||
///
|
||||
/// Each plane is part of one and only one pile. By default, a plane is part of
|
||||
/// the same pile containing that plane to which it is bound.
|
||||
///
|
||||
/// If ncpile_create is used in the place of ncplane_create, the returned plane
|
||||
/// becomes the root plane, top, and bottom of a new pile. As a root plane,
|
||||
/// it is bound to itself.
|
||||
///
|
||||
/// A new pile can also be created by reparenting a plane to itself,
|
||||
/// though if the plane is already a root plane, this is a no-op.
|
||||
///
|
||||
/// When a plane is moved to a different pile (whether new or preexisting),
|
||||
/// any planes which were bound to it are rebound to its previous parent.
|
||||
/// If the plane was a root plane of some pile, any bound planes become root
|
||||
/// planes. The new plane is placed immediately atop its new parent on its new
|
||||
/// pile's z-axis. When ncplane_reparent_family() is used, all planes bound to
|
||||
/// the reparented plane are moved along with it. Their relative z-order is maintained.
|
||||
///
|
||||
pub type NcPlane = crate::bindings::bindgen::ncplane;
|
||||
|
||||
/// Options struct for [`NcPlane`]
|
||||
pub type NcPlaneOptions = crate::ncplane_options;
|
||||
pub type NcPlaneOptions = crate::bindings::bindgen::ncplane_options;
|
||||
|
||||
/// Horizontal alignment relative to the parent plane. Set alignment in 'x'.
|
||||
pub const NCPLANE_OPTION_HORALIGNED: u64 = crate::bindings::NCPLANE_OPTION_HORALIGNED as u64;
|
||||
pub const NCPLANE_OPTION_HORALIGNED: u64 =
|
||||
crate::bindings::bindgen::NCPLANE_OPTION_HORALIGNED as u64;
|
||||
|
||||
/// I/O wrapper to dump file descriptor to [`NcPlane`]
|
||||
///
|
||||
/// `type in C: ncfdplane (struct)`
|
||||
pub type NcFdPlane = crate::ncfdplane;
|
||||
pub type NcFdPlane = crate::bindings::bindgen::ncfdplane;
|
||||
|
||||
/// Options struct for [`NcFdPlane`]
|
||||
///
|
||||
/// `type in C: ncplane_options (struct)`
|
||||
pub type NcFdPlaneOptions = crate::ncfdplane_options;
|
||||
pub type NcFdPlaneOptions = crate::bindings::bindgen::ncfdplane_options;
|
||||
|
||||
/// Alignment within a plane or terminal.
|
||||
/// Left/right-justified, or centered.
|
||||
pub type NcAlign = crate::ncalign_e;
|
||||
pub type NcAlign = crate::bindings::bindgen::ncalign_e;
|
||||
|
||||
/// Left alignment within an [`NcPlane`] or terminal.
|
||||
pub const NCALIGN_LEFT: NcAlign = crate::ncalign_e_NCALIGN_LEFT;
|
||||
pub const NCALIGN_LEFT: NcAlign = crate::bindings::bindgen::ncalign_e_NCALIGN_LEFT;
|
||||
|
||||
/// Right alignment within an [`NcPlane`] or terminal.
|
||||
pub const NCALIGN_RIGHT: NcAlign = crate::ncalign_e_NCALIGN_RIGHT;
|
||||
pub const NCALIGN_RIGHT: NcAlign = crate::bindings::bindgen::ncalign_e_NCALIGN_RIGHT;
|
||||
|
||||
/// Center alignment within an [`NcPlane`] or terminal.
|
||||
pub const NCALIGN_CENTER: NcAlign = crate::ncalign_e_NCALIGN_CENTER;
|
||||
pub const NCALIGN_CENTER: NcAlign = crate::bindings::bindgen::ncalign_e_NCALIGN_CENTER;
|
||||
|
||||
/// Do not align an [`NcPlane`] or terminal.
|
||||
pub const NCALIGN_UNALIGNED: NcAlign = crate::ncalign_e_NCALIGN_UNALIGNED;
|
||||
pub const NCALIGN_UNALIGNED: NcAlign = crate::bindings::bindgen::ncalign_e_NCALIGN_UNALIGNED;
|
||||
|
||||
/// Blitter Mode (`NCBLIT_*`)
|
||||
///
|
||||
/// We never blit full blocks, but instead spaces (more efficient) with the
|
||||
/// background set to the desired foreground.
|
||||
pub type NcBlitter = crate::ncblitter_e;
|
||||
pub type NcBlitter = crate::bindings::bindgen::ncblitter_e;
|
||||
|
||||
/// [`NcBlitter`] mode using: space, compatible with ASCII
|
||||
pub const NCBLIT_1x1: NcBlitter = crate::ncblitter_e_NCBLIT_1x1;
|
||||
pub const NCBLIT_1x1: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_1x1;
|
||||
|
||||
/// [`NcBlitter`] mode using: halves + 1x1 (space)
|
||||
/// ▄▀
|
||||
pub const NCBLIT_2x1: NcBlitter = crate::ncblitter_e_NCBLIT_2x1;
|
||||
pub const NCBLIT_2x1: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_2x1;
|
||||
|
||||
/// [`NcBlitter`] mode using: quadrants + 2x1
|
||||
/// ▗▐ ▖▀▟▌▙
|
||||
pub const NCBLIT_2x2: NcBlitter = crate::ncblitter_e_NCBLIT_2x2;
|
||||
pub const NCBLIT_2x2: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_2x2;
|
||||
|
||||
/// [`NcBlitter`] mode using: sextants
|
||||
/// 🬀🬁🬂🬃🬄🬅🬆🬇🬈🬉🬊🬋🬌🬍🬎🬏🬐🬑🬒🬓🬔🬕🬖🬗🬘🬙🬚🬛🬜🬝🬞🬟🬠🬡🬢🬣🬤🬥🬦🬧🬨🬩🬪🬫🬬🬭🬮🬯🬰🬱🬲🬳🬴🬵🬶🬷🬸🬹🬺🬻
|
||||
pub const NCBLIT_3x2: NcBlitter = crate::ncblitter_e_NCBLIT_3x2;
|
||||
pub const NCBLIT_3x2: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_3x2;
|
||||
|
||||
/// [`NcBlitter`] mode using: four vertical levels
|
||||
/// █▆▄▂
|
||||
pub const NCBLIT_4x1: NcBlitter = crate::ncblitter_e_NCBLIT_4x1;
|
||||
pub const NCBLIT_4x1: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_4x1;
|
||||
|
||||
/// [`NcBlitter`] mode using: eight vertical levels
|
||||
/// █▇▆▅▄▃▂▁
|
||||
pub const NCBLIT_8x1: NcBlitter = crate::ncblitter_e_NCBLIT_8x1;
|
||||
pub const NCBLIT_8x1: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_8x1;
|
||||
|
||||
/// [`NcBlitter`] mode using: 4 rows, 2 cols (braille)
|
||||
/// ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
|
||||
pub const NCBLIT_BRAILLE: NcBlitter = crate::ncblitter_e_NCBLIT_BRAILLE;
|
||||
pub const NCBLIT_BRAILLE: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_BRAILLE;
|
||||
|
||||
/// [`NcBlitter`] mode where the blitter is automatically chosen
|
||||
pub const NCBLIT_DEFAULT: NcBlitter = crate::ncblitter_e_NCBLIT_DEFAULT;
|
||||
pub const NCBLIT_DEFAULT: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_DEFAULT;
|
||||
|
||||
/// [`NcBlitter`] mode (not yet implemented)
|
||||
pub const NCBLIT_SIXEL: NcBlitter = crate::ncblitter_e_NCBLIT_SIXEL;
|
||||
pub const NCBLIT_SIXEL: NcBlitter = crate::bindings::bindgen::ncblitter_e_NCBLIT_SIXEL;
|
||||
|
||||
/// How to scale an [`NcVisual`] during rendering
|
||||
///
|
||||
@ -91,21 +123,21 @@ pub const NCBLIT_SIXEL: NcBlitter = crate::ncblitter_e_NCBLIT_SIXEL;
|
||||
/// - NCSCALE_STRETCH stretches and scales the image in an
|
||||
/// attempt to fill the entirety of the plane.
|
||||
///
|
||||
pub type NcScale = crate::ncscale_e;
|
||||
pub type NcScale = crate::bindings::bindgen::ncscale_e;
|
||||
/// Maintain original size
|
||||
pub const NCSCALE_NONE: NcScale = crate::ncscale_e_NCSCALE_NONE;
|
||||
pub const NCSCALE_NONE: NcScale = crate::bindings::bindgen::ncscale_e_NCSCALE_NONE;
|
||||
/// Maintain aspect ratio
|
||||
pub const NCSCALE_SCALE: NcScale = crate::ncscale_e_NCSCALE_SCALE;
|
||||
pub const NCSCALE_SCALE: NcScale = crate::bindings::bindgen::ncscale_e_NCSCALE_SCALE;
|
||||
/// Throw away aspect ratio
|
||||
pub const NCSCALE_STRETCH: NcScale = crate::ncscale_e_NCSCALE_STRETCH;
|
||||
pub const NCSCALE_STRETCH: NcScale = crate::bindings::bindgen::ncscale_e_NCSCALE_STRETCH;
|
||||
|
||||
/// A visual bit of multimedia opened with LibAV|OIIO
|
||||
pub type NcVisual = crate::ncvisual;
|
||||
pub type NcVisual = crate::bindings::bindgen::ncvisual;
|
||||
/// Options struct for [`NcVisual`]
|
||||
pub type NcVisualOptions = crate::ncvisual_options;
|
||||
pub type NcVisualOptions = crate::bindings::bindgen::ncvisual_options;
|
||||
|
||||
/// Use [`NCCELL_ALPHA_BLEND`] with visual
|
||||
pub const NCVISUAL_OPTION_BLEND: u32 = crate::bindings::NCVISUAL_OPTION_BLEND;
|
||||
pub const NCVISUAL_OPTION_BLEND: u32 = crate::bindings::bindgen::NCVISUAL_OPTION_BLEND;
|
||||
|
||||
/// Fail rather than degrade
|
||||
pub const NCVISUAL_OPTION_NODEGRADE: u32 = crate::bindings::NCVISUAL_OPTION_NODEGRADE;
|
||||
pub const NCVISUAL_OPTION_NODEGRADE: u32 = crate::bindings::bindgen::NCVISUAL_OPTION_NODEGRADE;
|
||||
|
@ -3,7 +3,7 @@
|
||||
// NcDirect --------------------------------------------------------------------
|
||||
|
||||
/// Minimal notcurses instances for styling text
|
||||
pub type NcDirect = crate::ncdirect;
|
||||
pub type NcDirect = crate::bindings::bindgen::ncdirect;
|
||||
|
||||
/// Flags (options) for [`NcDirect`]
|
||||
pub type NcDirectFlags = u64;
|
||||
@ -12,7 +12,7 @@ pub type NcDirectFlags = u64;
|
||||
/// (disabling echo and line buffering)
|
||||
///
|
||||
pub const NCDIRECT_OPTION_INHIBIT_CBREAK: NcDirectFlags =
|
||||
crate::bindings::NCDIRECT_OPTION_INHIBIT_CBREAK as NcDirectFlags;
|
||||
crate::bindings::bindgen::NCDIRECT_OPTION_INHIBIT_CBREAK as NcDirectFlags;
|
||||
|
||||
/// Flag that avoids calling setlocale(LC_ALL, NULL)
|
||||
///
|
||||
@ -24,7 +24,7 @@ pub const NCDIRECT_OPTION_INHIBIT_CBREAK: NcDirectFlags =
|
||||
/// itself, usually as one of the first lines.
|
||||
///
|
||||
pub const NCDIRECT_OPTION_INHIBIT_SETLOCALE: NcDirectFlags =
|
||||
crate::bindings::NCDIRECT_OPTION_INHIBIT_SETLOCALE as NcDirectFlags;
|
||||
crate::bindings::bindgen::NCDIRECT_OPTION_INHIBIT_SETLOCALE as NcDirectFlags;
|
||||
|
||||
// Notcurses -------------------------------------------------------------------
|
||||
|
||||
@ -33,10 +33,10 @@ pub const NCDIRECT_OPTION_INHIBIT_SETLOCALE: NcDirectFlags =
|
||||
/// Notcurses builds atop the terminfo abstraction layer to
|
||||
/// provide reasonably portable vivid character displays.
|
||||
///
|
||||
pub type Notcurses = crate::bindings::notcurses;
|
||||
pub type Notcurses = crate::bindings::bindgen::notcurses;
|
||||
|
||||
/// Options struct for [`Notcurses`]
|
||||
pub type NotcursesOptions = crate::bindings::notcurses_options;
|
||||
pub type NotcursesOptions = crate::bindings::bindgen::notcurses_options;
|
||||
|
||||
/// Do not call setlocale()
|
||||
///
|
||||
@ -48,13 +48,15 @@ pub type NotcursesOptions = crate::bindings::notcurses_options;
|
||||
/// prior to notcurses_init(), you should not set this bit. Even if you are
|
||||
/// invoking setlocale(), this behavior shouldn't be an issue unless you're
|
||||
/// doing something weird (setting a locale not based on LANG).
|
||||
pub const NCOPTION_INHIBIT_SETLOCALE: u64 = crate::bindings::NCOPTION_INHIBIT_SETLOCALE as u64;
|
||||
pub const NCOPTION_INHIBIT_SETLOCALE: u64 =
|
||||
crate::bindings::bindgen::NCOPTION_INHIBIT_SETLOCALE as u64;
|
||||
|
||||
/// Do not enter alternate mode.
|
||||
///
|
||||
/// If smcup/rmcup capabilities are indicated, Notcurses defaults to making use
|
||||
/// of the "alternate screen". This flag inhibits use of smcup/rmcup.
|
||||
pub const NCOPTION_NO_ALTERNATE_SCREEN: u64 = crate::bindings::NCOPTION_NO_ALTERNATE_SCREEN as u64;
|
||||
pub const NCOPTION_NO_ALTERNATE_SCREEN: u64 =
|
||||
crate::bindings::bindgen::NCOPTION_NO_ALTERNATE_SCREEN as u64;
|
||||
|
||||
/// Do not modify the font.
|
||||
///
|
||||
@ -62,26 +64,29 @@ pub const NCOPTION_NO_ALTERNATE_SCREEN: u64 = crate::bindings::NCOPTION_NO_ALTER
|
||||
/// glyphs (especially on the Linux console). If this is set, no such
|
||||
/// modifications will be made. Note that font changes will not affect anything
|
||||
/// but the virtual console/terminal in which Notcurses is running.
|
||||
pub const NCOPTION_NO_FONT_CHANGES: u64 = crate::bindings::NCOPTION_NO_FONT_CHANGES as u64;
|
||||
pub const NCOPTION_NO_FONT_CHANGES: u64 = crate::bindings::bindgen::NCOPTION_NO_FONT_CHANGES as u64;
|
||||
|
||||
/// Do not handle SIG{ING, SEGV, ABRT, QUIT}
|
||||
///
|
||||
/// We typically install a signal handler for SIG{INT, SEGV, ABRT, QUIT} that
|
||||
/// restores the screen, and then calls the old signal handler. Set to inhibit
|
||||
/// registration of these signal handlers.
|
||||
pub const NCOPTION_NO_QUIT_SIGHANDLERS: u64 = crate::bindings::NCOPTION_NO_QUIT_SIGHANDLERS as u64;
|
||||
pub const NCOPTION_NO_QUIT_SIGHANDLERS: u64 =
|
||||
crate::bindings::bindgen::NCOPTION_NO_QUIT_SIGHANDLERS as u64;
|
||||
|
||||
/// Do not handle SIGWINCH
|
||||
///
|
||||
/// We typically install a signal handler for SIGWINCH that generates a resize
|
||||
/// event in the notcurses_getc() queue. Set to inhibit this handler
|
||||
pub const NCOPTION_NO_WINCH_SIGHANDLER: u64 = crate::bindings::NCOPTION_NO_WINCH_SIGHANDLER as u64;
|
||||
pub const NCOPTION_NO_WINCH_SIGHANDLER: u64 =
|
||||
crate::bindings::bindgen::NCOPTION_NO_WINCH_SIGHANDLER as u64;
|
||||
|
||||
/// Do not print banners
|
||||
///
|
||||
/// Notcurses typically prints version info in notcurses_init() and performance
|
||||
/// info in notcurses_stop(). This inhibits that output.
|
||||
pub const NCOPTION_SUPPRESS_BANNERS: u64 = crate::bindings::NCOPTION_SUPPRESS_BANNERS as u64;
|
||||
pub const NCOPTION_SUPPRESS_BANNERS: u64 =
|
||||
crate::bindings::bindgen::NCOPTION_SUPPRESS_BANNERS as u64;
|
||||
|
||||
/// Test for Sixel support
|
||||
///
|
||||
@ -89,7 +94,7 @@ pub const NCOPTION_SUPPRESS_BANNERS: u64 = crate::bindings::NCOPTION_SUPPRESS_BA
|
||||
/// inline reply from the terminal. Since this can interact poorly with actual
|
||||
/// user input, it's not done unless Sixel will actually be used. Set this flag
|
||||
/// to unconditionally test for Sixel support in notcurses_init().
|
||||
pub const NCOPTION_VERIFY_SIXEL: u64 = crate::bindings::NCOPTION_VERIFY_SIXEL as u64;
|
||||
pub const NCOPTION_VERIFY_SIXEL: u64 = crate::bindings::bindgen::NCOPTION_VERIFY_SIXEL as u64;
|
||||
|
||||
// NcLogLevel ------------------------------------------------------------------
|
||||
|
||||
@ -101,34 +106,36 @@ pub const NCOPTION_VERIFY_SIXEL: u64 = crate::bindings::NCOPTION_VERIFY_SIXEL as
|
||||
/// `NCOPTION_SUPPRESS_BANNERS`.
|
||||
/// Note that if stderr is connected to the same terminal on which we're
|
||||
/// rendering, any kind of logging will disrupt the output.
|
||||
pub type NcLogLevel = crate::ncloglevel_e;
|
||||
pub type NcLogLevel = crate::bindings::bindgen::ncloglevel_e;
|
||||
|
||||
/// this is honestly a bit much
|
||||
pub const NCLOGLEVEL_DEBUG: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_DEBUG;
|
||||
pub const NCLOGLEVEL_DEBUG: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_DEBUG;
|
||||
|
||||
/// we can't keep doin' this, but we can do other things
|
||||
pub const NCLOGLEVEL_ERROR: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_ERROR;
|
||||
pub const NCLOGLEVEL_ERROR: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_ERROR;
|
||||
|
||||
/// we're hanging around, but we've had a horrible fault
|
||||
pub const NCLOGLEVEL_FATAL: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_FATAL;
|
||||
pub const NCLOGLEVEL_FATAL: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_FATAL;
|
||||
|
||||
/// "detailed information
|
||||
pub const NCLOGLEVEL_INFO: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_INFO;
|
||||
pub const NCLOGLEVEL_INFO: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_INFO;
|
||||
|
||||
/// print diagnostics immediately related to crashing
|
||||
pub const NCLOGLEVEL_PANIC: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_PANIC;
|
||||
pub const NCLOGLEVEL_PANIC: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_PANIC;
|
||||
|
||||
/// default. print nothing once fullscreen service begins
|
||||
pub const NCLOGLEVEL_SILENT: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_SILENT;
|
||||
pub const NCLOGLEVEL_SILENT: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_SILENT;
|
||||
|
||||
/// there's probably a better way to do what you want
|
||||
pub const NCLOGLEVEL_TRACE: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_TRACE;
|
||||
pub const NCLOGLEVEL_TRACE: NcLogLevel = crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_TRACE;
|
||||
|
||||
/// "detailed information
|
||||
pub const NCLOGLEVEL_VERBOSE: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_VERBOSE;
|
||||
pub const NCLOGLEVEL_VERBOSE: NcLogLevel =
|
||||
crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_VERBOSE;
|
||||
|
||||
/// you probably don't want what's happening to happen
|
||||
pub const NCLOGLEVEL_WARNING: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_WARNING;
|
||||
pub const NCLOGLEVEL_WARNING: NcLogLevel =
|
||||
crate::bindings::bindgen::ncloglevel_e_NCLOGLEVEL_WARNING;
|
||||
|
||||
// NcInput ---------------------------------------------------------------------
|
||||
|
||||
@ -138,4 +145,4 @@ pub const NCLOGLEVEL_WARNING: NcLogLevel = crate::ncloglevel_e_NCLOGLEVEL_WARNIN
|
||||
/// including synthesized events and mouse events.
|
||||
///
|
||||
/// To exit, generate EOF (usually Ctrl+‘d’).
|
||||
pub type NcInput = crate::ncinput;
|
||||
pub type NcInput = crate::bindings::bindgen::ncinput;
|
||||
|
@ -19,22 +19,22 @@ use crate::NcPlane;
|
||||
/// `ncmenu_destroy` removes a menu bar, and frees all associated resources.
|
||||
///
|
||||
/// `type in C: ncmenu (struct)`
|
||||
pub type NcMenu = crate::ncmenu;
|
||||
pub type NcMenu = crate::bindings::bindgen::ncmenu;
|
||||
|
||||
/// Options struct for [`NcMenu`]
|
||||
pub type NcMenuOptions = crate::ncmenu_options;
|
||||
pub type NcMenuOptions = crate::bindings::bindgen::ncmenu_options;
|
||||
|
||||
/// Item for [`NcMenu`]
|
||||
pub type NcMenuItem = crate::ncmenu_item;
|
||||
pub type NcMenuItem = crate::bindings::bindgen::ncmenu_item;
|
||||
|
||||
/// Section for [`NcMenu`]
|
||||
pub type NcMenuSection = crate::ncmenu_section;
|
||||
pub type NcMenuSection = crate::bindings::bindgen::ncmenu_section;
|
||||
|
||||
/// Bottom row (as opposed to top row)
|
||||
pub const NCMENU_OPTION_BOTTOM: u32 = crate::bindings::NCMENU_OPTION_BOTTOM;
|
||||
pub const NCMENU_OPTION_BOTTOM: u32 = crate::bindings::bindgen::NCMENU_OPTION_BOTTOM;
|
||||
|
||||
/// Hide the menu when not unrolled
|
||||
pub const NCMENU_OPTION_HIDING: u32 = crate::bindings::NCMENU_OPTION_HIDING;
|
||||
pub const NCMENU_OPTION_HIDING: u32 = crate::bindings::bindgen::NCMENU_OPTION_HIDING;
|
||||
|
||||
// NcReader --------------------------------------------------------------------
|
||||
|
||||
@ -48,26 +48,26 @@ pub const NCMENU_OPTION_HIDING: u32 = crate::bindings::NCMENU_OPTION_HIDING;
|
||||
///
|
||||
/// `type in C: ncreader (struct)`
|
||||
///
|
||||
pub type NcReader = crate::ncreader;
|
||||
pub type NcReader = crate::bindings::bindgen::ncreader;
|
||||
|
||||
/// Options struct for [`NcReader`]
|
||||
///
|
||||
/// `type in C: ncreader_options (struct)`
|
||||
///
|
||||
pub type NcReaderOptions = crate::ncreader_options;
|
||||
pub type NcReaderOptions = crate::bindings::bindgen::ncreader_options;
|
||||
|
||||
/// Make the terminal cursor visible across the lifetime of the ncreader, and
|
||||
/// have the ncreader manage the cursor's placement.
|
||||
pub const NCREADER_OPTION_CURSOR: u32 = crate::bindings::NCREADER_OPTION_CURSOR;
|
||||
pub const NCREADER_OPTION_CURSOR: u32 = crate::bindings::bindgen::NCREADER_OPTION_CURSOR;
|
||||
|
||||
/// Enable horizontal scrolling. Virtual lines can then grow arbitrarily long.
|
||||
pub const NCREADER_OPTION_HORSCROLL: u32 = crate::bindings::NCREADER_OPTION_HORSCROLL;
|
||||
pub const NCREADER_OPTION_HORSCROLL: u32 = crate::bindings::bindgen::NCREADER_OPTION_HORSCROLL;
|
||||
|
||||
/// Disable all editing shortcuts. By default, emacs-style keys are available.
|
||||
pub const NCREADER_OPTION_NOCMDKEYS: u32 = crate::bindings::NCREADER_OPTION_NOCMDKEYS;
|
||||
pub const NCREADER_OPTION_NOCMDKEYS: u32 = crate::bindings::bindgen::NCREADER_OPTION_NOCMDKEYS;
|
||||
|
||||
/// Enable vertical scrolling. You can then use arbitrarily many virtual lines.
|
||||
pub const NCREADER_OPTION_VERSCROLL: u32 = crate::bindings::NCREADER_OPTION_VERSCROLL;
|
||||
pub const NCREADER_OPTION_VERSCROLL: u32 = crate::bindings::bindgen::NCREADER_OPTION_VERSCROLL;
|
||||
|
||||
// NcReel ----------------------------------------------------------------------
|
||||
|
||||
@ -84,72 +84,73 @@ pub const NCREADER_OPTION_VERSCROLL: u32 = crate::bindings::NCREADER_OPTION_VERS
|
||||
///
|
||||
/// If there is space left over, other tablets are included in the display.
|
||||
/// Tablets can come and go at any time, and can grow or shrink at any time.
|
||||
pub type NcReel = crate::ncreel;
|
||||
pub type NcReel = crate::bindings::bindgen::ncreel;
|
||||
|
||||
/// Options struct for [`NcReel`]
|
||||
pub type NcReelOptions = crate::ncreel_options;
|
||||
pub type NcReelOptions = crate::bindings::bindgen::ncreel_options;
|
||||
|
||||
/// Visual tablet for [`NcReel`]
|
||||
pub type NcTablet = crate::nctablet;
|
||||
pub type NcTablet = crate::bindings::bindgen::nctablet;
|
||||
|
||||
/// is navigation circular (does moving down from the last tablet move to the
|
||||
/// first, and vice versa)? only meaningful when infinitescroll is true. if
|
||||
/// infinitescroll is false, this must be false.
|
||||
pub const NCREEL_OPTION_CIRCULAR: u32 = crate::bindings::NCREEL_OPTION_CIRCULAR;
|
||||
pub const NCREEL_OPTION_CIRCULAR: u32 = crate::bindings::bindgen::NCREEL_OPTION_CIRCULAR;
|
||||
/// is scrolling infinite (can one move down or up forever, or is an end
|
||||
/// reached?). if true, 'circular' specifies how to handle the special case of
|
||||
/// an incompletely-filled reel.
|
||||
pub const NCREEL_OPTION_INFINITESCROLL: u32 = crate::bindings::NCREEL_OPTION_INFINITESCROLL;
|
||||
pub const NCREEL_OPTION_INFINITESCROLL: u32 =
|
||||
crate::bindings::bindgen::NCREEL_OPTION_INFINITESCROLL;
|
||||
|
||||
// NcPlot ----------------------------------------------------------------------
|
||||
|
||||
/// A histogram, bound to an [`NcPlane`]
|
||||
/// (uses non-negative `f64`s)
|
||||
pub type NcPlotF64 = crate::ncdplot;
|
||||
pub type NcPlotF64 = crate::bindings::bindgen::ncdplot;
|
||||
|
||||
/// A histogram, bound to an [`NcPlane`] (uses `u64`s)
|
||||
pub type NcPlotU64 = crate::ncuplot;
|
||||
pub type NcPlotU64 = crate::bindings::bindgen::ncuplot;
|
||||
|
||||
/// Options struct for
|
||||
/// [`NcPlotF64`] or [`NcPlotU64`]
|
||||
pub type NcPlotOptions = crate::ncplot_options;
|
||||
pub type NcPlotOptions = crate::bindings::bindgen::ncplot_options;
|
||||
|
||||
/// Use domain detection only for max
|
||||
pub const NCPLOT_OPTION_DETECTMAXONLY: u32 = crate::bindings::NCPLOT_OPTION_DETECTMAXONLY;
|
||||
pub const NCPLOT_OPTION_DETECTMAXONLY: u32 = crate::bindings::bindgen::NCPLOT_OPTION_DETECTMAXONLY;
|
||||
|
||||
/// Exponential dependent axis
|
||||
pub const NCPLOT_OPTION_EXPONENTIALD: u32 = crate::bindings::NCPLOT_OPTION_EXPONENTIALD;
|
||||
pub const NCPLOT_OPTION_EXPONENTIALD: u32 = crate::bindings::bindgen::NCPLOT_OPTION_EXPONENTIALD;
|
||||
|
||||
/// Show labels for dependent axis
|
||||
pub const NCPLOT_OPTION_LABELTICKSD: u32 = crate::bindings::NCPLOT_OPTION_LABELTICKSD;
|
||||
pub const NCPLOT_OPTION_LABELTICKSD: u32 = crate::bindings::bindgen::NCPLOT_OPTION_LABELTICKSD;
|
||||
|
||||
/// Use domain detection only for max
|
||||
pub const NCPLOT_OPTION_NODEGRADE: u32 = crate::bindings::NCPLOT_OPTION_NODEGRADE;
|
||||
pub const NCPLOT_OPTION_NODEGRADE: u32 = crate::bindings::bindgen::NCPLOT_OPTION_NODEGRADE;
|
||||
|
||||
/// Independent axis is vertical
|
||||
pub const NCPLOT_OPTION_VERTICALI: u32 = crate::bindings::NCPLOT_OPTION_VERTICALI;
|
||||
pub const NCPLOT_OPTION_VERTICALI: u32 = crate::bindings::bindgen::NCPLOT_OPTION_VERTICALI;
|
||||
|
||||
// NcSelector ------------------------------------------------------------------
|
||||
|
||||
/// high-level widget for selecting one item from a set
|
||||
pub type NcSelector = crate::ncselector;
|
||||
pub type NcSelector = crate::bindings::bindgen::ncselector;
|
||||
/// an item for [`NcSelector`]
|
||||
pub type NcSelectorItem = crate::ncselector_item;
|
||||
pub type NcSelectorItem = crate::bindings::bindgen::ncselector_item;
|
||||
/// Options structur for [`NcSelector`]
|
||||
pub type NcSelectorOptions = crate::ncselector_options;
|
||||
pub type NcSelectorOptions = crate::bindings::bindgen::ncselector_options;
|
||||
|
||||
// NcStats ---------------------------------------------------------------------
|
||||
|
||||
/// notcurses runtime statistics
|
||||
pub type NcStats = crate::ncstats;
|
||||
pub type NcStats = crate::bindings::bindgen::ncstats;
|
||||
|
||||
// NcMultiSelector -------------------------------------------------------------
|
||||
|
||||
/// high-level widget for selecting items from a set
|
||||
pub type NcMultiSelector = crate::ncmultiselector;
|
||||
pub type NcMultiSelector = crate::bindings::bindgen::ncmultiselector;
|
||||
|
||||
/// an item for [`NcMultiSelector`]
|
||||
pub type NcMultiSelectorItem = crate::ncmselector_item;
|
||||
pub type NcMultiSelectorItem = crate::bindings::bindgen::ncmselector_item;
|
||||
|
||||
/// Options structure for [`NcMultiSelector`]
|
||||
pub type NcMultiSelectorOptions = crate::ncmultiselector_options;
|
||||
pub type NcMultiSelectorOptions = crate::bindings::bindgen::ncmultiselector_options;
|
||||
|
Loading…
x
Reference in New Issue
Block a user