mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Beeps should work(?). ANSI colors had some bugs, bolds weren't working and
blinking crashed irssi. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@305 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
6ee0a40abb
commit
3fd3a03402
@ -144,14 +144,15 @@ static char *convert_ansi(char *str, int *fgcolor, int *bgcolor, int *flags)
|
||||
/* reset colors back to default */
|
||||
fg = current_theme->default_color;
|
||||
bg = -1;
|
||||
fl &= ~(PRINTFLAG_BEEP|PRINTFLAG_INDENT);
|
||||
break;
|
||||
case 1:
|
||||
/* hilight */
|
||||
fg |= 8;
|
||||
fl |= PRINTFLAG_BOLD;
|
||||
break;
|
||||
case 5:
|
||||
/* blink */
|
||||
bg = bg == -1 ? 8 : bg | 8;
|
||||
fl |= PRINTFLAG_BLINK;
|
||||
break;
|
||||
case 7:
|
||||
/* reverse */
|
||||
@ -171,7 +172,7 @@ static char *convert_ansi(char *str, int *fgcolor, int *bgcolor, int *flags)
|
||||
if (*str == 'm') {
|
||||
if (!hide_text_style) {
|
||||
*fgcolor = fg;
|
||||
*bgcolor = bg == -1 ? -1 : bg;
|
||||
*bgcolor = bg;
|
||||
*flags = fl;
|
||||
}
|
||||
str++;
|
||||
|
@ -210,7 +210,9 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
|
||||
unsigned char buffer[12];
|
||||
int color, pos;
|
||||
|
||||
color = (fg & 0x0f) | (bg << 4);
|
||||
/* color should never have last bit on or it would be treated as a
|
||||
command! */
|
||||
color = (fg & 0x0f) | ((bg & 0x0f) << 4);
|
||||
pos = 0;
|
||||
|
||||
if (((fg & ATTR_COLOR8) == 0 && (fg|(bg << 4)) != gui->last_color) ||
|
||||
@ -227,14 +229,12 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_COLOR8;
|
||||
}
|
||||
if (flags & PRINTFLAG_BEEP) {
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_BEEP;
|
||||
}
|
||||
if (flags & PRINTFLAG_INDENT) {
|
||||
buffer[pos++] = 0;
|
||||
buffer[pos++] = LINE_CMD_INDENT;
|
||||
}
|
||||
if (flags & PRINTFLAG_BEEP)
|
||||
beep();
|
||||
|
||||
linebuf_add(gui, (char *) buffer, pos);
|
||||
|
||||
|
@ -76,8 +76,6 @@ static gchar *gui_window_line2text(LINE_REC *line)
|
||||
color &= 0xfff0;
|
||||
color |= 8|ATTR_COLOR8;
|
||||
break;
|
||||
case LINE_CMD_BEEP:
|
||||
break;
|
||||
case LINE_CMD_INDENT:
|
||||
break;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ enum {
|
||||
LINE_CMD_OVERFLOW, /* buffer overflow! */
|
||||
LINE_CMD_COLOR8, /* change to dark grey, normally 8 = bold black */
|
||||
LINE_CMD_UNDERLINE, /* enable/disable underlining */
|
||||
LINE_CMD_BEEP, /* beep */
|
||||
LINE_CMD_INDENT /* if line is split, indent it at this position */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user