From 4dcbe05c0f67fe9e914ba323ce7e179885ebb1f7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 28 Oct 2000 20:14:19 +0000 Subject: Cleaned up printtext.c, split part of it to formats.c git-svn-id: http://svn.irssi.org/repos/irssi/trunk@796 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-textwidget.c | 14 +++++++++----- src/fe-text/mainwindows.c | 1 + src/fe-text/module-formats.c | 2 +- src/fe-text/module-formats.h | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src/fe-text') diff --git a/src/fe-text/gui-textwidget.c b/src/fe-text/gui-textwidget.c index 9b16e691..04055bb4 100644 --- a/src/fe-text/gui-textwidget.c +++ b/src/fe-text/gui-textwidget.c @@ -28,6 +28,7 @@ #include "irc-servers.h" #include "windows.h" +#include "printtext.h" #include "screen.h" #include "gui-windows.h" @@ -56,8 +57,8 @@ static gchar *gui_window_line2text(LINE_REC *line) { /* set color */ color = *ptr; - g_string_sprintfa(str, "\003%c%c", (color & 0x07)+1, ((color & 0xf0) >> 4)+1); - if (color & 0x08) g_string_sprintfa(str, "\002"); + g_string_sprintfa(str, "\004%c%c", (color & 0x0f)+'0', + ((color & 0xf0) >> 4)+'0'); } else switch ((guchar) *ptr) { @@ -73,16 +74,19 @@ static gchar *gui_window_line2text(LINE_REC *line) g_string_append_c(str, 31); break; case LINE_CMD_COLOR0: - g_string_sprintfa(str, "\003%c%c", 1, ((color & 0xf0) >> 4)+1); + g_string_sprintfa(str, "\004%c%c", + '0', ((color & 0xf0) >> 4)+'0'); break; case LINE_CMD_COLOR8: - g_string_sprintfa(str, "\003%c%c", 9, ((color & 0xf0) >> 4)+1); + g_string_sprintfa(str, "\004%c%c", + '8', ((color & 0xf0) >> 4)+'0'); 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); + g_string_sprintfa(str, "\004%c%c", (color & 0x0f)+'0', + ((color & 0xf0) >> 4)+'0'); break; case LINE_CMD_INDENT: break; diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 2ba547dc..48bbf0b9 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -24,6 +24,7 @@ #include "commands.h" #include "levels.h" #include "misc.h" +#include "printtext.h" #include "screen.h" #include "statusbar.h" diff --git a/src/fe-text/module-formats.c b/src/fe-text/module-formats.c index 4114ca50..935e6eee 100644 --- a/src/fe-text/module-formats.c +++ b/src/fe-text/module-formats.c @@ -19,7 +19,7 @@ */ #include "module.h" -#include "printtext.h" +#include "formats.h" FORMAT_REC gui_text_formats[] = { diff --git a/src/fe-text/module-formats.h b/src/fe-text/module-formats.h index 2af040eb..06d02727 100644 --- a/src/fe-text/module-formats.h +++ b/src/fe-text/module-formats.h @@ -1,4 +1,4 @@ -#include "printtext.h" +#include "formats.h" enum { IRCTXT_MODULE_NAME, -- cgit v1.2.3