summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2011-11-06 20:40:25 +0100
committerAilin Nemui <ailin@esf51.localdomain>2014-07-07 00:32:07 +0200
commit0e294d5c2e4d4dd686378f2050abc9a9f2fae199 (patch)
tree5c39edb7d60860ec430953553c277da83d666373 /src/fe-common/core
parentfc00b9e6f07379f09ea13fa42d9feed377d2d762 (diff)
downloadirssi-0e294d5c2e4d4dd686378f2050abc9a9f2fae199.zip
add italics support; don't use standout for reverse
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/formats.c23
-rw-r--r--src/fe-common/core/formats.h2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c
index 770caaa1..375b00eb 100644
--- a/src/fe-common/core/formats.c
+++ b/src/fe-common/core/formats.c
@@ -207,6 +207,11 @@ int format_expand_styles(GString *out, const char **format, int *flags)
g_string_append_c(out, 4);
g_string_append_c(out, FORMAT_STYLE_REVERSE);
break;
+ case 'I':
+ /* italic */
+ g_string_append_c(out, 4);
+ g_string_append_c(out, FORMAT_STYLE_ITALIC);
+ break;
case ':':
/* Newline */
g_string_append_c(out, '\n');
@@ -913,6 +918,14 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str,
/* normal */
flags &= ~GUI_PRINT_FLAG_BOLD;
break;
+ case 3:
+ /* italic */
+ flags |= GUI_PRINT_FLAG_ITALIC;
+ break;
+ case 23:
+ /* not italic */
+ flags &= ~GUI_PRINT_FLAG_ITALIC;
+ break;
case 4:
/* underline */
flags |= GUI_PRINT_FLAG_UNDERLINE;
@@ -1085,7 +1098,7 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
#define IS_COLOR_CODE(c) \
((c) == 2 || (c) == 3 || (c) == 4 || (c) == 6 || (c) == 7 || \
- (c) == 15 || (c) == 22 || (c) == 27 || (c) == 31)
+ (c) == 15 || (c) == 22 || (c) == 27 || (c) == 29 || (c) == 31)
/* Return how many characters in `str' must be skipped before `len'
characters of text is skipped. */
@@ -1282,6 +1295,9 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
case FORMAT_STYLE_REVERSE:
flags ^= GUI_PRINT_FLAG_REVERSE;
break;
+ case FORMAT_STYLE_ITALIC:
+ flags ^= GUI_PRINT_FLAG_ITALIC;
+ break;
case FORMAT_STYLE_MONOSPACE:
flags ^= GUI_PRINT_FLAG_MONOSPACE;
break;
@@ -1356,6 +1372,11 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
if (!hide_text_style)
flags ^= GUI_PRINT_FLAG_REVERSE;
break;
+ case 29:
+ /* italic */
+ if (!hide_text_style)
+ flags ^= GUI_PRINT_FLAG_ITALIC;
+ break;
case 31:
/* underline */
if (!hide_text_style)
diff --git a/src/fe-common/core/formats.h b/src/fe-common/core/formats.h
index 037aa424..07e1832c 100644
--- a/src/fe-common/core/formats.h
+++ b/src/fe-common/core/formats.h
@@ -10,6 +10,7 @@
#define GUI_PRINT_FLAG_BLINK 0x0008
#define GUI_PRINT_FLAG_MIRC_COLOR 0x0010
#define GUI_PRINT_FLAG_INDENT 0x0020
+#define GUI_PRINT_FLAG_ITALIC 0x0040
#define GUI_PRINT_FLAG_NEWLINE 0x0080
#define GUI_PRINT_FLAG_CLRTOEOL 0x0100
#define GUI_PRINT_FLAG_MONOSPACE 0x0200
@@ -139,6 +140,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
#define FORMAT_STYLE_BOLD (0x03 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_REVERSE (0x04 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_INDENT (0x05 + FORMAT_STYLE_SPECIAL)
+#define FORMAT_STYLE_ITALIC (0x06 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_DEFAULTS (0x07 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_CLRTOEOL (0x08 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_MONOSPACE (0x09 + FORMAT_STYLE_SPECIAL)