aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-07-03 07:59:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-07-03 07:59:56 +0000
commite5ed387426cb7d50d6d24dc0a3fbf95334314d40 (patch)
tree075e84e1f06a7120f1abb1292ba144b81cac894d /terminal.h
parentcsi: implement SGR 21, double underlines (diff)
parentcsi: redraw margins after restoring the palette (diff)
Merge branch 'color-stack'
Closes #856
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/terminal.h b/terminal.h
index a148e528..4d628661 100644
--- a/terminal.h
+++ b/terminal.h
@@ -393,6 +393,19 @@ struct url {
};
typedef tll(struct url) url_list_t;
+
+struct colors {
+ uint32_t fg;
+ uint32_t bg;
+ uint32_t table[256];
+ uint16_t alpha;
+ uint32_t cursor_fg; /* Text color */
+ uint32_t cursor_bg; /* cursor color */
+ uint32_t selection_fg;
+ uint32_t selection_bg;
+ bool use_custom_selection;
+};
+
struct terminal {
struct fdm *fdm;
struct reaper *reaper;
@@ -563,15 +576,13 @@ struct terminal {
int cell_width; /* pixels per cell, x-wise */
int cell_height; /* pixels per cell, y-wise */
+ struct colors colors;
+
struct {
- uint32_t fg;
- uint32_t bg;
- uint32_t table[256];
- uint16_t alpha;
- uint32_t selection_fg;
- uint32_t selection_bg;
- bool use_custom_selection;
- } colors;
+ struct colors *stack;
+ size_t idx;
+ size_t size;
+ } color_stack;
enum cursor_style cursor_style;
struct {
@@ -580,10 +591,6 @@ struct terminal {
int fd;
enum { CURSOR_BLINK_ON, CURSOR_BLINK_OFF } state;
} cursor_blink;
- struct {
- uint32_t text;
- uint32_t cursor;
- } cursor_color;
struct {
enum selection_kind kind;