summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-07-18 12:41:37 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-07-18 12:53:41 +0200
commit952f4b59592088f15615eb404c828aaac31bfe82 (patch)
treea4e43e86f895b2a2cbc72ccd57a1a301cd84fb56 /src/libsystemd-terminal
parent1716f6dcf54d4c181c2e2558e3d5414f54c8d9ca (diff)
terminal: extend RGB attributes
There're 3 supported color-modes: term-color-codes, 256-color-code and rgb-color. We now use the term-color as default so zero(attr) will do what you'd expect. Furthermore, we split rgb and 256color so users can forward them properly without requiring an internal RGB converter. Furthermore, a "hidden" field according to VT510rm manual is added.
Diffstat (limited to 'src/libsystemd-terminal')
-rw-r--r--src/libsystemd-terminal/term-internal.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libsystemd-terminal/term-internal.h b/src/libsystemd-terminal/term-internal.h
index af1c723ade..56ebd30cb4 100644
--- a/src/libsystemd-terminal/term-internal.h
+++ b/src/libsystemd-terminal/term-internal.h
@@ -145,6 +145,11 @@ static inline void term_char_freep(term_char_t *p) {
*/
enum {
+ /* special color-codes */
+ TERM_CCODE_DEFAULT, /* default foreground/background color */
+ TERM_CCODE_256, /* 256color code */
+ TERM_CCODE_RGB, /* color is specified as RGB */
+
/* dark color-codes */
TERM_CCODE_BLACK,
TERM_CCODE_RED,
@@ -165,16 +170,12 @@ enum {
TERM_CCODE_LIGHT_CYAN = TERM_CCODE_CYAN + 8,
TERM_CCODE_LIGHT_WHITE = TERM_CCODE_WHITE + 8,
- /* pseudo colors */
- TERM_CCODE_FG, /* selected foreground color */
- TERM_CCODE_BG, /* selected background color */
- TERM_CCODE_RGB, /* color is specified as RGB */
-
TERM_CCODE_CNT,
};
struct term_color {
uint8_t ccode;
+ uint8_t c256;
uint8_t red;
uint8_t green;
uint8_t blue;
@@ -190,6 +191,7 @@ struct term_attr {
unsigned int inverse : 1; /* inverse fg/bg */
unsigned int protect : 1; /* protect from erase */
unsigned int blink : 1; /* blink text */
+ unsigned int hidden : 1; /* hidden */
};
/*