Struct libnotcurses_sys::c_api::notcurses_options [−][src]
#[repr(C)]pub struct notcurses_options {
pub termtype: *const c_char,
pub loglevel: ncloglevel_e,
pub margin_t: c_uint,
pub margin_r: c_uint,
pub margin_b: c_uint,
pub margin_l: c_uint,
pub flags: u64,
}Expand description
Configuration for notcurses_init().
Fields
termtype: *const c_charThe 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: ncloglevel_eProgressively higher log levels result in more logging to stderr. By default, nothing is printed to stderr once fullscreen service begins.
margin_t: c_uintDesirable 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: c_uintDesirable 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: c_uintDesirable 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: c_uintDesirable 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: u64General 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
New NcOptions, with margins.
New NcOptions, with flags.
pub const fn with_all_options(
loglevel: NcLogLevel,
margin_t: NcDim,
margin_r: NcDim,
margin_b: NcDim,
margin_l: NcDim,
flags: u64
) -> Self
pub const fn with_all_options(
loglevel: NcLogLevel,
margin_t: NcDim,
margin_r: NcDim,
margin_b: NcDim,
margin_l: NcDim,
flags: u64
) -> Self
New NcOptions, with all the options.
Arguments
-
loglevel
Progressively higher log levels result in more logging to stderr. By default, nothing is printed to stderr once fullscreen service begins.
-
margin_t, margin_r, margin_b, margin_l
Desirable margins (top, right, bottom, left).
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. Absolute coordinates are relative to the rendering area ((0, 0) is always the origin of the rendering area).
-
flags
General flags; This is expressed as a bitfield so that future options can be added without reshaping the struct. Undefined bits must be set to 0.
Input may be freely dropped.
This ought be provided when the program does not intend to handle input. Otherwise, input can accumulate in internal buffers, eventually preventing Notcurses from processing terminal messages.
Do not call setlocale()
notcurses_init() will call setlocale() to inspect the current locale. If that locale is “C” or “POSIX”, it will call setlocale(LC_ALL, “”) to set the locale according to the LANG environment variable. Ideally, this will result in UTF8 being enabled, even if the client app didn’t call setlocale() itself. Unless you’re certain that you’re invoking setlocale() 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).
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.
Do not try to clear any preexisting bitmaps.
Note that they might still get cleared even if this is set, and they might not get cleared even if this is not set.
Do not modify the font.
Notcurses might attempt to change the font slightly, to support certain 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.
Do not handle SIG{ING, SEGV, ABRT, QUIT}.
A signal handler will usually be installed for SIGABRT, SIGBUS,
SIGFPE, SIGILL, SIGINT, SIGQUIT, SIGSEGV and SIGTERM,
cleaning up the terminal on such exceptions.
With this flag, the handler will not be installed.
Do not handle SIGWINCH.
A signal handler will usually be installed for SIGWINCH, resulting in NCKEY_RESIZE events being generated on input. With this flag, the handler will not be installed.
Initialize the standard plane’s virtual cursor to match the physical cursor at context creation time.
Together with
NcOptions::NO_ALTERNATE_SCREEN
and a scrolling standard plane,
this facilitates easy scrolling-style programs in rendered mode.
Do not print banners.
Notcurses typically prints version info in notcurses_init() and performance info in notcurses_stop(). This inhibits that output.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
