Skip to main content

par_term_config/
cell.rs

1/// A single terminal cell with styled content for rendering
2///
3/// This is the bridge between terminal emulation (core library cells with VT attributes)
4/// and GPU rendering (colored rectangles and textured glyphs). The `TerminalManager`
5/// converts core cells into these, applying theme colors and selection state.
6#[derive(Clone, Debug, PartialEq)]
7pub struct Cell {
8    pub grapheme: String,
9    pub fg_color: [u8; 4],
10    pub bg_color: [u8; 4],
11    pub bold: bool,
12    pub italic: bool,
13    pub underline: bool,
14    pub strikethrough: bool,
15    pub hyperlink_id: Option<u32>,
16    pub wide_char: bool,
17    pub wide_char_spacer: bool,
18}
19
20impl Default for Cell {
21    fn default() -> Self {
22        Self {
23            grapheme: " ".to_string(),
24            fg_color: [255, 255, 255, 255],
25            bg_color: [0, 0, 0, 0],
26            bold: false,
27            italic: false,
28            underline: false,
29            strikethrough: false,
30            hyperlink_id: None,
31            wide_char: false,
32            wide_char_spacer: false,
33        }
34    }
35}