1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

move no window printing code

This commit is contained in:
ailin-nemui 2018-03-16 12:44:04 +01:00
parent 3f217ae149
commit 65a139aa9e

View File

@ -249,22 +249,8 @@ static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line)
textbuffer_view_insert_line(view, *line); textbuffer_view_insert_line(view, *line);
} }
static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor, static void print_text_no_window(int flags, int fg, int bg, int attr, const char *str)
void *bgcolor, void *pflags,
char *str, TEXT_DEST_REC *dest)
{ {
GUI_WINDOW_REC *gui;
TEXT_BUFFER_VIEW_REC *view;
LINE_REC *insert_after;
LINE_INFO_REC lineinfo;
int fg, bg, flags, attr;
flags = GPOINTER_TO_INT(pflags);
fg = GPOINTER_TO_INT(fgcolor);
bg = GPOINTER_TO_INT(bgcolor);
get_colors(flags, &fg, &bg, &attr);
if (window == NULL) {
g_return_if_fail(next_xpos != -1); g_return_if_fail(next_xpos != -1);
term_set_color2(root_window, attr, fg, bg); term_set_color2(root_window, attr, fg, bg);
@ -278,6 +264,25 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
} }
} }
next_xpos += term_addstr(root_window, str); next_xpos += term_addstr(root_window, str);
}
static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
void *bgcolor, void *pflags,
const char *str, TEXT_DEST_REC *dest)
{
GUI_WINDOW_REC *gui;
TEXT_BUFFER_VIEW_REC *view;
LINE_REC *insert_after;
LINE_INFO_REC lineinfo;
int fg, bg, flags, attr;
flags = GPOINTER_TO_INT(pflags);
fg = GPOINTER_TO_INT(fgcolor);
bg = GPOINTER_TO_INT(bgcolor);
get_colors(flags, &fg, &bg, &attr);
if (window == NULL) {
print_text_no_window(flags, fg, bg, attr, str);
return; return;
} }