NcOptions

Type Alias NcOptions 

Source
pub type NcOptions = notcurses_options;
Expand description

Options struct for Nc.

§Fields

Aliased Type§

#[repr(C)]
pub struct NcOptions { pub termtype: *const i8, pub loglevel: i32, pub margin_t: u32, pub margin_r: u32, pub margin_b: u32, pub margin_l: u32, pub flags: u64, }

Fields§

§termtype: *const i8

The name of the terminfo database entry describing this terminal. If NULL, the environment variable TERM is used. Failure to open the terminal definition will result in failure to initialize notcurses.

§loglevel: i32

Progressively higher log levels result in more logging to stderr. By default, nothing is printed to stderr once fullscreen service begins.

§margin_t: u32

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_r: u32

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_b: u32

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§margin_l: u32

Desirable margins. If all are 0 (default), we will render to the entirety of the screen. If the screen is too small, we do what we can–this is strictly best-effort. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).

§flags: u64

General flags; see NCOPTION_*. This is expressed as a bitfield so that future options can be added without reshaping the struct. Undefined bits must be set to 0.

Implementations§

Source§

impl NcOptions

§constructors

Source

pub fn builder() -> NcOptionsBuilder

Returns a default Nc options builder.

Source

pub fn to_builder(&self) -> NcOptionsBuilder

Returns a builder object from the current Nc options.

Source

pub fn new() -> Self

New NcOptions.

Source

pub fn with_margins(top: u32, right: u32, bottom: u32, left: u32) -> Self

New NcOptions, with margins.

Source

pub fn with_flags(flags: NcFlag) -> Self

New NcOptions, with flags.

Source

pub fn with_all_options( loglevel: NcLogLevel, trbl_margins: Option<(u32, u32, u32, u32)>, flags: NcFlag, ) -> NcOptions

New NcOptions, with flags

Source§

impl NcOptions

§methods

Source

pub fn margins(&self) -> (u32, u32, u32, u32)

Returns the (top, right, bottom, left) margins.

Source

pub fn log_level(&self) -> NcLogLevel

Returns the log level.

Source

pub fn is_drain_input(&self) -> bool

Returns true if it has the DrainInput flag set.

Source

pub fn is_inhibit_set_locale(&self) -> bool

Returns true if it has the InhibitSetLocale flag set.

Source

pub fn is_no_alternate_screen(&self) -> bool

Returns true if it has the NoAlternateScreen flag set.

Source

pub fn is_no_clear_bitmaps(&self) -> bool

Returns true if it has the NoClearBitmaps flag set.

Source

pub fn is_no_font_changes(&self) -> bool

Returns true if it has the NoFontChanges flag set.

Source

pub fn is_no_quit_sig_handlers(&self) -> bool

Returns true if it has the NoQuitSigHandlers flag set.

Source

pub fn is_no_winch_sig_handler(&self) -> bool

Returns true if it has the NoWinchSigHandler flag set.

Source

pub fn is_preserve_cursor(&self) -> bool

Returns true if it has the PreserveCursor flag set.

Source

pub fn is_scrolling(&self) -> bool

Returns true if it has the Scrolling flag set.

Source

pub fn is_cli_mode(&self) -> bool

Returns true if it has the CliMode flag set.

Source

pub fn is_suppress_banners(&self) -> bool

Returns true if it has the SuppressBanners flag set.

Trait Implementations§

Source§

impl From<&NcOptionsBuilder> for NcOptions

Source§

fn from(builder: &NcOptionsBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<&mut NcOptionsBuilder> for NcOptions

Source§

fn from(builder: &mut NcOptionsBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<NcOptionsBuilder> for NcOptions

Source§

fn from(builder: NcOptionsBuilder) -> NcOptions

Converts to this type from the input type.