diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-22 21:39:18 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-22 21:39:18 +0000 |
commit | 08c6484b6bd0f8f70dac672862b10ffe7817ba9e (patch) | |
tree | 277919f31398e02d485d3e8ec8a3a4cc0ed4f593 | |
parent | 2e64899f18f21bbcecaa489eb3535203a0666d09 (diff) | |
download | irssi-08c6484b6bd0f8f70dac672862b10ffe7817ba9e.zip |
Using blinking/bright background colors would crash irssi..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@619 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-text/gui-printtext.c | 6 | ||||
-rw-r--r-- | src/fe-text/gui-textwidget.c | 4 | ||||
-rw-r--r-- | src/fe-text/gui-windows.c | 6 | ||||
-rw-r--r-- | src/fe-text/gui-windows.h | 3 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index d0763115..9558f7bf 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -222,7 +222,7 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags) /* color should never have last bit on or it would be treated as a command! */ - color = (fg & 0x0f) | ((bg & 0x0f) << 4); + color = (fg & 0x0f) | ((bg & 0x07) << 4); pos = 0; if (((fg & ATTR_COLOR8) == 0 && (fg|(bg << 4)) != gui->last_color) || @@ -239,6 +239,10 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags) buffer[pos++] = 0; buffer[pos++] = LINE_CMD_COLOR8; } + if (bg & 0x08) { + buffer[pos++] = 0; + buffer[pos++] = LINE_CMD_BLINK; + } if (flags & PRINTFLAG_INDENT) { buffer[pos++] = 0; buffer[pos++] = LINE_CMD_INDENT; diff --git a/src/fe-text/gui-textwidget.c b/src/fe-text/gui-textwidget.c index ce2b58a5..f3604260 100644 --- a/src/fe-text/gui-textwidget.c +++ b/src/fe-text/gui-textwidget.c @@ -80,6 +80,10 @@ static gchar *gui_window_line2text(LINE_REC *line) color &= 0xfff0; color |= 8|ATTR_COLOR8; break; + case LINE_CMD_BLINK: + color |= 0x80; + g_string_sprintfa(str, "\003%c%c", (color & 0x0f)+1, ((color & 0xf0) >> 4)+1); + break; case LINE_CMD_INDENT: break; } diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c index fdec6438..b905684c 100644 --- a/src/fe-text/gui-windows.c +++ b/src/fe-text/gui-windows.c @@ -298,6 +298,9 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui, LINE_REC *line color &= 0xfff0; color |= 8|ATTR_COLOR8; break; + case LINE_CMD_BLINK: + color |= 0x80; + break; case LINE_CMD_INDENT: /* set indentation position here - don't do it if we're too close to right border */ @@ -429,6 +432,9 @@ static void single_line_draw(GUI_WINDOW_REC *gui, int ypos, LINE_CACHE_SUB_REC * color &= 0xfff0; color |= 8|ATTR_COLOR8; break; + case LINE_CMD_BLINK: + color |= 0x80; + break; } set_color(cwin, color); text++; diff --git a/src/fe-text/gui-windows.h b/src/fe-text/gui-windows.h index bcde75c5..ecadd775 100644 --- a/src/fe-text/gui-windows.h +++ b/src/fe-text/gui-windows.h @@ -19,7 +19,8 @@ enum { LINE_CMD_COLOR0, /* change to black, would be same as \0\0 but it breaks things.. */ LINE_CMD_COLOR8, /* change to dark grey, normally 8 = bold black */ LINE_CMD_UNDERLINE, /* enable/disable underlining */ - LINE_CMD_INDENT /* if line is split, indent it at this position */ + LINE_CMD_INDENT, /* if line is split, indent it at this position */ + LINE_CMD_BLINK /* blinking background */ }; typedef struct { |