Struct Screen

Source
pub struct Screen { /* private fields */ }

Implementations§

Source§

impl Screen

Source

pub fn new<S, O, I>( term: Option<S>, output: &O, input: &I, ) -> Result<Self, NCurseswWinError>
where S: Into<String>, O: AsRawFd + Write, I: AsRawFd + Read,

Source

pub fn newterm<S, O, I>( term: Option<S>, output: &O, input: &I, ) -> Result<Self, NCurseswWinError>
where S: Into<String>, O: AsRawFd + Write, I: AsRawFd + Read,

👎Deprecated since 0.5.0: Use Screen::new() instead
Source

pub unsafe fn from_ptr(screen: SCREEN) -> Self

§Safety

convert a ‘SCREEN’ pointer from the underlying ‘ncursesw’ crate to a ‘ncurseswwin::Screen’.

Source

pub unsafe fn as_ptr(&self) -> SCREEN

§Safety

Return’s the ‘Screen’ as a pointer so we can use some of underlying ‘ncursesw’ crates functions, for example ‘ncursesw::extend::ColorPair::new_sp()’ (as imported in this crate as ‘crate::extend::ColorPair::new_sp()’)

Source

pub fn set_input_mode(&self, mode: InputMode) -> Result<(), NCurseswWinError>

Set the input mode to use within NCurses on this Screen.

The terminal gets input from the user. Then it’s sometimes buffered up. At some point it’s passed into the program’s input buffer.

  • Character: Input is passed in 1 character at a time, but special characters (such as Ctrl+C and Ctrl+S) are automatically processed for you by the terminal.
  • Cooked: Input is passed in 1 line at a time, with the special character processing mentioned above enabled.
  • RawCharacter: Input is passed in 1 character at a time, and special character sequences are not processed automatically.
  • RawCooked: Input is passed in 1 line at a time, and special character sequences are not processed automatically.

The default mode is inherited from the terminal that started the program (usually Cooked), so you should always set the desired mode explicitly at the start of your program.

Source

pub fn set_echo(&self, flag: bool) -> Result<(), NCurseswWinError>

Set echo on or off within NCurses on this Screen.

Enables or disables the automatic echoing of input into the window as the user types. Default to on, but you probably want it to be off most of the time.

Source

pub fn set_filter(&self, flag: bool)

Source

pub fn set_newline(&self, flag: bool) -> Result<(), NCurseswWinError>

Control whether NCurses translates the return key into newline on input on this Screen.

This determines wether ncurses translates newline into return and line-feed on output (in either case, the call addch(‘\n’) does the equivalent of return and line feed on the virtual screen). Initially, these translations do occur. If you disable then ncurses will be able to make better use of the line-feed capability, resulting in faster cursor motion. Also, ncurses will then be able to detect the return key.

Source

pub fn set_qiflush(&self, flag: bool)

Source

pub fn assume_default_colors<S, C, T>( &self, colors: S, ) -> Result<(), NCurseswWinError>
where S: ColorsType<C, T>, C: ColorType<T>, T: ColorAttributeTypes,

Source

pub fn baudrate(&self) -> Result<u32, NCurseswWinError>

Source

pub fn beep(&self) -> Result<(), NCurseswWinError>

Source

pub fn can_change_color(&self) -> bool

Source

pub fn cursor_set( &self, cursor: CursorType, ) -> Result<CursorType, NCurseswWinError>

Source

pub fn curs_set( &self, cursor: CursorType, ) -> Result<CursorType, NCurseswWinError>

👎Deprecated since 0.6.0: Use Screen::cursor_set() instead
Source

pub fn define_key( &self, definition: Option<&str>, keycode: KeyBinding, ) -> Result<(), NCurseswWinError>

Source

pub fn def_prog_mode(&self) -> Result<(), NCurseswWinError>

Source

pub fn def_shell_mode(&self) -> Result<(), NCurseswWinError>

Source

pub fn delay_output(&self, ms: Duration) -> Result<(), NCurseswWinError>

Source

pub fn doupdate(&self) -> Result<(), NCurseswWinError>

Source

pub fn erasechar(&self) -> Result<char, NCurseswWinError>

Source

pub fn flash(&self) -> Result<(), NCurseswWinError>

Source

pub fn flushinp(&self) -> Result<(), NCurseswWinError>

Source

pub fn get_escdelay(&self) -> Result<Duration, NCurseswWinError>

Source

pub fn getwin<I: AsRawFd + Read>( &self, file: &I, ) -> Result<Window, NCurseswWinError>

Source

pub fn halfdelay(&self, tenths: Duration) -> Result<(), NCurseswWinError>

Source

pub fn has_colors(&self) -> bool

Source

