diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-07-01 08:09:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-07-01 08:09:44 +0000 |
| commit | 94b9014f95ea38ad1e488f9c9d2a1905c87d0f52 (patch) | |
| tree | a5f59e8b7037537b6b2bc92e9ffb18314d5f9480 /terminal.h | |
| parent | Merge branch 'vs15-16' (diff) | |
| parent | reaadme: add styled and colored underlines to the feature list (diff) | |
Merge branch 'curly-underlines'
Closes #828
Diffstat (limited to 'terminal.h')
| -rw-r--r-- | terminal.h | 68 |
1 files changed, 60 insertions, 8 deletions
@@ -99,19 +99,58 @@ struct damage { uint16_t lines; }; -struct row_uri_range { - int start; - int end; +struct uri_range_data { uint64_t id; 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 { + /* This is just an expanded union row_range_data, but + * anonymous, so that we don't have to write range->u.uri.id, + * but can instead do range->uri.id */ + union { + struct uri_range_data uri; + struct curly_range_data curly; + }; + union row_range_data data; + }; +}; + +struct row_ranges { + struct row_range *v; + int size; + int count; +}; + +enum row_range_type {ROW_RANGE_URI, ROW_RANGE_CURLY}; + struct row_data { - struct { - struct row_uri_range *v; - uint32_t size; - uint32_t count; - } uri_ranges; + struct row_ranges uri_ranges; + struct row_ranges curly_ranges; }; struct row { @@ -260,6 +299,8 @@ struct vt { char *uri; } osc8; + struct curly_range_data curly; + struct { uint8_t *data; size_t size; @@ -358,6 +399,17 @@ struct terminal { const struct config *conf; void (*ascii_printer)(struct terminal *term, char32_t c); + union { + struct { + bool sixels:1; + bool osc8:1; + bool curly_style:1; + bool curly_color:1; + bool insert_mode:1; + bool charset:1; + }; + uint8_t value; + } bits_affecting_ascii_printer; pid_t slave; int ptmx; |
