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 */
|
/* reset colors back to default */
|
||||||
fg = current_theme->default_color;
|
fg = current_theme->default_color;
|
||||||
bg = -1;
|
bg = -1;
|
||||||
|
fl &= ~(PRINTFLAG_BEEP|PRINTFLAG_INDENT);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* hilight */
|
/* hilight */
|
||||||
fg |= 8;
|
fl |= PRINTFLAG_BOLD;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
/* blink */
|
/* blink */
|
||||||
bg = bg == -1 ? 8 : bg | 8;
|
fl |= PRINTFLAG_BLINK;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
/* reverse */
|
/* reverse */
|
||||||
@ -171,7 +172,7 @@ static char *convert_ansi(char *str, int *fgcolor, int *bgcolor, int *flags)
|
|||||||
if (*str == 'm') {
|
if (*str == 'm') {
|
||||||
if (!hide_text_style) {
|
if (!hide_text_style) {
|
||||||
*fgcolor = fg;
|
*fgcolor = fg;
|
||||||
*bgcolor = bg == -1 ? -1 : bg;
|
*bgcolor = bg;
|
||||||
*flags = fl;
|
*flags = fl;
|
||||||
}
|
}
|
||||||
str++;
|
str++;
|
||||||
|
@ -210,7 +210,9 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
|
|||||||
unsigned char buffer[12];
|
unsigned char buffer[12];
|
||||||
int color, pos;
|
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;
|
pos = 0;
|
||||||
|
|
||||||
if (((fg & ATTR_COLOR8) == 0 && (fg|(bg << 4)) != gui->last_color) ||
|
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++] = 0;
|
||||||
buffer[pos++] = LINE_CMD_COLOR8;
|
buffer[pos++] = LINE_CMD_COLOR8;
|
||||||
}
|
}
|
||||||
if (flags & PRINTFLAG_BEEP) {
|
|
||||||
buffer[pos++] = 0;
|
|
||||||
buffer[pos++] = LINE_CMD_BEEP;
|
|
||||||
}
|
|
||||||
if (flags & PRINTFLAG_INDENT) {
|
if (flags & PRINTFLAG_INDENT) {
|
||||||
buffer[pos++] = 0;
|
buffer[pos++] = 0;
|
||||||
buffer[pos++] = LINE_CMD_INDENT;
|
buffer[pos++] = LINE_CMD_INDENT;
|
||||||
}
|
}
|
||||||
|
if (flags & PRINTFLAG_BEEP)
|
||||||
|
beep();
|
||||||
|
|
||||||
linebuf_add(gui, (char *) buffer, pos);
|
linebuf_add(gui, (char *) buffer, pos);
|
||||||
|
|
||||||
|
@ -76,8 +76,6 @@ static gchar *gui_window_line2text(LINE_REC *line)
|
|||||||
color &= 0xfff0;
|
color &= 0xfff0;
|
||||||
color |= 8|ATTR_COLOR8;
|
color |= 8|ATTR_COLOR8;
|
||||||
break;
|
break;
|
||||||
case LINE_CMD_BEEP:
|
|
||||||
break;
|
|
||||||
case LINE_CMD_INDENT:
|
case LINE_CMD_INDENT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ enum {
|
|||||||
LINE_CMD_OVERFLOW, /* buffer overflow! */
|
LINE_CMD_OVERFLOW, /* buffer overflow! */
|
||||||
LINE_CMD_COLOR8, /* change to dark grey, normally 8 = bold black */
|
LINE_CMD_COLOR8, /* change to dark grey, normally 8 = bold black */
|
||||||
LINE_CMD_UNDERLINE, /* enable/disable underlining */
|
LINE_CMD_UNDERLINE, /* enable/disable underlining */
|
||||||
LINE_CMD_BEEP, /* beep */
|
|
||||||
LINE_CMD_INDENT /* if line is split, indent it at this position */
|
LINE_CMD_INDENT /* if line is split, indent it at this position */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user