diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2018-03-16 12:44:04 +0100 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2018-03-16 12:54:15 +0100 |
commit | 65a139aa9e8a7cb7a7a123ab57ee05836c9e89ea (patch) | |
tree | e8dee2a209619ba912df1558b9987021bf4e54ae /src | |
parent | 3f217ae14951afac8a98ec7bb1a497b3a1c0cf8b (diff) | |
download | irssi-65a139aa9e8a7cb7a7a123ab57ee05836c9e89ea.zip |
move no window printing code
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/gui-printtext.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index c52f9ced..13d8c233 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -249,9 +249,26 @@ static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line) textbuffer_view_insert_line(view, *line); } +static void print_text_no_window(int flags, int fg, int bg, int attr, const char *str) +{ + g_return_if_fail(next_xpos != -1); + + term_set_color2(root_window, attr, fg, bg); + + term_move(root_window, next_xpos, next_ypos); + if (flags & GUI_PRINT_FLAG_CLRTOEOL) { + if (clrtoeol_info->window != NULL) { + term_window_clrtoeol_abs(clrtoeol_info->window, next_ypos); + } else { + term_clrtoeol(root_window); + } + } + next_xpos += term_addstr(root_window, str); +} + static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor, void *bgcolor, void *pflags, - char *str, TEXT_DEST_REC *dest) + const char *str, TEXT_DEST_REC *dest) { GUI_WINDOW_REC *gui; TEXT_BUFFER_VIEW_REC *view; @@ -265,19 +282,7 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor, get_colors(flags, &fg, &bg, &attr); if (window == NULL) { - g_return_if_fail(next_xpos != -1); - - term_set_color2(root_window, attr, fg, bg); - - term_move(root_window, next_xpos, next_ypos); - if (flags & GUI_PRINT_FLAG_CLRTOEOL) { - if (clrtoeol_info->window != NULL) { - term_window_clrtoeol_abs(clrtoeol_info->window, next_ypos); - } else { - term_clrtoeol(root_window); - } - } - next_xpos += term_addstr(root_window, str); + print_text_no_window(flags, fg, bg, attr, str); return; } |