pub struct TerminalEmulator { /* private fields */ }Expand description
Terminal emulator
Implementations§
Source§impl TerminalEmulator
impl TerminalEmulator
Sourcepub fn new(width: u32, height: u32) -> Result<Self, KernelError>
pub fn new(width: u32, height: u32) -> Result<Self, KernelError>
Create a new terminal emulator
Sourcepub fn render_to_surface(&self)
pub fn render_to_surface(&self)
Render the terminal contents to its compositor surface.
The surface includes a 28px title bar at the top; terminal content is rendered starting at row 28.
Sourcepub fn process_input(&mut self, event: InputEvent) -> Result<(), KernelError>
pub fn process_input(&mut self, event: InputEvent) -> Result<(), KernelError>
Process input event
Sourcepub fn update(&mut self) -> Result<(), KernelError>
pub fn update(&mut self) -> Result<(), KernelError>
Update terminal from PTY output
Sourcepub fn render(
&self,
buf: &mut [u8],
width: usize,
_height: usize,
) -> Result<(), KernelError>
pub fn render( &self, buf: &mut [u8], width: usize, _height: usize, ) -> Result<(), KernelError>
Render terminal to a BGRA pixel buffer.
buf is widthheight4 bytes in BGRA format.
Sourcepub fn surface_id(&self) -> u32
pub fn surface_id(&self) -> u32
Get compositor surface ID
Sourcepub fn pty_slave_id(&self) -> u32
pub fn pty_slave_id(&self) -> u32
Get PTY slave ID for shell connection