Merges from Irssi CVS.
[crypto.git] / apps / irssi / src / fe-text / gui-printtext.c
index 3bd1de3696557b17dd0f6d0784a767a0edbab2bb..2d8a8cde009125e00615d83e77389b1b467f22e1 100644 (file)
@@ -83,7 +83,8 @@ void gui_set_default_indent(const char *name)
 
        list = name == NULL ? NULL :
                g_hash_table_lookup(indent_functions, name);
-       default_indent_func = list == NULL ? NULL : list->data;
+       default_indent_func = list == NULL ? NULL :
+               (INDENT_FUNC) list->data;
         gui_windows_reset_settings();
 }
 
@@ -144,10 +145,12 @@ static void get_colors(int flags, int *fg, int *bg, int *attr)
                   colors wrap to 0, 1, ... */
                 if (*bg >= 0) *bg = mirc_colors[*bg % 16];
                if (*fg >= 0) *fg = mirc_colors[*fg % 16];
+               if (settings_get_bool("mirc_blink_fix"))
+                       *bg &= ~0x08;
        }
 
        if (*fg < 0 || *fg > 15)
-               *fg = current_theme->default_color;
+               *fg = -1;
        if (*bg < 0 || *bg > 15)
                 *bg = -1;
 
@@ -228,7 +231,7 @@ static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line)
 
 static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
                               void *bgcolor, void *pflags,
-                              char *str, void *level)
+                              char *str, TEXT_DEST_REC *dest)
 {
         GUI_WINDOW_REC *gui;
         TEXT_BUFFER_VIEW_REC *view;
@@ -244,8 +247,8 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
        if (window == NULL) {
                 g_return_if_fail(next_xpos != -1);
 
-               attr |= fg > 0 ? fg : ATTR_RESETFG;
-               attr |= bg > 0 ? (bg << 4) : ATTR_RESETBG;
+               attr |= fg >= 0 ? fg : ATTR_RESETFG;
+               attr |= bg >= 0 ? (bg << 4) : ATTR_RESETBG;
                term_set_color(root_window, attr);
 
                term_move(root_window, next_xpos, next_ypos);
@@ -256,7 +259,7 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
                 return;
        }
 
-       lineinfo.level = GPOINTER_TO_INT(level);
+       lineinfo.level = dest == NULL ? 0 : dest->level;
         lineinfo.time = time(NULL);
 
         gui = WINDOW_GUI(window);