mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Renamed refresh functions to update_virtual
This commit is contained in:
parent
e8e5ab597a
commit
404dde2810
@ -2644,7 +2644,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
||||
} else if (strcmp(args[0], "warn") == 0) {
|
||||
gboolean result = _cmd_set_boolean_preference(args[1], help,
|
||||
"OTR warning message", PREF_OTR_WARN);
|
||||
ui_current_refresh();
|
||||
ui_current_update_virtual();
|
||||
return result;
|
||||
} else if (strcmp(args[0], "libver") == 0) {
|
||||
char *version = otr_libotr_version();
|
||||
|
@ -234,7 +234,7 @@ _otr_keygen(ProfAccount *account)
|
||||
cons_show("Generating private key, this may take some time.");
|
||||
cons_show("Moving the mouse randomly around the screen may speed up the process!");
|
||||
ui_current_page_off();
|
||||
ui_refresh();
|
||||
ui_update_screen();
|
||||
err = otrl_privkey_generate(user_state, keysfilename->str, account->jid, "xmpp");
|
||||
if (!err == GPG_ERR_NO_ERROR) {
|
||||
g_string_free(basedir, TRUE);
|
||||
|
@ -70,7 +70,7 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
|
||||
char inp[INP_WIN_MAX];
|
||||
int size = 0;
|
||||
|
||||
ui_refresh();
|
||||
ui_update_screen();
|
||||
|
||||
if (account_name != NULL) {
|
||||
char *cmd = "/connect";
|
||||
@ -101,7 +101,7 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
|
||||
}
|
||||
|
||||
ui_handle_special_keys(&ch, inp, size);
|
||||
ui_refresh();
|
||||
ui_update_screen();
|
||||
jabber_process_events();
|
||||
|
||||
ch = inp_get_char(inp, &size);
|
||||
|
@ -98,7 +98,7 @@ handle_login_account_success(char *account_name)
|
||||
log_info("%s logged in successfully", account->jid);
|
||||
ui_current_page_off();
|
||||
status_bar_print_message(account->jid);
|
||||
status_bar_refresh();
|
||||
status_bar_update_virtual();
|
||||
|
||||
account_free(account);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ _cons_show_time(void)
|
||||
{
|
||||
ProfWin *console = wins_get_console();
|
||||
win_print_time(console, '-');
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -60,7 +60,7 @@ _cons_show_word(const char * const word)
|
||||
{
|
||||
ProfWin *console = wins_get_console();
|
||||
wprintw(console->win, "%s", word);
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -77,11 +77,11 @@ _cons_debug(const char * const msg, ...)
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
va_end(arg);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
|
||||
ui_current_page_off();
|
||||
ui_refresh();
|
||||
ui_update_screen();
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ _cons_show(const char * const msg, ...)
|
||||
wprintw(console->win, "%s\n", fmt_msg->str);
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
va_end(arg);
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -115,7 +115,7 @@ _cons_show_error(const char * const msg, ...)
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
va_end(arg);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ _cons_show_typing(const char * const barejid)
|
||||
|
||||
win_vprint_line(console, '-', COLOUR_TYPING, "!! %s is typing a message...", display_usr);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ _cons_show_incoming_message(const char * const short_from, const int win_index)
|
||||
wprintw(console->win, "<< incoming from %s (%d)\n", short_from, ui_index);
|
||||
wattroff(console->win, COLOUR_INCOMING);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ _cons_about(void)
|
||||
|
||||
pnoutrefresh(console->win, 0, 0, 1, 0, rows-3, cols-1);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ _cons_check_version(gboolean not_available_msg)
|
||||
}
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
}
|
||||
@ -254,7 +254,7 @@ _cons_show_login_success(ProfAccount *account)
|
||||
wprintw(console->win, " (priority %d)",
|
||||
accounts_get_priority_for_presence_type(account->name, presence));
|
||||
wprintw(console->win, ".\n");
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ _cons_show_wins(void)
|
||||
}
|
||||
|
||||
cons_show("");
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ _cons_show_room_invites(GSList *invites)
|
||||
}
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ _cons_show_info(PContact pcontact)
|
||||
ordered_resources = g_list_next(ordered_resources);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ _cons_show_caps(const char * const contact, Resource *resource)
|
||||
}
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@ _cons_show_software_version(const char * const jid, const char * const presence
|
||||
cons_show("OS : %s", os);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -592,7 +592,7 @@ _cons_show_room_list(GSList *rooms, const char * const conference_node)
|
||||
cons_show("No chat rooms at %s", conference_node);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@ _cons_show_bookmarks(const GList *list)
|
||||
list = g_list_next(list);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -664,7 +664,7 @@ _cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
|
||||
features = g_slist_next(features);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
}
|
||||
@ -690,7 +690,7 @@ _cons_show_disco_items(GSList *items, const char * const jid)
|
||||
cons_show("");
|
||||
cons_show("No service discovery items for %s", jid);
|
||||
}
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -705,7 +705,7 @@ _cons_show_status(const char * const barejid)
|
||||
} else {
|
||||
cons_show("No such contact \"%s\" in roster.", barejid);
|
||||
}
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -742,7 +742,7 @@ _cons_show_room_invite(const char * const invitor, const char * const room,
|
||||
|
||||
free(display_from);
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -772,7 +772,7 @@ _cons_show_account_list(gchar **accounts)
|
||||
cons_show("");
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -898,7 +898,7 @@ _cons_show_account(ProfAccount *account)
|
||||
}
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1034,7 +1034,7 @@ _cons_show_ui_prefs(void)
|
||||
cons_titlebar_setting();
|
||||
cons_otrwarn_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1078,7 +1078,7 @@ _cons_show_desktop_prefs(void)
|
||||
cons_show("");
|
||||
cons_notify_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1142,7 +1142,7 @@ _cons_show_chat_prefs(void)
|
||||
cons_gone_setting();
|
||||
cons_history_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1194,7 +1194,7 @@ _cons_show_log_prefs(void)
|
||||
cons_grlog_setting();
|
||||
cons_otr_log_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1230,7 +1230,7 @@ _cons_show_presence_prefs(void)
|
||||
cons_show("");
|
||||
cons_autoaway_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1276,7 +1276,7 @@ _cons_show_connection_prefs(void)
|
||||
cons_autoping_setting();
|
||||
cons_autoconnect_setting();
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1295,7 +1295,7 @@ _cons_show_themes(GSList *themes)
|
||||
}
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1316,7 +1316,7 @@ _cons_prefs(void)
|
||||
cons_show_connection_prefs();
|
||||
cons_show("");
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1339,7 +1339,7 @@ _cons_help(void)
|
||||
cons_show("/help [command] - Detailed help on a specific command.");
|
||||
cons_show("");
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1361,7 +1361,7 @@ _cons_navigation_help(void)
|
||||
cons_show("PAGE UP, PAGE DOWN : Page the main window.");
|
||||
cons_show("");
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1377,7 +1377,7 @@ _cons_show_roster_group(const char * const group, GSList *list)
|
||||
}
|
||||
|
||||
_show_roster_contacts(list, FALSE);
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1388,7 +1388,7 @@ _cons_show_roster(GSList *list)
|
||||
cons_show("Roster:");
|
||||
|
||||
_show_roster_contacts(list, TRUE);
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
@ -1407,7 +1407,7 @@ _cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_
|
||||
if (wins_is_current(console)) {
|
||||
ui_current_page_off();
|
||||
}
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1423,7 +1423,7 @@ _cons_show_contact_offline(PContact contact, char *resource, char *status)
|
||||
if (wins_is_current(console)) {
|
||||
ui_current_page_off();
|
||||
}
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1441,7 +1441,7 @@ _cons_show_contacts(GSList *list)
|
||||
curr = g_slist_next(curr);
|
||||
}
|
||||
|
||||
wins_refresh_console();
|
||||
wins_update_virtual_console();
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
|
@ -94,15 +94,15 @@ _ui_init(void)
|
||||
display = XOpenDisplay(0);
|
||||
#endif
|
||||
ui_idle_time = g_timer_new();
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
static void
|
||||
_ui_refresh(void)
|
||||
_ui_update_screen(void)
|
||||
{
|
||||
_ui_draw_win_title();
|
||||
title_bar_refresh();
|
||||
status_bar_refresh();
|
||||
title_bar_update_virtual();
|
||||
status_bar_update_virtual();
|
||||
inp_put_back();
|
||||
doupdate();
|
||||
}
|
||||
@ -148,7 +148,7 @@ _ui_resize(const int ch, const char * const input, const int size)
|
||||
status_bar_resize();
|
||||
wins_resize_all();
|
||||
inp_win_resize(input, size);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -187,7 +187,7 @@ _ui_contact_typing(const char * const barejid)
|
||||
// have chat window but not currently in it
|
||||
} else if (!wins_is_current(window)) {
|
||||
cons_show_typing(barejid);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// in chat window with user
|
||||
} else {
|
||||
@ -195,7 +195,7 @@ _ui_contact_typing(const char * const barejid)
|
||||
|
||||
int num = wins_get_num(window);
|
||||
status_bar_active(num);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ _ui_incoming_msg(const char * const from, const char * const message,
|
||||
win_print_incoming_message(window, tv_stamp, display_from, message);
|
||||
title_bar_set_typing(FALSE);
|
||||
status_bar_active(num);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// not currently viewing chat window with sender
|
||||
} else {
|
||||
@ -301,7 +301,7 @@ _ui_incoming_msg(const char * const from, const char * const message,
|
||||
ProfWin *current = wins_get_current();
|
||||
if (!current->paged) {
|
||||
win_move_to_end(current);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ _ui_handle_recipient_not_found(const char * const recipient, const char * const
|
||||
win_print_line(win, '!', COLOUR_ERROR, msg->str);
|
||||
}
|
||||
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
g_string_free(msg, TRUE);
|
||||
}
|
||||
@ -393,7 +393,7 @@ _ui_handle_recipient_error(const char * const recipient, const char * const err_
|
||||
win_print_line(win, '!', COLOUR_ERROR, msg->str);
|
||||
}
|
||||
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
g_string_free(msg, TRUE);
|
||||
}
|
||||
@ -406,7 +406,7 @@ _ui_handle_error(const char * const err_msg)
|
||||
|
||||
cons_show_error(msg->str);
|
||||
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
g_string_free(msg, TRUE);
|
||||
}
|
||||
@ -417,7 +417,7 @@ _ui_disconnected(void)
|
||||
wins_lost_connection();
|
||||
title_bar_set_presence(CONTACT_OFFLINE);
|
||||
status_bar_clear_message();
|
||||
status_bar_refresh();
|
||||
status_bar_update_virtual();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -553,12 +553,12 @@ _ui_switch_win(const int i)
|
||||
status_bar_current(i);
|
||||
status_bar_active(i);
|
||||
}
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ui_current_refresh(void)
|
||||
_ui_current_update_virtual(void)
|
||||
{
|
||||
ui_switch_win(wins_get_current_num());
|
||||
}
|
||||
@ -585,7 +585,7 @@ _ui_next_win(void)
|
||||
status_bar_current(i);
|
||||
status_bar_active(i);
|
||||
}
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -605,7 +605,7 @@ _ui_gone_secure(const char * const recipient, gboolean trusted)
|
||||
GString *recipient_str = _get_recipient_string(window);
|
||||
title_bar_set_recipient(recipient_str->str);
|
||||
g_string_free(recipient_str, TRUE);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -623,7 +623,7 @@ _ui_gone_insecure(const char * const recipient)
|
||||
GString *recipient_str = _get_recipient_string(window);
|
||||
title_bar_set_recipient(recipient_str->str);
|
||||
g_string_free(recipient_str, TRUE);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -641,7 +641,7 @@ _ui_trust(const char * const recipient)
|
||||
GString *recipient_str = _get_recipient_string(window);
|
||||
title_bar_set_recipient(recipient_str->str);
|
||||
g_string_free(recipient_str, TRUE);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -659,7 +659,7 @@ _ui_untrust(const char * const recipient)
|
||||
GString *recipient_str = _get_recipient_string(window);
|
||||
title_bar_set_recipient(recipient_str->str);
|
||||
g_string_free(recipient_str, TRUE);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -686,7 +686,7 @@ _ui_previous_win(void)
|
||||
status_bar_current(i);
|
||||
status_bar_active(i);
|
||||
}
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -714,7 +714,7 @@ _ui_close_win(int index)
|
||||
status_bar_current(1);
|
||||
status_bar_active(1);
|
||||
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -833,7 +833,7 @@ _ui_current_print_line(const char * const msg, ...)
|
||||
win_print_line(current, '-', 0, fmt_msg->str);
|
||||
va_end(arg);
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -847,7 +847,7 @@ _ui_current_print_formatted_line(const char show_char, int attrs, const char * c
|
||||
win_print_line(current, show_char, attrs, fmt_msg->str);
|
||||
va_end(arg);
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -855,7 +855,7 @@ _ui_current_error_line(const char * const msg)
|
||||
{
|
||||
ProfWin *current = wins_get_current();
|
||||
win_print_line(current, '-', COLOUR_ERROR, msg);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -863,7 +863,7 @@ _ui_current_page_off(void)
|
||||
{
|
||||
ProfWin *current = wins_get_current();
|
||||
win_move_to_end(current);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -897,7 +897,7 @@ _ui_print_system_msg_from_recipient(const char * const from, const char *message
|
||||
|
||||
// this is the current window
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -919,7 +919,7 @@ _ui_recipient_gone(const char * const barejid)
|
||||
if (window != NULL) {
|
||||
win_vprint_line(window, '!', COLOUR_GONE, "<- %s has left the conversation.", display_usr);
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1154,7 +1154,7 @@ _ui_room_roster(const char * const room, GList *roster, const char * const prese
|
||||
}
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1169,7 +1169,7 @@ _ui_room_member_offline(const char * const room, const char * const nick)
|
||||
wattroff(window->win, COLOUR_OFFLINE);
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1185,7 +1185,7 @@ _ui_room_member_online(const char * const room, const char * const nick,
|
||||
wattroff(window->win, COLOUR_ONLINE);
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1200,7 +1200,7 @@ _ui_room_member_presence(const char * const room, const char * const nick,
|
||||
}
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1216,7 +1216,7 @@ _ui_room_member_nick_change(const char * const room,
|
||||
wattroff(window->win, COLOUR_THEM);
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1231,7 +1231,7 @@ _ui_room_nick_change(const char * const room, const char * const nick)
|
||||
wattroff(window->win, COLOUR_ME);
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1257,7 +1257,7 @@ _ui_room_history(const char * const room_jid, const char * const nick,
|
||||
}
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1297,14 +1297,14 @@ _ui_room_message(const char * const room_jid, const char * const nick,
|
||||
// currently in groupchat window
|
||||
if (wins_is_current(window)) {
|
||||
status_bar_active(num);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// not currenlty on groupchat window
|
||||
} else {
|
||||
status_bar_new(num);
|
||||
cons_show_incoming_message(nick, num);
|
||||
if (wins_get_current_num() == 0) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) {
|
||||
@ -1335,7 +1335,7 @@ _ui_room_message(const char * const room_jid, const char * const nick,
|
||||
ProfWin *current = wins_get_current();
|
||||
if (!current->paged) {
|
||||
win_move_to_end(current);
|
||||
win_refresh(current);
|
||||
win_update_virtual(current);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1354,7 +1354,7 @@ _ui_room_subject(const char * const room_jid, const char * const subject)
|
||||
// currently in groupchat window
|
||||
if (wins_is_current(window)) {
|
||||
status_bar_active(num);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// not currenlty on groupchat window
|
||||
} else {
|
||||
@ -1377,7 +1377,7 @@ _ui_room_broadcast(const char * const room_jid, const char * const message)
|
||||
// currently in groupchat window
|
||||
if (wins_is_current(window)) {
|
||||
status_bar_active(num);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// not currenlty on groupchat window
|
||||
} else {
|
||||
@ -1450,7 +1450,7 @@ _ui_ask_password(void)
|
||||
{
|
||||
char *passwd = malloc(sizeof(char) * (MAX_PASSWORD_SIZE + 1));
|
||||
status_bar_get_password();
|
||||
status_bar_refresh();
|
||||
status_bar_update_virtual();
|
||||
inp_block();
|
||||
inp_get_password(passwd);
|
||||
inp_non_block();
|
||||
@ -1471,7 +1471,7 @@ _ui_chat_win_contact_online(PContact contact, Resource *resource, GDateTime *las
|
||||
last_activity, "++", "online");
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
ui_current_page_off();
|
||||
}
|
||||
}
|
||||
@ -1491,7 +1491,7 @@ _ui_chat_win_contact_offline(PContact contact, char *resource, char *status)
|
||||
"offline");
|
||||
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
ui_current_page_off();
|
||||
}
|
||||
}
|
||||
@ -1632,7 +1632,7 @@ _win_handle_page(const wint_t * const ch)
|
||||
*page_start = y - page_space;
|
||||
|
||||
current->paged = 1;
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
} else if (mouse_event.bstate & BUTTON4_PRESSED) { // mouse wheel up
|
||||
*page_start -= 4;
|
||||
|
||||
@ -1641,7 +1641,7 @@ _win_handle_page(const wint_t * const ch)
|
||||
*page_start = 0;
|
||||
|
||||
current->paged = 1;
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1656,7 +1656,7 @@ _win_handle_page(const wint_t * const ch)
|
||||
*page_start = 0;
|
||||
|
||||
current->paged = 1;
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
|
||||
// page down
|
||||
} else if (*ch == KEY_NPAGE) {
|
||||
@ -1671,7 +1671,7 @@ _win_handle_page(const wint_t * const ch)
|
||||
*page_start = y - page_space;
|
||||
|
||||
current->paged = 1;
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
// switch off page if last line visible
|
||||
@ -1703,7 +1703,7 @@ void
|
||||
ui_init_module(void)
|
||||
{
|
||||
ui_init = _ui_init;
|
||||
ui_refresh = _ui_refresh;
|
||||
ui_update_screen = _ui_update_screen;
|
||||
ui_get_idle_time = _ui_get_idle_time;
|
||||
ui_reset_idle_time = _ui_reset_idle_time;
|
||||
ui_close = _ui_close;
|
||||
@ -1778,5 +1778,5 @@ ui_init_module(void)
|
||||
ui_handle_recipient_not_found = _ui_handle_recipient_not_found;
|
||||
ui_handle_recipient_error = _ui_handle_recipient_error;
|
||||
ui_handle_error = _ui_handle_error;
|
||||
ui_current_refresh = _ui_current_refresh;
|
||||
ui_current_update_virtual = _ui_current_update_virtual;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "ui/windows.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
|
||||
#define _inp_win_refresh() pnoutrefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1)
|
||||
#define _inp_win_update_virtual() pnoutrefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1)
|
||||
|
||||
static WINDOW *inp_win;
|
||||
static int pad_start = 0;
|
||||
@ -71,7 +71,7 @@ _create_input_window(void)
|
||||
wbkgd(inp_win, COLOUR_INPUT_TEXT);
|
||||
keypad(inp_win, TRUE);
|
||||
wmove(inp_win, 0, 0);
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -89,7 +89,7 @@ _inp_win_resize(const char * const input, const int size)
|
||||
}
|
||||
}
|
||||
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -165,7 +165,7 @@ _inp_get_char(char *input, int *size)
|
||||
|
||||
if (inp_x - pad_start > cols-3) {
|
||||
pad_start++;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
// otherwise just append
|
||||
@ -189,7 +189,7 @@ _inp_get_char(char *input, int *size)
|
||||
getmaxyx(stdscr, rows, cols);
|
||||
if (display_size - pad_start > cols-2) {
|
||||
pad_start++;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -207,7 +207,7 @@ static void
|
||||
_inp_get_password(char *passwd)
|
||||
{
|
||||
_clear_input();
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
doupdate();
|
||||
noecho();
|
||||
mvwgetnstr(inp_win, 0, 1, passwd, MAX_PASSWORD_SIZE);
|
||||
@ -219,7 +219,7 @@ _inp_get_password(char *passwd)
|
||||
static void
|
||||
_inp_put_back(void)
|
||||
{
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -240,7 +240,7 @@ _inp_win_reset(void)
|
||||
{
|
||||
_clear_input();
|
||||
pad_start = 0;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
static void
|
||||
@ -316,7 +316,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
|
||||
pad_start = 0;
|
||||
}
|
||||
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
return 1;
|
||||
|
||||
@ -358,7 +358,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
|
||||
// if gone off screen to right, jump right (half a screen worth)
|
||||
if (inp_x > pad_start + cols) {
|
||||
pad_start = pad_start + (cols / 2);
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -444,7 +444,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
|
||||
// current position off screen to left
|
||||
if (inp_x - 1 < pad_start) {
|
||||
pad_start--;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -459,7 +459,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
|
||||
// current position off screen to right
|
||||
if ((inp_x + 1 - pad_start) >= cols) {
|
||||
pad_start++;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -494,7 +494,7 @@ _handle_edit(int result, const wint_t ch, char *input, int *size)
|
||||
}
|
||||
wmove(inp_win, 0, 0);
|
||||
pad_start = 0;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
return 1;
|
||||
|
||||
case KEY_END:
|
||||
@ -562,7 +562,7 @@ _handle_backspace(int display_size, int inp_x, int *size, char *input)
|
||||
pad_start = 0;
|
||||
}
|
||||
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
}
|
||||
|
||||
@ -674,7 +674,7 @@ _handle_alt_key(char *input, int *size, int key)
|
||||
pad_start = 0;
|
||||
}
|
||||
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
|
||||
return 1;
|
||||
@ -691,7 +691,7 @@ _go_to_end(int display_size)
|
||||
wmove(inp_win, 0, display_size);
|
||||
if (display_size > cols-2) {
|
||||
pad_start = display_size - cols + 1;
|
||||
_inp_win_refresh();
|
||||
_inp_win_update_virtual();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ _create_status_bar(void)
|
||||
}
|
||||
|
||||
static void
|
||||
_status_bar_refresh(void)
|
||||
_status_bar_update_virtual(void)
|
||||
{
|
||||
GDateTime *now_time = g_date_time_new_now_local();
|
||||
GTimeSpan elapsed = g_date_time_difference(now_time, last_time);
|
||||
@ -426,7 +426,7 @@ void
|
||||
statusbar_init_module(void)
|
||||
{
|
||||
create_status_bar = _create_status_bar;
|
||||
status_bar_refresh = _status_bar_refresh;
|
||||
status_bar_update_virtual = _status_bar_update_virtual;
|
||||
status_bar_resize = _status_bar_resize;
|
||||
status_bar_set_all_inactive = _status_bar_set_all_inactive;
|
||||
status_bar_current = _status_bar_current;
|
||||
|
@ -82,7 +82,7 @@ _title_bar_resize(void)
|
||||
}
|
||||
|
||||
static void
|
||||
_title_bar_refresh(void)
|
||||
_title_bar_update_virtual(void)
|
||||
{
|
||||
if (current_recipient != NULL) {
|
||||
|
||||
@ -264,7 +264,7 @@ titlebar_init_module(void)
|
||||
create_title_bar = _create_title_bar;
|
||||
title_bar_console = _title_bar_console;
|
||||
title_bar_resize = _title_bar_resize;
|
||||
title_bar_refresh = _title_bar_refresh;
|
||||
title_bar_update_virtual = _title_bar_update_virtual;
|
||||
title_bar_set_presence = _title_bar_set_presence;
|
||||
title_bar_set_recipient = _title_bar_set_recipient;
|
||||
title_bar_set_typing = _title_bar_set_typing;
|
||||
|
@ -51,7 +51,7 @@ void titlebar_init_module(void);
|
||||
// ui startup and control
|
||||
void (*ui_init)(void);
|
||||
void (*ui_load_colours)(void);
|
||||
void (*ui_refresh)(void);
|
||||
void (*ui_update_screen)(void);
|
||||
void (*ui_close)(void);
|
||||
void (*ui_resize)(const int ch, const char * const input,
|
||||
const int size);
|
||||
@ -86,7 +86,7 @@ void (*ui_current_print_line)(const char * const msg, ...);
|
||||
void (*ui_current_print_formatted_line)(const char show_char, int attrs, const char * const msg, ...);
|
||||
void (*ui_current_error_line)(const char * const msg);
|
||||
void (*ui_current_page_off)(void);
|
||||
void (*ui_current_refresh)(void);
|
||||
void (*ui_current_update_virtual)(void);
|
||||
|
||||
win_type_t (*ui_win_type)(int index);
|
||||
char * (*ui_recipient)(int index);
|
||||
@ -153,7 +153,7 @@ void (*create_status_bar)(void);
|
||||
void (*create_input_window)(void);
|
||||
|
||||
// title bar actions
|
||||
void (*title_bar_refresh)(void);
|
||||
void (*title_bar_update_virtual)(void);
|
||||
void (*title_bar_resize)(void);
|
||||
void (*title_bar_console)(void);
|
||||
void (*title_bar_set_presence)(contact_presence_t presence);
|
||||
@ -233,7 +233,7 @@ void (*cons_show_contact_online)(PContact contact, Resource *resource, GDateTime
|
||||
void (*cons_show_contact_offline)(PContact contact, char *resource, char *status);
|
||||
|
||||
// status bar actions
|
||||
void (*status_bar_refresh)(void);
|
||||
void (*status_bar_update_virtual)(void);
|
||||
void (*status_bar_resize)(void);
|
||||
void (*status_bar_clear)(void);
|
||||
void (*status_bar_clear_message)(void);
|
||||
|
@ -106,7 +106,7 @@ win_vprint_line(ProfWin *window, const char show_char, int attrs,
|
||||
}
|
||||
|
||||
void
|
||||
win_refresh(ProfWin *window)
|
||||
win_update_virtual(ProfWin *window)
|
||||
{
|
||||
int rows, cols;
|
||||
getmaxyx(stdscr, rows, cols);
|
||||
|
@ -62,7 +62,7 @@ void win_vprint_line(ProfWin *self, const char show_char, int attrs,
|
||||
const char * const msg, ...);
|
||||
void win_print_line(ProfWin *self, const char show_char, int attrs,
|
||||
const char * const msg);
|
||||
void win_refresh(ProfWin *window);
|
||||
void win_update_virtual(ProfWin *window);
|
||||
void win_move_to_end(ProfWin *window);
|
||||
void win_print_time(ProfWin *window, char show_char);
|
||||
void win_presence_colour_on(ProfWin *window, const char * const presence);
|
||||
|
@ -197,7 +197,7 @@ wins_close_by_num(int i)
|
||||
if (i != 1) {
|
||||
if (i == current) {
|
||||
current = 1;
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
g_hash_table_remove(windows, GINT_TO_POINTER(i));
|
||||
status_bar_inactive(i);
|
||||
@ -205,10 +205,10 @@ wins_close_by_num(int i)
|
||||
}
|
||||
|
||||
void
|
||||
wins_refresh_current(void)
|
||||
wins_update_virtual_current(void)
|
||||
{
|
||||
ProfWin *window = wins_get_current();
|
||||
win_refresh(window);
|
||||
win_update_virtual(window);
|
||||
}
|
||||
|
||||
void
|
||||
@ -216,7 +216,7 @@ wins_clear_current(void)
|
||||
{
|
||||
ProfWin *window = wins_get_current();
|
||||
werase(window->win);
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -283,10 +283,10 @@ wins_resize_all(void)
|
||||
}
|
||||
|
||||
void
|
||||
wins_refresh_console(void)
|
||||
wins_update_virtual_console(void)
|
||||
{
|
||||
if (current == 0) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ wins_lost_connection(void)
|
||||
|
||||
// if current win, set current_win_dirty
|
||||
if (wins_is_current(window)) {
|
||||
wins_refresh_current();
|
||||
wins_update_virtual_current();
|
||||
}
|
||||
}
|
||||
curr = g_list_next(curr);
|
||||
|
@ -35,8 +35,8 @@ int wins_get_num(ProfWin *window);
|
||||
int wins_get_current_num(void);
|
||||
void wins_close_current(void);
|
||||
void wins_close_by_num(int i);
|
||||
void wins_refresh_current(void);
|
||||
void wins_refresh_console(void);
|
||||
void wins_update_virtual_current(void);
|
||||
void wins_update_virtual_console(void);
|
||||
void wins_clear_current(void);
|
||||
gboolean wins_is_current(ProfWin *window);
|
||||
ProfWin * wins_new(const char * const from, win_type_t type);
|
||||
|
@ -179,7 +179,7 @@ void cmd_otr_log_redact_shows_warning_when_chlog_disabled(void **state)
|
||||
void cmd_otr_warn_shows_usage_when_no_args(void **state)
|
||||
{
|
||||
mock_cons_show();
|
||||
stub_ui_current_refresh();
|
||||
stub_ui_current_update_virtual();
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
help->usage = "Some usage";
|
||||
gchar *args[] = { "warn", NULL };
|
||||
@ -195,7 +195,7 @@ void cmd_otr_warn_shows_usage_when_no_args(void **state)
|
||||
void cmd_otr_warn_shows_usage_when_invalid_arg(void **state)
|
||||
{
|
||||
mock_cons_show();
|
||||
stub_ui_current_refresh();
|
||||
stub_ui_current_update_virtual();
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
help->usage = "Some usage";
|
||||
gchar *args[] = { "warn", "badarg", NULL };
|
||||
@ -211,7 +211,7 @@ void cmd_otr_warn_shows_usage_when_invalid_arg(void **state)
|
||||
void cmd_otr_warn_on_enables_unencrypted_warning(void **state)
|
||||
{
|
||||
mock_cons_show();
|
||||
stub_ui_current_refresh();
|
||||
stub_ui_current_update_virtual();
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "warn", "on", NULL };
|
||||
|
||||
@ -230,7 +230,7 @@ void cmd_otr_warn_on_enables_unencrypted_warning(void **state)
|
||||
void cmd_otr_warn_off_disables_unencrypted_warning(void **state)
|
||||
{
|
||||
mock_cons_show();
|
||||
stub_ui_current_refresh();
|
||||
stub_ui_current_update_virtual();
|
||||
CommandHelp *help = malloc(sizeof(CommandHelp));
|
||||
gchar *args[] = { "warn", "off", NULL };
|
||||
|
||||
|
@ -133,7 +133,7 @@ void _stub_ui_handle_recipient_not_found(const char * const recipient, const cha
|
||||
}
|
||||
|
||||
static
|
||||
void _stub_ui_current_refresh(void)
|
||||
void _stub_ui_current_update_virtual(void)
|
||||
{
|
||||
}
|
||||
|
||||
@ -265,9 +265,9 @@ stub_ui_handle_recipient_error(void)
|
||||
}
|
||||
|
||||
void
|
||||
stub_ui_current_refresh(void)
|
||||
stub_ui_current_update_virtual(void)
|
||||
{
|
||||
ui_current_refresh = _stub_ui_current_refresh;
|
||||
ui_current_update_virtual = _stub_ui_current_update_virtual;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -49,7 +49,7 @@ void mock_current_win_type(win_type_t type);
|
||||
void mock_ui_current_recipient(void);
|
||||
void ui_current_recipient_returns(char *jid);
|
||||
|
||||
void stub_ui_current_refresh(void);
|
||||
void stub_ui_current_update_virtual(void);
|
||||
|
||||
void mock_ui_current_print_formatted_line(void);
|
||||
void ui_current_print_formatted_line_expect(char show_char, int attrs, char *message);
|
||||
|
Loading…
Reference in New Issue
Block a user