diff options
author | Ailin Nemui <ailin@esf51.localdomain> | 2014-01-09 15:20:29 +0100 |
---|---|---|
committer | Ailin Nemui <ailin@esf51.localdomain> | 2014-06-30 02:41:34 +0200 |
commit | 96a292d40e7f6fe505c4a0f686d35132ffac8208 (patch) | |
tree | 6f101c12381cbf47b19ce85499a81435a1d9f4f6 /src/fe-text/term.h | |
parent | 2d4edc51877719c49d712271967313310f4796fb (diff) | |
download | irssi-96a292d40e7f6fe505c4a0f686d35132ffac8208.zip |
Finish 256 colour support for Irssi
256 colour patch is cleaned up and the remaining cases are made work,
this includes especially Theme support, which was not implemented
before. Changes not related to colours were reverted again, making a
review of the two patches against master easier to follow.
As a byproduct of the Hex-colour code parser, the 24bit colours are
also implemented. Actually using them in the terminal is guarded by a
compile time switch (as well as a run time switch), as it breaks the
existing colour protocol and requires additional storage.
To make a seamless usage, down-conversion is provided for 8 and 16
colours.
Diverging from Tom's approach, the colour protocol is reverted back to
the original one. Unfortunately, the changes required in the Theme
engine will break the API.
For more details, please refer to the patch documentation at either
http://irssi-docs.wikispaces.com/Notes-256-Colour or
https://github.com/shabble/irssi-docs/wiki/Notes-256-Colour
Diffstat (limited to 'src/fe-text/term.h')
-rw-r--r-- | src/fe-text/term.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/fe-text/term.h b/src/fe-text/term.h index 5a40d4b2..e5f66644 100644 --- a/src/fe-text/term.h +++ b/src/fe-text/term.h @@ -3,30 +3,19 @@ typedef struct _TERM_WINDOW TERM_WINDOW; -/* text attributes */ - - #define FG_MASK ( 0x00ff ) #define BG_MASK ( 0xff00 ) +#define BG_SHIFT 8 +/* text attributes */ #define ATTR_RESETFG ( 0x010000 ) #define ATTR_RESETBG ( 0x020000 ) #define ATTR_BOLD ( 0x040000 ) -#define ATTR_BLINK ( 0x080000 ) +#define ATTR_BLINK ( 0x080000 ) #define ATTR_UNDERLINE ( 0x100000 ) #define ATTR_REVERSE ( 0x200000 ) - -/* can also mean default color, probably. */ -#define ATTR_COLOR_UNDEFINED ( -1 ) - -#define EXT_COLOR_BLACK ( 0 ) -#define EXT_COLOR_RED ( 1 ) -#define EXT_COLOR_GREEN ( 2 ) -#define EXT_COLOR_YELLOW ( 3 ) -#define EXT_COLOR_BLUE ( 4 ) -#define EXT_COLOR_MAGENTA ( 5 ) -#define EXT_COLOR_CYAN ( 6 ) -#define EXT_COLOR_WHITE ( 7 ) +#define ATTR_FGCOLOR24 ( 0x400000 ) +#define ATTR_BGCOLOR24 ( 0x800000 ) #define ATTR_RESET (ATTR_RESETFG|ATTR_RESETBG) @@ -42,6 +31,8 @@ typedef guint32 unichar; extern TERM_WINDOW *root_window; extern int term_width, term_height; extern int term_use_colors, term_type; +extern int term_use_colors24; +extern int term_color256map[]; /* Initialize / deinitialize terminal */ int term_init(void); @@ -80,10 +71,9 @@ void term_window_clear(TERM_WINDOW *window); /* Scroll window up/down */ void term_window_scroll(TERM_WINDOW *window, int count); +void term_set_color2(TERM_WINDOW *window, int col, unsigned int fgcol24, unsigned int bgcol24); void term_set_color(TERM_WINDOW *window, int col); -void term_set_extended_color(TERM_WINDOW *window, int fg, int bg); - void term_move(TERM_WINDOW *window, int x, int y); void term_addch(TERM_WINDOW *window, char chr); void term_add_unichar(TERM_WINDOW *window, unichar chr); |