pub fn has_ic(&self) -> bool

Source

pub fn has_il(&self) -> bool

Source

pub fn has_key(&self, ch: KeyBinding) -> bool

Source

pub fn has_mouse(&self) -> bool

Source

pub fn intrflush(&self, flag: bool) -> Result<(), NCurseswWinError>

Source

pub fn is_term_resized(&self, size: Size) -> Result<bool, NCurseswWinError>

Source

pub fn keybound(&self, keycode: KeyBinding, count: i32) -> Option<String>

Source

pub fn key_defined( &self, definition: &str, ) -> Result<Option<KeyBinding>, NCurseswWinError>

Source

pub fn keyname(&self, c: KeyBinding) -> Result<String, NCurseswWinError>

Source

pub fn keyok( &self, keycode: KeyBinding, enable: bool, ) -> Result<(), NCurseswWinError>

Source

pub fn killchar(&self) -> Result<char, NCurseswWinError>

Source

pub fn longname(&self) -> Result<String, NCurseswWinError>

Source

pub fn mcprint(&self, data: &[i8], len: i32) -> Result<i32, NCurseswWinError>

Source

pub fn mvcur(&self, old: Origin, new: Origin) -> Result<(), NCurseswWinError>

Source

pub fn napms(&self, ms: Duration) -> Result<(), NCurseswWinError>

👎Deprecated since 0.5.0: ncurses library call superseeded by native rust call. Use std::thread::sleep(dur: std::time::Duration) instead
Source

pub fn reset_color_pairs(&self)

👎Deprecated since 0.5.0: use with caution as this routine will reset all color pairs potentially before they go out of scope and the color pairs will default to terminal default foreground and backgound colors.

Reset all defined color pairs.

Source

pub fn reset_prog_mode(&self) -> Result<(), NCurseswWinError>

Source

pub fn reset_shell_mode(&self) -> Result<(), NCurseswWinError>

Source

pub fn resetty(&self) -> Result<(), NCurseswWinError>

Source

pub fn resize_term(&self, size: Size) -> Result<(), NCurseswWinError>

Source

pub fn resizeterm(&self, size: Size) -> Result<(), NCurseswWinError>

Source

pub fn savetty(&self) -> Result<(), NCurseswWinError>

Source

pub fn scr_init<P: AsRef<Path>>(&self, path: P) -> Result<(), NCurseswWinError>

Source

pub fn scr_restore<P: AsRef<Path>>( &self, path: P, ) -> Result<(), NCurseswWinError>

Source

pub fn scr_set<P: AsRef<Path>>(&self, path: P) -> Result<(), NCurseswWinError>

Source

pub fn set_escdelay(&self, ms: Duration) -> Result<(), NCurseswWinError>

Source

pub fn set_tabsize(&self, size: i32) -> Result<(), NCurseswWinError>

Source

pub fn set_term(&self) -> Result<Screen, NCurseswWinError>

Source

pub fn start_color(&self) -> Result<(), NCurseswWinError>

Source

pub fn termname(&self) -> Result<String, NCurseswWinError>

Source

pub fn typeahead<FD: AsRawFd + Read>( &self, file: Option<FD>, ) -> Result<(), NCurseswWinError>

Source

pub fn unctrl(&self, c: ChtypeChar) -> Result<String, NCurseswWinError>

Source

pub fn ungetch(&self, ch: char) -> Result<(), NCurseswWinError>

Source

pub fn unget_wch(&self, ch: WideChar) -> Result<(), NCurseswWinError>

Source

pub fn use_default_colors(&self) -> Result<(), NCurseswWinError>

Source

pub fn use_env(&self, flag: bool)

Source

pub fn use_tioctl(&self, flag: bool)

Source

pub fn use_legacy_coding( &self, level: Legacy, ) -> Result<Legacy, NCurseswWinError>

Source

pub fn wunctrl(&self, ch: ComplexChar) -> Result<WideChar, NCurseswWinError>

Source

pub fn erasewchar(&self) -> Result<WideChar, NCurseswWinError>

Source

pub fn killwchar(&self) -> Result<WideChar, NCurseswWinError>

Source

pub fn ceiling_panel(&self) -> Result<Panel, NCurseswWinError>

Returns the topmost panel in the given screen.

Source

pub fn ground_panel(&self) -> Result<Panel, NCurseswWinError>

Returns the lowest panel in the given screen.

Source

pub fn update_panels(&self)

Trait Implementations§

Source§

impl AsRef<Screen> for Screen

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Screen

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Screen

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Screen

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Hash for Screen

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Screen

Source§

fn eq(&self, rhs: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Screen

Source§

impl Send for Screen

Source§

impl Sync for Screen

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.