pub struct Screen { /* private fields */ }
Implementations§
Source§impl Screen
impl Screen
pub fn new<S, O, I>( term: Option<S>, output: &O, input: &I, ) -> Result<Self, NCurseswWinError>
pub fn newterm<S, O, I>( term: Option<S>, output: &O, input: &I, ) -> Result<Self, NCurseswWinError>
Sourcepub unsafe fn from_ptr(screen: SCREEN) -> Self
pub unsafe fn from_ptr(screen: SCREEN) -> Self
§Safety
convert a ‘SCREEN’ pointer from the underlying ‘ncursesw’ crate to a ‘ncurseswwin::Screen’.
Sourcepub unsafe fn as_ptr(&self) -> SCREEN
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()’)
Sourcepub fn set_input_mode(&self, mode: InputMode) -> Result<(), NCurseswWinError>
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.
Sourcepub fn set_echo(&self, flag: bool) -> Result<(), NCurseswWinError>
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.
pub fn set_filter(&self, flag: bool)
Sourcepub fn set_newline(&self, flag: bool) -> Result<(), NCurseswWinError>
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.
pub fn set_qiflush(&self, flag: bool)
pub fn assume_default_colors<S, C, T>( &self, colors: S, ) -> Result<(), NCurseswWinError>
pub fn baudrate(&self) -> Result<u32, NCurseswWinError>
pub fn beep(&self) -> Result<(), NCurseswWinError>
pub fn can_change_color(&self) -> bool
pub fn cursor_set( &self, cursor: CursorType, ) -> Result<CursorType, NCurseswWinError>
pub fn curs_set( &self, cursor: CursorType, ) -> Result<CursorType, NCurseswWinError>
pub fn define_key( &self, definition: Option<&str>, keycode: KeyBinding, ) -> Result<(), NCurseswWinError>
pub fn def_prog_mode(&self) -> Result<(), NCurseswWinError>
pub fn def_shell_mode(&self) -> Result<(), NCurseswWinError>
pub fn delay_output(&self, ms: Duration) -> Result<(), NCurseswWinError>
pub fn doupdate(&self) -> Result<(), NCurseswWinError>
pub fn erasechar(&self) -> Result<char, NCurseswWinError>
pub fn flash(&self) -> Result<(), NCurseswWinError>
pub fn flushinp(&self) -> Result<(), NCurseswWinError>
pub fn get_escdelay(&self) -> Result<Duration, NCurseswWinError>
pub fn getwin<I: AsRawFd + Read>( &self, file: &I, ) -> Result<Window, NCurseswWinError>
pub fn halfdelay(&self, tenths: Duration) -> Result<(), NCurseswWinError>
pub fn has_colors(&self) -> bool
pub fn has_ic(&self) -> bool
pub fn has_il(&self) -> bool
pub fn has_key(&self, ch: KeyBinding) -> bool
pub fn has_mouse(&self) -> bool
pub fn intrflush(&self, flag: bool) -> Result<(), NCurseswWinError>
pub fn is_term_resized(&self, size: Size) -> Result<bool, NCurseswWinError>
pub fn keybound(&self, keycode: KeyBinding, count: i32) -> Option<String>
pub fn key_defined( &self, definition: &str, ) -> Result<Option<KeyBinding>, NCurseswWinError>
pub fn keyname(&self, c: KeyBinding) -> Result<String, NCurseswWinError>
pub fn keyok( &self, keycode: KeyBinding, enable: bool, ) -> Result<(), NCurseswWinError>
pub fn killchar(&self) -> Result<char, NCurseswWinError>
pub fn longname(&self) -> Result<String, NCurseswWinError>
pub fn mcprint(&self, data: &[i8], len: i32) -> Result<i32, NCurseswWinError>
pub fn mvcur(&self, old: Origin, new: Origin) -> Result<(), NCurseswWinError>
pub fn napms(&self, ms: Duration) -> Result<(), NCurseswWinError>
Sourcepub 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.
pub fn reset_color_pairs(&self)
Reset all defined color pairs.
pub fn reset_prog_mode(&self) -> Result<(), NCurseswWinError>
pub fn reset_shell_mode(&self) -> Result<(), NCurseswWinError>
pub fn resetty(&self) -> Result<(), NCurseswWinError>
pub fn resize_term(&self, size: Size) -> Result<(), NCurseswWinError>
pub fn resizeterm(&self, size: Size) -> Result<(), NCurseswWinError>
pub fn savetty(&self) -> Result<(), NCurseswWinError>
pub fn scr_init<P: AsRef<Path>>(&self, path: P) -> Result<(), NCurseswWinError>
pub fn scr_restore<P: AsRef<Path>>( &self, path: P, ) -> Result<(), NCurseswWinError>
pub fn scr_set<P: AsRef<Path>>(&self, path: P) -> Result<(), NCurseswWinError>
pub fn set_escdelay(&self, ms: Duration) -> Result<(), NCurseswWinError>
pub fn set_tabsize(&self, size: i32) -> Result<(), NCurseswWinError>
pub fn set_term(&self) -> Result<Screen, NCurseswWinError>
pub fn start_color(&self) -> Result<(), NCurseswWinError>
pub fn termname(&self) -> Result<String, NCurseswWinError>
pub fn typeahead<FD: AsRawFd + Read>( &self, file: Option<FD>, ) -> Result<(), NCurseswWinError>
pub fn unctrl(&self, c: ChtypeChar) -> Result<String, NCurseswWinError>
pub fn ungetch(&self, ch: char) -> Result<(), NCurseswWinError>
pub fn unget_wch(&self, ch: WideChar) -> Result<(), NCurseswWinError>
pub fn use_default_colors(&self) -> Result<(), NCurseswWinError>
pub fn use_env(&self, flag: bool)
pub fn use_tioctl(&self, flag: bool)
pub fn use_legacy_coding( &self, level: Legacy, ) -> Result<Legacy, NCurseswWinError>
pub fn wunctrl(&self, ch: ComplexChar) -> Result<WideChar, NCurseswWinError>
pub fn erasewchar(&self) -> Result<WideChar, NCurseswWinError>
pub fn killwchar(&self) -> Result<WideChar, NCurseswWinError>
Sourcepub fn ceiling_panel(&self) -> Result<Panel, NCurseswWinError>
pub fn ceiling_panel(&self) -> Result<Panel, NCurseswWinError>
Returns the topmost panel in the given screen.
Sourcepub fn ground_panel(&self) -> Result<Panel, NCurseswWinError>
pub fn ground_panel(&self) -> Result<Panel, NCurseswWinError>
Returns the lowest panel in the given screen.