pub struct Terminal {
pub screen: Screen,
pub encoding: Encoding,
pub music_on_csi_m: bool,
pub music_enabled: bool,
pub sixel_display_mode: bool,
pub syncterm: SyncTerm,
pub mouse: MouseModes,
pub bracketed_paste: bool,
pub download_dir: Option<PathBuf>,
pub fonts_dir: Option<PathBuf>,
/* private fields */
}Fields§
§screen: Screen§encoding: Encoding§music_on_csi_m: boolTreat ESC [ M with no parameter as the start of ANSI music, as
many BBS doors expect, instead of “delete one line”. ESC [ N and
ESC [ | always start music.
music_enabled: boolWhether music is played at all (it isn’t waited for if not).
sixel_display_mode: boolCSI ? 80 h (DECSDM): sixel pictures go at the top left of the
screen and don’t scroll it.
syncterm: SyncTermSyncTERM’s file cache, pictures and pixel buffers.
mouse: MouseModesThe mouse reporting the BBS has asked for.
bracketed_paste: boolCSI ? 2004 h: pasted text comes between ESC [ 200 ~ and
ESC [ 201 ~, so the BBS can tell it from typing.
download_dir: Option<PathBuf>Where downloads go: RIP looks there for icons and scenes too.
fonts_dir: Option<PathBuf>The user’s fonts: SkyPix finds Amiga disk fonts there.
Implementations§
Source§impl Terminal
impl Terminal
pub fn new(cols: usize, rows: usize, scrollback: usize) -> Self
Sourcepub fn start_emulation(&mut self)
pub fn start_emulation(&mut self)
Set up the screen for the encoding: a C64 or Atari system gets that machine’s colors and font.
pub fn rip_mut(&mut self) -> Option<&mut Rip>
Sourcepub fn toggle_reveal(&mut self) -> Option<bool>
pub fn toggle_reveal(&mut self) -> Option<bool>
Show a teletext page’s concealed text, or hide it again (Viewdata and Mode 7); the new state, or None for other systems.
pub fn igs_mut(&mut self) -> Option<&mut Igs>
Sourcepub fn skypix_mut(&mut self) -> Option<&mut Skypix>
pub fn skypix_mut(&mut self) -> Option<&mut Skypix>
The Amiga screen, for a SkyPix system.
Sourcepub fn take_skypix_transfer(&mut self) -> Option<(Transfer, Vec<u8>)>
pub fn take_skypix_transfer(&mut self) -> Option<(Transfer, Vec<u8>)>
A file transfer SkyPix started, and the bytes after it.
pub fn skypix(&self) -> Option<&Skypix>
Sourcepub fn codepage(&self) -> Option<&'static CodePage>
pub fn codepage(&self) -> Option<&'static CodePage>
The code page the BBS’s text is in, when it has chosen a code-page font for its screen (CP866, KOI8-R…): typing, pasting and copying go through it rather than CP437.
Sourcepub fn text_codepage(&self) -> Option<&'static CodePage>
pub fn text_codepage(&self) -> Option<&'static CodePage>
What the characters on the screen are, for copying them as text: the code page, or the C64’s or Atari’s screen codes.
Sourcepub fn encode_text(&self, text: &str) -> Vec<u8> ⓘ
pub fn encode_text(&self, text: &str) -> Vec<u8> ⓘ
Text typed or pasted, as the BBS expects its bytes.
Sourcepub fn paste(&self, text: &str) -> Vec<u8> ⓘ
pub fn paste(&self, text: &str) -> Vec<u8> ⓘ
Pasted text, as the BBS should get it: in brackets if it asked for them (with any escape taken out, so the text can’t end them early).
Sourcepub fn take_replies(&mut self) -> Vec<u8> ⓘ
pub fn take_replies(&mut self) -> Vec<u8> ⓘ
Bytes the terminal wants sent to the remote (e.g. CPR replies).
pub fn take_events(&mut self) -> Vec<TermEvent>
pub fn feed(&mut self, data: &[u8])
Sourcepub fn poll(&mut self, now: Instant)
pub fn poll(&mut self, now: Instant)
Time passing: sound reports the BBS asked for, and reading again after a wait for a sound.
Sourcepub fn next_poll(&self) -> Option<Instant>
pub fn next_poll(&self) -> Option<Instant>
When Terminal::poll has something to do.
Sourcepub fn take_rip_block(&mut self) -> Option<(BlockTransfer, Vec<u8>)>
pub fn take_rip_block(&mut self) -> Option<(BlockTransfer, Vec<u8>)>
A file transfer RIP started, and the bytes after it.
Sourcepub fn rip_press(&mut self, x: usize, y: usize) -> Option<Vec<u8>>
pub fn rip_press(&mut self, x: usize, y: usize) -> Option<Vec<u8>>
A click on the RIP graphics at (x, y): what to send, if anything
(see crate::rip::Rip::press).
Sourcepub fn rip_answer(&mut self, answer: Option<String>)
pub fn rip_answer(&mut self, answer: Option<String>)
The answer to a TermEvent::RipQuestion (None: cancelled); what
it lets be sent is in the replies.