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
This commit is contained in:
Timo Sirainen 2000-10-28 20:14:19 +00:00 committed by cras
commit 4dcbe05c0f
46 changed files with 733 additions and 632 deletions

View file

@ -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;

View file

@ -24,6 +24,7 @@
#include "commands.h"
#include "levels.h"
#include "misc.h"
#include "printtext.h"
#include "screen.h"
#include "statusbar.h"

View file

@ -19,7 +19,7 @@
*/
#include "module.h"
#include "printtext.h"
#include "formats.h"
FORMAT_REC gui_text_formats[] =
{

View file

@ -1,4 +1,4 @@
#include "printtext.h"
#include "formats.h"
enum {
IRCTXT_MODULE_NAME,