"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/fe-text/gui-printtext.c" between
irssi-1.2.2.tar.gz and irssi-1.2.3.tar.gz

About: irssi is a terminal based IRC client that also supports SILC and ICB protocols via plugins.

gui-printtext.c  (irssi-1.2.2):gui-printtext.c  (irssi-1.2.3)
skipping to change at line 33 skipping to change at line 33
#include "settings.h" #include "settings.h"
#include "formats.h" #include "formats.h"
#include "printtext.h" #include "printtext.h"
#include "themes.h" #include "themes.h"
#include "term.h" #include "term.h"
#include "gui-printtext.h" #include "gui-printtext.h"
#include "gui-windows.h" #include "gui-windows.h"
/* Terminal indexed colour map */
int mirc_colors[] = { 15, 0, 1, 2, 12, 4, 5, 6, 14, 10, 3, 11, 9, 13, 8, 7, int mirc_colors[] = { 15, 0, 1, 2, 12, 4, 5, 6, 14, 10, 3, 11, 9, 13, 8, 7,
/* 16-27 */ 52, 94, 100, 58, 22, 29, 23, 24, 17, 54, 53, 89, /* 16-27 */ 52, 94, 100, 58, 22, 29, 23, 24, 17, 54, 53, 89,
/* 28-39 */ 88, 130, 142, 64, 28, 35, 30, 25, 18, 91, 90, 125, /* 28-39 */ 88, 130, 142, 64, 28, 35, 30, 25, 18, 91, 90, 125,
/* 40-51 */ 124, 166, 184, 106, 34, 49, 37, 33, 19, 129, 127, 161, /* 40-51 */ 124, 166, 184, 106, 34, 49, 37, 33, 19, 129, 127, 161,
/* 52-63 */ 196, 208, 226, 154, 46, 86, 51, 75, 21, 171, 201, 198, /* 52-63 */ 196, 208, 226, 154, 46, 86, 51, 75, 21, 171, 201, 198,
/* 64-75 */ 203, 215, 227, 191, 83, 122, 87, 111, 63, 177, 207, 205, /* 64-75 */ 203, 215, 227, 191, 83, 122, 87, 111, 63, 177, 207, 205,
/* 76-87 */ 217, 223, 229, 193, 157, 158, 159, 153, 147, 183, 219, 212, /* 76-87 */ 217, 223, 229, 193, 157, 158, 159, 153, 147, 183, 219, 212,
/* 88-98 */ 16, 233, 235, 237, 239, 241, 244, 247, 250, 254, 231, -1 }; /* 88-98 */ 16, 233, 235, 237, 239, 241, 244, 247, 250, 254, 231, -1 };
/* RGB colour map */
int mirc_colors24[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
/* 16-27 */ 0x470000, 0x472100, 0x474700, 0x324700, 0x004700, 0x00472c,
0x004747, 0x002747, 0x000047, 0x2e0047, 0x470047, 0x47002a,
/* 28-39 */ 0x740000, 0x743a00, 0x747400, 0x517400, 0x007400, 0x007449,
0x007474, 0x004074, 0x000074, 0x4b0074, 0x740074, 0x740045,
/* 40-51 */ 0xb50000, 0xb56300, 0xb5b500, 0x7db500, 0x00b500, 0x00b571,
0x00b5b5, 0x0063b5, 0x0000b5, 0x7500b5, 0xb500b5, 0xb5006b,
/* 52-63 */ 0xff0000, 0xff8c00, 0xffff00, 0xb2ff00, 0x00ff00, 0x00ffa0,
0x00ffff, 0x008cff, 0x0000ff, 0xa500ff, 0xff00ff, 0xff0098,
/* 64-75 */ 0xff5959, 0xffb459, 0xffff71, 0xcfff60, 0x6fff6f, 0x65ffc9,
0x6dffff, 0x59b4ff, 0x5959ff, 0xc459ff, 0xff66ff, 0xff59bc,
/* 76-87 */ 0xff9c9c, 0xffd39c, 0xffff9c, 0xe2ff9c, 0x9cff9c, 0x9cffdb,
0x9cffff, 0x9cd3ff, 0x9c9cff, 0xdc9cff, 0xff9cff, 0xff94d3,
/* 88-98 */ 0x000000, 0x131313, 0x282828, 0x363636, 0x4d4d4d, 0x656565,
0x818181, 0x9f9f9f, 0xbcbcbc, 0xe2e2e2, 0xffffff, -1 };
static int scrollback_lines, scrollback_time, scrollback_burst_remove; static int scrollback_lines, scrollback_time, scrollback_burst_remove;
static int next_xpos, next_ypos; static int next_xpos, next_ypos;
static GHashTable *indent_functions; static GHashTable *indent_functions;
static INDENT_FUNC default_indent_func; static INDENT_FUNC default_indent_func;
void gui_register_indent_func(const char *name, INDENT_FUNC func) void gui_register_indent_func(const char *name, INDENT_FUNC func)
{ {
gpointer key, value; gpointer key, value;
skipping to change at line 205 skipping to change at line 217
/* too new line, don't remove yet - also /* too new line, don't remove yet - also
if scrollback_lines is 0, we want to check if scrollback_lines is 0, we want to check
only scrollback_time setting. */ only scrollback_time setting. */
break; break;
} }
textbuffer_view_remove_line(view, line); textbuffer_view_remove_line(view, line);
} }
} }
} }
static void get_colors(int flags, int *fg, int *bg, int *attr) static void get_colors(int *flags, int *fg, int *bg, int *attr)
{ {
*attr = 0; *attr = 0;
if (flags & GUI_PRINT_FLAG_MIRC_COLOR) { if (*flags & GUI_PRINT_FLAG_MIRC_COLOR) {
/* mirc colors - extended colours proposal */ /* mirc colors - extended colours proposal */
if (*bg >= 0) { gboolean use_24_map = FALSE;
*bg = mirc_colors[*bg % 100]; #ifdef TERM_TRUECOLOR
flags &= ~GUI_PRINT_FLAG_COLOR_24_BG; use_24_map = settings_get_bool("colors_ansi_24bit");
/* ignore mirc color 99 = -1 (reset) */ #endif
if (*bg != -1 && settings_get_bool("mirc_blink_fix")) { if (*bg >= 0) {
if (*bg < 16) /* ansi bit flip :-( */ if (use_24_map && mirc_colors24[*bg % 100] != -1) {
*bg = (*bg&8) | (*bg&4)>>2 | (*bg&2) | (* *bg = mirc_colors24[*bg % 100];
bg&1)<<2; *flags |= GUI_PRINT_FLAG_COLOR_24_BG;
*bg = term_color256map[*bg&0xff] & 7; } else {
*bg = mirc_colors[*bg % 100];
*flags &= ~GUI_PRINT_FLAG_COLOR_24_BG;
/* ignore mirc color 99 = -1 (reset) */
if (*bg != -1 && settings_get_bool("mirc_blink_fi
x")) {
if (*bg < 16) /* ansi bit flip :-( */
*bg = (*bg&8) | (*bg&4)>>2 | (*bg
&2) | (*bg&1)<<2;
*bg = term_color256map[*bg&0xff] & 7;
}
} }
} }
if (*fg >= 0) { if (*fg >= 0) {
*fg = mirc_colors[*fg % 100]; if (use_24_map && mirc_colors24[*fg % 100] != -1) {
flags &= ~GUI_PRINT_FLAG_COLOR_24_FG; *fg = mirc_colors24[*fg % 100];
*flags |= GUI_PRINT_FLAG_COLOR_24_FG;
} else {
*fg = mirc_colors[*fg % 100];
*flags &= ~GUI_PRINT_FLAG_COLOR_24_FG;
}
} }
} }
if (flags & GUI_PRINT_FLAG_COLOR_24_FG) if (*flags & GUI_PRINT_FLAG_COLOR_24_FG)
*attr |= ATTR_FGCOLOR24; *attr |= ATTR_FGCOLOR24;
else if (*fg < 0 || *fg > 255) { else if (*fg < 0 || *fg > 255) {
*fg = -1; *fg = -1;
*attr |= ATTR_RESETFG; *attr |= ATTR_RESETFG;
} }
else else
*attr |= *fg; *attr |= *fg;
if (flags & GUI_PRINT_FLAG_COLOR_24_BG) if (*flags & GUI_PRINT_FLAG_COLOR_24_BG)
*attr |= ATTR_BGCOLOR24; *attr |= ATTR_BGCOLOR24;
else if (*bg < 0 || *bg > 255) { else if (*bg < 0 || *bg > 255) {
*bg = -1; *bg = -1;
*attr |= ATTR_RESETBG; *attr |= ATTR_RESETBG;
} }
else else
*attr |= (*bg << BG_SHIFT); *attr |= (*bg << BG_SHIFT);
if (flags & GUI_PRINT_FLAG_REVERSE) *attr |= ATTR_REVERSE; if (*flags & GUI_PRINT_FLAG_REVERSE) *attr |= ATTR_REVERSE;
if (flags & GUI_PRINT_FLAG_ITALIC) *attr |= ATTR_ITALIC; if (*flags & GUI_PRINT_FLAG_ITALIC) *attr |= ATTR_ITALIC;
if (flags & GUI_PRINT_FLAG_BOLD) *attr |= ATTR_BOLD; if (*flags & GUI_PRINT_FLAG_BOLD) *attr |= ATTR_BOLD;
if (flags & GUI_PRINT_FLAG_UNDERLINE) *attr |= ATTR_UNDERLINE; if (*flags & GUI_PRINT_FLAG_UNDERLINE) *attr |= ATTR_UNDERLINE;
if (flags & GUI_PRINT_FLAG_BLINK) *attr |= ATTR_BLINK; if (*flags & GUI_PRINT_FLAG_BLINK) *attr |= ATTR_BLINK;
} }
static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line) static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line)
{ {
static const unsigned char eol[] = { 0, LINE_CMD_EOL }; static const unsigned char eol[] = { 0, LINE_CMD_EOL };
*line = textbuffer_insert(view->buffer, *line, eol, 2, NULL); *line = textbuffer_insert(view->buffer, *line, eol, 2, NULL);
textbuffer_view_insert_line(view, *line); textbuffer_view_insert_line(view, *line);
} }
skipping to change at line 289 skipping to change at line 315
{ {
GUI_WINDOW_REC *gui; GUI_WINDOW_REC *gui;
TEXT_BUFFER_VIEW_REC *view; TEXT_BUFFER_VIEW_REC *view;
LINE_REC *insert_after; LINE_REC *insert_after;
LINE_INFO_REC lineinfo; LINE_INFO_REC lineinfo;
int fg, bg, flags, attr; int fg, bg, flags, attr;
flags = GPOINTER_TO_INT(pflags); flags = GPOINTER_TO_INT(pflags);
fg = GPOINTER_TO_INT(fgcolor); fg = GPOINTER_TO_INT(fgcolor);
bg = GPOINTER_TO_INT(bgcolor); bg = GPOINTER_TO_INT(bgcolor);
get_colors(flags, &fg, &bg, &attr); get_colors(&flags, &fg, &bg, &attr);
if (window == NULL) { if (window == NULL) {
print_text_no_window(flags, fg, bg, attr, str); print_text_no_window(flags, fg, bg, attr, str);
return; return;
} }
lineinfo.level = dest == NULL ? 0 : dest->level; lineinfo.level = dest == NULL ? 0 : dest->level;
gui = WINDOW_GUI(window); gui = WINDOW_GUI(window);
lineinfo.time = (gui->use_insert_after && gui->insert_after_time) ? lineinfo.time = (gui->use_insert_after && gui->insert_after_time) ?
gui->insert_after_time : time(NULL); gui->insert_after_time : time(NULL);
 End of changes. 10 change blocks. 
21 lines changed or deleted 56 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)