ttx 0.1.0
Loading...
Searching...
No Matches
cell.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/math/numeric_limits.h"
4#include "di/types/integers.h"
5
6namespace ttx::terminal {
8struct Cell {
9 constexpr static auto max_text_size = (di::NumericLimits<u16>::max >> 4);
10
12 u16 hyperlink_id { 0 };
13 u16 multi_cell_id { 0 };
14 u16 text_size : 12 { 0 };
16 u16 explicitly_sized : 1 { 0 };
18 mutable u16 stale : 1 { false };
19
20 auto is_multi_cell() const { return multi_cell_id != 0; }
23
24 auto is_empty() const {
25 return graphics_rendition_id == 0 && hyperlink_id == 0 && multi_cell_id == 0 && text_size == 0;
26 }
27};
28}
Definition capability.h:8
Represents a on-screen terminal cell.
Definition cell.h:8
auto is_nonprimary_in_multi_cell() const
Definition cell.h:22
u16 stale
1 indicates the cell has ben rendered
Definition cell.h:18
u16 explicitly_sized
1 indicates must be rendered using explicit sizing
Definition cell.h:16
u16 text_size
The size in bytes of the text in this cell (0 means no text)
Definition cell.h:14
auto is_primary_in_multi_cell() const
Definition cell.h:21
auto is_empty() const
Definition cell.h:24
static constexpr auto max_text_size
Definition cell.h:9
auto is_multi_cell() const
Definition cell.h:20
u16 multi_cell_id
0 means none (single cell)
Definition cell.h:13
u16 left_boundary_of_multicell
1 indicates this cell is in the furthest left column of a multicell.
Definition cell.h:15
u16 graphics_rendition_id
0 means default
Definition cell.h:11
u16 complex_grapheme_cluster
1 indicates this cell consists of multiple non-zero width code points
Definition cell.h:17
u16 hyperlink_id
0 means none
Definition cell.h:12