csi: wip: styled underlines

This is work in progress, and fairly untested.

This adds initial tracking of styled underlines. Setting attributes
seems to work (both color and underline style). Grid reflow has *not*
been tested.

When rendering, style is currently ignored (all styles are rendered as
a plain, legacy underline).

Color however, *is* applied.
This commit is contained in:
Daniel Eklöf 2024-06-23 17:39:15 +02:00
parent 20923bb2e8
commit 32effc6657
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 371 additions and 66 deletions

View file

@ -104,12 +104,33 @@ struct uri_range_data {
char *uri;
};
enum curly_style {
CURLY_NONE,
CURLY_SINGLE, /* Legacy underline */
CURLY_DOUBLE,
CURLY_CURLY,
CURLY_DOTTED,
CURLY_DASHED,
};
struct curly_range_data {
enum curly_style style;
enum color_source color_src;
uint32_t color;
};
union row_range_data {
struct uri_range_data uri;
struct curly_range_data curly;
};
struct row_range {
int start;
int end;
union {
struct uri_range_data uri;
struct curly_range_data curly;
};
};
@ -119,10 +140,11 @@ struct row_ranges {
int count;
};
enum row_range_type {ROW_RANGE_URI};
enum row_range_type {ROW_RANGE_URI, ROW_RANGE_CURLY};
struct row_data {
struct row_ranges uri_ranges;
struct row_ranges curly_ranges;
};
struct row {
@ -271,6 +293,8 @@ struct vt {
char *uri;
} osc8;
struct curly_range_data curly;
struct {
uint8_t *data;
size_t size;