1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: replace some calls to ncurses *printw functions by *addstr

This commit is contained in:
Sebastien Helleu
2013-09-23 13:07:45 +02:00
parent 81a229f77f
commit 92019c300c
3 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -361,7 +361,7 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
output = string_iconv_from_internal (NULL, utf_char);
if (low_char)
wattron (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, A_REVERSE);
wprintw (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, "%s",
waddstr (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
(output) ? output : utf_char);
if (low_char)
wattroff (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar, A_REVERSE);
@@ -683,7 +683,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(config_color_bar_more),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
mvwprintw (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
mvwaddstr (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
y, x, ptr_string);
}
}
@@ -702,7 +702,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
CONFIG_COLOR(config_color_bar_more),
CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
mvwprintw (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
mvwaddstr (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
y, x, ptr_string);
}
}
+7 -7
View File
@@ -198,9 +198,9 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate)
x = 0;
while (x < gui_chat_get_real_width (window))
{
mvwprintw (GUI_WINDOW_OBJECTS(window)->win_chat,
mvwaddstr (GUI_WINDOW_OBJECTS(window)->win_chat,
window->win_chat_cursor_y, x,
"%s", read_marker_string);
read_marker_string);
x += size_on_screen;
}
}
@@ -405,8 +405,8 @@ gui_chat_display_word_raw (struct t_gui_window *window, struct t_gui_line *line,
if (!simulate)
{
output = string_iconv_from_internal (NULL, utf_char);
wprintw (GUI_WINDOW_OBJECTS(window)->win_chat,
"%s", (output) ? output : utf_char);
waddstr (GUI_WINDOW_OBJECTS(window)->win_chat,
(output) ? output : utf_char);
if (output)
free (output);
@@ -1477,7 +1477,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
{
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_TEXT_FOUND);
mvwprintw (GUI_WINDOW_OBJECTS(window)->win_chat,
mvwaddstr (GUI_WINDOW_OBJECTS(window)->win_chat,
read_marker_y, read_marker_x,
"*");
}
@@ -1491,7 +1491,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
{
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_READ_MARKER);
mvwprintw (GUI_WINDOW_OBJECTS(window)->win_chat,
mvwaddstr (GUI_WINDOW_OBJECTS(window)->win_chat,
read_marker_y, read_marker_x,
"*");
}
@@ -1852,7 +1852,7 @@ gui_chat_draw (struct t_gui_buffer *buffer, int clear_chat)
case GUI_BUFFER_TYPE_FORMATTED:
/* min 2 lines for chat area */
if (ptr_win->win_chat_height < 2)
mvwprintw (GUI_WINDOW_OBJECTS(ptr_win)->win_chat, 0, 0, "...");
mvwaddstr (GUI_WINDOW_OBJECTS(ptr_win)->win_chat, 0, 0, "...");
else
gui_chat_draw_formatted_buffer (ptr_win);
break;
+6 -6
View File
@@ -84,10 +84,10 @@ gui_main_get_password (const char *prompt1, const char *prompt2,
clear();
mvprintw (0, 0, "%s", prompt1);
mvprintw (1, 0, "%s", prompt2);
mvprintw (2, 0, "%s", prompt3);
mvprintw (3, 0, "=> ");
mvaddstr (0, 0, prompt1);
mvaddstr (1, 0, prompt2);
mvaddstr (2, 0, prompt3);
mvaddstr (3, 0, "=> ");
refresh ();
memset (password, '\0', size);
@@ -103,14 +103,14 @@ gui_main_get_password (const char *prompt1, const char *prompt2,
{
i--;
password[i] = '\0';
mvprintw (3, 3 + i, " ");
mvaddstr (3, 3 + i, " ");
move (3, 3 + i);
}
}
else
{
password[i] = ch;
mvprintw (3, 3 + i, "*");
mvaddstr (3, 3 + i, "*");
i++;
}
refresh ();